[mutter/wip/carlosg/input-in-backends: 237/241] backends: Don't use glib types



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

    backends: Don't use glib types

 src/backends/x11/meta-device-manager-x11.c | 30 +++++++++++++-------------
 src/backends/x11/meta-input-device-x11.c   | 12 +++++------
 src/backends/x11/meta-keymap-x11.c         | 34 +++++++++++++++---------------
 src/backends/x11/meta-keymap-x11.h         |  6 +++---
 src/backends/x11/meta-stage-x11.c          | 12 +++++------
 src/backends/x11/meta-xkb-a11y-x11.c       |  6 +++---
 6 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/src/backends/x11/meta-device-manager-x11.c b/src/backends/x11/meta-device-manager-x11.c
index a9f466f2d..dc070f2c3 100644
--- a/src/backends/x11/meta-device-manager-x11.c
+++ b/src/backends/x11/meta-device-manager-x11.c
@@ -156,7 +156,7 @@ translate_device_classes (Display             *xdisplay,
                           XIAnyClassInfo     **classes,
                           guint                n_classes)
 {
-  gint i;
+  int i;
 
   for (i = 0; i < n_classes; i++)
     {
@@ -167,7 +167,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);
@@ -246,7 +246,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;
@@ -274,11 +274,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;
 
@@ -306,14 +306,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)
@@ -346,7 +346,7 @@ get_pad_features (XIDeviceInfo *info,
                   guint        *n_rings,
                   guint        *n_strips)
 {
-  gint i, rings = 0, strips = 0;
+  int i, rings = 0, strips = 0;
 
   for (i = PAD_AXIS_FIRST; i < info->num_classes; i++)
     {
@@ -378,7 +378,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;
@@ -459,7 +459,7 @@ create_device (MetaDeviceManagerX11 *manager_xi2,
   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;
+  char *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
 
   if (info->use == XIMasterKeyboard || info->use == XISlaveKeyboard)
     {
@@ -478,7 +478,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);
 
@@ -570,7 +570,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);
 
@@ -669,7 +669,7 @@ add_device (MetaDeviceManagerX11 *manager_xi2,
 
 static void
 remove_device (MetaDeviceManagerX11 *manager_xi2,
-               gint                  device_id)
+               int                   device_id)
 {
   ClutterInputDevice *device;
 
@@ -947,7 +947,7 @@ translate_pad_axis (ClutterInputDevice *device,
                     gdouble            *value)
 {
   double *values;
-  gint i;
+  int i;
 
   values = valuators->values;
 
diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c
index 3060553f5..2bd465f4e 100644
--- a/src/backends/x11/meta-input-device-x11.c
+++ b/src/backends/x11/meta-input-device-x11.c
@@ -29,7 +29,7 @@ struct _MetaInputDeviceX11
 {
   ClutterInputDevice device;
 
-  gint device_id;
+  int32_t device_id;
   ClutterInputDeviceTool *current_tool;
 
   guint inhibit_pointer_query_timer;
@@ -67,7 +67,7 @@ meta_input_device_x11_constructed (GObject *gobject)
 #ifdef HAVE_LIBWACOM
   if (clutter_input_device_get_device_type (CLUTTER_INPUT_DEVICE (gobject)) == 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 (gobject)));
     }
@@ -76,8 +76,8 @@ meta_input_device_x11_constructed (GObject *gobject)
 
 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);
diff --git a/src/backends/x11/meta-keymap-x11.c b/src/backends/x11/meta-keymap-x11.c
index 2e71c148d..e7ce8afe4 100644
--- a/src/backends/x11/meta-keymap-x11.c
+++ b/src/backends/x11/meta-keymap-x11.c
@@ -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;
 
@@ -340,8 +340,8 @@ meta_keymap_x11_constructed (GObject *gobject)
 {
   MetaKeymapX11 *keymap_x11 = META_KEYMAP_X11 (gobject);
   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);
 
@@ -588,7 +588,7 @@ meta_keymap_x11_handle_event (MetaKeymapX11 *keymap_x11,
   return retval;
 }
 
-gint
+int
 meta_keymap_x11_get_key_group (MetaKeymapX11       *keymap,
                                ClutterModifierType  state)
 {
@@ -606,7 +606,7 @@ static int
 translate_keysym (MetaKeymapX11 *keymap,
                   guint          hardware_keycode)
 {
-  gint retval;
+  int retval;
 
   retval = XKeycodeToKeysym (clutter_x11_get_default_display (),
                              hardware_keycode, 0);
@@ -615,7 +615,7 @@ translate_keysym (MetaKeymapX11 *keymap,
 
 G_GNUC_END_IGNORE_DEPRECATIONS
 
-gint
+int
 meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
                                      guint                hardware_keycode,
                                      ClutterModifierType *modifier_state_p,
@@ -623,7 +623,7 @@ meta_keymap_x11_translate_key_state (MetaKeymapX11       *keymap,
 {
   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);
 
@@ -656,7 +656,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);
 
@@ -700,24 +700,24 @@ static gboolean
 meta_keymap_x11_get_entries_for_keyval (MetaKeymapX11     *keymap_x11,
                                         guint              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
@@ -895,7 +895,7 @@ meta_keymap_x11_keycode_for_keyval (MetaKeymapX11 *keymap_x11,
                                     guint         *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);
diff --git a/src/backends/x11/meta-keymap-x11.h b/src/backends/x11/meta-keymap-x11.h
index e2bb52634..cbd1a390e 100644
--- a/src/backends/x11/meta-keymap-x11.h
+++ b/src/backends/x11/meta-keymap-x11.h
@@ -30,14 +30,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 ce0f7866d..a12920bf5 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -127,8 +127,8 @@ update_state (MetaStageX11      *stage_x11,
 
 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);
 
@@ -230,8 +230,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);
 
@@ -660,7 +660,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);
 
@@ -1075,7 +1075,7 @@ meta_stage_x11_translate_event (MetaStageX11 *stage_x11,
         {
           Display *xdisplay = clutter_x11_get_default_display ();
           Atom     type;
-          gint     format;
+          int      format;
           gulong   n_items, bytes_after;
           guchar  *data = NULL;
           gboolean fullscreen_set = FALSE;
diff --git a/src/backends/x11/meta-xkb-a11y-x11.c b/src/backends/x11/meta-xkb-a11y-x11.c
index b0e7c9af4..9c3706ede 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]