[mutter/wip/carlosg/input-in-backends: 7/9] backends: Don't use glib types in new native backend objects



commit c9c30a445d116d7050e8c00b083e5e15303040c8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 16 19:33:43 2019 +0200

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

 src/backends/native/meta-device-manager-native.c   | 164 ++++++++++-----------
 src/backends/native/meta-device-manager-native.h   |  22 +--
 src/backends/native/meta-event-native.c            |  12 +-
 src/backends/native/meta-event-native.h            |   8 +-
 src/backends/native/meta-input-device-native.c     |  78 +++++-----
 src/backends/native/meta-input-device-native.h     |  24 +--
 .../native/meta-input-device-tool-native.c         |  30 ++--
 .../native/meta-input-device-tool-native.h         |  16 +-
 src/backends/native/meta-seat-native.c             |  28 ++--
 src/backends/native/meta-seat-native.h             |  22 +--
 10 files changed, 202 insertions(+), 202 deletions(-)
---
diff --git a/src/backends/native/meta-device-manager-native.c 
b/src/backends/native/meta-device-manager-native.c
index 8fe655f6d..c8246e33e 100644
--- a/src/backends/native/meta-device-manager-native.c
+++ b/src/backends/native/meta-device-manager-native.c
@@ -252,10 +252,10 @@ meta_device_manager_native_filter_relative_motion (MetaDeviceManagerNative *mana
 
 static ClutterEvent *
 new_absolute_motion_event (ClutterInputDevice *input_device,
-                           guint64             time_us,
-                           gfloat              x,
-                           gfloat              y,
-                           gdouble            *axes)
+                           uint64_t            time_us,
+                           float               x,
+                           float               y,
+                           double             *axes)
 {
   gfloat stage_width, stage_height;
   MetaDeviceManagerNative *manager_evdev;
@@ -324,10 +324,10 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
 
 static void
 notify_absolute_motion (ClutterInputDevice *input_device,
-                        guint64             time_us,
-                        gfloat              x,
-                        gfloat              y,
-                        gdouble            *axes)
+                        uint64_t            time_us,
+                        float               x,
+                        float               y,
+                        double             *axes)
 {
   ClutterEvent *event;
 
@@ -338,10 +338,10 @@ notify_absolute_motion (ClutterInputDevice *input_device,
 
 static void
 notify_relative_tool_motion (ClutterInputDevice *input_device,
-                             guint64             time_us,
-                             gfloat              dx,
-                             gfloat              dy,
-                             gdouble            *axes)
+                             uint64_t            time_us,
+                             float               dx,
+                             float               dy,
+                             double             *axes)
 {
   MetaInputDeviceNative *device_evdev;
   ClutterEvent *event;
@@ -369,12 +369,12 @@ notify_relative_tool_motion (ClutterInputDevice *input_device,
 static void
 notify_pinch_gesture_event (ClutterInputDevice          *input_device,
                             ClutterTouchpadGesturePhase  phase,
-                            guint64                      time_us,
-                            gdouble                      dx,
-                            gdouble                      dy,
-                            gdouble                      angle_delta,
-                            gdouble                      scale,
-                            guint                        n_fingers)
+                            uint64_t                     time_us,
+                            double                       dx,
+                            double                       dy,
+                            double                       angle_delta,
+                            double                       scale,
+                            uint32_t                     n_fingers)
 {
   MetaInputDeviceNative *device_evdev;
   MetaSeatNative *seat;
@@ -418,10 +418,10 @@ notify_pinch_gesture_event (ClutterInputDevice          *input_device,
 static void
 notify_swipe_gesture_event (ClutterInputDevice          *input_device,
                             ClutterTouchpadGesturePhase  phase,
-                            guint64                      time_us,
-                            guint                        n_fingers,
-                            gdouble                      dx,
-                            gdouble                      dy)
+                            uint64_t                     time_us,
+                            uint32_t                     n_fingers,
+                            double                       dx,
+                            double                       dy)
 {
   MetaInputDeviceNative *device_evdev;
   MetaSeatNative *seat;
@@ -462,7 +462,7 @@ notify_swipe_gesture_event (ClutterInputDevice          *input_device,
 
 static void
 notify_proximity (ClutterInputDevice *input_device,
-                  guint64             time_us,
+                  uint64_t            time_us,
                   gboolean            in)
 {
   MetaInputDeviceNative *device_evdev;
@@ -499,11 +499,11 @@ notify_proximity (ClutterInputDevice *input_device,
 
 static void
 notify_pad_button (ClutterInputDevice *input_device,
-                   guint64             time_us,
-                   guint32             button,
-                   guint32             mode_group,
-                   guint32             mode,
-                   guint32             pressed)
+                   uint64_t            time_us,
+                   uint32_t            button,
+                   uint32_t            mode_group,
+                   uint32_t            mode,
+                   uint32_t            pressed)
 {
   MetaInputDeviceNative *device_evdev;
   MetaSeatNative *seat;
@@ -540,12 +540,12 @@ notify_pad_button (ClutterInputDevice *input_device,
 
 static void
 notify_pad_strip (ClutterInputDevice *input_device,
-                  guint64             time_us,
-                  guint32             strip_number,
-                  guint32             strip_source,
-                  guint32             mode_group,
-                  guint32             mode,
-                  gdouble             value)
+                  uint64_t            time_us,
+                  uint32_t            strip_number,
+                  uint32_t            strip_source,
+                  uint32_t            mode_group,
+                  uint32_t            mode,
+                  double              value)
 {
   MetaInputDeviceNative *device_evdev;
   ClutterInputDevicePadSource source;
@@ -586,12 +586,12 @@ notify_pad_strip (ClutterInputDevice *input_device,
 
 static void
 notify_pad_ring (ClutterInputDevice *input_device,
-                 guint64             time_us,
-                 guint32             ring_number,
-                 guint32             ring_source,
-                 guint32             mode_group,
-                 guint32             mode,
-                 gdouble             angle)
+                 uint64_t            time_us,
+                 uint32_t            ring_number,
+                 uint32_t            ring_source,
+                 uint32_t            mode_group,
+                 uint32_t            mode,
+                 double              angle)
 {
   MetaInputDeviceNative *device_evdev;
   ClutterInputDevicePadSource source;
@@ -998,7 +998,7 @@ input_device_update_tool (ClutterInputDevice          *input_device,
   MetaInputDeviceNative *evdev_device = META_INPUT_DEVICE_NATIVE (input_device);
   ClutterInputDeviceTool *tool = NULL;
   ClutterInputDeviceToolType tool_type;
-  guint64 tool_serial;
+  uint64_t tool_serial;
 
   if (libinput_tool)
     {
@@ -1161,9 +1161,9 @@ process_tablet_axis (MetaDeviceManagerNative *manager_evdev,
                      struct libinput_event   *event)
 {
   struct libinput_device *libinput_device = libinput_event_get_device (event);
-  guint64 time;
+  uint64_t time;
   double x, y, dx, dy, *axes;
-  gfloat stage_width, stage_height;
+  float stage_width, stage_height;
   ClutterStage *stage;
   ClutterInputDevice *device;
   struct libinput_event_tablet_tool *tablet_event =
@@ -1216,8 +1216,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
     {
     case LIBINPUT_EVENT_KEYBOARD_KEY:
       {
-        guint32 key, key_state, seat_key_count;
-        guint64 time_us;
+        uint32_t key, key_state, seat_key_count;
+        uint64_t time_us;
         struct libinput_event_keyboard *key_event =
           libinput_event_get_keyboard_event (event);
 
@@ -1271,9 +1271,9 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
 
     case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
       {
-        guint64 time_us;
+        uint64_t time_us;
         double x, y;
-        gfloat stage_width, stage_height;
+        float stage_width, stage_height;
         ClutterStage *stage;
         struct libinput_event_pointer *motion_event =
           libinput_event_get_pointer_event (event);
@@ -1303,8 +1303,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
 
     case LIBINPUT_EVENT_POINTER_BUTTON:
       {
-        guint32 button, button_state, seat_button_count;
-        guint64 time_us;
+        uint32_t button, button_state, seat_button_count;
+        uint64_t time_us;
         struct libinput_event_pointer *button_event =
           libinput_event_get_pointer_event (event);
         device = libinput_device_get_user_data (libinput_device);
@@ -1330,7 +1330,7 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
 
     case LIBINPUT_EVENT_POINTER_AXIS:
       {
-        guint64 time_us;
+        uint64_t time_us;
         enum libinput_pointer_axis_source source;
         struct libinput_event_pointer *axis_event =
           libinput_event_get_pointer_event (event);
@@ -1368,9 +1368,9 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
     case LIBINPUT_EVENT_TOUCH_DOWN:
       {
         int device_slot;
-        guint64 time_us;
+        uint64_t time_us;
         double x, y;
-        gfloat stage_width, stage_height;
+        float stage_width, stage_height;
         MetaSeatNative *seat;
         ClutterStage *stage;
         MetaTouchState *touch_state;
@@ -1413,7 +1413,7 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
     case LIBINPUT_EVENT_TOUCH_UP:
       {
         int device_slot;
-        guint64 time_us;
+        uint64_t time_us;
         MetaSeatNative *seat;
         MetaTouchState *touch_state;
         struct libinput_event_touch *touch_event =
@@ -1444,9 +1444,9 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
     case LIBINPUT_EVENT_TOUCH_MOTION:
       {
         int device_slot;
-        guint64 time_us;
+        uint64_t time_us;
         double x, y;
-        gfloat stage_width, stage_height;
+        float stage_width, stage_height;
         MetaSeatNative *seat;
         ClutterStage *stage;
         MetaTouchState *touch_state;
@@ -1490,7 +1490,7 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TOUCH_CANCEL:
       {
-        guint64 time_us;
+        uint64_t time_us;
         struct libinput_event_touch *touch_event =
           libinput_event_get_touch_event (event);
 
@@ -1508,8 +1508,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
         struct libinput_event_gesture *gesture_event =
           libinput_event_get_gesture_event (event);
         ClutterTouchpadGesturePhase phase;
-        guint n_fingers;
-        guint64 time_us;
+        uint32_t n_fingers;
+        uint64_t time_us;
 
         if (libinput_event_get_type (event) == LIBINPUT_EVENT_GESTURE_PINCH_BEGIN)
           phase = CLUTTER_TOUCHPAD_GESTURE_PHASE_BEGIN;
@@ -1528,8 +1528,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
         struct libinput_event_gesture *gesture_event =
           libinput_event_get_gesture_event (event);
         gdouble angle_delta, scale, dx, dy;
-        guint n_fingers;
-        guint64 time_us;
+        uint32_t n_fingers;
+        uint64_t time_us;
 
         n_fingers = libinput_event_gesture_get_finger_count (gesture_event);
         device = libinput_device_get_user_data (libinput_device);
@@ -1550,8 +1550,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
         struct libinput_event_gesture *gesture_event =
           libinput_event_get_gesture_event (event);
         ClutterTouchpadGesturePhase phase;
-        guint32 n_fingers;
-        guint64 time_us;
+        uint32_t n_fingers;
+        uint64_t time_us;
 
         device = libinput_device_get_user_data (libinput_device);
         time_us = libinput_event_gesture_get_time_usec (gesture_event);
@@ -1570,9 +1570,9 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       {
         struct libinput_event_gesture *gesture_event =
           libinput_event_get_gesture_event (event);
-        guint32 n_fingers;
-        guint64 time_us;
-        gdouble dx, dy;
+        uint32_t n_fingers;
+        uint64_t time_us;
+        double dx, dy;
 
         device = libinput_device_get_user_data (libinput_device);
         time_us = libinput_event_gesture_get_time_usec (gesture_event);
@@ -1592,7 +1592,7 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY:
       {
-        guint64 time;
+        uint64_t time;
         struct libinput_event_tablet_tool *tablet_event =
           libinput_event_get_tablet_tool_event (event);
         struct libinput_tablet_tool *libinput_tool = NULL;
@@ -1613,11 +1613,11 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
       {
-        guint64 time_us;
-        guint32 button_state;
+        uint64_t time_us;
+        uint32_t button_state;
         struct libinput_event_tablet_tool *tablet_event =
           libinput_event_get_tablet_tool_event (event);
-        guint tablet_button;
+        uint32_t tablet_button;
 
         process_tablet_axis (manager_evdev, event);
 
@@ -1634,8 +1634,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_TOOL_TIP:
       {
-        guint64 time_us;
-        guint32 button_state;
+        uint64_t time_us;
+        uint32_t button_state;
         struct libinput_event_tablet_tool *tablet_event =
           libinput_event_get_tablet_tool_event (event);
 
@@ -1658,8 +1658,8 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
       {
-        guint64 time;
-        guint32 button_state, button, group, mode;
+        uint64_t time;
+        uint32_t button_state, button, group, mode;
         struct libinput_tablet_pad_mode_group *mode_group;
         struct libinput_event_tablet_pad *pad_event =
           libinput_event_get_tablet_pad_event (event);
@@ -1679,12 +1679,12 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_PAD_STRIP:
       {
-        guint64 time;
-        guint32 number, source, group, mode;
+        uint64_t time;
+        uint32_t number, source, group, mode;
         struct libinput_tablet_pad_mode_group *mode_group;
         struct libinput_event_tablet_pad *pad_event =
           libinput_event_get_tablet_pad_event (event);
-        gdouble value;
+        double value;
 
         device = libinput_device_get_user_data (libinput_device);
         time = libinput_event_tablet_pad_get_time_usec (pad_event);
@@ -1701,12 +1701,12 @@ process_device_event (MetaDeviceManagerNative *manager_evdev,
       }
     case LIBINPUT_EVENT_TABLET_PAD_RING:
       {
-        guint64 time;
-        guint32 number, source, group, mode;
+        uint64_t time;
+        uint32_t number, source, group, mode;
         struct libinput_tablet_pad_mode_group *mode_group;
         struct libinput_event_tablet_pad *pad_event =
           libinput_event_get_tablet_pad_event (event);
-        gdouble angle;
+        double angle;
 
         device = libinput_device_get_user_data (libinput_device);
         time = libinput_event_tablet_pad_get_time_usec (pad_event);
@@ -2547,8 +2547,8 @@ meta_device_manager_native_set_relative_motion_filter (ClutterDeviceManager
 void
 meta_device_manager_native_set_keyboard_repeat (ClutterDeviceManager *evdev,
                                                 gboolean              repeat,
-                                                guint32               delay,
-                                                guint32               interval)
+                                                uint32_t              delay,
+                                                uint32_t              interval)
 {
   MetaDeviceManagerNative *manager_evdev;
   MetaSeatNative *seat;
@@ -2674,7 +2674,7 @@ meta_device_manager_native_remove_filter (MetaEvdevFilterFunc func,
  */
 void
 meta_device_manager_native_warp_pointer (ClutterInputDevice   *pointer_device,
-                                         guint32               time_,
+                                         uint32_t              time_,
                                          int                   x,
                                          int                   y)
 {
diff --git a/src/backends/native/meta-device-manager-native.h 
b/src/backends/native/meta-device-manager-native.h
index ca600d0d4..1f917f6da 100644
--- a/src/backends/native/meta-device-manager-native.h
+++ b/src/backends/native/meta-device-manager-native.h
@@ -75,22 +75,22 @@ void meta_device_manager_native_dispatch (MetaDeviceManagerNative *manager_evdev
 
 struct xkb_state * meta_device_manager_native_get_xkb_state (MetaDeviceManagerNative *manager_evdev);
 
-static inline guint64
-us (guint64 us)
+static inline uint64_t
+us (uint64_t us)
 {
   return us;
 }
 
-static inline guint64
-ms2us (guint64 ms)
+static inline uint64_t
+ms2us (uint64_t ms)
 {
   return us (ms * 1000);
 }
 
-static inline guint32
-us2ms (guint64 us)
+static inline uint32_t
+us2ms (uint64_t us)
 {
-  return (guint32) (us / 1000);
+  return (uint32_t) (us / 1000);
 }
 
 /**
@@ -135,7 +135,7 @@ void  meta_device_manager_native_reclaim_devices (void);
  * to be in the same position.
  */
 typedef void (* MetaPointerConstrainCallback) (ClutterInputDevice *device,
-                                               guint32             time,
+                                               uint32_t            time,
                                                float               prev_x,
                                                float               prev_y,
                                                float              *x,
@@ -173,8 +173,8 @@ void meta_device_manager_native_set_keyboard_numlock (ClutterDeviceManager *evde
 
 void meta_device_manager_native_set_keyboard_repeat (ClutterDeviceManager *evdev,
                                                      gboolean              repeat,
-                                                     guint32               delay,
-                                                     guint32               interval);
+                                                     uint32_t              delay,
+                                                     uint32_t              interval);
 
 typedef gboolean (* MetaEvdevFilterFunc) (struct libinput_event *event,
                                           gpointer               data);
@@ -186,7 +186,7 @@ void meta_device_manager_native_remove_filter (MetaEvdevFilterFunc    func,
                                                gpointer               data);
 
 void meta_device_manager_native_warp_pointer (ClutterInputDevice   *pointer_device,
-                                              guint32               time_,
+                                              uint32_t              time_,
                                               int                   x,
                                               int                   y);
 
diff --git a/src/backends/native/meta-event-native.c b/src/backends/native/meta-event-native.c
index 343a28996..03bffca65 100644
--- a/src/backends/native/meta-event-native.c
+++ b/src/backends/native/meta-event-native.c
@@ -29,9 +29,9 @@ typedef struct _MetaEventNative MetaEventNative;
 
 struct _MetaEventNative
 {
-  guint32 evcode;
+  uint32_t evcode;
 
-  guint64 time_usec;
+  uint64_t time_usec;
 
   gboolean has_relative_motion;
   double dx;
@@ -78,7 +78,7 @@ meta_event_native_ensure_platform_data (ClutterEvent *event)
 
 void
 meta_event_native_set_event_code (ClutterEvent *event,
-                                  guint32       evcode)
+                                  uint32_t      evcode)
 {
   MetaEventNative *event_evdev;
 
@@ -88,7 +88,7 @@ meta_event_native_set_event_code (ClutterEvent *event,
 
 void
 meta_event_native_set_time_usec (ClutterEvent *event,
-                                 guint64       time_usec)
+                                 uint64_t      time_usec)
 {
   MetaEventNative *event_evdev;
 
@@ -122,7 +122,7 @@ meta_event_native_set_relative_motion (ClutterEvent *event,
  *
  * Returns: The event code.
  **/
-guint32
+uint32_t
 meta_event_native_get_event_code (const ClutterEvent *event)
 {
   MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
@@ -141,7 +141,7 @@ meta_event_native_get_event_code (const ClutterEvent *event)
  *
  * Returns: The time in microsecond granularity, or 0 if unavailable.
  */
-guint64
+uint64_t
 meta_event_native_get_time_usec (const ClutterEvent *event)
 {
   MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
diff --git a/src/backends/native/meta-event-native.h b/src/backends/native/meta-event-native.h
index f89a9dab9..b56041f88 100644
--- a/src/backends/native/meta-event-native.h
+++ b/src/backends/native/meta-event-native.h
@@ -28,12 +28,12 @@ typedef struct _MetaEventNative MetaEventNative;
 MetaEventNative * meta_event_native_copy (MetaEventNative *event_evdev);
 void              meta_event_native_free (MetaEventNative *event_evdev);
 
-guint32           meta_event_native_get_event_code (const ClutterEvent *event);
+uint32_t          meta_event_native_get_event_code (const ClutterEvent *event);
 void              meta_event_native_set_event_code (ClutterEvent *event,
-                                                    guint32       evcode);
-guint64           meta_event_native_get_time_usec  (const ClutterEvent *event);
+                                                    uint32_t      evcode);
+uint64_t          meta_event_native_get_time_usec  (const ClutterEvent *event);
 void              meta_event_native_set_time_usec  (ClutterEvent *event,
-                                                    guint64       time_usec);
+                                                    uint64_t      time_usec);
 void              meta_event_native_set_relative_motion (ClutterEvent *event,
                                                          double        dx,
                                                          double        dy,
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c
index b2b71ee1c..75e1d3590 100644
--- a/src/backends/native/meta-input-device-native.c
+++ b/src/backends/native/meta-input-device-native.c
@@ -130,8 +130,8 @@ meta_input_device_native_get_property (GObject    *object,
 
 static gboolean
 meta_input_device_native_keycode_to_evdev (ClutterInputDevice *device,
-                                           guint hardware_keycode,
-                                           guint *evdev_keycode)
+                                           uint32_t            hardware_keycode,
+                                           uint32_t           *evdev_keycode)
 {
   /* The hardware keycodes from the evdev backend are almost evdev
      keycodes: we use the evdev keycode file, but xkb rules have an
@@ -182,8 +182,8 @@ meta_input_device_native_update_from_tool (ClutterInputDevice     *device,
 
 static gboolean
 meta_input_device_native_is_mode_switch_button (ClutterInputDevice *device,
-                                                guint               group,
-                                                guint               button)
+                                                uint32_t            group,
+                                                uint32_t            button)
 {
   struct libinput_device *libinput_device;
   struct libinput_tablet_pad_mode_group *mode_group;
@@ -194,9 +194,9 @@ meta_input_device_native_is_mode_switch_button (ClutterInputDevice *device,
   return libinput_tablet_pad_mode_group_button_is_toggle (mode_group, button) != 0;
 }
 
-static gint
+static int
 meta_input_device_native_get_group_n_modes (ClutterInputDevice *device,
-                                            gint                group)
+                                            int                 group)
 {
   struct libinput_device *libinput_device;
   struct libinput_tablet_pad_mode_group *mode_group;
@@ -281,7 +281,7 @@ trigger_slow_keys (gpointer data)
   return G_SOURCE_REMOVE;
 }
 
-static gint
+static int
 find_pending_event_by_keycode (gconstpointer a,
                                gconstpointer b)
 {
@@ -708,7 +708,7 @@ handle_enablekeys_release (ClutterEvent          *event,
 }
 
 static int
-get_button_index (gint button)
+get_button_index (int button)
 {
   switch (button)
     {
@@ -730,7 +730,7 @@ static void
 emulate_button_press (MetaInputDeviceNative *device_evdev)
 {
   ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
-  gint btn = device_evdev->mousekeys_btn;
+  int btn = device_evdev->mousekeys_btn;
 
   if (device_evdev->mousekeys_btn_states[get_button_index (btn)])
     return;
@@ -745,7 +745,7 @@ static void
 emulate_button_release (MetaInputDeviceNative *device_evdev)
 {
   ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
-  gint btn = device_evdev->mousekeys_btn;
+  int btn = device_evdev->mousekeys_btn;
 
   if (device_evdev->mousekeys_btn_states[get_button_index (btn)] == CLUTTER_BUTTON_STATE_RELEASED)
     return;
@@ -775,18 +775,18 @@ update_mousekeys_params (MetaInputDeviceNative  *device,
   device->mousekeys_init_delay = MAX (0, settings->mousekeys_init_delay);
 
   device->mousekeys_curve_factor =
-    (((gdouble) device->mousekeys_max_speed) /
-      pow ((gdouble) device->mousekeys_accel_time, MOUSEKEYS_CURVE));
+    (((double) device->mousekeys_max_speed) /
+      pow ((double) device->mousekeys_accel_time, MOUSEKEYS_CURVE));
 }
 
-static gdouble
+static double
 mousekeys_get_speed_factor (MetaInputDeviceNative *device,
-                            gint64                 time_us)
+                            uint64_t               time_us)
 {
-  guint32 time;
-  gint64 delta_t;
-  gint64 init_time;
-  gdouble speed;
+  uint32_t time;
+  int64_t delta_t;
+  int64_t init_time;
+  double speed;
 
   time = us2ms (time_us);
 
@@ -821,27 +821,27 @@ mousekeys_get_speed_factor (MetaInputDeviceNative *device,
 
 static void
 emulate_pointer_motion (MetaInputDeviceNative *device_evdev,
-                        gint                   dx,
-                        gint                   dy)
+                        int                    dx,
+                        int                    dy)
 {
   ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
-  gdouble dx_motion;
-  gdouble dy_motion;
-  gdouble speed;
-  gint64 time_us;
+  double dx_motion;
+  double dy_motion;
+  double speed;
+  int64_t time_us;
 
   time_us = g_get_monotonic_time ();
   speed = mousekeys_get_speed_factor (device_evdev, time_us);
 
   if (dx < 0)
-    dx_motion = floor (((gdouble) dx) * speed);
+    dx_motion = floor (((double) dx) * speed);
   else
-    dx_motion = ceil (((gdouble) dx) * speed);
+    dx_motion = ceil (((double) dx) * speed);
 
   if (dy < 0)
-    dy_motion = floor (((gdouble) dy) * speed);
+    dy_motion = floor (((double) dy) * speed);
   else
-    dy_motion = ceil (((gdouble) dy) * speed);
+    dy_motion = ceil (((double) dy) * speed);
 
   clutter_virtual_input_device_notify_relative_motion (device->accessibility_virtual_device,
                                                        time_us, dx_motion, dy_motion);
@@ -909,8 +909,8 @@ static gboolean
 trigger_mousekeys_move (gpointer data)
 {
   MetaInputDeviceNative *device = data;
-  gint dx = 0;
-  gint dy = 0;
+  int dx = 0;
+  int dy = 0;
 
   if (device->mousekeys_first_motion_time == 0)
     {
@@ -1340,10 +1340,10 @@ meta_input_device_native_new (ClutterDeviceManager   *manager,
   MetaInputDeviceNative *device;
   ClutterInputDeviceType type;
   MetaDeviceManagerNative *manager_evdev;
-  gchar *vendor, *product;
-  gint device_id, n_rings = 0, n_strips = 0, n_groups = 1;
-  gchar *node_path;
-  gdouble width, height;
+  char *vendor, *product;
+  int device_id, n_rings = 0, n_strips = 0, n_groups = 1;
+  char *node_path;
+  double width, height;
 
   type = meta_input_device_native_determine_type (libinput_device);
   vendor = g_strdup_printf ("%.4x", libinput_device_get_id_vendor (libinput_device));
@@ -1407,7 +1407,7 @@ meta_input_device_native_new_virtual (ClutterDeviceManager   *manager,
   MetaInputDeviceNative *device;
   MetaDeviceManagerNative *manager_evdev;
   const char *name;
-  gint device_id;
+  int device_id;
 
   switch (type)
     {
@@ -1505,12 +1505,12 @@ meta_input_device_native_get_libinput_device (ClutterInputDevice *device)
 void
 meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
                                                 ClutterStage       *stage,
-                                                gfloat             *x,
-                                                gfloat             *y)
+                                                float              *x,
+                                                float              *y)
 {
   MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device);
   double min_x = 0, min_y = 0, max_x = 1, max_y = 1;
-  gdouble stage_width, stage_height;
+  double stage_width, stage_height;
   double x_d, y_d;
 
   stage_width = clutter_actor_get_width (CLUTTER_ACTOR (stage));
@@ -1522,7 +1522,7 @@ meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
   if (device_evdev->output_ratio > 0 &&
       device_evdev->device_aspect_ratio > 0)
     {
-      gdouble ratio = device_evdev->device_aspect_ratio / device_evdev->output_ratio;
+      double ratio = device_evdev->device_aspect_ratio / device_evdev->output_ratio;
 
       if (ratio > 1)
         x_d *= ratio;
diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h
index 0d1edfac8..572ed454a 100644
--- a/src/backends/native/meta-input-device-native.h
+++ b/src/backends/native/meta-input-device-native.h
@@ -65,8 +65,8 @@ struct _MetaInputDeviceNative
   ClutterInputDeviceTool *last_tool;
 
   cairo_matrix_t device_matrix;
-  gdouble device_aspect_ratio; /* w:h */
-  gdouble output_ratio;        /* w:h */
+  double device_aspect_ratio; /* w:h */
+  double output_ratio;        /* w:h */
 
   GHashTable *touches;
 
@@ -74,23 +74,23 @@ struct _MetaInputDeviceNative
   ClutterKeyboardA11yFlags a11y_flags;
   GList *slow_keys_list;
   guint debounce_timer;
-  guint16 debounce_key;
+  uint16_t debounce_key;
   xkb_mod_mask_t stickykeys_depressed_mask;
   xkb_mod_mask_t stickykeys_latched_mask;
   xkb_mod_mask_t stickykeys_locked_mask;
   guint toggle_slowkeys_timer;
-  guint16 shift_count;
-  guint32 last_shift_time;
-  gint mousekeys_btn;
+  uint16_t shift_count;
+  uint32_t last_shift_time;
+  int mousekeys_btn;
   gboolean mousekeys_btn_states[3];
-  guint32 mousekeys_first_motion_time; /* ms */
-  guint32 mousekeys_last_motion_time; /* ms */
+  uint32_t mousekeys_first_motion_time; /* ms */
+  uint32_t mousekeys_last_motion_time; /* ms */
   guint mousekeys_init_delay;
   guint mousekeys_accel_time;
   guint mousekeys_max_speed;
-  gdouble mousekeys_curve_factor;
+  double mousekeys_curve_factor;
   guint move_mousekeys_timer;
-  guint16 last_mousekeys_key;
+  uint16_t last_mousekeys_key;
 };
 
 struct _MetaInputDeviceNativeClass
@@ -120,8 +120,8 @@ ClutterInputDeviceType    meta_input_device_native_determine_type  (struct libin
 
 void                      meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
                                                                           ClutterStage       *stage,
-                                                                          gfloat             *x,
-                                                                          gfloat             *y);
+                                                                          float              *x,
+                                                                          float              *y);
 
 void                      meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative  *device,
                                                                             ClutterKbdA11ySettings 
*settings);
diff --git a/src/backends/native/meta-input-device-tool-native.c 
b/src/backends/native/meta-input-device-tool-native.c
index 8a2e844cd..8b540afbb 100644
--- a/src/backends/native/meta-input-device-tool-native.c
+++ b/src/backends/native/meta-input-device-tool-native.c
@@ -51,7 +51,7 @@ meta_input_device_tool_native_init (MetaInputDeviceToolNative *tool)
 
 ClutterInputDeviceTool *
 meta_input_device_tool_native_new (struct libinput_tablet_tool *tool,
-                                   guint64                      serial,
+                                   uint64_t                     serial,
                                    ClutterInputDeviceToolType   type)
 {
   MetaInputDeviceToolNative *evdev_tool;
@@ -69,7 +69,7 @@ meta_input_device_tool_native_new (struct libinput_tablet_tool *tool,
 
 void
 meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool,
-                                                  gdouble                 curve[4])
+                                                  double                  curve[4])
 {
   MetaInputDeviceToolNative *evdev_tool;
 
@@ -88,8 +88,8 @@ meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool,
 
 void
 meta_input_device_tool_native_set_button_code (ClutterInputDeviceTool *tool,
-                                               guint                   button,
-                                               guint                   evcode)
+                                               uint32_t                button,
+                                               uint32_t                evcode)
 {
   MetaInputDeviceToolNative *evdev_tool;
 
@@ -108,14 +108,14 @@ meta_input_device_tool_native_set_button_code (ClutterInputDeviceTool *tool,
     }
 }
 
-static gdouble
-calculate_bezier_position (gdouble pos,
-                           gdouble x1,
-                           gdouble y1,
-                           gdouble x2,
-                           gdouble y2)
+static double
+calculate_bezier_position (double pos,
+                           double x1,
+                           double y1,
+                           double x2,
+                           double y2)
 {
-  gdouble int1_y, int2_y;
+  double int1_y, int2_y;
 
   pos = CLAMP (pos, 0, 1);
 
@@ -129,9 +129,9 @@ calculate_bezier_position (gdouble pos,
   return (pos * (int2_y - int1_y)) + int1_y;
 }
 
-gdouble
+double
 meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
-                                                  gdouble                 pressure)
+                                                  double                  pressure)
 {
   MetaInputDeviceToolNative *evdev_tool;
 
@@ -146,9 +146,9 @@ meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
                                     evdev_tool->pressure_curve[3]);
 }
 
-guint
+uint32_t
 meta_input_device_tool_native_get_button_code (ClutterInputDeviceTool *tool,
-                                               guint                   button)
+                                               uint32_t                button)
 {
   MetaInputDeviceToolNative *evdev_tool;
 
diff --git a/src/backends/native/meta-input-device-tool-native.h 
b/src/backends/native/meta-input-device-tool-native.h
index ea16c4511..9bb1489cf 100644
--- a/src/backends/native/meta-input-device-tool-native.h
+++ b/src/backends/native/meta-input-device-tool-native.h
@@ -55,7 +55,7 @@ struct _MetaInputDeviceToolNative
   ClutterInputDeviceTool parent_instance;
   struct libinput_tablet_tool *tool;
   GHashTable *button_map;
-  gdouble pressure_curve[4];
+  double pressure_curve[4];
 };
 
 struct _MetaInputDeviceToolNativeClass
@@ -66,19 +66,19 @@ struct _MetaInputDeviceToolNativeClass
 GType                    meta_input_device_tool_native_get_type (void) G_GNUC_CONST;
 
 ClutterInputDeviceTool * meta_input_device_tool_native_new      (struct libinput_tablet_tool *tool,
-                                                                 guint64                      serial,
+                                                                 uint64_t                     serial,
                                                                  ClutterInputDeviceToolType   type);
 
 gdouble                  meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
-                                                                           gdouble                 pressure);
-guint                    meta_input_device_tool_native_get_button_code    (ClutterInputDeviceTool *tool,
-                                                                           guint                   button);
+                                                                           double                  pressure);
+uint32_t                 meta_input_device_tool_native_get_button_code    (ClutterInputDeviceTool *tool,
+                                                                           uint32_t                button);
 
 void                     meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool,
-                                                                            gdouble                 
curve[4]);
+                                                                           double                  curve[4]);
 void                     meta_input_device_tool_native_set_button_code    (ClutterInputDeviceTool *tool,
-                                                                          guint                   button,
-                                                                          guint                   evcode);
+                                                                          uint32_t                button,
+                                                                          uint32_t                evcode);
 
 G_END_DECLS
 
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index fb4f0dc0b..714624cea 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -348,7 +348,7 @@ meta_seat_native_notify_key (MetaSeatNative     *seat,
     case 1:
     case 2:
       {
-        guint32 interval;
+        uint32_t interval;
 
         meta_seat_native_clear_repeat_timer (seat);
         seat->repeat_device = g_object_ref (device);
@@ -374,10 +374,10 @@ meta_seat_native_notify_key (MetaSeatNative     *seat,
 static ClutterEvent *
 new_absolute_motion_event (MetaSeatNative     *seat,
                            ClutterInputDevice *input_device,
-                           guint64             time_us,
-                           gfloat              x,
-                           gfloat              y,
-                           gdouble            *axes)
+                           uint64_t            time_us,
+                           float               x,
+                           float               y,
+                           double             *axes)
 {
   ClutterStage *stage = _clutter_input_device_get_stage (input_device);
   ClutterEvent *event;
@@ -437,7 +437,7 @@ meta_seat_native_notify_relative_motion (MetaSeatNative     *seat,
                                          float               dx_unaccel,
                                          float               dy_unaccel)
 {
-  gfloat new_x, new_y;
+  float new_x, new_y;
   ClutterEvent *event;
 
   /* We can drop the event on the floor if no stage has been
@@ -489,8 +489,8 @@ meta_seat_native_notify_button (MetaSeatNative     *seat,
   MetaInputDeviceNative *device_evdev = (MetaInputDeviceNative *) input_device;
   ClutterStage *stage;
   ClutterEvent *event = NULL;
-  gint button_nr;
-  static gint maskmap[8] =
+  int button_nr;
+  static int maskmap[8] =
     {
       CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON3_MASK, CLUTTER_BUTTON2_MASK,
       CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK, 0, 0, 0
@@ -589,7 +589,7 @@ meta_seat_native_notify_button (MetaSeatNative     *seat,
   if (device_evdev->last_tool)
     {
       /* Apply the button event code as per the tool mapping */
-      guint mapped_button;
+      uint32_t mapped_button;
 
       mapped_button = meta_input_device_tool_native_get_button_code (device_evdev->last_tool,
                                                                      button_nr);
@@ -616,9 +616,9 @@ meta_seat_native_notify_button (MetaSeatNative     *seat,
 
 static void
 notify_scroll (ClutterInputDevice       *input_device,
-               guint64                   time_us,
-               gdouble                   dx,
-               gdouble                   dy,
+               uint64_t                  time_us,
+               double                    dx,
+               double                    dy,
                ClutterScrollSource       scroll_source,
                ClutterScrollFinishFlags  flags,
                gboolean                  emulated)
@@ -627,7 +627,7 @@ notify_scroll (ClutterInputDevice       *input_device,
   MetaSeatNative *seat;
   ClutterStage *stage;
   ClutterEvent *event = NULL;
-  gdouble scroll_factor;
+  double scroll_factor;
 
   /* We can drop the event on the floor if no stage has been
    * associated with the device yet. */
@@ -870,7 +870,7 @@ meta_seat_native_free (MetaSeatNative *seat)
 
 ClutterInputDevice *
 meta_seat_native_get_device (MetaSeatNative *seat,
-                             gint            id)
+                             int             id)
 {
   ClutterInputDevice *device;
   GSList *l;
diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h
index f07142014..45b5033e8 100644
--- a/src/backends/native/meta-seat-native.h
+++ b/src/backends/native/meta-seat-native.h
@@ -65,19 +65,19 @@ struct _MetaSeatNative
 
   /* keyboard repeat */
   gboolean repeat;
-  guint32 repeat_delay;
-  guint32 repeat_interval;
-  guint32 repeat_key;
-  guint32 repeat_count;
-  guint32 repeat_timer;
+  uint32_t repeat_delay;
+  uint32_t repeat_interval;
+  uint32_t repeat_key;
+  uint32_t repeat_count;
+  uint32_t repeat_timer;
   ClutterInputDevice *repeat_device;
 
-  gfloat pointer_x;
-  gfloat pointer_y;
+  float pointer_x;
+  float pointer_y;
 
   /* Emulation of discrete scroll events out of smooth ones */
-  gfloat accum_scroll_dx;
-  gfloat accum_scroll_dy;
+  float accum_scroll_dx;
+  float accum_scroll_dy;
 };
 
 void meta_seat_native_notify_key (MetaSeatNative     *seat,
@@ -137,7 +137,7 @@ void meta_seat_native_set_libinput_seat (MetaSeatNative       *seat,
 void meta_seat_native_sync_leds (MetaSeatNative *seat);
 
 ClutterInputDevice * meta_seat_native_get_device (MetaSeatNative *seat,
-                                                  gint            id);
+                                                  int             id);
 
 MetaTouchState * meta_seat_native_acquire_touch_state (MetaSeatNative *seat,
                                                        int             device_slot);
@@ -146,7 +146,7 @@ void meta_seat_native_release_touch_state (MetaSeatNative *seat,
                                            MetaTouchState *touch_state);
 
 MetaTouchState * meta_seat_native_get_touch (MetaSeatNative *seat,
-                                             guint32         id);
+                                             uint32_t        id);
 
 void meta_seat_native_set_stage (MetaSeatNative *seat,
                                  ClutterStage   *stage);



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