src/video/wayland/SDL_waylandevents.c
changeset 8104 2e4f1bd21196
parent 8062 4fc5f66d63cc
child 8116 f7c2f71251e5
     1.1 --- a/src/video/wayland/SDL_waylandevents.c	Wed Jan 08 14:53:08 2014 -0500
     1.2 +++ b/src/video/wayland/SDL_waylandevents.c	Thu Jan 09 13:56:21 2014 -0300
     1.3 @@ -19,7 +19,7 @@
     1.4    3. This notice may not be removed or altered from any source distribution.
     1.5  */
     1.6  
     1.7 -#include "SDL_config.h"
     1.8 +#include "../../SDL_internal.h"
     1.9  
    1.10  #include "SDL_stdinc.h"
    1.11  #include "SDL_assert.h"
    1.12 @@ -32,6 +32,8 @@
    1.13  #include "SDL_waylandevents_c.h"
    1.14  #include "SDL_waylandwindow.h"
    1.15  
    1.16 +#include "SDL_waylanddyn.h"
    1.17 +
    1.18  #include <linux/input.h>
    1.19  #include <sys/select.h>
    1.20  #include <sys/mman.h>
    1.21 @@ -60,14 +62,14 @@
    1.22      SDL_VideoData *d = _this->driverdata;
    1.23      struct pollfd pfd[1];
    1.24  
    1.25 -    pfd[0].fd = wl_display_get_fd(d->display);
    1.26 +    pfd[0].fd = WAYLAND_wl_display_get_fd(d->display);
    1.27      pfd[0].events = POLLIN;
    1.28      poll(pfd, 1, 0);
    1.29  
    1.30      if (pfd[0].revents & POLLIN)
    1.31 -        wl_display_dispatch(d->display);
    1.32 +        WAYLAND_wl_display_dispatch(d->display);
    1.33      else
    1.34 -        wl_display_dispatch_pending(d->display);
    1.35 +        WAYLAND_wl_display_dispatch_pending(d->display);
    1.36  }
    1.37  
    1.38  static void
    1.39 @@ -199,7 +201,7 @@
    1.40          return;
    1.41      }
    1.42  
    1.43 -    input->xkb.keymap = xkb_map_new_from_string(input->display->xkb_context,
    1.44 +    input->xkb.keymap = WAYLAND_xkb_keymap_new_from_string(input->display->xkb_context,
    1.45                                                  map_str,
    1.46                                                  XKB_KEYMAP_FORMAT_TEXT_V1,
    1.47                                                  0);
    1.48 @@ -211,10 +213,10 @@
    1.49          return;
    1.50      }
    1.51  
    1.52 -    input->xkb.state = xkb_state_new(input->xkb.keymap);
    1.53 +    input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap);
    1.54      if (!input->xkb.state) {
    1.55          fprintf(stderr, "failed to create XKB state\n");
    1.56 -        xkb_map_unref(input->xkb.keymap);
    1.57 +        WAYLAND_xkb_keymap_unref(input->xkb.keymap);
    1.58          input->xkb.keymap = NULL;
    1.59          return;
    1.60      }
    1.61 @@ -266,11 +268,11 @@
    1.62          return;
    1.63  
    1.64      // TODO can this happen?
    1.65 -    if (xkb_key_get_syms(input->xkb.state, key + 8, &syms) != 1)
    1.66 +    if (WAYLAND_xkb_state_key_get_syms(input->xkb.state, key + 8, &syms) != 1)
    1.67          return;
    1.68  
    1.69      if (state) {
    1.70 -        size = xkb_keysym_to_utf8(syms[0], text, sizeof text);
    1.71 +        size = WAYLAND_xkb_keysym_to_utf8(syms[0], text, sizeof text);
    1.72  
    1.73          if (size > 0) {
    1.74              text[size] = 0;
    1.75 @@ -287,7 +289,7 @@
    1.76  {
    1.77      struct SDL_WaylandInput *input = data;
    1.78  
    1.79 -    xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched,
    1.80 +    WAYLAND_xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched,
    1.81                            mods_locked, 0, 0, group);
    1.82  }
    1.83  
    1.84 @@ -349,7 +351,7 @@
    1.85      wl_seat_add_listener(input->seat, &seat_listener, input);
    1.86      wl_seat_set_user_data(input->seat, input);
    1.87  
    1.88 -    wayland_schedule_write(d);
    1.89 +    WAYLAND_wl_display_flush(d->display);
    1.90  }
    1.91  
    1.92  void Wayland_display_destroy_input(SDL_VideoData *d)
    1.93 @@ -369,10 +371,10 @@
    1.94          wl_seat_destroy(input->seat);
    1.95  
    1.96      if (input->xkb.state)
    1.97 -        xkb_state_unref(input->xkb.state);
    1.98 +        WAYLAND_xkb_state_unref(input->xkb.state);
    1.99  
   1.100      if (input->xkb.keymap)
   1.101 -        xkb_map_unref(input->xkb.keymap);
   1.102 +        WAYLAND_xkb_keymap_unref(input->xkb.keymap);
   1.103  
   1.104      free(input);
   1.105      d->input = NULL;