Commit Graph

2127 Commits (e422601121f0611d44b859397b24a5ca11fb3665)

Author SHA1 Message Date
Kristian Høgsberg d202bc4462 Pull in XKB_COMMON_* version of modifier masks
This way we can use libxkbcommon without having to include X.h.
2010-10-08 15:07:53 -04:00
Adam Jackson 73ca959d7b Dead code removal and static markup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-27 16:06:48 -04:00
Kristian Høgsberg fb05ee47bf Remove libxkbfile dependency for real this time 2010-09-03 20:35:28 -04:00
Kristian Høgsberg 20bfe1280d Use const char * in struct xkb_rule_names 2010-08-29 21:30:10 -04:00
Kristian Høgsberg be2bd66181 Pull in a few #defines from libxkbfile and lower kbproto requirement 2010-08-25 14:51:52 -04:00
Kristian Høgsberg 351f8c6587 Drop Bool type
It's a nightmare trying to avoid double definitions.
2010-07-02 15:05:21 -04:00
Kristian Høgsberg b3805a2360 Get rid of a few unused #defines in public header 2010-07-02 14:21:59 -04:00
Kristian Høgsberg 97fbc348b0 Rename XkbRMLVOSet to struct xkb_rule_names 2010-07-02 14:21:52 -04:00
Kristian Høgsberg 15f259993e Move private structs and defines to private headers 2010-07-02 12:20:59 -04:00
Kristian Høgsberg 3f0034a990 Rename public entry points to lowercase and underscore 2010-07-02 12:20:59 -04:00
Kristian Høgsberg 5669e1a82d Compile with -fvisibility=hidden when possible 2010-07-02 12:20:59 -04:00
Kristian Høgsberg 9f6026867a Pull in enough structs and defines from XKBstr.h to only need XKB.h
We want to move away from sharing implementation structs and let libX11
and libxkbcommon use each their own set of structs.
2010-07-02 12:20:54 -04:00
Kristian Høgsberg 9d55d5bbf6 Drop Xmd.h include now that we're using uint32_t 2010-06-30 17:32:54 -04:00
Kristian Høgsberg 8e653493d0 Fix warning from CARD32 -> uint32_t conversion 2010-06-30 17:31:34 -04:00
Kristian Høgsberg e10e16ad2f Constify XkbcAtomText()
Atoms aren't mutable and this lets us put tbGetBuffer() back in the box.
2010-06-30 17:30:42 -04:00
Kristian Høgsberg d95b289367 Make XkbcInitAtoms() call optional 2010-06-30 17:13:21 -04:00
Kristian Høgsberg 0ece2cdbaf Drop more malloc/free wrappers 2010-06-30 16:56:24 -04:00
Kristian Høgsberg a76df86572 Use the right action structs
We were casting the union members to the wrong action structs (from kbproto).
2010-06-30 16:33:25 -04:00
Kristian Høgsberg 1723ef1bc7 Copy over missing action structs from kbproto 2010-06-30 15:48:39 -04:00
Kristian Høgsberg 9258cc3dca Rename Xkbc*Action to struct xkb_*_action 2010-06-30 13:31:21 -04:00
Kristian Høgsberg 399d4bd678 Drop malloc wrappers 2010-06-28 06:58:01 -04:00
Kristian Høgsberg 47d3b3969b Drop CARD32 and Opaque types 2010-06-28 06:50:12 -04:00
Daniel Stone 2fb329c964 Copy and duplicate XkbModsRec and XkbKTMapEntryRec
Copy these types in so we can extend the vmod size.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-23 16:25:10 +01:00
Daniel Stone b74223eb50 fix mod size confusion
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-23 16:25:02 +01:00
Daniel Stone 8693c2652c Add really rudimentary rules caching support
Keep the parsed form of the last-used rules file around, and reuse that
if we get asked for the same ruleset.  If not, bin it and cache the
other one.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:16 +01:00
Daniel Stone 7257d4c89e Use CARD32 instead of Atom, move geom headers in
Use CARD32 instead of Atom/KeySym/et al to avoid type size confusion
between server and non-server code; relatedly, move the geometry headers
in from kbproto, so every non-simple type (i.e. structs containing
nothing more than basic types) is now copied into xkbcommon.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:16 +01:00
Daniel Stone b38525421f Interp: More lazy keysym resolution
Resolve the keysyms when we create an InterpDef, rather than directly
in the parser.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:16 +01:00
Daniel Stone 2c4a045aca Allow external atom databases
Allow people to plug in an external atom database (e.g. the X server's),
so we don't have to migrate our own atoms over later.  We are a bit
over-keen on atoms at the moment, so it does pollute the atom database a
bit though.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:16 +01:00
Daniel Stone 15b0db5492 Copy in XkbCompatMapRec and XkbSymInterpretRec
These contain actions, so transition them ahead to XkbcAction and move
them into XKBcommon.h.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:57:16 +01:00
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 e564235b43 xkbcomp: Don't malloc() and free() most scanned tokens
Use a constant buffer instead.  Sigh.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone f246db20f4 Fix compilation with DEBUG
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone acc467de9f xkbcomp: Use fread() instead of getc()
So, it turns out that if you're parsing a fairly large amount of data,
using getc() to get all the input rather than, say, read(), is some kind
of remarkably daft and unperformant idea.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 240a0c3409 xkbcomp: Lazy keysym parsing (avoid XStringToKeysym)
Instead of calling XStringToKeysym on every keysym we parse, store it as
a string until we need to store it in an actual keymap.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 48baabeb38 Atoms: Avoid allocations in XkbAtomText()
XkbAtomGetString() returns a freshly-allocated string, whereas
XkbAtomText() returns the same in a temporary buffer.  XkbAtomText used
to call XkbAtomGetString() and then free the result, which seems quite
spectacularly pointless when you think about it.  Shuffle the atom code
around so we don't have to allocate for XkbAtomText().

This changes semantics slightly wrt non-printable characters, but I
haven't been able to see any effect so far.  And it may well be ever so
slightly quicker.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 080a083fd2 configure.ac: Enable automake silent rules by default
This allows us to spot warnings much more easily.  Also, drop the
now-deprecated AM_MAINTAINER_MODE.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone a0e180b083 Expose tbGetBuffer to the rest of libxkbcommon
This will let us implement XkbAtomGetString on top of XkbAtomText,
instead of having the latter get a duplicated string, dump it into a
temporary buffer, and subsequently free it (sigh).

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 4346e0065b xkbcomp: keycodes: Silence gcc warnings
It was right to warn us: some of these were actually bogus.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 5df3dff741 xkbcomp: geometry: Plug numerous atom text & expr leaks
This code is absolute misery.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 18039a6c0b xkbcomp: Atom text and expr leak fixes part #973
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone a22386d402 xkbcomp: Don't leak atom text and string exprs, again
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:56 +01:00
Daniel Stone 8904c6eea7 xkbcomp: expr: Use XkbcAtomText instead of GetString
This returns us a temporary string, rather than leaking the atom.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone ad0a3d7c52 xkbcomp: Don't leak atom text and string exprs
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone d20bdd3b9a xkbcomp: vmod: Don't get and immediately intern atoms
XkbcInternAtom(XkbcAtomGetString(atom)) has to be the most spectacularly
broken antipattern I've yet seen.  Just compare the atoms directly.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone 50a037cacf xkbcomp: Replace open-coded strdup
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +01:00
Daniel Stone 5140250273 Add testcase for XkbcCanonicaliseComponents
Should be reasonably thorough; the shell part is, however, quite
unpleasant.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2010-06-22 15:56:55 +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