Commit Graph

34 Commits (60e7eeeba1d6c1b17cc71c36381251e633d6716e)

Author SHA1 Message Date
Daniel Stone 60e7eeeba1 Use CARD32 instead of Atom, drag in XkbClientMapRec
On 64-bit architectures, XID varies in size between the server (always
32 bits), and non-server (always unsigned long) for some inexplicable
reason.  Use CARD32 instead to avoid this horrible trap.

This involves dragging in XkbClientMapRec so we don't get stuck in the
KeySym trap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:12 +01:00
Daniel Stone d2d787df65 Regroup actions into current vs. deprecated, resize vmod
Use Xkbc* for all our actions that we intend to keep around, and Xkb*
for deprecated ones we can hopefully get rid of, at least internally.

While we're at it, make vmods be a uint32_t.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 85b7f47d8a Add XkbcCanonicaliseComponents
Canonicalises two sets of components (new and old), e.g.:
new: +bar
old: foo
result: foo+bar

This is required as part of the spec, so clients can reuse part of the
device's old keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone 8ffa371395 XKBcommon.h: Make header self-contained
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone 8b5af79b7b Keysym: Add apallingly bad API documentation for keysym <-> string
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone 70b64213ca Make keysym <-> string conversion public API
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Dan Nicholson 4e854a21aa listing: Drop unused deviceSpec argument
The server might care about this, but ListComponents is just reading xkb
files.
2009-04-21 23:22:25 -07:00
Dan Nicholson 18b43f8dfe Rewrite listing code to generate XkbComponentListPtr
In xkbcomp, the listing code printed out the xkb files to stdout and the
caller would parse the output. Here, we can just generate a
XkbComponentListPtr and pass it back.

This should be a series of smaller commits, but there was no clean way to
do it since it's basically a complete rewrite except for the core map
matching logic.

A lot of code used for special printing modes in xkbcomp has been
shedded. Callers can massage the output as they please.
2009-04-19 16:34:12 -07:00
Dan Nicholson abbd141935 Add interface to compile keyboard description from keymap files
We need to support generating a keyboard description from a keymap file
because there are just some cases where RMLVO or ktcsg is not enough.

The map choosing logic has been refactored into its own function and now
supports choosing a named or default keymap.
2009-04-10 12:25:51 -07:00
Dan Nicholson 0280b10df9 Make XkbcInitAtoms externally accessible
Applications (like the server) need to initialize the atoms system
before using the rest of the library. Maybe it should just init itself
implicitly.
2009-04-09 14:29:32 -07:00
Dan Nicholson f5d37e279a Constify public API
There's no reason the arguments can't be const.
2009-04-08 17:59:15 -07:00
Dan Nicholson babae38935 Change CompileKeymapFromRules to take XkbRMLVOSet
Let's use a nice interface now that it's available from XKBrulescommon.h.
2009-04-08 17:54:55 -07:00
Dan Nicholson 6a84a34d86 Remove all non-public API from XKBcommon.h header
The noble intention was to expose all the new API and new generic types
in the split out kbproto headers through XKBcommon.h. It turns out that
would be a massive amount of work in the server. Someday, but first just
wedging in XkbCompileKeymap* would be good.

