api: deprecate XKB_MAP_COMPILE_PLACEHOLDER, and use KEYMAP instead of MAP

The PLACEHOLDER was not meant to be used, but c++ doesn't like passing 0
to enums, so it was used. For this reason we add all the NO_FLAGS items,
so the PLACEHOLDER shouldn't be used anymore.

Second, XKB_MAP is the prefix we used ages ago, KEYMAP is the expected
prefix here. So deprecate that as well.

The old names may still be used through the xkbcommon-compat.h header,
which is included by default (no need to include directly).

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2014-02-08 16:40:20 +02:00
parent 8cc9434fd2
commit 973b8fd47e
5 changed files with 10 additions and 8 deletions

View File

@ -132,7 +132,7 @@ xkb_keymap_new_from_names(struct xkb_context *ctx,
return NULL;
}
if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) {
if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) {
log_err_func(ctx, "unrecognized flags: %#x\n", flags);
return NULL;
}
@ -193,7 +193,7 @@ xkb_keymap_new_from_buffer(struct xkb_context *ctx,
return NULL;
}
if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) {
if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) {
log_err_func(ctx, "unrecognized flags: %#x\n", flags);
return NULL;
}
@ -230,7 +230,7 @@ xkb_keymap_new_from_file(struct xkb_context *ctx,
return NULL;
}
if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) {
if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) {
log_err_func(ctx, "unrecognized flags: %#x\n", flags);
return NULL;
}

View File

@ -1125,7 +1125,7 @@ xkb_x11_keymap_new_from_device(struct xkb_context *ctx,
struct xkb_keymap *keymap;
const enum xkb_keymap_format format = XKB_KEYMAP_FORMAT_TEXT_V1;
if (flags & ~(XKB_MAP_COMPILE_PLACEHOLDER)) {
if (flags & ~(XKB_KEYMAP_COMPILE_NO_FLAGS)) {
log_err_func(ctx, "unrecognized flags: %#x\n", flags);
return NULL;
}

View File

@ -56,7 +56,7 @@ main(void)
assert(device_id != -1);
keymap = xkb_x11_keymap_new_from_device(ctx, conn, device_id,
XKB_MAP_COMPILE_NO_FLAGS);
XKB_KEYMAP_COMPILE_NO_FLAGS);
assert(keymap);
state = xkb_x11_state_new_from_device(keymap, conn, device_id);

View File

@ -91,4 +91,8 @@
#define xkb_state_get_map(state) xkb_state_get_keymap(state)
/* Not needed anymore, since there's NO_FLAGS. */
#define XKB_MAP_COMPILE_PLACEHOLDER XKB_KEYMAP_COMPILE_NO_FLAGS
#define XKB_MAP_COMPILE_NO_FLAGS XKB_KEYMAP_COMPILE_NO_FLAGS
#endif

View File

@ -681,9 +681,7 @@ xkb_context_set_log_fn(struct xkb_context *context,
/** Flags for keymap compilation. */
enum xkb_keymap_compile_flags {
/** Do not apply any flags. */
XKB_MAP_COMPILE_NO_FLAGS = 0,
/** Apparently you can't have empty enums. What a drag. */
XKB_MAP_COMPILE_PLACEHOLDER = 0
XKB_KEYMAP_COMPILE_NO_FLAGS = 0
};
/**