Commit Graph

659 Commits (730c2bc34f28e3a2f42f1f6201b98368b3d70196)

Author SHA1 Message Date
Dan Nicholson e98eb80509 test: Remove extraneous includes
These programs don't actually use the internal API.
2009-04-09 20:52:26 -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 5889cef809 Require strdup and remove utils wrapper
This kills a couple warnings from using the uStringDup wrapper. If you
don't have strdup on your platform, you have bigger issues.
2009-04-05 20:27:35 -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 e0e77b71de Coding style cleanup on key allocation functions 2009-04-05 09:30:15 -07:00
Dan Nicholson 713c8f418f test: Exercise compiling from components
This could probably use a lot more real world test cases, but it does
the job for now.
2009-04-04 12:54:44 -07:00
Dan Nicholson a2e597675b xkbcomp: Don't say we're exiting when we're not 2009-04-04 12:50:27 -07:00
Dan Nicholson 85039a0d76 xkbcomp: Give keymap file empty name if none supplied
Ensure that the keymap file topName is not NULL since it gets blindly
dereferenced later.
2009-04-04 12:31:55 -07:00
Dan Nicholson 125ce76f5b xkbcomp: Ensure at least keycodes supplied in components
It seems that at least a non-empty keycodes component is required to
compile a XkbcDescPtr.
2009-04-04 12:21:05 -07:00
Dan Nicholson fdd8a9ec1b xkbcomp: Don't dereference NULL VarDefsPtr 2009-04-04 12:17:50 -07:00
Dan Nicholson 99d2f4a5eb xkbcomp: Refactor keymap file generator 2009-04-04 12:16:04 -07:00
Dan Nicholson 4f736db995 test: Minor refactor to allow $EXEEXT in program names 2009-04-04 11:04:35 -07:00
Dan Nicholson 8f9a612990 test: Add logging and some intentionally failing cases
We want to log the output of the tests rather than letting them go to
stderr. This allows tests we expect to fail to be run.
2009-04-04 11:01:58 -07:00
Dan Nicholson 8269cbce81 xkbcomp: Generating components requires rules _and_ layout
This came from trial and error, but it seems that you can generate a
valid keymap with only rules and layout.
2009-04-04 10:02:39 -07:00
Dan Nicholson fa96602d0f xkbcomp: Fail when converting rules to components returns an error
XkbcRF_GetComponents was returning an error but leaving the generated
components alone. This ensures that the broken XkbComponentNamesPtr is
freed and the error is passed up to the caller.
2009-04-04 09:51:33 -07:00
Dan Nicholson e72fc29f33 xkbcomp: Cleanup error messages 2009-04-04 09:48:59 -07:00
Dan Nicholson 83367a8d2d xkbcomp: Ensure user has supplied a rules name 2009-04-04 09:46:20 -07:00
Dan Nicholson 95dbbb8a7b rulescomp: Remove unneeded API 2009-04-04 09:37:53 -07:00
Dan Nicholson 5d95a43ad0 Refactor xkbpath so that it implicitly initializes
Instead of requiring the user to call XkbInitIncludePath() and
XkbAddDefaultDirectoriesToPath(), all the path entry points now implicitly
initialize the path. When initializing, the default directories are added
so it's useful.

This provides normal operation without exposing the xkbpath API. That
might happen later to allow apps to edit the XKB search path.
2009-04-04 09:29:43 -07:00
Dan Nicholson 5c91062334 Remove trailing spaces in source files 2009-04-04 09:19:51 -07:00
Dan Nicholson 5cc55d7cbb Test compiler to simulate xkbcomp usage
Added a test program, rulescomp, which takes a RMLVO set and generates a
XkbcDescPtr. This is essentially what the xserver will do, except that we
still need to access some xkbcomp internal API to make it work.
2009-04-04 09:14:20 -07:00
Dan Nicholson 51eff3d939 Fix cleanup error in names allocation
A conditional got reversed during the coding style cleanup.
2009-04-04 08:55:23 -07:00
Dan Nicholson c38cdc5ded xkbcomp: Ignore generated parser 2009-04-03 21:18:58 -07:00
Dan Nicholson 3a709e399e xkbcomp: Don't segfault if the debug files aren't set
Another interface that needs to be cleaned up.
2009-04-03 21:17:52 -07:00
Dan Nicholson ec86ce1f1a xkbcomp: Declare global debugging vars
These will need to be sanitized at some point, but for now let's just get
the code running.
2009-04-03 20:34:41 -07:00
Dan Nicholson c14c60bb37 xkbcomp: Back out strdup warning cleanup
There are some spots in the code that use strdup without checking the
argument, so we need this to not segfault. Cleanup later...
2009-04-03 20:34:19 -07:00
Dan Nicholson 71baa3d85a Fix install path for XKBcommon.h 2009-04-03 19:35:01 -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 a9822d8720 Add xkbcommon pkg-config file 2009-04-01 06:22:06 -07:00
Dan Nicholson db03c9b7e9 xkbcomp: Clean up utils prototypes
Includes using a macro for the gcc format attributes instead of repeated
ifdef's.
2009-03-31 19:32:49 -07:00
Dan Nicholson a27e56b6fb xkbcomp: Remove duplicated macros 2009-03-31 07:21:20 -07:00
Dan Nicholson 05daf09f18 xkbcomp: Kill warnings about address always evaluating as true 2009-03-31 07:09:47 -07:00
Dan Nicholson a151329266 Merge commit 'tilt/master' 2009-03-31 06:57:06 -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 e1284944cf Add rules 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-29 11:31:54 -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 1115d55549 xkbcomp: Include Xdefs.h for Atom in tokens.h 2009-03-29 08:17:13 -07:00
Dan Nicholson 587a5d956f xkbcomp: Add missing includes for Bool in xkbpath 2009-03-29 08:15:27 -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 c4c9e36fbf xkbcomp: Remove listing sources
The xkbcomp listing APIs were only needed for the "xkblist" mode, which
won't be supported here.
2009-03-28 18:50:29 -07:00
Dan Nicholson fe94593d02 malloc/misc/xkb: Coding style cleanup 2009-03-28 18:17:34 -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 baa9581d81 geom: Coding-style cleanup 2009-03-28 16:21:25 -07:00