[mutter/wip/carlosg/input-in-backends: 41/48] backends: Don't use glib types in new X11 backend objects



commit 96d5bde9b760ecec43a806fc03356d0c26089115
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Mar 29 21:14:46 2019 +0100

    backends: Don't use glib types in new X11 backend objects
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/672

 src/backends/x11/meta-device-manager-x11.c | 106 ++++++++++++++---------------
 src/backends/x11/meta-input-device-x11.c   |  56 +++++++--------
 src/backends/x11/meta-input-device-x11.h   |  12 ++--
 src/backends/x11/meta-keymap-x11.c         |  92 ++++++++++++-------------
 src/backends/x11/meta-keymap-x11.h         |   6 +-
 src/backends/x11/meta-stage-x11.c          |  16 ++---
 src/backends/x11/meta-xkb-a11y-x11.c       |   6 +-
 7 files changed, 147 insertions(+), 147 deletions(-)
---
diff --git a/src/backends/x11/meta-device-manager-x11.c b/src/backends/x11/meta-device-manager-x11.c
index 339558222..c2a0ec112 100644
--- a/src/backends/x11/meta-device-manager-x11.c
+++ b/src/backends/x11/meta-device-manager-x11.c
@@ -161,9 +161,9 @@ static void
 translate_device_classes (Display             *xdisplay,
                           ClutterInputDevice  *device,
                           XIAnyClassInfo     **classes,
-                          guint                n_classes)
+                          int                  n_classes)
 {
-  gint i;
+  int i;
 
   for (i = 0; i < n_classes; i++)
     {
@@ -174,7 +174,7 @@ translate_device_classes (Display             *xdisplay,
         case XIKeyClass:
           {
             XIKeyClassInfo *key_info = (XIKeyClassInfo *) class_info;
-            gint j;
+            int j;
 
             _clutter_input_device_set_n_keys (device,
                                               key_info->num_keycodes);
@@ -225,11 +225,11 @@ translate_device_classes (Display             *xdisplay,
 
 static gboolean
 is_touch_device (XIAnyClassInfo         **classes,
-                 guint                    n_classes,
+                 int                      n_classes,
                  ClutterInputDeviceType  *device_type,
-                 guint                   *n_touch_points)
+                 uint32_t                *n_touch_points)
 {
-  guint i;
+  int i;
 
   for (i = 0; i < n_classes; i++)
     {
@@ -260,7 +260,7 @@ static gboolean
 is_touchpad_device (XIDeviceInfo *info)
 {
   gulong nitems, bytes_after;
-  guint32 *data = NULL;
+  uint32_t *data = NULL;
   int rc, format;
   Atom type;
   Atom prop;
@@ -288,11 +288,11 @@ is_touchpad_device (XIDeviceInfo *info)
 
 static gboolean
 get_device_ids (XIDeviceInfo  *info,
-                gchar        **vendor_id,
-                gchar        **product_id)
+                char         **vendor_id,
+                char         **product_id)
 {
   gulong nitems, bytes_after;
-  guint32 *data = NULL;
+  uint32_t *data = NULL;
   int rc, format;
   Atom type;
 
@@ -320,14 +320,14 @@ get_device_ids (XIDeviceInfo  *info,
   return TRUE;
 }
 
-static gchar *
+static char *
 get_device_node_path (XIDeviceInfo *info)
 {
   gulong nitems, bytes_after;
   guchar *data;
   int rc, format;
   Atom prop, type;
-  gchar *node_path;
+  char *node_path;
 
   prop = XInternAtom (clutter_x11_get_default_display (), "Device Node", False);
   if (prop == None)
@@ -357,10 +357,10 @@ get_device_node_path (XIDeviceInfo *info)
 
 static void
 get_pad_features (XIDeviceInfo *info,
-                  guint        *n_rings,
-                  guint        *n_strips)
+                  uint32_t     *n_rings,
+                  uint32_t     *n_strips)
 {
-  gint i, rings = 0, strips = 0;
+  int i, rings = 0, strips = 0;
 
   for (i = PAD_AXIS_FIRST; i < info->num_classes; i++)
     {
@@ -392,7 +392,7 @@ guess_source_from_wacom_type (XIDeviceInfo            *info,
                               ClutterInputDeviceType  *source_out)
 {
   gulong nitems, bytes_after;
-  guint32 *data = NULL;
+  uint32_t *data = NULL;
   int rc, format;
   Atom type;
   Atom prop;
@@ -449,7 +449,7 @@ guess_source_from_wacom_type (XIDeviceInfo            *info,
     }
   else if (device_type == types[WACOM_TYPE_TOUCH])
     {
-        guint num_touches = 0;
+        uint32_t num_touches = 0;
 
         if (!is_touch_device (info->classes, info->num_classes,
                               source_out, &num_touches))
@@ -472,8 +472,8 @@ create_device (MetaDeviceManagerX11 *manager_xi2,
   ClutterInputDevice *retval;
   ClutterInputMode mode;
   gboolean is_enabled;
-  guint num_touches = 0, num_rings = 0, num_strips = 0;
-  gchar *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
+  uint32_t num_touches = 0, num_rings = 0, num_strips = 0;
+  char *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
 
   if (info->use == XIMasterKeyboard || info->use == XISlaveKeyboard)
     {
@@ -492,7 +492,7 @@ create_device (MetaDeviceManagerX11 *manager_xi2,
     }
   else if (!guess_source_from_wacom_type (info, &source))
     {
-      gchar *name;
+      char *name;
 
       name = g_ascii_strdown (info->name, -1);
 
@@ -589,7 +589,7 @@ pad_passive_button_grab (ClutterInputDevice *device)
 {
   XIGrabModifiers xi_grab_mods = { XIAnyModifier, };
   XIEventMask xi_event_mask;
-  gint device_id, rc;
+  int device_id, rc;
 
   device_id = clutter_input_device_get_device_id (device);
 
@@ -688,7 +688,7 @@ add_device (MetaDeviceManagerX11 *manager_xi2,
 
 static void
 remove_device (MetaDeviceManagerX11 *manager_xi2,
-               gint                  device_id)
+               int                   device_id)
 {
   ClutterInputDevice *device;
 
@@ -923,24 +923,24 @@ print_keysym (uint32_t symbol,
   return 1;
 }
 
-static gdouble *
+static double *
 translate_axes (ClutterInputDevice *device,
-                gdouble             x,
-                gdouble             y,
+                double              x,
+                double              y,
                 XIValuatorState    *valuators)
 {
-  guint n_axes = clutter_input_device_get_n_axes (device);
-  guint i;
-  gdouble *retval;
+  uint32_t n_axes = clutter_input_device_get_n_axes (device);
+  uint32_t i;
+  double *retval;
   double *values;
 
-  retval = g_new0 (gdouble, n_axes);
+  retval = g_new0 (double, n_axes);
   values = valuators->values;
 
   for (i = 0; i < valuators->mask_len * 8; i++)
     {
       ClutterInputAxis axis;
-      gdouble val;
+      double val;
 
       if (!XIMaskIsSet (valuators->mask, i))
         continue;
@@ -971,18 +971,18 @@ static gboolean
 translate_pad_axis (ClutterInputDevice *device,
                     XIValuatorState    *valuators,
                     ClutterEventType   *evtype,
-                    guint              *number,
-                    gdouble            *value)
+                    uint32_t           *number,
+                    double             *value)
 {
   double *values;
-  gint i;
+  int i;
 
   values = valuators->values;
 
   for (i = PAD_AXIS_FIRST; i < valuators->mask_len * 8; i++)
     {
-      gdouble val;
-      guint axis_number = 0;
+      double val;
+      uint32_t axis_number = 0;
 
       if (!XIMaskIsSet (valuators->mask, i))
         continue;
@@ -1017,15 +1017,15 @@ translate_pad_axis (ClutterInputDevice *device,
 
 static void
 translate_coords (MetaStageX11 *stage_x11,
-                  gdouble       event_x,
-                  gdouble       event_y,
-                  gfloat       *x_out,
-                  gfloat       *y_out)
+                  double        event_x,
+                  double        event_y,
+                  float        *x_out,
+                  float        *y_out)
 {
   ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
   ClutterActor *stage = CLUTTER_ACTOR (stage_cogl->wrapper);
-  gfloat stage_width;
-  gfloat stage_height;
+  float stage_width;
+  float stage_height;
 
   clutter_actor_get_size (stage, &stage_width, &stage_height);
 
@@ -1033,14 +1033,14 @@ translate_coords (MetaStageX11 *stage_x11,
   *y_out = CLAMP (event_y, 0, stage_height);
 }
 
-static gdouble
+static double
 scroll_valuators_changed (ClutterInputDevice *device,
                           XIValuatorState    *valuators,
-                          gdouble            *dx_p,
-                          gdouble            *dy_p)
+                          double             *dx_p,
+                          double             *dy_p)
 {
   gboolean retval = FALSE;
-  guint n_axes, n_val, i;
+  uint32_t n_axes, n_val, i;
   double *values;
 
   n_axes = clutter_input_device_get_n_axes (device);
@@ -1053,7 +1053,7 @@ scroll_valuators_changed (ClutterInputDevice *device,
   for (i = 0; i < MIN (valuators->mask_len * 8, n_axes); i++)
     {
       ClutterScrollDirection direction;
-      gdouble delta;
+      double delta;
 
       if (!XIMaskIsSet (valuators->mask, i))
         continue;
@@ -1114,12 +1114,12 @@ meta_device_manager_x11_select_stage_events (ClutterDeviceManager *manager,
   g_free (mask);
 }
 
-static guint
+static uint
 device_get_tool_serial (ClutterInputDevice *device)
 {
   gulong nitems, bytes_after;
-  guint32 *data = NULL;
-  guint serial_id = 0;
+  uint32_t *data = NULL;
+  int serial_id = 0;
   int rc, format;
   Atom type;
   Atom prop;
@@ -1160,7 +1160,7 @@ handle_property_event (MetaDeviceManagerX11 *manager_xi2,
     {
       ClutterInputDeviceTool *tool = NULL;
       ClutterInputDeviceToolType type;
-      guint serial_id;
+      int serial_id;
 
       serial_id = device_get_tool_serial (device);
 
@@ -1189,8 +1189,8 @@ translate_pad_event (ClutterEvent       *event,
                      XIDeviceEvent      *xev,
                      ClutterInputDevice *device)
 {
-  gdouble value;
-  guint number, mode = 0;
+  double value;
+  uint32_t number, mode = 0;
 
   if (!translate_pad_axis (device, &xev->valuators,
                            &event->any.type,
@@ -1642,7 +1642,7 @@ meta_device_manager_x11_translate_event (MetaDeviceManagerX11 *manager_xi2,
     case XI_Motion:
       {
         XIDeviceEvent *xev = (XIDeviceEvent *) xi_event;
-        gdouble delta_x, delta_y;
+        double delta_x, delta_y;
 
         source_device = g_hash_table_lookup (manager_xi2->devices_by_id,
                                              GINT_TO_POINTER (xev->sourceid));
diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c
index ff1719b4e..c04c1404e 100644
--- a/src/backends/x11/meta-input-device-x11.c
+++ b/src/backends/x11/meta-input-device-x11.c
@@ -29,10 +29,10 @@ struct _MetaInputDeviceX11
 {
   ClutterInputDevice device;
 
-  gint device_id;
+  int32_t device_id;
   ClutterInputDeviceTool *current_tool;
 
-  guint inhibit_pointer_query_timer;
+  int inhibit_pointer_query_timer;
   gboolean query_status;
   float current_x;
   float current_y;
@@ -67,7 +67,7 @@ meta_input_device_x11_constructed (GObject *object)
 #ifdef HAVE_LIBWACOM
   if (clutter_input_device_get_device_type (CLUTTER_INPUT_DEVICE (object)) == CLUTTER_PAD_DEVICE)
     {
-      device_xi2->group_modes = g_array_new (FALSE, TRUE, sizeof (guint));
+      device_xi2->group_modes = g_array_new (FALSE, TRUE, sizeof (uint32_t));
       g_array_set_size (device_xi2->group_modes,
                         clutter_input_device_get_n_mode_groups (CLUTTER_INPUT_DEVICE (object)));
     }
@@ -76,8 +76,8 @@ meta_input_device_x11_constructed (GObject *object)
 
 static gboolean
 meta_input_device_x11_keycode_to_evdev (ClutterInputDevice *device,
-                                        guint               hardware_keycode,
-                                        guint              *evdev_keycode)
+                                        uint32_t            hardware_keycode,
+                                        uint32_t           *evdev_keycode)
 {
   /* When using evdev under X11 the hardware keycodes are the evdev
      keycodes plus 8. I haven't been able to find any documentation to
@@ -114,9 +114,9 @@ meta_input_device_x11_finalize (GObject *object)
   G_OBJECT_CLASS (meta_input_device_x11_parent_class)->finalize (object);
 }
 
-static gint
+static int
 meta_input_device_x11_get_group_n_modes (ClutterInputDevice *device,
-                                         gint                group)
+                                         int                 group)
 {
 #ifdef HAVE_LIBWACOM
   MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
@@ -146,7 +146,7 @@ meta_input_device_x11_get_group_n_modes (ClutterInputDevice *device,
 #ifdef HAVE_LIBWACOM
 static int
 meta_input_device_x11_get_button_group (ClutterInputDevice *device,
-                                        guint               button)
+                                        uint32_t            button)
 {
   MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
 
@@ -165,8 +165,8 @@ meta_input_device_x11_get_button_group (ClutterInputDevice *device,
 
 static gboolean
 meta_input_device_x11_is_mode_switch_button (ClutterInputDevice *device,
-                                             guint               group,
-                                             guint               button)
+                                             uint32_t            group,
+                                             uint32_t            button)
 {
   int button_group = -1;
 
@@ -223,17 +223,17 @@ meta_input_device_x11_translate_state (ClutterEvent    *event,
                                        XIButtonState   *buttons_state,
                                        XIGroupState    *group_state)
 {
-  guint button = 0;
-  guint base = 0;
-  guint latched = 0;
-  guint locked = 0;
-  guint effective;
+  uint32_t button = 0;
+  uint32_t base = 0;
+  uint32_t latched = 0;
+  uint32_t locked = 0;
+  uint32_t effective;
 
   if (modifiers_state)
     {
-      base = (guint) modifiers_state->base;
-      latched = (guint) modifiers_state->latched;
-      locked = (guint) modifiers_state->locked;
+      base = (uint32_t) modifiers_state->base;
+      latched = (uint32_t) modifiers_state->latched;
+      locked = (uint32_t) modifiers_state->locked;
     }
 
   if (buttons_state)
@@ -371,27 +371,27 @@ meta_input_device_x11_ensure_wacom_info (ClutterInputDevice  *device,
                                                      WFALLBACK_NONE, NULL);
 }
 
-guint
+uint32_t
 meta_input_device_x11_get_pad_group_mode (ClutterInputDevice *device,
-                                          guint               group)
+                                          uint32_t            group)
 {
   MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
 
   if (group >= device_xi2->group_modes->len)
     return 0;
 
-  return g_array_index (device_xi2->group_modes, guint, group);
+  return g_array_index (device_xi2->group_modes, uint32_t, group);
 }
 
 void
 meta_input_device_x11_update_pad_state (ClutterInputDevice *device,
-                                        guint               button,
-                                        guint               state,
-                                        guint              *group,
-                                        guint              *mode)
+                                        uint32_t            button,
+                                        uint32_t            state,
+                                        uint32_t           *group,
+                                        uint32_t           *mode)
 {
   MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (device);
-  guint button_group, *group_mode;
+  uint32_t button_group, *group_mode;
   gboolean is_mode_switch = FALSE;
 
   button_group = meta_input_device_x11_get_button_group (device, button);
@@ -403,11 +403,11 @@ meta_input_device_x11_update_pad_state (ClutterInputDevice *device,
   if (button_group >= device_xi2->group_modes->len)
     return;
 
-  group_mode = &g_array_index (device_xi2->group_modes, guint, button_group);
+  group_mode = &g_array_index (device_xi2->group_modes, uint32_t, button_group);
 
   if (is_mode_switch && state)
     {
-      guint next, n_modes;
+      uint32_t next, n_modes;
 
       n_modes = clutter_input_device_get_group_n_modes (device, button_group);
       next = (*group_mode + 1) % n_modes;
diff --git a/src/backends/x11/meta-input-device-x11.h b/src/backends/x11/meta-input-device-x11.h
index bdfbeb6b1..eacef955a 100644
--- a/src/backends/x11/meta-input-device-x11.h
+++ b/src/backends/x11/meta-input-device-x11.h
@@ -54,14 +54,14 @@ ClutterInputDeviceTool * meta_input_device_x11_get_current_tool (ClutterInputDev
 void meta_input_device_x11_ensure_wacom_info (ClutterInputDevice  *device,
                                               WacomDeviceDatabase *wacom_db);
 
-guint meta_input_device_x11_get_pad_group_mode (ClutterInputDevice *device,
-                                                guint               group);
+uint32_t meta_input_device_x11_get_pad_group_mode (ClutterInputDevice *device,
+                                                   uint32_t            group);
 
 void meta_input_device_x11_update_pad_state (ClutterInputDevice *device,
-                                             guint               button,
-                                             guint               state,
-                                             guint              *group,
-                                             guint              *mode);
+                                             uint32_t            button,
+                                             uint32_t            state,
+                                             uint32_t           *group,
+                                             uint32_t           *mode);
 
 #endif
 
diff --git a/src/backends/x11/meta-keymap-x11.c b/src/backends/x11/meta-keymap-x11.c
index 5f3418449..e0c1c2a55 100644
--- a/src/backends/x11/meta-keymap-x11.c
+++ b/src/backends/x11/meta-keymap-x11.c
@@ -36,14 +36,14 @@ typedef struct _ClutterKeymapKey        ClutterKeymapKey;
 
 struct _ClutterKeymapKey
 {
-  guint keycode;
-  guint group;
-  guint level;
+  uint32_t keycode;
+  uint32_t group;
+  uint32_t level;
 };
 
 struct _DirectionCacheEntry
 {
-  guint serial;
+  uint32_t serial;
   Atom group_atom;
   PangoDirection direction;
 };
@@ -67,23 +67,23 @@ struct _MetaKeymapX11
 
   XkbDescPtr xkb_desc;
   int xkb_event_base;
-  guint xkb_map_serial;
+  uint32_t xkb_map_serial;
   Atom current_group_atom;
-  guint current_cache_serial;
+  uint32_t current_cache_serial;
   DirectionCacheEntry group_direction_cache[4];
   int current_group;
 
   GHashTable *reserved_keycodes;
   GQueue *available_keycodes;
 
-  guint keymap_serial;
+  uint32_t keymap_serial;
 
-  guint caps_lock_state : 1;
-  guint num_lock_state  : 1;
-  guint has_direction   : 1;
+  uint32_t caps_lock_state : 1;
+  uint32_t num_lock_state  : 1;
+  uint32_t has_direction   : 1;
 
-  guint use_xkb : 1;
-  guint have_xkb_autorepeat : 1;
+  uint32_t use_xkb : 1;
+  uint32_t have_xkb_autorepeat : 1;
 };
 
 enum
@@ -105,7 +105,7 @@ update_modmap (Display       *display,
                MetaKeymapX11 *keymap_x11)
 {
   static struct {
-    const gchar *name;
+    const char *name;
     Atom atom;
     ClutterModifierType mask;
   } vmods[] = {
@@ -201,7 +201,7 @@ get_xkb (MetaKeymapX11 *keymap_x11)
 
 static void
 update_locked_mods (MetaKeymapX11 *keymap_x11,
-                    gint           locked_mods)
+                    int            locked_mods)
 {
   gboolean old_caps_lock_state, old_num_lock_state;
 
@@ -344,8 +344,8 @@ meta_keymap_x11_constructed (GObject *object)
 {
   MetaKeymapX11 *keymap_x11 = META_KEYMAP_X11 (object);
   Display *xdisplay = clutter_x11_get_default_display ();
-  gint xkb_major = XkbMajorVersion;
-  gint xkb_minor = XkbMinorVersion;
+  int xkb_major = XkbMajorVersion;
+  int xkb_minor = XkbMinorVersion;
 
   g_assert (keymap_x11->backend != NULL);
 
@@ -414,9 +414,9 @@ meta_keymap_x11_refresh_reserved_keycodes (MetaKeymapX11 *keymap_x11)
   g_hash_table_iter_init (&iter, keymap_x11->reserved_keycodes);
   while (g_hash_table_iter_next (&iter, &key, &value))
     {
-      guint reserved_keycode = GPOINTER_TO_UINT (key);
-      guint reserved_keysym = GPOINTER_TO_UINT (value);
-      guint actual_keysym = XkbKeycodeToKeysym (dpy, reserved_keycode, 0, 0);
+      uint32_t reserved_keycode = GPOINTER_TO_UINT (key);
+      uint32_t reserved_keysym = GPOINTER_TO_UINT (value);
+      uint32_t actual_keysym = XkbKeycodeToKeysym (dpy, reserved_keycode, 0, 0);
 
       /* If an available keycode is no longer mapped to the stored keysym, then
        * the keycode should not be considered available anymore and should be
@@ -486,7 +486,7 @@ meta_keymap_x11_finalize (GObject *object)
   g_hash_table_iter_init (&iter, keymap->reserved_keycodes);
   while (g_hash_table_iter_next (&iter, &key, &value))
     {
-      guint keycode = GPOINTER_TO_UINT (key);
+      uint32_t keycode = GPOINTER_TO_UINT (key);
       meta_keymap_x11_replace_keycode (keymap, keycode, NoSymbol);
     }
 
@@ -594,7 +594,7 @@ meta_keymap_x11_handle_event (MetaKeymapX11 *keymap_x11,
   return retval;
 }
 
-gint
+int
 meta_keymap_x11_get_key_group (MetaKeymapX11       *keymap,
                                ClutterModifierType  state)
 {
@@ -610,9 +610,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
  */
 static int
 translate_keysym (MetaKeymapX11 *keymap,
-                  guint          hardware_keycode)
+                  uint32_t       hardware_keycode)
 {
-  gint retval;
+  int retval;
 
   retval = XKeycodeToKeysym (clutter_x11_get_default_display (),
                              hardware_keycode, 0);
@@ -621,15 +621,15 @@ translate_keysym (MetaKeymapX11 *keymap,
 
 G_GNUC_END_IGNORE_DEPRECATIONS
 
-gint
+int
 meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
-                                     guint                hardware_keycode,
+                                     uint32_t             hardware_keycode,
                                      ClutterModifierType *modifier_state_p,
                                      ClutterModifierType *mods_p)
 {
   ClutterModifierType unconsumed_modifiers = 0;
   ClutterModifierType modifier_state = *modifier_state_p;
-  gint retval;
+  int retval;
 
   g_return_val_if_fail (META_IS_KEYMAP_X11 (keymap), 0);
 
@@ -662,7 +662,7 @@ meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
 
 gboolean
 meta_keymap_x11_get_is_modifier (MetaKeymapX11 *keymap,
-                                 gint           keycode)
+                                 int            keycode)
 {
   g_return_val_if_fail (META_IS_KEYMAP_X11 (keymap), FALSE);
 
@@ -704,26 +704,26 @@ meta_keymap_x11_get_direction (MetaKeymapX11 *keymap)
 
 static gboolean
 meta_keymap_x11_get_entries_for_keyval (MetaKeymapX11     *keymap_x11,
-                                        guint              keyval,
+                                        uint32_t           keyval,
                                         ClutterKeymapKey **keys,
-                                        gint              *n_keys)
+                                        int               *n_keys)
 {
   if (keymap_x11->use_xkb)
     {
       XkbDescRec *xkb = get_xkb (keymap_x11);
       GArray *retval;
-      gint keycode;
+      int keycode;
 
       keycode = keymap_x11->min_keycode;
       retval = g_array_new (FALSE, FALSE, sizeof (ClutterKeymapKey));
 
       while (keycode <= keymap_x11->max_keycode)
         {
-          gint max_shift_levels = XkbKeyGroupsWidth (xkb, keycode);
-          gint group = 0;
-          gint level = 0;
-          gint total_syms = XkbKeyNumSyms (xkb, keycode);
-          gint i = 0;
+          int max_shift_levels = XkbKeyGroupsWidth (xkb, keycode);
+          int group = 0;
+          int level = 0;
+          int total_syms = XkbKeyNumSyms (xkb, keycode);
+          int i = 0;
           KeySym *entry;
 
           /* entry is an array with all syms for group 0, all
@@ -785,7 +785,7 @@ meta_keymap_x11_get_entries_for_keyval (MetaKeymapX11     *keymap_x11,
     }
 }
 
-static guint
+static uint32_t
 meta_keymap_x11_get_available_keycode (MetaKeymapX11 *keymap_x11)
 {
   if (keymap_x11->use_xkb)
@@ -796,7 +796,7 @@ meta_keymap_x11_get_available_keycode (MetaKeymapX11 *keymap_x11)
         {
           Display *dpy = clutter_x11_get_default_display ();
           XkbDescPtr xkb = get_xkb (keymap_x11);
-          guint i;
+          uint32_t i;
 
           for (i = xkb->max_key_code; i >= xkb->min_key_code; --i)
             {
@@ -813,8 +813,8 @@ meta_keymap_x11_get_available_keycode (MetaKeymapX11 *keymap_x11)
 
 gboolean
 meta_keymap_x11_reserve_keycode (MetaKeymapX11 *keymap_x11,
-                                 guint          keyval,
-                                 guint         *keycode_out)
+                                 uint32_t       keyval,
+                                 uint32_t      *keycode_out)
 {
   g_return_val_if_fail (META_IS_KEYMAP_X11 (keymap_x11), FALSE);
   g_return_val_if_fail (keyval != 0, FALSE);
@@ -842,7 +842,7 @@ meta_keymap_x11_reserve_keycode (MetaKeymapX11 *keymap_x11,
 
 void
 meta_keymap_x11_release_keycode_if_needed (MetaKeymapX11 *keymap_x11,
-                                           guint          keycode)
+                                           uint32_t       keycode)
 {
   g_return_if_fail (META_IS_KEYMAP_X11 (keymap_x11));
 
@@ -896,12 +896,12 @@ meta_keymap_x11_get_current_group (MetaKeymapX11 *keymap_x11)
 
 gboolean
 meta_keymap_x11_keycode_for_keyval (MetaKeymapX11 *keymap_x11,
-                                    guint          keyval,
-                                    guint         *keycode_out,
-                                    guint         *level_out)
+                                    uint32_t       keyval,
+                                    uint32_t      *keycode_out,
+                                    uint32_t      *level_out)
 {
   ClutterKeymapKey *keys;
-  gint i, n_keys, group;
+  int i, n_keys, group;
   gboolean found = FALSE;
 
   g_return_val_if_fail (keycode_out != NULL, FALSE);
@@ -930,8 +930,8 @@ meta_keymap_x11_keycode_for_keyval (MetaKeymapX11 *keymap_x11,
       g_hash_table_iter_init (&iter, keymap_x11->reserved_keycodes);
       while (!found && g_hash_table_iter_next (&iter, &key, &value))
         {
-          guint reserved_keycode = GPOINTER_TO_UINT (key);
-          guint reserved_keysym = GPOINTER_TO_UINT (value);
+          uint32_t reserved_keycode = GPOINTER_TO_UINT (key);
+          uint32_t reserved_keysym = GPOINTER_TO_UINT (value);
 
           if (keyval == reserved_keysym)
             {
diff --git a/src/backends/x11/meta-keymap-x11.h b/src/backends/x11/meta-keymap-x11.h
index 0c1c608dc..e4e3a67e1 100644
--- a/src/backends/x11/meta-keymap-x11.h
+++ b/src/backends/x11/meta-keymap-x11.h
@@ -31,14 +31,14 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (MetaKeymapX11, meta_keymap_x11,
                       META, KEYMAP_X11, ClutterKeymap)
 
-gint     meta_keymap_x11_get_key_group       (MetaKeymapX11       *keymap,
+int      meta_keymap_x11_get_key_group       (MetaKeymapX11       *keymap,
                                               ClutterModifierType  state);
-gint     meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
+int      meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
                                               guint                hardware_keycode,
                                               ClutterModifierType *modifier_state_p,
                                               ClutterModifierType *mods_p);
 gboolean meta_keymap_x11_get_is_modifier     (MetaKeymapX11       *keymap,
-                                              gint                 keycode);
+                                              int                  keycode);
 
 PangoDirection meta_keymap_x11_get_direction (MetaKeymapX11       *keymap);
 
diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c
index d09ecdcb3..0f39bf990 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -71,15 +71,15 @@ G_DEFINE_TYPE_WITH_CODE (MetaStageX11,
 
 static void
 meta_stage_x11_fix_window_size (MetaStageX11 *stage_x11,
-                                gint          new_width,
-                                gint          new_height)
+                                int           new_width,
+                                int           new_height)
 {
   ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
 
   if (stage_x11->xwin != None)
     {
       Display *xdisplay = clutter_x11_get_default_display ();
-      guint min_width, min_height;
+      uint32_t min_width, min_height;
       XSizeHints *size_hints;
 
       size_hints = XAllocSizeHints();
@@ -134,8 +134,8 @@ meta_stage_x11_get_geometry (ClutterStageWindow    *stage_window,
 
 static void
 meta_stage_x11_resize (ClutterStageWindow *stage_window,
-                       gint                width,
-                       gint                height)
+                       int                 width,
+                       int                 height)
 {
   MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
 
@@ -355,7 +355,7 @@ meta_stage_x11_realize (ClutterStageWindow *stage_window)
   ClutterBackend *backend = CLUTTER_BACKEND (stage_cogl->backend);
   Display *xdisplay = clutter_x11_get_default_display ();
   ClutterDeviceManager *device_manager;
-  gfloat width, height;
+  float width, height;
   GError *error = NULL;
 
   clutter_actor_get_size (CLUTTER_ACTOR (stage_cogl->wrapper), &width, &height);
@@ -456,7 +456,7 @@ meta_stage_x11_set_cursor_visible (ClutterStageWindow *stage_window,
 
 static void
 meta_stage_x11_set_title (ClutterStageWindow *stage_window,
-                          const gchar        *title)
+                          const char         *title)
 {
   MetaStageX11 *stage_x11 = META_STAGE_X11 (stage_window);
 
@@ -950,7 +950,7 @@ meta_x11_get_stage_from_window (Window win)
 
 void
 meta_stage_x11_set_user_time (MetaStageX11 *stage_x11,
-                              guint32       user_time)
+                              uint32_t      user_time)
 {
   ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
   ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
diff --git a/src/backends/x11/meta-xkb-a11y-x11.c b/src/backends/x11/meta-xkb-a11y-x11.c
index 92131ee1b..2baed9808 100644
--- a/src/backends/x11/meta-xkb-a11y-x11.c
+++ b/src/backends/x11/meta-xkb-a11y-x11.c
@@ -149,7 +149,7 @@ xkb_a11y_event_filter (XEvent       *xevent,
 static gboolean
 is_xkb_available (Display *xdisplay)
 {
-  gint opcode, error_base, event_base, major, minor;
+  int opcode, error_base, event_base, major, minor;
 
   if (_xkb_event_base)
     return TRUE;
@@ -253,8 +253,8 @@ meta_device_manager_x11_apply_kbd_a11y_settings (ClutterDeviceManager   *device_
   else if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
                          CLUTTER_A11Y_MOUSE_KEYS_ENABLED, XkbMouseKeysMask | XkbMouseKeysAccelMask))
     {
-      gint mk_max_speed;
-      gint mk_accel_time;
+      int mk_max_speed;
+      int mk_accel_time;
 
       desc->ctrls->mk_interval     = 100;     /* msec between mousekey events */
       desc->ctrls->mk_curve        = 50;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]