Re: [PATCH weston 1/2] Replace deprecated xkbcommon symbols with current names

2014-08-20 Thread Daniel Stone
Hi,

On 19 August 2014 13:59, Ran Benita  wrote:

> These symbols (xkb_map_* and others) were replaced in xkbcommon with more
> consistent names. See the header xkbcommon/xkbcommon-compat.h for how
> the old names map to the new.
>
> The new names have been available since the first stable xkbcommon
> release (0.2.0).
>

Pushed this and the unref fix both. Thanks!

Cheers,
Dan
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 1/2] Replace deprecated xkbcommon symbols with current names

2014-08-19 Thread Ran Benita
These symbols (xkb_map_* and others) were replaced in xkbcommon with more
consistent names. See the header xkbcommon/xkbcommon-compat.h for how
the old names map to the new.

The new names have been available since the first stable xkbcommon
release (0.2.0).

Signed-off-by: Ran Benita 
---
 clients/weston-simple-im.c | 22 
 clients/window.c   | 24 -
 src/compositor-wayland.c   | 10 +++
 src/compositor-x11.c   |  4 +--
 src/input.c| 66 --
 src/screen-share.c | 10 +++
 6 files changed, 70 insertions(+), 66 deletions(-)

diff --git a/clients/weston-simple-im.c b/clients/weston-simple-im.c
index ded6a04..787782f 100644
--- a/clients/weston-simple-im.c
+++ b/clients/weston-simple-im.c
@@ -187,10 +187,10 @@ input_method_keyboard_keymap(void *data,
}
 
keyboard->keymap =
-   xkb_map_new_from_string(keyboard->xkb_context,
-   map_str,
-   XKB_KEYMAP_FORMAT_TEXT_V1,
-   0);
+   xkb_keymap_new_from_string(keyboard->xkb_context,
+  map_str,
+  XKB_KEYMAP_FORMAT_TEXT_V1,
+  0);
 
munmap(map_str, size);
close(fd);
@@ -203,16 +203,16 @@ input_method_keyboard_keymap(void *data,
keyboard->state = xkb_state_new(keyboard->keymap);
if (!keyboard->state) {
fprintf(stderr, "failed to create XKB state\n");
-   xkb_map_unref(keyboard->keymap);
+   xkb_keymap_unref(keyboard->keymap);
return;
}
 
keyboard->control_mask =
-   1 << xkb_map_mod_get_index(keyboard->keymap, "Control");
+   1 << xkb_keymap_mod_get_index(keyboard->keymap, "Control");
keyboard->alt_mask =
-   1 << xkb_map_mod_get_index(keyboard->keymap, "Mod1");
+   1 << xkb_keymap_mod_get_index(keyboard->keymap, "Mod1");
keyboard->shift_mask =
-   1 << xkb_map_mod_get_index(keyboard->keymap, "Shift");
+   1 << xkb_keymap_mod_get_index(keyboard->keymap, "Shift");
 }
 
 static void
@@ -234,7 +234,7 @@ input_method_keyboard_key(void *data,
return;
 
code = key + 8;
-   num_syms = xkb_key_get_syms(keyboard->state, code, &syms);
+   num_syms = xkb_state_key_get_syms(keyboard->state, code, &syms);
 
sym = XKB_KEY_NoSymbol;
if (num_syms == 1)
@@ -261,8 +261,8 @@ input_method_keyboard_modifiers(void *data,
xkb_state_update_mask(keyboard->state, mods_depressed,
  mods_latched, mods_locked, 0, 0, group);
mask = xkb_state_serialize_mods(keyboard->state,
-   XKB_STATE_DEPRESSED |
-   XKB_STATE_LATCHED);
+   XKB_STATE_MODS_DEPRESSED |
+   XKB_STATE_MODS_LATCHED);
 
keyboard->modifiers = 0;
if (mask & keyboard->control_mask)
diff --git a/clients/window.c b/clients/window.c
index a8bc260..90f45d3 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2749,10 +2749,10 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
return;
}
 
-   keymap = xkb_map_new_from_string(input->display->xkb_context,
-map_str,
-XKB_KEYMAP_FORMAT_TEXT_V1,
-0);
+   keymap = xkb_keymap_new_from_string(input->display->xkb_context,
+   map_str,
+   XKB_KEYMAP_FORMAT_TEXT_V1,
+   0);
munmap(map_str, size);
close(fd);
 
@@ -2764,7 +2764,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
state = xkb_state_new(keymap);
if (!state) {
fprintf(stderr, "failed to create XKB state\n");
-   xkb_map_unref(keymap);
+   xkb_keymap_unref(keymap);
return;
}
 
@@ -2774,11 +2774,11 @@ keyboard_handle_keymap(void *data, struct wl_keyboard 
*keyboard,
input->xkb.state = state;
 
input->xkb.control_mask =
-   1 << xkb_map_mod_get_index(input->xkb.keymap, "Control");
+   1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Control");
input->xkb.alt_mask =
-   1 << xkb_map_mod_get_index(input->xkb.keymap, "Mod1");
+   1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Mod1");
input->xkb.shift_mask =
-   1 << xkb_map_mod_get_index(input->xkb.keymap, "Shift");
+   1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Shift");