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
|
|
|
|
|
|
|
|
#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;
|
|
|
|
MetaSeatNative *seat;
|
|
|
|
ClutterInputDeviceTool *last_tool;
|
|
|
|
|
|
|
|
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;
|
|
|
|
guint 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;
|
|
|
|
guint 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;
|
2019-03-29 17:03:27 -04:00
|
|
|
guint 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;
|
|
|
|
|
2019-09-25 17:04:25 -04:00
|
|
|
ClutterInputDevice * meta_input_device_native_new (MetaSeatNative *seat,
|
2019-03-29 17:03:27 -04:00
|
|
|
struct libinput_device *libinput_device);
|
|
|
|
|
2019-09-25 17:04:25 -04:00
|
|
|
ClutterInputDevice * meta_input_device_native_new_virtual (MetaSeatNative *seat,
|
2019-03-29 17:03:27 -04:00
|
|
|
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,
|
2020-07-31 13:11:32 -04:00
|
|
|
MetaViewportInfo *viewports,
|
2019-08-16 13:33:43 -04:00
|
|
|
float *x,
|
|
|
|
float *y);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
2020-05-06 13:06:59 -04:00
|
|
|
MetaInputDeviceMapping meta_input_device_native_get_mapping_mode (ClutterInputDevice *device);
|
|
|
|
void meta_input_device_native_set_mapping_mode (ClutterInputDevice *device,
|
|
|
|
MetaInputDeviceMapping mapping);
|
|
|
|
|
2020-08-05 10:40:04 -04:00
|
|
|
void meta_input_device_native_apply_kbd_a11y_settings (MetaInputDeviceNative *device,
|
|
|
|
MetaKbdA11ySettings *settings);
|
2019-03-29 17:03:27 -04:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2020-06-05 17:43:54 -04:00
|
|
|
void meta_input_device_native_set_coords (MetaInputDeviceNative *device_native,
|
|
|
|
float x,
|
|
|
|
float y);
|
|
|
|
void meta_input_device_native_get_coords (MetaInputDeviceNative *device_native,
|
|
|
|
float *x,
|
|
|
|
float *y);
|
|
|
|
|
2019-03-29 17:03:27 -04:00
|
|
|
#endif /* META_INPUT_DEVICE_NATIVE_H */
|