mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
backends/native: Spin MetaSeatImpl off MetaSeatNative
Move most of the functional bits (those meant to run on a standalone thread) to a MetaSeatImpl object. This object is managed by the MetaSeatImpl and not exposed outside the friend MetaSeatNative/MetaInputDeviceNative/ MetaInputSettings classes. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
This commit is contained in:
parent
a2616d83e8
commit
06adde5c6b
@ -22,5 +22,6 @@
|
|||||||
#define META_BACKEND_NATIVE_TYPES_H
|
#define META_BACKEND_NATIVE_TYPES_H
|
||||||
|
|
||||||
typedef struct _MetaBackendNative MetaBackendNative;
|
typedef struct _MetaBackendNative MetaBackendNative;
|
||||||
|
typedef struct _MetaSeatNative MetaSeatNative;
|
||||||
|
|
||||||
#endif /* META_BACKEND_NATIVE_TYPES_H */
|
#endif /* META_BACKEND_NATIVE_TYPES_H */
|
||||||
|
@ -70,7 +70,7 @@ meta_input_device_native_finalize (GObject *object)
|
|||||||
|
|
||||||
backend = clutter_get_default_backend ();
|
backend = clutter_get_default_backend ();
|
||||||
seat = clutter_backend_get_default_seat (backend);
|
seat = clutter_backend_get_default_seat (backend);
|
||||||
meta_seat_native_release_device_id (META_SEAT_NATIVE (seat), device);
|
meta_seat_impl_release_device_id (META_SEAT_NATIVE (seat)->impl, device);
|
||||||
|
|
||||||
clear_slow_keys (device_evdev);
|
clear_slow_keys (device_evdev);
|
||||||
stop_bounce_keys (device_evdev);
|
stop_bounce_keys (device_evdev);
|
||||||
@ -222,7 +222,7 @@ meta_input_device_native_is_grouped (ClutterInputDevice *device,
|
|||||||
static void
|
static void
|
||||||
meta_input_device_native_bell_notify (MetaInputDeviceNative *device)
|
meta_input_device_native_bell_notify (MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
clutter_seat_bell_notify (CLUTTER_SEAT (device->seat));
|
clutter_seat_bell_notify (CLUTTER_SEAT (device->seat_impl->seat));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -423,7 +423,7 @@ key_event_is_modifier (ClutterEvent *event)
|
|||||||
static void
|
static void
|
||||||
notify_stickykeys_mask (MetaInputDeviceNative *device)
|
notify_stickykeys_mask (MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
g_signal_emit_by_name (device->seat,
|
g_signal_emit_by_name (device->seat_impl->seat,
|
||||||
"kbd-a11y-mods-state-changed",
|
"kbd-a11y-mods-state-changed",
|
||||||
device->stickykeys_latched_mask,
|
device->stickykeys_latched_mask,
|
||||||
device->stickykeys_locked_mask);
|
device->stickykeys_locked_mask);
|
||||||
@ -434,15 +434,17 @@ update_internal_xkb_state (MetaInputDeviceNative *device,
|
|||||||
xkb_mod_mask_t new_latched_mask,
|
xkb_mod_mask_t new_latched_mask,
|
||||||
xkb_mod_mask_t new_locked_mask)
|
xkb_mod_mask_t new_locked_mask)
|
||||||
{
|
{
|
||||||
MetaSeatNative *seat = device->seat;
|
MetaSeatImpl *seat_impl = device->seat_impl;
|
||||||
xkb_mod_mask_t depressed_mods;
|
xkb_mod_mask_t depressed_mods;
|
||||||
xkb_mod_mask_t latched_mods;
|
xkb_mod_mask_t latched_mods;
|
||||||
xkb_mod_mask_t locked_mods;
|
xkb_mod_mask_t locked_mods;
|
||||||
xkb_mod_mask_t group_mods;
|
xkb_mod_mask_t group_mods;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
depressed_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
|
xkb_state = meta_seat_impl_get_xkb_state (seat_impl);
|
||||||
latched_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_LATCHED);
|
depressed_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED);
|
||||||
locked_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_LOCKED);
|
latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED);
|
||||||
|
locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED);
|
||||||
|
|
||||||
latched_mods &= ~device->stickykeys_latched_mask;
|
latched_mods &= ~device->stickykeys_latched_mask;
|
||||||
locked_mods &= ~device->stickykeys_locked_mask;
|
locked_mods &= ~device->stickykeys_locked_mask;
|
||||||
@ -453,9 +455,9 @@ update_internal_xkb_state (MetaInputDeviceNative *device,
|
|||||||
latched_mods |= device->stickykeys_latched_mask;
|
latched_mods |= device->stickykeys_latched_mask;
|
||||||
locked_mods |= device->stickykeys_locked_mask;
|
locked_mods |= device->stickykeys_locked_mask;
|
||||||
|
|
||||||
group_mods = xkb_state_serialize_layout (seat->xkb, XKB_STATE_LAYOUT_EFFECTIVE);
|
group_mods = xkb_state_serialize_layout (xkb_state, XKB_STATE_LAYOUT_EFFECTIVE);
|
||||||
|
|
||||||
xkb_state_update_mask (seat->xkb,
|
xkb_state_update_mask (xkb_state,
|
||||||
depressed_mods,
|
depressed_mods,
|
||||||
latched_mods,
|
latched_mods,
|
||||||
locked_mods,
|
locked_mods,
|
||||||
@ -469,23 +471,25 @@ update_stickykeys_event (ClutterEvent *event,
|
|||||||
xkb_mod_mask_t new_latched_mask,
|
xkb_mod_mask_t new_latched_mask,
|
||||||
xkb_mod_mask_t new_locked_mask)
|
xkb_mod_mask_t new_locked_mask)
|
||||||
{
|
{
|
||||||
MetaSeatNative *seat = device->seat;
|
MetaSeatImpl *seat_impl = device->seat_impl;
|
||||||
xkb_mod_mask_t effective_mods;
|
xkb_mod_mask_t effective_mods;
|
||||||
xkb_mod_mask_t latched_mods;
|
xkb_mod_mask_t latched_mods;
|
||||||
xkb_mod_mask_t locked_mods;
|
xkb_mod_mask_t locked_mods;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
update_internal_xkb_state (device, new_latched_mask, new_locked_mask);
|
update_internal_xkb_state (device, new_latched_mask, new_locked_mask);
|
||||||
|
|
||||||
effective_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_EFFECTIVE);
|
xkb_state = meta_seat_impl_get_xkb_state (seat_impl);
|
||||||
latched_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_LATCHED);
|
effective_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
|
||||||
locked_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_LOCKED);
|
latched_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LATCHED);
|
||||||
|
locked_mods = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_LOCKED);
|
||||||
|
|
||||||
_clutter_event_set_state_full (event,
|
_clutter_event_set_state_full (event,
|
||||||
seat->button_state,
|
seat_impl->button_state,
|
||||||
device->stickykeys_depressed_mask,
|
device->stickykeys_depressed_mask,
|
||||||
latched_mods,
|
latched_mods,
|
||||||
locked_mods,
|
locked_mods,
|
||||||
effective_mods | seat->button_state);
|
effective_mods | seat_impl->button_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -549,10 +553,11 @@ static void
|
|||||||
handle_stickykeys_press (ClutterEvent *event,
|
handle_stickykeys_press (ClutterEvent *event,
|
||||||
MetaInputDeviceNative *device)
|
MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
MetaSeatNative *seat = device->seat;
|
MetaSeatImpl *seat_impl = device->seat_impl;
|
||||||
xkb_mod_mask_t depressed_mods;
|
xkb_mod_mask_t depressed_mods;
|
||||||
xkb_mod_mask_t new_latched_mask;
|
xkb_mod_mask_t new_latched_mask;
|
||||||
xkb_mod_mask_t new_locked_mask;
|
xkb_mod_mask_t new_locked_mask;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
if (!key_event_is_modifier (event))
|
if (!key_event_is_modifier (event))
|
||||||
return;
|
return;
|
||||||
@ -564,7 +569,8 @@ handle_stickykeys_press (ClutterEvent *event,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
depressed_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
|
xkb_state = meta_seat_impl_get_xkb_state (seat_impl);
|
||||||
|
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
|
||||||
* to some other modifier which can be sticky.
|
* to some other modifier which can be sticky.
|
||||||
@ -597,10 +603,12 @@ static void
|
|||||||
handle_stickykeys_release (ClutterEvent *event,
|
handle_stickykeys_release (ClutterEvent *event,
|
||||||
MetaInputDeviceNative *device)
|
MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
MetaSeatNative *seat = device->seat;
|
MetaSeatImpl *seat_impl = device->seat_impl;
|
||||||
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
|
xkb_state = meta_seat_impl_get_xkb_state (seat_impl);
|
||||||
device->stickykeys_depressed_mask =
|
device->stickykeys_depressed_mask =
|
||||||
xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
|
xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_DEPRESSED);
|
||||||
|
|
||||||
if (key_event_is_modifier (event))
|
if (key_event_is_modifier (event))
|
||||||
{
|
{
|
||||||
@ -838,8 +846,12 @@ emulate_pointer_motion (MetaInputDeviceNative *device_evdev,
|
|||||||
static gboolean
|
static gboolean
|
||||||
is_numlock_active (MetaInputDeviceNative *device)
|
is_numlock_active (MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
MetaSeatNative *seat = device->seat;
|
MetaSeatImpl *seat_impl = device->seat_impl;
|
||||||
return xkb_state_mod_name_is_active (seat->xkb,
|
struct xkb_state *xkb_state;
|
||||||
|
|
||||||
|
xkb_state = meta_seat_impl_get_xkb_state (seat_impl);
|
||||||
|
|
||||||
|
return xkb_state_mod_name_is_active (xkb_state,
|
||||||
"Mod2",
|
"Mod2",
|
||||||
XKB_STATE_MODS_LOCKED);
|
XKB_STATE_MODS_LOCKED);
|
||||||
}
|
}
|
||||||
@ -859,7 +871,7 @@ enable_mousekeys (MetaInputDeviceNative *device_evdev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
device->accessibility_virtual_device =
|
device->accessibility_virtual_device =
|
||||||
clutter_seat_create_virtual_device (CLUTTER_SEAT (device_evdev->seat),
|
clutter_seat_create_virtual_device (clutter_input_device_get_seat (device),
|
||||||
CLUTTER_POINTER_DEVICE);
|
CLUTTER_POINTER_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1276,7 +1288,7 @@ meta_input_device_native_init (MetaInputDeviceNative *self)
|
|||||||
* it with the provided seat.
|
* it with the provided seat.
|
||||||
*/
|
*/
|
||||||
ClutterInputDevice *
|
ClutterInputDevice *
|
||||||
meta_input_device_native_new (MetaSeatNative *seat,
|
meta_input_device_native_new (MetaSeatImpl *seat_impl,
|
||||||
struct libinput_device *libinput_device)
|
struct libinput_device *libinput_device)
|
||||||
{
|
{
|
||||||
MetaInputDeviceNative *device;
|
MetaInputDeviceNative *device;
|
||||||
@ -1289,7 +1301,7 @@ meta_input_device_native_new (MetaSeatNative *seat,
|
|||||||
type = meta_input_device_native_determine_type (libinput_device);
|
type = meta_input_device_native_determine_type (libinput_device);
|
||||||
vendor = g_strdup_printf ("%.4x", libinput_device_get_id_vendor (libinput_device));
|
vendor = g_strdup_printf ("%.4x", libinput_device_get_id_vendor (libinput_device));
|
||||||
product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device));
|
product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device));
|
||||||
device_id = meta_seat_native_acquire_device_id (seat);
|
device_id = meta_seat_impl_acquire_device_id (seat_impl);
|
||||||
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));
|
||||||
|
|
||||||
if (libinput_device_has_capability (libinput_device,
|
if (libinput_device_has_capability (libinput_device,
|
||||||
@ -1311,10 +1323,10 @@ meta_input_device_native_new (MetaSeatNative *seat,
|
|||||||
"n-strips", n_strips,
|
"n-strips", n_strips,
|
||||||
"n-mode-groups", n_groups,
|
"n-mode-groups", n_groups,
|
||||||
"device-node", node_path,
|
"device-node", node_path,
|
||||||
"seat", seat,
|
"seat", seat_impl->seat,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
device->seat = seat;
|
device->seat_impl = seat_impl;
|
||||||
device->libinput_device = libinput_device;
|
device->libinput_device = libinput_device;
|
||||||
|
|
||||||
libinput_device_set_user_data (libinput_device, device);
|
libinput_device_set_user_data (libinput_device, device);
|
||||||
@ -1337,7 +1349,7 @@ meta_input_device_native_new (MetaSeatNative *seat,
|
|||||||
* Create a new virtual ClutterInputDevice of the given type.
|
* Create a new virtual ClutterInputDevice of the given type.
|
||||||
*/
|
*/
|
||||||
ClutterInputDevice *
|
ClutterInputDevice *
|
||||||
meta_input_device_native_new_virtual (MetaSeatNative *seat,
|
meta_input_device_native_new_virtual (MetaSeatImpl *seat_impl,
|
||||||
ClutterInputDeviceType type,
|
ClutterInputDeviceType type,
|
||||||
ClutterInputMode mode)
|
ClutterInputMode mode)
|
||||||
{
|
{
|
||||||
@ -1361,24 +1373,24 @@ meta_input_device_native_new_virtual (MetaSeatNative *seat,
|
|||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
device_id = meta_seat_native_acquire_device_id (seat);
|
device_id = meta_seat_impl_acquire_device_id (seat_impl);
|
||||||
device = g_object_new (META_TYPE_INPUT_DEVICE_NATIVE,
|
device = g_object_new (META_TYPE_INPUT_DEVICE_NATIVE,
|
||||||
"id", device_id,
|
"id", device_id,
|
||||||
"name", name,
|
"name", name,
|
||||||
"device-type", type,
|
"device-type", type,
|
||||||
"device-mode", mode,
|
"device-mode", mode,
|
||||||
"seat", seat,
|
"seat", seat_impl->seat,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
device->seat = seat;
|
device->seat_impl = seat_impl;
|
||||||
|
|
||||||
return CLUTTER_INPUT_DEVICE (device);
|
return CLUTTER_INPUT_DEVICE (device);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaSeatNative *
|
MetaSeatImpl *
|
||||||
meta_input_device_native_get_seat (MetaInputDeviceNative *device)
|
meta_input_device_native_get_seat_impl (MetaInputDeviceNative *device)
|
||||||
{
|
{
|
||||||
return device->seat;
|
return device->seat_impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -69,7 +69,7 @@ struct _MetaInputDeviceNative
|
|||||||
ClutterInputDevice parent;
|
ClutterInputDevice parent;
|
||||||
|
|
||||||
struct libinput_device *libinput_device;
|
struct libinput_device *libinput_device;
|
||||||
MetaSeatNative *seat;
|
MetaSeatImpl *seat_impl;
|
||||||
ClutterInputDeviceTool *last_tool;
|
ClutterInputDeviceTool *last_tool;
|
||||||
|
|
||||||
cairo_matrix_t device_matrix;
|
cairo_matrix_t device_matrix;
|
||||||
@ -111,14 +111,14 @@ 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 (MetaSeatNative *seat,
|
ClutterInputDevice * meta_input_device_native_new (MetaSeatImpl *seat_impl,
|
||||||
struct libinput_device *libinput_device);
|
struct libinput_device *libinput_device);
|
||||||
|
|
||||||
ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatNative *seat,
|
ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatImpl *seat_impl,
|
||||||
ClutterInputDeviceType type,
|
ClutterInputDeviceType type,
|
||||||
ClutterInputMode mode);
|
ClutterInputMode mode);
|
||||||
|
|
||||||
MetaSeatNative * meta_input_device_native_get_seat (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 (MetaInputDeviceNative *device,
|
||||||
enum libinput_led leds);
|
enum libinput_led leds);
|
||||||
|
@ -389,8 +389,8 @@ meta_input_settings_native_set_keyboard_repeat (MetaInputSettings *settings,
|
|||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
|
|
||||||
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
|
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
|
||||||
meta_seat_native_set_keyboard_repeat (META_SEAT_NATIVE (seat),
|
meta_seat_impl_set_keyboard_repeat (META_SEAT_NATIVE (seat)->impl,
|
||||||
enabled, delay, interval);
|
enabled, delay, interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -58,7 +58,7 @@ meta_keymap_native_get_num_lock_state (ClutterKeymap *keymap)
|
|||||||
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_native_get_xkb_state (META_SEAT_NATIVE (seat));
|
xkb_state = meta_seat_impl_get_xkb_state (META_SEAT_NATIVE (seat)->impl);
|
||||||
|
|
||||||
return xkb_state_mod_name_is_active (xkb_state,
|
return xkb_state_mod_name_is_active (xkb_state,
|
||||||
XKB_MOD_NAME_NUM,
|
XKB_MOD_NAME_NUM,
|
||||||
@ -73,7 +73,7 @@ meta_keymap_native_get_caps_lock_state (ClutterKeymap *keymap)
|
|||||||
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_native_get_xkb_state (META_SEAT_NATIVE (seat));
|
xkb_state = meta_seat_impl_get_xkb_state (META_SEAT_NATIVE (seat)->impl);
|
||||||
|
|
||||||
return xkb_state_mod_name_is_active (xkb_state,
|
return xkb_state_mod_name_is_active (xkb_state,
|
||||||
XKB_MOD_NAME_CAPS,
|
XKB_MOD_NAME_CAPS,
|
||||||
|
@ -528,9 +528,9 @@ 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_native_set_device_callbacks (on_evdev_device_open,
|
meta_seat_impl_set_device_callbacks (on_evdev_device_open,
|
||||||
on_evdev_device_close,
|
on_evdev_device_close,
|
||||||
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);
|
||||||
|
|
||||||
|
3068
src/backends/native/meta-seat-impl.c
Normal file
3068
src/backends/native/meta-seat-impl.c
Normal file
File diff suppressed because it is too large
Load Diff
257
src/backends/native/meta-seat-impl.h
Normal file
257
src/backends/native/meta-seat-impl.h
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Intel Corp.
|
||||||
|
* Copyright (C) 2014 Jonas Ådahl
|
||||||
|
* Copyright (C) 2016 Red Hat Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* Author: Damien Lespiau <damien.lespiau@intel.com>
|
||||||
|
* Author: Jonas Ådahl <jadahl@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef META_SEAT_IMPL_H
|
||||||
|
#define META_SEAT_IMPL_H
|
||||||
|
|
||||||
|
#include <gudev/gudev.h>
|
||||||
|
#include <libinput.h>
|
||||||
|
#include <linux/input-event-codes.h>
|
||||||
|
|
||||||
|
#include "backends/meta-viewport-info.h"
|
||||||
|
#include "backends/native/meta-backend-native-types.h"
|
||||||
|
#include "backends/native/meta-barrier-native.h"
|
||||||
|
#include "backends/native/meta-cursor-renderer-native.h"
|
||||||
|
#include "backends/native/meta-keymap-native.h"
|
||||||
|
#include "backends/native/meta-pointer-constraint-native.h"
|
||||||
|
#include "backends/native/meta-xkb-utils.h"
|
||||||
|
#include "clutter/clutter.h"
|
||||||
|
|
||||||
|
typedef struct _MetaTouchState MetaTouchState;
|
||||||
|
typedef struct _MetaSeatImpl MetaSeatImpl;
|
||||||
|
typedef struct _MetaEventSource MetaEventSource;
|
||||||
|
|
||||||
|
struct _MetaTouchState
|
||||||
|
{
|
||||||
|
MetaSeatImpl *seat;
|
||||||
|
|
||||||
|
int device_slot;
|
||||||
|
int seat_slot;
|
||||||
|
graphene_point_t coords;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MetaSeatImpl
|
||||||
|
{
|
||||||
|
GObject parent_instance;
|
||||||
|
|
||||||
|
MetaSeatNative *seat;
|
||||||
|
char *seat_id;
|
||||||
|
MetaEventSource *event_source;
|
||||||
|
struct libinput *libinput;
|
||||||
|
struct libinput_seat *libinput_seat;
|
||||||
|
|
||||||
|
GSList *devices;
|
||||||
|
|
||||||
|
ClutterInputDevice *core_pointer;
|
||||||
|
ClutterInputDevice *core_keyboard;
|
||||||
|
|
||||||
|
GHashTable *touch_states;
|
||||||
|
GHashTable *cursor_renderers;
|
||||||
|
|
||||||
|
struct xkb_state *xkb;
|
||||||
|
xkb_led_index_t caps_lock_led;
|
||||||
|
xkb_led_index_t num_lock_led;
|
||||||
|
xkb_led_index_t scroll_lock_led;
|
||||||
|
xkb_layout_index_t layout_idx;
|
||||||
|
uint32_t button_state;
|
||||||
|
int button_count[KEY_CNT];
|
||||||
|
|
||||||
|
int device_id_next;
|
||||||
|
GList *free_device_ids;
|
||||||
|
|
||||||
|
MetaBarrierManagerNative *barrier_manager;
|
||||||
|
MetaPointerConstraintImpl *pointer_constraint;
|
||||||
|
|
||||||
|
MetaKeymapNative *keymap;
|
||||||
|
|
||||||
|
MetaViewportInfo *viewports;
|
||||||
|
|
||||||
|
GUdevClient *udev_client;
|
||||||
|
guint tablet_mode_switch_state : 1;
|
||||||
|
guint has_touchscreen : 1;
|
||||||
|
guint has_tablet_switch : 1;
|
||||||
|
guint touch_mode : 1;
|
||||||
|
|
||||||
|
/* keyboard repeat */
|
||||||
|
gboolean repeat;
|
||||||
|
uint32_t repeat_delay;
|
||||||
|
uint32_t repeat_interval;
|
||||||
|
uint32_t repeat_key;
|
||||||
|
uint32_t repeat_count;
|
||||||
|
uint32_t repeat_timer;
|
||||||
|
ClutterInputDevice *repeat_device;
|
||||||
|
|
||||||
|
float pointer_x;
|
||||||
|
float pointer_y;
|
||||||
|
|
||||||
|
/* Emulation of discrete scroll events out of smooth ones */
|
||||||
|
float accum_scroll_dx;
|
||||||
|
float accum_scroll_dy;
|
||||||
|
|
||||||
|
gboolean released;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define META_TYPE_SEAT_IMPL meta_seat_impl_get_type ()
|
||||||
|
G_DECLARE_FINAL_TYPE (MetaSeatImpl, meta_seat_impl,
|
||||||
|
META, SEAT_IMPL, GObject)
|
||||||
|
|
||||||
|
MetaSeatImpl * meta_seat_impl_new (MetaSeatNative *seat,
|
||||||
|
const gchar *seat_id);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_key (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *device,
|
||||||
|
uint64_t time_us,
|
||||||
|
uint32_t key,
|
||||||
|
uint32_t state,
|
||||||
|
gboolean update_keys);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_relative_motion (MetaSeatImpl *seat_evdev,
|
||||||
|
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_evdev,
|
||||||
|
ClutterInputDevice *input_device,
|
||||||
|
uint64_t time_us,
|
||||||
|
float x,
|
||||||
|
float y,
|
||||||
|
double *axes);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_button (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *input_device,
|
||||||
|
uint64_t time_us,
|
||||||
|
uint32_t button,
|
||||||
|
uint32_t state);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_scroll_continuous (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *input_device,
|
||||||
|
uint64_t time_us,
|
||||||
|
double dx,
|
||||||
|
double dy,
|
||||||
|
ClutterScrollSource source,
|
||||||
|
ClutterScrollFinishFlags flags);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_discrete_scroll (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *input_device,
|
||||||
|
uint64_t time_us,
|
||||||
|
double discrete_dx,
|
||||||
|
double discrete_dy,
|
||||||
|
ClutterScrollSource source);
|
||||||
|
|
||||||
|
void meta_seat_impl_notify_touch_event (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *input_device,
|
||||||
|
ClutterEventType evtype,
|
||||||
|
uint64_t time_us,
|
||||||
|
int slot,
|
||||||
|
double x,
|
||||||
|
double y);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_libinput_seat (MetaSeatImpl *seat,
|
||||||
|
struct libinput_seat *libinput_seat);
|
||||||
|
|
||||||
|
void meta_seat_impl_sync_leds (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
MetaTouchState * meta_seat_impl_acquire_touch_state (MetaSeatImpl *seat,
|
||||||
|
int seat_slot);
|
||||||
|
MetaTouchState * meta_seat_impl_lookup_touch_state (MetaSeatImpl *seat,
|
||||||
|
int seat_slot);
|
||||||
|
|
||||||
|
void meta_seat_impl_release_touch_state (MetaSeatImpl *seat,
|
||||||
|
int seat_slot);
|
||||||
|
|
||||||
|
gint meta_seat_impl_acquire_device_id (MetaSeatImpl *seat);
|
||||||
|
void meta_seat_impl_release_device_id (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *device);
|
||||||
|
|
||||||
|
void meta_seat_impl_update_xkb_state (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MetaOpenDeviceCallback:
|
||||||
|
* @path: the device path
|
||||||
|
* @flags: flags to be passed to open
|
||||||
|
*
|
||||||
|
* This callback will be called when Clutter needs to access an input
|
||||||
|
* device. It should return an open file descriptor for the file at @path,
|
||||||
|
* or -1 if opening failed.
|
||||||
|
*/
|
||||||
|
typedef int (* MetaOpenDeviceCallback) (const char *path,
|
||||||
|
int flags,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
|
typedef void (* MetaCloseDeviceCallback) (int fd,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_device_callbacks (MetaOpenDeviceCallback open_callback,
|
||||||
|
MetaCloseDeviceCallback close_callback,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
void meta_seat_impl_release_devices (MetaSeatImpl *seat);
|
||||||
|
void meta_seat_impl_reclaim_devices (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
struct xkb_state * meta_seat_impl_get_xkb_state (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_keyboard_map (MetaSeatImpl *seat,
|
||||||
|
struct xkb_keymap *keymap);
|
||||||
|
|
||||||
|
struct xkb_keymap * meta_seat_impl_get_keyboard_map (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_keyboard_layout_index (MetaSeatImpl *seat,
|
||||||
|
xkb_layout_index_t idx);
|
||||||
|
|
||||||
|
xkb_layout_index_t meta_seat_impl_get_keyboard_layout_index (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_keyboard_numlock (MetaSeatImpl *seat,
|
||||||
|
gboolean numlock_state);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_keyboard_repeat (MetaSeatImpl *seat,
|
||||||
|
gboolean repeat,
|
||||||
|
uint32_t delay,
|
||||||
|
uint32_t interval);
|
||||||
|
|
||||||
|
MetaBarrierManagerNative * meta_seat_impl_get_barrier_manager (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
void meta_seat_impl_set_pointer_constraint (MetaSeatImpl *seat,
|
||||||
|
MetaPointerConstraintImpl *impl);
|
||||||
|
void meta_seat_impl_set_viewports (MetaSeatImpl *seat,
|
||||||
|
MetaViewportInfo *viewports);
|
||||||
|
|
||||||
|
void meta_seat_impl_warp_pointer (MetaSeatImpl *seat,
|
||||||
|
int x,
|
||||||
|
int y);
|
||||||
|
ClutterVirtualInputDevice *
|
||||||
|
meta_seat_impl_create_virtual_device (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDeviceType device_type);
|
||||||
|
gboolean meta_seat_impl_query_state (MetaSeatImpl *seat,
|
||||||
|
ClutterInputDevice *device,
|
||||||
|
ClutterEventSequence *sequence,
|
||||||
|
graphene_point_t *coords,
|
||||||
|
ClutterModifierType *modifiers);
|
||||||
|
ClutterInputDevice * meta_seat_impl_get_pointer (MetaSeatImpl *seat);
|
||||||
|
ClutterInputDevice * meta_seat_impl_get_keyboard (MetaSeatImpl *seat);
|
||||||
|
GSList * meta_seat_impl_get_devices (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
MetaKeymapNative * meta_seat_impl_get_keymap (MetaSeatImpl *seat);
|
||||||
|
|
||||||
|
#endif /* META_SEAT_IMPL_H */
|
File diff suppressed because it is too large
Load Diff
@ -32,82 +32,29 @@
|
|||||||
#include "backends/native/meta-cursor-renderer-native.h"
|
#include "backends/native/meta-cursor-renderer-native.h"
|
||||||
#include "backends/native/meta-keymap-native.h"
|
#include "backends/native/meta-keymap-native.h"
|
||||||
#include "backends/native/meta-pointer-constraint-native.h"
|
#include "backends/native/meta-pointer-constraint-native.h"
|
||||||
|
#include "backends/native/meta-seat-impl.h"
|
||||||
#include "backends/native/meta-xkb-utils.h"
|
#include "backends/native/meta-xkb-utils.h"
|
||||||
#include "clutter/clutter.h"
|
#include "clutter/clutter.h"
|
||||||
|
|
||||||
typedef struct _MetaTouchState MetaTouchState;
|
|
||||||
typedef struct _MetaSeatNative MetaSeatNative;
|
typedef struct _MetaSeatNative MetaSeatNative;
|
||||||
typedef struct _MetaEventSource MetaEventSource;
|
|
||||||
|
|
||||||
struct _MetaTouchState
|
|
||||||
{
|
|
||||||
MetaSeatNative *seat;
|
|
||||||
|
|
||||||
int device_slot;
|
|
||||||
int seat_slot;
|
|
||||||
graphene_point_t coords;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _MetaSeatNative
|
struct _MetaSeatNative
|
||||||
{
|
{
|
||||||
ClutterSeat parent_instance;
|
ClutterSeat parent_instance;
|
||||||
|
|
||||||
|
MetaSeatImpl *impl;
|
||||||
char *seat_id;
|
char *seat_id;
|
||||||
MetaEventSource *event_source;
|
|
||||||
struct libinput *libinput;
|
|
||||||
struct libinput_seat *libinput_seat;
|
|
||||||
|
|
||||||
GSList *devices;
|
GList *devices;
|
||||||
|
|
||||||
ClutterInputDevice *core_pointer;
|
ClutterInputDevice *core_pointer;
|
||||||
ClutterInputDevice *core_keyboard;
|
ClutterInputDevice *core_keyboard;
|
||||||
|
|
||||||
GHashTable *touch_states;
|
|
||||||
GHashTable *cursor_renderers;
|
|
||||||
|
|
||||||
struct xkb_state *xkb;
|
|
||||||
xkb_led_index_t caps_lock_led;
|
|
||||||
xkb_led_index_t num_lock_led;
|
|
||||||
xkb_led_index_t scroll_lock_led;
|
|
||||||
xkb_layout_index_t layout_idx;
|
|
||||||
uint32_t button_state;
|
|
||||||
int button_count[KEY_CNT];
|
|
||||||
|
|
||||||
int device_id_next;
|
|
||||||
GList *free_device_ids;
|
|
||||||
|
|
||||||
MetaBarrierManagerNative *barrier_manager;
|
|
||||||
MetaPointerConstraintImpl *pointer_constraint;
|
|
||||||
|
|
||||||
MetaKeymapNative *keymap;
|
MetaKeymapNative *keymap;
|
||||||
MetaCursorRenderer *cursor_renderer;
|
MetaCursorRenderer *cursor_renderer;
|
||||||
MetaKmsCursorRenderer *kms_cursor_renderer;
|
MetaKmsCursorRenderer *kms_cursor_renderer;
|
||||||
GHashTable *tablet_cursors;
|
GHashTable *tablet_cursors;
|
||||||
|
|
||||||
MetaViewportInfo *viewports;
|
|
||||||
|
|
||||||
GUdevClient *udev_client;
|
|
||||||
guint tablet_mode_switch_state : 1;
|
|
||||||
guint has_touchscreen : 1;
|
|
||||||
guint has_tablet_switch : 1;
|
|
||||||
guint touch_mode : 1;
|
|
||||||
|
|
||||||
/* keyboard repeat */
|
|
||||||
gboolean repeat;
|
|
||||||
uint32_t repeat_delay;
|
|
||||||
uint32_t repeat_interval;
|
|
||||||
uint32_t repeat_key;
|
|
||||||
uint32_t repeat_count;
|
|
||||||
uint32_t repeat_timer;
|
|
||||||
ClutterInputDevice *repeat_device;
|
|
||||||
|
|
||||||
float pointer_x;
|
|
||||||
float pointer_y;
|
|
||||||
|
|
||||||
/* Emulation of discrete scroll events out of smooth ones */
|
|
||||||
float accum_scroll_dx;
|
|
||||||
float accum_scroll_dy;
|
|
||||||
|
|
||||||
gboolean released;
|
gboolean released;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -115,95 +62,11 @@ struct _MetaSeatNative
|
|||||||
G_DECLARE_FINAL_TYPE (MetaSeatNative, meta_seat_native,
|
G_DECLARE_FINAL_TYPE (MetaSeatNative, meta_seat_native,
|
||||||
META, SEAT_NATIVE, ClutterSeat)
|
META, SEAT_NATIVE, ClutterSeat)
|
||||||
|
|
||||||
void meta_seat_native_notify_key (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *device,
|
|
||||||
uint64_t time_us,
|
|
||||||
uint32_t key,
|
|
||||||
uint32_t state,
|
|
||||||
gboolean update_keys);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_relative_motion (MetaSeatNative *seat_evdev,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
uint64_t time_us,
|
|
||||||
float dx,
|
|
||||||
float dy,
|
|
||||||
float dx_unaccel,
|
|
||||||
float dy_unaccel);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_absolute_motion (MetaSeatNative *seat_evdev,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
uint64_t time_us,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
double *axes);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_button (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
uint64_t time_us,
|
|
||||||
uint32_t button,
|
|
||||||
uint32_t state);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_scroll_continuous (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
uint64_t time_us,
|
|
||||||
double dx,
|
|
||||||
double dy,
|
|
||||||
ClutterScrollSource source,
|
|
||||||
ClutterScrollFinishFlags flags);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_discrete_scroll (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
uint64_t time_us,
|
|
||||||
double discrete_dx,
|
|
||||||
double discrete_dy,
|
|
||||||
ClutterScrollSource source);
|
|
||||||
|
|
||||||
void meta_seat_native_notify_touch_event (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *input_device,
|
|
||||||
ClutterEventType evtype,
|
|
||||||
uint64_t time_us,
|
|
||||||
int slot,
|
|
||||||
double x,
|
|
||||||
double y);
|
|
||||||
|
|
||||||
void meta_seat_native_set_libinput_seat (MetaSeatNative *seat,
|
void meta_seat_native_set_libinput_seat (MetaSeatNative *seat,
|
||||||
struct libinput_seat *libinput_seat);
|
struct libinput_seat *libinput_seat);
|
||||||
|
|
||||||
void meta_seat_native_sync_leds (MetaSeatNative *seat);
|
void meta_seat_native_sync_leds (MetaSeatNative *seat);
|
||||||
|
|
||||||
MetaTouchState * meta_seat_native_acquire_touch_state (MetaSeatNative *seat,
|
|
||||||
int seat_slot);
|
|
||||||
MetaTouchState * meta_seat_native_lookup_touch_state (MetaSeatNative *seat,
|
|
||||||
int seat_slot);
|
|
||||||
|
|
||||||
void meta_seat_native_release_touch_state (MetaSeatNative *seat,
|
|
||||||
int seat_slot);
|
|
||||||
|
|
||||||
void meta_seat_native_clear_repeat_timer (MetaSeatNative *seat);
|
|
||||||
|
|
||||||
gint meta_seat_native_acquire_device_id (MetaSeatNative *seat);
|
|
||||||
void meta_seat_native_release_device_id (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *device);
|
|
||||||
|
|
||||||
void meta_seat_native_update_xkb_state (MetaSeatNative *seat);
|
|
||||||
|
|
||||||
void meta_seat_native_constrain_pointer (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *core_pointer,
|
|
||||||
uint64_t time_us,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float *new_x,
|
|
||||||
float *new_y);
|
|
||||||
|
|
||||||
void meta_seat_native_filter_relative_motion (MetaSeatNative *seat,
|
|
||||||
ClutterInputDevice *device,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float *dx,
|
|
||||||
float *dy);
|
|
||||||
|
|
||||||
void meta_seat_native_dispatch (MetaSeatNative *seat);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaOpenDeviceCallback:
|
* MetaOpenDeviceCallback:
|
||||||
* @path: the device path
|
* @path: the device path
|
||||||
@ -227,8 +90,6 @@ void meta_seat_native_set_device_callbacks (MetaOpenDeviceCallback open_callba
|
|||||||
void meta_seat_native_release_devices (MetaSeatNative *seat);
|
void meta_seat_native_release_devices (MetaSeatNative *seat);
|
||||||
void meta_seat_native_reclaim_devices (MetaSeatNative *seat);
|
void meta_seat_native_reclaim_devices (MetaSeatNative *seat);
|
||||||
|
|
||||||
struct xkb_state * meta_seat_native_get_xkb_state (MetaSeatNative *seat);
|
|
||||||
|
|
||||||
void meta_seat_native_set_keyboard_map (MetaSeatNative *seat,
|
void meta_seat_native_set_keyboard_map (MetaSeatNative *seat,
|
||||||
struct xkb_keymap *keymap);
|
struct xkb_keymap *keymap);
|
||||||
|
|
||||||
|
@ -129,19 +129,19 @@ release_pressed_buttons (ClutterVirtualInputDevice *virtual_device)
|
|||||||
switch (get_button_type (code))
|
switch (get_button_type (code))
|
||||||
{
|
{
|
||||||
case EVDEV_BUTTON_TYPE_KEY:
|
case EVDEV_BUTTON_TYPE_KEY:
|
||||||
meta_seat_native_notify_key (virtual_evdev->seat,
|
meta_seat_impl_notify_key (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->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_native_notify_button (virtual_evdev->seat,
|
meta_seat_impl_notify_button (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->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 ();
|
||||||
@ -165,11 +165,11 @@ meta_virtual_input_device_native_notify_relative_motion (ClutterVirtualInputDevi
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
meta_seat_native_notify_relative_motion (virtual_evdev->seat,
|
meta_seat_impl_notify_relative_motion (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
dx, dy,
|
dx, dy,
|
||||||
dx, dy);
|
dx, dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -186,11 +186,11 @@ meta_virtual_input_device_native_notify_absolute_motion (ClutterVirtualInputDevi
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
meta_seat_native_notify_absolute_motion (virtual_evdev->seat,
|
meta_seat_impl_notify_absolute_motion (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
x, y,
|
x, y,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -252,11 +252,11 @@ meta_virtual_input_device_native_notify_button (ClutterVirtualInputDevice *virtu
|
|||||||
button_state == CLUTTER_BUTTON_STATE_PRESSED ? "press" : "release",
|
button_state == CLUTTER_BUTTON_STATE_PRESSED ? "press" : "release",
|
||||||
evdev_button, virtual_device);
|
evdev_button, virtual_device);
|
||||||
|
|
||||||
meta_seat_native_notify_button (virtual_evdev->seat,
|
meta_seat_impl_notify_button (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
evdev_button,
|
evdev_button,
|
||||||
button_state);
|
button_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -294,12 +294,12 @@ meta_virtual_input_device_native_notify_key (ClutterVirtualInputDevice *virtual_
|
|||||||
key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release",
|
key_state == CLUTTER_KEY_STATE_PRESSED ? "press" : "release",
|
||||||
key, virtual_device);
|
key, virtual_device);
|
||||||
|
|
||||||
meta_seat_native_notify_key (virtual_evdev->seat,
|
meta_seat_impl_notify_key (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
key,
|
key,
|
||||||
key_state,
|
key_state,
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -320,7 +320,7 @@ 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 (META_KEYMAP_NATIVE (keymap));
|
||||||
state = virtual_evdev->seat->xkb;
|
state = meta_seat_impl_get_xkb_state (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);
|
||||||
@ -389,12 +389,12 @@ 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_native_notify_key (virtual_evdev->seat,
|
meta_seat_impl_notify_key (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
evcode,
|
evcode,
|
||||||
key_state,
|
key_state,
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -447,12 +447,12 @@ meta_virtual_input_device_native_notify_keyval (ClutterVirtualInputDevice *virtu
|
|||||||
if (key_state)
|
if (key_state)
|
||||||
apply_level_modifiers (virtual_device, time_us, level, key_state);
|
apply_level_modifiers (virtual_device, time_us, level, key_state);
|
||||||
|
|
||||||
meta_seat_native_notify_key (virtual_evdev->seat,
|
meta_seat_impl_notify_key (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
evcode,
|
evcode,
|
||||||
key_state,
|
key_state,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
if (!key_state)
|
if (!key_state)
|
||||||
apply_level_modifiers (virtual_device, time_us, level, key_state);
|
apply_level_modifiers (virtual_device, time_us, level, key_state);
|
||||||
@ -504,11 +504,11 @@ meta_virtual_input_device_native_notify_discrete_scroll (ClutterVirtualInputDevi
|
|||||||
|
|
||||||
direction_to_discrete (direction, &discrete_dx, &discrete_dy);
|
direction_to_discrete (direction, &discrete_dx, &discrete_dy);
|
||||||
|
|
||||||
meta_seat_native_notify_discrete_scroll (virtual_evdev->seat,
|
meta_seat_impl_notify_discrete_scroll (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
discrete_dx, discrete_dy,
|
discrete_dx, discrete_dy,
|
||||||
scroll_source);
|
scroll_source);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -527,12 +527,12 @@ meta_virtual_input_device_native_notify_scroll_continuous (ClutterVirtualInputDe
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
meta_seat_native_notify_scroll_continuous (virtual_evdev->seat,
|
meta_seat_impl_notify_scroll_continuous (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->device,
|
||||||
time_us,
|
time_us,
|
||||||
dx, dy,
|
dx, dy,
|
||||||
scroll_source,
|
scroll_source,
|
||||||
CLUTTER_SCROLL_FINISHED_NONE);
|
CLUTTER_SCROLL_FINISHED_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -551,21 +551,21 @@ meta_virtual_input_device_native_notify_touch_down (ClutterVirtualInputDevice *v
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
touch_state = meta_seat_native_acquire_touch_state (virtual_evdev->seat,
|
touch_state = meta_seat_impl_acquire_touch_state (virtual_evdev->seat->impl,
|
||||||
device_slot);
|
device_slot);
|
||||||
if (!touch_state)
|
if (!touch_state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
touch_state->coords.x = x;
|
touch_state->coords.x = x;
|
||||||
touch_state->coords.y = y;
|
touch_state->coords.y = y;
|
||||||
|
|
||||||
meta_seat_native_notify_touch_event (virtual_evdev->seat,
|
meta_seat_impl_notify_touch_event (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -584,21 +584,21 @@ meta_virtual_input_device_native_notify_touch_motion (ClutterVirtualInputDevice
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
touch_state = meta_seat_native_lookup_touch_state (virtual_evdev->seat,
|
touch_state = meta_seat_impl_lookup_touch_state (virtual_evdev->seat->impl,
|
||||||
device_slot);
|
device_slot);
|
||||||
if (!touch_state)
|
if (!touch_state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
touch_state->coords.x = x;
|
touch_state->coords.x = x;
|
||||||
touch_state->coords.y = y;
|
touch_state->coords.y = y;
|
||||||
|
|
||||||
meta_seat_native_notify_touch_event (virtual_evdev->seat,
|
meta_seat_impl_notify_touch_event (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -615,21 +615,21 @@ meta_virtual_input_device_native_notify_touch_up (ClutterVirtualInputDevice *vir
|
|||||||
if (time_us == CLUTTER_CURRENT_TIME)
|
if (time_us == CLUTTER_CURRENT_TIME)
|
||||||
time_us = g_get_monotonic_time ();
|
time_us = g_get_monotonic_time ();
|
||||||
|
|
||||||
touch_state = meta_seat_native_lookup_touch_state (virtual_evdev->seat,
|
touch_state = meta_seat_impl_lookup_touch_state (virtual_evdev->seat->impl,
|
||||||
device_slot);
|
device_slot);
|
||||||
if (!touch_state)
|
if (!touch_state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_seat_native_notify_touch_event (virtual_evdev->seat,
|
meta_seat_impl_notify_touch_event (virtual_evdev->seat->impl,
|
||||||
virtual_evdev->device,
|
virtual_evdev->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);
|
||||||
|
|
||||||
meta_seat_native_release_touch_state (virtual_evdev->seat,
|
meta_seat_impl_release_touch_state (virtual_evdev->seat->impl,
|
||||||
touch_state->seat_slot);
|
touch_state->seat_slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -688,7 +688,7 @@ meta_virtual_input_device_native_constructed (GObject *object)
|
|||||||
device_type, virtual_device);
|
device_type, virtual_device);
|
||||||
|
|
||||||
virtual_evdev->device =
|
virtual_evdev->device =
|
||||||
meta_input_device_native_new_virtual (virtual_evdev->seat,
|
meta_input_device_native_new_virtual (virtual_evdev->seat->impl,
|
||||||
device_type,
|
device_type,
|
||||||
CLUTTER_INPUT_MODE_SLAVE);
|
CLUTTER_INPUT_MODE_SLAVE);
|
||||||
|
|
||||||
|
@ -705,6 +705,8 @@ if have_native_backend
|
|||||||
'backends/native/meta-renderer-native-gles3.c',
|
'backends/native/meta-renderer-native-gles3.c',
|
||||||
'backends/native/meta-renderer-native-gles3.h',
|
'backends/native/meta-renderer-native-gles3.h',
|
||||||
'backends/native/meta-renderer-native.h',
|
'backends/native/meta-renderer-native.h',
|
||||||
|
'backends/native/meta-seat-impl.c',
|
||||||
|
'backends/native/meta-seat-impl.h',
|
||||||
'backends/native/meta-seat-native.c',
|
'backends/native/meta-seat-native.c',
|
||||||
'backends/native/meta-seat-native.h',
|
'backends/native/meta-seat-native.h',
|
||||||
'backends/native/meta-stage-native.c',
|
'backends/native/meta-stage-native.c',
|
||||||
|
Loading…
Reference in New Issue
Block a user