2019-03-29 17:03:27 -04:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2020-11-20 17:53:46 -05:00
|
|
|
#ifndef META_INPUT_THREAD_H_INSIDE
|
|
|
|
#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h""
|
|
|
|
#endif /* META_INPUT_THREAD_H_INSIDE */
|
|
|
|
|
2019-03-29 17:03:27 -04:00
|
|
|
#include <glib-object.h>
|
|
|
|
|
2020-03-06 08:12:59 -05:00
|
|
|
#include "backends/meta-input-device-private.h"
|
2020-08-05 10:40:04 -04:00
|
|
|
#include "backends/meta-input-settings-private.h"
|
2019-03-29 17:03:27 -04:00
|
|
|
#include "backends/native/meta-seat-native.h"
|
|
|
|
#include "clutter/clutter-mutter.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))
|
|
|
|
|
2020-05-06 13:06:59 -04:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
META_INPUT_DEVICE_MAPPING_ABSOLUTE,
|
|
|
|
META_INPUT_DEVICE_MAPPING_RELATIVE,
|
|
|
|
} MetaInputDeviceMapping;
|
|
|
|
|
2019-03-29 17:03:27 -04:00
|
|
|
typedef struct _MetaInputDeviceNative MetaInputDeviceNative;
|
|
|
|
typedef struct _MetaInputDeviceNativeClass MetaInputDeviceNativeClass;
|
|
|
|
|
|
|
|
struct _MetaInputDeviceNative
|
|
|
|
{
|
|
|
|
ClutterInputDevice parent;
|
|
|
|
|
|
|
|
struct libinput_device *libinput_device;
|
2020-08-07 09:13:51 -04:00
|
|
|
MetaSeatImpl *seat_impl;
|
2019-03-29 17:03:27 -04:00
|
|
|
ClutterInputDeviceTool *last_tool;
|
2020-11-19 12:51:58 -05:00
|
|
|
GArray *pad_features;
|
2019-03-29 17:03:27 -04:00
|
|
|
|
|
|
|
cairo_matrix_t device_matrix;
|
2019-08-16 13:33:43 -04:00
|
|
|
double device_aspect_ratio; /* w:h */
|
|
|
|
double output_ratio; /* w:h */
|
2020-05-06 13:06:59 -04:00
|
|
|
MetaInputDeviceMapping mapping_mode;
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-06-05 17:43:54 -04:00
|
|
|
/* Pointer position */
|
|
|
|
float pointer_x;
|
|
|
|
float pointer_y;
|
|
|
|
|
2019-03-29 17:03:27 -04:00
|
|
|
/* Keyboard a11y */
|
2020-08-05 10:40:04 -04:00
|
|
|
MetaKeyboardA11yFlags a11y_flags;
|
2019-03-29 17:03:27 -04:00
|
|
|
GList *slow_keys_list;
|
2020-08-12 12:04:34 -04:00
|
|
|
GSource *debounce_timer;
|
2019-08-16 13:33:43 -04:00
|
|
|
uint16_t debounce_key;
|
2019-03-29 17:03:27 -04:00
|
|
|
xkb_mod_mask_t stickykeys_depressed_mask;
|
|
|
|
xkb_mod_mask_t stickykeys_latched_mask;
|
|
|
|
xkb_mod_mask_t stickykeys_locked_mask;
|
2020-08-12 12:04:34 -04:00
|
|
|
GSource *toggle_slowkeys_timer;
|
2019-08-16 13:33:43 -04:00
|
|
|
uint16_t shift_count;
|
|
|
|
uint32_t last_shift_time;
|
|
|
|
int mousekeys_btn;
|
2019-03-29 17:03:27 -04:00
|
|
|
gboolean mousekeys_btn_states[3];
|
2019-08-16 13:33:43 -04:00
|
|
|
uint32_t mousekeys_first_motion_time; /* ms */
|
|
|
|
uint32_t mousekeys_last_motion_time; /* ms */
|
2019-03-29 17:03:27 -04:00
|
|
|
guint mousekeys_init_delay;
|
|
|
|
guint mousekeys_accel_time;
|
|
|
|
guint mousekeys_max_speed;
|
2019-08-16 13:33:43 -04:00
|
|
|
double mousekeys_curve_factor;
|
2020-08-12 12:04:34 -04:00
|
|
|
GSource *move_mousekeys_timer;
|
2019-08-16 13:33:43 -04:00
|
|
|
uint16_t last_mousekeys_key;
|
2019-03-29 17:03:27 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _MetaInputDeviceNativeClass
|
|
|
|
{
|
|
|
|
ClutterInputDeviceClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType meta_input_device_native_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
ClutterInputDevice * meta_input_device_native_new_in_impl (MetaSeatImpl *seat_impl,
|
2019-03-29 17:03:27 -04:00
|
|
|
struct libinput_device *libinput_device);
|
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatImpl *seat_impl,
|
|
|
|
ClutterInputDeviceType type,
|
|
|
|
ClutterInputMode mode);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
MetaSeatImpl * meta_input_device_native_get_seat_impl (MetaInputDeviceNative *device);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
void meta_input_device_native_update_leds_in_impl (MetaInputDeviceNative *device,
|
|
|
|
enum libinput_led leds);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
ClutterInputDeviceType meta_input_device_native_determine_type_in_impl (struct libinput_device *libinput_device);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
void meta_input_device_native_translate_coordinates_in_impl (ClutterInputDevice *device,
|
|
|
|
MetaViewportInfo *viewports,
|
|
|
|
float *x,
|
|
|
|
float *y);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
MetaInputDeviceMapping meta_input_device_native_get_mapping_mode_in_impl (ClutterInputDevice *device);
|
|
|
|
void meta_input_device_native_set_mapping_mode_in_impl (ClutterInputDevice *device,
|
|
|
|
MetaInputDeviceMapping mapping);
|
2020-05-06 13:06:59 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
void meta_input_device_native_apply_kbd_a11y_settings_in_impl (MetaInputDeviceNative *device,
|
|
|
|
MetaKbdA11ySettings *settings);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
void meta_input_device_native_a11y_maybe_notify_toggle_keys_in_impl (MetaInputDeviceNative *device_evdev);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
|
|
|
struct libinput_device * meta_input_device_native_get_libinput_device (ClutterInputDevice *device);
|
|
|
|
|
2020-11-19 19:36:19 -05:00
|
|
|
void meta_input_device_native_set_coords_in_impl (MetaInputDeviceNative *device_native,
|
|
|
|
float x,
|
|
|
|
float y);
|
|
|
|
void meta_input_device_native_get_coords_in_impl (MetaInputDeviceNative *device_native,
|
|
|
|
float *x,
|
|
|
|
float *y);
|
|
|
|
gboolean meta_input_device_native_process_kbd_a11y_event_in_impl (ClutterInputDevice *device,
|
|
|
|
ClutterEvent *event);
|
2020-06-05 17:43:54 -04:00
|
|
|
|
2019-03-29 17:03:27 -04:00
|
|
|
#endif /* META_INPUT_DEVICE_NATIVE_H */
|