backends/native: Add a bunch of "_in_impl" suffixes to functions

They're a dime a dozen. If it gets called exclusively from the
input thread, it got one. Hopefully these breadcrumbs will be
enough so people don't lose their way here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho 2020-11-20 01:36:19 +01:00 committed by Marge Bot
parent 820262e537
commit c03be03cd3
14 changed files with 544 additions and 537 deletions

View File

@ -500,11 +500,11 @@ clamp_to_barrier (MetaBarrierImplNative *self,
} }
void void
meta_barrier_manager_native_process (MetaBarrierManagerNative *manager, meta_barrier_manager_native_process_in_impl (MetaBarrierManagerNative *manager,
ClutterInputDevice *device, ClutterInputDevice *device,
guint32 time, guint32 time,
float *x, float *x,
float *y) float *y)
{ {
graphene_point_t prev_pos; graphene_point_t prev_pos;
float prev_x; float prev_x;

View File

@ -41,11 +41,11 @@ typedef struct _MetaBarrierManagerNative MetaBarrierManagerNative;
MetaBarrierImpl *meta_barrier_impl_native_new (MetaBarrier *barrier); MetaBarrierImpl *meta_barrier_impl_native_new (MetaBarrier *barrier);
MetaBarrierManagerNative *meta_barrier_manager_native_new (void); MetaBarrierManagerNative *meta_barrier_manager_native_new (void);
void meta_barrier_manager_native_process (MetaBarrierManagerNative *manager, void meta_barrier_manager_native_process_in_impl (MetaBarrierManagerNative *manager,
ClutterInputDevice *device, ClutterInputDevice *device,
guint32 time, guint32 time,
float *x, float *x,
float *y); float *y);
G_END_DECLS G_END_DECLS

View File

@ -198,7 +198,7 @@ meta_input_device_native_get_pad_feature_group (ClutterInputDevice *de
static void static void
meta_input_device_native_bell_notify (MetaInputDeviceNative *device) meta_input_device_native_bell_notify (MetaInputDeviceNative *device)
{ {
meta_seat_impl_notify_bell (device->seat_impl); meta_seat_impl_notify_bell_in_impl (device->seat_impl);
} }
static void static void
@ -419,9 +419,9 @@ key_event_is_modifier (ClutterEvent *event)
static void static void
notify_stickykeys_mask (MetaInputDeviceNative *device) notify_stickykeys_mask (MetaInputDeviceNative *device)
{ {
meta_seat_impl_notify_kbd_a11y_mods_state_changed (device->seat_impl, meta_seat_impl_notify_kbd_a11y_mods_state_changed_in_impl (device->seat_impl,
device->stickykeys_latched_mask, device->stickykeys_latched_mask,
device->stickykeys_locked_mask); device->stickykeys_locked_mask);
} }
static void static void
@ -438,7 +438,7 @@ update_internal_xkb_state (MetaInputDeviceNative *device,
g_rw_lock_writer_lock (&seat_impl->state_lock); g_rw_lock_writer_lock (&seat_impl->state_lock);
xkb_state = meta_seat_impl_get_xkb_state (seat_impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (seat_impl);
depressed_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED); depressed_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED);
latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED); latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED);
locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED); locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED);
@ -478,7 +478,7 @@ update_stickykeys_event (ClutterEvent *event,
update_internal_xkb_state (device, new_latched_mask, new_locked_mask); update_internal_xkb_state (device, new_latched_mask, new_locked_mask);
xkb_state = meta_seat_impl_get_xkb_state (seat_impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (seat_impl);
effective_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE); effective_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED); latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED);
locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED); locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED);
@ -498,9 +498,9 @@ notify_stickykeys_change (MetaInputDeviceNative *device)
device->stickykeys_depressed_mask = 0; device->stickykeys_depressed_mask = 0;
update_internal_xkb_state (device, 0, 0); update_internal_xkb_state (device, 0, 0);
meta_seat_impl_notify_kbd_a11y_flags_changed (device->seat_impl, meta_seat_impl_notify_kbd_a11y_flags_changed_in_impl (device->seat_impl,
device->a11y_flags, device->a11y_flags,
META_A11Y_STICKY_KEYS_ENABLED); META_A11Y_STICKY_KEYS_ENABLED);
} }
static void static void
@ -530,9 +530,9 @@ set_slowkeys_off (MetaInputDeviceNative *device)
{ {
device->a11y_flags &= ~META_A11Y_SLOW_KEYS_ENABLED; device->a11y_flags &= ~META_A11Y_SLOW_KEYS_ENABLED;
meta_seat_impl_notify_kbd_a11y_flags_changed (device->seat_impl, meta_seat_impl_notify_kbd_a11y_flags_changed_in_impl (device->seat_impl,
device->a11y_flags, device->a11y_flags,
META_A11Y_SLOW_KEYS_ENABLED); META_A11Y_SLOW_KEYS_ENABLED);
} }
static void static void
@ -540,9 +540,9 @@ set_slowkeys_on (MetaInputDeviceNative *device)
{ {
device->a11y_flags |= META_A11Y_SLOW_KEYS_ENABLED; device->a11y_flags |= META_A11Y_SLOW_KEYS_ENABLED;
meta_seat_impl_notify_kbd_a11y_flags_changed (device->seat_impl, meta_seat_impl_notify_kbd_a11y_flags_changed_in_impl (device->seat_impl,
device->a11y_flags, device->a11y_flags,
META_A11Y_SLOW_KEYS_ENABLED); META_A11Y_SLOW_KEYS_ENABLED);
} }
static void static void
@ -565,7 +565,7 @@ handle_stickykeys_press (ClutterEvent *event,
return; return;
} }
xkb_state = meta_seat_impl_get_xkb_state (seat_impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (seat_impl);
depressed_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED); depressed_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED);
/* Ignore the lock modifier mask, that one cannot be sticky, yet the /* Ignore the lock modifier mask, that one cannot be sticky, yet the
* CAPS_LOCK key itself counts as a modifier as it might be remapped * CAPS_LOCK key itself counts as a modifier as it might be remapped
@ -602,7 +602,7 @@ handle_stickykeys_release (ClutterEvent *event,
MetaSeatImpl *seat_impl = device->seat_impl; MetaSeatImpl *seat_impl = device->seat_impl;
struct xkb_state *xkb_state; struct xkb_state *xkb_state;
xkb_state = meta_seat_impl_get_xkb_state (seat_impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (seat_impl);
device->stickykeys_depressed_mask = device->stickykeys_depressed_mask =
xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED); xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED);
@ -846,7 +846,7 @@ is_numlock_active (MetaInputDeviceNative *device)
MetaSeatImpl *seat_impl = device->seat_impl; MetaSeatImpl *seat_impl = device->seat_impl;
struct xkb_state *xkb_state; struct xkb_state *xkb_state;
xkb_state = meta_seat_impl_get_xkb_state (seat_impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (seat_impl);
return xkb_state_mod_name_is_active (xkb_state, return xkb_state_mod_name_is_active (xkb_state,
"Mod2", "Mod2",
@ -1126,8 +1126,8 @@ handle_mousekeys_release (ClutterEvent *event,
} }
gboolean gboolean
meta_input_device_native_process_kbd_a11y_event (ClutterInputDevice *device, meta_input_device_native_process_kbd_a11y_event_in_impl (ClutterInputDevice *device,
ClutterEvent *event) ClutterEvent *event)
{ {
MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device); MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device);
@ -1183,8 +1183,8 @@ meta_input_device_native_process_kbd_a11y_event (ClutterInputDevice *device,
} }
void void
meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device, meta_input_device_native_apply_kbd_a11y_settings_in_impl (MetaInputDeviceNative *device,
MetaKbdA11ySettings *settings) MetaKbdA11ySettings *settings)
{ {
MetaKeyboardA11yFlags changed_flags = (device->a11y_flags ^ settings->controls); MetaKeyboardA11yFlags changed_flags = (device->a11y_flags ^ settings->controls);
@ -1222,7 +1222,7 @@ meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device,
} }
void void
meta_input_device_native_a11y_maybe_notify_toggle_keys (MetaInputDeviceNative *device) meta_input_device_native_a11y_maybe_notify_toggle_keys_in_impl (MetaInputDeviceNative *device)
{ {
if (device->a11y_flags & META_A11Y_TOGGLE_KEYS_ENABLED) if (device->a11y_flags & META_A11Y_TOGGLE_KEYS_ENABLED)
meta_input_device_native_bell_notify (device); meta_input_device_native_bell_notify (device);
@ -1324,8 +1324,8 @@ update_pad_features (MetaInputDeviceNative *device_native)
* it with the provided seat. * it with the provided seat.
*/ */
ClutterInputDevice * ClutterInputDevice *
meta_input_device_native_new (MetaSeatImpl *seat_impl, meta_input_device_native_new_in_impl (MetaSeatImpl *seat_impl,
struct libinput_device *libinput_device) struct libinput_device *libinput_device)
{ {
MetaInputDeviceNative *device; MetaInputDeviceNative *device;
ClutterInputDeviceType type; ClutterInputDeviceType type;
@ -1334,7 +1334,7 @@ meta_input_device_native_new (MetaSeatImpl *seat_impl,
char *node_path; char *node_path;
double width, height; double width, height;
type = meta_input_device_native_determine_type (libinput_device); type = meta_input_device_native_determine_type_in_impl (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));
product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device)); product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device));
node_path = g_strdup_printf ("/dev/input/%s", libinput_device_get_sysname (libinput_device)); node_path = g_strdup_printf ("/dev/input/%s", libinput_device_get_sysname (libinput_device));
@ -1431,8 +1431,8 @@ meta_input_device_native_get_seat_impl (MetaInputDeviceNative *device)
} }
void void
meta_input_device_native_update_leds (MetaInputDeviceNative *device, meta_input_device_native_update_leds_in_impl (MetaInputDeviceNative *device,
enum libinput_led leds) enum libinput_led leds)
{ {
if (!device->libinput_device) if (!device->libinput_device)
return; return;
@ -1441,7 +1441,7 @@ meta_input_device_native_update_leds (MetaInputDeviceNative *device,
} }
ClutterInputDeviceType ClutterInputDeviceType
meta_input_device_native_determine_type (struct libinput_device *ldev) meta_input_device_native_determine_type_in_impl (struct libinput_device *ldev)
{ {
/* This setting is specific to touchpads and alike, only in these /* This setting is specific to touchpads and alike, only in these
* devices there is this additional layer of touch event interpretation. * devices there is this additional layer of touch event interpretation.
@ -1486,10 +1486,10 @@ 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_in_impl (ClutterInputDevice *device,
MetaViewportInfo *viewports, MetaViewportInfo *viewports,
float *x, float *x,
float *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;
@ -1521,7 +1521,7 @@ meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
} }
MetaInputDeviceMapping MetaInputDeviceMapping
meta_input_device_native_get_mapping_mode (ClutterInputDevice *device) meta_input_device_native_get_mapping_mode_in_impl (ClutterInputDevice *device)
{ {
MetaInputDeviceNative *device_native = META_INPUT_DEVICE_NATIVE (device); MetaInputDeviceNative *device_native = META_INPUT_DEVICE_NATIVE (device);
ClutterInputDeviceType device_type; ClutterInputDeviceType device_type;
@ -1539,8 +1539,8 @@ meta_input_device_native_get_mapping_mode (ClutterInputDevice *device)
} }
void void
meta_input_device_native_set_mapping_mode (ClutterInputDevice *device, meta_input_device_native_set_mapping_mode_in_impl (ClutterInputDevice *device,
MetaInputDeviceMapping mapping) MetaInputDeviceMapping mapping)
{ {
MetaInputDeviceNative *device_native = META_INPUT_DEVICE_NATIVE (device); MetaInputDeviceNative *device_native = META_INPUT_DEVICE_NATIVE (device);
ClutterInputDeviceType device_type; ClutterInputDeviceType device_type;
@ -1556,18 +1556,18 @@ meta_input_device_native_set_mapping_mode (ClutterInputDevice *device,
} }
void void
meta_input_device_native_set_coords (MetaInputDeviceNative *device_native, meta_input_device_native_set_coords_in_impl (MetaInputDeviceNative *device_native,
float x, float x,
float y) float y)
{ {
device_native->pointer_x = x; device_native->pointer_x = x;
device_native->pointer_y = y; device_native->pointer_y = y;
} }
void void
meta_input_device_native_get_coords (MetaInputDeviceNative *device_native, meta_input_device_native_get_coords_in_impl (MetaInputDeviceNative *device_native,
float *x, float *x,
float *y) float *y)
{ {
if (x) if (x)
*x = device_native->pointer_x; *x = device_native->pointer_x;

View File

@ -112,44 +112,44 @@ struct _MetaInputDeviceNativeClass
GType meta_input_device_native_get_type (void) G_GNUC_CONST; GType meta_input_device_native_get_type (void) G_GNUC_CONST;
ClutterInputDevice * meta_input_device_native_new (MetaSeatImpl *seat_impl, ClutterInputDevice * meta_input_device_native_new_in_impl (MetaSeatImpl *seat_impl,
struct libinput_device *libinput_device); struct libinput_device *libinput_device);
ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatImpl *seat_impl, ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatImpl *seat_impl,
ClutterInputDeviceType type, ClutterInputDeviceType type,
ClutterInputMode mode); ClutterInputMode mode);
MetaSeatImpl * meta_input_device_native_get_seat_impl (MetaInputDeviceNative *device); MetaSeatImpl * meta_input_device_native_get_seat_impl (MetaInputDeviceNative *device);
void meta_input_device_native_update_leds (MetaInputDeviceNative *device, void meta_input_device_native_update_leds_in_impl (MetaInputDeviceNative *device,
enum libinput_led leds); enum libinput_led leds);
ClutterInputDeviceType meta_input_device_native_determine_type (struct libinput_device *libinput_device); ClutterInputDeviceType meta_input_device_native_determine_type_in_impl (struct libinput_device *libinput_device);
void meta_input_device_native_translate_coordinates (ClutterInputDevice *device, void meta_input_device_native_translate_coordinates_in_impl (ClutterInputDevice *device,
MetaViewportInfo *viewports, MetaViewportInfo *viewports,
float *x, float *x,
float *y); float *y);
MetaInputDeviceMapping meta_input_device_native_get_mapping_mode (ClutterInputDevice *device); MetaInputDeviceMapping meta_input_device_native_get_mapping_mode_in_impl (ClutterInputDevice *device);
void meta_input_device_native_set_mapping_mode (ClutterInputDevice *device, void meta_input_device_native_set_mapping_mode_in_impl (ClutterInputDevice *device,
MetaInputDeviceMapping mapping); MetaInputDeviceMapping mapping);
void meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device, void meta_input_device_native_apply_kbd_a11y_settings_in_impl (MetaInputDeviceNative *device,
MetaKbdA11ySettings *settings); MetaKbdA11ySettings *settings);
void meta_input_device_native_a11y_maybe_notify_toggle_keys (MetaInputDeviceNative *device_evdev); void meta_input_device_native_a11y_maybe_notify_toggle_keys_in_impl (MetaInputDeviceNative *device_evdev);
struct libinput_device * meta_input_device_native_get_libinput_device (ClutterInputDevice *device); struct libinput_device * meta_input_device_native_get_libinput_device (ClutterInputDevice *device);
void meta_input_device_native_set_coords (MetaInputDeviceNative *device_native, void meta_input_device_native_set_coords_in_impl (MetaInputDeviceNative *device_native,
float x, float x,
float y); float y);
void meta_input_device_native_get_coords (MetaInputDeviceNative *device_native, void meta_input_device_native_get_coords_in_impl (MetaInputDeviceNative *device_native,
float *x, float *x,
float *y); float *y);
gboolean meta_input_device_native_process_kbd_a11y_event (ClutterInputDevice *device, gboolean meta_input_device_native_process_kbd_a11y_event_in_impl (ClutterInputDevice *device,
ClutterEvent *event); ClutterEvent *event);
#endif /* META_INPUT_DEVICE_NATIVE_H */ #endif /* META_INPUT_DEVICE_NATIVE_H */

View File

@ -90,8 +90,8 @@ 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_in_impl (ClutterInputDeviceTool *tool,
double curve[4]) double curve[4])
{ {
MetaInputDeviceToolNative *evdev_tool; MetaInputDeviceToolNative *evdev_tool;
@ -109,9 +109,9 @@ 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_in_impl (ClutterInputDeviceTool *tool,
uint32_t button, uint32_t button,
uint32_t evcode) uint32_t evcode)
{ {
MetaInputDeviceToolNative *evdev_tool; MetaInputDeviceToolNative *evdev_tool;
@ -152,8 +152,8 @@ calculate_bezier_position (double pos,
} }
double double
meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool, meta_input_device_tool_native_translate_pressure_in_impl (ClutterInputDeviceTool *tool,
double pressure) double pressure)
{ {
MetaInputDeviceToolNative *evdev_tool; MetaInputDeviceToolNative *evdev_tool;
@ -169,8 +169,8 @@ meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
} }
uint32_t uint32_t
meta_input_device_tool_native_get_button_code (ClutterInputDeviceTool *tool, meta_input_device_tool_native_get_button_code_in_impl (ClutterInputDeviceTool *tool,
uint32_t button) uint32_t button)
{ {
MetaInputDeviceToolNative *evdev_tool; MetaInputDeviceToolNative *evdev_tool;

View File

@ -70,16 +70,16 @@ ClutterInputDeviceTool * meta_input_device_tool_native_new (struct libinput
uint64_t 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_in_impl (ClutterInputDeviceTool *tool,
double pressure); double pressure);
uint32_t meta_input_device_tool_native_get_button_code (ClutterInputDeviceTool *tool, uint32_t meta_input_device_tool_native_get_button_code_in_impl (ClutterInputDeviceTool *tool,
uint32_t button); uint32_t button);
void meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool, void meta_input_device_tool_native_set_pressure_curve_in_impl (ClutterInputDeviceTool *tool,
double 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_in_impl (ClutterInputDeviceTool *tool,
uint32_t button, uint32_t button,
uint32_t evcode); uint32_t evcode);
G_END_DECLS G_END_DECLS

View File

@ -157,7 +157,7 @@ meta_input_settings_native_set_matrix (MetaInputSettings *settings,
if (clutter_input_device_get_device_type (device) == if (clutter_input_device_get_device_type (device) ==
CLUTTER_TOUCHSCREEN_DEVICE || CLUTTER_TOUCHSCREEN_DEVICE ||
meta_input_device_native_get_mapping_mode (device) == meta_input_device_native_get_mapping_mode_in_impl (device) ==
META_INPUT_DEVICE_MAPPING_ABSOLUTE) META_INPUT_DEVICE_MAPPING_ABSOLUTE)
{ {
cairo_matrix_init (dev_matrix, matrix[0], matrix[3], matrix[1], cairo_matrix_init (dev_matrix, matrix[0], matrix[3], matrix[1],
@ -504,8 +504,8 @@ meta_input_settings_native_set_keyboard_repeat (MetaInputSettings *settings,
MetaInputSettingsNative *input_settings_native; MetaInputSettingsNative *input_settings_native;
input_settings_native = META_INPUT_SETTINGS_NATIVE (settings); input_settings_native = META_INPUT_SETTINGS_NATIVE (settings);
meta_seat_impl_set_keyboard_repeat (input_settings_native->seat_impl, meta_seat_impl_set_keyboard_repeat_in_impl (input_settings_native->seat_impl,
enabled, delay, interval); enabled, delay, interval);
} }
static void static void
@ -636,7 +636,7 @@ meta_input_settings_native_set_tablet_mapping (MetaInputSettings *settings,
else else
return; return;
meta_input_device_native_set_mapping_mode (device, dev_mapping); meta_input_device_native_set_mapping_mode_in_impl (device, dev_mapping);
} }
static gboolean static gboolean
@ -660,7 +660,7 @@ meta_input_settings_native_set_tablet_aspect_ratio (MetaInputSettings *settings
MetaInputSettingsNative *input_settings_native; MetaInputSettingsNative *input_settings_native;
GTask *task; GTask *task;
if (meta_input_device_native_get_mapping_mode (device) == if (meta_input_device_native_get_mapping_mode_in_impl (device) ==
META_INPUT_DEVICE_MAPPING_RELATIVE) META_INPUT_DEVICE_MAPPING_RELATIVE)
aspect_ratio = 0; aspect_ratio = 0;
@ -718,7 +718,7 @@ meta_input_settings_native_set_stylus_pressure (MetaInputSettings *settings
pressure_curve[2] = (gdouble) curve[2] / 100; pressure_curve[2] = (gdouble) curve[2] / 100;
pressure_curve[3] = (gdouble) curve[3] / 100; pressure_curve[3] = (gdouble) curve[3] / 100;
meta_input_device_tool_native_set_pressure_curve (tool, pressure_curve); meta_input_device_tool_native_set_pressure_curve_in_impl (tool, pressure_curve);
} }
static guint static guint
@ -748,12 +748,12 @@ meta_input_settings_native_set_stylus_button_map (MetaInputSettings *se
GDesktopStylusButtonAction secondary, GDesktopStylusButtonAction secondary,
GDesktopStylusButtonAction tertiary) GDesktopStylusButtonAction tertiary)
{ {
meta_input_device_tool_native_set_button_code (tool, CLUTTER_BUTTON_MIDDLE, meta_input_device_tool_native_set_button_code_in_impl (tool, CLUTTER_BUTTON_MIDDLE,
action_to_evcode (primary)); action_to_evcode (primary));
meta_input_device_tool_native_set_button_code (tool, CLUTTER_BUTTON_SECONDARY, meta_input_device_tool_native_set_button_code_in_impl (tool, CLUTTER_BUTTON_SECONDARY,
action_to_evcode (secondary)); action_to_evcode (secondary));
meta_input_device_tool_native_set_button_code (tool, 8, /* Back */ meta_input_device_tool_native_set_button_code_in_impl (tool, 8, /* Back */
action_to_evcode (tertiary)); action_to_evcode (tertiary));
} }
static void static void
@ -870,7 +870,7 @@ meta_input_settings_native_init (MetaInputSettingsNative *settings)
} }
MetaInputSettings * MetaInputSettings *
meta_input_settings_native_new (MetaSeatImpl *seat_impl) meta_input_settings_native_new_in_impl (MetaSeatImpl *seat_impl)
{ {
return g_object_new (META_TYPE_INPUT_SETTINGS_NATIVE, return g_object_new (META_TYPE_INPUT_SETTINGS_NATIVE,
"seat-impl", seat_impl, "seat-impl", seat_impl,

View File

@ -47,6 +47,6 @@ struct _MetaInputSettingsNativeClass
GType meta_input_settings_native_get_type (void) G_GNUC_CONST; GType meta_input_settings_native_get_type (void) G_GNUC_CONST;
MetaInputSettings * meta_input_settings_native_new (MetaSeatImpl *seat_impl); MetaInputSettings * meta_input_settings_native_new_in_impl (MetaSeatImpl *seat_impl);
#endif /* META_INPUT_SETTINGS_NATIVE_H */ #endif /* META_INPUT_SETTINGS_NATIVE_H */

View File

@ -107,8 +107,8 @@ meta_keymap_native_init (MetaKeymapNative *keymap)
} }
void void
meta_keymap_native_set_keyboard_map (MetaKeymapNative *keymap, meta_keymap_native_set_keyboard_map_in_impl (MetaKeymapNative *keymap,
struct xkb_keymap *xkb_keymap) struct xkb_keymap *xkb_keymap)
{ {
g_return_if_fail (xkb_keymap != NULL); g_return_if_fail (xkb_keymap != NULL);
@ -118,19 +118,19 @@ meta_keymap_native_set_keyboard_map (MetaKeymapNative *keymap,
} }
struct xkb_keymap * struct xkb_keymap *
meta_keymap_native_get_keyboard_map (MetaKeymapNative *keymap) meta_keymap_native_get_keyboard_map_in_impl (MetaKeymapNative *keymap)
{ {
return keymap->keymap; return keymap->keymap;
} }
void void
meta_keymap_native_update (MetaKeymapNative *keymap) meta_keymap_native_update_in_impl (MetaKeymapNative *keymap)
{ {
struct xkb_state *xkb_state; struct xkb_state *xkb_state;
ClutterSeat *seat; ClutterSeat *seat;
seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
xkb_state = meta_seat_impl_get_xkb_state (META_SEAT_NATIVE (seat)->impl); xkb_state = meta_seat_impl_get_xkb_state_in_impl (META_SEAT_NATIVE (seat)->impl);
keymap->num_lock = keymap->num_lock =
xkb_state_mod_name_is_active (xkb_state, xkb_state_mod_name_is_active (xkb_state,

View File

@ -29,9 +29,9 @@ G_DECLARE_FINAL_TYPE (MetaKeymapNative, meta_keymap_native,
META, KEYMAP_NATIVE, META, KEYMAP_NATIVE,
ClutterKeymap) ClutterKeymap)
void meta_keymap_native_set_keyboard_map (MetaKeymapNative *keymap, void meta_keymap_native_set_keyboard_map_in_impl (MetaKeymapNative *keymap,
struct xkb_keymap *xkb_keymap); struct xkb_keymap *xkb_keymap);
struct xkb_keymap * meta_keymap_native_get_keyboard_map (MetaKeymapNative *keymap); struct xkb_keymap * meta_keymap_native_get_keyboard_map_in_impl (MetaKeymapNative *keymap);
void meta_keymap_native_update (MetaKeymapNative *keymap); void meta_keymap_native_update_in_impl (MetaKeymapNative *keymap);
#endif /* META_KEYMAP_NATIVE_H */ #endif /* META_KEYMAP_NATIVE_H */

View File

@ -385,10 +385,10 @@ out:
} }
static int static int
on_evdev_device_open (const char *path, on_evdev_device_open_in_input_impl (const char *path,
int flags, int flags,
gpointer user_data, gpointer user_data,
GError **error) GError **error)
{ {
MetaLauncher *self = user_data; MetaLauncher *self = user_data;
@ -420,8 +420,8 @@ on_evdev_device_open (const char *path,
} }
static void static void
on_evdev_device_close (int fd, on_evdev_device_close_in_input_impl (int fd,
gpointer user_data) gpointer user_data)
{ {
MetaLauncher *self = user_data; MetaLauncher *self = user_data;
@ -530,8 +530,8 @@ meta_launcher_new (GError **error)
meta_clutter_backend_native_set_seat_id (self->seat_id); meta_clutter_backend_native_set_seat_id (self->seat_id);
meta_seat_impl_set_device_callbacks (on_evdev_device_open, meta_seat_impl_set_device_callbacks (on_evdev_device_open_in_input_impl,
on_evdev_device_close, on_evdev_device_close_in_input_impl,
self); self);
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self); g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);

View File

@ -159,7 +159,7 @@ meta_seat_impl_run_input_task (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_sync_leds (MetaSeatImpl *seat_impl) meta_seat_impl_sync_leds_in_impl (MetaSeatImpl *seat_impl)
{ {
GSList *iter; GSList *iter;
MetaInputDeviceNative *device_native; MetaInputDeviceNative *device_native;
@ -183,13 +183,13 @@ meta_seat_impl_sync_leds (MetaSeatImpl *seat_impl)
for (iter = seat_impl->devices; iter; iter = iter->next) for (iter = seat_impl->devices; iter; iter = iter->next)
{ {
device_native = iter->data; device_native = iter->data;
meta_input_device_native_update_leds (device_native, leds); meta_input_device_native_update_leds_in_impl (device_native, leds);
} }
} }
MetaTouchState * MetaTouchState *
meta_seat_impl_lookup_touch_state (MetaSeatImpl *seat_impl, meta_seat_impl_lookup_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot) int seat_slot)
{ {
if (!seat_impl->touch_states) if (!seat_impl->touch_states)
return NULL; return NULL;
@ -205,8 +205,8 @@ meta_touch_state_free (MetaTouchState *state)
} }
MetaTouchState * MetaTouchState *
meta_seat_impl_acquire_touch_state (MetaSeatImpl *seat_impl, meta_seat_impl_acquire_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot) int seat_slot)
{ {
MetaTouchState *touch_state; MetaTouchState *touch_state;
@ -233,8 +233,8 @@ meta_seat_impl_acquire_touch_state (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_release_touch_state (MetaSeatImpl *seat_impl, meta_seat_impl_release_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot) int seat_slot)
{ {
if (!seat_impl->touch_states) if (!seat_impl->touch_states)
return; return;
@ -271,12 +271,12 @@ keyboard_repeat (gpointer data)
g_return_val_if_fail (seat_impl->repeat_device != NULL, G_SOURCE_REMOVE); g_return_val_if_fail (seat_impl->repeat_device != NULL, G_SOURCE_REMOVE);
meta_seat_impl_notify_key (seat_impl, meta_seat_impl_notify_key_in_impl (seat_impl,
seat_impl->repeat_device, seat_impl->repeat_device,
g_source_get_time (seat_impl->repeat_source), g_source_get_time (seat_impl->repeat_source),
seat_impl->repeat_key, seat_impl->repeat_key,
AUTOREPEAT_VALUE, AUTOREPEAT_VALUE,
FALSE); FALSE);
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
} }
@ -372,12 +372,12 @@ emit_signal (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_key (MetaSeatImpl *seat_impl, meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *device, ClutterInputDevice *device,
uint64_t time_us, uint64_t time_us,
uint32_t key, uint32_t key,
uint32_t state, uint32_t state,
gboolean update_keys) gboolean update_keys)
{ {
ClutterEvent *event = NULL; ClutterEvent *event = NULL;
enum xkb_state_component changed_state; enum xkb_state_component changed_state;
@ -419,8 +419,8 @@ meta_seat_impl_notify_key (MetaSeatImpl *seat_impl,
clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_REPEATED); clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_REPEATED);
} }
if (!meta_input_device_native_process_kbd_a11y_event (seat_impl->core_keyboard, if (!meta_input_device_native_process_kbd_a11y_event_in_impl (seat_impl->core_keyboard,
event)) event))
queue_event (seat_impl, event); queue_event (seat_impl, event);
else else
clutter_event_free (event); clutter_event_free (event);
@ -431,7 +431,7 @@ meta_seat_impl_notify_key (MetaSeatImpl *seat_impl,
gboolean numlock_active; gboolean numlock_active;
emit_signal (seat_impl, signals[MODS_STATE_CHANGED], NULL, 0); emit_signal (seat_impl, signals[MODS_STATE_CHANGED], NULL, 0);
meta_seat_impl_sync_leds (seat_impl); meta_seat_impl_sync_leds_in_impl (seat_impl);
numlock_active = numlock_active =
xkb_state_mod_name_is_active (seat_impl->xkb, XKB_MOD_NAME_NUM, xkb_state_mod_name_is_active (seat_impl->xkb, XKB_MOD_NAME_NUM,
@ -441,7 +441,7 @@ meta_seat_impl_notify_key (MetaSeatImpl *seat_impl,
numlock_active); numlock_active);
keyboard_native = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard); keyboard_native = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard);
meta_input_device_native_a11y_maybe_notify_toggle_keys (keyboard_native); meta_input_device_native_a11y_maybe_notify_toggle_keys_in_impl (keyboard_native);
} }
if (state == 0 || /* key release */ if (state == 0 || /* key release */
@ -518,10 +518,10 @@ new_absolute_motion_event (MetaSeatImpl *seat_impl,
/* This may happen early at startup */ /* This may happen early at startup */
if (seat_impl->viewports) if (seat_impl->viewports)
{ {
meta_input_device_native_translate_coordinates (input_device, meta_input_device_native_translate_coordinates_in_impl (input_device,
seat_impl->viewports, seat_impl->viewports,
&event->motion.x, &event->motion.x,
&event->motion.y); &event->motion.y);
} }
event->motion.axes = axes; event->motion.axes = axes;
@ -537,14 +537,14 @@ new_absolute_motion_event (MetaSeatImpl *seat_impl,
clutter_event_set_device_tool (event, device_native->last_tool); clutter_event_set_device_tool (event, device_native->last_tool);
clutter_event_set_device (event, input_device); clutter_event_set_device (event, input_device);
meta_input_device_native_set_coords (META_INPUT_DEVICE_NATIVE (input_device), meta_input_device_native_set_coords_in_impl (META_INPUT_DEVICE_NATIVE (input_device),
x, y); x, y);
} }
else else
{ {
clutter_event_set_device (event, seat_impl->core_pointer); clutter_event_set_device (event, seat_impl->core_pointer);
meta_input_device_native_set_coords (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer), meta_input_device_native_set_coords_in_impl (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer),
x, y); x, y);
} }
if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE) if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
@ -559,13 +559,13 @@ new_absolute_motion_event (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_relative_motion (MetaSeatImpl *seat_impl, meta_seat_impl_notify_relative_motion_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
float dx, float dx,
float dy, float dy,
float dx_unaccel, float dx_unaccel,
float dy_unaccel) float dy_unaccel)
{ {
float new_x, new_y; float new_x, new_y;
ClutterEvent *event; ClutterEvent *event;
@ -590,12 +590,12 @@ meta_seat_impl_notify_relative_motion (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_absolute_motion (MetaSeatImpl *seat_impl, meta_seat_impl_notify_absolute_motion_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
float x, float x,
float y, float y,
double *axes) double *axes)
{ {
ClutterEvent *event; ClutterEvent *event;
@ -605,11 +605,11 @@ meta_seat_impl_notify_absolute_motion (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_button (MetaSeatImpl *seat_impl, meta_seat_impl_notify_button_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
uint32_t button, uint32_t button,
uint32_t state) uint32_t state)
{ {
MetaInputDeviceNative *device_native = (MetaInputDeviceNative *) input_device; MetaInputDeviceNative *device_native = (MetaInputDeviceNative *) input_device;
ClutterEvent *event = NULL; ClutterEvent *event = NULL;
@ -692,15 +692,15 @@ meta_seat_impl_notify_button (MetaSeatImpl *seat_impl,
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE) if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{ {
meta_input_device_native_get_coords (device_native, meta_input_device_native_get_coords_in_impl (device_native,
&event->button.x, &event->button.x,
&event->button.y); &event->button.y);
} }
else else
{ {
meta_input_device_native_get_coords (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer), meta_input_device_native_get_coords_in_impl (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer),
&event->button.x, &event->button.x,
&event->button.y); &event->button.y);
} }
clutter_event_set_device (event, seat_impl->core_pointer); clutter_event_set_device (event, seat_impl->core_pointer);
@ -711,8 +711,8 @@ meta_seat_impl_notify_button (MetaSeatImpl *seat_impl,
/* Apply the button event code as per the tool mapping */ /* Apply the button event code as per the tool mapping */
uint32_t mapped_button; uint32_t mapped_button;
mapped_button = meta_input_device_tool_native_get_button_code (device_native->last_tool, mapped_button = meta_input_device_tool_native_get_button_code_in_impl (device_native->last_tool,
button_nr); button_nr);
if (mapped_button != 0) if (mapped_button != 0)
button = mapped_button; button = mapped_button;
} }
@ -850,13 +850,13 @@ check_notify_discrete_scroll (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_scroll_continuous (MetaSeatImpl *seat_impl, meta_seat_impl_notify_scroll_continuous_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
double dx, double dx,
double dy, double dy,
ClutterScrollSource scroll_source, ClutterScrollSource scroll_source,
ClutterScrollFinishFlags finish_flags) ClutterScrollFinishFlags finish_flags)
{ {
if (finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL) if (finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL)
seat_impl->accum_scroll_dx = 0; seat_impl->accum_scroll_dx = 0;
@ -891,12 +891,12 @@ discrete_to_direction (double discrete_dx,
} }
void void
meta_seat_impl_notify_discrete_scroll (MetaSeatImpl *seat_impl, meta_seat_impl_notify_discrete_scroll_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
double discrete_dx, double discrete_dx,
double discrete_dy, double discrete_dy,
ClutterScrollSource scroll_source) ClutterScrollSource scroll_source)
{ {
notify_scroll (input_device, time_us, notify_scroll (input_device, time_us,
discrete_dx * DISCRETE_SCROLL_STEP, discrete_dx * DISCRETE_SCROLL_STEP,
@ -910,13 +910,13 @@ meta_seat_impl_notify_discrete_scroll (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_touch_event (MetaSeatImpl *seat_impl, meta_seat_impl_notify_touch_event_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device, ClutterInputDevice *input_device,
ClutterEventType evtype, ClutterEventType evtype,
uint64_t time_us, uint64_t time_us,
int slot, int slot,
double x, double x,
double y) double y)
{ {
ClutterEvent *event = NULL; ClutterEvent *event = NULL;
@ -926,10 +926,10 @@ meta_seat_impl_notify_touch_event (MetaSeatImpl *seat_impl,
event->touch.time = us2ms (time_us); event->touch.time = us2ms (time_us);
event->touch.x = x; event->touch.x = x;
event->touch.y = y; event->touch.y = y;
meta_input_device_native_translate_coordinates (input_device, meta_input_device_native_translate_coordinates_in_impl (input_device,
seat_impl->viewports, seat_impl->viewports,
&event->touch.x, &event->touch.x,
&event->touch.y); &event->touch.y);
/* "NULL" sequences are special cased in clutter */ /* "NULL" sequences are special cased in clutter */
event->touch.sequence = GINT_TO_POINTER (MAX (1, slot + 1)); event->touch.sequence = GINT_TO_POINTER (MAX (1, slot + 1));
@ -966,10 +966,10 @@ constrain_to_barriers (MetaSeatImpl *seat_impl,
float *new_x, float *new_x,
float *new_y) float *new_y)
{ {
meta_barrier_manager_native_process (seat_impl->barrier_manager, meta_barrier_manager_native_process_in_impl (seat_impl->barrier_manager,
device, device,
time, time,
new_x, new_y); new_x, new_y);
} }
/* /*
@ -990,8 +990,8 @@ constrain_all_screen_monitors (ClutterInputDevice *device,
float cx, cy; float cx, cy;
int i, n_views; int i, n_views;
meta_input_device_native_get_coords (META_INPUT_DEVICE_NATIVE (device), meta_input_device_native_get_coords_in_impl (META_INPUT_DEVICE_NATIVE (device),
&cx, &cy); &cx, &cy);
/* if we're trying to escape, clamp to the CRTC we're coming from */ /* if we're trying to escape, clamp to the CRTC we're coming from */
@ -1180,11 +1180,11 @@ meta_seat_impl_filter_relative_motion (MetaSeatImpl *seat_impl,
} }
static void static void
notify_absolute_motion (ClutterInputDevice *input_device, notify_absolute_motion_in_impl (ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
float x, float x,
float y, float y,
double *axes) double *axes)
{ {
MetaSeatImpl *seat_impl; MetaSeatImpl *seat_impl;
ClutterEvent *event; ClutterEvent *event;
@ -1196,11 +1196,11 @@ notify_absolute_motion (ClutterInputDevice *input_device,
} }
static void static void
notify_relative_tool_motion (ClutterInputDevice *input_device, notify_relative_tool_motion_in_impl (ClutterInputDevice *input_device,
uint64_t time_us, uint64_t time_us,
float dx, float dx,
float dy, float dy,
double *axes) double *axes)
{ {
MetaInputDeviceNative *device_native; MetaInputDeviceNative *device_native;
ClutterEvent *event; ClutterEvent *event;
@ -1243,9 +1243,9 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
event = clutter_event_new (CLUTTER_TOUCHPAD_PINCH); event = clutter_event_new (CLUTTER_TOUCHPAD_PINCH);
meta_input_device_native_get_coords (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer), meta_input_device_native_get_coords_in_impl (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer),
&event->touchpad_pinch.x, &event->touchpad_pinch.x,
&event->touchpad_pinch.y); &event->touchpad_pinch.y);
meta_event_native_set_time_usec (event, time_us); meta_event_native_set_time_usec (event, time_us);
event->touchpad_pinch.phase = phase; event->touchpad_pinch.phase = phase;
@ -1283,9 +1283,9 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
event->touchpad_swipe.phase = phase; event->touchpad_swipe.phase = phase;
event->touchpad_swipe.time = us2ms (time_us); event->touchpad_swipe.time = us2ms (time_us);
meta_input_device_native_get_coords (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer), meta_input_device_native_get_coords_in_impl (META_INPUT_DEVICE_NATIVE (seat_impl->core_pointer),
&event->touchpad_swipe.x, &event->touchpad_swipe.x,
&event->touchpad_swipe.y); &event->touchpad_swipe.y);
event->touchpad_swipe.dx = dx; event->touchpad_swipe.dx = dx;
event->touchpad_swipe.dy = dy; event->touchpad_swipe.dy = dy;
event->touchpad_swipe.n_fingers = n_fingers; event->touchpad_swipe.n_fingers = n_fingers;
@ -1566,13 +1566,13 @@ evdev_add_device (MetaSeatImpl *seat_impl,
ClutterInputDevice *device; ClutterInputDevice *device;
gboolean is_touchscreen, is_tablet_switch; gboolean is_touchscreen, is_tablet_switch;
device = meta_input_device_native_new (seat_impl, libinput_device); device = meta_input_device_native_new_in_impl (seat_impl, libinput_device);
seat_impl->devices = g_slist_prepend (seat_impl->devices, device); seat_impl->devices = g_slist_prepend (seat_impl->devices, device);
/* Clutter assumes that device types are exclusive in the /* Clutter assumes that device types are exclusive in the
* ClutterInputDevice API */ * ClutterInputDevice API */
type = meta_input_device_native_determine_type (libinput_device); type = meta_input_device_native_determine_type_in_impl (libinput_device);
is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE; is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE;
is_tablet_switch = is_tablet_switch =
@ -1772,7 +1772,7 @@ translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event,
if (libinput_tablet_tool_has_pressure (libinput_tool)) if (libinput_tablet_tool_has_pressure (libinput_tool))
{ {
value = libinput_event_tablet_tool_get_pressure (tablet_event); value = libinput_event_tablet_tool_get_pressure (tablet_event);
value = meta_input_device_tool_native_translate_pressure (tool, value); value = meta_input_device_tool_native_translate_pressure_in_impl (tool, value);
axes[CLUTTER_INPUT_AXIS_PRESSURE] = value; axes[CLUTTER_INPUT_AXIS_PRESSURE] = value;
} }
@ -1834,9 +1834,9 @@ notify_continuous_axis (MetaSeatImpl *seat_impl,
finish_flags |= CLUTTER_SCROLL_FINISHED_VERTICAL; finish_flags |= CLUTTER_SCROLL_FINISHED_VERTICAL;
} }
meta_seat_impl_notify_scroll_continuous (seat_impl, device, time_us, meta_seat_impl_notify_scroll_continuous_in_impl (seat_impl, device, time_us,
dx, dy, dx, dy,
scroll_source, finish_flags); scroll_source, finish_flags);
} }
static void static void
@ -1861,10 +1861,10 @@ notify_discrete_axis (MetaSeatImpl *seat_impl,
axis_event, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); axis_event, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
} }
meta_seat_impl_notify_discrete_scroll (seat_impl, device, meta_seat_impl_notify_discrete_scroll_in_impl (seat_impl, device,
time_us, time_us,
discrete_dx, discrete_dy, discrete_dx, discrete_dy,
scroll_source); scroll_source);
} }
static void static void
@ -1891,19 +1891,19 @@ process_tablet_axis (MetaSeatImpl *seat_impl,
time = libinput_event_tablet_tool_get_time_usec (tablet_event); time = libinput_event_tablet_tool_get_time_usec (tablet_event);
if (meta_input_device_native_get_mapping_mode (device) == META_INPUT_DEVICE_MAPPING_RELATIVE || if (meta_input_device_native_get_mapping_mode_in_impl (device) == META_INPUT_DEVICE_MAPPING_RELATIVE ||
clutter_input_device_tool_get_tool_type (evdev_device->last_tool) == CLUTTER_INPUT_DEVICE_TOOL_MOUSE || clutter_input_device_tool_get_tool_type (evdev_device->last_tool) == CLUTTER_INPUT_DEVICE_TOOL_MOUSE ||
clutter_input_device_tool_get_tool_type (evdev_device->last_tool) == CLUTTER_INPUT_DEVICE_TOOL_LENS) clutter_input_device_tool_get_tool_type (evdev_device->last_tool) == CLUTTER_INPUT_DEVICE_TOOL_LENS)
{ {
dx = libinput_event_tablet_tool_get_dx (tablet_event); dx = libinput_event_tablet_tool_get_dx (tablet_event);
dy = libinput_event_tablet_tool_get_dy (tablet_event); dy = libinput_event_tablet_tool_get_dy (tablet_event);
notify_relative_tool_motion (device, time, dx, dy, axes); notify_relative_tool_motion_in_impl (device, time, dx, dy, axes);
} }
else else
{ {
x = libinput_event_tablet_tool_get_x_transformed (tablet_event, stage_width); x = libinput_event_tablet_tool_get_x_transformed (tablet_event, stage_width);
y = libinput_event_tablet_tool_get_y_transformed (tablet_event, stage_height); y = libinput_event_tablet_tool_get_y_transformed (tablet_event, stage_height);
notify_absolute_motion (device, time, x, y, axes); notify_absolute_motion_in_impl (device, time, x, y, axes);
} }
} }
@ -1947,9 +1947,9 @@ process_device_event (MetaSeatImpl *seat_impl,
break; break;
} }
meta_seat_impl_notify_key (seat_impl, meta_seat_impl_notify_key_in_impl (seat_impl,
device, device,
time_us, key, key_state, TRUE); time_us, key, key_state, TRUE);
break; break;
} }
@ -1971,11 +1971,11 @@ process_device_event (MetaSeatImpl *seat_impl,
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event); dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event); dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
meta_seat_impl_notify_relative_motion (seat_impl, meta_seat_impl_notify_relative_motion_in_impl (seat_impl,
device, device,
time_us, time_us,
dx, dy, dx, dy,
dx_unaccel, dy_unaccel); dx_unaccel, dy_unaccel);
break; break;
} }
@ -1998,11 +1998,11 @@ process_device_event (MetaSeatImpl *seat_impl,
y = libinput_event_pointer_get_absolute_y_transformed (motion_event, y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
stage_height); stage_height);
meta_seat_impl_notify_absolute_motion (seat_impl, meta_seat_impl_notify_absolute_motion_in_impl (seat_impl,
device, device,
time_us, time_us,
x, y, x, y,
NULL); NULL);
break; break;
} }
@ -2036,8 +2036,8 @@ process_device_event (MetaSeatImpl *seat_impl,
break; break;
} }
meta_seat_impl_notify_button (seat_impl, device, meta_seat_impl_notify_button_in_impl (seat_impl, device,
time_us, button, button_state); time_us, button, button_state);
break; break;
} }
@ -2101,18 +2101,18 @@ process_device_event (MetaSeatImpl *seat_impl,
g_rw_lock_writer_lock (&seat_impl->state_lock); g_rw_lock_writer_lock (&seat_impl->state_lock);
touch_state = meta_seat_impl_acquire_touch_state (seat_impl, seat_slot); touch_state = meta_seat_impl_acquire_touch_state_in_impl (seat_impl, seat_slot);
touch_state->coords.x = x; touch_state->coords.x = x;
touch_state->coords.y = y; touch_state->coords.y = y;
g_rw_lock_writer_unlock (&seat_impl->state_lock); g_rw_lock_writer_unlock (&seat_impl->state_lock);
meta_seat_impl_notify_touch_event (seat_impl, device, meta_seat_impl_notify_touch_event_in_impl (seat_impl, device,
CLUTTER_TOUCH_BEGIN, CLUTTER_TOUCH_BEGIN,
time_us, time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
break; break;
} }
@ -2129,18 +2129,18 @@ process_device_event (MetaSeatImpl *seat_impl,
seat_slot = libinput_event_touch_get_seat_slot (touch_event); seat_slot = libinput_event_touch_get_seat_slot (touch_event);
time_us = libinput_event_touch_get_time_usec (touch_event); time_us = libinput_event_touch_get_time_usec (touch_event);
touch_state = meta_seat_impl_lookup_touch_state (seat_impl, seat_slot); touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat_impl, seat_slot);
if (!touch_state) if (!touch_state)
break; break;
meta_seat_impl_notify_touch_event (seat_impl, device, meta_seat_impl_notify_touch_event_in_impl (seat_impl, device,
CLUTTER_TOUCH_END, time_us, CLUTTER_TOUCH_END, time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
g_rw_lock_writer_lock (&seat_impl->state_lock); g_rw_lock_writer_lock (&seat_impl->state_lock);
meta_seat_impl_release_touch_state (seat_impl, seat_slot); meta_seat_impl_release_touch_state_in_impl (seat_impl, seat_slot);
g_rw_lock_writer_unlock (&seat_impl->state_lock); g_rw_lock_writer_unlock (&seat_impl->state_lock);
break; break;
} }
@ -2169,7 +2169,7 @@ process_device_event (MetaSeatImpl *seat_impl,
stage_height); stage_height);
g_rw_lock_writer_lock (&seat_impl->state_lock); g_rw_lock_writer_lock (&seat_impl->state_lock);
touch_state = meta_seat_impl_lookup_touch_state (seat_impl, seat_slot); touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat_impl, seat_slot);
if (touch_state) if (touch_state)
{ {
touch_state->coords.x = x; touch_state->coords.x = x;
@ -2180,12 +2180,12 @@ process_device_event (MetaSeatImpl *seat_impl,
if (!touch_state) if (!touch_state)
break; break;
meta_seat_impl_notify_touch_event (seat_impl, device, meta_seat_impl_notify_touch_event_in_impl (seat_impl, device,
CLUTTER_TOUCH_UPDATE, CLUTTER_TOUCH_UPDATE,
time_us, time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
break; break;
} }
case LIBINPUT_EVENT_TOUCH_CANCEL: case LIBINPUT_EVENT_TOUCH_CANCEL:
@ -2201,19 +2201,19 @@ process_device_event (MetaSeatImpl *seat_impl,
time_us = libinput_event_touch_get_time_usec (touch_event); time_us = libinput_event_touch_get_time_usec (touch_event);
seat_slot = libinput_event_touch_get_seat_slot (touch_event); seat_slot = libinput_event_touch_get_seat_slot (touch_event);
touch_state = meta_seat_impl_lookup_touch_state (seat_impl, seat_slot); touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat_impl, seat_slot);
if (!touch_state) if (!touch_state)
break; break;
meta_seat_impl_notify_touch_event (touch_state->seat_impl, meta_seat_impl_notify_touch_event_in_impl (touch_state->seat_impl,
CLUTTER_INPUT_DEVICE (device_native), CLUTTER_INPUT_DEVICE (device_native),
CLUTTER_TOUCH_CANCEL, CLUTTER_TOUCH_CANCEL,
time_us, time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
meta_seat_impl_release_touch_state (seat_impl, seat_slot); meta_seat_impl_release_touch_state_in_impl (seat_impl, seat_slot);
break; break;
} }
case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN: case LIBINPUT_EVENT_GESTURE_PINCH_BEGIN:
@ -2345,8 +2345,8 @@ process_device_event (MetaSeatImpl *seat_impl,
button_state = libinput_event_tablet_tool_get_button_state (tablet_event) == button_state = libinput_event_tablet_tool_get_button_state (tablet_event) ==
LIBINPUT_BUTTON_STATE_PRESSED; LIBINPUT_BUTTON_STATE_PRESSED;
meta_seat_impl_notify_button (seat_impl, device, meta_seat_impl_notify_button_in_impl (seat_impl, device,
time_us, tablet_button, button_state); time_us, tablet_button, button_state);
break; break;
} }
case LIBINPUT_EVENT_TABLET_TOOL_TIP: case LIBINPUT_EVENT_TABLET_TOOL_TIP:
@ -2367,8 +2367,8 @@ process_device_event (MetaSeatImpl *seat_impl,
if (button_state) if (button_state)
process_tablet_axis (seat_impl, event); process_tablet_axis (seat_impl, event);
meta_seat_impl_notify_button (seat_impl, device, meta_seat_impl_notify_button_in_impl (seat_impl, device,
time_us, BTN_TOUCH, button_state); time_us, BTN_TOUCH, button_state);
if (!button_state) if (!button_state)
process_tablet_axis (seat_impl, event); process_tablet_axis (seat_impl, event);
break; break;
@ -2537,12 +2537,12 @@ kbd_a11y_changed_cb (MetaInputSettings *input_settings,
MetaInputDeviceNative *keyboard; MetaInputDeviceNative *keyboard;
keyboard = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard); keyboard = META_INPUT_DEVICE_NATIVE (seat_impl->core_keyboard);
meta_input_device_native_apply_kbd_a11y_settings (keyboard, a11y_settings); meta_input_device_native_apply_kbd_a11y_settings_in_impl (keyboard, a11y_settings);
} }
static void static void
meta_seat_impl_set_keyboard_numlock (MetaSeatImpl *seat_impl, meta_seat_impl_set_keyboard_numlock_in_impl (MetaSeatImpl *seat_impl,
gboolean numlock_state) gboolean numlock_state)
{ {
xkb_mod_mask_t depressed_mods; xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t latched_mods; xkb_mod_mask_t latched_mods;
@ -2553,7 +2553,7 @@ meta_seat_impl_set_keyboard_numlock (MetaSeatImpl *seat_impl,
MetaKeymapNative *keymap; MetaKeymapNative *keymap;
keymap = seat_impl->keymap; keymap = seat_impl->keymap;
xkb_keymap = meta_keymap_native_get_keyboard_map (keymap); xkb_keymap = meta_keymap_native_get_keyboard_map_in_impl (keymap);
numlock = (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")); numlock = (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2"));
@ -2578,8 +2578,8 @@ meta_seat_impl_set_keyboard_numlock (MetaSeatImpl *seat_impl,
0, 0, 0, 0,
group_mods); group_mods);
meta_seat_impl_sync_leds (seat_impl); meta_seat_impl_sync_leds_in_impl (seat_impl);
meta_keymap_native_update (seat_impl->keymap); meta_keymap_native_update_in_impl (seat_impl->keymap);
} }
static gpointer static gpointer
@ -2619,7 +2619,7 @@ input_thread (MetaSeatImpl *seat_impl)
udev_unref (udev); udev_unref (udev);
seat_impl->input_settings = meta_input_settings_native_new (seat_impl); seat_impl->input_settings = meta_input_settings_native_new_in_impl (seat_impl);
g_signal_connect_object (seat_impl->input_settings, "kbd-a11y-changed", g_signal_connect_object (seat_impl->input_settings, "kbd-a11y-changed",
G_CALLBACK (kbd_a11y_changed_cb), seat_impl, 0); G_CALLBACK (kbd_a11y_changed_cb), seat_impl, 0);
@ -2628,7 +2628,7 @@ input_thread (MetaSeatImpl *seat_impl)
seat_impl->keymap = g_object_new (META_TYPE_KEYMAP_NATIVE, NULL); seat_impl->keymap = g_object_new (META_TYPE_KEYMAP_NATIVE, NULL);
xkb_keymap = meta_keymap_native_get_keyboard_map (seat_impl->keymap); xkb_keymap = meta_keymap_native_get_keyboard_map_in_impl (seat_impl->keymap);
if (xkb_keymap) if (xkb_keymap)
{ {
@ -2643,7 +2643,7 @@ input_thread (MetaSeatImpl *seat_impl)
} }
if (meta_input_settings_maybe_restore_numlock_state (seat_impl->input_settings)) if (meta_input_settings_maybe_restore_numlock_state (seat_impl->input_settings))
meta_seat_impl_set_keyboard_numlock (seat_impl, TRUE); meta_seat_impl_set_keyboard_numlock_in_impl (seat_impl, TRUE);
seat_impl->has_touchscreen = has_touchscreen (seat_impl); seat_impl->has_touchscreen = has_touchscreen (seat_impl);
seat_impl->has_tablet_switch = has_tablet_switch (seat_impl); seat_impl->has_tablet_switch = has_tablet_switch (seat_impl);
@ -2702,9 +2702,9 @@ meta_seat_impl_constructed (GObject *object)
CLUTTER_INPUT_MODE_LOGICAL); CLUTTER_INPUT_MODE_LOGICAL);
seat_impl->pointer_x = INITIAL_POINTER_X; seat_impl->pointer_x = INITIAL_POINTER_X;
seat_impl->pointer_y = INITIAL_POINTER_Y; seat_impl->pointer_y = INITIAL_POINTER_Y;
meta_input_device_native_set_coords (META_INPUT_DEVICE_NATIVE (device), meta_input_device_native_set_coords_in_impl (META_INPUT_DEVICE_NATIVE (device),
seat_impl->pointer_x, seat_impl->pointer_x,
seat_impl->pointer_y); seat_impl->pointer_y);
seat_impl->core_pointer = device; seat_impl->core_pointer = device;
device = meta_input_device_native_new_virtual ( device = meta_input_device_native_new_virtual (
@ -2831,7 +2831,7 @@ meta_seat_impl_get_keyboard (MetaSeatImpl *seat_impl)
} }
GSList * GSList *
meta_seat_impl_get_devices (MetaSeatImpl *seat_impl) meta_seat_impl_get_devices_in_impl (MetaSeatImpl *seat_impl)
{ {
return g_slist_copy_deep (seat_impl->devices, return g_slist_copy_deep (seat_impl->devices,
(GCopyFunc) g_object_ref, (GCopyFunc) g_object_ref,
@ -2845,14 +2845,14 @@ meta_seat_impl_get_keymap (MetaSeatImpl *seat_impl)
} }
static gboolean static gboolean
warp_pointer (GTask *task) warp_pointer_in_impl (GTask *task)
{ {
MetaSeatImpl *seat = g_task_get_source_object (task); MetaSeatImpl *seat = g_task_get_source_object (task);
graphene_point_t *point; graphene_point_t *point;
point = g_task_get_task_data (task); point = g_task_get_task_data (task);
notify_absolute_motion (seat->core_pointer, 0, notify_absolute_motion_in_impl (seat->core_pointer, 0,
point->x, point->y, NULL); point->x, point->y, NULL);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -2872,7 +2872,8 @@ meta_seat_impl_warp_pointer (MetaSeatImpl *seat_impl,
task = g_task_new (seat_impl, NULL, NULL, NULL); task = g_task_new (seat_impl, NULL, NULL, NULL);
g_task_set_task_data (task, point, (GDestroyNotify) graphene_point_free); g_task_set_task_data (task, point, (GDestroyNotify) graphene_point_free);
meta_seat_impl_run_input_task (seat_impl, task, (GSourceFunc) warp_pointer); meta_seat_impl_run_input_task (seat_impl, task,
(GSourceFunc) warp_pointer_in_impl);
g_object_unref (task); g_object_unref (task);
} }
@ -2895,7 +2896,7 @@ meta_seat_impl_query_state (MetaSeatImpl *seat_impl,
int slot; int slot;
slot = meta_event_native_sequence_get_slot (sequence); slot = meta_event_native_sequence_get_slot (sequence);
touch_state = meta_seat_impl_lookup_touch_state (seat_impl, slot); touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat_impl, slot);
if (!touch_state) if (!touch_state)
goto out; goto out;
@ -3047,7 +3048,7 @@ meta_seat_impl_set_device_callbacks (MetaOpenDeviceCallback open_callback,
} }
void void
meta_seat_impl_update_xkb_state (MetaSeatImpl *seat_impl) meta_seat_impl_update_xkb_state_in_impl (MetaSeatImpl *seat_impl)
{ {
xkb_mod_mask_t latched_mods = 0; xkb_mod_mask_t latched_mods = 0;
xkb_mod_mask_t locked_mods = 0; xkb_mod_mask_t locked_mods = 0;
@ -3055,7 +3056,7 @@ meta_seat_impl_update_xkb_state (MetaSeatImpl *seat_impl)
g_rw_lock_writer_lock (&seat_impl->state_lock); g_rw_lock_writer_lock (&seat_impl->state_lock);
xkb_keymap = meta_keymap_native_get_keyboard_map (seat_impl->keymap); xkb_keymap = meta_keymap_native_get_keyboard_map_in_impl (seat_impl->keymap);
if (seat_impl->xkb) if (seat_impl->xkb)
{ {
@ -3081,8 +3082,8 @@ meta_seat_impl_update_xkb_state (MetaSeatImpl *seat_impl)
seat_impl->scroll_lock_led = seat_impl->scroll_lock_led =
xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL); xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL);
meta_seat_impl_sync_leds (seat_impl); meta_seat_impl_sync_leds_in_impl (seat_impl);
meta_keymap_native_update (seat_impl->keymap); meta_keymap_native_update_in_impl (seat_impl->keymap);
g_rw_lock_writer_unlock (&seat_impl->state_lock); g_rw_lock_writer_unlock (&seat_impl->state_lock);
} }
@ -3142,7 +3143,7 @@ reclaim_devices (GTask *task)
if (seat_impl->released) if (seat_impl->released)
{ {
libinput_resume (seat_impl->libinput); libinput_resume (seat_impl->libinput);
meta_seat_impl_update_xkb_state (seat_impl); meta_seat_impl_update_xkb_state_in_impl (seat_impl);
process_events (seat_impl); process_events (seat_impl);
seat_impl->released = FALSE; seat_impl->released = FALSE;
@ -3189,9 +3190,9 @@ set_keyboard_map (GTask *task)
MetaKeymapNative *keymap; MetaKeymapNative *keymap;
keymap = seat_impl->keymap; keymap = seat_impl->keymap;
meta_keymap_native_set_keyboard_map (keymap, xkb_keymap); meta_keymap_native_set_keyboard_map_in_impl (keymap, xkb_keymap);
meta_seat_impl_update_xkb_state (seat_impl); meta_seat_impl_update_xkb_state_in_impl (seat_impl);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -3243,7 +3244,7 @@ set_keyboard_layout_index (GTask *task)
locked_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED); locked_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED);
xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx); xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx);
meta_keymap_native_update (seat_impl->keymap); meta_keymap_native_update_in_impl (seat_impl->keymap);
seat_impl->layout_idx = idx; seat_impl->layout_idx = idx;
@ -3276,9 +3277,8 @@ meta_seat_impl_set_keyboard_layout_index (MetaSeatImpl *seat_impl,
g_object_unref (task); g_object_unref (task);
} }
/** /**
* meta_seat_impl_set_keyboard_repeat: * meta_seat_impl_set_keyboard_repeat_in_impl:
* @seat: the #ClutterSeat created by the evdev backend * @seat: the #ClutterSeat created by the evdev backend
* @repeat: whether to enable or disable keyboard repeat events * @repeat: whether to enable or disable keyboard repeat events
* @delay: the delay in ms between the hardware key press event and * @delay: the delay in ms between the hardware key press event and
@ -3290,10 +3290,10 @@ meta_seat_impl_set_keyboard_layout_index (MetaSeatImpl *seat_impl,
* delay and interval period to be specified. * delay and interval period to be specified.
*/ */
void void
meta_seat_impl_set_keyboard_repeat (MetaSeatImpl *seat_impl, meta_seat_impl_set_keyboard_repeat_in_impl (MetaSeatImpl *seat_impl,
gboolean repeat, gboolean repeat,
uint32_t delay, uint32_t delay,
uint32_t interval) uint32_t interval)
{ {
g_return_if_fail (META_IS_SEAT_IMPL (seat_impl)); g_return_if_fail (META_IS_SEAT_IMPL (seat_impl));
@ -3303,7 +3303,7 @@ meta_seat_impl_set_keyboard_repeat (MetaSeatImpl *seat_impl,
} }
struct xkb_state * struct xkb_state *
meta_seat_impl_get_xkb_state (MetaSeatImpl *seat_impl) meta_seat_impl_get_xkb_state_in_impl (MetaSeatImpl *seat_impl)
{ {
return seat_impl->xkb; return seat_impl->xkb;
} }
@ -3388,9 +3388,9 @@ meta_seat_impl_new (MetaSeatNative *seat_native,
} }
void void
meta_seat_impl_notify_kbd_a11y_flags_changed (MetaSeatImpl *seat_impl, meta_seat_impl_notify_kbd_a11y_flags_changed_in_impl (MetaSeatImpl *seat_impl,
MetaKeyboardA11yFlags new_flags, MetaKeyboardA11yFlags new_flags,
MetaKeyboardA11yFlags what_changed) MetaKeyboardA11yFlags what_changed)
{ {
MetaInputSettings *input_settings; MetaInputSettings *input_settings;
GValue values[] = { G_VALUE_INIT, G_VALUE_INIT }; GValue values[] = { G_VALUE_INIT, G_VALUE_INIT };
@ -3408,9 +3408,9 @@ meta_seat_impl_notify_kbd_a11y_flags_changed (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_kbd_a11y_mods_state_changed (MetaSeatImpl *seat_impl, meta_seat_impl_notify_kbd_a11y_mods_state_changed_in_impl (MetaSeatImpl *seat_impl,
xkb_mod_mask_t new_latched_mods, xkb_mod_mask_t new_latched_mods,
xkb_mod_mask_t new_locked_mods) xkb_mod_mask_t new_locked_mods)
{ {
GValue values[] = { G_VALUE_INIT, G_VALUE_INIT }; GValue values[] = { G_VALUE_INIT, G_VALUE_INIT };
@ -3424,7 +3424,7 @@ meta_seat_impl_notify_kbd_a11y_mods_state_changed (MetaSeatImpl *seat_impl,
} }
void void
meta_seat_impl_notify_bell (MetaSeatImpl *seat_impl) meta_seat_impl_notify_bell_in_impl (MetaSeatImpl *seat_impl)
{ {
emit_signal (seat_impl, signals[BELL], NULL, 0); emit_signal (seat_impl, signals[BELL], NULL, 0);
} }

View File

@ -129,67 +129,67 @@ void meta_seat_impl_run_input_task (MetaSeatImpl *seat_impl,
GTask *task, GTask *task,
GSourceFunc dispatch_func); GSourceFunc dispatch_func);
void meta_seat_impl_notify_key (MetaSeatImpl *seat_impl, void meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *device, ClutterInputDevice *device,
uint64_t time_us,
uint32_t key,
uint32_t state,
gboolean update_keys);
void meta_seat_impl_notify_relative_motion (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
float dx,
float dy,
float dx_unaccel,
float dy_unaccel);
void meta_seat_impl_notify_absolute_motion (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
float x,
float y,
double *axes);
void meta_seat_impl_notify_button (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
uint32_t button,
uint32_t state);
void meta_seat_impl_notify_scroll_continuous (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
double dx,
double dy,
ClutterScrollSource source,
ClutterScrollFinishFlags flags);
void meta_seat_impl_notify_discrete_scroll (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
double discrete_dx,
double discrete_dy,
ClutterScrollSource source);
void meta_seat_impl_notify_touch_event (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
ClutterEventType evtype,
uint64_t time_us, uint64_t time_us,
int slot, uint32_t key,
double x, uint32_t state,
double y); gboolean update_keys);
void meta_seat_impl_sync_leds (MetaSeatImpl *seat_impl); void meta_seat_impl_notify_relative_motion_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
float dx,
float dy,
float dx_unaccel,
float dy_unaccel);
MetaTouchState * meta_seat_impl_acquire_touch_state (MetaSeatImpl *seat_impl, void meta_seat_impl_notify_absolute_motion_in_impl (MetaSeatImpl *seat_impl,
int seat_slot); ClutterInputDevice *input_device,
MetaTouchState * meta_seat_impl_lookup_touch_state (MetaSeatImpl *seat_impl, uint64_t time_us,
int seat_slot); float x,
void meta_seat_impl_release_touch_state (MetaSeatImpl *seat_impl, float y,
int seat_slot); double *axes);
void meta_seat_impl_update_xkb_state (MetaSeatImpl *seat_impl); void meta_seat_impl_notify_button_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
uint32_t button,
uint32_t state);
void meta_seat_impl_notify_scroll_continuous_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
double dx,
double dy,
ClutterScrollSource source,
ClutterScrollFinishFlags flags);
void meta_seat_impl_notify_discrete_scroll_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
uint64_t time_us,
double discrete_dx,
double discrete_dy,
ClutterScrollSource source);
void meta_seat_impl_notify_touch_event_in_impl (MetaSeatImpl *seat_impl,
ClutterInputDevice *input_device,
ClutterEventType evtype,
uint64_t time_us,
int slot,
double x,
double y);
void meta_seat_impl_sync_leds_in_impl (MetaSeatImpl *seat_impl);
MetaTouchState * meta_seat_impl_acquire_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot);
MetaTouchState * meta_seat_impl_lookup_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot);
void meta_seat_impl_release_touch_state_in_impl (MetaSeatImpl *seat_impl,
int seat_slot);
void meta_seat_impl_update_xkb_state_in_impl (MetaSeatImpl *seat_impl);
/** /**
* MetaOpenDeviceCallback: * MetaOpenDeviceCallback:
@ -214,18 +214,18 @@ void meta_seat_impl_set_device_callbacks (MetaOpenDeviceCallback open_callback
void meta_seat_impl_release_devices (MetaSeatImpl *seat_impl); void meta_seat_impl_release_devices (MetaSeatImpl *seat_impl);
void meta_seat_impl_reclaim_devices (MetaSeatImpl *seat_impl); void meta_seat_impl_reclaim_devices (MetaSeatImpl *seat_impl);
struct xkb_state * meta_seat_impl_get_xkb_state (MetaSeatImpl *seat_impl); struct xkb_state * meta_seat_impl_get_xkb_state_in_impl (MetaSeatImpl *seat_impl);
void meta_seat_impl_set_keyboard_map (MetaSeatImpl *seat_impl, void meta_seat_impl_set_keyboard_map (MetaSeatImpl *seat_impl,
struct xkb_keymap *keymap); struct xkb_keymap *keymap);
void meta_seat_impl_set_keyboard_layout_index (MetaSeatImpl *seat_impl, void meta_seat_impl_set_keyboard_layout_index (MetaSeatImpl *seat_impl,
xkb_layout_index_t idx); xkb_layout_index_t idx);
void meta_seat_impl_set_keyboard_repeat (MetaSeatImpl *seat_impl, void meta_seat_impl_set_keyboard_repeat_in_impl (MetaSeatImpl *seat_impl,
gboolean repeat, gboolean repeat,
uint32_t delay, uint32_t delay,
uint32_t interval); uint32_t interval);
MetaBarrierManagerNative * meta_seat_impl_get_barrier_manager (MetaSeatImpl *seat_impl); MetaBarrierManagerNative * meta_seat_impl_get_barrier_manager (MetaSeatImpl *seat_impl);
@ -244,17 +244,17 @@ gboolean meta_seat_impl_query_state (MetaSeatImpl *seat_impl,
ClutterModifierType *modifiers); ClutterModifierType *modifiers);
ClutterInputDevice * meta_seat_impl_get_pointer (MetaSeatImpl *seat_impl); ClutterInputDevice * meta_seat_impl_get_pointer (MetaSeatImpl *seat_impl);
ClutterInputDevice * meta_seat_impl_get_keyboard (MetaSeatImpl *seat_impl); ClutterInputDevice * meta_seat_impl_get_keyboard (MetaSeatImpl *seat_impl);
GSList * meta_seat_impl_get_devices (MetaSeatImpl *seat_impl); GSList * meta_seat_impl_get_devices_in_impl (MetaSeatImpl *seat_impl);
MetaKeymapNative * meta_seat_impl_get_keymap (MetaSeatImpl *seat_impl); MetaKeymapNative * meta_seat_impl_get_keymap (MetaSeatImpl *seat_impl);
void meta_seat_impl_notify_kbd_a11y_flags_changed (MetaSeatImpl *seat_impl, void meta_seat_impl_notify_kbd_a11y_flags_changed_in_impl (MetaSeatImpl *seat_impl,
MetaKeyboardA11yFlags new_flags, MetaKeyboardA11yFlags new_flags,
MetaKeyboardA11yFlags what_changed); MetaKeyboardA11yFlags what_changed);
void meta_seat_impl_notify_kbd_a11y_mods_state_changed (MetaSeatImpl *seat_impl, void meta_seat_impl_notify_kbd_a11y_mods_state_changed_in_impl (MetaSeatImpl *seat_impl,
xkb_mod_mask_t new_latched_mods, xkb_mod_mask_t new_latched_mods,
xkb_mod_mask_t new_locked_mods); xkb_mod_mask_t new_locked_mods);
void meta_seat_impl_notify_bell (MetaSeatImpl *seat_impl); void meta_seat_impl_notify_bell_in_impl (MetaSeatImpl *seat_impl);
MetaInputSettings * meta_seat_impl_get_input_settings (MetaSeatImpl *seat_impl); MetaInputSettings * meta_seat_impl_get_input_settings (MetaSeatImpl *seat_impl);

View File

@ -109,9 +109,9 @@ typedef enum _EvdevButtonType
} EvdevButtonType; } EvdevButtonType;
static int static int
update_button_count (MetaVirtualInputDeviceNative *virtual_evdev, update_button_count_in_impl (MetaVirtualInputDeviceNative *virtual_evdev,
uint32_t button, uint32_t button,
uint32_t state) uint32_t state)
{ {
if (state) if (state)
return ++virtual_evdev->impl_state->button_count[button]; return ++virtual_evdev->impl_state->button_count[button];
@ -156,7 +156,7 @@ get_button_type (uint16_t code)
} }
static gboolean static gboolean
release_device (GTask *task) release_device_in_impl (GTask *task)
{ {
ImplState *impl_state = g_task_get_task_data (task); ImplState *impl_state = g_task_get_task_data (task);
MetaInputDeviceNative *device_native; MetaInputDeviceNative *device_native;
@ -180,19 +180,19 @@ release_device (GTask *task)
switch (get_button_type (code)) switch (get_button_type (code))
{ {
case EVDEV_BUTTON_TYPE_KEY: case EVDEV_BUTTON_TYPE_KEY:
meta_seat_impl_notify_key (seat_impl, meta_seat_impl_notify_key_in_impl (seat_impl,
impl_state->device, impl_state->device,
time_us, time_us,
code, code,
CLUTTER_KEY_STATE_RELEASED, CLUTTER_KEY_STATE_RELEASED,
TRUE); TRUE);
break; break;
case EVDEV_BUTTON_TYPE_BUTTON: case EVDEV_BUTTON_TYPE_BUTTON:
meta_seat_impl_notify_button (seat_impl, meta_seat_impl_notify_button_in_impl (seat_impl,
impl_state->device, impl_state->device,
time_us, time_us,
code, code,
CLUTTER_BUTTON_STATE_RELEASED); CLUTTER_BUTTON_STATE_RELEASED);
break; break;
case EVDEV_BUTTON_TYPE_NONE: case EVDEV_BUTTON_TYPE_NONE:
g_assert_not_reached (); g_assert_not_reached ();
@ -206,7 +206,7 @@ release_device (GTask *task)
} }
static gboolean static gboolean
notify_relative_motion (GTask *task) notify_relative_motion_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -216,11 +216,11 @@ notify_relative_motion (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
meta_seat_impl_notify_relative_motion (seat, meta_seat_impl_notify_relative_motion_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
event->x, event->y, event->x, event->y,
event->x, event->y); event->x, event->y);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@ -246,12 +246,12 @@ meta_virtual_input_device_native_notify_relative_motion (ClutterVirtualInputDevi
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_relative_motion); (GSourceFunc) notify_relative_motion_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_absolute_motion (GTask *task) notify_absolute_motion_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -261,11 +261,11 @@ notify_absolute_motion (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
meta_seat_impl_notify_absolute_motion (seat, meta_seat_impl_notify_absolute_motion_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
event->x, event->y, event->x, event->y,
NULL); NULL);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@ -291,7 +291,7 @@ meta_virtual_input_device_native_notify_absolute_motion (ClutterVirtualInputDevi
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_absolute_motion); (GSourceFunc) notify_absolute_motion_in_impl);
g_object_unref (task); g_object_unref (task);
} }
@ -316,7 +316,7 @@ translate_to_evdev_button (int clutter_button)
} }
static gboolean static gboolean
notify_button (GTask *task) notify_button_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -337,14 +337,14 @@ notify_button (GTask *task)
goto out; goto out;
} }
button_count = update_button_count (virtual_evdev, evdev_button, button_count = update_button_count_in_impl (virtual_evdev, evdev_button,
event->button_state); event->button_state);
if (button_count < 0 || button_count > 1) if (button_count < 0 || button_count > 1)
{ {
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", evdev_button, g_warning ("Received multiple virtual 0x%x button %s (ignoring)", evdev_button,
event->button_state == CLUTTER_BUTTON_STATE_PRESSED ? event->button_state == CLUTTER_BUTTON_STATE_PRESSED ?
"presses" : "releases"); "presses" : "releases");
update_button_count (virtual_evdev, evdev_button, 1 - event->button_state); update_button_count_in_impl (virtual_evdev, evdev_button, 1 - event->button_state);
goto out; goto out;
} }
@ -354,11 +354,11 @@ notify_button (GTask *task)
"press" : "release", "press" : "release",
evdev_button, virtual_evdev); evdev_button, virtual_evdev);
meta_seat_impl_notify_button (seat, meta_seat_impl_notify_button_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
evdev_button, evdev_button,
event->button_state); event->button_state);
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -385,12 +385,12 @@ meta_virtual_input_device_native_notify_button (ClutterVirtualInputDevice *virtu
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_button); (GSourceFunc) notify_button_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_key (GTask *task) notify_key_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -407,13 +407,13 @@ notify_key (GTask *task)
goto out; goto out;
} }
key_count = update_button_count (virtual_evdev, event->key, event->key_state); key_count = update_button_count_in_impl (virtual_evdev, event->key, event->key_state);
if (key_count < 0 || key_count > 1) if (key_count < 0 || key_count > 1)
{ {
g_warning ("Received multiple virtual 0x%x key %s (ignoring)", event->key, g_warning ("Received multiple virtual 0x%x key %s (ignoring)", event->key,
event->key_state == CLUTTER_KEY_STATE_PRESSED ? event->key_state == CLUTTER_KEY_STATE_PRESSED ?
"presses" : "releases"); "presses" : "releases");
update_button_count (virtual_evdev, event->key, 1 - event->key_state); update_button_count_in_impl (virtual_evdev, event->key, 1 - event->key_state);
goto out; goto out;
} }
@ -422,12 +422,12 @@ notify_key (GTask *task)
event->key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release", event->key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release",
event->key, virtual_evdev); event->key, virtual_evdev);
meta_seat_impl_notify_key (seat, meta_seat_impl_notify_key_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
event->key, event->key,
event->key_state, event->key_state,
TRUE); TRUE);
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
@ -455,15 +455,15 @@ meta_virtual_input_device_native_notify_key (ClutterVirtualInputDevice *virtual_
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_key); (GSourceFunc) notify_key_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_device, pick_keycode_for_keyval_in_current_group_in_impl (ClutterVirtualInputDevice *virtual_device,
guint keyval, guint keyval,
guint *keycode_out, guint *keycode_out,
guint *level_out) guint *level_out)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device); META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
@ -476,8 +476,8 @@ pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_dev
backend = clutter_get_default_backend (); backend = clutter_get_default_backend ();
keymap = clutter_seat_get_keymap (clutter_backend_get_default_seat (backend)); keymap = clutter_seat_get_keymap (clutter_backend_get_default_seat (backend));
xkb_keymap = meta_keymap_native_get_keyboard_map (META_KEYMAP_NATIVE (keymap)); xkb_keymap = meta_keymap_native_get_keyboard_map_in_impl (META_KEYMAP_NATIVE (keymap));
state = meta_seat_impl_get_xkb_state (virtual_evdev->seat->impl); state = meta_seat_impl_get_xkb_state_in_impl (virtual_evdev->seat->impl);
layout = xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE); layout = xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE);
min_keycode = xkb_keymap_min_keycode (xkb_keymap); min_keycode = xkb_keymap_min_keycode (xkb_keymap);
@ -508,10 +508,10 @@ pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_dev
} }
static void static void
apply_level_modifiers (ClutterVirtualInputDevice *virtual_device, apply_level_modifiers_in_impl (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us, uint64_t time_us,
uint32_t level, uint32_t level,
uint32_t key_state) uint32_t key_state)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device); META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
@ -534,8 +534,8 @@ apply_level_modifiers (ClutterVirtualInputDevice *virtual_device,
return; return;
} }
if (!pick_keycode_for_keyval_in_current_group (virtual_device, keysym, if (!pick_keycode_for_keyval_in_current_group_in_impl (virtual_device, keysym,
&keycode, NULL)) &keycode, NULL))
return; return;
evcode = meta_xkb_keycode_to_evdev (keycode); evcode = meta_xkb_keycode_to_evdev (keycode);
@ -545,16 +545,16 @@ apply_level_modifiers (ClutterVirtualInputDevice *virtual_device,
key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release", key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release",
evcode, virtual_device); evcode, virtual_device);
meta_seat_impl_notify_key (virtual_evdev->seat->impl, meta_seat_impl_notify_key_in_impl (virtual_evdev->seat->impl,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
time_us, time_us,
evcode, evcode,
key_state, key_state,
TRUE); TRUE);
} }
static gboolean static gboolean
notify_keyval (GTask *task) notify_keyval_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -568,8 +568,9 @@ notify_keyval (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
if (!pick_keycode_for_keyval_in_current_group (virtual_device, if (!pick_keycode_for_keyval_in_current_group_in_impl (virtual_device,
event->key, &keycode, &level)) event->key,
&keycode, &level))
{ {
g_warning ("No keycode found for keyval %x in current group", event->key); g_warning ("No keycode found for keyval %x in current group", event->key);
goto out; goto out;
@ -583,13 +584,13 @@ notify_keyval (GTask *task)
goto out; goto out;
} }
key_count = update_button_count (virtual_evdev, evcode, event->key_state); key_count = update_button_count_in_impl (virtual_evdev, evcode, event->key_state);
if (key_count < 0 || key_count > 1) if (key_count < 0 || key_count > 1)
{ {
g_warning ("Received multiple virtual 0x%x key %s (ignoring)", evcode, g_warning ("Received multiple virtual 0x%x key %s (ignoring)", evcode,
event->key_state == CLUTTER_KEY_STATE_PRESSED ? event->key_state == CLUTTER_KEY_STATE_PRESSED ?
"presses" : "releases"); "presses" : "releases");
update_button_count (virtual_evdev, evcode, 1 - event->key_state); update_button_count_in_impl (virtual_evdev, evcode, 1 - event->key_state);
goto out; goto out;
} }
@ -600,17 +601,23 @@ notify_keyval (GTask *task)
evcode, level, key_count, virtual_evdev); evcode, level, key_count, virtual_evdev);
if (event->key_state) if (event->key_state)
apply_level_modifiers (virtual_device, event->time_us, level, event->key_state); {
apply_level_modifiers_in_impl (virtual_device, event->time_us,
level, event->key_state);
}
meta_seat_impl_notify_key (seat, meta_seat_impl_notify_key_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
evcode, evcode,
event->key_state, event->key_state,
TRUE); TRUE);
if (!event->key_state) if (!event->key_state)
apply_level_modifiers (virtual_device, event->time_us, level, event->key_state); {
apply_level_modifiers_in_impl (virtual_device, event->time_us,
level, event->key_state);
}
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
@ -638,7 +645,7 @@ meta_virtual_input_device_native_notify_keyval (ClutterVirtualInputDevice *virtu
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_keyval); (GSourceFunc) notify_keyval_in_impl);
g_object_unref (task); g_object_unref (task);
} }
@ -672,7 +679,7 @@ direction_to_discrete (ClutterScrollDirection direction,
} }
static gboolean static gboolean
notify_discrete_scroll (GTask *task) notify_discrete_scroll_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -685,11 +692,11 @@ notify_discrete_scroll (GTask *task)
direction_to_discrete (event->direction, &discrete_dx, &discrete_dy); direction_to_discrete (event->direction, &discrete_dx, &discrete_dy);
meta_seat_impl_notify_discrete_scroll (seat, meta_seat_impl_notify_discrete_scroll_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
discrete_dx, discrete_dy, discrete_dx, discrete_dy,
event->scroll_source); event->scroll_source);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -716,12 +723,12 @@ meta_virtual_input_device_native_notify_discrete_scroll (ClutterVirtualInputDevi
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_discrete_scroll); (GSourceFunc) notify_discrete_scroll_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_scroll_continuous (GTask *task) notify_scroll_continuous_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -731,12 +738,12 @@ notify_scroll_continuous (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
meta_seat_impl_notify_scroll_continuous (seat, meta_seat_impl_notify_scroll_continuous_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
event->time_us, event->time_us,
event->dx, event->dy, event->dx, event->dy,
event->scroll_source, event->scroll_source,
CLUTTER_SCROLL_FINISHED_NONE); CLUTTER_SCROLL_FINISHED_NONE);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@ -766,12 +773,12 @@ meta_virtual_input_device_native_notify_scroll_continuous (ClutterVirtualInputDe
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_scroll_continuous); (GSourceFunc) notify_scroll_continuous_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_touch_down (GTask *task) notify_touch_down_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -782,21 +789,21 @@ notify_touch_down (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
touch_state = meta_seat_impl_acquire_touch_state (seat, touch_state = meta_seat_impl_acquire_touch_state_in_impl (seat,
event->device_slot); event->device_slot);
if (!touch_state) if (!touch_state)
goto out; goto out;
touch_state->coords.x = event->x; touch_state->coords.x = event->x;
touch_state->coords.y = event->y; touch_state->coords.y = event->y;
meta_seat_impl_notify_touch_event (seat, meta_seat_impl_notify_touch_event_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
CLUTTER_TOUCH_BEGIN, CLUTTER_TOUCH_BEGIN,
event->time_us, event->time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
@ -826,12 +833,12 @@ meta_virtual_input_device_native_notify_touch_down (ClutterVirtualInputDevice *v
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_touch_down); (GSourceFunc) notify_touch_down_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_touch_motion (GTask *task) notify_touch_motion_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -842,21 +849,21 @@ notify_touch_motion (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
touch_state = meta_seat_impl_lookup_touch_state (seat, touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat,
event->device_slot); event->device_slot);
if (!touch_state) if (!touch_state)
goto out; goto out;
touch_state->coords.x = event->x; touch_state->coords.x = event->x;
touch_state->coords.y = event->y; touch_state->coords.y = event->y;
meta_seat_impl_notify_touch_event (seat, meta_seat_impl_notify_touch_event_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
CLUTTER_TOUCH_UPDATE, CLUTTER_TOUCH_UPDATE,
event->time_us, event->time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
@ -886,12 +893,12 @@ meta_virtual_input_device_native_notify_touch_motion (ClutterVirtualInputDevice
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_touch_motion); (GSourceFunc) notify_touch_motion_in_impl);
g_object_unref (task); g_object_unref (task);
} }
static gboolean static gboolean
notify_touch_up (GTask *task) notify_touch_up_in_impl (GTask *task)
{ {
MetaVirtualInputDeviceNative *virtual_evdev = MetaVirtualInputDeviceNative *virtual_evdev =
g_task_get_source_object (task); g_task_get_source_object (task);
@ -902,21 +909,21 @@ notify_touch_up (GTask *task)
if (event->time_us == CLUTTER_CURRENT_TIME) if (event->time_us == CLUTTER_CURRENT_TIME)
event->time_us = g_get_monotonic_time (); event->time_us = g_get_monotonic_time ();
touch_state = meta_seat_impl_lookup_touch_state (seat, touch_state = meta_seat_impl_lookup_touch_state_in_impl (seat,
event->device_slot); event->device_slot);
if (!touch_state) if (!touch_state)
goto out; goto out;
meta_seat_impl_notify_touch_event (seat, meta_seat_impl_notify_touch_event_in_impl (seat,
virtual_evdev->impl_state->device, virtual_evdev->impl_state->device,
CLUTTER_TOUCH_END, CLUTTER_TOUCH_END,
event->time_us, event->time_us,
touch_state->seat_slot, touch_state->seat_slot,
touch_state->coords.x, touch_state->coords.x,
touch_state->coords.y); touch_state->coords.y);
meta_seat_impl_release_touch_state (virtual_evdev->seat->impl, meta_seat_impl_release_touch_state_in_impl (virtual_evdev->seat->impl,
touch_state->seat_slot); touch_state->seat_slot);
out: out:
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
@ -942,7 +949,7 @@ meta_virtual_input_device_native_notify_touch_up (ClutterVirtualInputDevice *vir
task = g_task_new (virtual_device, NULL, NULL, NULL); task = g_task_new (virtual_device, NULL, NULL, NULL);
g_task_set_task_data (task, event, g_free); g_task_set_task_data (task, event, g_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) notify_touch_up); (GSourceFunc) notify_touch_up_in_impl);
g_object_unref (task); g_object_unref (task);
} }
@ -1039,7 +1046,7 @@ meta_virtual_input_device_native_dispose (GObject *object)
g_task_set_task_data (task, virtual_evdev->impl_state, g_task_set_task_data (task, virtual_evdev->impl_state,
(GDestroyNotify) impl_state_free); (GDestroyNotify) impl_state_free);
meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task, meta_seat_impl_run_input_task (virtual_evdev->seat->impl, task,
(GSourceFunc) release_device); (GSourceFunc) release_device_in_impl);
g_object_unref (task); g_object_unref (task);
virtual_evdev->impl_state = NULL; virtual_evdev->impl_state = NULL;