summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal
Commit message (Collapse)AuthorAge
* Remove src/libsystemd-terminalAndy Wingo2015-04-19
|
* terminal/sysview: introduce SETTLE eventsDavid Herrmann2015-03-11
| | | | | | | | | | | | | | | | | | This introduces a new SYSVIEW_EVENT_SETTLE notification that is sent after initial scanning via sysview is done. This is very handy to let the application raise warnings in case requested resources are not found during startup. The SETTLE event is sent after systemd-logind and udev enumerations are done. This event does in no way guarantee that a given resource is available. All it does is notify the application that scanning is done! You must not react to SETTLE if you don't have external synchronization with the resource you're waiting for. The main use-case for SETTLE is to run applications _inside_ of logind sessions and startup sysview. You really want to make sure that the own session you're running in was found during enumeration. If not, something is seriously wrong.
* libsystemd-terminal: use at most LOG_ERR for XKB errorsZbigniew Jędrzejewski-Szmek2015-03-07
| | | | | | | XKB errors aren't *that* important. Coverity complained that the same action is taken in multiple branches, which is semi-valid, so is fixed too (CID #1256582).
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* Add a snprinf wrapper which checks that the buffer was big enoughZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | | | | If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
* build-sys: unbundle unifontZbigniew Jędrzejewski-Szmek2015-01-26
| | | | | | | We should prefer the unifont.hex file from the system, instead of our own. Upstream has made a few releases since our version was included, and we should follow upstream changes. But adding 2.6MB to our source repo every time upstream releases is not nice.
* Revert commit f131770b "tree-wide: spelling fixes"David Herrmann2014-12-31
| | | | | | | | | | | | | | | | | | This partially reverts: commit f131770b1465fbf423881f16ba85523a05f846fe Author: Veres Lajos <vlajos@gmail.com> Date: Mon Dec 29 09:45:58 2014 +0000 tree-wide: spelling fixes The commit in question changed a binary file. I didn't look at the diff in particular, so I have no idea what exactly was changed. However, the file is generated and it looked highly suspiciuous. Therefore, I reverted that part. Note that this is generated by "make update-unifont" so really no reason to touch at all.
* tree-wide: spelling fixesVeres Lajos2014-12-30
| | | | | | | https://github.com/vlajos/misspell_fixer https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa Thanks to Torstein Husebo <torstein@huseboe.net>.
* shared: utf8 - support ucs4 -> utf8Tom Gundersen2014-12-22
| | | | | Originally we only supported ucs2, so move the ucs4 version from libsystemd-terminal to shared and use that everywhere.
* tree-wide: use our memset() macros instead of memset() itselfLennart Poettering2014-12-11
|
* treewide: correct spacing near eol in code commentsTorstein Husebø2014-12-11
|
* treewide: sanitize loop_writeZbigniew Jędrzejewski-Szmek2014-12-09
| | | | | | | loop_write() didn't follow the usual systemd rules and returned status partially in errno and required extensive checks from callers. Some of the callers dealt with this properly, but many did not, treating partial writes as successful. Simplify things by conforming to usual rules.
* terminal/screen: fix GL/GR double-mappingDavid Herrmann2014-11-30
| | | | | We must not call screen_map() multiple times for the same input char. Fix the double-mapping for GL/GR maps are correctly applied.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* treewide: simplify log_*_errno(r,...) immediately followed by "return r"Michal Schmidt2014-11-28
|
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* fix build with --enable-terminalThomas Hindoe Paaboel Andersen2014-11-27
| | | | Broke with 086891e5c119abb9854237fc32e736fe2d67234c
* log: rearrange log function namingLennart Poettering2014-11-27
| | | | | | | | | | - Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
* terminal/idev: forward xkb-messagesDavid Herrmann2014-11-25
| | | | | | | Properly forward all XKB messages. You can use XKB_LOG_VERBOSITY= to control the amount of messages sent by XKB. We explicitly set XKB_LOG_LEVEL to 7 you can use SYSTEMD_LOG_LEVEL to control the log-level generically.
* terminal/idev: avoid magic numbersDavid Herrmann2014-11-25
| | | | Use XKB_CONTEXT_NO_FLAGS instead of magic 0.
* terminal/idev: use compose tablesDavid Herrmann2014-11-24
| | | | | | | | | | | | | | | | | | Before forwarding keyboard events, feed them into possible compose tables. This enables Compose-key and Dead-key features. Few notes: * REPEAT events are never fed into compose tables. It just doesn't make sense and is usually not wanted. Compose-sequences are usually hard to remember and take time to type. Thus, the REPEAT event of the Compose-key itself would often cancel the compose sequence already. * Stop resolving symbols for UP events. Anything but keycodes is never associated to a physical key, but is a one-time action. There is nothing like UP events for key-symbols! * Cancel compose-sequences on Multi-Key UP. See the inline comment. We should make this configurable!
* terminal/idev: add compose-file supportDavid Herrmann2014-11-24
| | | | | | | | Add support for compose files to idev-keyboard. This requires libxkbcommon-0.5.0, which is pretty new, but should be fine. We don't use the compose-files, yet. Further commits will put life into them.
* util: introduce negative_errno()David Herrmann2014-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Imagine a constructor like this: int object_new(void **out) { void *my_object; int r; ... r = ioctl(...); if (r < 0) return -errno; ... *out = my_object; return 0; } We have a lot of those in systemd. If you now call those, gcc might inline the call and optimize it. However, gcc cannot know that "errno" is negative if "r" is. Therefore, a caller like this will produce warnings: r = object_new(&obj); if (r < 0) return r; obj->xyz = "foobar"; In case the ioctl in the constructor fails, gcc might assume "errno" is 0 and thus the error-handling is not triggered. Therefore, "obj" is uninitialized, but accessed. Gcc will warn about that. The new negative_errno() helper can be used to mitigate those warnings. The helper is guaranteed to return a negative integer. Furthermore, it spills out runtime warnings if "errno" is non-negative. Instead of returning "-errno", you can use: return negative_errno(); gcc will no longer assume that this can return >=0, thus, it will not warn about it. Use this new helper in libsystemd-terminal to fix some grdev-drm warnings.
* util: unify how we see srand()Lennart Poettering2014-10-30
|
* terminal: log unsupported ANSI or DEC mode changesTom Gundersen2014-10-16
|
* terminal: split ANSI from DEC mode changesTom Gundersen2014-10-16
|
* terminal/grdrm: force deep modeset on enterDavid Herrmann2014-10-11
| | | | | | | | | | | | | Usually, when our session is activated (or re-configurated) we should be able to try a page-flip to our buffer. The kernel driver should reject it if it is incompatible. As it turns out, drivers don't do this. Therefore, we now force a deep modeset if we're not sure what mode is set. This has the side-effect that we might get glitches on session-switches (depending on driver behavior). However, there's no way around this and it is what everyone does so far. Most drivers still detect if we keep the mode and so don't touch the clocks. Therefore, we just get a regular async flip.
* terminal: remove an unused initializationThomas Hindoe Paaboel Andersen2014-10-05
|
* terminal/idev: don't remove consumed-mods from kbd-matchesDavid Herrmann2014-10-05
| | | | | | | | | | | XKB consumed mods include modifiers that *didn't* affect the translation, but might affect it if used. This is very misleading, given that we are usually not interested in that information. Therefore, keep them in real mods to behave like X11 does. Maybe at some point, XKB introduces proper shortcut matching... Also make evcat display consumed modifiers so we can better debug those situations.
* terminal/screen: perform bold->light conversion only on foregroundDavid Herrmann2014-10-05
| | | | | Bold glyphs always use light colors. However, this color conversion is limited to the foreground color, so skip it for backgrounds.
* terminal/subterm: leave bold-light conversion to parentDavid Herrmann2014-10-05
| | | | | | We rely on the parent terminal to do color conversion, so also leave bold->light conversion to the parent. Otherwise, it will be performed twice and we might apply it on the wrong color.
* terminal/screen: add support for alternate screen buffersTom Gundersen2014-10-05
| | | | | | | Hook up SM/RM 47/1047-1049 and enable alternate screen buffers for term applications. (David: rebased on top of -git, renamed helpers and added docs)
* terminal/screen: save state in separate objectDavid Herrmann2014-10-05
| | | | | | | Terminal state can be saved/restored by applications. To simplify our internal handling, put all affected state into a separate object. Especially with alternate screen buffers, this will simplify our code significantly.
* terminal/subterm: skip setting parent's cursorDavid Herrmann2014-10-05
| | | | | | We draw our own cursor in subterm now, so there's no reason to update the cursor-position of the parent terminal on each frame. The parent's cursor is hidden, anyway.
* terminal: fix TERM_FLAG_* commentDavid Herrmann2014-10-05
| | | | 7BIT mode is enabled by default. Fix the comment to state this correctly.
* terminal: fix restoring of screen flagsTom Gundersen2014-10-05
|
* terminal/screen: adjust screen age only on updateDavid Herrmann2014-10-03
| | | | | | | Instead of increasing the screen-age on redraw, we now increase it only on real updates. This is effectively the same, but avoids increased age counters on backbuffer rendering. Therefore, we can now check age counters against fronbuffers safely, while rendering frames in background.
* terminal/screen: add color converterDavid Herrmann2014-10-03
| | | | | | | | | | Terminals use pseudo color-codes mixed with 8bit and 24bit colors. Provide a color-converter so external renderers only have to deal with ARGB32 colors. This requires a color-palette as input as there's no fixed mapping. We provide a default, but maybe we wanna support external palettes in the future.
* terminal/screen: add cursor renderingDavid Herrmann2014-10-03
| | | | | | | | | This is the most simple way to render cursors: flip attr->inverse of the cursor cell. This causes the background and foreground colors of the cursor-cell to be inversed. Now that we render cursors ourselves, make subterm not call into the parent terminal to render cursors.
* terminal/screen: mark cursor dirty on enabled/disableDavid Herrmann2014-10-03
| | | | | | If we hide or show the cursor, we change visual attributes and have to mark the underlying cell as dirty. Otherwise, the terminal will not be redrawn.
* terminal/idev: add helper to match keyboard shortcutsDavid Herrmann2014-10-03
| | | | | | | | | | | Matching keyboard shortcuts on internationalized keyboards is actually non-trivial. Matching the actual key is easy, but the modifiers can be used by both, the matching and the translation step. Therefore, XKB exports "consumed-modifiers" that we use to figure out whether a modifier was already used by the translation step. The new IDEV_KBDMATCH() helper can be used to match on any keyboard shortcut and it will do the right thing.
* terminal/screen: add keyboard mappingDavid Herrmann2014-10-03
| | | | | | | | Implement the feed_keyboard() handling by mapping XKB keys according to DEC-VT behavior. Public information on terminal key-mappings is pretty scarce. We only implement the most basic mapping for now. Further improvements welcome!
* terminal/idev: don't map XKB_KEY_NoSymbol as ASCII 0David Herrmann2014-10-03
| | | | | XKB_KEY_NoSymbol is defined as 0 but does not correspond to a VT key with ASCII value 0. No such key exists, so don't try to find such a key.
* terminal/unifont: add built-in fallback glyphDavid Herrmann2014-10-03
| | | | | | | In case we cannot render a glyph, we want a fallback we can display instead. If we rely on the font itself to provide the fallback character, we have nothing to display if that character is not available. Therefore, add a static fallback that we can use at any time.
* terminal/subterm: use screen rendererDavid Herrmann2014-10-03
| | | | | Don't hard-code the screen renderer but use the newly introduced term_screen_draw() helper.