[mutter/wip/carlosg/input-in-backends: 18/20] clutter: Move evdev input to src/backends/native
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-in-backends: 18/20] clutter: Move evdev input to src/backends/native
- Date: Thu, 4 Jul 2019 12:40:27 +0000 (UTC)
commit 90eac1cbc7175fe852cd2c3ed3709364e901dc55
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Mar 29 22:03:27 2019 +0100
clutter: Move evdev input to src/backends/native
The end goal is to have all clutter backend code in src/backends. Input
is the larger chunk of it, which is now part of our specific
MutterClutterBackendNative, this extends to device manager, input devices,
tools and keymap.
This was supposed to be nice and incremental, but there's no sane way
to cut this through. As a result of the refactor, a number of private
Clutter functions are now exported for external backends to be possible.
clutter/clutter/clutter-backend.c | 30 +-
clutter/clutter/clutter-event-private.h | 2 +
clutter/clutter/clutter-virtual-input-device.h | 1 +
clutter/clutter/egl/clutter-backend-eglnative.c | 4 -
.../clutter/evdev/clutter-device-manager-evdev.h | 108 ---
clutter/clutter/evdev/clutter-evdev.h | 181 ----
clutter/clutter/evdev/clutter-event-evdev.c | 191 -----
clutter/clutter/evdev/clutter-input-device-evdev.h | 157 ----
.../evdev/clutter-input-device-tool-evdev.h | 84 --
clutter/clutter/evdev/clutter-seat-evdev.h | 163 ----
clutter/clutter/evdev/clutter-xkb-utils.h | 46 -
clutter/clutter/meson.build | 20 -
clutter/meson.build | 8 -
src/backends/native/meta-backend-native.c | 33 +-
src/backends/native/meta-clutter-backend-native.c | 34 +
.../backends/native/meta-device-manager-native.c | 949 ++++++++++-----------
src/backends/native/meta-device-manager-native.h | 207 +++++
src/backends/native/meta-event-native.c | 210 +++++
src/backends/native/meta-event-native.h | 50 ++
.../backends/native/meta-input-device-native.c | 445 +++++-----
src/backends/native/meta-input-device-native.h | 146 ++++
.../native/meta-input-device-tool-native.c | 75 +-
.../native/meta-input-device-tool-native.h | 85 ++
src/backends/native/meta-input-settings-native.c | 49 +-
.../backends/native/meta-keymap-native.c | 50 +-
.../backends/native/meta-keymap-native.h | 16 +-
src/backends/native/meta-launcher.c | 12 +-
.../backends/native/meta-seat-native.c | 306 +++----
src/backends/native/meta-seat-native.h | 160 ++++
.../native/meta-virtual-input-device-native.c | 419 +++++----
.../native/meta-virtual-input-device-native.h | 18 +-
.../backends/native/meta-xkb-utils.c | 37 +-
src/backends/native/meta-xkb-utils.h | 42 +
src/meson.build | 18 +
src/wayland/meta-wayland-keyboard.c | 4 +-
src/wayland/meta-wayland-pointer.c | 6 +-
src/wayland/meta-wayland-tablet-pad-group.c | 5 +-
src/wayland/meta-wayland-tablet-pad.c | 7 +-
src/wayland/meta-wayland-tablet-seat.c | 1 -
src/wayland/meta-wayland-tablet-tool.c | 5 +-
src/wayland/meta-wayland-touch.c | 12 +-
41 files changed, 2142 insertions(+), 2254 deletions(-)
---
diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c
index 06a0305a5..5294ea965 100644
--- a/clutter/clutter/clutter-backend.c
+++ b/clutter/clutter/clutter-backend.c
@@ -62,9 +62,6 @@
#ifdef CLUTTER_INPUT_X11
#include "x11/clutter-backend-x11.h"
#endif
-#ifdef CLUTTER_INPUT_EVDEV
-#include "evdev/clutter-device-manager-evdev.h"
-#endif
#ifdef CLUTTER_WINDOWING_EGL
#include "egl/clutter-backend-eglnative.h"
#endif
@@ -523,32 +520,7 @@ _clutter_create_backend (void)
static void
clutter_backend_real_init_events (ClutterBackend *backend)
{
- const char *input_backend = NULL;
-
- input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
- if (input_backend != NULL)
- input_backend = g_intern_string (input_backend);
-
-#ifdef CLUTTER_INPUT_EVDEV
- /* Evdev can be used regardless of the windowing system */
- if ((input_backend != NULL && strcmp (input_backend, CLUTTER_INPUT_EVDEV) == 0)
-#ifdef CLUTTER_WINDOWING_EGL
- /* but we do want to always use it for EGL native */
- || clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL)
-#endif
- )
- {
- _clutter_events_evdev_init (backend);
- }
- else
-#endif
- if (input_backend != NULL)
- {
- if (input_backend != I_(CLUTTER_INPUT_NULL))
- g_error ("Unrecognized input backend '%s'", input_backend);
- }
- else
- g_error ("Unknown input backend");
+ g_error ("Unknown input backend");
}
static ClutterDeviceManager *
diff --git a/clutter/clutter/clutter-event-private.h b/clutter/clutter/clutter-event-private.h
index cd840e9a0..668be6ef9 100644
--- a/clutter/clutter/clutter-event-private.h
+++ b/clutter/clutter/clutter-event-private.h
@@ -10,8 +10,10 @@ void _clutter_event_set_pointer_emulated (ClutterEvent *eve
gboolean is_emulated);
/* Reinjecting queued events for processing */
+CLUTTER_EXPORT
void _clutter_process_event (ClutterEvent *event);
+CLUTTER_EXPORT
gboolean _clutter_event_process_filters (ClutterEvent *event);
/* clears the event queue inside the main context */
diff --git a/clutter/clutter/clutter-virtual-input-device.h b/clutter/clutter/clutter-virtual-input-device.h
index 3e25dbeac..450accda2 100644
--- a/clutter/clutter/clutter-virtual-input-device.h
+++ b/clutter/clutter/clutter-virtual-input-device.h
@@ -172,6 +172,7 @@ void clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *vi
CLUTTER_EXPORT
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
+CLUTTER_EXPORT
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
diff --git a/clutter/clutter/egl/clutter-backend-eglnative.c b/clutter/clutter/egl/clutter-backend-eglnative.c
index 997298734..727dd4418 100644
--- a/clutter/clutter/egl/clutter-backend-eglnative.c
+++ b/clutter/clutter/egl/clutter-backend-eglnative.c
@@ -40,10 +40,6 @@
/* This is a Cogl based backend */
#include "cogl/clutter-stage-cogl.h"
-#ifdef HAVE_EVDEV
-#include "evdev/clutter-device-manager-evdev.h"
-#endif
-
#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-main.h"
diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build
index 9fa1c4dad..7a247632d 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -297,28 +297,8 @@ endif
if have_native_backend
clutter_native_nonintrospected_sources = [
'egl/clutter-backend-eglnative.c',
- 'evdev/clutter-device-manager-evdev.c',
- 'evdev/clutter-event-evdev.c',
- 'evdev/clutter-input-device-evdev.c',
- 'evdev/clutter-input-device-tool-evdev.c',
- 'evdev/clutter-keymap-evdev.c',
- 'evdev/clutter-seat-evdev.c',
- 'evdev/clutter-virtual-input-device-evdev.c',
- 'evdev/clutter-xkb-utils.c',
]
clutter_backend_nonintrospected_sources += clutter_native_nonintrospected_sources
-
- clutter_native_private_headers = [
- 'evdev/clutter-evdev.h',
- 'evdev/clutter-device-manager-evdev.h',
- 'evdev/clutter-input-device-evdev.h',
- 'evdev/clutter-input-device-tool-evdev.h',
- 'evdev/clutter-keymap-evdev.h',
- 'evdev/clutter-seat-evdev.h',
- 'evdev/clutter-virtual-input-device-evdev.h',
- 'evdev/clutter-xkb-utils.h',
- ]
- clutter_backend_private_headers += clutter_native_private_headers
endif
if have_wayland
diff --git a/clutter/meson.build b/clutter/meson.build
index e599a7ef0..367ff0e10 100644
--- a/clutter/meson.build
+++ b/clutter/meson.build
@@ -71,14 +71,6 @@ if have_x11
]
endif
-if have_native_backend
- clutter_pkg_private_deps += [
- libudev_dep,
- libinput_dep,
- xkbcommon_dep,
- ]
-endif
-
if have_libwacom
clutter_pkg_private_deps += [
libwacom_dep,
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index d285d61f2..4df2d5235 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -50,6 +50,8 @@
#include "backends/native/meta-barrier-native.h"
#include "backends/native/meta-clutter-backend-native.h"
#include "backends/native/meta-cursor-renderer-native.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-event-native.h"
#include "backends/native/meta-input-settings-native.h"
#include "backends/native/meta-kms.h"
#include "backends/native/meta-kms-device.h"
@@ -57,7 +59,6 @@
#include "backends/native/meta-monitor-manager-kms.h"
#include "backends/native/meta-renderer-native.h"
#include "backends/native/meta-stage-native.h"
-#include "clutter/evdev/clutter-evdev.h"
#include "core/meta-border.h"
#include "meta/main.h"
@@ -343,10 +344,10 @@ meta_backend_native_post_init (MetaBackend *backend)
META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
- clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
- NULL, NULL);
- clutter_evdev_set_relative_motion_filter (manager, relative_motion_filter,
- meta_backend_get_monitor_manager (backend));
+ meta_device_manager_native_set_pointer_constrain_callback (manager, pointer_constrain_callback,
+ NULL, NULL);
+ meta_device_manager_native_set_relative_motion_filter (manager, relative_motion_filter,
+ meta_backend_get_monitor_manager (backend));
if (meta_settings_is_experimental_feature_enabled (settings,
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER))
@@ -411,7 +412,7 @@ meta_backend_native_warp_pointer (MetaBackend *backend,
guint32 time_ = 0;
/* Warp the input device pointer state. */
- clutter_evdev_warp_pointer (device, time_, x, y);
+ meta_device_manager_native_warp_pointer (device, time_, x, y);
/* Warp displayed pointer cursor. */
meta_cursor_tracker_update_position (cursor_tracker, x, y);
@@ -450,7 +451,7 @@ meta_backend_native_set_keymap (MetaBackend *backend,
keymap = xkb_keymap_new_from_names (context, &names, XKB_KEYMAP_COMPILE_NO_FLAGS);
xkb_context_unref (context);
- clutter_evdev_set_keyboard_map (manager, keymap);
+ meta_device_manager_native_set_keyboard_map (manager, keymap);
meta_backend_notify_keymap_changed (backend);
@@ -461,7 +462,7 @@ static struct xkb_keymap *
meta_backend_native_get_keymap (MetaBackend *backend)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- return clutter_evdev_get_keyboard_map (manager);
+ return meta_device_manager_native_get_keyboard_map (manager);
}
static xkb_layout_index_t
@@ -469,7 +470,7 @@ meta_backend_native_get_keymap_layout_group (MetaBackend *backend)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- return clutter_evdev_get_keyboard_layout_index (manager);
+ return meta_device_manager_native_get_keyboard_layout_index (manager);
}
static void
@@ -483,7 +484,7 @@ meta_backend_native_lock_layout_group (MetaBackend *backend,
if (old_idx == idx)
return;
- clutter_evdev_set_keyboard_layout_index (manager, idx);
+ meta_device_manager_native_set_keyboard_layout_index (manager, idx);
meta_backend_notify_keymap_layout_group_changed (backend, idx);
}
@@ -492,7 +493,7 @@ meta_backend_native_set_numlock (MetaBackend *backend,
gboolean numlock_state)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- clutter_evdev_set_keyboard_numlock (manager, numlock_state);
+ meta_device_manager_native_set_keyboard_numlock (manager, numlock_state);
}
static gboolean
@@ -503,9 +504,9 @@ meta_backend_native_get_relative_motion_deltas (MetaBackend *backend,
double *dx_unaccel,
double *dy_unaccel)
{
- return clutter_evdev_event_get_relative_motion (event,
- dx, dy,
- dx_unaccel, dy_unaccel);
+ return meta_event_native_get_relative_motion (event,
+ dx, dy,
+ dx_unaccel, dy_unaccel);
}
static void
@@ -798,7 +799,7 @@ meta_backend_native_pause (MetaBackendNative *native)
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
- clutter_evdev_release_devices ();
+ meta_device_manager_native_release_devices ();
clutter_stage_freeze_updates (stage);
disconnect_udev_device_added_handler (native);
@@ -821,7 +822,7 @@ void meta_backend_native_resume (MetaBackendNative *native)
connect_udev_device_added_handler (native);
- clutter_evdev_reclaim_devices ();
+ meta_device_manager_native_reclaim_devices ();
clutter_stage_thaw_updates (stage);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/src/backends/native/meta-clutter-backend-native.c
b/src/backends/native/meta-clutter-backend-native.c
index 7d1479053..e60680803 100644
--- a/src/backends/native/meta-clutter-backend-native.c
+++ b/src/backends/native/meta-clutter-backend-native.c
@@ -44,6 +44,8 @@
#include "backends/meta-backend-private.h"
#include "backends/meta-renderer.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-keymap-native.h"
#include "backends/native/meta-stage-native.h"
#include "clutter/clutter.h"
#include "core/bell.h"
@@ -54,6 +56,8 @@ struct _MetaClutterBackendNative
ClutterBackendEglNative parent;
MetaStageNative *stage_native;
+ MetaKeymapNative *keymap;
+ MetaDeviceManagerNative *device_manager;
};
G_DEFINE_TYPE (MetaClutterBackendNative, meta_clutter_backend_native,
@@ -103,6 +107,33 @@ meta_clutter_backend_native_bell_notify (ClutterBackend *backend)
meta_bell_notify (display, NULL);
}
+static ClutterDeviceManager *
+meta_clutter_backend_native_get_device_manager (ClutterBackend *backend)
+{
+ MetaClutterBackendNative *backend_native = META_CLUTTER_BACKEND_NATIVE (backend);
+
+ return CLUTTER_DEVICE_MANAGER (backend_native->device_manager);
+}
+
+static ClutterKeymap *
+meta_clutter_backend_native_get_keymap (ClutterBackend *backend)
+{
+ MetaClutterBackendNative *backend_native = META_CLUTTER_BACKEND_NATIVE (backend);
+
+ return CLUTTER_KEYMAP (backend_native->keymap);
+}
+
+static void
+meta_clutter_backend_native_init_events (ClutterBackend *backend)
+{
+ MetaClutterBackendNative *backend_native = META_CLUTTER_BACKEND_NATIVE (backend);
+
+ backend_native->keymap = g_object_new (META_TYPE_KEYMAP_NATIVE, NULL);
+ backend_native->device_manager = g_object_new (META_TYPE_DEVICE_MANAGER_NATIVE,
+ "backend", backend,
+ NULL);
+}
+
static void
meta_clutter_backend_native_init (MetaClutterBackendNative *clutter_backend_nativen)
{
@@ -116,4 +147,7 @@ meta_clutter_backend_native_class_init (MetaClutterBackendNativeClass *klass)
clutter_backend_class->get_renderer = meta_clutter_backend_native_get_renderer;
clutter_backend_class->create_stage = meta_clutter_backend_native_create_stage;
clutter_backend_class->bell_notify = meta_clutter_backend_native_bell_notify;
+ clutter_backend_class->get_device_manager = meta_clutter_backend_native_get_device_manager;
+ clutter_backend_class->get_keymap = meta_clutter_backend_native_get_keymap;
+ clutter_backend_class->init_events = meta_clutter_backend_native_init_events;
}
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c
b/src/backends/native/meta-device-manager-native.c
similarity index 69%
rename from clutter/clutter/evdev/clutter-device-manager-evdev.c
rename to src/backends/native/meta-device-manager-native.c
index 14da4a7c9..5caf928cc 100644
--- a/clutter/clutter/evdev/clutter-device-manager-evdev.c
+++ b/src/backends/native/meta-device-manager-native.c
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright (C) 2010 Intel Corp.
* Copyright (C) 2014 Jonas Ådahl
*
@@ -23,7 +19,7 @@
* Author: Jonas Ådahl <jadahl gmail com>
*/
-#include "clutter-build-config.h"
+#include "config.h"
#include <math.h>
#include <float.h>
@@ -35,28 +31,18 @@
#include <string.h>
#include <unistd.h>
+#include <clutter/clutter-mutter.h>
#include <glib.h>
#include <libinput.h>
-#include "clutter-backend.h"
-#include "clutter-debug.h"
-#include "clutter-device-manager.h"
-#include "clutter-device-manager-private.h"
-#include "clutter-event-private.h"
-#include "clutter-input-device-evdev.h"
-#include "clutter-keymap-evdev.h"
-#include "clutter-seat-evdev.h"
-#include "clutter-virtual-input-device-evdev.h"
-#include "clutter-main.h"
-#include "clutter-private.h"
-#include "clutter-stage-manager.h"
-#include "clutter-xkb-utils.h"
-#include "clutter-backend-private.h"
-#include "clutter-evdev.h"
-#include "clutter-stage-private.h"
-#include "clutter-input-device-tool-evdev.h"
-
-#include "clutter-device-manager-evdev.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-event-native.h"
+#include "backends/native/meta-input-device-native.h"
+#include "backends/native/meta-input-device-tool-native.h"
+#include "backends/native/meta-keymap-native.h"
+#include "backends/native/meta-seat-native.h"
+#include "backends/native/meta-virtual-input-device-native.h"
+#include "backends/native/meta-xkb-utils.h"
/*
* Clutter makes the assumption that two core devices have ID's 2 and 3 (core
@@ -68,36 +54,36 @@
*/
#define INITIAL_DEVICE_ID 2
-typedef struct _ClutterEventFilter ClutterEventFilter;
+typedef struct _MetaEventFilter MetaEventFilter;
-struct _ClutterEventFilter
+struct _MetaEventFilter
{
- ClutterEvdevFilterFunc func;
+ MetaEvdevFilterFunc func;
gpointer data;
GDestroyNotify destroy_notify;
};
-typedef struct _ClutterEventSource ClutterEventSource;
+typedef struct _MetaEventSource MetaEventSource;
-struct _ClutterDeviceManagerEvdevPrivate
+struct _MetaDeviceManagerNativePrivate
{
struct libinput *libinput;
ClutterStage *stage;
gboolean released;
- ClutterEventSource *event_source;
+ MetaEventSource *event_source;
GSList *devices;
GSList *seats;
- ClutterSeatEvdev *main_seat;
+ MetaSeatNative *main_seat;
- ClutterPointerConstrainCallback constrain_callback;
- gpointer constrain_data;
- GDestroyNotify constrain_data_notify;
+ MetaPointerConstrainCallback constrain_callback;
+ gpointer constrain_data;
+ GDestroyNotify constrain_data_notify;
- ClutterRelativeMotionFilter relative_motion_filter;
+ MetaRelativeMotionFilter relative_motion_filter;
gpointer relative_motion_filter_user_data;
ClutterStageManager *stage_manager;
@@ -110,15 +96,15 @@ struct _ClutterDeviceManagerEvdevPrivate
GList *free_device_ids;
};
-G_DEFINE_TYPE_WITH_CODE (ClutterDeviceManagerEvdev,
- clutter_device_manager_evdev,
+G_DEFINE_TYPE_WITH_CODE (MetaDeviceManagerNative,
+ meta_device_manager_native,
CLUTTER_TYPE_DEVICE_MANAGER,
- G_ADD_PRIVATE (ClutterDeviceManagerEvdev))
+ G_ADD_PRIVATE (MetaDeviceManagerNative))
-static ClutterOpenDeviceCallback device_open_callback;
-static ClutterCloseDeviceCallback device_close_callback;
-static gpointer device_callback_data;
-static gchar * evdev_seat_id;
+static MetaOpenDeviceCallback device_open_callback;
+static MetaCloseDeviceCallback device_close_callback;
+static gpointer device_callback_data;
+static gchar * evdev_seat_id;
#ifdef CLUTTER_ENABLE_DEBUG
static const char *device_type_str[] = {
@@ -137,53 +123,53 @@ static const char *device_type_str[] = {
#endif /* CLUTTER_ENABLE_DEBUG */
/*
- * ClutterEventSource management
+ * MetaEventSource management
*
* The device manager is responsible for managing the GSource when devices
* appear and disappear from the system.
*/
static void
-clutter_device_manager_evdev_copy_event_data (ClutterDeviceManager *device_manager,
- const ClutterEvent *src,
- ClutterEvent *dest)
+meta_device_manager_native_copy_event_data (ClutterDeviceManager *device_manager,
+ const ClutterEvent *src,
+ ClutterEvent *dest)
{
- ClutterEventEvdev *event_evdev;
+ MetaEventNative *event_evdev;
event_evdev = _clutter_event_get_platform_data (src);
if (event_evdev != NULL)
- _clutter_event_set_platform_data (dest, _clutter_event_evdev_copy (event_evdev));
+ _clutter_event_set_platform_data (dest, meta_event_native_copy (event_evdev));
}
static void
-clutter_device_manager_evdev_free_event_data (ClutterDeviceManager *device_manager,
- ClutterEvent *event)
+meta_device_manager_native_free_event_data (ClutterDeviceManager *device_manager,
+ ClutterEvent *event)
{
- ClutterEventEvdev *event_evdev;
+ MetaEventNative *event_evdev;
event_evdev = _clutter_event_get_platform_data (event);
if (event_evdev != NULL)
- _clutter_event_evdev_free (event_evdev);
+ meta_event_native_free (event_evdev);
}
/*
- * ClutterEventSource for reading input devices
+ * MetaEventSource for reading input devices
*/
-struct _ClutterEventSource
+struct _MetaEventSource
{
GSource source;
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
GPollFD event_poll_fd;
};
static void
-process_events (ClutterDeviceManagerEvdev *manager_evdev);
+process_events (MetaDeviceManagerNative *manager_evdev);
static gboolean
-clutter_event_prepare (GSource *source,
- gint *timeout)
+meta_event_prepare (GSource *source,
+ gint *timeout)
{
gboolean retval;
@@ -198,9 +184,9 @@ clutter_event_prepare (GSource *source,
}
static gboolean
-clutter_event_check (GSource *source)
+meta_event_check (GSource *source)
{
- ClutterEventSource *event_source = (ClutterEventSource *) source;
+ MetaEventSource *event_source = (MetaEventSource *) source;
gboolean retval;
_clutter_threads_acquire_lock ();
@@ -220,13 +206,13 @@ queue_event (ClutterEvent *event)
}
void
-_clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
- ClutterInputDevice *core_pointer,
- uint64_t time_us,
- float x,
- float y,
- float *new_x,
- float *new_y)
+meta_device_manager_native_constrain_pointer (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *core_pointer,
+ uint64_t time_us,
+ float x,
+ float y,
+ float *new_x,
+ float *new_y)
{
if (manager_evdev->priv->constrain_callback)
{
@@ -248,14 +234,14 @@ _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *mana
}
void
-_clutter_device_manager_evdev_filter_relative_motion (ClutterDeviceManagerEvdev *manager_evdev,
- ClutterInputDevice *device,
- float x,
- float y,
- float *dx,
- float *dy)
+meta_device_manager_native_filter_relative_motion (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *device,
+ float x,
+ float y,
+ float *dx,
+ float *dy)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
if (!priv->relative_motion_filter)
return;
@@ -272,16 +258,16 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
gdouble *axes)
{
gfloat stage_width, stage_height;
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
stage = _clutter_input_device_get_stage (input_device);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (input_device->device_manager);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (input_device->device_manager);
+ seat = meta_input_device_native_get_seat (device_evdev);
stage_width = clutter_actor_get_width (CLUTTER_ACTOR (stage));
stage_height = clutter_actor_get_height (CLUTTER_ACTOR (stage));
@@ -304,15 +290,15 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
y = CLAMP (y, 0.f, stage_height - 1);
}
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us);
event->motion.stage = stage;
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
- clutter_input_device_evdev_translate_coordinates (input_device, stage,
- &event->motion.x,
- &event->motion.y);
+ meta_input_device_native_translate_coordinates (input_device, stage,
+ &event->motion.x,
+ &event->motion.y);
event->motion.axes = axes;
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
@@ -357,17 +343,17 @@ notify_relative_tool_motion (ClutterInputDevice *input_device,
gfloat dy,
gdouble *axes)
{
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
ClutterEvent *event;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
gfloat x, y;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
x = input_device->current_x + dx;
y = input_device->current_y + dy;
- _clutter_device_manager_evdev_filter_relative_motion (seat->manager_evdev,
+ meta_device_manager_native_filter_relative_motion (seat->manager_evdev,
input_device,
seat->pointer_x,
seat->pointer_y,
@@ -375,7 +361,7 @@ notify_relative_tool_motion (ClutterInputDevice *input_device,
&dy);
event = new_absolute_motion_event (input_device, time_us, x, y, axes);
- _clutter_evdev_event_set_relative_motion (event, dx, dy, 0, 0);
+ meta_event_native_set_relative_motion (event, dx, dy, 0, 0);
queue_event (event);
}
@@ -390,8 +376,8 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
gdouble scale,
guint n_fingers)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
ClutterPoint pos;
@@ -402,14 +388,14 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
if (stage == NULL)
return;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_TOUCHPAD_PINCH);
clutter_input_device_get_coords (seat->core_pointer, NULL, &pos);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->touchpad_pinch.phase = phase;
event->touchpad_pinch.time = us2ms (time_us);
event->touchpad_pinch.stage = CLUTTER_STAGE (stage);
@@ -421,7 +407,7 @@ notify_pinch_gesture_event (ClutterInputDevice *input_device,
event->touchpad_pinch.scale = scale;
event->touchpad_pinch.n_fingers = n_fingers;
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
@@ -437,8 +423,8 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
gdouble dx,
gdouble dy)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
ClutterPoint pos;
@@ -449,12 +435,12 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
if (stage == NULL)
return;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_TOUCHPAD_SWIPE);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->touchpad_swipe.phase = phase;
event->touchpad_swipe.time = us2ms (time_us);
event->touchpad_swipe.stage = CLUTTER_STAGE (stage);
@@ -466,7 +452,7 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
event->touchpad_swipe.dy = dy;
event->touchpad_swipe.n_fingers = n_fingers;
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
@@ -479,8 +465,8 @@ notify_proximity (ClutterInputDevice *input_device,
guint64 time_us,
gboolean in)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
@@ -490,15 +476,15 @@ notify_proximity (ClutterInputDevice *input_device,
if (stage == NULL)
return;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
if (in)
event = clutter_event_new (CLUTTER_PROXIMITY_IN);
else
event = clutter_event_new (CLUTTER_PROXIMITY_OUT);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->proximity.time = us2ms (time_us);
event->proximity.stage = CLUTTER_STAGE (stage);
@@ -519,8 +505,8 @@ notify_pad_button (ClutterInputDevice *input_device,
guint32 mode,
guint32 pressed)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event;
@@ -535,10 +521,10 @@ notify_pad_button (ClutterInputDevice *input_device,
else
event = clutter_event_new (CLUTTER_PAD_BUTTON_RELEASE);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->pad_button.stage = stage;
event->pad_button.button = button;
event->pad_button.group = mode_group;
@@ -561,9 +547,9 @@ notify_pad_strip (ClutterInputDevice *input_device,
guint32 mode,
gdouble value)
{
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
ClutterInputDevicePadSource source;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event;
@@ -578,11 +564,11 @@ notify_pad_strip (ClutterInputDevice *input_device,
else
source = CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_PAD_STRIP);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->pad_strip.strip_source = source;
event->pad_strip.stage = stage;
event->pad_strip.strip_number = strip_number;
@@ -607,9 +593,9 @@ notify_pad_ring (ClutterInputDevice *input_device,
guint32 mode,
gdouble angle)
{
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
ClutterInputDevicePadSource source;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event;
@@ -624,11 +610,11 @@ notify_pad_ring (ClutterInputDevice *input_device,
else
source = CLUTTER_INPUT_DEVICE_PAD_SOURCE_UNKNOWN;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_PAD_RING);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->pad_ring.ring_source = source;
event->pad_ring.stage = stage;
event->pad_ring.ring_number = ring_number;
@@ -645,21 +631,21 @@ notify_pad_ring (ClutterInputDevice *input_device,
}
static void
-dispatch_libinput (ClutterDeviceManagerEvdev *manager_evdev)
+dispatch_libinput (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
libinput_dispatch (priv->libinput);
process_events (manager_evdev);
}
static gboolean
-clutter_event_dispatch (GSource *g_source,
- GSourceFunc callback,
- gpointer user_data)
+meta_event_dispatch (GSource *g_source,
+ GSourceFunc callback,
+ gpointer user_data)
{
- ClutterEventSource *source = (ClutterEventSource *) g_source;
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaEventSource *source = (MetaEventSource *) g_source;
+ MetaDeviceManagerNative *manager_evdev;
ClutterEvent *event;
_clutter_threads_acquire_lock ();
@@ -681,10 +667,10 @@ clutter_event_dispatch (GSource *g_source,
ClutterModifierType event_state;
ClutterInputDevice *input_device =
clutter_event_get_source_device (event);
- ClutterInputDeviceEvdev *device_evdev =
- CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- ClutterSeatEvdev *seat =
- _clutter_input_device_evdev_get_seat (device_evdev);
+ MetaInputDeviceNative *device_evdev =
+ META_INPUT_DEVICE_NATIVE (input_device);
+ MetaSeatNative *seat =
+ meta_input_device_native_get_seat (device_evdev);
/* Drop events if we don't have any stage to forward them to */
if (!_clutter_input_device_get_stage (input_device))
@@ -706,22 +692,22 @@ out:
return TRUE;
}
static GSourceFuncs event_funcs = {
- clutter_event_prepare,
- clutter_event_check,
- clutter_event_dispatch,
+ meta_event_prepare,
+ meta_event_check,
+ meta_event_dispatch,
NULL
};
-static ClutterEventSource *
-clutter_event_source_new (ClutterDeviceManagerEvdev *manager_evdev)
+static MetaEventSource *
+meta_event_source_new (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
GSource *source;
- ClutterEventSource *event_source;
+ MetaEventSource *event_source;
gint fd;
- source = g_source_new (&event_funcs, sizeof (ClutterEventSource));
- event_source = (ClutterEventSource *) source;
+ source = g_source_new (&event_funcs, sizeof (MetaEventSource));
+ event_source = (MetaEventSource *) source;
/* setup the source */
event_source->manager_evdev = manager_evdev;
@@ -740,12 +726,10 @@ clutter_event_source_new (ClutterDeviceManagerEvdev *manager_evdev)
}
static void
-clutter_event_source_free (ClutterEventSource *source)
+meta_event_source_free (MetaEventSource *source)
{
GSource *g_source = (GSource *) source;
- CLUTTER_NOTE (EVENT, "Removing GSource for evdev device manager");
-
/* ignore the return value of close, it's not like we can do something
* about it */
close (source->event_poll_fd.fd);
@@ -755,14 +739,14 @@ clutter_event_source_free (ClutterEventSource *source)
}
static void
-evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_device *libinput_device)
+evdev_add_device (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_device *libinput_device)
{
ClutterDeviceManager *manager = (ClutterDeviceManager *) manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
ClutterInputDeviceType type;
struct libinput_seat *libinput_seat;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterInputDevice *device;
libinput_seat = libinput_device_get_seat (libinput_device);
@@ -776,21 +760,21 @@ evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
seat = priv->main_seat;
else
{
- seat = clutter_seat_evdev_new (manager_evdev);
+ seat = meta_seat_native_new (manager_evdev);
priv->seats = g_slist_append (priv->seats, seat);
}
- clutter_seat_evdev_set_libinput_seat (seat, libinput_seat);
+ meta_seat_native_set_libinput_seat (seat, libinput_seat);
}
- device = _clutter_input_device_evdev_new (manager, seat, libinput_device);
+ device = meta_input_device_native_new (manager, seat, libinput_device);
_clutter_input_device_set_stage (device, manager_evdev->priv->stage);
_clutter_device_manager_add_device (manager, device);
/* Clutter assumes that device types are exclusive in the
* ClutterInputDevice API */
- type = _clutter_input_device_evdev_determine_type (libinput_device);
+ type = meta_input_device_native_determine_type (libinput_device);
if (type == CLUTTER_KEYBOARD_DEVICE)
{
@@ -802,15 +786,11 @@ evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
_clutter_input_device_set_associated_device (device, seat->core_pointer);
_clutter_input_device_add_slave (seat->core_pointer, device);
}
-
- CLUTTER_NOTE (EVENT, "Added physical device '%s', type %s",
- clutter_input_device_get_device_name (device),
- device_type_str[type]);
}
static void
-evdev_remove_device (ClutterDeviceManagerEvdev *manager_evdev,
- ClutterInputDeviceEvdev *device_evdev)
+evdev_remove_device (MetaDeviceManagerNative *manager_evdev,
+ MetaInputDeviceNative *device_evdev)
{
ClutterDeviceManager *manager = CLUTTER_DEVICE_MANAGER (manager_evdev);
ClutterInputDevice *input_device = CLUTTER_INPUT_DEVICE (device_evdev);
@@ -823,35 +803,35 @@ evdev_remove_device (ClutterDeviceManagerEvdev *manager_evdev,
*/
static void
-clutter_device_manager_evdev_add_device (ClutterDeviceManager *manager,
- ClutterInputDevice *device)
+meta_device_manager_native_add_device (ClutterDeviceManager *manager,
+ ClutterInputDevice *device)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
priv = manager_evdev->priv;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
+ seat = meta_input_device_native_get_seat (device_evdev);
seat->devices = g_slist_prepend (seat->devices, device);
priv->devices = g_slist_prepend (priv->devices, device);
}
static void
-clutter_device_manager_evdev_remove_device (ClutterDeviceManager *manager,
- ClutterInputDevice *device)
+meta_device_manager_native_remove_device (ClutterDeviceManager *manager,
+ ClutterInputDevice *device)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
+ seat = meta_input_device_native_get_seat (device_evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
priv = manager_evdev->priv;
/* Remove the device */
@@ -859,25 +839,25 @@ clutter_device_manager_evdev_remove_device (ClutterDeviceManager *manager,
priv->devices = g_slist_remove (priv->devices, device);
if (seat->repeat_timer && seat->repeat_device == device)
- clutter_seat_evdev_clear_repeat_timer (seat);
+ meta_seat_native_clear_repeat_timer (seat);
g_object_unref (device);
}
static const GSList *
-clutter_device_manager_evdev_get_devices (ClutterDeviceManager *manager)
+meta_device_manager_native_get_devices (ClutterDeviceManager *manager)
{
- return CLUTTER_DEVICE_MANAGER_EVDEV (manager)->priv->devices;
+ return META_DEVICE_MANAGER_NATIVE (manager)->priv->devices;
}
static ClutterInputDevice *
-clutter_device_manager_evdev_get_core_device (ClutterDeviceManager *manager,
- ClutterInputDeviceType type)
+meta_device_manager_native_get_core_device (ClutterDeviceManager *manager,
+ ClutterInputDeviceType type)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
priv = manager_evdev->priv;
switch (type)
@@ -897,20 +877,20 @@ clutter_device_manager_evdev_get_core_device (ClutterDeviceManager *manager,
}
static ClutterInputDevice *
-clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
- gint id)
+meta_device_manager_native_get_device (ClutterDeviceManager *manager,
+ gint id)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
GSList *l;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
priv = manager_evdev->priv;
for (l = priv->seats; l; l = l->next)
{
- ClutterSeatEvdev *seat = l->data;
- ClutterInputDevice *device = clutter_seat_evdev_get_device (seat, id);
+ MetaSeatNative *seat = l->data;
+ ClutterInputDevice *device = meta_seat_native_get_device (seat, id);
if (device)
return device;
@@ -932,8 +912,8 @@ flush_event_queue (void)
}
static gboolean
-process_base_event (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_event *event)
+process_base_event (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_event *event)
{
ClutterInputDevice *device;
struct libinput_device *libinput_device;
@@ -957,7 +937,7 @@ process_base_event (ClutterDeviceManagerEvdev *manager_evdev,
device = libinput_device_get_user_data (libinput_device);
evdev_remove_device (manager_evdev,
- CLUTTER_INPUT_DEVICE_EVDEV (device));
+ META_INPUT_DEVICE_NATIVE (device));
break;
default:
@@ -1015,7 +995,7 @@ static void
input_device_update_tool (ClutterInputDevice *input_device,
struct libinput_tablet_tool *libinput_tool)
{
- ClutterInputDeviceEvdev *evdev_device = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
+ MetaInputDeviceNative *evdev_device = META_INPUT_DEVICE_NATIVE (input_device);
ClutterInputDeviceTool *tool = NULL;
ClutterInputDeviceToolType tool_type;
guint64 tool_serial;
@@ -1029,8 +1009,8 @@ input_device_update_tool (ClutterInputDevice *input_device,
if (!tool)
{
- tool = clutter_input_device_tool_evdev_new (libinput_tool,
- tool_serial, tool_type);
+ tool = meta_input_device_tool_native_new (libinput_tool,
+ tool_serial, tool_type);
clutter_input_device_add_tool (input_device, tool);
}
}
@@ -1067,7 +1047,7 @@ translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event,
if (libinput_tablet_tool_has_pressure (libinput_tool))
{
value = libinput_event_tablet_tool_get_pressure (tablet_event);
- value = clutter_input_device_tool_evdev_translate_pressure (tool, value);
+ value = meta_input_device_tool_native_translate_pressure (tool, value);
g_array_append_val (axes, value);
}
@@ -1106,16 +1086,16 @@ translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event,
return (gdouble *) g_array_free (axes, FALSE);
}
-static ClutterSeatEvdev *
+static MetaSeatNative *
seat_from_device (ClutterInputDevice *device)
{
- ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device);
- return _clutter_input_device_evdev_get_seat (device_evdev);
+ return meta_input_device_native_get_seat (device_evdev);
}
static void
-notify_continuous_axis (ClutterSeatEvdev *seat,
+notify_continuous_axis (MetaSeatNative *seat,
ClutterInputDevice *device,
uint64_t time_us,
ClutterScrollSource scroll_source,
@@ -1143,13 +1123,13 @@ notify_continuous_axis (ClutterSeatEvdev *seat,
finish_flags |= CLUTTER_SCROLL_FINISHED_VERTICAL;
}
- clutter_seat_evdev_notify_scroll_continuous (seat, device, time_us,
- dx, dy,
- scroll_source, finish_flags);
+ meta_seat_native_notify_scroll_continuous (seat, device, time_us,
+ dx, dy,
+ scroll_source, finish_flags);
}
static void
-notify_discrete_axis (ClutterSeatEvdev *seat,
+notify_discrete_axis (MetaSeatNative *seat,
ClutterInputDevice *device,
uint64_t time_us,
ClutterScrollSource scroll_source,
@@ -1170,15 +1150,15 @@ notify_discrete_axis (ClutterSeatEvdev *seat,
axis_event, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
}
- clutter_seat_evdev_notify_discrete_scroll (seat, device,
- time_us,
- discrete_dx, discrete_dy,
- scroll_source);
+ meta_seat_native_notify_discrete_scroll (seat, device,
+ time_us,
+ discrete_dx, discrete_dy,
+ scroll_source);
}
static void
-process_tablet_axis (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_event *event)
+process_tablet_axis (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_event *event)
{
struct libinput_device *libinput_device = libinput_event_get_device (event);
guint64 time;
@@ -1188,10 +1168,10 @@ process_tablet_axis (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *device;
struct libinput_event_tablet_tool *tablet_event =
libinput_event_get_tablet_tool_event (event);
- ClutterInputDeviceEvdev *evdev_device;
+ MetaInputDeviceNative *evdev_device;
device = libinput_device_get_user_data (libinput_device);
- evdev_device = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ evdev_device = META_INPUT_DEVICE_NATIVE (device);
stage = _clutter_input_device_get_stage (device);
if (!stage)
@@ -1224,13 +1204,13 @@ process_tablet_axis (ClutterDeviceManagerEvdev *manager_evdev,
}
static gboolean
-process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_event *event)
+process_device_event (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_event *event)
{
gboolean handled = TRUE;
struct libinput_device *libinput_device = libinput_event_get_device(event);
ClutterInputDevice *device;
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
switch (libinput_event_get_type (event))
{
@@ -1256,9 +1236,9 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
seat_key_count != 0))
break;
- clutter_seat_evdev_notify_key (seat_from_device (device),
- device,
- time_us, key, key_state, TRUE);
+ meta_seat_native_notify_key (seat_from_device (device),
+ device,
+ time_us, key, key_state, TRUE);
break;
}
@@ -1280,11 +1260,11 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
- clutter_seat_evdev_notify_relative_motion (seat_from_device (device),
- device,
- time_us,
- dx, dy,
- dx_unaccel, dy_unaccel);
+ meta_seat_native_notify_relative_motion (seat_from_device (device),
+ device,
+ time_us,
+ dx, dy,
+ dx_unaccel, dy_unaccel);
break;
}
@@ -1312,11 +1292,11 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
stage_height);
- clutter_seat_evdev_notify_absolute_motion (seat_from_device (device),
- device,
- time_us,
- x, y,
- NULL);
+ meta_seat_native_notify_absolute_motion (seat_from_device (device),
+ device,
+ time_us,
+ x, y,
+ NULL);
break;
}
@@ -1343,8 +1323,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
seat_button_count != 0))
break;
- clutter_seat_evdev_notify_button (seat_from_device (device), device,
- time_us, button, button_state);
+ meta_seat_native_notify_button (seat_from_device (device), device,
+ time_us, button, button_state);
break;
}
@@ -1354,11 +1334,11 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
enum libinput_pointer_axis_source source;
struct libinput_event_pointer *axis_event =
libinput_event_get_pointer_event (event);
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterScrollSource scroll_source;
device = libinput_device_get_user_data (libinput_device);
- seat = _clutter_input_device_evdev_get_seat (CLUTTER_INPUT_DEVICE_EVDEV (device));
+ seat = meta_input_device_native_get_seat (META_INPUT_DEVICE_NATIVE (device));
time_us = libinput_event_pointer_get_time_usec (axis_event);
source = libinput_event_pointer_get_axis_source (axis_event);
@@ -1391,15 +1371,15 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
guint64 time_us;
double x, y;
gfloat stage_width, stage_height;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterStage *stage;
- ClutterTouchState *touch_state;
+ MetaTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
+ seat = meta_input_device_native_get_seat (device_evdev);
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
@@ -1416,17 +1396,17 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
stage_height);
touch_state =
- clutter_input_device_evdev_acquire_touch_state (device_evdev,
- device_slot);
+ meta_input_device_native_acquire_touch_state (device_evdev,
+ device_slot);
touch_state->coords.x = x;
touch_state->coords.y = y;
- clutter_seat_evdev_notify_touch_event (seat, device,
- CLUTTER_TOUCH_BEGIN,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (seat, device,
+ CLUTTER_TOUCH_BEGIN,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
break;
}
@@ -1434,30 +1414,30 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
{
int device_slot;
guint64 time_us;
- ClutterSeatEvdev *seat;
- ClutterTouchState *touch_state;
+ MetaSeatNative *seat;
+ MetaTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
+ seat = meta_input_device_native_get_seat (device_evdev);
device_slot = libinput_event_touch_get_slot (touch_event);
time_us = libinput_event_touch_get_time_usec (touch_event);
touch_state =
- clutter_input_device_evdev_lookup_touch_state (device_evdev,
- device_slot);
+ meta_input_device_native_lookup_touch_state (device_evdev,
+ device_slot);
if (!touch_state)
break;
- clutter_seat_evdev_notify_touch_event (seat, device,
- CLUTTER_TOUCH_END, time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
- clutter_input_device_evdev_release_touch_state (device_evdev,
- touch_state);
+ meta_seat_native_notify_touch_event (seat, device,
+ CLUTTER_TOUCH_END, time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
+ meta_input_device_native_release_touch_state (device_evdev,
+ touch_state);
break;
}
@@ -1467,15 +1447,15 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
guint64 time_us;
double x, y;
gfloat stage_width, stage_height;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterStage *stage;
- ClutterTouchState *touch_state;
+ MetaTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
+ seat = meta_input_device_native_get_seat (device_evdev);
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
@@ -1492,20 +1472,20 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
stage_height);
touch_state =
- clutter_input_device_evdev_lookup_touch_state (device_evdev,
- device_slot);
+ meta_input_device_native_lookup_touch_state (device_evdev,
+ device_slot);
if (!touch_state)
break;
touch_state->coords.x = x;
touch_state->coords.y = y;
- clutter_seat_evdev_notify_touch_event (seat, device,
- CLUTTER_TOUCH_UPDATE,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (seat, device,
+ CLUTTER_TOUCH_UPDATE,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
break;
}
case LIBINPUT_EVENT_TOUCH_CANCEL:
@@ -1515,10 +1495,10 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
time_us = libinput_event_touch_get_time_usec (touch_event);
- clutter_input_device_evdev_release_touch_slots (device_evdev, time_us);
+ meta_input_device_native_release_touch_slots (device_evdev, time_us);
break;
}
@@ -1648,8 +1628,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
button_state = libinput_event_tablet_tool_get_button_state (tablet_event) ==
LIBINPUT_BUTTON_STATE_PRESSED;
- clutter_seat_evdev_notify_button (seat_from_device (device), device,
- time_us, tablet_button, button_state);
+ meta_seat_native_notify_button (seat_from_device (device), device,
+ time_us, tablet_button, button_state);
break;
}
case LIBINPUT_EVENT_TABLET_TOOL_TIP:
@@ -1670,8 +1650,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
if (button_state)
process_tablet_axis (manager_evdev, event);
- clutter_seat_evdev_notify_button (seat_from_device (device), device,
- time_us, BTN_TOUCH, button_state);
+ meta_seat_native_notify_button (seat_from_device (device), device,
+ time_us, BTN_TOUCH, button_state);
if (!button_state)
process_tablet_axis (manager_evdev, event);
break;
@@ -1749,11 +1729,11 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
}
static gboolean
-filter_event (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_event *event)
+filter_event (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_event *event)
{
gboolean retval = CLUTTER_EVENT_PROPAGATE;
- ClutterEventFilter *filter;
+ MetaEventFilter *filter;
GSList *tmp_list;
tmp_list = manager_evdev->priv->event_filters;
@@ -1772,8 +1752,8 @@ filter_event (ClutterDeviceManagerEvdev *manager_evdev,
}
static void
-process_event (ClutterDeviceManagerEvdev *manager_evdev,
- struct libinput_event *event)
+process_event (MetaDeviceManagerNative *manager_evdev,
+ struct libinput_event *event)
{
gboolean retval;
@@ -1789,9 +1769,9 @@ process_event (ClutterDeviceManagerEvdev *manager_evdev,
}
static void
-process_events (ClutterDeviceManagerEvdev *manager_evdev)
+process_events (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
struct libinput_event *event;
while ((event = libinput_get_event (priv->libinput)))
@@ -1848,14 +1828,14 @@ static const struct libinput_interface libinput_interface = {
};
static ClutterVirtualInputDevice *
-clutter_device_manager_evdev_create_virtual_device (ClutterDeviceManager *manager,
- ClutterInputDeviceType device_type)
+meta_device_manager_native_create_virtual_device (ClutterDeviceManager *manager,
+ ClutterInputDeviceType device_type)
{
- ClutterDeviceManagerEvdev *manager_evdev =
- CLUTTER_DEVICE_MANAGER_EVDEV (manager);
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNative *manager_evdev =
+ META_DEVICE_MANAGER_NATIVE (manager);
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
- return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV,
+ return g_object_new (META_TYPE_VIRTUAL_INPUT_DEVICE_NATIVE,
"device-manager", manager,
"seat", priv->main_seat,
"device-type", device_type,
@@ -1863,7 +1843,7 @@ clutter_device_manager_evdev_create_virtual_device (ClutterDeviceManager *manag
}
static ClutterVirtualDeviceType
-clutter_device_manager_evdev_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
+meta_device_manager_native_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
{
return (CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD |
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER |
@@ -1871,40 +1851,40 @@ clutter_device_manager_evdev_get_supported_virtual_device_types (ClutterDeviceMa
}
static void
-clutter_device_manager_evdev_compress_motion (ClutterDeviceManager *device_manger,
- ClutterEvent *event,
- const ClutterEvent *to_discard)
+meta_device_manager_native_compress_motion (ClutterDeviceManager *device_manger,
+ ClutterEvent *event,
+ const ClutterEvent *to_discard)
{
double dx, dy;
double dx_unaccel, dy_unaccel;
double dst_dx = 0.0, dst_dy = 0.0;
double dst_dx_unaccel = 0.0, dst_dy_unaccel = 0.0;
- if (!clutter_evdev_event_get_relative_motion (to_discard,
- &dx, &dy,
- &dx_unaccel, &dy_unaccel))
+ if (!meta_event_native_get_relative_motion (to_discard,
+ &dx, &dy,
+ &dx_unaccel, &dy_unaccel))
return;
- clutter_evdev_event_get_relative_motion (event,
- &dst_dx, &dst_dy,
- &dst_dx_unaccel, &dst_dy_unaccel);
- _clutter_evdev_event_set_relative_motion (event,
- dx + dst_dx,
- dy + dst_dy,
- dx_unaccel + dst_dx_unaccel,
- dy_unaccel + dst_dy_unaccel);
+ meta_event_native_get_relative_motion (event,
+ &dst_dx, &dst_dy,
+ &dst_dx_unaccel, &dst_dy_unaccel);
+ meta_event_native_set_relative_motion (event,
+ dx + dst_dx,
+ dy + dst_dy,
+ dx_unaccel + dst_dx_unaccel,
+ dy_unaccel + dst_dy_unaccel);
}
static void
-clutter_device_manager_evdev_apply_kbd_a11y_settings (ClutterDeviceManager *device_manager,
- ClutterKbdA11ySettings *settings)
+meta_device_manager_native_apply_kbd_a11y_settings (ClutterDeviceManager *device_manager,
+ ClutterKbdA11ySettings *settings)
{
ClutterInputDevice *device;
- device = clutter_device_manager_evdev_get_core_device (device_manager, CLUTTER_KEYBOARD_DEVICE);
+ device = meta_device_manager_native_get_core_device (device_manager, CLUTTER_KEYBOARD_DEVICE);
if (device)
- clutter_input_device_evdev_apply_kbd_a11y_settings (CLUTTER_INPUT_DEVICE_EVDEV (device),
- settings);
+ meta_input_device_native_apply_kbd_a11y_settings (META_INPUT_DEVICE_NATIVE (device),
+ settings);
}
/*
@@ -1912,11 +1892,11 @@ clutter_device_manager_evdev_apply_kbd_a11y_settings (ClutterDeviceManager *de
*/
static void
-clutter_device_manager_evdev_constructed (GObject *gobject)
+meta_device_manager_native_constructed (GObject *gobject)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
- ClutterEventSource *source;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
+ MetaEventSource *source;
struct udev *udev;
udev = udev_new ();
@@ -1926,7 +1906,7 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
return;
}
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (gobject);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (gobject);
priv = manager_evdev->priv;
priv->libinput = libinput_udev_create_context (&libinput_interface,
@@ -1949,22 +1929,22 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
udev_unref (udev);
- priv->main_seat = clutter_seat_evdev_new (manager_evdev);
+ priv->main_seat = meta_seat_native_new (manager_evdev);
priv->seats = g_slist_append (priv->seats, priv->main_seat);
dispatch_libinput (manager_evdev);
- source = clutter_event_source_new (manager_evdev);
+ source = meta_event_source_new (manager_evdev);
priv->event_source = source;
}
static void
-clutter_device_manager_evdev_dispose (GObject *object)
+meta_device_manager_native_dispose (GObject *object)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (object);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (object);
priv = manager_evdev->priv;
if (priv->stage_added_handler)
@@ -1987,23 +1967,23 @@ clutter_device_manager_evdev_dispose (GObject *object)
priv->stage_manager = NULL;
}
- G_OBJECT_CLASS (clutter_device_manager_evdev_parent_class)->dispose (object);
+ G_OBJECT_CLASS (meta_device_manager_native_parent_class)->dispose (object);
}
static void
-clutter_device_manager_evdev_finalize (GObject *object)
+meta_device_manager_native_finalize (GObject *object)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (object);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (object);
priv = manager_evdev->priv;
- g_slist_free_full (priv->seats, (GDestroyNotify) clutter_seat_evdev_free);
+ g_slist_free_full (priv->seats, (GDestroyNotify) meta_seat_native_free);
g_slist_free (priv->devices);
if (priv->event_source != NULL)
- clutter_event_source_free (priv->event_source);
+ meta_event_source_free (priv->event_source);
if (priv->constrain_data_notify != NULL)
priv->constrain_data_notify (priv->constrain_data);
@@ -2013,39 +1993,39 @@ clutter_device_manager_evdev_finalize (GObject *object)
g_list_free (priv->free_device_ids);
- G_OBJECT_CLASS (clutter_device_manager_evdev_parent_class)->finalize (object);
+ G_OBJECT_CLASS (meta_device_manager_native_parent_class)->finalize (object);
}
static void
-clutter_device_manager_evdev_class_init (ClutterDeviceManagerEvdevClass *klass)
+meta_device_manager_native_class_init (MetaDeviceManagerNativeClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterDeviceManagerClass *manager_class;
- gobject_class->constructed = clutter_device_manager_evdev_constructed;
- gobject_class->finalize = clutter_device_manager_evdev_finalize;
- gobject_class->dispose = clutter_device_manager_evdev_dispose;
+ gobject_class->constructed = meta_device_manager_native_constructed;
+ gobject_class->finalize = meta_device_manager_native_finalize;
+ gobject_class->dispose = meta_device_manager_native_dispose;
manager_class = CLUTTER_DEVICE_MANAGER_CLASS (klass);
- manager_class->add_device = clutter_device_manager_evdev_add_device;
- manager_class->remove_device = clutter_device_manager_evdev_remove_device;
- manager_class->get_devices = clutter_device_manager_evdev_get_devices;
- manager_class->get_core_device = clutter_device_manager_evdev_get_core_device;
- manager_class->get_device = clutter_device_manager_evdev_get_device;
- manager_class->create_virtual_device = clutter_device_manager_evdev_create_virtual_device;
- manager_class->get_supported_virtual_device_types =
clutter_device_manager_evdev_get_supported_virtual_device_types;
- manager_class->compress_motion = clutter_device_manager_evdev_compress_motion;
- manager_class->apply_kbd_a11y_settings = clutter_device_manager_evdev_apply_kbd_a11y_settings;
- manager_class->copy_event_data = clutter_device_manager_evdev_copy_event_data;
- manager_class->free_event_data = clutter_device_manager_evdev_free_event_data;
+ manager_class->add_device = meta_device_manager_native_add_device;
+ manager_class->remove_device = meta_device_manager_native_remove_device;
+ manager_class->get_devices = meta_device_manager_native_get_devices;
+ manager_class->get_core_device = meta_device_manager_native_get_core_device;
+ manager_class->get_device = meta_device_manager_native_get_device;
+ manager_class->create_virtual_device = meta_device_manager_native_create_virtual_device;
+ manager_class->get_supported_virtual_device_types =
meta_device_manager_native_get_supported_virtual_device_types;
+ manager_class->compress_motion = meta_device_manager_native_compress_motion;
+ manager_class->apply_kbd_a11y_settings = meta_device_manager_native_apply_kbd_a11y_settings;
+ manager_class->copy_event_data = meta_device_manager_native_copy_event_data;
+ manager_class->free_event_data = meta_device_manager_native_free_event_data;
}
static void
-clutter_device_manager_evdev_stage_added_cb (ClutterStageManager *manager,
- ClutterStage *stage,
- ClutterDeviceManagerEvdev *self)
+meta_device_manager_native_stage_added_cb (ClutterStageManager *manager,
+ ClutterStage *stage,
+ MetaDeviceManagerNative *self)
{
- ClutterDeviceManagerEvdevPrivate *priv = self->priv;
+ MetaDeviceManagerNativePrivate *priv = self->priv;
GSList *l;
/* NB: Currently we can only associate a single stage with all evdev
@@ -2060,9 +2040,9 @@ clutter_device_manager_evdev_stage_added_cb (ClutterStageManager *manager,
/* Set the stage of any devices that don't already have a stage */
for (l = priv->seats; l; l = l->next)
{
- ClutterSeatEvdev *seat = l->data;
+ MetaSeatNative *seat = l->data;
- clutter_seat_evdev_set_stage (seat, stage);
+ meta_seat_native_set_stage (seat, stage);
}
/* We only want to do this once so we can catch the default
@@ -2074,29 +2054,29 @@ clutter_device_manager_evdev_stage_added_cb (ClutterStageManager *manager,
}
static void
-clutter_device_manager_evdev_stage_removed_cb (ClutterStageManager *manager,
- ClutterStage *stage,
- ClutterDeviceManagerEvdev *self)
+meta_device_manager_native_stage_removed_cb (ClutterStageManager *manager,
+ ClutterStage *stage,
+ MetaDeviceManagerNative *self)
{
- ClutterDeviceManagerEvdevPrivate *priv = self->priv;
+ MetaDeviceManagerNativePrivate *priv = self->priv;
GSList *l;
/* Remove the stage of any input devices that were pointing to this
stage so we don't send events to invalid stages */
for (l = priv->seats; l; l = l->next)
{
- ClutterSeatEvdev *seat = l->data;
+ MetaSeatNative *seat = l->data;
- clutter_seat_evdev_set_stage (seat, NULL);
+ meta_seat_native_set_stage (seat, NULL);
}
}
static void
-clutter_device_manager_evdev_init (ClutterDeviceManagerEvdev *self)
+meta_device_manager_native_init (MetaDeviceManagerNative *self)
{
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNativePrivate *priv;
- priv = self->priv = clutter_device_manager_evdev_get_instance_private (self);
+ priv = self->priv = meta_device_manager_native_get_instance_private (self);
priv->stage_manager = clutter_stage_manager_get_default ();
g_object_ref (priv->stage_manager);
@@ -2111,38 +2091,21 @@ clutter_device_manager_evdev_init (ClutterDeviceManagerEvdev *self)
priv->stage_added_handler =
g_signal_connect (priv->stage_manager,
"stage-added",
- G_CALLBACK (clutter_device_manager_evdev_stage_added_cb),
+ G_CALLBACK (meta_device_manager_native_stage_added_cb),
self);
priv->stage_removed_handler =
g_signal_connect (priv->stage_manager,
"stage-removed",
- G_CALLBACK (clutter_device_manager_evdev_stage_removed_cb),
+ G_CALLBACK (meta_device_manager_native_stage_removed_cb),
self);
priv->device_id_next = INITIAL_DEVICE_ID;
}
-void
-_clutter_events_evdev_init (ClutterBackend *backend)
-{
- CLUTTER_NOTE (EVENT, "Initializing evdev backend");
-
- backend->keymap = g_object_new (CLUTTER_TYPE_KEYMAP_EVDEV, NULL);
- backend->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV,
- "backend", backend,
- NULL);
-}
-
-void
-_clutter_events_evdev_uninit (ClutterBackend *backend)
-{
- CLUTTER_NOTE (EVENT, "Uninitializing evdev backend");
-}
-
gint
-_clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev *manager_evdev)
+meta_device_manager_native_acquire_device_id (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
GList *first;
gint next_id;
@@ -2165,7 +2128,7 @@ _clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev *mana
}
void
-_clutter_device_manager_evdev_dispatch (ClutterDeviceManagerEvdev *manager_evdev)
+meta_device_manager_native_dispatch (MetaDeviceManagerNative *manager_evdev)
{
dispatch_libinput (manager_evdev);
}
@@ -2178,10 +2141,10 @@ compare_ids (gconstpointer a,
}
void
-_clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *manager_evdev,
- ClutterInputDevice *device)
+meta_device_manager_native_release_device_id (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *device)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
gint device_id;
device_id = clutter_input_device_get_device_id (device);
@@ -2191,20 +2154,20 @@ _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *mana
}
ClutterStage *
-_clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev)
+meta_device_manager_native_get_stage (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
return priv->stage;
}
/**
- * clutter_evdev_release_devices:
+ * meta_device_manager_native_release_devices:
*
* Releases all the evdev devices that Clutter is currently managing. This api
* is typically used when switching away from the Clutter application when
* switching tty. The devices can be reclaimed later with a call to
- * clutter_evdev_reclaim_devices().
+ * meta_device_manager_native_reclaim_devices().
*
* This function should only be called after clutter has been initialized.
*
@@ -2212,11 +2175,11 @@ _clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evde
* Stability: unstable
*/
void
-clutter_evdev_release_devices (void)
+meta_device_manager_native_release_devices (void)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
if (!manager)
{
@@ -2225,9 +2188,9 @@ clutter_evdev_release_devices (void)
return;
}
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (manager));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (manager));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
priv = manager_evdev->priv;
if (priv->released)
@@ -2245,18 +2208,18 @@ clutter_evdev_release_devices (void)
}
static void
-clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
+update_xkb_state (MetaDeviceManagerNative *manager_evdev)
{
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNativePrivate *priv;
GSList *iter;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
struct xkb_keymap *xkb_keymap;
ClutterKeymap *keymap;
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
- xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
+ xkb_keymap = meta_keymap_native_get_keyboard_map (META_KEYMAP_NATIVE (keymap));
priv = manager_evdev->priv;
@@ -2281,12 +2244,12 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
seat->num_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_NUM);
seat->scroll_lock_led = xkb_keymap_led_get_index (xkb_keymap, XKB_LED_NAME_SCROLL);
- clutter_seat_evdev_sync_leds (seat);
+ meta_seat_native_sync_leds (seat);
}
}
/**
- * clutter_evdev_reclaim_devices:
+ * meta_device_manager_native_reclaim_devices:
*
* This causes Clutter to re-probe for evdev devices. This is must only be
* called after a corresponding call to clutter_evdev_release_devices()
@@ -2300,12 +2263,12 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
* Stability: unstable
*/
void
-clutter_evdev_reclaim_devices (void)
+meta_device_manager_native_reclaim_devices (void)
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- ClutterDeviceManagerEvdev *manager_evdev =
- CLUTTER_DEVICE_MANAGER_EVDEV (manager);
- ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
+ MetaDeviceManagerNative *manager_evdev =
+ META_DEVICE_MANAGER_NATIVE (manager);
+ MetaDeviceManagerNativePrivate *priv = manager_evdev->priv;
if (!priv->released)
{
@@ -2315,14 +2278,14 @@ clutter_evdev_reclaim_devices (void)
}
libinput_resume (priv->libinput);
- clutter_evdev_update_xkb_state (manager_evdev);
+ update_xkb_state (manager_evdev);
process_events (manager_evdev);
priv->released = FALSE;
}
/**
- * clutter_evdev_set_device_callbacks: (skip)
+ * meta_device_manager_native_set_device_callbacks: (skip)
* @open_callback: the user replacement for open()
* @close_callback: the user replacement for close()
* @user_data: user data for @callback
@@ -2340,9 +2303,9 @@ clutter_evdev_reclaim_devices (void)
* Stability: unstable
*/
void
-clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
- ClutterCloseDeviceCallback close_callback,
- gpointer user_data)
+meta_device_manager_native_set_device_callbacks (MetaOpenDeviceCallback open_callback,
+ MetaCloseDeviceCallback close_callback,
+ gpointer user_data)
{
device_open_callback = open_callback;
device_close_callback = close_callback;
@@ -2350,7 +2313,7 @@ clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
}
/**
- * clutter_evdev_set_keyboard_map: (skip)
+ * meta_device_manager_native_set_keyboard_map: (skip)
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @keymap: the new keymap
*
@@ -2363,24 +2326,24 @@ clutter_evdev_set_device_callbacks (ClutterOpenDeviceCallback open_callback,
* Stability: unstable
*/
void
-clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
- struct xkb_keymap *xkb_keymap)
+meta_device_manager_native_set_keyboard_map (ClutterDeviceManager *evdev,
+ struct xkb_keymap *xkb_keymap)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
ClutterKeymap *keymap;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
- clutter_keymap_evdev_set_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap),
- xkb_keymap);
+ meta_keymap_native_set_keyboard_map (META_KEYMAP_NATIVE (keymap),
+ xkb_keymap);
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
- clutter_evdev_update_xkb_state (manager_evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
+ update_xkb_state (manager_evdev);
}
/**
- * clutter_evdev_get_keyboard_map: (skip)
+ * meta_device_manager_native_get_keyboard_map: (skip)
* @evdev: the #ClutterDeviceManager created by the evdev backend
*
* Retrieves the #xkb_keymap in use by the evdev backend.
@@ -2391,19 +2354,19 @@ clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
* Stability: unstable
*/
struct xkb_keymap *
-clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev)
+meta_device_manager_native_get_keyboard_map (ClutterDeviceManager *evdev)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
- g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev), NULL);
+ g_return_val_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev), NULL);
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
return xkb_state_get_keymap (manager_evdev->priv->main_seat->xkb);
}
/**
- * clutter_evdev_set_keyboard_layout_index: (skip)
+ * meta_device_manager_set_keyboard_layout_index: (skip)
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @idx: the xkb layout index to set
*
@@ -2413,19 +2376,19 @@ clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev)
* Stability: unstable
*/
void
-clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
- xkb_layout_index_t idx)
+meta_device_manager_native_set_keyboard_layout_index (ClutterDeviceManager *evdev,
+ xkb_layout_index_t idx)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
struct xkb_state *state;
GSList *l;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
state = manager_evdev->priv->main_seat->xkb;
depressed_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_DEPRESSED);
@@ -2435,7 +2398,7 @@ clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx);
for (l = manager_evdev->priv->seats; l; l = l->next)
{
- ClutterSeatEvdev *seat = l->data;
+ MetaSeatNative *seat = l->data;
seat->layout_idx = idx;
}
@@ -2445,16 +2408,16 @@ clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
* clutter_evdev_get_keyboard_layout_index: (skip)
*/
xkb_layout_index_t
-clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev)
+meta_device_manager_native_get_keyboard_layout_index (ClutterDeviceManager *evdev)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
return manager_evdev->priv->main_seat->layout_idx;
}
/**
- * clutter_evdev_set_keyboard_numlock: (skip)
+ * meta_device_manager_native_set_keyboard_numlock: (skip)
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @numlock_set: TRUE to set NumLock ON, FALSE otherwise.
*
@@ -2463,29 +2426,29 @@ clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev)
* Stability: unstable
*/
void
-clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
- gboolean numlock_state)
+meta_device_manager_native_set_keyboard_numlock (ClutterDeviceManager *evdev,
+ gboolean numlock_state)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
GSList *iter;
xkb_mod_mask_t numlock;
struct xkb_keymap *xkb_keymap;
ClutterKeymap *keymap;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
priv = manager_evdev->priv;
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
- xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
+ xkb_keymap = meta_keymap_native_get_keyboard_map (META_KEYMAP_NATIVE (keymap));
numlock = (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2"));
for (iter = priv->seats; iter; iter = iter->next)
{
- ClutterSeatEvdev *seat = iter->data;
+ MetaSeatNative *seat = iter->data;
xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
@@ -2508,13 +2471,13 @@ clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
0, 0,
group_mods);
- clutter_seat_evdev_sync_leds (seat);
+ meta_seat_native_sync_leds (seat);
}
}
/**
- * clutter_evdev_set_pointer_constrain_callback:
+ * meta_device_manager_native_set_pointer_constrain_callback:
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @callback: the callback
* @user_data: data to pass to the callback
@@ -2528,17 +2491,17 @@ clutter_evdev_set_keyboard_numlock (ClutterDeviceManager *evdev,
* Stability: unstable
*/
void
-clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager *evdev,
- ClutterPointerConstrainCallback callback,
- gpointer user_data,
- GDestroyNotify user_data_notify)
+meta_device_manager_native_set_pointer_constrain_callback (ClutterDeviceManager *evdev,
+ MetaPointerConstrainCallback callback,
+ gpointer user_data,
+ GDestroyNotify user_data_notify)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
priv = manager_evdev->priv;
if (priv->constrain_data_notify)
@@ -2550,16 +2513,16 @@ clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager *e
}
void
-clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
- ClutterRelativeMotionFilter filter,
- gpointer user_data)
+meta_device_manager_native_set_relative_motion_filter (ClutterDeviceManager *evdev,
+ MetaRelativeMotionFilter filter,
+ gpointer user_data)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterDeviceManagerEvdevPrivate *priv;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaDeviceManagerNativePrivate *priv;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
priv = manager_evdev->priv;
priv->relative_motion_filter = filter;
@@ -2567,7 +2530,7 @@ clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
}
/**
- * clutter_evdev_set_keyboard_repeat:
+ * meta_device_manager_native_set_keyboard_repeat:
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @repeat: whether to enable or disable keyboard repeat events
* @delay: the delay in ms between the hardware key press event and
@@ -2582,17 +2545,17 @@ clutter_evdev_set_relative_motion_filter (ClutterDeviceManager *evdev,
* Stability: unstable
*/
void
-clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
- gboolean repeat,
- guint32 delay,
- guint32 interval)
+meta_device_manager_native_set_keyboard_repeat (ClutterDeviceManager *evdev,
+ gboolean repeat,
+ guint32 delay,
+ guint32 interval)
{
- ClutterDeviceManagerEvdev *manager_evdev;
- ClutterSeatEvdev *seat;
+ MetaDeviceManagerNative *manager_evdev;
+ MetaSeatNative *seat;
- g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+ g_return_if_fail (META_IS_DEVICE_MANAGER_NATIVE (evdev));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (evdev);
seat = manager_evdev->priv->main_seat;
seat->repeat = repeat;
@@ -2601,7 +2564,7 @@ clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
}
/**
- * clutter_evdev_add_filter: (skip)
+ * meta_device_manager_native_add_filter: (skip)
* @func: (closure data): a filter function
* @data: (allow-none): user data to be passed to the filter function, or %NULL
* @destroy_notify: (allow-none): function to call on @data when the filter is removed, or %NULL
@@ -2612,27 +2575,27 @@ clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
* Stability: unstable
*/
void
-clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
- gpointer data,
- GDestroyNotify destroy_notify)
+meta_device_manager_native_add_filter (MetaEvdevFilterFunc func,
+ gpointer data,
+ GDestroyNotify destroy_notify)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
ClutterDeviceManager *manager;
- ClutterEventFilter *filter;
+ MetaEventFilter *filter;
g_return_if_fail (func != NULL);
manager = clutter_device_manager_get_default ();
- if (!CLUTTER_IS_DEVICE_MANAGER_EVDEV (manager))
+ if (!META_IS_DEVICE_MANAGER_NATIVE (manager))
{
g_critical ("The Clutter input backend is not a evdev backend");
return;
}
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
- filter = g_new0 (ClutterEventFilter, 1);
+ filter = g_new0 (MetaEventFilter, 1);
filter->func = func;
filter->data = data;
filter->destroy_notify = destroy_notify;
@@ -2642,7 +2605,7 @@ clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
}
/**
- * clutter_evdev_remove_filter: (skip)
+ * meta_device_manager_native_remove_filter: (skip)
* @func: a filter function
* @data: (allow-none): user data to be passed to the filter function, or %NULL
*
@@ -2652,25 +2615,25 @@ clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
* Stability: unstable
*/
void
-clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
- gpointer data)
+meta_device_manager_native_remove_filter (MetaEvdevFilterFunc func,
+ gpointer data)
{
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
ClutterDeviceManager *manager;
- ClutterEventFilter *filter;
+ MetaEventFilter *filter;
GSList *tmp_list;
g_return_if_fail (func != NULL);
manager = clutter_device_manager_get_default ();
- if (!CLUTTER_IS_DEVICE_MANAGER_EVDEV (manager))
+ if (!META_IS_DEVICE_MANAGER_NATIVE (manager))
{
g_critical ("The Clutter input backend is not a evdev backend");
return;
}
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
tmp_list = manager_evdev->priv->event_filters;
while (tmp_list)
@@ -2692,7 +2655,7 @@ clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
}
/**
- * clutter_evdev_warp_pointer:
+ * meta_device_manager_native_warp_pointer:
* @pointer_device: the pointer device to warp
* @time: the timestamp for the warp event
* @x: the new X position of the pointer
@@ -2710,16 +2673,16 @@ clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
* Stability: unstable
*/
void
-clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
- guint32 time_,
- int x,
- int y)
+meta_device_manager_native_warp_pointer (ClutterInputDevice *pointer_device,
+ guint32 time_,
+ int x,
+ int y)
{
notify_absolute_motion (pointer_device, ms2us(time_), x, y, NULL);
}
/**
- * clutter_evdev_set_seat_id:
+ * meta_device_manager_native_set_seat_id:
* @seat_id: The seat ID
*
* Sets the seat to assign to the libinput context.
@@ -2727,14 +2690,14 @@ clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
* For reliable effects, this function must be called before clutter_init().
*/
void
-clutter_evdev_set_seat_id (const gchar *seat_id)
+meta_device_manager_native_set_seat_id (const gchar *seat_id)
{
g_free (evdev_seat_id);
evdev_seat_id = g_strdup (seat_id);
}
struct xkb_state *
-_clutter_device_manager_evdev_get_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
+meta_device_manager_native_get_xkb_state (MetaDeviceManagerNative *manager_evdev)
{
return manager_evdev->priv->main_seat->xkb;
}
diff --git a/src/backends/native/meta-device-manager-native.h
b/src/backends/native/meta-device-manager-native.h
new file mode 100644
index 000000000..132a6f341
--- /dev/null
+++ b/src/backends/native/meta-device-manager-native.h
@@ -0,0 +1,207 @@
+/*
+ * Copyright (C) 2010 Intel Corp.
+ *
+ * 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>
+ */
+
+#ifndef META_DEVICE_MANAGER_NATIVE_H
+#define META_DEVICE_MANAGER_NATIVE_H
+
+#include <clutter/clutter-mutter.h>
+#include <libinput.h>
+#include <xkbcommon/xkbcommon.h>
+
+#define META_TYPE_DEVICE_MANAGER_NATIVE (meta_device_manager_native_get_type ())
+#define META_DEVICE_MANAGER_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
META_TYPE_DEVICE_MANAGER_NATIVE, MetaDeviceManagerNative))
+#define META_IS_DEVICE_MANAGER_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
META_TYPE_DEVICE_MANAGER_NATIVE))
+#define META_DEVICE_MANAGER_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
META_TYPE_DEVICE_MANAGER_NATIVE, MetaDeviceManagerNativeClass))
+#define META_IS_DEVICE_MANAGER_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
META_TYPE_DEVICE_MANAGER_NATIVE))
+#define META_DEVICE_MANAGER_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
META_TYPE_DEVICE_MANAGER_NATIVE, MetaDeviceManagerNativeClass))
+
+typedef struct _MetaDeviceManagerNative MetaDeviceManagerNative;
+typedef struct _MetaDeviceManagerNativeClass MetaDeviceManagerNativeClass;
+typedef struct _MetaDeviceManagerNativePrivate MetaDeviceManagerNativePrivate;
+
+struct _MetaDeviceManagerNative
+{
+ ClutterDeviceManager parent_instance;
+
+ MetaDeviceManagerNativePrivate *priv;
+};
+
+struct _MetaDeviceManagerNativeClass
+{
+ ClutterDeviceManagerClass parent_class;
+};
+
+GType meta_device_manager_native_get_type (void) G_GNUC_CONST;
+
+gint meta_device_manager_native_acquire_device_id (MetaDeviceManagerNative *manager_evdev);
+
+void meta_device_manager_native_release_device_id (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *device);
+
+ClutterStage * meta_device_manager_native_get_stage (MetaDeviceManagerNative *manager_evdev);
+
+void meta_device_manager_native_constrain_pointer (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *core_pointer,
+ uint64_t time_us,
+ float x,
+ float y,
+ float *new_x,
+ float *new_y);
+
+void meta_device_manager_native_filter_relative_motion (MetaDeviceManagerNative *manager_evdev,
+ ClutterInputDevice *device,
+ float x,
+ float y,
+ float *dx,
+ float *dy);
+
+void meta_device_manager_native_dispatch (MetaDeviceManagerNative *manager_evdev);
+
+struct xkb_state * meta_device_manager_native_get_xkb_state (MetaDeviceManagerNative *manager_evdev);
+
+static inline guint64
+us (guint64 us)
+{
+ return us;
+}
+
+static inline guint64
+ms2us (guint64 ms)
+{
+ return us (ms * 1000);
+}
+
+static inline guint32
+us2ms (guint64 us)
+{
+ return (guint32) (us / 1000);
+}
+
+/**
+ * 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);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_device_callbacks (MetaOpenDeviceCallback open_callback,
+ MetaCloseDeviceCallback close_callback,
+ gpointer user_data);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_seat_id (const gchar *seat_id);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_release_devices (void);
+CLUTTER_EXPORT
+void meta_device_manager_native_reclaim_devices (void);
+
+/**
+ * MetaPointerConstrainCallback:
+ * @device: the core pointer device
+ * @time: the event time in milliseconds
+ * @x: (inout): the new X coordinate
+ * @y: (inout): the new Y coordinate
+ * @user_data: user data passed to this function
+ *
+ * This callback will be called for all pointer motion events, and should
+ * update (@x, @y) to constrain the pointer position appropriately.
+ * The subsequent motion event will use the updated values as the new coordinates.
+ * Note that the coordinates are not clamped to the stage size, and the callback
+ * must make sure that this happens before it returns.
+ * Also note that the event will be emitted even if the pointer is constrained
+ * to be in the same position.
+ *
+ * Since: 1.16
+ */
+typedef void (* MetaPointerConstrainCallback) (ClutterInputDevice *device,
+ guint32 time,
+ float prev_x,
+ float prev_y,
+ float *x,
+ float *y,
+ gpointer user_data);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_pointer_constrain_callback (ClutterDeviceManager *evdev,
+ MetaPointerConstrainCallback callback,
+ gpointer user_data,
+ GDestroyNotify
user_data_notify);
+
+typedef void (* MetaRelativeMotionFilter) (ClutterInputDevice *device,
+ float x,
+ float y,
+ float *dx,
+ float *dy,
+ gpointer user_data);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_relative_motion_filter (ClutterDeviceManager *evdev,
+ MetaRelativeMotionFilter filter,
+ gpointer user_data);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_keyboard_map (ClutterDeviceManager *evdev,
+ struct xkb_keymap *keymap);
+
+CLUTTER_EXPORT
+struct xkb_keymap * meta_device_manager_native_get_keyboard_map (ClutterDeviceManager *evdev);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_keyboard_layout_index (ClutterDeviceManager *evdev,
+ xkb_layout_index_t idx);
+
+CLUTTER_EXPORT
+xkb_layout_index_t meta_device_manager_native_get_keyboard_layout_index (ClutterDeviceManager *evdev);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_keyboard_numlock (ClutterDeviceManager *evdev,
+ gboolean numlock_state);
+
+CLUTTER_EXPORT
+void meta_device_manager_native_set_keyboard_repeat (ClutterDeviceManager *evdev,
+ gboolean repeat,
+ guint32 delay,
+ guint32 interval);
+
+typedef gboolean (* MetaEvdevFilterFunc) (struct libinput_event *event,
+ gpointer data);
+
+void meta_device_manager_native_add_filter (MetaEvdevFilterFunc func,
+ gpointer data,
+ GDestroyNotify destroy_notify);
+void meta_device_manager_native_remove_filter (MetaEvdevFilterFunc func,
+ gpointer data);
+
+void meta_device_manager_native_warp_pointer (ClutterInputDevice *pointer_device,
+ guint32 time_,
+ int x,
+ int y);
+
+#endif /* META_DEVICE_MANAGER_NATIVE_H */
diff --git a/src/backends/native/meta-event-native.c b/src/backends/native/meta-event-native.c
new file mode 100644
index 000000000..1dba490fb
--- /dev/null
+++ b/src/backends/native/meta-event-native.c
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2015 Red Hat
+ *
+ * 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/>.
+ *
+ * Authored by:
+ * Carlos Garnacho <carlosg gnome org>
+ */
+
+#include "config.h"
+
+#include <clutter/clutter-mutter.h>
+
+#include "backends/native/meta-event-native.h"
+#include "backends/native/meta-input-device-native.h"
+
+typedef struct _MetaEventNative MetaEventNative;
+
+struct _MetaEventNative
+{
+ guint32 evcode;
+
+ guint64 time_usec;
+
+ gboolean has_relative_motion;
+ double dx;
+ double dy;
+ double dx_unaccel;
+ double dy_unaccel;
+};
+
+static MetaEventNative *
+meta_event_native_new (void)
+{
+ return g_slice_new0 (MetaEventNative);
+}
+
+MetaEventNative *
+meta_event_native_copy (MetaEventNative *event_evdev)
+{
+ if (event_evdev != NULL)
+ return g_slice_dup (MetaEventNative, event_evdev);
+
+ return NULL;
+}
+
+void
+meta_event_native_free (MetaEventNative *event_evdev)
+{
+ if (event_evdev != NULL)
+ g_slice_free (MetaEventNative, event_evdev);
+}
+
+static MetaEventNative *
+meta_event_native_ensure_platform_data (ClutterEvent *event)
+{
+ MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
+
+ if (!event_evdev)
+ {
+ event_evdev = meta_event_native_new ();
+ _clutter_event_set_platform_data (event, event_evdev);
+ }
+
+ return event_evdev;
+}
+
+void
+meta_event_native_set_event_code (ClutterEvent *event,
+ guint32 evcode)
+{
+ MetaEventNative *event_evdev;
+
+ event_evdev = meta_event_native_ensure_platform_data (event);
+ event_evdev->evcode = evcode;
+}
+
+void
+meta_event_native_set_time_usec (ClutterEvent *event,
+ guint64 time_usec)
+{
+ MetaEventNative *event_evdev;
+
+ event_evdev = meta_event_native_ensure_platform_data (event);
+ event_evdev->time_usec = time_usec;
+}
+
+void
+meta_event_native_set_relative_motion (ClutterEvent *event,
+ double dx,
+ double dy,
+ double dx_unaccel,
+ double dy_unaccel)
+{
+ MetaEventNative *event_evdev;
+
+ event_evdev = meta_event_native_ensure_platform_data (event);
+ event_evdev->dx = dx;
+ event_evdev->dy = dy;
+ event_evdev->dx_unaccel = dx_unaccel;
+ event_evdev->dy_unaccel = dy_unaccel;
+ event_evdev->has_relative_motion = TRUE;
+}
+
+/**
+ * meta_event_native_get_event_code:
+ * @event: a #ClutterEvent
+ *
+ * Returns the event code of the original event. See linux/input.h for more
+ * information.
+ *
+ * Returns: The event code.
+ **/
+guint32
+meta_event_native_get_event_code (const ClutterEvent *event)
+{
+ MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
+
+ if (event_evdev)
+ return event_evdev->evcode;
+
+ return 0;
+}
+
+/**
+ * meta_event_native_get_time_usec:
+ * @event: a #ClutterEvent
+ *
+ * Returns the time in microsecond granularity, or 0 if unavailable.
+ *
+ * Returns: The time in microsecond granularity, or 0 if unavailable.
+ */
+guint64
+meta_event_native_get_time_usec (const ClutterEvent *event)
+{
+ MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
+
+ if (event_evdev)
+ return event_evdev->time_usec;
+
+ return 0;
+}
+
+/**
+ * meta_event_get_pointer_motion
+ * @event: a #ClutterEvent
+ *
+ * If available, the normal and unaccelerated motion deltas are written
+ * to the dx, dy, dx_unaccel and dy_unaccel and TRUE is returned.
+ *
+ * If unavailable, FALSE is returned.
+ *
+ * Returns: TRUE on success, otherwise FALSE.
+ **/
+gboolean
+meta_event_native_get_relative_motion (const ClutterEvent *event,
+ double *dx,
+ double *dy,
+ double *dx_unaccel,
+ double *dy_unaccel)
+{
+ MetaEventNative *event_evdev = _clutter_event_get_platform_data (event);
+
+ if (event_evdev && event_evdev->has_relative_motion)
+ {
+ if (dx)
+ *dx = event_evdev->dx;
+ if (dy)
+ *dy = event_evdev->dy;
+ if (dx_unaccel)
+ *dx_unaccel = event_evdev->dx_unaccel;
+ if (dy_unaccel)
+ *dy_unaccel = event_evdev->dy_unaccel;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/**
+ * meta_event_native_sequence_get_slot:
+ * @sequence: a #ClutterEventSequence
+ *
+ * Retrieves the touch slot triggered by this @sequence
+ *
+ * Returns: the libinput touch slot.
+ *
+ * Since: 1.20
+ * Stability: unstable
+ **/
+int32_t
+meta_event_native_sequence_get_slot (const ClutterEventSequence *sequence)
+{
+ if (!sequence)
+ return -1;
+
+ return GPOINTER_TO_INT (sequence) - 1;
+}
+
diff --git a/src/backends/native/meta-event-native.h b/src/backends/native/meta-event-native.h
new file mode 100644
index 000000000..f89a9dab9
--- /dev/null
+++ b/src/backends/native/meta-event-native.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015 Red Hat
+ *
+ * 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/>.
+ *
+ * Authored by:
+ * Carlos Garnacho <carlosg gnome org>
+ */
+
+#ifndef META_EVENT_NATIVE_H
+#define META_EVENT_NATIVE_H
+
+#include <clutter/clutter.h>
+
+typedef struct _MetaEventNative MetaEventNative;
+
+MetaEventNative * meta_event_native_copy (MetaEventNative *event_evdev);
+void meta_event_native_free (MetaEventNative *event_evdev);
+
+guint32 meta_event_native_get_event_code (const ClutterEvent *event);
+void meta_event_native_set_event_code (ClutterEvent *event,
+ guint32 evcode);
+guint64 meta_event_native_get_time_usec (const ClutterEvent *event);
+void meta_event_native_set_time_usec (ClutterEvent *event,
+ guint64 time_usec);
+void meta_event_native_set_relative_motion (ClutterEvent *event,
+ double dx,
+ double dy,
+ double dx_unaccel,
+ double dy_unaccel);
+gboolean meta_event_native_get_relative_motion (const ClutterEvent *event,
+ double *dx,
+ double *dy,
+ double *dx_unaccel,
+ double *dy_unaccel);
+
+int32_t meta_event_native_sequence_get_slot (const ClutterEventSequence *sequence);
+
+#endif /* META_EVENT_NATIVE_H */
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c
b/src/backends/native/meta-input-device-native.c
similarity index 73%
rename from clutter/clutter/evdev/clutter-input-device-evdev.c
rename to src/backends/native/meta-input-device-native.c
index f315bfb60..b2b71ee1c 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/src/backends/native/meta-input-device-native.c
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright (C) 2010 Intel Corp.
* Copyright (C) 2014 Jonas Ådahl
*
@@ -23,27 +19,19 @@
* Author: Jonas Ådahl <jadahl gmail com>
*/
-#include "clutter-build-config.h"
+#include "config.h"
#include <math.h>
+#include <clutter/clutter-mutter.h>
+#include <cairo-gobject.h>
-#include "clutter/clutter-device-manager-private.h"
-#include "clutter/clutter-event-private.h"
-#include "clutter-private.h"
-#include "clutter-evdev.h"
-#include "clutter-input-device-tool-evdev.h"
-
-#include "clutter-input-device-evdev.h"
-#include "clutter-device-manager-evdev.h"
-
-#include "cairo-gobject.h"
-
-typedef struct _ClutterInputDeviceClass ClutterInputDeviceEvdevClass;
+#include "backends/native/meta-input-device-tool-native.h"
+#include "backends/native/meta-input-device-native.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-seat-native.h"
-#define clutter_input_device_evdev_get_type _clutter_input_device_evdev_get_type
-
-G_DEFINE_TYPE (ClutterInputDeviceEvdev,
- clutter_input_device_evdev,
+G_DEFINE_TYPE (MetaInputDeviceNative,
+ meta_input_device_native,
CLUTTER_TYPE_INPUT_DEVICE)
enum
@@ -58,48 +46,48 @@ static GParamSpec *obj_props[N_PROPS] = { 0 };
typedef struct _SlowKeysEventPending
{
- ClutterInputDeviceEvdev *device;
+ MetaInputDeviceNative *device;
ClutterEvent *event;
ClutterEmitInputDeviceEvent emit_event_func;
guint timer;
} SlowKeysEventPending;
-static void clear_slow_keys (ClutterInputDeviceEvdev *device);
-static void stop_bounce_keys (ClutterInputDeviceEvdev *device);
-static void stop_toggle_slowkeys (ClutterInputDeviceEvdev *device);
-static void stop_mousekeys_move (ClutterInputDeviceEvdev *device);
+static void clear_slow_keys (MetaInputDeviceNative *device);
+static void stop_bounce_keys (MetaInputDeviceNative *device);
+static void stop_toggle_slowkeys (MetaInputDeviceNative *device);
+static void stop_mousekeys_move (MetaInputDeviceNative *device);
static void
-clutter_input_device_evdev_finalize (GObject *object)
+meta_input_device_native_finalize (GObject *object)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (object);
- ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (object);
- ClutterDeviceManagerEvdev *manager_evdev =
- CLUTTER_DEVICE_MANAGER_EVDEV (device->device_manager);
+ MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (object);
+ MetaDeviceManagerNative *manager_evdev =
+ META_DEVICE_MANAGER_NATIVE (device->device_manager);
if (device_evdev->libinput_device)
libinput_device_unref (device_evdev->libinput_device);
- clutter_input_device_evdev_release_touch_slots (device_evdev,
- g_get_monotonic_time ());
+ meta_input_device_native_release_touch_slots (device_evdev,
+ g_get_monotonic_time ());
- _clutter_device_manager_evdev_release_device_id (manager_evdev, device);
+ meta_device_manager_native_release_device_id (manager_evdev, device);
clear_slow_keys (device_evdev);
stop_bounce_keys (device_evdev);
stop_toggle_slowkeys (device_evdev);
stop_mousekeys_move (device_evdev);
- G_OBJECT_CLASS (clutter_input_device_evdev_parent_class)->finalize (object);
+ G_OBJECT_CLASS (meta_input_device_native_parent_class)->finalize (object);
}
static void
-clutter_input_device_evdev_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+meta_input_device_native_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- ClutterInputDeviceEvdev *device = CLUTTER_INPUT_DEVICE_EVDEV (object);
+ MetaInputDeviceNative *device = META_INPUT_DEVICE_NATIVE (object);
switch (prop_id)
{
@@ -120,12 +108,12 @@ clutter_input_device_evdev_set_property (GObject *object,
}
static void
-clutter_input_device_evdev_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+meta_input_device_native_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- ClutterInputDeviceEvdev *device = CLUTTER_INPUT_DEVICE_EVDEV (object);
+ MetaInputDeviceNative *device = META_INPUT_DEVICE_NATIVE (object);
switch (prop_id)
{
@@ -141,9 +129,9 @@ clutter_input_device_evdev_get_property (GObject *object,
}
static gboolean
-clutter_input_device_evdev_keycode_to_evdev (ClutterInputDevice *device,
- guint hardware_keycode,
- guint *evdev_keycode)
+meta_input_device_native_keycode_to_evdev (ClutterInputDevice *device,
+ guint hardware_keycode,
+ guint *evdev_keycode)
{
/* The hardware keycodes from the evdev backend are almost evdev
keycodes: we use the evdev keycode file, but xkb rules have an
@@ -154,12 +142,12 @@ clutter_input_device_evdev_keycode_to_evdev (ClutterInputDevice *device,
}
static void
-clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
- ClutterInputDeviceTool *tool)
+meta_input_device_native_update_from_tool (ClutterInputDevice *device,
+ ClutterInputDeviceTool *tool)
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
+ evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
g_object_freeze_notify (G_OBJECT (device));
@@ -193,47 +181,47 @@ clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
}
static gboolean
-clutter_input_device_evdev_is_mode_switch_button (ClutterInputDevice *device,
- guint group,
- guint button)
+meta_input_device_native_is_mode_switch_button (ClutterInputDevice *device,
+ guint group,
+ guint button)
{
struct libinput_device *libinput_device;
struct libinput_tablet_pad_mode_group *mode_group;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, group);
return libinput_tablet_pad_mode_group_button_is_toggle (mode_group, button) != 0;
}
static gint
-clutter_input_device_evdev_get_group_n_modes (ClutterInputDevice *device,
- gint group)
+meta_input_device_native_get_group_n_modes (ClutterInputDevice *device,
+ gint group)
{
struct libinput_device *libinput_device;
struct libinput_tablet_pad_mode_group *mode_group;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, group);
return libinput_tablet_pad_mode_group_get_num_modes (mode_group);
}
static gboolean
-clutter_input_device_evdev_is_grouped (ClutterInputDevice *device,
- ClutterInputDevice *other_device)
+meta_input_device_native_is_grouped (ClutterInputDevice *device,
+ ClutterInputDevice *other_device)
{
struct libinput_device *libinput_device, *other_libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
- other_libinput_device = clutter_evdev_input_device_get_libinput_device (other_device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
+ other_libinput_device = meta_input_device_native_get_libinput_device (other_device);
return libinput_device_get_device_group (libinput_device) ==
libinput_device_get_device_group (other_libinput_device);
}
static void
-clutter_input_device_evdev_bell_notify (void)
+meta_input_device_native_bell_notify (void)
{
ClutterBackend *backend;
@@ -242,7 +230,7 @@ clutter_input_device_evdev_bell_notify (void)
}
static void
-clutter_input_device_evdev_free_pending_slow_key (gpointer data)
+meta_input_device_native_free_pending_slow_key (gpointer data)
{
SlowKeysEventPending *slow_keys_event = data;
@@ -253,9 +241,9 @@ clutter_input_device_evdev_free_pending_slow_key (gpointer data)
}
static void
-clear_slow_keys (ClutterInputDeviceEvdev *device)
+clear_slow_keys (MetaInputDeviceNative *device)
{
- g_list_free_full (device->slow_keys_list, clutter_input_device_evdev_free_pending_slow_key);
+ g_list_free_full (device->slow_keys_list, meta_input_device_native_free_pending_slow_key);
g_list_free (device->slow_keys_list);
device->slow_keys_list = NULL;
}
@@ -275,7 +263,7 @@ static gboolean
trigger_slow_keys (gpointer data)
{
SlowKeysEventPending *slow_keys_event = data;
- ClutterInputDeviceEvdev *device = slow_keys_event->device;
+ MetaInputDeviceNative *device = slow_keys_event->device;
ClutterKeyEvent *key_event = (ClutterKeyEvent *) slow_keys_event->event;
/* Alter timestamp and emit the event */
@@ -285,10 +273,10 @@ trigger_slow_keys (gpointer data)
/* Then remote the pending event */
device->slow_keys_list = g_list_remove (device->slow_keys_list, slow_keys_event);
- clutter_input_device_evdev_free_pending_slow_key (slow_keys_event);
+ meta_input_device_native_free_pending_slow_key (slow_keys_event);
if (device->a11y_flags & CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
return G_SOURCE_REMOVE;
}
@@ -305,9 +293,9 @@ find_pending_event_by_keycode (gconstpointer a,
}
static void
-start_slow_keys (ClutterEvent *event,
- ClutterInputDeviceEvdev *device,
- ClutterEmitInputDeviceEvent emit_event_func)
+start_slow_keys (ClutterEvent *event,
+ MetaInputDeviceNative *device,
+ ClutterEmitInputDeviceEvent emit_event_func)
{
SlowKeysEventPending *slow_keys_event;
ClutterKeyEvent *key_event = (ClutterKeyEvent *) event;
@@ -326,13 +314,13 @@ start_slow_keys (ClutterEvent *event,
device->slow_keys_list = g_list_append (device->slow_keys_list, slow_keys_event);
if (device->a11y_flags & CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
}
static void
-stop_slow_keys (ClutterEvent *event,
- ClutterInputDeviceEvdev *device,
- ClutterEmitInputDeviceEvent emit_event_func)
+stop_slow_keys (ClutterEvent *event,
+ MetaInputDeviceNative *device,
+ ClutterEmitInputDeviceEvent emit_event_func)
{
GList *item;
@@ -343,10 +331,10 @@ stop_slow_keys (ClutterEvent *event,
SlowKeysEventPending *slow_keys_event = item->data;
device->slow_keys_list = g_list_delete_link (device->slow_keys_list, item);
- clutter_input_device_evdev_free_pending_slow_key (slow_keys_event);
+ meta_input_device_native_free_pending_slow_key (slow_keys_event);
if (device->a11y_flags & CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
return;
}
@@ -369,7 +357,7 @@ get_debounce_delay (ClutterInputDevice *device)
static gboolean
clear_bounce_keys (gpointer data)
{
- ClutterInputDeviceEvdev *device = data;
+ MetaInputDeviceNative *device = data;
device->debounce_key = 0;
device->debounce_timer = 0;
@@ -378,8 +366,8 @@ clear_bounce_keys (gpointer data)
}
static void
-start_bounce_keys (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+start_bounce_keys (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
stop_bounce_keys (device);
@@ -391,7 +379,7 @@ start_bounce_keys (ClutterEvent *event,
}
static void
-stop_bounce_keys (ClutterInputDeviceEvdev *device)
+stop_bounce_keys (MetaInputDeviceNative *device)
{
if (device->debounce_timer)
{
@@ -401,15 +389,15 @@ stop_bounce_keys (ClutterInputDeviceEvdev *device)
}
static void
-notify_bounce_keys_reject (ClutterInputDeviceEvdev *device)
+notify_bounce_keys_reject (MetaInputDeviceNative *device)
{
if (device->a11y_flags & CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
}
static gboolean
-debounce_key (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+debounce_key (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
return (device->debounce_key == ((ClutterKeyEvent *) event)->hardware_keycode);
}
@@ -440,7 +428,7 @@ key_event_is_modifier (ClutterEvent *event)
}
static void
-notify_stickykeys_mask (ClutterInputDeviceEvdev *device)
+notify_stickykeys_mask (MetaInputDeviceNative *device)
{
g_signal_emit_by_name (CLUTTER_INPUT_DEVICE (device)->device_manager,
"kbd-a11y-mods-state-changed",
@@ -449,11 +437,11 @@ notify_stickykeys_mask (ClutterInputDeviceEvdev *device)
}
static void
-update_internal_xkb_state (ClutterInputDeviceEvdev *device,
- xkb_mod_mask_t new_latched_mask,
- xkb_mod_mask_t new_locked_mask)
+update_internal_xkb_state (MetaInputDeviceNative *device,
+ xkb_mod_mask_t new_latched_mask,
+ xkb_mod_mask_t new_locked_mask)
{
- ClutterSeatEvdev *seat = device->seat;
+ MetaSeatNative *seat = device->seat;
xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
@@ -483,12 +471,12 @@ update_internal_xkb_state (ClutterInputDeviceEvdev *device,
}
static void
-update_stickykeys_event (ClutterEvent *event,
- ClutterInputDeviceEvdev *device,
- xkb_mod_mask_t new_latched_mask,
- xkb_mod_mask_t new_locked_mask)
+update_stickykeys_event (ClutterEvent *event,
+ MetaInputDeviceNative *device,
+ xkb_mod_mask_t new_latched_mask,
+ xkb_mod_mask_t new_locked_mask)
{
- ClutterSeatEvdev *seat = device->seat;
+ MetaSeatNative *seat = device->seat;
xkb_mod_mask_t effective_mods;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
@@ -508,7 +496,7 @@ update_stickykeys_event (ClutterEvent *event,
}
static void
-notify_stickykeys_change (ClutterInputDeviceEvdev *device)
+notify_stickykeys_change (MetaInputDeviceNative *device)
{
/* Everytime sticky keys setting is changed, clear the masks */
device->stickykeys_depressed_mask = 0;
@@ -521,29 +509,29 @@ notify_stickykeys_change (ClutterInputDeviceEvdev *device)
}
static void
-set_stickykeys_off (ClutterInputDeviceEvdev *device)
+set_stickykeys_off (MetaInputDeviceNative *device)
{
device->a11y_flags &= ~CLUTTER_A11Y_STICKY_KEYS_ENABLED;
notify_stickykeys_change (device);
}
static void
-set_stickykeys_on (ClutterInputDeviceEvdev *device)
+set_stickykeys_on (MetaInputDeviceNative *device)
{
device->a11y_flags |= CLUTTER_A11Y_STICKY_KEYS_ENABLED;
notify_stickykeys_change (device);
}
static void
-clear_stickykeys_event (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+clear_stickykeys_event (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
set_stickykeys_off (device);
update_stickykeys_event (event, device, 0, 0);
}
static void
-set_slowkeys_off (ClutterInputDeviceEvdev *device)
+set_slowkeys_off (MetaInputDeviceNative *device)
{
device->a11y_flags &= ~CLUTTER_A11Y_SLOW_KEYS_ENABLED;
@@ -554,7 +542,7 @@ set_slowkeys_off (ClutterInputDeviceEvdev *device)
}
static void
-set_slowkeys_on (ClutterInputDeviceEvdev *device)
+set_slowkeys_on (MetaInputDeviceNative *device)
{
device->a11y_flags |= CLUTTER_A11Y_SLOW_KEYS_ENABLED;
@@ -565,10 +553,10 @@ set_slowkeys_on (ClutterInputDeviceEvdev *device)
}
static void
-handle_stickykeys_press (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_stickykeys_press (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
- ClutterSeatEvdev *seat = device->seat;
+ MetaSeatNative *seat = device->seat;
xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t new_latched_mask;
xkb_mod_mask_t new_locked_mask;
@@ -613,10 +601,10 @@ handle_stickykeys_press (ClutterEvent *event,
}
static void
-handle_stickykeys_release (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_stickykeys_release (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
- ClutterSeatEvdev *seat = device->seat;
+ MetaSeatNative *seat = device->seat;
device->stickykeys_depressed_mask =
xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
@@ -624,7 +612,7 @@ handle_stickykeys_release (ClutterEvent *event,
if (key_event_is_modifier (event))
{
if (device->a11y_flags & CLUTTER_A11Y_STICKY_KEYS_BEEP)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
return;
}
@@ -638,12 +626,12 @@ handle_stickykeys_release (ClutterEvent *event,
static gboolean
trigger_toggle_slowkeys (gpointer data)
{
- ClutterInputDeviceEvdev *device = data;
+ MetaInputDeviceNative *device = data;
device->toggle_slowkeys_timer = 0;
if (device->a11y_flags & CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
if (device->a11y_flags & CLUTTER_A11Y_SLOW_KEYS_ENABLED)
set_slowkeys_off (device);
@@ -654,7 +642,7 @@ trigger_toggle_slowkeys (gpointer data)
}
static void
-start_toggle_slowkeys (ClutterInputDeviceEvdev *device)
+start_toggle_slowkeys (MetaInputDeviceNative *device)
{
if (device->toggle_slowkeys_timer != 0)
return;
@@ -666,7 +654,7 @@ start_toggle_slowkeys (ClutterInputDeviceEvdev *device)
}
static void
-stop_toggle_slowkeys (ClutterInputDeviceEvdev *device)
+stop_toggle_slowkeys (MetaInputDeviceNative *device)
{
if (device->toggle_slowkeys_timer)
{
@@ -676,8 +664,8 @@ stop_toggle_slowkeys (ClutterInputDeviceEvdev *device)
}
static void
-handle_enablekeys_press (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_enablekeys_press (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R)
{
@@ -698,8 +686,8 @@ handle_enablekeys_press (ClutterEvent *event,
}
static void
-handle_enablekeys_release (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_enablekeys_release (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
if (event->key.keyval == XKB_KEY_Shift_L || event->key.keyval == XKB_KEY_Shift_R)
{
@@ -709,7 +697,7 @@ handle_enablekeys_release (ClutterEvent *event,
device->shift_count = 0;
if (device->a11y_flags & CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
if (device->a11y_flags & CLUTTER_A11Y_STICKY_KEYS_ENABLED)
set_stickykeys_off (device);
@@ -739,7 +727,7 @@ get_button_index (gint button)
}
static void
-emulate_button_press (ClutterInputDeviceEvdev *device_evdev)
+emulate_button_press (MetaInputDeviceNative *device_evdev)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
gint btn = device_evdev->mousekeys_btn;
@@ -754,7 +742,7 @@ emulate_button_press (ClutterInputDeviceEvdev *device_evdev)
}
static void
-emulate_button_release (ClutterInputDeviceEvdev *device_evdev)
+emulate_button_release (MetaInputDeviceNative *device_evdev)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
gint btn = device_evdev->mousekeys_btn;
@@ -769,7 +757,7 @@ emulate_button_release (ClutterInputDeviceEvdev *device_evdev)
}
static void
-emulate_button_click (ClutterInputDeviceEvdev *device)
+emulate_button_click (MetaInputDeviceNative *device)
{
emulate_button_press (device);
emulate_button_release (device);
@@ -778,8 +766,8 @@ emulate_button_click (ClutterInputDeviceEvdev *device)
#define MOUSEKEYS_CURVE (1.0 + (((double) 50.0) * 0.001))
static void
-update_mousekeys_params (ClutterInputDeviceEvdev *device,
- ClutterKbdA11ySettings *settings)
+update_mousekeys_params (MetaInputDeviceNative *device,
+ ClutterKbdA11ySettings *settings)
{
/* Prevent us from broken settings values */
device->mousekeys_max_speed = MAX (1, settings->mousekeys_max_speed);
@@ -792,8 +780,8 @@ update_mousekeys_params (ClutterInputDeviceEvdev *device,
}
static gdouble
-mousekeys_get_speed_factor (ClutterInputDeviceEvdev *device,
- gint64 time_us)
+mousekeys_get_speed_factor (MetaInputDeviceNative *device,
+ gint64 time_us)
{
guint32 time;
gint64 delta_t;
@@ -832,9 +820,9 @@ mousekeys_get_speed_factor (ClutterInputDeviceEvdev *device,
#undef MOUSEKEYS_CURVE
static void
-emulate_pointer_motion (ClutterInputDeviceEvdev *device_evdev,
- gint dx,
- gint dy)
+emulate_pointer_motion (MetaInputDeviceNative *device_evdev,
+ gint dx,
+ gint dy)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
gdouble dx_motion;
@@ -859,16 +847,16 @@ emulate_pointer_motion (ClutterInputDeviceEvdev *device_evdev,
time_us, dx_motion, dy_motion);
}
static gboolean
-is_numlock_active (ClutterInputDeviceEvdev *device)
+is_numlock_active (MetaInputDeviceNative *device)
{
- ClutterSeatEvdev *seat = device->seat;
+ MetaSeatNative *seat = device->seat;
return xkb_state_mod_name_is_active (seat->xkb,
"Mod2",
XKB_STATE_MODS_LOCKED);
}
static void
-enable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
+enable_mousekeys (MetaInputDeviceNative *device_evdev)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
ClutterDeviceManager *manager = device->device_manager;
@@ -888,7 +876,7 @@ enable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
}
static void
-disable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
+disable_mousekeys (MetaInputDeviceNative *device_evdev)
{
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
@@ -920,7 +908,7 @@ disable_mousekeys (ClutterInputDeviceEvdev *device_evdev)
static gboolean
trigger_mousekeys_move (gpointer data)
{
- ClutterInputDeviceEvdev *device = data;
+ MetaInputDeviceNative *device = data;
gint dx = 0;
gint dy = 0;
@@ -995,7 +983,7 @@ trigger_mousekeys_move (gpointer data)
}
static void
-stop_mousekeys_move (ClutterInputDeviceEvdev *device)
+stop_mousekeys_move (MetaInputDeviceNative *device)
{
device->mousekeys_first_motion_time = 0;
device->mousekeys_last_motion_time = 0;
@@ -1008,8 +996,8 @@ stop_mousekeys_move (ClutterInputDeviceEvdev *device)
}
static void
-start_mousekeys_move (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+start_mousekeys_move (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
device->last_mousekeys_key = event->key.keyval;
@@ -1020,8 +1008,8 @@ start_mousekeys_move (ClutterEvent *event,
}
static gboolean
-handle_mousekeys_press (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_mousekeys_press (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
if (!(event->key.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
stop_mousekeys_move (device);
@@ -1098,8 +1086,8 @@ handle_mousekeys_press (ClutterEvent *event,
}
static gboolean
-handle_mousekeys_release (ClutterEvent *event,
- ClutterInputDeviceEvdev *device)
+handle_mousekeys_release (ClutterEvent *event,
+ MetaInputDeviceNative *device)
{
/* Do not handle mousekeys if NumLock is ON */
if (is_numlock_active (device))
@@ -1143,11 +1131,11 @@ handle_mousekeys_release (ClutterEvent *event,
}
static void
-clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *event,
- ClutterInputDevice *device,
- ClutterEmitInputDeviceEvent emit_event_func)
+meta_input_device_native_process_kbd_a11y_event (ClutterEvent *event,
+ ClutterInputDevice *device,
+ ClutterEmitInputDeviceEvent emit_event_func)
{
- ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device);
/* Ignore key events injected from IM */
if (event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)
@@ -1208,8 +1196,8 @@ emit_event:
}
void
-clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *device,
- ClutterKbdA11ySettings *settings)
+meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device,
+ ClutterKbdA11ySettings *settings)
{
ClutterKeyboardA11yFlags changed_flags = (device->a11y_flags ^ settings->controls);
@@ -1247,28 +1235,28 @@ clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *dev
}
void
-clutter_evdev_a11y_maybe_notify_toggle_keys (ClutterInputDeviceEvdev *device)
+meta_input_device_native_a11y_maybe_notify_toggle_keys (MetaInputDeviceNative *device)
{
if (device->a11y_flags & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED)
- clutter_input_device_evdev_bell_notify ();
+ meta_input_device_native_bell_notify ();
}
static void
release_device_touch_slot (gpointer value)
{
- ClutterTouchState *touch_state = value;
+ MetaTouchState *touch_state = value;
- clutter_seat_evdev_release_touch_state (touch_state->seat, touch_state);
+ meta_seat_native_release_touch_state (touch_state->seat, touch_state);
}
-ClutterTouchState *
-clutter_input_device_evdev_acquire_touch_state (ClutterInputDeviceEvdev *device,
- int device_slot)
+MetaTouchState *
+meta_input_device_native_acquire_touch_state (MetaInputDeviceNative *device,
+ int device_slot)
{
- ClutterTouchState *touch_state;
+ MetaTouchState *touch_state;
- touch_state = clutter_seat_evdev_acquire_touch_state (device->seat,
- device_slot);
+ touch_state = meta_seat_native_acquire_touch_state (device->seat,
+ device_slot);
g_hash_table_insert (device->touches,
GINT_TO_POINTER (device_slot),
touch_state);
@@ -1276,36 +1264,37 @@ clutter_input_device_evdev_acquire_touch_state (ClutterInputDeviceEvdev *device,
return touch_state;
}
-ClutterTouchState *
-clutter_input_device_evdev_lookup_touch_state (ClutterInputDeviceEvdev *device,
- int device_slot)
+MetaTouchState *
+meta_input_device_native_lookup_touch_state (MetaInputDeviceNative *device,
+ int device_slot)
{
return g_hash_table_lookup (device->touches, GINT_TO_POINTER (device_slot));
}
void
-clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
- ClutterTouchState *touch_state)
+meta_input_device_native_release_touch_state (MetaInputDeviceNative *device,
+ MetaTouchState *touch_state)
{
g_hash_table_remove (device->touches,
GINT_TO_POINTER (touch_state->device_slot));
}
static void
-clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
+meta_input_device_native_class_init (MetaInputDeviceNativeClass *klass)
{
+ ClutterInputDeviceClass *device_manager_class = CLUTTER_INPUT_DEVICE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = clutter_input_device_evdev_finalize;
- object_class->set_property = clutter_input_device_evdev_set_property;
- object_class->get_property = clutter_input_device_evdev_get_property;
+ object_class->finalize = meta_input_device_native_finalize;
+ object_class->set_property = meta_input_device_native_set_property;
+ object_class->get_property = meta_input_device_native_get_property;
- klass->keycode_to_evdev = clutter_input_device_evdev_keycode_to_evdev;
- klass->update_from_tool = clutter_input_device_evdev_update_from_tool;
- klass->is_mode_switch_button = clutter_input_device_evdev_is_mode_switch_button;
- klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
- klass->is_grouped = clutter_input_device_evdev_is_grouped;
- klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
+ device_manager_class->keycode_to_evdev = meta_input_device_native_keycode_to_evdev;
+ device_manager_class->update_from_tool = meta_input_device_native_update_from_tool;
+ device_manager_class->is_mode_switch_button = meta_input_device_native_is_mode_switch_button;
+ device_manager_class->get_group_n_modes = meta_input_device_native_get_group_n_modes;
+ device_manager_class->is_grouped = meta_input_device_native_is_grouped;
+ device_manager_class->process_kbd_a11y_event = meta_input_device_native_process_kbd_a11y_event;
obj_props[PROP_DEVICE_MATRIX] =
g_param_spec_boxed ("device-matrix",
@@ -1324,7 +1313,7 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
}
static void
-clutter_input_device_evdev_init (ClutterInputDeviceEvdev *self)
+meta_input_device_native_init (MetaInputDeviceNative *self)
{
cairo_matrix_init_identity (&self->device_matrix);
self->device_aspect_ratio = 0;
@@ -1335,7 +1324,7 @@ clutter_input_device_evdev_init (ClutterInputDeviceEvdev *self)
}
/*
- * _clutter_input_device_evdev_new:
+ * meta_input_device_native_new:
* @manager: the device manager
* @seat: the seat the device will belong to
* @libinput_device: the libinput device
@@ -1344,23 +1333,23 @@ clutter_input_device_evdev_init (ClutterInputDeviceEvdev *self)
* it with the provided seat.
*/
ClutterInputDevice *
-_clutter_input_device_evdev_new (ClutterDeviceManager *manager,
- ClutterSeatEvdev *seat,
- struct libinput_device *libinput_device)
+meta_input_device_native_new (ClutterDeviceManager *manager,
+ MetaSeatNative *seat,
+ struct libinput_device *libinput_device)
{
- ClutterInputDeviceEvdev *device;
+ MetaInputDeviceNative *device;
ClutterInputDeviceType type;
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaDeviceManagerNative *manager_evdev;
gchar *vendor, *product;
gint device_id, n_rings = 0, n_strips = 0, n_groups = 1;
gchar *node_path;
gdouble width, height;
- type = _clutter_input_device_evdev_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));
product = g_strdup_printf ("%.4x", libinput_device_get_id_product (libinput_device));
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
- device_id = _clutter_device_manager_evdev_acquire_device_id (manager_evdev);
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
+ device_id = meta_device_manager_native_acquire_device_id (manager_evdev);
node_path = g_strdup_printf ("/dev/input/%s", libinput_device_get_sysname (libinput_device));
if (libinput_device_has_capability (libinput_device,
@@ -1371,7 +1360,7 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
n_groups = libinput_device_tablet_pad_get_num_mode_groups (libinput_device);
}
- device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_EVDEV,
+ device = g_object_new (META_TYPE_INPUT_DEVICE_NATIVE,
"id", device_id,
"name", libinput_device_get_name (libinput_device),
"device-manager", manager,
@@ -1402,7 +1391,7 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
}
/*
- * _clutter_input_device_evdev_new_virtual:
+ * meta_input_device_native_new_virtual:
* @manager: the device manager
* @seat: the seat the device will belong to
* @type: the input device type
@@ -1410,13 +1399,13 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
* Create a new virtual ClutterInputDevice of the given type.
*/
ClutterInputDevice *
-_clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
- ClutterSeatEvdev *seat,
- ClutterInputDeviceType type,
- ClutterInputMode mode)
+meta_input_device_native_new_virtual (ClutterDeviceManager *manager,
+ MetaSeatNative *seat,
+ ClutterInputDeviceType type,
+ ClutterInputMode mode)
{
- ClutterInputDeviceEvdev *device;
- ClutterDeviceManagerEvdev *manager_evdev;
+ MetaInputDeviceNative *device;
+ MetaDeviceManagerNative *manager_evdev;
const char *name;
gint device_id;
@@ -1436,9 +1425,9 @@ _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
break;
};
- manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
- device_id = _clutter_device_manager_evdev_acquire_device_id (manager_evdev);
- device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_EVDEV,
+ manager_evdev = META_DEVICE_MANAGER_NATIVE (manager);
+ device_id = meta_device_manager_native_acquire_device_id (manager_evdev);
+ device = g_object_new (META_TYPE_INPUT_DEVICE_NATIVE,
"id", device_id,
"name", name,
"device-manager", manager,
@@ -1452,15 +1441,15 @@ _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
return CLUTTER_INPUT_DEVICE (device);
}
-ClutterSeatEvdev *
-_clutter_input_device_evdev_get_seat (ClutterInputDeviceEvdev *device)
+MetaSeatNative *
+meta_input_device_native_get_seat (MetaInputDeviceNative *device)
{
return device->seat;
}
void
-_clutter_input_device_evdev_update_leds (ClutterInputDeviceEvdev *device,
- enum libinput_led leds)
+meta_input_device_native_update_leds (MetaInputDeviceNative *device,
+ enum libinput_led leds)
{
if (!device->libinput_device)
return;
@@ -1469,7 +1458,7 @@ _clutter_input_device_evdev_update_leds (ClutterInputDeviceEvdev *device,
}
ClutterInputDeviceType
-_clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
+meta_input_device_native_determine_type (struct libinput_device *ldev)
{
/* This setting is specific to touchpads and alike, only in these
* devices there is this additional layer of touch event interpretation.
@@ -1491,7 +1480,7 @@ _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
}
/**
- * clutter_evdev_input_device_get_libinput_device:
+ * meta_input_device_native_get_libinput_device:
* @device: a #ClutterInputDevice
*
* Retrieves the libinput_device struct held in @device.
@@ -1502,44 +1491,24 @@ _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
* Stability: unstable
**/
struct libinput_device *
-clutter_evdev_input_device_get_libinput_device (ClutterInputDevice *device)
+meta_input_device_native_get_libinput_device (ClutterInputDevice *device)
{
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
- g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_EVDEV (device), NULL);
+ g_return_val_if_fail (META_IS_INPUT_DEVICE_NATIVE (device), NULL);
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ device_evdev = META_INPUT_DEVICE_NATIVE (device);
return device_evdev->libinput_device;
}
-/**
- * clutter_evdev_event_sequence_get_slot:
- * @sequence: a #ClutterEventSequence
- *
- * Retrieves the touch slot triggered by this @sequence
- *
- * Returns: the libinput touch slot.
- *
- * Since: 1.20
- * Stability: unstable
- **/
-gint32
-clutter_evdev_event_sequence_get_slot (const ClutterEventSequence *sequence)
-{
- if (!sequence)
- return -1;
-
- return GPOINTER_TO_INT (sequence) - 1;
-}
-
void
-clutter_input_device_evdev_translate_coordinates (ClutterInputDevice *device,
- ClutterStage *stage,
- gfloat *x,
- gfloat *y)
+meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
+ ClutterStage *stage,
+ gfloat *x,
+ gfloat *y)
{
- ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
+ MetaInputDeviceNative *device_evdev = META_INPUT_DEVICE_NATIVE (device);
double min_x = 0, min_y = 0, max_x = 1, max_y = 1;
gdouble stage_width, stage_height;
double x_d, y_d;
@@ -1570,22 +1539,22 @@ clutter_input_device_evdev_translate_coordinates (ClutterInputDevice *device,
}
void
-clutter_input_device_evdev_release_touch_slots (ClutterInputDeviceEvdev *device_evdev,
- uint64_t time_us)
+meta_input_device_native_release_touch_slots (MetaInputDeviceNative *device_evdev,
+ uint64_t time_us)
{
GHashTableIter iter;
- ClutterTouchState *touch_state;
+ MetaTouchState *touch_state;
g_hash_table_iter_init (&iter, device_evdev->touches);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch_state))
{
- clutter_seat_evdev_notify_touch_event (touch_state->seat,
- CLUTTER_INPUT_DEVICE (device_evdev),
- CLUTTER_TOUCH_CANCEL,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (touch_state->seat,
+ CLUTTER_INPUT_DEVICE (device_evdev),
+ CLUTTER_TOUCH_CANCEL,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
g_hash_table_iter_remove (&iter);
}
}
diff --git a/src/backends/native/meta-input-device-native.h b/src/backends/native/meta-input-device-native.h
new file mode 100644
index 000000000..691846b0e
--- /dev/null
+++ b/src/backends/native/meta-input-device-native.h
@@ -0,0 +1,146 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2010 Intel Corp.
+ * Copyright (C) 2014 Jonas Ådahl
+ *
+ * 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_INPUT_DEVICE_NATIVE_H
+#define META_INPUT_DEVICE_NATIVE_H
+
+#include <glib-object.h>
+#include <clutter/clutter-mutter.h>
+
+#include "backends/native/meta-seat-native.h"
+
+#define META_TYPE_INPUT_DEVICE_NATIVE meta_input_device_native_get_type()
+
+#define META_INPUT_DEVICE_NATIVE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ META_TYPE_INPUT_DEVICE_NATIVE, MetaInputDeviceNative))
+
+#define META_INPUT_DEVICE_NATIVE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ META_TYPE_INPUT_DEVICE_NATIVE, MetaInputDeviceNativeClass))
+
+#define META_IS_INPUT_DEVICE_NATIVE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ META_TYPE_INPUT_DEVICE_NATIVE))
+
+#define META_IS_INPUT_DEVICE_NATIVE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ META_TYPE_INPUT_DEVICE_NATIVE))
+
+#define META_INPUT_DEVICE_NATIVE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ META_TYPE_INPUT_DEVICE_NATIVE, MetaInputDeviceNativeClass))
+
+typedef struct _MetaInputDeviceNative MetaInputDeviceNative;
+typedef struct _MetaInputDeviceNativeClass MetaInputDeviceNativeClass;
+
+struct _MetaInputDeviceNative
+{
+ ClutterInputDevice parent;
+
+ struct libinput_device *libinput_device;
+ MetaSeatNative *seat;
+ ClutterInputDeviceTool *last_tool;
+
+ cairo_matrix_t device_matrix;
+ gdouble device_aspect_ratio; /* w:h */
+ gdouble output_ratio; /* w:h */
+
+ GHashTable *touches;
+
+ /* Keyboard a11y */
+ ClutterKeyboardA11yFlags a11y_flags;
+ GList *slow_keys_list;
+ guint debounce_timer;
+ guint16 debounce_key;
+ xkb_mod_mask_t stickykeys_depressed_mask;
+ xkb_mod_mask_t stickykeys_latched_mask;
+ xkb_mod_mask_t stickykeys_locked_mask;
+ guint toggle_slowkeys_timer;
+ guint16 shift_count;
+ guint32 last_shift_time;
+ gint mousekeys_btn;
+ gboolean mousekeys_btn_states[3];
+ guint32 mousekeys_first_motion_time; /* ms */
+ guint32 mousekeys_last_motion_time; /* ms */
+ guint mousekeys_init_delay;
+ guint mousekeys_accel_time;
+ guint mousekeys_max_speed;
+ gdouble mousekeys_curve_factor;
+ guint move_mousekeys_timer;
+ guint16 last_mousekeys_key;
+ ClutterVirtualInputDevice *mousekeys_virtual_device;
+};
+
+struct _MetaInputDeviceNativeClass
+{
+ ClutterInputDeviceClass parent_class;
+};
+
+
+GType meta_input_device_native_get_type (void) G_GNUC_CONST;
+
+ClutterInputDevice * meta_input_device_native_new (ClutterDeviceManager *manager,
+ MetaSeatNative *seat,
+ struct libinput_device
*libinput_device);
+
+ClutterInputDevice * meta_input_device_native_new_virtual (ClutterDeviceManager *manager,
+ MetaSeatNative *seat,
+ ClutterInputDeviceType type,
+ ClutterInputMode mode);
+
+MetaSeatNative * meta_input_device_native_get_seat (MetaInputDeviceNative *device);
+
+void meta_input_device_native_update_leds (MetaInputDeviceNative *device,
+ enum libinput_led leds);
+
+ClutterInputDeviceType meta_input_device_native_determine_type (struct libinput_device
*libinput_device);
+
+
+void meta_input_device_native_translate_coordinates (ClutterInputDevice *device,
+ ClutterStage *stage,
+ gfloat *x,
+ gfloat *y);
+
+void meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device,
+ ClutterKbdA11ySettings
*settings);
+
+MetaTouchState * meta_input_device_native_acquire_touch_state (MetaInputDeviceNative *device,
+ int device_slot);
+
+MetaTouchState * meta_input_device_native_lookup_touch_state (MetaInputDeviceNative *device,
+ int device_slot);
+
+void meta_input_device_native_release_touch_state (MetaInputDeviceNative *device,
+ MetaTouchState *touch_state);
+
+void meta_input_device_native_release_touch_slots (MetaInputDeviceNative *device_evdev,
+ uint64_t time_us);
+
+void meta_input_device_native_a11y_maybe_notify_toggle_keys (MetaInputDeviceNative
*device_evdev);
+
+struct libinput_device * meta_input_device_native_get_libinput_device (ClutterInputDevice *device);
+
+#endif /* META_INPUT_DEVICE_NATIVE_H */
diff --git a/clutter/clutter/evdev/clutter-input-device-tool-evdev.c
b/src/backends/native/meta-input-device-tool-native.c
similarity index 56%
rename from clutter/clutter/evdev/clutter-input-device-tool-evdev.c
rename to src/backends/native/meta-input-device-tool-native.c
index df100f2fe..8a2e844cd 100644
--- a/clutter/clutter/evdev/clutter-input-device-tool-evdev.c
+++ b/src/backends/native/meta-input-device-tool-native.c
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright © 2009, 2010, 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
@@ -21,47 +17,46 @@
* Author: Carlos Garnacho <carlosg gnome org>
*/
-#include "clutter-build-config.h"
+#include "config.h"
-#include "clutter-input-device-tool-evdev.h"
-#include "clutter-evdev.h"
+#include "backends/native/meta-input-device-tool-native.h"
-G_DEFINE_TYPE (ClutterInputDeviceToolEvdev, clutter_input_device_tool_evdev,
+G_DEFINE_TYPE (MetaInputDeviceToolNative, meta_input_device_tool_native,
CLUTTER_TYPE_INPUT_DEVICE_TOOL)
static void
-clutter_input_device_tool_evdev_finalize (GObject *object)
+meta_input_device_tool_native_finalize (GObject *object)
{
- ClutterInputDeviceToolEvdev *tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (object);
+ MetaInputDeviceToolNative *tool = META_INPUT_DEVICE_TOOL_NATIVE (object);
g_hash_table_unref (tool->button_map);
libinput_tablet_tool_unref (tool->tool);
- G_OBJECT_CLASS (clutter_input_device_tool_evdev_parent_class)->finalize (object);
+ G_OBJECT_CLASS (meta_input_device_tool_native_parent_class)->finalize (object);
}
static void
-clutter_input_device_tool_evdev_class_init (ClutterInputDeviceToolEvdevClass *klass)
+meta_input_device_tool_native_class_init (MetaInputDeviceToolNativeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = clutter_input_device_tool_evdev_finalize;
+ object_class->finalize = meta_input_device_tool_native_finalize;
}
static void
-clutter_input_device_tool_evdev_init (ClutterInputDeviceToolEvdev *tool)
+meta_input_device_tool_native_init (MetaInputDeviceToolNative *tool)
{
tool->button_map = g_hash_table_new (NULL, NULL);
}
ClutterInputDeviceTool *
-clutter_input_device_tool_evdev_new (struct libinput_tablet_tool *tool,
- guint64 serial,
- ClutterInputDeviceToolType type)
+meta_input_device_tool_native_new (struct libinput_tablet_tool *tool,
+ guint64 serial,
+ ClutterInputDeviceToolType type)
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- evdev_tool = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV,
+ evdev_tool = g_object_new (META_TYPE_INPUT_DEVICE_TOOL_NATIVE,
"type", type,
"serial", serial,
"id", libinput_tablet_tool_get_tool_id (tool),
@@ -73,18 +68,18 @@ clutter_input_device_tool_evdev_new (struct libinput_tablet_tool *tool,
}
void
-clutter_evdev_input_device_tool_set_pressure_curve (ClutterInputDeviceTool *tool,
- gdouble curve[4])
+meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool,
+ gdouble curve[4])
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV (tool));
+ g_return_if_fail (META_IS_INPUT_DEVICE_TOOL_NATIVE (tool));
g_return_if_fail (curve[0] >= 0 && curve[0] <= 1 &&
curve[1] >= 0 && curve[1] <= 1 &&
curve[2] >= 0 && curve[2] <= 1 &&
curve[3] >= 0 && curve[3] <= 1);
- evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
+ evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
evdev_tool->pressure_curve[0] = curve[0];
evdev_tool->pressure_curve[1] = curve[1];
evdev_tool->pressure_curve[2] = curve[2];
@@ -92,15 +87,15 @@ clutter_evdev_input_device_tool_set_pressure_curve (ClutterInputDeviceTool *tool
}
void
-clutter_evdev_input_device_tool_set_button_code (ClutterInputDeviceTool *tool,
- guint button,
- guint evcode)
+meta_input_device_tool_native_set_button_code (ClutterInputDeviceTool *tool,
+ guint button,
+ guint evcode)
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV (tool));
+ g_return_if_fail (META_IS_INPUT_DEVICE_TOOL_NATIVE (tool));
- evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
+ evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
if (evcode == 0)
{
@@ -135,14 +130,14 @@ calculate_bezier_position (gdouble pos,
}
gdouble
-clutter_input_device_tool_evdev_translate_pressure (ClutterInputDeviceTool *tool,
- gdouble pressure)
+meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
+ gdouble pressure)
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), pressure);
+ g_return_val_if_fail (META_IS_INPUT_DEVICE_TOOL_NATIVE (tool), pressure);
- evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
+ evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
return calculate_bezier_position (CLAMP (pressure, 0, 1),
evdev_tool->pressure_curve[0],
@@ -152,14 +147,14 @@ clutter_input_device_tool_evdev_translate_pressure (ClutterInputDeviceTool *tool
}
guint
-clutter_input_device_tool_evdev_get_button_code (ClutterInputDeviceTool *tool,
- guint button)
+meta_input_device_tool_native_get_button_code (ClutterInputDeviceTool *tool,
+ guint button)
{
- ClutterInputDeviceToolEvdev *evdev_tool;
+ MetaInputDeviceToolNative *evdev_tool;
- g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), 0);
+ g_return_val_if_fail (META_IS_INPUT_DEVICE_TOOL_NATIVE (tool), 0);
- evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
+ evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
return GPOINTER_TO_UINT (g_hash_table_lookup (evdev_tool->button_map,
GUINT_TO_POINTER (button)));
diff --git a/src/backends/native/meta-input-device-tool-native.h
b/src/backends/native/meta-input-device-tool-native.h
new file mode 100644
index 000000000..ea16c4511
--- /dev/null
+++ b/src/backends/native/meta-input-device-tool-native.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright © 2009, 2010, 2011 Intel Corp.
+ *
+ * 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: Carlos Garnacho <carlosg gnome org>
+ */
+
+#ifndef META_INPUT_DEVICE_NATIVE_TOOL_H
+#define META_INPUT_DEVICE_NATIVE_TOOL_H
+
+#include <clutter/clutter.h>
+#include <libinput.h>
+
+G_BEGIN_DECLS
+
+#define META_TYPE_INPUT_DEVICE_TOOL_NATIVE (meta_input_device_tool_native_get_type ())
+
+#define META_INPUT_DEVICE_TOOL_NATIVE(o) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((o), \
+ META_TYPE_INPUT_DEVICE_TOOL_NATIVE, MetaInputDeviceToolNative))
+
+#define META_IS_INPUT_DEVICE_TOOL_NATIVE(o) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
+ META_TYPE_INPUT_DEVICE_TOOL_NATIVE))
+
+#define META_INPUT_DEVICE_TOOL_NATIVE_CLASS(c) \
+ (G_TYPE_CHECK_CLASS_CAST ((c), \
+ META_TYPE_INPUT_DEVICE_TOOL_EVDEV, MetaInputDeviceToolNativeClass))
+
+#define META_IS_INPUT_DEVICE_TOOL_NATIVE_CLASS(c) \
+ (G_TYPE_CHECK_CLASS_TYPE ((c), \
+ META_TYPE_INPUT_DEVICE_TOOL_NATIVE))
+
+#define META_INPUT_DEVICE_TOOL_NATIVE_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), \
+ META_TYPE_INPUT_DEVICE_TOOL_NATIVE, MetaInputDeviceToolNativeClass))
+
+typedef struct _MetaInputDeviceToolNative MetaInputDeviceToolNative;
+typedef struct _MetaInputDeviceToolNativeClass MetaInputDeviceToolNativeClass;
+
+struct _MetaInputDeviceToolNative
+{
+ ClutterInputDeviceTool parent_instance;
+ struct libinput_tablet_tool *tool;
+ GHashTable *button_map;
+ gdouble pressure_curve[4];
+};
+
+struct _MetaInputDeviceToolNativeClass
+{
+ ClutterInputDeviceToolClass parent_class;
+};
+
+GType meta_input_device_tool_native_get_type (void) G_GNUC_CONST;
+
+ClutterInputDeviceTool * meta_input_device_tool_native_new (struct libinput_tablet_tool *tool,
+ guint64 serial,
+ ClutterInputDeviceToolType type);
+
+gdouble meta_input_device_tool_native_translate_pressure (ClutterInputDeviceTool *tool,
+ gdouble pressure);
+guint meta_input_device_tool_native_get_button_code (ClutterInputDeviceTool *tool,
+ guint button);
+
+void meta_input_device_tool_native_set_pressure_curve (ClutterInputDeviceTool *tool,
+ gdouble
curve[4]);
+void meta_input_device_tool_native_set_button_code (ClutterInputDeviceTool *tool,
+ guint button,
+ guint evcode);
+
+G_END_DECLS
+
+#endif /* META_INPUT_DEVICE_NATIVE_TOOL_H */
diff --git a/src/backends/native/meta-input-settings-native.c
b/src/backends/native/meta-input-settings-native.c
index 0e00c0202..4c980cbab 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -28,8 +28,9 @@
#include "backends/meta-logical-monitor.h"
#include "backends/native/meta-backend-native.h"
+#include "backends/native/meta-input-device-native.h"
+#include "backends/native/meta-input-device-tool-native.h"
#include "backends/native/meta-input-settings-native.h"
-#include "clutter/evdev/clutter-evdev.h"
G_DEFINE_TYPE (MetaInputSettingsNative, meta_input_settings_native, META_TYPE_INPUT_SETTINGS)
@@ -56,7 +57,7 @@ meta_input_settings_native_set_send_events (MetaInputSettings *settings,
g_assert_not_reached ();
}
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
libinput_device_config_send_events_set_mode (libinput_device, libinput_mode);
@@ -81,7 +82,7 @@ meta_input_settings_native_set_speed (MetaInputSettings *settings,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
libinput_device_config_accel_set_speed (libinput_device,
@@ -95,7 +96,7 @@ meta_input_settings_native_set_left_handed (MetaInputSettings *settings,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -110,7 +111,7 @@ meta_input_settings_native_set_tap_enabled (MetaInputSettings *settings,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -128,7 +129,7 @@ meta_input_settings_native_set_tap_and_drag_enabled (MetaInputSettings *setting
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -146,7 +147,7 @@ meta_input_settings_native_set_disable_while_typing (MetaInputSettings *setting
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -165,7 +166,7 @@ meta_input_settings_native_set_invert_scroll (MetaInputSettings *settings,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -200,7 +201,7 @@ meta_input_settings_native_set_edge_scroll (MetaInputSettings *settin
struct libinput_device *libinput_device;
enum libinput_config_scroll_method current, method;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
method = edge_scrolling_enabled ? LIBINPUT_CONFIG_SCROLL_EDGE : LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
current = libinput_device_config_scroll_get_method (libinput_device);
@@ -217,7 +218,7 @@ meta_input_settings_native_set_two_finger_scroll (MetaInputSettings *
struct libinput_device *libinput_device;
enum libinput_config_scroll_method current, method;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
method = two_finger_scroll_enabled ? LIBINPUT_CONFIG_SCROLL_2FG : LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
current = libinput_device_config_scroll_get_method (libinput_device);
@@ -232,7 +233,7 @@ meta_input_settings_native_has_two_finger_scroll (MetaInputSettings *settings,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return FALSE;
@@ -248,7 +249,7 @@ meta_input_settings_native_set_scroll_button (MetaInputSettings *settings,
enum libinput_config_scroll_method method;
guint evcode;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -282,7 +283,7 @@ meta_input_settings_native_set_click_method (MetaInputSettings *settin
enum libinput_config_click_method click_method = 0;
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return;
@@ -316,7 +317,7 @@ meta_input_settings_native_set_keyboard_repeat (MetaInputSettings *settings,
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
- clutter_evdev_set_keyboard_repeat (manager, enabled, delay, interval);
+ meta_device_manager_native_set_keyboard_repeat (manager, enabled, delay, interval);
}
static void
@@ -327,7 +328,7 @@ set_device_accel_profile (ClutterInputDevice *device,
enum libinput_config_accel_profile libinput_profile;
uint32_t profiles;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
switch (profile)
{
@@ -363,7 +364,7 @@ has_udev_property (ClutterInputDevice *device,
struct udev_device *udev_device;
struct udev_device *parent_udev_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device)
return FALSE;
@@ -500,7 +501,7 @@ meta_input_settings_native_set_tablet_area (MetaInputSettings *settings,
gfloat matrix[6] = { scale_x, 0., offset_x,
0., scale_y, offset_y };
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
if (!libinput_device ||
!libinput_device_config_calibration_has_matrix (libinput_device))
return;
@@ -521,7 +522,7 @@ meta_input_settings_native_set_stylus_pressure (MetaInputSettings *settings
pressure_curve[2] = (gdouble) curve[2] / 100;
pressure_curve[3] = (gdouble) curve[3] / 100;
- clutter_evdev_input_device_tool_set_pressure_curve (tool, pressure_curve);
+ meta_input_device_tool_native_set_pressure_curve (tool, pressure_curve);
}
static guint
@@ -551,12 +552,12 @@ meta_input_settings_native_set_stylus_button_map (MetaInputSettings *se
GDesktopStylusButtonAction secondary,
GDesktopStylusButtonAction tertiary)
{
- clutter_evdev_input_device_tool_set_button_code (tool, CLUTTER_BUTTON_MIDDLE,
- action_to_evcode (primary));
- clutter_evdev_input_device_tool_set_button_code (tool, CLUTTER_BUTTON_SECONDARY,
- action_to_evcode (secondary));
- clutter_evdev_input_device_tool_set_button_code (tool, 8, /* Back */
- action_to_evcode (tertiary));
+ meta_input_device_tool_native_set_button_code (tool, CLUTTER_BUTTON_MIDDLE,
+ action_to_evcode (primary));
+ meta_input_device_tool_native_set_button_code (tool, CLUTTER_BUTTON_SECONDARY,
+ action_to_evcode (secondary));
+ meta_input_device_tool_native_set_button_code (tool, 8, /* Back */
+ action_to_evcode (tertiary));
}
static void
diff --git a/clutter/clutter/evdev/clutter-keymap-evdev.c b/src/backends/native/meta-keymap-native.c
similarity index 61%
rename from clutter/clutter/evdev/clutter-keymap-evdev.c
rename to src/backends/native/meta-keymap-native.c
index 7f67bf2a3..35df9f373 100644
--- a/clutter/clutter/evdev/clutter-keymap-evdev.c
+++ b/src/backends/native/meta-keymap-native.c
@@ -19,46 +19,46 @@
* Author: Carlos Garnacho <carlosg gnome org>
*/
-#include "clutter-build-config.h"
+#include "config.h"
-#include "clutter-device-manager-evdev.h"
-#include "clutter-keymap-evdev.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-keymap-native.h"
static const char *option_xkb_layout = "us";
static const char *option_xkb_variant = "";
static const char *option_xkb_options = "";
-typedef struct _ClutterKeymapEvdev ClutterKeymapEvdev;
+typedef struct _MetaKeymapNative MetaKeymapNative;
-struct _ClutterKeymapEvdev
+struct _MetaKeymapNative
{
ClutterKeymap parent_instance;
struct xkb_keymap *keymap;
};
-G_DEFINE_TYPE (ClutterKeymapEvdev, clutter_keymap_evdev,
+G_DEFINE_TYPE (MetaKeymapNative, meta_keymap_native,
CLUTTER_TYPE_KEYMAP)
static void
-clutter_keymap_evdev_finalize (GObject *object)
+meta_keymap_native_finalize (GObject *object)
{
- ClutterKeymapEvdev *keymap = CLUTTER_KEYMAP_EVDEV (object);
+ MetaKeymapNative *keymap = META_KEYMAP_NATIVE (object);
xkb_keymap_unref (keymap->keymap);
- G_OBJECT_CLASS (clutter_keymap_evdev_parent_class)->finalize (object);
+ G_OBJECT_CLASS (meta_keymap_native_parent_class)->finalize (object);
}
static gboolean
-clutter_keymap_evdev_get_num_lock_state (ClutterKeymap *keymap)
+meta_keymap_native_get_num_lock_state (ClutterKeymap *keymap)
{
- ClutterDeviceManagerEvdev *device_manager;
+ MetaDeviceManagerNative *device_manager;
struct xkb_state *xkb_state;
device_manager =
- CLUTTER_DEVICE_MANAGER_EVDEV (clutter_device_manager_get_default ());
- xkb_state = _clutter_device_manager_evdev_get_xkb_state (device_manager);
+ META_DEVICE_MANAGER_NATIVE (clutter_device_manager_get_default ());
+ xkb_state = meta_device_manager_native_get_xkb_state (device_manager);
return xkb_state_mod_name_is_active (xkb_state,
XKB_MOD_NAME_NUM,
@@ -67,14 +67,14 @@ clutter_keymap_evdev_get_num_lock_state (ClutterKeymap *keymap)
}
static gboolean
-clutter_keymap_evdev_get_caps_lock_state (ClutterKeymap *keymap)
+meta_keymap_native_get_caps_lock_state (ClutterKeymap *keymap)
{
- ClutterDeviceManagerEvdev *device_manager;
+ MetaDeviceManagerNative *device_manager;
struct xkb_state *xkb_state;
device_manager =
- CLUTTER_DEVICE_MANAGER_EVDEV (clutter_device_manager_get_default ());
- xkb_state = _clutter_device_manager_evdev_get_xkb_state (device_manager);
+ META_DEVICE_MANAGER_NATIVE (clutter_device_manager_get_default ());
+ xkb_state = meta_device_manager_native_get_xkb_state (device_manager);
return xkb_state_mod_name_is_active (xkb_state,
XKB_MOD_NAME_CAPS,
@@ -83,19 +83,19 @@ clutter_keymap_evdev_get_caps_lock_state (ClutterKeymap *keymap)
}
static void
-clutter_keymap_evdev_class_init (ClutterKeymapEvdevClass *klass)
+meta_keymap_native_class_init (MetaKeymapNativeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterKeymapClass *keymap_class = CLUTTER_KEYMAP_CLASS (klass);
- object_class->finalize = clutter_keymap_evdev_finalize;
+ object_class->finalize = meta_keymap_native_finalize;
- keymap_class->get_num_lock_state = clutter_keymap_evdev_get_num_lock_state;
- keymap_class->get_caps_lock_state = clutter_keymap_evdev_get_caps_lock_state;
+ keymap_class->get_num_lock_state = meta_keymap_native_get_num_lock_state;
+ keymap_class->get_caps_lock_state = meta_keymap_native_get_caps_lock_state;
}
static void
-clutter_keymap_evdev_init (ClutterKeymapEvdev *keymap)
+meta_keymap_native_init (MetaKeymapNative *keymap)
{
struct xkb_context *ctx;
struct xkb_rule_names names;
@@ -113,8 +113,8 @@ clutter_keymap_evdev_init (ClutterKeymapEvdev *keymap)
}
void
-clutter_keymap_evdev_set_keyboard_map (ClutterKeymapEvdev *keymap,
- struct xkb_keymap *xkb_keymap)
+meta_keymap_native_set_keyboard_map (MetaKeymapNative *keymap,
+ struct xkb_keymap *xkb_keymap)
{
if (keymap->keymap)
xkb_keymap_unref (keymap->keymap);
@@ -122,7 +122,7 @@ clutter_keymap_evdev_set_keyboard_map (ClutterKeymapEvdev *keymap,
}
struct xkb_keymap *
-clutter_keymap_evdev_get_keyboard_map (ClutterKeymapEvdev *keymap)
+meta_keymap_native_get_keyboard_map (MetaKeymapNative *keymap)
{
return keymap->keymap;
}
diff --git a/clutter/clutter/evdev/clutter-keymap-evdev.h b/src/backends/native/meta-keymap-native.h
similarity index 62%
rename from clutter/clutter/evdev/clutter-keymap-evdev.h
rename to src/backends/native/meta-keymap-native.h
index f3424b775..a814e43ea 100644
--- a/clutter/clutter/evdev/clutter-keymap-evdev.h
+++ b/src/backends/native/meta-keymap-native.h
@@ -19,14 +19,14 @@
* Author: Carlos Garnacho <carlosg gnome org>
*/
-#include "clutter-xkb-utils.h"
-#include "clutter-keymap.h"
+#include <clutter/clutter.h>
+#include "backends/native/meta-xkb-utils.h"
-#define CLUTTER_TYPE_KEYMAP_EVDEV (clutter_keymap_evdev_get_type ())
-G_DECLARE_FINAL_TYPE (ClutterKeymapEvdev, clutter_keymap_evdev,
- CLUTTER, KEYMAP_EVDEV,
+#define META_TYPE_KEYMAP_NATIVE (meta_keymap_native_get_type ())
+G_DECLARE_FINAL_TYPE (MetaKeymapNative, meta_keymap_native,
+ META, KEYMAP_NATIVE,
ClutterKeymap)
-void clutter_keymap_evdev_set_keyboard_map (ClutterKeymapEvdev *keymap,
- struct xkb_keymap *xkb_keymap);
-struct xkb_keymap * clutter_keymap_evdev_get_keyboard_map (ClutterKeymapEvdev *keymap);
+void meta_keymap_native_set_keyboard_map (MetaKeymapNative *keymap,
+ struct xkb_keymap *xkb_keymap);
+struct xkb_keymap * meta_keymap_native_get_keyboard_map (MetaKeymapNative *keymap);
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index cc59ad537..565bb2a11 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -19,6 +19,8 @@
#include "config.h"
+#include <sys/sysmacros.h>
+
#include "backends/native/meta-launcher.h"
#include <gio/gunixfdlist.h>
@@ -37,9 +39,9 @@
#include "backends/native/dbus-utils.h"
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-cursor-renderer-native.h"
+#include "backends/native/meta-device-manager-native.h"
#include "backends/native/meta-renderer-native.h"
#include "clutter/clutter.h"
-#include "clutter/evdev/clutter-evdev.h"
#include "meta-dbus-login1.h"
@@ -524,11 +526,11 @@ meta_launcher_new (GError **error)
self->sysfs_fds = g_hash_table_new (NULL, NULL);
self->session_active = TRUE;
- clutter_evdev_set_seat_id (self->seat_id);
+ meta_device_manager_native_set_seat_id (self->seat_id);
- clutter_evdev_set_device_callbacks (on_evdev_device_open,
- on_evdev_device_close,
- self);
+ meta_device_manager_native_set_device_callbacks (on_evdev_device_open,
+ on_evdev_device_close,
+ self);
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/src/backends/native/meta-seat-native.c
similarity index 70%
rename from clutter/clutter/evdev/clutter-seat-evdev.c
rename to src/backends/native/meta-seat-native.c
index 888db6e4f..f37537633 100644
--- a/clutter/clutter/evdev/clutter-seat-evdev.c
+++ b/src/backends/native/meta-seat-native.c
@@ -24,18 +24,17 @@
* Author: Jonas Ådahl <jadahl gmail com>
*/
-#include "clutter-build-config.h"
-
-#include "clutter-seat-evdev.h"
+#include "config.h"
#include <linux/input.h>
#include <math.h>
+#include <clutter/clutter-mutter.h>
-#include "clutter-event-private.h"
-#include "clutter-input-device-evdev.h"
-#include "clutter-input-device-tool-evdev.h"
-#include "clutter-keymap-evdev.h"
-#include "clutter-main.h"
+#include "backends/native/meta-seat-native.h"
+#include "backends/native/meta-event-native.h"
+#include "backends/native/meta-input-device-native.h"
+#include "backends/native/meta-input-device-tool-native.h"
+#include "backends/native/meta-keymap-native.h"
/* Try to keep the pointer inside the stage. Hopefully no one is using
* this backend with stages smaller than this. */
@@ -51,8 +50,8 @@
#endif
void
-clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
- struct libinput_seat *libinput_seat)
+meta_seat_native_set_libinput_seat (MetaSeatNative *seat,
+ struct libinput_seat *libinput_seat)
{
g_assert (seat->libinput_seat == NULL);
@@ -62,10 +61,10 @@ clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat)
+meta_seat_native_sync_leds (MetaSeatNative *seat)
{
GSList *iter;
- ClutterInputDeviceEvdev *device_evdev;
+ MetaInputDeviceNative *device_evdev;
int caps_lock, num_lock, scroll_lock;
enum libinput_led leds = 0;
@@ -83,19 +82,19 @@ clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat)
for (iter = seat->devices; iter; iter = iter->next)
{
device_evdev = iter->data;
- _clutter_input_device_evdev_update_leds (device_evdev, leds);
+ meta_input_device_native_update_leds (device_evdev, leds);
}
}
static void
-clutter_touch_state_free (ClutterTouchState *touch_state)
+clutter_touch_state_free (MetaTouchState *touch_state)
{
- g_slice_free (ClutterTouchState, touch_state);
+ g_slice_free (MetaTouchState, touch_state);
}
static void
-ensure_seat_slot_allocated (ClutterSeatEvdev *seat,
- int seat_slot)
+ensure_seat_slot_allocated (MetaSeatNative *seat,
+ int seat_slot)
{
if (seat_slot >= seat->n_alloc_touch_states)
{
@@ -105,17 +104,17 @@ ensure_seat_slot_allocated (ClutterSeatEvdev *seat,
seat->n_alloc_touch_states += size_increase;
seat->touch_states = g_realloc_n (seat->touch_states,
seat->n_alloc_touch_states,
- sizeof (ClutterTouchState *));
+ sizeof (MetaTouchState *));
for (i = 0; i < size_increase; i++)
seat->touch_states[seat->n_alloc_touch_states - (i + 1)] = NULL;
}
}
-ClutterTouchState *
-clutter_seat_evdev_acquire_touch_state (ClutterSeatEvdev *seat,
- int device_slot)
+MetaTouchState *
+meta_seat_native_acquire_touch_state (MetaSeatNative *seat,
+ int device_slot)
{
- ClutterTouchState *touch_state;
+ MetaTouchState *touch_state;
int seat_slot;
for (seat_slot = 0; seat_slot < seat->n_alloc_touch_states; seat_slot++)
@@ -126,8 +125,8 @@ clutter_seat_evdev_acquire_touch_state (ClutterSeatEvdev *seat,
ensure_seat_slot_allocated (seat, seat_slot);
- touch_state = g_slice_new0 (ClutterTouchState);
- *touch_state = (ClutterTouchState) {
+ touch_state = g_slice_new0 (MetaTouchState);
+ *touch_state = (MetaTouchState) {
.seat = seat,
.seat_slot = seat_slot,
.device_slot = device_slot,
@@ -139,32 +138,32 @@ clutter_seat_evdev_acquire_touch_state (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_release_touch_state (ClutterSeatEvdev *seat,
- ClutterTouchState *touch_state)
+meta_seat_native_release_touch_state (MetaSeatNative *seat,
+ MetaTouchState *touch_state)
{
g_clear_pointer (&seat->touch_states[touch_state->seat_slot],
clutter_touch_state_free);
}
-ClutterSeatEvdev *
-clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
+MetaSeatNative *
+meta_seat_native_new (MetaDeviceManagerNative *manager_evdev)
{
ClutterDeviceManager *manager = CLUTTER_DEVICE_MANAGER (manager_evdev);
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
ClutterInputDevice *device;
ClutterStage *stage;
ClutterKeymap *keymap;
struct xkb_keymap *xkb_keymap;
- seat = g_new0 (ClutterSeatEvdev, 1);
+ seat = g_new0 (MetaSeatNative, 1);
if (!seat)
return NULL;
seat->manager_evdev = manager_evdev;
- device = _clutter_input_device_evdev_new_virtual (
+ device = meta_input_device_native_new_virtual (
manager, seat, CLUTTER_POINTER_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
- stage = _clutter_device_manager_evdev_get_stage (manager_evdev);
+ stage = meta_device_manager_native_get_stage (manager_evdev);
_clutter_input_device_set_stage (device, stage);
seat->pointer_x = INITIAL_POINTER_X;
seat->pointer_y = INITIAL_POINTER_Y;
@@ -174,7 +173,7 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
_clutter_device_manager_add_device (manager, device);
seat->core_pointer = device;
- device = _clutter_input_device_evdev_new_virtual (
+ device = meta_input_device_native_new_virtual (
manager, seat, CLUTTER_KEYBOARD_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
_clutter_input_device_set_stage (device, stage);
@@ -186,7 +185,7 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
seat->repeat_interval = 33; /* ms */
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
- xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
+ xkb_keymap = meta_keymap_native_get_keyboard_map (META_KEYMAP_NATIVE (keymap));
if (xkb_keymap)
{
@@ -204,7 +203,7 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
}
void
-clutter_seat_evdev_clear_repeat_timer (ClutterSeatEvdev *seat)
+meta_seat_native_clear_repeat_timer (MetaSeatNative *seat)
{
if (seat->repeat_timer)
{
@@ -217,24 +216,24 @@ clutter_seat_evdev_clear_repeat_timer (ClutterSeatEvdev *seat)
static gboolean
keyboard_repeat (gpointer data)
{
- ClutterSeatEvdev *seat = data;
+ MetaSeatNative *seat = data;
GSource *source;
/* There might be events queued in libinput that could cancel the
repeat timer. */
- _clutter_device_manager_evdev_dispatch (seat->manager_evdev);
+ meta_device_manager_native_dispatch (seat->manager_evdev);
if (!seat->repeat_timer)
return G_SOURCE_REMOVE;
g_return_val_if_fail (seat->repeat_device != NULL, G_SOURCE_REMOVE);
source = g_main_context_find_source_by_id (NULL, seat->repeat_timer);
- clutter_seat_evdev_notify_key (seat,
- seat->repeat_device,
- g_source_get_time (source),
- seat->repeat_key,
- AUTOREPEAT_VALUE,
- FALSE);
+ meta_seat_native_notify_key (seat,
+ seat->repeat_device,
+ g_source_get_time (source),
+ seat->repeat_key,
+ AUTOREPEAT_VALUE,
+ FALSE);
return G_SOURCE_CONTINUE;
}
@@ -246,9 +245,9 @@ queue_event (ClutterEvent *event)
}
static int
-update_button_count (ClutterSeatEvdev *seat,
- uint32_t button,
- uint32_t state)
+update_button_count (MetaSeatNative *seat,
+ uint32_t button,
+ uint32_t state)
{
if (state)
{
@@ -265,12 +264,12 @@ update_button_count (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
- ClutterInputDevice *device,
- uint64_t time_us,
- uint32_t key,
- uint32_t state,
- gboolean update_keys)
+meta_seat_native_notify_key (MetaSeatNative *seat,
+ ClutterInputDevice *device,
+ uint64_t time_us,
+ uint32_t key,
+ uint32_t state,
+ gboolean update_keys)
{
ClutterStage *stage;
ClutterEvent *event = NULL;
@@ -291,17 +290,17 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
{
- clutter_seat_evdev_clear_repeat_timer (seat);
+ meta_seat_native_clear_repeat_timer (seat);
return;
}
- event = _clutter_key_event_new_from_evdev (device,
- seat->core_keyboard,
- stage,
- seat->xkb,
- seat->button_state,
- us2ms (time_us), key, state);
- _clutter_evdev_event_set_event_code (event, key);
+ event = meta_key_event_new_from_evdev (device,
+ seat->core_keyboard,
+ stage,
+ seat->xkb,
+ seat->button_state,
+ us2ms (time_us), key, state);
+ meta_event_native_set_event_code (event, key);
/* We must be careful and not pass multiple releases to xkb, otherwise it gets
confused and locks the modifiers */
@@ -325,8 +324,8 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
backend = clutter_get_default_backend ();
g_signal_emit_by_name (clutter_backend_get_keymap (backend), "state-changed");
- clutter_seat_evdev_sync_leds (seat);
- clutter_evdev_a11y_maybe_notify_toggle_keys (CLUTTER_INPUT_DEVICE_EVDEV (seat->core_keyboard));
+ meta_seat_native_sync_leds (seat);
+ meta_input_device_native_a11y_maybe_notify_toggle_keys (META_INPUT_DEVICE_NATIVE
(seat->core_keyboard));
}
if (state == 0 || /* key release */
@@ -334,7 +333,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
!xkb_keymap_key_repeats (xkb_state_get_keymap (seat->xkb),
event->key.hardware_keycode))
{
- clutter_seat_evdev_clear_repeat_timer (seat);
+ meta_seat_native_clear_repeat_timer (seat);
return;
}
@@ -351,7 +350,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
{
guint32 interval;
- clutter_seat_evdev_clear_repeat_timer (seat);
+ meta_seat_native_clear_repeat_timer (seat);
seat->repeat_device = g_object_ref (device);
if (seat->repeat_count == 1)
@@ -373,7 +372,7 @@ clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
}
static ClutterEvent *
-new_absolute_motion_event (ClutterSeatEvdev *seat,
+new_absolute_motion_event (MetaSeatNative *seat,
ClutterInputDevice *input_device,
guint64 time_us,
gfloat x,
@@ -386,17 +385,19 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
event = clutter_event_new (CLUTTER_MOTION);
if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
- _clutter_device_manager_evdev_constrain_pointer (seat->manager_evdev,
- seat->core_pointer,
- time_us,
- seat->pointer_x,
- seat->pointer_y,
- &x, &y);
+ {
+ meta_device_manager_native_constrain_pointer (seat->manager_evdev,
+ seat->core_pointer,
+ time_us,
+ seat->pointer_x,
+ seat->pointer_y,
+ &x, &y);
+ }
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us);
event->motion.stage = stage;
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
event->motion.axes = axes;
@@ -405,8 +406,8 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
- ClutterInputDeviceEvdev *device_evdev =
- CLUTTER_INPUT_DEVICE_EVDEV (input_device);
+ MetaInputDeviceNative *device_evdev =
+ META_INPUT_DEVICE_NATIVE (input_device);
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, input_device);
@@ -428,13 +429,13 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_notify_relative_motion (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- uint64_t time_us,
- float dx,
- float dy,
- float dx_unaccel,
- float dy_unaccel)
+meta_seat_native_notify_relative_motion (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ uint64_t time_us,
+ float dx,
+ float dy,
+ float dx_unaccel,
+ float dy_unaccel)
{
gfloat new_x, new_y;
ClutterEvent *event;
@@ -444,31 +445,32 @@ clutter_seat_evdev_notify_relative_motion (ClutterSeatEvdev *seat,
if (!_clutter_input_device_get_stage (input_device))
return;
- _clutter_device_manager_evdev_filter_relative_motion (seat->manager_evdev,
- input_device,
- seat->pointer_x,
- seat->pointer_y,
- &dx,
- &dy);
+ meta_device_manager_native_filter_relative_motion (seat->manager_evdev,
+ input_device,
+ seat->pointer_x,
+ seat->pointer_y,
+ &dx,
+ &dy);
new_x = seat->pointer_x + dx;
new_y = seat->pointer_y + dy;
event = new_absolute_motion_event (seat, input_device,
time_us, new_x, new_y, NULL);
- _clutter_evdev_event_set_relative_motion (event,
- dx, dy,
- dx_unaccel, dy_unaccel);
+ meta_event_native_set_relative_motion (event,
+ dx, dy,
+ dx_unaccel, dy_unaccel);
queue_event (event);
}
-void clutter_seat_evdev_notify_absolute_motion (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- uint64_t time_us,
- float x,
- float y,
- double *axes)
+void
+meta_seat_native_notify_absolute_motion (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ uint64_t time_us,
+ float x,
+ float y,
+ double *axes)
{
ClutterEvent *event;
@@ -478,13 +480,13 @@ void clutter_seat_evdev_notify_absolute_motion (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- uint64_t time_us,
- uint32_t button,
- uint32_t state)
+meta_seat_native_notify_button (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ uint64_t time_us,
+ uint32_t button,
+ uint32_t state)
{
- ClutterInputDeviceEvdev *device_evdev = (ClutterInputDeviceEvdev *) input_device;
+ MetaInputDeviceNative *device_evdev = (MetaInputDeviceNative *) input_device;
ClutterStage *stage;
ClutterEvent *event = NULL;
gint button_nr;
@@ -561,10 +563,10 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
seat->button_state &= ~maskmap[button_nr - 1];
}
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->button.time = us2ms (time_us);
event->button.stage = CLUTTER_STAGE (stage);
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
event->button.button = button_nr;
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
@@ -589,13 +591,13 @@ clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
/* Apply the button event code as per the tool mapping */
guint mapped_button;
- mapped_button = clutter_input_device_tool_evdev_get_button_code (device_evdev->last_tool,
- button_nr);
+ mapped_button = meta_input_device_tool_native_get_button_code (device_evdev->last_tool,
+ button_nr);
if (mapped_button != 0)
button = mapped_button;
}
- _clutter_evdev_event_set_event_code (event, button);
+ meta_event_native_set_event_code (event, button);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
@@ -621,8 +623,8 @@ notify_scroll (ClutterInputDevice *input_device,
ClutterScrollFinishFlags flags,
gboolean emulated)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
gdouble scroll_factor;
@@ -633,15 +635,15 @@ notify_scroll (ClutterInputDevice *input_device,
if (stage == NULL)
return;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_SCROLL);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage);
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
/* libinput pointer axis events are in pointer motion coordinate space.
* To convert to Xi2 discrete step coordinate space, multiply the factor
@@ -671,8 +673,8 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
ClutterScrollSource scroll_source,
gboolean emulated)
{
- ClutterInputDeviceEvdev *device_evdev;
- ClutterSeatEvdev *seat;
+ MetaInputDeviceNative *device_evdev;
+ MetaSeatNative *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
@@ -685,15 +687,15 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
if (stage == NULL)
return;
- device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
- seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ device_evdev = META_INPUT_DEVICE_NATIVE (input_device);
+ seat = meta_input_device_native_get_seat (device_evdev);
event = clutter_event_new (CLUTTER_SCROLL);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage);
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
event->scroll.direction = direction;
@@ -709,7 +711,7 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
}
static void
-check_notify_discrete_scroll (ClutterSeatEvdev *seat,
+check_notify_discrete_scroll (MetaSeatNative *seat,
ClutterInputDevice *device,
uint64_t time_us,
ClutterScrollSource scroll_source)
@@ -740,13 +742,13 @@ check_notify_discrete_scroll (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_notify_scroll_continuous (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- uint64_t time_us,
- double dx,
- double dy,
- ClutterScrollSource scroll_source,
- ClutterScrollFinishFlags finish_flags)
+meta_seat_native_notify_scroll_continuous (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ uint64_t time_us,
+ double dx,
+ double dy,
+ ClutterScrollSource scroll_source,
+ ClutterScrollFinishFlags finish_flags)
{
if (finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL)
seat->accum_scroll_dx = 0;
@@ -781,12 +783,12 @@ discrete_to_direction (double discrete_dx,
}
void
-clutter_seat_evdev_notify_discrete_scroll (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- uint64_t time_us,
- double discrete_dx,
- double discrete_dy,
- ClutterScrollSource scroll_source)
+meta_seat_native_notify_discrete_scroll (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ uint64_t time_us,
+ double discrete_dx,
+ double discrete_dy,
+ ClutterScrollSource scroll_source)
{
notify_scroll (input_device, time_us,
discrete_dx * DISCRETE_SCROLL_STEP,
@@ -800,13 +802,13 @@ clutter_seat_evdev_notify_discrete_scroll (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
- ClutterInputDevice *input_device,
- ClutterEventType evtype,
- uint64_t time_us,
- int slot,
- double x,
- double y)
+meta_seat_native_notify_touch_event (MetaSeatNative *seat,
+ ClutterInputDevice *input_device,
+ ClutterEventType evtype,
+ uint64_t time_us,
+ int slot,
+ double x,
+ double y)
{
ClutterStage *stage;
ClutterEvent *event = NULL;
@@ -819,18 +821,18 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
event = clutter_event_new (evtype);
- _clutter_evdev_event_set_time_usec (event, time_us);
+ meta_event_native_set_time_usec (event, time_us);
event->touch.time = us2ms (time_us);
event->touch.stage = CLUTTER_STAGE (stage);
event->touch.x = x;
event->touch.y = y;
- clutter_input_device_evdev_translate_coordinates (input_device, stage,
- &event->touch.x,
- &event->touch.y);
+ meta_input_device_native_translate_coordinates (input_device, stage,
+ &event->touch.x,
+ &event->touch.y);
/* "NULL" sequences are special cased in clutter */
event->touch.sequence = GINT_TO_POINTER (MAX (1, slot + 1));
- _clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
+ meta_xkb_translate_state (event, seat->xkb, seat->button_state);
if (evtype == CLUTTER_TOUCH_BEGIN ||
evtype == CLUTTER_TOUCH_UPDATE)
@@ -843,7 +845,7 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_free (ClutterSeatEvdev *seat)
+meta_seat_native_free (MetaSeatNative *seat)
{
GSList *iter;
@@ -858,7 +860,7 @@ clutter_seat_evdev_free (ClutterSeatEvdev *seat)
xkb_state_unref (seat->xkb);
- clutter_seat_evdev_clear_repeat_timer (seat);
+ meta_seat_native_clear_repeat_timer (seat);
if (seat->libinput_seat)
libinput_seat_unref (seat->libinput_seat);
@@ -867,8 +869,8 @@ clutter_seat_evdev_free (ClutterSeatEvdev *seat)
}
ClutterInputDevice *
-clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
- gint id)
+meta_seat_native_get_device (MetaSeatNative *seat,
+ gint id)
{
ClutterInputDevice *device;
GSList *l;
@@ -885,8 +887,8 @@ clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
}
void
-clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat,
- ClutterStage *stage)
+meta_seat_native_set_stage (MetaSeatNative *seat,
+ ClutterStage *stage)
{
GSList *l;
diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h
new file mode 100644
index 000000000..f07142014
--- /dev/null
+++ b/src/backends/native/meta-seat-native.h
@@ -0,0 +1,160 @@
+/*
+ * 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_NATIVE_H
+#define META_SEAT_NATIVE_H
+
+#include <clutter/clutter.h>
+#include <libinput.h>
+#include <linux/input-event-codes.h>
+
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-xkb-utils.h"
+
+typedef struct _MetaTouchState MetaTouchState;
+typedef struct _MetaSeatNative MetaSeatNative;
+
+struct _MetaTouchState
+{
+ MetaSeatNative *seat;
+
+ int device_slot;
+ int seat_slot;
+ ClutterPoint coords;
+};
+
+struct _MetaSeatNative
+{
+ struct libinput_seat *libinput_seat;
+ MetaDeviceManagerNative *manager_evdev;
+
+ GSList *devices;
+
+ ClutterInputDevice *core_pointer;
+ ClutterInputDevice *core_keyboard;
+
+ MetaTouchState **touch_states;
+ int n_alloc_touch_states;
+
+ 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];
+
+ /* keyboard repeat */
+ gboolean repeat;
+ guint32 repeat_delay;
+ guint32 repeat_interval;
+ guint32 repeat_key;
+ guint32 repeat_count;
+ guint32 repeat_timer;
+ ClutterInputDevice *repeat_device;
+
+ gfloat pointer_x;
+ gfloat pointer_y;
+
+ /* Emulation of discrete scroll events out of smooth ones */
+ gfloat accum_scroll_dx;
+ gfloat accum_scroll_dy;
+};
+
+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,
+ struct libinput_seat *libinput_seat);
+
+void meta_seat_native_sync_leds (MetaSeatNative *seat);
+
+ClutterInputDevice * meta_seat_native_get_device (MetaSeatNative *seat,
+ gint id);
+
+MetaTouchState * meta_seat_native_acquire_touch_state (MetaSeatNative *seat,
+ int device_slot);
+
+void meta_seat_native_release_touch_state (MetaSeatNative *seat,
+ MetaTouchState *touch_state);
+
+MetaTouchState * meta_seat_native_get_touch (MetaSeatNative *seat,
+ guint32 id);
+
+void meta_seat_native_set_stage (MetaSeatNative *seat,
+ ClutterStage *stage);
+
+void meta_seat_native_clear_repeat_timer (MetaSeatNative *seat);
+
+MetaSeatNative * meta_seat_native_new (MetaDeviceManagerNative *manager_evdev);
+
+void meta_seat_native_free (MetaSeatNative *seat);
+
+#endif /* META_SEAT_NATIVE_H */
diff --git a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
b/src/backends/native/meta-virtual-input-device-native.c
similarity index 51%
rename from clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
rename to src/backends/native/meta-virtual-input-device-native.c
index c365810ed..88a13cf10 100644
--- a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
+++ b/src/backends/native/meta-virtual-input-device-native.c
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
@@ -21,17 +17,16 @@
* Author: Jonas Ådahl <jadahl gmail com>
*/
-#include "clutter-build-config.h"
+#include "config.h"
+#include <clutter/clutter-mutter.h>
#include <glib-object.h>
#include <linux/input.h>
-#include "clutter-private.h"
-#include "clutter-virtual-input-device.h"
-#include "evdev/clutter-input-device-evdev.h"
-#include "evdev/clutter-keymap-evdev.h"
-#include "evdev/clutter-seat-evdev.h"
-#include "evdev/clutter-virtual-input-device-evdev.h"
+#include "backends/native/meta-input-device-native.h"
+#include "backends/native/meta-keymap-native.h"
+#include "backends/native/meta-seat-native.h"
+#include "backends/native/meta-virtual-input-device-native.h"
enum
{
@@ -44,17 +39,17 @@ enum
static GParamSpec *obj_props[PROP_LAST];
-struct _ClutterVirtualInputDeviceEvdev
+struct _MetaVirtualInputDeviceNative
{
ClutterVirtualInputDevice parent;
ClutterInputDevice *device;
- ClutterSeatEvdev *seat;
+ MetaSeatNative *seat;
int button_count[KEY_CNT];
};
-G_DEFINE_TYPE (ClutterVirtualInputDeviceEvdev,
- clutter_virtual_input_device_evdev,
+G_DEFINE_TYPE (MetaVirtualInputDeviceNative,
+ meta_virtual_input_device_native,
CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE)
typedef enum _EvdevButtonType
@@ -65,9 +60,9 @@ typedef enum _EvdevButtonType
} EvdevButtonType;
static int
-update_button_count (ClutterVirtualInputDeviceEvdev *virtual_evdev,
- uint32_t button,
- uint32_t state)
+update_button_count (MetaVirtualInputDeviceNative *virtual_evdev,
+ uint32_t button,
+ uint32_t state)
{
if (state)
return ++virtual_evdev->button_count[button];
@@ -114,8 +109,8 @@ get_button_type (uint16_t code)
static void
release_pressed_buttons (ClutterVirtualInputDevice *virtual_device)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
int code;
uint64_t time_us;
@@ -147,41 +142,41 @@ release_pressed_buttons (ClutterVirtualInputDevice *virtual_device)
}
static void
-clutter_virtual_input_device_evdev_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- double dx,
- double dy)
+meta_virtual_input_device_native_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ double dx,
+ double dy)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- clutter_seat_evdev_notify_relative_motion (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- dx, dy,
- dx, dy);
+ meta_seat_native_notify_relative_motion (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ dx, dy,
+ dx, dy);
}
static void
-clutter_virtual_input_device_evdev_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- double x,
- double y)
+meta_virtual_input_device_native_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ double x,
+ double y)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- clutter_seat_evdev_notify_absolute_motion (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- x, y,
- NULL);
+ meta_seat_native_notify_absolute_motion (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ x, y,
+ NULL);
}
static int
@@ -205,13 +200,13 @@ translate_to_evdev_button (int clutter_button)
}
static void
-clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- uint32_t button,
- ClutterButtonState button_state)
+meta_virtual_input_device_native_notify_button (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ uint32_t button,
+ ClutterButtonState button_state)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
int button_count;
int evdev_button;
@@ -236,21 +231,21 @@ clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *vir
return;
}
- clutter_seat_evdev_notify_button (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- evdev_button,
- button_state);
+ meta_seat_native_notify_button (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ evdev_button,
+ button_state);
}
static void
-clutter_virtual_input_device_evdev_notify_key (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- uint32_t key,
- ClutterKeyState key_state)
+meta_virtual_input_device_native_notify_key (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ uint32_t key,
+ ClutterKeyState key_state)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
int key_count;
if (time_us == CLUTTER_CURRENT_TIME)
@@ -271,12 +266,12 @@ clutter_virtual_input_device_evdev_notify_key (ClutterVirtualInputDevice *virtua
return;
}
- clutter_seat_evdev_notify_key (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- key,
- key_state,
- TRUE);
+ meta_seat_native_notify_key (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ key,
+ key_state,
+ TRUE);
}
static gboolean
@@ -285,8 +280,8 @@ pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_dev
guint *keycode_out,
guint *level_out)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
ClutterKeymap *keymap;
struct xkb_keymap *xkb_keymap;
struct xkb_state *state;
@@ -294,7 +289,7 @@ pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_dev
xkb_keycode_t min_keycode, max_keycode;
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
- xkb_keymap = clutter_keymap_evdev_get_keyboard_map (CLUTTER_KEYMAP_EVDEV (keymap));
+ xkb_keymap = meta_keymap_native_get_keyboard_map (META_KEYMAP_NATIVE (keymap));
state = virtual_evdev->seat->xkb;
layout = xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE);
@@ -331,8 +326,8 @@ apply_level_modifiers (ClutterVirtualInputDevice *virtual_device,
uint32_t level,
uint32_t key_state)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
guint keysym, keycode, evcode;
if (level == 0)
@@ -358,22 +353,22 @@ apply_level_modifiers (ClutterVirtualInputDevice *virtual_device,
clutter_input_device_keycode_to_evdev (virtual_evdev->device,
keycode, &evcode);
- clutter_seat_evdev_notify_key (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- evcode,
- key_state,
- TRUE);
+ meta_seat_native_notify_key (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ evcode,
+ key_state,
+ TRUE);
}
static void
-clutter_virtual_input_device_evdev_notify_keyval (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- uint32_t keyval,
- ClutterKeyState key_state)
+meta_virtual_input_device_native_notify_keyval (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ uint32_t keyval,
+ ClutterKeyState key_state)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
int key_count;
guint keycode = 0, level = 0, evcode = 0;
@@ -408,12 +403,12 @@ clutter_virtual_input_device_evdev_notify_keyval (ClutterVirtualInputDevice *vir
if (key_state)
apply_level_modifiers (virtual_device, time_us, level, key_state);
- clutter_seat_evdev_notify_key (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- evcode,
- key_state,
- TRUE);
+ meta_seat_native_notify_key (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ evcode,
+ key_state,
+ TRUE);
if (!key_state)
apply_level_modifiers (virtual_device, time_us, level, key_state);
@@ -449,13 +444,13 @@ direction_to_discrete (ClutterScrollDirection direction,
}
static void
-clutter_virtual_input_device_evdev_notify_discrete_scroll (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- ClutterScrollDirection direction,
- ClutterScrollSource scroll_source)
+meta_virtual_input_device_native_notify_discrete_scroll (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ ClutterScrollDirection direction,
+ ClutterScrollSource scroll_source)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
double discrete_dx = 0.0, discrete_dy = 0.0;
if (time_us == CLUTTER_CURRENT_TIME)
@@ -463,139 +458,139 @@ clutter_virtual_input_device_evdev_notify_discrete_scroll (ClutterVirtualInputDe
direction_to_discrete (direction, &discrete_dx, &discrete_dy);
- clutter_seat_evdev_notify_discrete_scroll (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- discrete_dx, discrete_dy,
- scroll_source);
+ meta_seat_native_notify_discrete_scroll (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ discrete_dx, discrete_dy,
+ scroll_source);
}
static void
-clutter_virtual_input_device_evdev_notify_scroll_continuous (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- double dx,
- double dy,
- ClutterScrollSource scroll_source,
- ClutterScrollFinishFlags finish_flags)
+meta_virtual_input_device_native_notify_scroll_continuous (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ double dx,
+ double dy,
+ ClutterScrollSource scroll_source,
+ ClutterScrollFinishFlags finish_flags)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- clutter_seat_evdev_notify_scroll_continuous (virtual_evdev->seat,
- virtual_evdev->device,
- time_us,
- dx, dy,
- scroll_source,
- CLUTTER_SCROLL_FINISHED_NONE);
+ meta_seat_native_notify_scroll_continuous (virtual_evdev->seat,
+ virtual_evdev->device,
+ time_us,
+ dx, dy,
+ scroll_source,
+ CLUTTER_SCROLL_FINISHED_NONE);
}
static void
-clutter_virtual_input_device_evdev_notify_touch_down (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- int device_slot,
- double x,
- double y)
+meta_virtual_input_device_native_notify_touch_down (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ int device_slot,
+ double x,
+ double y)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
- ClutterInputDeviceEvdev *device_evdev =
- CLUTTER_INPUT_DEVICE_EVDEV (virtual_evdev->device);
- ClutterTouchState *touch_state;
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
+ MetaInputDeviceNative *device_evdev =
+ META_INPUT_DEVICE_NATIVE (virtual_evdev->device);
+ MetaTouchState *touch_state;
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- touch_state = clutter_input_device_evdev_acquire_touch_state (device_evdev,
- device_slot);
+ touch_state = meta_input_device_native_acquire_touch_state (device_evdev,
+ device_slot);
if (!touch_state)
return;
touch_state->coords.x = x;
touch_state->coords.y = y;
- clutter_seat_evdev_notify_touch_event (virtual_evdev->seat,
- virtual_evdev->device,
- CLUTTER_TOUCH_BEGIN,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (virtual_evdev->seat,
+ virtual_evdev->device,
+ CLUTTER_TOUCH_BEGIN,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
}
static void
-clutter_virtual_input_device_evdev_notify_touch_motion (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- int device_slot,
- double x,
- double y)
+meta_virtual_input_device_native_notify_touch_motion (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ int device_slot,
+ double x,
+ double y)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
- ClutterInputDeviceEvdev *device_evdev =
- CLUTTER_INPUT_DEVICE_EVDEV (virtual_evdev->device);
- ClutterTouchState *touch_state;
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
+ MetaInputDeviceNative *device_evdev =
+ META_INPUT_DEVICE_NATIVE (virtual_evdev->device);
+ MetaTouchState *touch_state;
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- touch_state = clutter_input_device_evdev_lookup_touch_state (device_evdev,
- device_slot);
+ touch_state = meta_input_device_native_lookup_touch_state (device_evdev,
+ device_slot);
if (!touch_state)
return;
touch_state->coords.x = x;
touch_state->coords.y = y;
- clutter_seat_evdev_notify_touch_event (virtual_evdev->seat,
- virtual_evdev->device,
- CLUTTER_TOUCH_BEGIN,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (virtual_evdev->seat,
+ virtual_evdev->device,
+ CLUTTER_TOUCH_BEGIN,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
}
static void
-clutter_virtual_input_device_evdev_notify_touch_up (ClutterVirtualInputDevice *virtual_device,
- uint64_t time_us,
- int device_slot)
+meta_virtual_input_device_native_notify_touch_up (ClutterVirtualInputDevice *virtual_device,
+ uint64_t time_us,
+ int device_slot)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
- ClutterInputDeviceEvdev *device_evdev =
- CLUTTER_INPUT_DEVICE_EVDEV (virtual_evdev->device);
- ClutterTouchState *touch_state;
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (virtual_device);
+ MetaInputDeviceNative *device_evdev =
+ META_INPUT_DEVICE_NATIVE (virtual_evdev->device);
+ MetaTouchState *touch_state;
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
- touch_state = clutter_input_device_evdev_lookup_touch_state (device_evdev,
- device_slot);
+ touch_state = meta_input_device_native_lookup_touch_state (device_evdev,
+ device_slot);
if (!touch_state)
return;
- clutter_seat_evdev_notify_touch_event (virtual_evdev->seat,
- virtual_evdev->device,
- CLUTTER_TOUCH_BEGIN,
- time_us,
- touch_state->seat_slot,
- touch_state->coords.x,
- touch_state->coords.y);
+ meta_seat_native_notify_touch_event (virtual_evdev->seat,
+ virtual_evdev->device,
+ CLUTTER_TOUCH_BEGIN,
+ time_us,
+ touch_state->seat_slot,
+ touch_state->coords.x,
+ touch_state->coords.y);
- clutter_input_device_evdev_release_touch_state (device_evdev, touch_state);
+ meta_input_device_native_release_touch_state (device_evdev, touch_state);
}
static void
-clutter_virtual_input_device_evdev_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+meta_virtual_input_device_native_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (object);
switch (prop_id)
{
@@ -609,13 +604,13 @@ clutter_virtual_input_device_evdev_get_property (GObject *object,
}
static void
-clutter_virtual_input_device_evdev_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+meta_virtual_input_device_native_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (object);
switch (prop_id)
{
@@ -629,12 +624,12 @@ clutter_virtual_input_device_evdev_set_property (GObject *object,
}
static void
-clutter_virtual_input_device_evdev_constructed (GObject *object)
+meta_virtual_input_device_native_constructed (GObject *object)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (object);
ClutterDeviceManager *manager;
ClutterInputDeviceType device_type;
ClutterStage *stage;
@@ -643,63 +638,63 @@ clutter_virtual_input_device_evdev_constructed (GObject *object)
device_type = clutter_virtual_input_device_get_device_type (virtual_device);
virtual_evdev->device =
- _clutter_input_device_evdev_new_virtual (manager,
- virtual_evdev->seat,
- device_type,
- CLUTTER_INPUT_MODE_SLAVE);
+ meta_input_device_native_new_virtual (manager,
+ virtual_evdev->seat,
+ device_type,
+ CLUTTER_INPUT_MODE_SLAVE);
- stage = _clutter_device_manager_evdev_get_stage (CLUTTER_DEVICE_MANAGER_EVDEV (manager));
+ stage = meta_device_manager_native_get_stage (META_DEVICE_MANAGER_NATIVE (manager));
_clutter_input_device_set_stage (virtual_evdev->device, stage);
}
static void
-clutter_virtual_input_device_evdev_finalize (GObject *object)
+meta_virtual_input_device_native_finalize (GObject *object)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
- ClutterVirtualInputDeviceEvdev *virtual_evdev =
- CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
+ MetaVirtualInputDeviceNative *virtual_evdev =
+ META_VIRTUAL_INPUT_DEVICE_NATIVE (object);
GObjectClass *object_class;
release_pressed_buttons (virtual_device);
g_clear_object (&virtual_evdev->device);
object_class =
- G_OBJECT_CLASS (clutter_virtual_input_device_evdev_parent_class);
+ G_OBJECT_CLASS (meta_virtual_input_device_native_parent_class);
object_class->finalize (object);
}
static void
-clutter_virtual_input_device_evdev_init (ClutterVirtualInputDeviceEvdev *virtual_device_evdev)
+meta_virtual_input_device_native_init (MetaVirtualInputDeviceNative *virtual_device_evdev)
{
}
static void
-clutter_virtual_input_device_evdev_class_init (ClutterVirtualInputDeviceEvdevClass *klass)
+meta_virtual_input_device_native_class_init (MetaVirtualInputDeviceNativeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterVirtualInputDeviceClass *virtual_input_device_class =
CLUTTER_VIRTUAL_INPUT_DEVICE_CLASS (klass);
- object_class->get_property = clutter_virtual_input_device_evdev_get_property;
- object_class->set_property = clutter_virtual_input_device_evdev_set_property;
- object_class->constructed = clutter_virtual_input_device_evdev_constructed;
- object_class->finalize = clutter_virtual_input_device_evdev_finalize;
-
- virtual_input_device_class->notify_relative_motion =
clutter_virtual_input_device_evdev_notify_relative_motion;
- virtual_input_device_class->notify_absolute_motion =
clutter_virtual_input_device_evdev_notify_absolute_motion;
- virtual_input_device_class->notify_button = clutter_virtual_input_device_evdev_notify_button;
- virtual_input_device_class->notify_key = clutter_virtual_input_device_evdev_notify_key;
- virtual_input_device_class->notify_keyval = clutter_virtual_input_device_evdev_notify_keyval;
- virtual_input_device_class->notify_discrete_scroll =
clutter_virtual_input_device_evdev_notify_discrete_scroll;
- virtual_input_device_class->notify_scroll_continuous =
clutter_virtual_input_device_evdev_notify_scroll_continuous;
- virtual_input_device_class->notify_touch_down = clutter_virtual_input_device_evdev_notify_touch_down;
- virtual_input_device_class->notify_touch_motion = clutter_virtual_input_device_evdev_notify_touch_motion;
- virtual_input_device_class->notify_touch_up = clutter_virtual_input_device_evdev_notify_touch_up;
+ object_class->get_property = meta_virtual_input_device_native_get_property;
+ object_class->set_property = meta_virtual_input_device_native_set_property;
+ object_class->constructed = meta_virtual_input_device_native_constructed;
+ object_class->finalize = meta_virtual_input_device_native_finalize;
+
+ virtual_input_device_class->notify_relative_motion =
meta_virtual_input_device_native_notify_relative_motion;
+ virtual_input_device_class->notify_absolute_motion =
meta_virtual_input_device_native_notify_absolute_motion;
+ virtual_input_device_class->notify_button = meta_virtual_input_device_native_notify_button;
+ virtual_input_device_class->notify_key = meta_virtual_input_device_native_notify_key;
+ virtual_input_device_class->notify_keyval = meta_virtual_input_device_native_notify_keyval;
+ virtual_input_device_class->notify_discrete_scroll =
meta_virtual_input_device_native_notify_discrete_scroll;
+ virtual_input_device_class->notify_scroll_continuous =
meta_virtual_input_device_native_notify_scroll_continuous;
+ virtual_input_device_class->notify_touch_down = meta_virtual_input_device_native_notify_touch_down;
+ virtual_input_device_class->notify_touch_motion = meta_virtual_input_device_native_notify_touch_motion;
+ virtual_input_device_class->notify_touch_up = meta_virtual_input_device_native_notify_touch_up;
obj_props[PROP_SEAT] = g_param_spec_pointer ("seat",
- P_("ClutterSeatEvdev"),
- P_("ClutterSeatEvdev"),
+ P_("Seat"),
+ P_("Seat"),
CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
diff --git a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.h
b/src/backends/native/meta-virtual-input-device-native.h
similarity index 63%
rename from clutter/clutter/evdev/clutter-virtual-input-device-evdev.h
rename to src/backends/native/meta-virtual-input-device-native.h
index 9bb8db016..fdf88679f 100644
--- a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.h
+++ b/src/backends/native/meta-virtual-input-device-native.h
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
@@ -21,15 +17,15 @@
* Author: Jonas Ådahl <jadahl gmail com>
*/
-#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
-#define __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
+#ifndef META_VIRTUAL_INPUT_DEVICE_NATIVE_H
+#define META_VIRTUAL_INPUT_DEVICE_NATIVE_H
#include "clutter-virtual-input-device.h"
-#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV (clutter_virtual_input_device_evdev_get_type ())
-G_DECLARE_FINAL_TYPE (ClutterVirtualInputDeviceEvdev,
- clutter_virtual_input_device_evdev,
- CLUTTER, VIRTUAL_INPUT_DEVICE_EVDEV,
+#define META_TYPE_VIRTUAL_INPUT_DEVICE_NATIVE (meta_virtual_input_device_native_get_type ())
+G_DECLARE_FINAL_TYPE (MetaVirtualInputDeviceNative,
+ meta_virtual_input_device_native,
+ META, VIRTUAL_INPUT_DEVICE_NATIVE,
ClutterVirtualInputDevice)
-#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__ */
+#endif /* META_VIRTUAL_INPUT_DEVICE_NATIVE_H */
diff --git a/clutter/clutter/evdev/clutter-xkb-utils.c b/src/backends/native/meta-xkb-utils.c
similarity index 78%
rename from clutter/clutter/evdev/clutter-xkb-utils.c
rename to src/backends/native/meta-xkb-utils.c
index 0a9a8387b..7091a129b 100644
--- a/clutter/clutter/evdev/clutter-xkb-utils.c
+++ b/src/backends/native/meta-xkb-utils.c
@@ -1,8 +1,4 @@
/*
- * Clutter.
- *
- * An OpenGL based 'interactive canvas' library.
- *
* Copyright (C) 2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
@@ -23,11 +19,12 @@
* Damien Lespiau <damien lespiau intel com>
*/
-#include "clutter-build-config.h"
+#include "config.h"
+
+#include <clutter/clutter-keysyms.h>
+#include <clutter/clutter-mutter.h>
-#include "clutter-keysyms.h"
-#include "clutter-event-private.h"
-#include "clutter-xkb-utils.h"
+#include "backends/native/meta-xkb-utils.h"
/*
* _clutter_event_new_from_evdev: Create a new Clutter ClutterKeyEvent
@@ -44,14 +41,14 @@
* Return value: the new #ClutterEvent
*/
ClutterEvent *
-_clutter_key_event_new_from_evdev (ClutterInputDevice *device,
- ClutterInputDevice *core_device,
- ClutterStage *stage,
- struct xkb_state *xkb_state,
- uint32_t button_state,
- uint32_t _time,
- xkb_keycode_t key,
- uint32_t state)
+meta_key_event_new_from_evdev (ClutterInputDevice *device,
+ ClutterInputDevice *core_device,
+ ClutterStage *stage,
+ struct xkb_state *xkb_state,
+ uint32_t button_state,
+ uint32_t _time,
+ xkb_keycode_t key,
+ uint32_t state)
{
ClutterEvent *event;
xkb_keysym_t sym;
@@ -78,7 +75,7 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
event->key.stage = stage;
event->key.time = _time;
- _clutter_xkb_translate_state (event, xkb_state, button_state);
+ meta_xkb_translate_state (event, xkb_state, button_state);
event->key.hardware_keycode = key;
event->key.keyval = sym;
clutter_event_set_device (event, core_device);
@@ -102,9 +99,9 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
}
void
-_clutter_xkb_translate_state (ClutterEvent *event,
- struct xkb_state *state,
- uint32_t button_state)
+meta_xkb_translate_state (ClutterEvent *event,
+ struct xkb_state *state,
+ uint32_t button_state)
{
_clutter_event_set_state_full (event,
button_state,
diff --git a/src/backends/native/meta-xkb-utils.h b/src/backends/native/meta-xkb-utils.h
new file mode 100644
index 000000000..32a2dd377
--- /dev/null
+++ b/src/backends/native/meta-xkb-utils.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 Intel Corporation.
+ *
+ * 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/>.
+
+ * Authors:
+ * Damien Lespiau <damien lespiau intel com>
+ */
+
+#ifndef META_XKB_UTILS_H
+#define META_XKB_UTILS_H
+
+#include <xkbcommon/xkbcommon.h>
+
+#include "clutter-stage.h"
+#include "clutter-event.h"
+#include "clutter-input-device.h"
+
+ClutterEvent * meta_key_event_new_from_evdev (ClutterInputDevice *device,
+ ClutterInputDevice *core_keyboard,
+ ClutterStage *stage,
+ struct xkb_state *xkb_state,
+ uint32_t button_state,
+ uint32_t _time,
+ uint32_t key,
+ uint32_t state);
+void meta_xkb_translate_state (ClutterEvent *event,
+ struct xkb_state *xkb_state,
+ uint32_t button_state);
+
+#endif /* META_XKB_UTILS_H */
diff --git a/src/meson.build b/src/meson.build
index a3e0c1ccb..57dfd77c3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -125,6 +125,8 @@ if have_native_backend
gudev_dep,
libgbm_dep,
logind_provider_dep,
+ libudev_dep,
+ xkbcommon_dep,
]
endif
@@ -595,16 +597,26 @@ if have_native_backend
'backends/native/meta-crtc-kms.h',
'backends/native/meta-cursor-renderer-native.c',
'backends/native/meta-cursor-renderer-native.h',
+ 'backends/native/meta-device-manager-native.c',
+ 'backends/native/meta-device-manager-native.h',
'backends/native/meta-drm-buffer-dumb.c',
'backends/native/meta-drm-buffer-dumb.h',
'backends/native/meta-drm-buffer-gbm.c',
'backends/native/meta-drm-buffer-gbm.h',
'backends/native/meta-drm-buffer.c',
'backends/native/meta-drm-buffer.h',
+ 'backends/native/meta-event-native.c',
+ 'backends/native/meta-event-native.h',
'backends/native/meta-gpu-kms.c',
'backends/native/meta-gpu-kms.h',
+ 'backends/native/meta-input-device-native.c',
+ 'backends/native/meta-input-device-native.h',
+ 'backends/native/meta-input-device-tool-native.c',
+ 'backends/native/meta-input-device-tool-native.h',
'backends/native/meta-input-settings-native.c',
'backends/native/meta-input-settings-native.h',
+ 'backends/native/meta-keymap-native.c',
+ 'backends/native/meta-keymap-native.h',
'backends/native/meta-launcher.c',
'backends/native/meta-launcher.h',
'backends/native/meta-monitor-manager-kms.c',
@@ -643,10 +655,16 @@ if have_native_backend
'backends/native/meta-renderer-native-gles3.c',
'backends/native/meta-renderer-native-gles3.h',
'backends/native/meta-renderer-native.h',
+ 'backends/native/meta-seat-native.c',
+ 'backends/native/meta-seat-native.h',
'backends/native/meta-stage-native.c',
'backends/native/meta-stage-native.h',
'backends/native/meta-udev.c',
'backends/native/meta-udev.h',
+ 'backends/native/meta-virtual-input-device-native.c',
+ 'backends/native/meta-virtual-input-device-native.h',
+ 'backends/native/meta-xkb-utils.c',
+ 'backends/native/meta-xkb-utils.h',
]
endif
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 291faa1e9..0c3447137 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -56,12 +56,12 @@
#include <unistd.h>
#include "backends/meta-backend-private.h"
-#include "clutter/evdev/clutter-evdev.h"
#include "core/display-private.h"
#include "wayland/meta-wayland-private.h"
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
+#include "backends/native/meta-event-native.h"
#endif
#define GSD_KEYBOARD_SCHEMA "org.gnome.settings-daemon.peripherals.keyboard"
@@ -531,7 +531,7 @@ default_grab_key (MetaWaylandKeyboardGrab *grab,
#ifdef HAVE_NATIVE_BACKEND
if (META_IS_BACKEND_NATIVE (backend))
- code = clutter_evdev_event_get_event_code (event);
+ code = meta_event_native_get_event_code (event);
if (code == 0)
#endif
code = evdev_code (&event->key);
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 3ace7b3e4..a724fc538 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -52,7 +52,6 @@
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-cursor.h"
#include "clutter/clutter.h"
-#include "clutter/evdev/clutter-evdev.h"
#include "cogl/cogl-wayland-server.h"
#include "cogl/cogl.h"
#include "compositor/meta-surface-actor-wayland.h"
@@ -68,6 +67,7 @@
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
+#include "backends/native/meta-event-native.h"
#endif
#include "relative-pointer-unstable-v1-server-protocol.h"
@@ -295,7 +295,7 @@ meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
return;
#ifdef HAVE_NATIVE_BACKEND
- time_us = clutter_evdev_event_get_time_usec (event);
+ time_us = meta_event_native_get_time_usec (event);
if (time_us == 0)
#endif
time_us = clutter_event_get_time (event) * 1000ULL;
@@ -369,7 +369,7 @@ meta_wayland_pointer_send_button (MetaWaylandPointer *pointer,
#ifdef HAVE_NATIVE_BACKEND
MetaBackend *backend = meta_get_backend ();
if (META_IS_BACKEND_NATIVE (backend))
- button = clutter_evdev_event_get_event_code (event);
+ button = meta_event_native_get_event_code (event);
else
#endif
{
diff --git a/src/wayland/meta-wayland-tablet-pad-group.c b/src/wayland/meta-wayland-tablet-pad-group.c
index 583fa0999..4229f834a 100644
--- a/src/wayland/meta-wayland-tablet-pad-group.c
+++ b/src/wayland/meta-wayland-tablet-pad-group.c
@@ -34,7 +34,8 @@
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
-#include "clutter/evdev/clutter-evdev.h"
+#include "backends/native/meta-event-native.h"
+#include "backends/native/meta-input-device-native.h"
#endif
#include "tablet-unstable-v2-server-protocol.h"
@@ -131,7 +132,7 @@ meta_wayland_tablet_pad_group_has_button (MetaWaylandTabletPadGroup *group,
struct libinput_tablet_pad_mode_group *mode_group;
guint n_group;
- libinput_device = clutter_evdev_input_device_get_libinput_device (group->pad->device);
+ libinput_device = meta_input_device_native_get_libinput_device (group->pad->device);
n_group = g_list_index (group->pad->groups, group);
mode_group = libinput_device_tablet_pad_get_mode_group (libinput_device, n_group);
diff --git a/src/wayland/meta-wayland-tablet-pad.c b/src/wayland/meta-wayland-tablet-pad.c
index ed31e236f..335d3d030 100644
--- a/src/wayland/meta-wayland-tablet-pad.c
+++ b/src/wayland/meta-wayland-tablet-pad.c
@@ -38,8 +38,9 @@
#include "wayland/meta-wayland-tablet.h"
#ifdef HAVE_NATIVE_BACKEND
+#include <libinput.h>
#include "backends/native/meta-backend-native.h"
-#include "clutter/evdev/clutter-evdev.h"
+#include "backends/native/meta-input-device-native.h"
#endif
#include "tablet-unstable-v2-server-protocol.h"
@@ -69,7 +70,7 @@ group_rings_strips (MetaWaylandTabletPad *pad)
struct libinput_device *libinput_device = NULL;
if (META_IS_BACKEND_NATIVE (backend))
- libinput_device = clutter_evdev_input_device_get_libinput_device (pad->device);
+ libinput_device = meta_input_device_native_get_libinput_device (pad->device);
#endif
for (n_group = 0, g = pad->groups; g; g = g->next)
@@ -153,7 +154,7 @@ meta_wayland_tablet_pad_new (ClutterInputDevice *device,
{
struct libinput_device *libinput_device;
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
+ libinput_device = meta_input_device_native_get_libinput_device (device);
pad->n_buttons = libinput_device_tablet_pad_get_num_buttons (libinput_device);
}
#endif
diff --git a/src/wayland/meta-wayland-tablet-seat.c b/src/wayland/meta-wayland-tablet-seat.c
index dd35724c4..b4bc4aa58 100644
--- a/src/wayland/meta-wayland-tablet-seat.c
+++ b/src/wayland/meta-wayland-tablet-seat.c
@@ -34,7 +34,6 @@
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
-#include "clutter/evdev/clutter-evdev.h"
#endif
#include "tablet-unstable-v2-server-protocol.h"
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index d243608cf..5adbc20f4 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -28,7 +28,6 @@
#include <glib.h>
#include <wayland-server.h>
-#include "clutter/evdev/clutter-evdev.h"
#include "wayland/meta-wayland-private.h"
#include "wayland/meta-wayland-tablet-cursor-surface.h"
#include "compositor/meta-surface-actor-wayland.h"
@@ -39,8 +38,8 @@
#ifdef HAVE_NATIVE_BACKEND
#include <linux/input-event-codes.h>
-
#include "backends/native/meta-backend-native.h"
+#include "backends/native/meta-event-native.h"
#endif
#include "tablet-unstable-v2-server-protocol.h"
@@ -724,7 +723,7 @@ broadcast_button (MetaWaylandTabletTool *tool,
MetaBackend *backend = meta_get_backend ();
if (META_IS_BACKEND_NATIVE (backend))
{
- button = clutter_evdev_event_get_event_code (event);
+ button = meta_event_native_get_event_code (event);
}
else
#endif
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index 5ea4c4b27..80c3b57e0 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -27,11 +27,13 @@
#include <string.h>
#include "compositor/meta-surface-actor-wayland.h"
-#include "clutter/evdev/clutter-evdev.h"
#include "wayland/meta-wayland-private.h"
#ifdef HAVE_NATIVE_BACKEND
+#include <libinput.h>
#include "backends/native/meta-backend-native.h"
+#include "backends/native/meta-device-manager-native.h"
+#include "backends/native/meta-event-native.h"
#endif
G_DEFINE_TYPE (MetaWaylandTouch, meta_wayland_touch,
@@ -186,7 +188,7 @@ touch_get_info (MetaWaylandTouch *touch,
if (!touch_info && create)
{
touch_info = g_new0 (MetaWaylandTouchInfo, 1);
- touch_info->slot = clutter_evdev_event_sequence_get_slot (sequence);
+ touch_info->slot = meta_event_native_sequence_get_slot (sequence);
g_hash_table_insert (touch->touches, sequence, touch_info);
}
@@ -412,7 +414,7 @@ check_send_frame_event (MetaWaylandTouch *touch,
if (META_IS_BACKEND_NATIVE (backend))
{
sequence = clutter_event_get_event_sequence (event);
- slot = clutter_evdev_event_sequence_get_slot (sequence);
+ slot = meta_event_native_sequence_get_slot (sequence);
touch->frame_slots &= ~(1 << slot);
if (touch->frame_slots == 0)
@@ -568,7 +570,7 @@ meta_wayland_touch_enable (MetaWaylandTouch *touch)
#ifdef HAVE_NATIVE_BACKEND
MetaBackend *backend = meta_get_backend ();
if (META_IS_BACKEND_NATIVE (backend))
- clutter_evdev_add_filter (evdev_filter_func, touch, NULL);
+ meta_device_manager_native_add_filter (evdev_filter_func, touch, NULL);
#endif
}
@@ -578,7 +580,7 @@ meta_wayland_touch_disable (MetaWaylandTouch *touch)
#ifdef HAVE_NATIVE_BACKEND
MetaBackend *backend = meta_get_backend ();
if (META_IS_BACKEND_NATIVE (backend))
- clutter_evdev_remove_filter (evdev_filter_func, touch);
+ meta_device_manager_native_remove_filter (evdev_filter_func, touch);
#endif
meta_wayland_touch_cancel (touch);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]