Commit Graph

26 Commits (9e5052259a0f5d3655cff1c6aa36cc303c866e47)

Author SHA1 Message Date
Ran Benita 37f4384947 rules: remove support for keymap rule
This commit removes the ability to specify a keymap *in a rules file*,
e.g. in /usr/share/X11/xkb/rules/evdev or somesuch. This is unused in
xkeyboard-data, and the current code has never even supported it,
because xkb_map_new_from_kccgst (which is no longer exposed in the API)
checks to see that one of the usual components (e.g. symbols, types, ..)
has been filled, while the rules parser, on the other hand,  doesn't
allow to specify a keymap and other stuff at the same time.

( The idea was to remove xkb_map_new_from_kccgst entirely, but it's used
  by a test so it can stay. )

tl;dr: dead code. Of course passing a keymap file to
xkb_map_new_from_file still works.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-01 00:51:56 +03:00
Ran Benita 48b4d30aa3 Use enum for file types
enums are nice for some type safety and readability. This one also
removes the distinction between file type mask / file type index and
some naming consistency.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-01 00:51:56 +03:00
Ran Benita 955ed8c469 state: use darray for filters
For the darray we need to specify the explicit struct xkb_filter type
instead of void*, so we move the definition of struct xkb_state into
state.c thus making it opaque even from the rest of the files. It has
enough getters to get going and is otherwise good style.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 13:21:21 +03:00
Ran Benita a1f8440d70 symbols: use darray in struct xkb_sym_map
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 13:21:21 +03:00
Ran Benita bc50cdd460 darray: some changes for convenience
- Make darray_free also initialize the array back to an empty state, and
  stop worrying about it everywhere.

- Add darray_mem, to access the underlying memory, which we do manually
  now using &darray_item(arr, 0). This makes a bit more clear when we
  actually mean to take the address of a specific item.

- Add darray_copy, to make a deep copy of a darray.

- Add darray_same, to test whether two darrays have the same underlying
  memory (e.g. if the struct itself was value copied). This should used
  where previously two arrays were compared for pointer equality.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 12:34:57 +03:00
Ran Benita 93ef256063 Comment out unused fields in xkb_controls
Until (if) we implement/use them the should take up any (mental) space.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 12:34:57 +03:00
Ran Benita cb631c2de0 Unconstify a few string struct fields
These were made const when the structs were exposed in the API. Now they
are private and we shouldn't mess around with the UNCONSTIFY business.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-06-09 12:34:57 +03:00
Daniel Stone ebd397e184 Add xkb_map_get_as_string
Returns a newly-allocated string representing the specified keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-29 15:07:18 +01:00
Daniel Stone 208d957806 Fix signed vs. unsigned confusion in actions
Some actions could also take relative rather than absolute parameters,
so they really needed to be signed instead of explicitly unsigned.
Oops.

Fixes, e.g., action= MovePtr(x=-1,y=+1), which was reported as
(x=+65535,y=+1).

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-25 18:02:19 +01:00
Ran Benita ccc047c4e0 compat: use darray for acts and key_acts in the server map
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 18:02:40 +03:00
Ran Benita 07c88b551b symbols: use darray for xkb_sym_map
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 15:20:47 +03:00
Ran Benita c65a3596ae keytypes: use darray for xkb_kt_map_entry's
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:24 +03:00
Ran Benita 374b0c9814 alloc: use darray in xkb_key_names
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:24 +03:00
Ran Benita c2ac3a2b20 keytypes: use darray for key types in the client map
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:23 +03:00
Ran Benita 561504162f compat: use darray for sym_interprets
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:23 +03:00
Ran Benita c815ff96d9 Import darray.h for common dynamic array code
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-22 14:19:23 +03:00
Daniel Stone 7b00485a6b Rename 'ctx' back to 'context' in external API
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-11 15:03:43 +01:00
Daniel Stone 7a1201bdf2 Change xkb_key_get_syms to just return a bare int
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09 20:51:37 +01:00
Daniel Stone 46441b1184 Move KcCGST API to internal-only
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-09 20:49:04 +01:00
Daniel Stone 6433d72e7c Merge remote-tracking branch 'krh/keysyms'
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-09 20:15:46 +01:00
Ran Benita 5e59ef3f47 Remove support for xkb_layout and xkb_semantics file types
These are two aggregate file types which are not used anywhere. We
maintain useful-enough backward compatibility in the parser, by treating
them as xkb_keymap. The keymap type allows for all types of components,
so they will still compile fine if they ever come up.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-09 17:53:15 +01:00
Ran Benita e7bb1e5fd9 Shorten context to ctx
(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-09 17:52:26 +01:00
Ran Benita 699a0b841c Contextualize the atom table
Each context gets its own table, i.e. interning a string in one context
does not affect any other context.

The existing xkb_atom_* functions are turned into wrappers around a new
standalone atom_table object.

Signed-off-by: Ran Benita <ran234@gmail.com>

[daniels: Updated for xkb -> keymap.]
2012-05-09 15:56:25 +01:00
Ran Benita 4aef083e46 Contextualize XkbFile IDs
Currently the IDs are assigned from a static variable inside
CreateXKBFile. This can lead to some unpleasantness with threads, so
maintain the counter in the context instead.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-09 15:30:49 +01:00
Daniel Stone 38cb639082 Change all 'xkb' xkb_keymap names to 'keymap'
To make it a bit more clear what it actually is.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-09 15:17:25 +01:00
Ran Benita b610b2b953 Rename XKBcommonint.h to xkb-priv.h and use it
Make the files in the src/* directory use their own header or a
consilidated private header. This makes the file dependencies clearer.

Also drop the pointless "xkb" file name prefix, add split a few
declarations to their own files (atom.h and text.h).

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-08 17:29:43 +01:00