summaryrefslogtreecommitdiff
path: root/src/context.h
Commit message (Collapse)AuthorAgeFilesLines
* context: add XKB_CONTEXT_NO_SECURE_GETENV flag (#312)Ronan Pigott2022-12-161-0/+4
| | | | | | | | | This flag is useful for clients that may have relatively benign capabilities set, like CAP_SYS_NICE, that also want to use the xkb configuration from the environment and user configs in XDG_CONFIG_HOME. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/308 Fixes: https://github.com/xkbcommon/libxkbcommon/issues/129 Signed-off-by: Ran Benita <ran@unusedvar.com>
* x11: cache X11 atomsRan Benita2020-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | On every keymap notify event, the keymap should be refreshed, which fetches the required X11 atoms. A big keymap might have a few hundred of atoms. A profile by a user has shown this *might* be slow when some intensive amount of keymap activity is occurring. It might also be slow on a remote X server. While I'm not really sure this is the actual bottleneck, caching the atoms is easy enough and only needs a couple kb of memory, so do that. On the added bench-x11: Before: retrieved 2500 keymaps from X in 11.233237s After : retrieved 2500 keymaps from X in 1.592339s Signed-off-by: Ran Benita <ran@unusedvar.com>
* Add /etc/xkb as extra lookup path for system data filesPeter Hutterer2020-08-301-0/+3
| | | | | | | | | | | | | | | This completes the usual triplet of configuration locations available for most processes: - vendor-provided data files in /usr/share/X11/xkb - system-specific data files in /etc/xkb - user-specific data files in $XDG_CONFIG_HOME/xkb The default lookup order user, system, vendor, just like everything else that uses these conventions. For include directives in rules files, the '%E' resolves to that path. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* context: add a helper function to return the default system include pathPeter Hutterer2019-12-241-0/+3
| | | | | | | No functional changes but we'll need that same lookup in the rules file include handling in a future patch. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* context: add xkb_context_sanitize_rule_names()Ran Benita2014-02-101-14/+3
| | | | | | | We want all the default logic in a test, so encapsulate it in this function, and make all the get_default_* functions static. Signed-off-by: Ran Benita <ran234@gmail.com>
* context: split private functions to context-priv.cRan Benita2014-01-131-0/+24
| | | | | | (Same as keymap-priv.c). Signed-off-by: Ran Benita <ran234@gmail.com>
* context: remove mostly useless log wrappersRan Benita2014-01-121-18/+8
| | | | | | Just use xkb_log directly. Signed-off-by: Ran Benita <ran234@gmail.com>
* atom: drop {xkb_,}atom_strdupRan Benita2013-12-021-3/+0
| | | | | | | Even though in 112cccb18ad1bc877b3c4a87fa536ea085c761b5 I said it might be useful, it's not. So remove it. Signed-off-by: Ran Benita <ran234@gmail.com>
* ctx: adapt to the len-aware atom functionsRan Benita2013-07-211-3/+6
| | | | | | | | | xkb_atom_intern now takes a len parameter. Turns out though that almost all of our xkb_atom_intern calls are called on string literals, the length of which we know statically. So we add a macro to micro-optimize this case. Signed-off-by: Ran Benita <ran234@gmail.com>
* Add environment overrides for default RMLVODaniel Stone2013-03-191-0/+15
| | | | | | | You can now set default values in the environment, as well as a context option to ignore the environment, e.g. for tests. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Remove file_id entirelyRan Benita2013-03-181-3/+0
| | | | | | It is not used anymore. Signed-off-by: Ran Benita <ran234@gmail.com>
* keymap: abstract a bit over the keymap formatRan Benita2013-03-181-0/+10
| | | | | | | | | | | | | | | | | | | | Make it a bit easier to experiment with other formats. Add a struct xkb_keymap_format_operations, which currently contains the keymap compilation and _get_as_string functions. Each format can implement whatever it wants from these. The current public entry points become wrappers which do some error reporting, allocation etc., and calling to the specific format. The wrappers are all moved to src/keymap.c, so there are no XKB_EXPORT's under src/xkbcomp/ anymore. The only format available now is normal text_v1. This is all not very KISS, and adds some indirection, but it is helpful and somewhat cleaner. Signed-off-by: Ran Benita <ran234@gmail.com>
* Contextualize GetBuffer()Ran Benita2012-10-181-0/+3
| | | | | | | Instead storing the buffer in a non-thread-safe static array, we move it to the context. Signed-off-by: Ran Benita <ran234@gmail.com>
* API: add _context prefix to log-related functionsRan Benita2012-09-241-2/+2
| | | | | | | | | This is to follow the general scheme set by all of the other API functions. Since no one is using these functions yet, we don't (actually better not) add the old names to xkbcommon-compat.h. Signed-off-by: Ran Benita <ran234@gmail.com>
* Organize src/ and test/ headersRan Benita2012-09-161-0/+99
- Add context.h and move context-related functions from xkb-priv.h to it. - Move xkb_context definition back to context.c. - Add keysym.h and move keysym upper/lower/keypad from xkb-priv.h to it. - Rename xkb-priv.h to map.h since it only contains keymap-related definitions and declarations now. - Remove unnecessary includes and some and some other small cleanups. Signed-off-by: Ran Benita <ran234@gmail.com>