Most of the API is in new internal xkb*.h headers. In order to allow the
XKBcommon.h header to be used from the server, we can't pull in other
headers from kbproto since the server has its own copies. However, types
that are different (XkbDescRec, XkbAction) still have Xkbc equivalents
here, and I think they should be used in the server.
2009-04-08 07:46:25 -07:00
Dan Nicholson b4a3c39b7e Remove KS macros available in XKBfilecommon.h now
A couple of the XkbcKS* macros become redundant with XKBfilecommon.h
split out in kbproto.
2009-04-07 19:56:41 -07:00
Dan Nicholson 8b100fc0a9 Add action datatypes as defined in the server
Some of the XkbAction types are defined differently in the server, so we
add those to XKBcommon.h and use them here like XkbcDescPtr. We'll have
to deal with the impedance mismatch on the client side later.
2009-04-05 15:15:20 -07:00
Dan Nicholson 5216f0c92f Drop keysym.h pollution from XKBcommon.h
There's really no need to pull this into a public header.
2009-04-02 06:37:16 -07:00
Dan Nicholson a8d936bda5 Compile keyboard description from XKB rules, too
XkbcCompileKeymapFromRules can be used to generate a XkbDescPtr from XKB
rules instead of using components. The previous XkbcCompileKeymap has
been renamed to XkbcCompileKeymapFromComponents.
2009-03-31 05:43:08 -07:00
Dan Nicholson 94fd317463 Add rules file parsing from xkbfile
Copy over the Xkb_RF* rules parsing functions from xkbfile's maprules.c.
Eventually, this will be tied into xkbcomp's path searching utilities so
you don't need to supply a full path to the rules file. Also, it this
should eventually incorporate the server's RMLVOSet.
2009-03-30 06:31:26 -07:00
Dan Nicholson 3fc0dcc816 Generate keyboard description from components
Finally, we can generate a XkbcDescPtr from a XkbComponentNamesPtr. This
involves turning the components into a parsed XKB file and then passing
it into the compiler. This first conversion needs more error handling.
2009-03-29 08:55:18 -07:00
Dan Nicholson e86b31ce92 Add XKBlib resizing functions
These were originally in XKBMalloc.c.
2009-03-29 08:11:25 -07:00
Dan Nicholson d43a7bf02f Copy xkbfile IsUpper/IsLower macros
xkbcomp was using Xlib's XConvertCase to check upper/lowercase. That's a
lot of code, so hopefully the xkbfile macros using _XkbKSCheckCase are
good enough. This also required that <X11/keysym.h> is included to get
all the XK_* definitions.
2009-03-28 20:22:28 -07:00
Dan Nicholson eff1c53873 Copy XkbEnsureSafeMapName from xkbfile 2009-03-28 19:00:13 -07:00
Dan Nicholson 5315e5d14a Add XKBlib API to support keytypes
Added common variants of XkbComputeEffectiveMap, XkbInitCanonicalKeyTypes
and all their needed functions. A couple functions that were in alloc.c
moved to malloc.c to mirror the libX11 sources better.

Original code in

libX11/src/xkb/XKBMalloc.c
libX11/src/xkb/XKBMisc.c
libX11/src/xkb/XKB.c
2009-03-28 17:55:46 -07:00
Dan Nicholson 62482b9614 Add geometry Compute API from XKBlib
A small needed subset from libX11/src/xkb/XKBGeom.c.
2009-03-28 16:08:46 -07:00
Dan Nicholson 28de09e515 Add xkbcommon macro for XkbKSIsKeypad and XkbKSIsDeadKey(k)
IsKeypad is used in symbols, but we'll just grab them both. It might be
better to split parts of XKBfile.h out eventually.
2009-03-28 15:51:06 -07:00
Dan Nicholson a53b9b1ed3 Add XkbModIndexText replacement
Now, I think we should have all the *Text functions we need.
2009-03-28 15:32:51 -07:00
Dan Nicholson 54aea7fe8b Add VMod Text functions from xkbfile 2009-03-28 15:12:30 -07:00
Dan Nicholson 46e5e164d6 Copy XkbAddGeom* functions from XKBlib
These are needed by the geometry compiler in xkbcomp.
2009-03-28 14:22:42 -07:00
Dan Nicholson 1f08ae1e56 Expose all the geometry allocation subroutines
We need a couple in xkbcomp, but they might also be needed externally,
too.
2009-03-28 14:22:41 -07:00
Dan Nicholson 2671b777cf Add more *Text functions from xkbfile
This should cover all the usage in xkbcomp. The format arguments were
dropped except for the special case of XkbModMaskText, which needs to
write in XkbCFile format in HandleVModDef. This was just changed to a
Bool to avoid the need for the macros in XKBfile.h.

The function prefixes have been renamed to be unique from xkbfile.
2009-03-28 14:22:41 -07:00
Dan Nicholson 72df9bb35f Move *Text APIs into libxkbcommon
These seem like they might be generally useful, and more will be needed
from xkbfile.
2009-03-28 12:01:36 -07:00
Dan Nicholson 4859304f65 Use X extern "C" guards around function declarations for public header 2009-03-25 20:06:39 -07:00
Dan Nicholson c88c0ba725 Borrow atom implementation from libxkbfile
We need an atom implementation not relying on XInternAtom and friends.
The original code is in

libxkbfile/src/xkbatom.c
2009-03-25 20:06:39 -07:00
Dan Nicholson 1ff77ecd36 Rename headers to XKBcommon* and install in extensions directory
Following the kbproto convention, the headers will be named XKBcommon.h
and XKBcommonint.h. Furthermore, they'll be installed in X11/extensions
directory with the rest of the XKB headers.
2009-03-25 19:40:57 -07:00