summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2023-12-22Add a new API to set key repeatJengHyun Kang1-0/+4
Change-Id: If1644c4c6575b4eb7cadb8c1e11147651013d8ef
2023-10-06Keysyms: Fix missing hpYdiaeresisPierre Le Marre1-0/+1
The handling of keysym name guards (e.g. `#ifndef XK_Ydiaeresis`) was incomplete and led to a missing keysym. Make `sripts/makeheader` more robust to C macros handling.
2023-09-28Keysyms: Update using latest xorgprotoPierre Le Marre1-856/+889
xorgproto commit: 1c8128d72df22843a2022576850bc5ab5e3a46ea.
2023-09-26Compose: add iterator APIRan Benita1-0/+137
Allow users to iterate the entries in a compose table. This is useful for other projects which want programmable access to the sequences, without having to write their own parser. - New API: - `xkb_compose_table_entry_sequence`; - `xkb_compose_table_entry_keysym`; - `xkb_compose_table_entry_utf8`; - `xkb_compose_table_iterator_new`; - `xkb_compose_table_iterator_free`; - `xkb_compose_table_iterator_next`. - Add tests in `test/compose.c`. - Add benchmark for compose traversal. - `tools/compose.c`: - Print entries instead of just validating them. - Add `--file` option. - TODO: make this tool part of the xkbcli commands. Co-authored-by: Pierre Le Marre <dev@wismill.eu> Co-authored-by: Ran Benita <ran@unusedvar.com> Signed-off-by: Ran Benita <ran@unusedvar.com>
2023-07-14Improve the documentation of keysyms in xkbcommon.hPierre Le Marre1-14/+23
2023-07-14Add XKB_KEYSYM_MIN and XKB_KEYSYM_MAXPierre Le Marre1-0/+9
Keysyms are 32-bit integers with the 3 most significant bits always set to zero. See: Appendix A “KEYSYM Encoding” of the X Window System Protocol at https://www.x.org/releases/current/doc/xproto/x11protocol.html#keysym_encoding. Add a new constants XKB_KEYSYM_MIN and XKB_KEYSYM_MAX to make the interval of valid keysyms more obvious in the code.
2023-04-30Improve the doc of the XKB keymap text format, V1 (#321)Wismill1-0/+5
- Add table of contents - Add terminology section - (WIP) Add Introduction to the format - Improve the keycode section - Improve the interpret section - Add guide to create and use modifiers - (WIP) Add actions documentation - Add cross-references - Add keysyms header to documentation
2023-04-12keysyms: add new keysyms XF86EmojiPicker, XF86DictateRan Benita1-0/+2
Ref: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/commit/914d8f5e0f469cd0416364dd008e9eea752bf703 Ref: https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/commit/a839f0c7fc5596d10e786394d3b0953eb8a1731b Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-17doc: clarify "server state" and "client state" distinctionRan Benita1-21/+42
Add a common page for the concept and link to there from the relevant functions. Signed-off-by: Ran Benita <ran@unusedvar.com>
2022-12-16context: add XKB_CONTEXT_NO_SECURE_GETENV flag (#312)Ronan Pigott2-1/+16
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>
2022-02-24Improve misleading comments #270Mladen Milinkovic1-1/+2
2021-05-22xkbcommon: deprecate XK_approxeq and XK_notapproxeqRan Benita1-2/+2
Sync xorg-proto commit https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/commit/25f3278b85ec7d1c78bb150eaea52f9c98294ea4 Fixes: #82 Signed-off-by: Ran Benita <ran@unusedvar.com>
2021-04-27Move include files to include/ subdirectoryRan Benita7-0/+6871
This way we don't specify `include_directorories('.')` which brings in more than needed. Signed-off-by: Ran Benita <ran@unusedvar.com>
2012-07-23build: drop the include/ directoryRan Benita3-3651/+0
The include/ dir is somewhat redundant and makes it just a bit harder to handle the -I directives from out side of automake; without it the default $(top_buildir) just works. Here's also some further justifications I found: http://smcv.pseudorandom.co.uk/2008/09/pc-uninstalled/ Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-17Run source tree through uncrustifyDaniel Stone1-68/+65
.uncrustify.cfg committed for future reference also, but had to manually fix up a few things: it really likes justifying struct initialisers. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-12Enlarge keysym name buffers and mention in commentRan Benita1-1/+3
The longest keysym is 27 chars long. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-22Add xkb_key_repeatsDaniel Stone1-0/+6
Does what it says on the box. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-09Move XKB_KEY_NoSymbol to xkbcommon-keysyms.hRan Benita2-2/+1
This avoids a couple of special cases in the code, and is more consistent. Since anyone who includes xkbcommon.h also gets xkbcommon-keysyms.h, and anyone who include xkbcommon-keysyms.h would want NoSymbol anyway, there's no down side. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-08Add API for getting unicode representation of a keysymRob Bradford1-0/+19
This code uses a table and code derived from http://www.cl.cam.ac.uk/~mgk25/ucs/keysym2ucs.c The added API calls are: xkb_keysym_to_utf32 xkb_keysym_to_utf8 [daniels: Changed API to be more in line with keysym_get_name, added test, changed formatting to 4-space.]
2012-05-29Add xkb_map_get_as_stringDaniel Stone1-0/+7
Returns a newly-allocated string representing the specified keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-18Change xkb_map_new_from_fd to use FILE*Ran Benita1-3/+4
i.e. xkb_map_new_from_file. The reason is that flex only works with FILE's, so we must use fdopen on the file descriptor; but to avoid a memory leak, we must also fclose() it, which, in turn, closes the file descriptor itself. Either way is not acceptable, so we can either: * dup() the fd and use fdopen on that, or * have the user call fdopen on his own, and accept a FILE* instead of an fd. The second one seems better, and is standard C, so why not. We must add stdio.h to xkbcommon.h though, which is regrettable, but not a big deal. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-11Rename 'ctx' back to 'context' in external APIDaniel Stone1-19/+19
Still keep things as 'ctx' internally so we don't have to worry about typing it too often, but rename the user-visible API back as it was kinda ugly. This partially reverts e7bb1e5f. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Document that xkb_state_get_map doesn't take a refDaniel Stone1-1/+3
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Change xkb_key_get_syms to just return a bare intDaniel Stone1-1/+1
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Move KcCGST API to internal-onlyDaniel Stone1-46/+0
And don't export it. We don't need it for X11 support, let alone anything else. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Rename serialise to serializeDaniel Stone1-8/+8
Yes, British English is correct, but unfortunately we've lost that battle. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Add common LED names to xkbcommon-names.hDaniel Stone1-0/+4
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Include xkbcommon-names.h from xkbcommon.hDaniel Stone1-0/+1
So clients only have one file to include. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Remove keycode_range_is_legalDaniel Stone1-6/+1
It was a pretty pointless check. Also sanitise the _x11 variant to actually do what it says on the box. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Merge remote-tracking branch 'krh/keysyms'Daniel Stone2-2/+2998
Conflicts: src/keysym.c src/misc.c src/text.h src/xkbcomp/expr.c src/xkbcomp/parser.y src/xkbcomp/parseutils.c src/xkbcomp/symbols.c Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Use our own keysymsKristian Høgsberg1-2/+2
2012-05-09Add XKB version of X11 keysymsKristian Høgsberg2-0/+2996
With this we're now completely standalone. add vendor keysyms
2012-05-09Shorten context to ctxRan Benita1-19/+19
(This breaks the API.) "context" is really annoying to type all the time (and we're going to type it a lot more :). "ctx" is clear, concise and common in many other libraries. Use it! Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fix for xkb -> keymap change.]
2012-05-09Change all 'xkb' xkb_keymap names to 'keymap'Daniel Stone1-13/+13
To make it a bit more clear what it actually is. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Rename keysym <-> string APIDaniel Stone1-4/+4
Change them to refer to the string representation of the keysym's name as a name rather than a string, since we want to add API to get the Unicode printable representation as well. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09Add multiple modifier state matching APIDaniel Stone1-1/+41
Two new calls allow users to test the exact modifier state, including verifying that no other modifiers but the ones you wanted are down. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08Add pre-defined names databaseDaniel Stone1-0/+35
xkbcommon-names.h right now just contains a set of hardcoded modifier strings that are most commonly used for the usual modifiers. Provide definitions of these so people don't have to worry about typoing a string or mixing up Mod1 and Mod4. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08Add context flag to inhibit default include pathsDaniel Stone1-2/+2
Which will make the context start with no include paths at all. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08Add flags to context creationDaniel Stone1-1/+6
None defined as yet, but why not. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08Add flags to keymap compilation entrypointsDaniel Stone1-4/+13
No use as yet, but might as well ... Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08Revert "Unconstify xkb_rules_names"Ran Benita1-5/+5
This reverts commit d007cd0a1f3f4b9c927175771ff79aae6fe4ab8b. This is in fact more restrictive, because it breaks the (common) case where the strings are const themselved, e.g. "evdev", "us", etc. As is you must either duplicate the strings or suppress the warnings. If the user needs to retain the non-const strings, he should instead just keep them in some other struct and use xkb_rules_names just as a temporary parameter for xkb_map_new_from_names. Mildly annoying but acceptable.
2012-04-09Add xkb_state_get_map()Ran Benita1-0/+6
This is very useful because it avoids redundent pointers in structs and/or parameter passing in the application. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-04-09Remove Xfuncproto.h and XKB.h from xkbcommon/xkbcommon.hRan Benita1-48/+49
The kbproto header is already not needed here anymore. Move the _X_EXPORT's to the corresponding function definitions, and use straight extern "C" clauses instead of _XFUNCPROTOBEGIN/END. It also makes more sense to have the EXPORT's in the source files, as it provides some documentation to the reader, whereas in the header it's obvious. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
2012-04-09Constify the syms_out argument to xkb_key_get_syms()Ran Benita1-1/+1
The caller should not mess around with these as they come directly from our internal structs. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-04-09Implement missing xkb_state_ref and add return valueRan Benita1-4/+4
xkb_state_ref was missing. Also modify the _ref functions to return the object instead of being void. This is a useful idiom: struct my_object my_object_new(struct xkb_state *state) { [...] my_object->state = xkb_state_ref(state); [...] } Essentially "taking" a reference, such that you don't forget to increment it and it's one line less (see example in our own code). A case could also be made for _unref to return the object or NULL, but this is quite uncommon. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
2012-04-09Fix compiler warningsRan Benita1-1/+1
(They were not reported, see next commit). The reset function declaration didn't match its name in the definition; the _defaults variant matches better with the rest. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated to current master.]
2012-04-09Unconstify xkb_rules_namesDaniel Stone1-5/+5
Since we never return an xkb_rules_names and it's all user-provided strings, seems a bit harsh to have it const. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-04-09Rename xkb_desc to xkb_keymapDaniel Stone1-18/+18
struct xkb_desc was just a hangover from the old XkbDescRec, which isn't a very descriptive name. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-04-03Properly document xkb_key_get_symsDaniel Stone1-4/+13
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-03-27Use xkb_contexts in keymap compilationDaniel Stone1-4/+21
Primarily for the include path, but also for the logging in future. Signed-off-by: Daniel Stone <daniel@fooishbar.org>