backends: Move absolute/relative device mapping to native backend

This is a bit scattered around, with the setter/getter in Clutter, and
it only being only directly honored in Wayland (it goes straight through
device properties in X11).

Make this private native API, and out of public ClutterInputDevice API.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486
This commit is contained in:
Carlos Garnacho
2020-05-06 19:06:59 +02:00
committed by Jonas Ådahl
parent 82c6c3f303
commit 6cb1557d99
9 changed files with 55 additions and 87 deletions

View File

@ -54,6 +54,12 @@
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
META_TYPE_INPUT_DEVICE_NATIVE, MetaInputDeviceNativeClass))
typedef enum
{
META_INPUT_DEVICE_MAPPING_ABSOLUTE,
META_INPUT_DEVICE_MAPPING_RELATIVE,
} MetaInputDeviceMapping;
typedef struct _MetaInputDeviceNative MetaInputDeviceNative;
typedef struct _MetaInputDeviceNativeClass MetaInputDeviceNativeClass;
@ -68,6 +74,7 @@ struct _MetaInputDeviceNative
cairo_matrix_t device_matrix;
double device_aspect_ratio; /* w:h */
double output_ratio; /* w:h */
MetaInputDeviceMapping mapping_mode;
/* Keyboard a11y */
ClutterKeyboardA11yFlags a11y_flags;
@ -97,7 +104,6 @@ struct _MetaInputDeviceNativeClass
ClutterInputDeviceClass parent_class;
};
GType meta_input_device_native_get_type (void) G_GNUC_CONST;
ClutterInputDevice * meta_input_device_native_new (MetaSeatNative *seat,
@ -120,6 +126,10 @@ void meta_input_device_native_translate_coordinates (Clutte
float *x,
float *y);
MetaInputDeviceMapping meta_input_device_native_get_mapping_mode (ClutterInputDevice *device);
void meta_input_device_native_set_mapping_mode (ClutterInputDevice *device,
MetaInputDeviceMapping mapping);
void meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device,
ClutterKbdA11ySettings *settings);