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