Add flags to context creation

None defined as yet, but why not.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-05-08 17:51:16 +01:00
parent b537b5524a
commit c358428009
7 changed files with 13 additions and 8 deletions

View File

@ -193,13 +193,18 @@ xkb_string_to_keysym(const char *s);
* @{
*/
enum xkb_context_flags {
/** Apparently you can't have empty enums. What a drag. */
XKB_CONTEXT_PLACEHOLDER = 0,
};
/**
* Returns a new XKB context, or NULL on failure. If successful, the caller
* holds a reference on the context, and must free it when finished with
* xkb_context_unref().
*/
struct xkb_context *
xkb_context_new(void);
xkb_context_new(enum xkb_context_flags flags);
/**
* Appends a new entry to the include path used for keymap compilation.

View File

@ -177,7 +177,7 @@ xkb_context_unref(struct xkb_context *context)
* Create a new context.
*/
_X_EXPORT struct xkb_context *
xkb_context_new(void)
xkb_context_new(enum xkb_context_flags flags)
{
struct xkb_context *context = calloc(1, sizeof(*context));

View File

@ -30,7 +30,7 @@
int
main(void)
{
struct xkb_context *context = xkb_context_new();
struct xkb_context *context = xkb_context_new(0);
assert(context);

View File

@ -46,7 +46,7 @@ test_file(const char *path)
fd = open(path, O_RDONLY);
assert(fd >= 0);
context = xkb_context_new();
context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling path: %s\n", path);
@ -81,7 +81,7 @@ test_string(const char *string)
struct xkb_context *context;
struct xkb_keymap *xkb;
context = xkb_context_new();
context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling string\n");

View File

@ -46,7 +46,7 @@ test_names(const char *keycodes, const char *types,
.symbols = strdup(symbols),
};
context = xkb_context_new();
context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s\n", kccgst.keycodes, kccgst.types,

View File

@ -43,7 +43,7 @@ test_rmlvo(const char *rules, const char *model, const char *layout,
.options = options
};
context = xkb_context_new();
context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s %s\n", rmlvo.rules, rmlvo.model,

View File

@ -215,7 +215,7 @@ main(void)
.options = NULL,
};
context = xkb_context_new();
context = xkb_context_new(0);
assert(context);
xkb = xkb_map_new_from_names(context, &rmlvo, 0);