summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-04-24gtktsm: add libtsm exampleHEADmasterDavid Herrmann10-0/+2627
GtkTsmTerminal is a Gtk+-3.0 widget using libtsm. It provides a generic terminal-widget that can be easily used to create any kinds of terminal-emulators. The GtkTsm program is a small example that shows how to use GtkTsm. Note that all this is optional and only meant as example. Maybe at some point we will install GtkTsmTerminal as shared object. However, it will never be mandatory! Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-24Update libtsm wiki-linkDavid Herrmann2-2/+2
We moved libtsm in the fdo-wiki so it's no longer a sub-kmscon project. Update the links to reflect that. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-24shared: add macro, pty and ring helpersDavid Herrmann6-1/+1108
Few more shl helpers that we later need for TSM examples. Note that --gc-sections strips them from normal libtsm builds. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-24screen: improve aging for sb-resetDavid Herrmann1-1/+1
If the sb is already NULL, there's no need to increase the age of the screen. This avoids redrawing the terminal on each keystroke as terminals usually have to reset sbs then. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-02build: move shl_xy to shl-xyDavid Herrmann11-12/+12
Same move as with the other TSM files. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-04-01Restructure source treeDavid Herrmann19-38/+57
Some simple code-moves: shl => src/shared/ tsm => src/tsm/ ..and also move the ./docs/ files into the source tree. This will make the tree much easier to grasp once we add more tools like gtktsm. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-03-27build: support darwin targetsFlorian Gilcher2-2/+38
Mac OS X now uses the llvm linker, so our --gc-sections logic is not supported. Furthermore, linker-scripts aren't supported either. Add GNU-ld and Darwin detection and drop any GNU-ld specific options if not supported. Dropping --gc-sections and its related options is fine. We will produce bigger binaries, but that's just what you get if you don't support that. On Darwin we try the -dead_stip options instead. They should work sufficiently well. Regarding version-scripts, we still set visibility=hidden by default and require compilers to support __attribute__((__visibility__("public"))). So symbols are correctly exported, but version-information will be lost. Again, that's an issue of the target architecture and we don't care whether they lack useful features. (extended commit-msg and reorder am-conditionals) Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12screen: move renderer to separate fileDavid Herrmann4-156/+201
Move the screen rendering helpers into a separate file. They keep getting bigger and are totally separate from screen manipulation. Thus, keep it separate so we can easily simplify it later. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12screen: extract selection codeDavid Herrmann3-322/+358
The screen-selection code is horrible and just hacked together. It works and seems to have no bugs, but we definitely need to rework it. Lets move it into a separate file to make it mostly independent of the core screen code. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12screen: rename inc_age to screen_inc_ageDavid Herrmann2-47/+47
Make inc_age shared and rename it to screen_inc_age so it's obvious where it actually belongs to. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12screen: move struct-defs to shared headerDavid Herrmann2-71/+76
The screen-source gets quite huge. Lets move the struct-defs to a shared header so we can extract the selection and render code. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12Revert "screen: remove empty cell fallback"David Herrmann1-2/+8
This reverts: commit 68e64ecf6d4a0b5d959962d875a97694b6abc23a Author: David Herrmann <dh.herrmann@gmail.com> Date: Tue Oct 22 15:53:31 2013 +0200 screen: remove empty cell fallback Our assumption was actually not true. If we render scrollback-buffer lines, we cannot assume that they are long enough. So add the dummy cell again and use it if a cell is not reachable. Note that we're safe removing the cursor-fallback, though (which was done in a follow up). Scroll-back buffers never contain the cursor so we're fine. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12build: add symbol testsDavid Herrmann4-1/+97
Add some minor tests for symbol tables. Also build libtsm twice, once as static library so we can access internal symbols from within the tests. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12shl: update llogDavid Herrmann3-20/+45
Some minor changes and cleanups to shl_llog. Mostly cosmetic changes. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12build: add automated memleak testsDavid Herrmann3-1/+86
We now use valgrind to perform automated mem-leak tests on selected test-programs. We also add a separate test_valgrind program which is used to verify that the memcheck actually works. We don't run these tests as part of the normal test-suite, however, we require them for distcheck. Thus, you can avoid using valgrind if you're not about to do dist-releases. Every developer should have it installed, anyway, so it's fine. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-12vte: add tsm_vte_get_def_attr() helperDavid Herrmann3-0/+11
This helper returns the current default attribute of the VTE object. Compared to the def-attr of the screen it's immutable by the pty. It should be used to draw borders and/or padding of your terminal or to initialize the cells. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-31build: fix links in configure.acDavid Herrmann1-2/+2
Fix library links from github to fdo. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: increase package version to 3libtsm-3David Herrmann1-1/+1
Same as for library/symbol version, we set the package version to 3 to avoid any conflicts with earlier embedded libtsm releases. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29README: fix linksDavid Herrmann1-7/+5
Fix links to point to the fdo wiki and dirs. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: increase version to 3David Herrmann2-4/+11
We used to provide libtsm as part of kmscon. To avoid any compatibility problems, increase the library version to 3 (same for symbol versions). This way, old libtsm libraries will not be linked to by new programs. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: remove -fstack-protectorDavid Herrmann1-2/+1
-fstack-protector should be set by the build-environment, not by each project. It may fail in subtle ways if the toolchain doesn't support it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: add LICENSE_htable to EXTRA_DISTDavid Herrmann1-0/+1
We need to ship the additional license file with tarballs. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29gitignore: add config.h.in~David Herrmann1-0/+1
Add temp config.h.in files. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29Remove old compatibility headersDavid Herrmann4-107/+1
We don't need tsm_*.h as installed headers. Remove them. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: minor style cleanups in configure.acDavid Herrmann2-14/+21
Some minor modifications, typo-fixes and comment additions for configure.ac. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-29build: make autogen.sh comply to gnome-build rulesDavid Herrmann1-3/+12
Fix some minor autogen.sh features so we comply to common build-chain rules. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: skip ageing on cursor move if hiddenDavid Herrmann1-0/+11
If the cursor is hidden we don't need to increase the age. We already do this whenever the HIDE_CURSOR flag is changed. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: implement proper ageing on screen resizeDavid Herrmann1-6/+4
Screen-resize doesn't actually move any cells so it's fairly easy to age new cells. No need to redraw the whole buffer. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: clear existing cells when shrinkingDavid Herrmann1-4/+7
Clear parts of the existing screen if it is about to get hidden. Otherwise, it might reach the scrollback later when it is no longer part of the line it was during resize. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: implement proper ageing for tsm_screen_write()David Herrmann1-15/+13
tsm_screen_write() is fairly simple so we can easily implement proper ageing support. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: remove old cursor-drawing fallbackDavid Herrmann1-17/+3
We used to not guarantee that all cells are allocated. Hence, we had to correctly draw the cursor if they weren't. These days we have this guarantee, though. So remove the old fallbacks. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: implement trivial ageingDavid Herrmann1-31/+226
To fully support the new ageing API, we now implement trivial ageing. On each modification, we simply increase the screen-age (which overwrites any line or cell age). This basically invalidates the whole screen on each change, but at least makes the ageing API work. Note that for cursor movements we actually age only both changed cells. Same for flag-changes. But these are the only non-trivial ageing implementations so far. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Remove old hashtable and replace testsDavid Herrmann8-756/+322
shl_hashtable is no longer used. Remove it and replace the tests with shl_htable tests. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23unicode: use new faster htableDavid Herrmann5-23/+1192
Replace the old shl_hashtable with shl_htable, which avoids the additional allocations and is considerably faster. The underlying hash-table is still the same, but our boilerplate code is reduced heavily. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23unicode: simplify hash_ucs4 and cmp_ucs4David Herrmann1-12/+2
Both are overly complex. Remove the boilerplate and redundant code. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23unicode: remove the default symbol tableDavid Herrmann1-32/+3
We don't use the default table, anymore. Remove it so no-one else will ever have the stupid idea to use it again. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: allocate private symbol tableDavid Herrmann1-2/+9
We shouldn't use the global symbol table. It's not thread-safe. Allocate a new one for private use in tsm_screen. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Remove internal symbols from public APIDavid Herrmann6-99/+65
These symbols have been used by kmscon once internally. We copied them over during libtsm extraction. Remove them now so no-one else uses them. They're for internal use only! Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Move shl_misc.h into libtsm_int.hDavid Herrmann6-16/+10
Add a single internal header for all our shared but private code. Remove now unused shl_misc.h. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23shl: move next_pow2() into shl_arrayDavid Herrmann2-16/+17
We use next_pow2() only in the shl_array implementation, so move it. We want shl APIs to be self-contained so this removes the array->misc dependency. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23Sanitize headerDavid Herrmann1-11/+92
Add C++ protection and proper docbook comments so we can later hook it up. No huge documentation, but at least some proper grouping is added. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: add screen-age to APIDavid Herrmann2-7/+50
This adds the "ageing"-concept to the screen API. Each cell now has an integer attached which describes its age. Furthermore, the whole screen has an age-counter which is increased on every change we do on the screen. Whenever we modify a cell, we increase the age-counter and set the age of the cell to the current value of the age-counter. During rendering, we pass the age of the cell to the cell-renderer. Furthermore, once rendering is done, we return the current screen age. This allows renderers to save the age of the screen with a framebuffer. Once a specific framebuffer is redrawn, only cells with a newer age need to be updated. Everything else can be skipped. By saving the age with the framebuffer, this even allows multi-buffered applications to make use of this (also see the EGL buffer-age ext for a similar feature). Note that the age-counter might overflow. We return 0 in that case (which is an invalid age). Applications need to reset *all* their framebuffer ages if that happens. Note that non-ageing-aware applications can simply ignore the new feature (apart from changing the draw-cb) and it'll work as before. This does _not_ implement the real ageing feature. It only adds the API. We currently always return 1 as age, which is wrong.. We need to fix the whole code to increase ages correctly, which can get quite tricky if we want the scrollback-buffer to work, too. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-23screen: reset buffer-link on screen-resetDavid Herrmann1-0/+1
We need to reset the lines-link to main_lines during reset, otherwise the alternate buffer stays active (which is not what we want). Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: minor coding style fixesDavid Herrmann1-13/+22
Fix some coding-style issues and minor logical redudancy. Also improve the file-documentation to correctly describe what tsm_screen does today. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: clear padding of main-lines on resizeDavid Herrmann1-2/+4
The invisible padding during width reduction is not cleared as we clear it when it gets visible again. However, if the line is pushed into scrollback in between, it may get visible once the width is increases again. Hence, clear padding of main-lines if screen-width is decreased. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: remove empty cell fallbackDavid Herrmann1-7/+1
If we resize our screen, we guarantee that all cells are allocated. This hasn't been true in the early times so we needed an empty cell during rendering as fallback. It's no longer needed so remove it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: remove prepare/render callbacksDavid Herrmann2-33/+3
Again, some leftovers from kmscon. There's no reason to provide these callbacks. Users can just call the, before/after calling into TSM. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22build: remove shl_timer.hDavid Herrmann2-131/+0
This helper is now unused, remove it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: remove timerDavid Herrmann2-42/+2
This is still a leftover from kmscon. Remove it, if users want it, they should implement it themselves. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-10-22screen: correctly clear expansion areaDavid Herrmann1-13/+9
We incorrectly clear the alternate-screen and width-extensions. Fix this. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>