[mutter/wip/carlosg/device-size-through-udev: 2/2] clutter: Drop no longer necessary API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/device-size-through-udev: 2/2] clutter: Drop no longer necessary API
- Date: Mon, 25 Mar 2019 13:09:32 +0000 (UTC)
commit 47663c7e0fd217be195f0af1db1aa05cfa8c8aa6
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Mar 22 15:51:21 2019 +0100
clutter: Drop no longer necessary API
clutter_input_device_get_physical_size was just used for device mapping
heuristics in MetaInputMapper. It now started using the info from udev
on for both backends, so this means this clutter API is no longer
necessary.
https://gitlab.gnome.org/GNOME/mutter/issues/514
clutter/clutter/clutter-device-manager-private.h | 4 --
clutter/clutter/clutter-input-device.c | 12 -----
clutter/clutter/clutter-input-device.h | 4 --
clutter/clutter/evdev/clutter-input-device-evdev.c | 13 ------
clutter/clutter/x11/clutter-input-device-xi2.c | 51 ----------------------
5 files changed, 84 deletions(-)
---
diff --git a/clutter/clutter/clutter-device-manager-private.h
b/clutter/clutter/clutter-device-manager-private.h
index 60cb99d55..2364fd27c 100644
--- a/clutter/clutter/clutter-device-manager-private.h
+++ b/clutter/clutter/clutter-device-manager-private.h
@@ -167,10 +167,6 @@ struct _ClutterInputDeviceClass
gboolean (* is_grouped) (ClutterInputDevice *device,
ClutterInputDevice *other_device);
- gboolean (* get_physical_size) (ClutterInputDevice *device,
- gdouble *width,
- gdouble *height);
-
/* Keyboard accessbility */
void (* process_kbd_a11y_event) (ClutterEvent *event,
ClutterInputDevice *device,
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index 5de169c11..0697e3a1a 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -2284,15 +2284,3 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
}
-
-gboolean
-clutter_input_device_get_physical_size (ClutterInputDevice *device,
- gdouble *width,
- gdouble *height)
-{
- g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
-
- return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
- width,
- height);
-}
diff --git a/clutter/clutter/clutter-input-device.h b/clutter/clutter/clutter-input-device.h
index 8dd2a54b9..c121fe12c 100644
--- a/clutter/clutter/clutter-input-device.h
+++ b/clutter/clutter/clutter-input-device.h
@@ -171,10 +171,6 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
CLUTTER_EXPORT
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device);
-CLUTTER_EXPORT
-gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
- gdouble *width,
- gdouble *height);
G_END_DECLS
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c
b/clutter/clutter/evdev/clutter-input-device-evdev.c
index 325881287..25a8139a2 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.c
@@ -1263,18 +1263,6 @@ clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
GINT_TO_POINTER (touch_state->device_slot));
}
-static gboolean
-clutter_input_device_evdev_get_physical_size (ClutterInputDevice *device,
- gdouble *width,
- gdouble *height)
-{
- struct libinput_device *libinput_device;
-
- libinput_device = clutter_evdev_input_device_get_libinput_device (device);
-
- return libinput_device_get_size (libinput_device, width, height) == 0;
-}
-
static void
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
{
@@ -1290,7 +1278,6 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
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;
- klass->get_physical_size = clutter_input_device_evdev_get_physical_size;
obj_props[PROP_DEVICE_MATRIX] =
g_param_spec_boxed ("device-matrix",
diff --git a/clutter/clutter/x11/clutter-input-device-xi2.c b/clutter/clutter/x11/clutter-input-device-xi2.c
index 92d3637da..1254aca3a 100644
--- a/clutter/clutter/x11/clutter-input-device-xi2.c
+++ b/clutter/clutter/x11/clutter-input-device-xi2.c
@@ -180,56 +180,6 @@ clutter_input_device_xi2_is_mode_switch_button (ClutterInputDevice *device,
return button_group == (int) group;
}
-static gboolean
-clutter_input_device_xi2_get_physical_size (ClutterInputDevice *device,
- gdouble *width,
- gdouble *height)
-{
- Display *xdisplay;
- XIDeviceInfo *dev_info;
- gdouble w = 0, h = 0;
- int i, n_info, device_id;
-
- xdisplay = clutter_x11_get_default_display ();
- device_id = clutter_input_device_get_device_id (device);
-
- clutter_x11_trap_x_errors ();
- dev_info = XIQueryDevice (xdisplay, device_id, &n_info);
- if (clutter_x11_untrap_x_errors ())
- return FALSE;
-
- if (!dev_info)
- return FALSE;
-
- for (i = 0; i < dev_info->num_classes; i++)
- {
- XIValuatorClassInfo *valuator;
- gdouble *value;
-
- if (dev_info->classes[i]->type != XIValuatorClass)
- continue;
-
- valuator = (XIValuatorClassInfo *) dev_info->classes[i];
-
- if (valuator->label == XInternAtom (xdisplay, "Abs X", True) ||
- valuator->label == XInternAtom (xdisplay, "Abs MT Position X", True))
- value = &w;
- else if (valuator->label == XInternAtom (xdisplay, "Abs Y", True) ||
- valuator->label == XInternAtom (xdisplay, "Abs MT Position Y", True))
- value = &h;
- else
- continue;
-
- *value = (valuator->max - valuator->min) * 1000 / valuator->resolution;
- }
-
- XIFreeDeviceInfo (dev_info);
- *width = w;
- *height = h;
-
- return (w > 0 && h > 0);
-}
-
static void
clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
{
@@ -243,7 +193,6 @@ clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
device_class->is_grouped = clutter_input_device_xi2_is_grouped;
device_class->get_group_n_modes = clutter_input_device_xi2_get_group_n_modes;
device_class->is_mode_switch_button = clutter_input_device_xi2_is_mode_switch_button;
- device_class->get_physical_size = clutter_input_device_xi2_get_physical_size;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]