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
This commit is contained in:
parent
9843e21fff
commit
47663c7e0f
5 changed files with 0 additions and 84 deletions
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue