2009-11-24 16:22:44 +00:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
2011-01-18 12:57:12 +00:00
|
|
|
* Copyright © 2009, 2010, 2011 Intel Corp.
|
2009-11-24 16:22:44 +00:00
|
|
|
*
|
|
|
|
* 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: Emmanuele Bassi <ebassi@linux.intel.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2022-05-25 18:41:48 +02:00
|
|
|
* ClutterInputDevice:
|
|
|
|
*
|
|
|
|
* An input device managed by Clutter
|
2009-11-24 16:22:44 +00:00
|
|
|
*
|
|
|
|
* #ClutterInputDevice represents an input device known to Clutter.
|
|
|
|
*
|
|
|
|
* The #ClutterInputDevice class holds the state of the device, but
|
|
|
|
* its contents are usually defined by the Clutter backend in use.
|
|
|
|
*/
|
|
|
|
|
2016-05-05 22:21:51 +08:00
|
|
|
#include "clutter-build-config.h"
|
2009-11-23 16:07:16 +00:00
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
#include "clutter-input-device.h"
|
|
|
|
|
2010-10-21 12:16:05 +01:00
|
|
|
#include "clutter-actor-private.h"
|
2009-11-23 16:07:16 +00:00
|
|
|
#include "clutter-debug.h"
|
|
|
|
#include "clutter-enum-types.h"
|
2011-02-18 16:27:49 +00:00
|
|
|
#include "clutter-event-private.h"
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
#include "clutter-marshal.h"
|
2009-11-23 16:07:16 +00:00
|
|
|
#include "clutter-private.h"
|
2010-10-21 11:29:09 +01:00
|
|
|
#include "clutter-stage-private.h"
|
2019-10-04 23:01:54 +02:00
|
|
|
#include "clutter-input-device-private.h"
|
2015-01-09 17:37:28 +01:00
|
|
|
#include "clutter-input-device-tool.h"
|
2009-11-23 16:07:16 +00:00
|
|
|
|
2013-09-03 11:51:19 +01:00
|
|
|
#include <math.h>
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
PROP_BACKEND,
|
|
|
|
|
2010-06-21 10:20:32 +01:00
|
|
|
PROP_NAME,
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
PROP_DEVICE_TYPE,
|
2022-03-08 17:04:40 +01:00
|
|
|
PROP_CAPABILITIES,
|
2019-04-04 12:14:28 +02:00
|
|
|
PROP_SEAT,
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
PROP_DEVICE_MODE,
|
|
|
|
|
|
|
|
PROP_HAS_CURSOR,
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
PROP_VENDOR_ID,
|
|
|
|
PROP_PRODUCT_ID,
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
PROP_N_STRIPS,
|
|
|
|
PROP_N_RINGS,
|
|
|
|
PROP_N_MODE_GROUPS,
|
2020-11-19 18:51:58 +01:00
|
|
|
PROP_N_BUTTONS,
|
2016-05-13 13:17:00 +02:00
|
|
|
PROP_DEVICE_NODE,
|
2016-05-10 17:00:38 +02:00
|
|
|
|
2010-06-21 10:20:32 +01:00
|
|
|
PROP_LAST
|
2009-11-23 16:07:16 +00:00
|
|
|
};
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
typedef struct _ClutterInputDevicePrivate ClutterInputDevicePrivate;
|
|
|
|
|
|
|
|
struct _ClutterInputDevicePrivate
|
|
|
|
{
|
|
|
|
ClutterInputDeviceType device_type;
|
2022-03-08 17:04:40 +01:00
|
|
|
ClutterInputCapabilities capabilities;
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputMode device_mode;
|
|
|
|
|
|
|
|
char *device_name;
|
|
|
|
|
|
|
|
ClutterSeat *seat;
|
|
|
|
|
|
|
|
ClutterBackend *backend;
|
|
|
|
|
|
|
|
char *vendor_id;
|
|
|
|
char *product_id;
|
|
|
|
char *node_path;
|
|
|
|
|
|
|
|
int n_rings;
|
|
|
|
int n_strips;
|
|
|
|
int n_mode_groups;
|
2020-11-19 18:51:58 +01:00
|
|
|
int n_buttons;
|
2020-11-19 13:51:42 +01:00
|
|
|
|
|
|
|
gboolean has_cursor;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_PRIVATE (ClutterInputDevice, clutter_input_device, G_TYPE_OBJECT);
|
2009-11-23 16:07:16 +00:00
|
|
|
|
2022-03-08 17:12:42 +01:00
|
|
|
static void
|
|
|
|
clutter_input_device_constructed (GObject *gobject)
|
|
|
|
{
|
|
|
|
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (gobject);
|
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
|
|
|
if (priv->capabilities == 0)
|
|
|
|
{
|
|
|
|
ClutterInputCapabilities capabilities = 0;
|
|
|
|
|
|
|
|
switch (priv->device_type)
|
|
|
|
{
|
|
|
|
case CLUTTER_POINTER_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_POINTER;
|
|
|
|
break;
|
|
|
|
case CLUTTER_KEYBOARD_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_KEYBOARD;
|
|
|
|
break;
|
|
|
|
case CLUTTER_TOUCHPAD_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_POINTER |
|
|
|
|
CLUTTER_INPUT_CAPABILITY_TOUCHPAD;
|
|
|
|
break;
|
|
|
|
case CLUTTER_TOUCHSCREEN_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_TOUCH;
|
|
|
|
break;
|
|
|
|
case CLUTTER_TABLET_DEVICE:
|
|
|
|
case CLUTTER_PEN_DEVICE:
|
|
|
|
case CLUTTER_ERASER_DEVICE:
|
|
|
|
case CLUTTER_CURSOR_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_TABLET_TOOL;
|
|
|
|
break;
|
|
|
|
case CLUTTER_PAD_DEVICE:
|
|
|
|
capabilities = CLUTTER_INPUT_CAPABILITY_TABLET_PAD;
|
|
|
|
break;
|
|
|
|
case CLUTTER_EXTENSION_DEVICE:
|
|
|
|
case CLUTTER_JOYSTICK_DEVICE:
|
|
|
|
break;
|
|
|
|
case CLUTTER_N_DEVICE_TYPES:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
priv->capabilities = capabilities;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
static void
|
|
|
|
clutter_input_device_dispose (GObject *gobject)
|
|
|
|
{
|
|
|
|
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (gobject);
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
g_clear_pointer (&priv->device_name, g_free);
|
|
|
|
g_clear_pointer (&priv->vendor_id, g_free);
|
|
|
|
g_clear_pointer (&priv->product_id, g_free);
|
|
|
|
g_clear_pointer (&priv->node_path, g_free);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
|
2019-02-27 15:57:22 +01:00
|
|
|
if (device->accessibility_virtual_device)
|
|
|
|
g_clear_object (&device->accessibility_virtual_device);
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
G_OBJECT_CLASS (clutter_input_device_parent_class)->dispose (gobject);
|
|
|
|
}
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
static void
|
|
|
|
clutter_input_device_set_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
ClutterInputDevice *self = CLUTTER_INPUT_DEVICE (gobject);
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (self);
|
2009-11-23 16:07:16 +00:00
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_DEVICE_TYPE:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->device_type = g_value_get_enum (value);
|
2009-11-23 16:07:16 +00:00
|
|
|
break;
|
|
|
|
|
2022-03-08 17:04:40 +01:00
|
|
|
case PROP_CAPABILITIES:
|
|
|
|
priv->capabilities = g_value_get_flags (value);
|
|
|
|
break;
|
|
|
|
|
2019-04-04 12:14:28 +02:00
|
|
|
case PROP_SEAT:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->seat = g_value_get_object (value);
|
2019-04-04 12:14:28 +02:00
|
|
|
break;
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
case PROP_DEVICE_MODE:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->device_mode = g_value_get_enum (value);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_BACKEND:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->backend = g_value_get_object (value);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
2010-01-15 11:37:43 +00:00
|
|
|
case PROP_NAME:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->device_name = g_value_dup_string (value);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_HAS_CURSOR:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->has_cursor = g_value_get_boolean (value);
|
2010-01-15 11:37:43 +00:00
|
|
|
break;
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
case PROP_VENDOR_ID:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->vendor_id = g_value_dup_string (value);
|
2014-11-25 21:09:32 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_PRODUCT_ID:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->product_id = g_value_dup_string (value);
|
2014-11-25 21:09:32 +01:00
|
|
|
break;
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
case PROP_N_RINGS:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->n_rings = g_value_get_int (value);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_N_STRIPS:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->n_strips = g_value_get_int (value);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_N_MODE_GROUPS:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->n_mode_groups = g_value_get_int (value);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
2020-11-19 18:51:58 +01:00
|
|
|
case PROP_N_BUTTONS:
|
|
|
|
priv->n_buttons = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
|
2016-05-13 13:17:00 +02:00
|
|
|
case PROP_DEVICE_NODE:
|
2020-11-19 13:51:42 +01:00
|
|
|
priv->node_path = g_value_dup_string (value);
|
2016-05-13 13:17:00 +02:00
|
|
|
break;
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_input_device_get_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
ClutterInputDevice *self = CLUTTER_INPUT_DEVICE (gobject);
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (self);
|
2009-11-23 16:07:16 +00:00
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_DEVICE_TYPE:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_enum (value, priv->device_type);
|
2009-11-23 16:07:16 +00:00
|
|
|
break;
|
|
|
|
|
2022-03-08 17:04:40 +01:00
|
|
|
case PROP_CAPABILITIES:
|
|
|
|
g_value_set_flags (value, priv->capabilities);
|
|
|
|
break;
|
|
|
|
|
2019-04-04 12:14:28 +02:00
|
|
|
case PROP_SEAT:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_object (value, priv->seat);
|
2019-04-04 12:14:28 +02:00
|
|
|
break;
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
case PROP_DEVICE_MODE:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_enum (value, priv->device_mode);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_BACKEND:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_object (value, priv->backend);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
2010-01-15 11:37:43 +00:00
|
|
|
case PROP_NAME:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_string (value, priv->device_name);
|
2010-01-15 11:37:43 +00:00
|
|
|
break;
|
|
|
|
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
case PROP_HAS_CURSOR:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_boolean (value, priv->has_cursor);
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
break;
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
case PROP_VENDOR_ID:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_string (value, priv->vendor_id);
|
2014-11-25 21:09:32 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_PRODUCT_ID:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_string (value, priv->product_id);
|
2014-11-25 21:09:32 +01:00
|
|
|
break;
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
case PROP_N_RINGS:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_int (value, priv->n_rings);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_N_STRIPS:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_int (value, priv->n_strips);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_N_MODE_GROUPS:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_int (value, priv->n_mode_groups);
|
2016-05-10 17:00:38 +02:00
|
|
|
break;
|
|
|
|
|
2020-11-19 18:51:58 +01:00
|
|
|
case PROP_N_BUTTONS:
|
|
|
|
g_value_set_int (value, priv->n_buttons);
|
|
|
|
break;
|
|
|
|
|
2016-05-13 13:17:00 +02:00
|
|
|
case PROP_DEVICE_NODE:
|
2020-11-19 13:51:42 +01:00
|
|
|
g_value_set_string (value, priv->node_path);
|
2016-05-13 13:17:00 +02:00
|
|
|
break;
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_input_device_class_init (ClutterInputDeviceClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
2010-01-15 11:37:43 +00:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:name:
|
|
|
|
*
|
|
|
|
* The name of the device
|
|
|
|
*/
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
obj_props[PROP_NAME] =
|
|
|
|
g_param_spec_string ("name",
|
|
|
|
P_("Name"),
|
|
|
|
P_("The name of the device"),
|
|
|
|
NULL,
|
|
|
|
CLUTTER_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY);
|
2010-01-15 11:37:43 +00:00
|
|
|
|
2009-11-24 16:22:44 +00:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:device-type:
|
|
|
|
*
|
|
|
|
* The type of the device
|
|
|
|
*/
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
obj_props[PROP_DEVICE_TYPE] =
|
|
|
|
g_param_spec_enum ("device-type",
|
|
|
|
P_("Device Type"),
|
|
|
|
P_("The type of the device"),
|
|
|
|
CLUTTER_TYPE_INPUT_DEVICE_TYPE,
|
|
|
|
CLUTTER_POINTER_DEVICE,
|
|
|
|
CLUTTER_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2022-03-08 17:04:40 +01:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:capabilities:
|
|
|
|
*
|
|
|
|
* The capabilities of the device
|
|
|
|
*/
|
|
|
|
obj_props[PROP_CAPABILITIES] =
|
|
|
|
g_param_spec_flags ("capabilities",
|
|
|
|
P_("Capabilities"),
|
|
|
|
P_("The capabilities of the device"),
|
|
|
|
CLUTTER_TYPE_INPUT_CAPABILITIES, 0,
|
|
|
|
CLUTTER_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2019-04-04 12:14:28 +02:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:seat:
|
|
|
|
*
|
|
|
|
* The #ClutterSeat instance which owns the device
|
|
|
|
*/
|
|
|
|
obj_props[PROP_SEAT] =
|
|
|
|
g_param_spec_object ("seat",
|
|
|
|
P_("Seat"),
|
|
|
|
P_("Seat"),
|
|
|
|
CLUTTER_TYPE_SEAT,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2011-01-19 17:03:27 +00:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:mode:
|
|
|
|
*
|
|
|
|
* The mode of the device.
|
|
|
|
*/
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
obj_props[PROP_DEVICE_MODE] =
|
|
|
|
g_param_spec_enum ("device-mode",
|
|
|
|
P_("Device Mode"),
|
|
|
|
P_("The mode of the device"),
|
|
|
|
CLUTTER_TYPE_INPUT_MODE,
|
|
|
|
CLUTTER_INPUT_MODE_FLOATING,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2011-01-19 17:03:27 +00:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:has-cursor:
|
|
|
|
*
|
|
|
|
* Whether the device has an on screen cursor following its movement.
|
|
|
|
*/
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
obj_props[PROP_HAS_CURSOR] =
|
|
|
|
g_param_spec_boolean ("has-cursor",
|
|
|
|
P_("Has Cursor"),
|
|
|
|
P_("Whether the device has a cursor"),
|
|
|
|
FALSE,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2011-01-19 17:03:27 +00:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:backend:
|
|
|
|
*
|
|
|
|
* The #ClutterBackend that created the device.
|
|
|
|
*/
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
obj_props[PROP_BACKEND] =
|
|
|
|
g_param_spec_object ("backend",
|
|
|
|
P_("Backend"),
|
|
|
|
P_("The backend instance"),
|
|
|
|
CLUTTER_TYPE_BACKEND,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
/**
|
|
|
|
* ClutterInputDevice:vendor-id:
|
|
|
|
*
|
2022-05-31 13:58:40 +02:00
|
|
|
* Vendor ID of this device.2
|
2014-11-25 21:09:32 +01:00
|
|
|
*/
|
|
|
|
obj_props[PROP_VENDOR_ID] =
|
|
|
|
g_param_spec_string ("vendor-id",
|
|
|
|
P_("Vendor ID"),
|
|
|
|
P_("Vendor ID"),
|
|
|
|
NULL,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ClutterInputDevice:product-id:
|
|
|
|
*
|
2022-05-31 13:58:40 +02:00
|
|
|
* Product ID of this device.2
|
2014-11-25 21:09:32 +01:00
|
|
|
*/
|
|
|
|
obj_props[PROP_PRODUCT_ID] =
|
|
|
|
g_param_spec_string ("product-id",
|
|
|
|
P_("Product ID"),
|
|
|
|
P_("Product ID"),
|
|
|
|
NULL,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
obj_props[PROP_N_RINGS] =
|
|
|
|
g_param_spec_int ("n-rings",
|
|
|
|
P_("Number of rings"),
|
|
|
|
P_("Number of rings (circular sliders) in this device"),
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
|
|
|
obj_props[PROP_N_STRIPS] =
|
|
|
|
g_param_spec_int ("n-strips",
|
|
|
|
P_("Number of strips"),
|
|
|
|
P_("Number of strips (linear sliders) in this device"),
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
|
|
|
obj_props[PROP_N_MODE_GROUPS] =
|
|
|
|
g_param_spec_int ("n-mode-groups",
|
|
|
|
P_("Number of mode groups"),
|
|
|
|
P_("Number of mode groups"),
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2020-11-19 18:51:58 +01:00
|
|
|
obj_props[PROP_N_BUTTONS] =
|
|
|
|
g_param_spec_int ("n-buttons",
|
|
|
|
P_("Number of buttons"),
|
|
|
|
P_("Number of buttons"),
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2016-05-13 13:17:00 +02:00
|
|
|
obj_props[PROP_DEVICE_NODE] =
|
|
|
|
g_param_spec_string ("device-node",
|
|
|
|
P_("Device node path"),
|
|
|
|
P_("Device node path"),
|
|
|
|
NULL,
|
|
|
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
2022-03-08 17:12:42 +01:00
|
|
|
gobject_class->constructed = clutter_input_device_constructed;
|
event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-04 12:32:04 +00:00
|
|
|
gobject_class->dispose = clutter_input_device_dispose;
|
|
|
|
gobject_class->set_property = clutter_input_device_set_property;
|
|
|
|
gobject_class->get_property = clutter_input_device_get_property;
|
|
|
|
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
|
2009-11-23 16:07:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_input_device_init (ClutterInputDevice *self)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (self);
|
|
|
|
|
|
|
|
priv->device_type = CLUTTER_POINTER_DEVICE;
|
2010-01-08 17:51:00 +00:00
|
|
|
}
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
/**
|
|
|
|
* clutter_input_device_get_device_type:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Retrieves the type of @device
|
|
|
|
*
|
|
|
|
* Return value: the type of the device
|
|
|
|
*/
|
|
|
|
ClutterInputDeviceType
|
|
|
|
clutter_input_device_get_device_type (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2009-11-23 16:07:16 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device),
|
|
|
|
CLUTTER_POINTER_DEVICE);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->device_type;
|
2009-11-23 16:07:16 +00:00
|
|
|
}
|
|
|
|
|
2022-03-08 17:04:40 +01:00
|
|
|
/**
|
|
|
|
* clutter_input_device_get_capabilities:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Retrieves the capabilities of @device
|
|
|
|
*
|
|
|
|
* Return value: the capabilities of the device
|
|
|
|
*/
|
|
|
|
ClutterInputCapabilities
|
|
|
|
clutter_input_device_get_capabilities (ClutterInputDevice *device)
|
|
|
|
{
|
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
|
|
|
|
return priv->capabilities;
|
|
|
|
}
|
|
|
|
|
2010-01-15 11:37:43 +00:00
|
|
|
/**
|
|
|
|
* clutter_input_device_get_device_name:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Retrieves the name of the @device
|
|
|
|
*
|
|
|
|
* Return value: the name of the device, or %NULL. The returned string
|
|
|
|
* is owned by the #ClutterInputDevice and should never be modified
|
|
|
|
* or freed
|
|
|
|
*/
|
Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.
We always used it to conform to the platform, at least for public-facing
API.
At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.
Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:
https://bugzilla.gnome.org/show_bug.cgi?id=644611
Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 15:49:20 +01:00
|
|
|
const gchar *
|
2010-01-15 11:37:43 +00:00
|
|
|
clutter_input_device_get_device_name (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2010-01-15 11:37:43 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->device_name;
|
2010-01-15 11:37:43 +00:00
|
|
|
}
|
2010-02-17 18:21:50 +00:00
|
|
|
|
2011-01-18 17:33:22 +00:00
|
|
|
/**
|
|
|
|
* clutter_input_device_get_has_cursor:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Retrieves whether @device has a pointer that follows the
|
|
|
|
* device motion.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the device has a cursor
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
clutter_input_device_get_has_cursor (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2011-01-18 17:33:22 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->has_cursor;
|
2011-01-18 17:33:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_input_device_get_device_mode:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Retrieves the #ClutterInputMode of @device.
|
|
|
|
*
|
|
|
|
* Return value: the device mode
|
|
|
|
*/
|
|
|
|
ClutterInputMode
|
|
|
|
clutter_input_device_get_device_mode (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2011-01-18 17:33:22 +00:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device),
|
|
|
|
CLUTTER_INPUT_MODE_FLOATING);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->device_mode;
|
2011-01-18 17:33:22 +00:00
|
|
|
}
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
/**
|
|
|
|
* clutter_input_device_get_vendor_id:
|
2020-08-31 18:47:23 +02:00
|
|
|
* @device: a physical #ClutterInputDevice
|
2014-11-25 21:09:32 +01:00
|
|
|
*
|
|
|
|
* Gets the vendor ID of this device.
|
|
|
|
*
|
2022-05-31 13:58:40 +02:00
|
|
|
* Returns: the vendor ID2
|
2014-11-25 21:09:32 +01:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
clutter_input_device_get_vendor_id (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
2020-08-31 18:47:23 +02:00
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL, NULL);
|
2014-11-25 21:09:32 +01:00
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->vendor_id;
|
2014-11-25 21:09:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_input_device_get_product_id:
|
2020-08-31 18:47:23 +02:00
|
|
|
* @device: a physical #ClutterInputDevice
|
2014-11-25 21:09:32 +01:00
|
|
|
*
|
|
|
|
* Gets the product ID of this device.
|
|
|
|
*
|
2022-05-31 13:58:40 +02:00
|
|
|
* Returns: the product ID2
|
2014-11-25 21:09:32 +01:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
clutter_input_device_get_product_id (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2014-11-25 21:09:32 +01:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
2020-08-31 18:47:23 +02:00
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_LOGICAL, NULL);
|
2014-11-25 21:09:32 +01:00
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->product_id;
|
2014-11-25 21:09:32 +01:00
|
|
|
}
|
2015-01-09 17:37:28 +01:00
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
gint
|
|
|
|
clutter_input_device_get_n_rings (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->n_rings;
|
2016-05-10 17:00:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
clutter_input_device_get_n_strips (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->n_strips;
|
2016-05-10 17:00:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
clutter_input_device_get_n_mode_groups (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2016-05-10 17:00:38 +02:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
|
|
|
CLUTTER_PAD_DEVICE, 0);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->n_mode_groups;
|
2016-05-10 17:00:38 +02:00
|
|
|
}
|
2016-05-13 13:17:00 +02:00
|
|
|
|
2020-11-19 18:51:58 +01:00
|
|
|
gint
|
|
|
|
clutter_input_device_get_n_buttons (ClutterInputDevice *device)
|
|
|
|
{
|
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
|
|
|
CLUTTER_PAD_DEVICE, 0);
|
|
|
|
|
|
|
|
return priv->n_buttons;
|
|
|
|
}
|
|
|
|
|
2016-12-28 11:44:27 +01:00
|
|
|
gint
|
|
|
|
clutter_input_device_get_group_n_modes (ClutterInputDevice *device,
|
|
|
|
gint group)
|
|
|
|
{
|
|
|
|
ClutterInputDeviceClass *device_class;
|
|
|
|
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), 0);
|
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
|
|
|
CLUTTER_PAD_DEVICE, 0);
|
|
|
|
g_return_val_if_fail (group >= 0, 0);
|
|
|
|
|
|
|
|
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
|
|
|
|
|
|
|
if (device_class->get_group_n_modes)
|
|
|
|
return device_class->get_group_n_modes (device, group);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-12-28 11:41:23 +01:00
|
|
|
gboolean
|
|
|
|
clutter_input_device_is_mode_switch_button (ClutterInputDevice *device,
|
|
|
|
guint group,
|
|
|
|
guint button)
|
|
|
|
{
|
|
|
|
ClutterInputDeviceClass *device_class;
|
|
|
|
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
|
|
|
CLUTTER_PAD_DEVICE, FALSE);
|
|
|
|
|
|
|
|
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
|
|
|
|
|
|
|
if (device_class->is_mode_switch_button)
|
|
|
|
return device_class->is_mode_switch_button (device, group, button);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
clutter_input_device_get_mode_switch_button_group (ClutterInputDevice *device,
|
|
|
|
guint button)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
2016-12-28 11:41:23 +01:00
|
|
|
gint group;
|
|
|
|
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), -1);
|
|
|
|
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
|
|
|
CLUTTER_PAD_DEVICE, -1);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
for (group = 0; group < priv->n_mode_groups; group++)
|
2016-12-28 11:41:23 +01:00
|
|
|
{
|
|
|
|
if (clutter_input_device_is_mode_switch_button (device, group, button))
|
|
|
|
return group;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-11-19 18:51:58 +01:00
|
|
|
int
|
|
|
|
clutter_input_device_get_pad_feature_group (ClutterInputDevice *device,
|
|
|
|
ClutterInputDevicePadFeature feature,
|
|
|
|
int n_feature)
|
|
|
|
{
|
|
|
|
ClutterInputDeviceClass *device_class;
|
|
|
|
|
|
|
|
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
|
|
|
if (!device_class->get_pad_feature_group)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_pad_feature_group (device,
|
|
|
|
feature,
|
|
|
|
n_feature);
|
|
|
|
}
|
|
|
|
|
2016-05-13 13:17:00 +02:00
|
|
|
const gchar *
|
|
|
|
clutter_input_device_get_device_node (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2016-05-13 13:17:00 +02:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->node_path;
|
2016-05-13 13:17:00 +02:00
|
|
|
}
|
2016-05-13 19:57:51 +02:00
|
|
|
|
2017-02-13 11:58:52 +01:00
|
|
|
gboolean
|
|
|
|
clutter_input_device_is_grouped (ClutterInputDevice *device,
|
|
|
|
ClutterInputDevice *other_device)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
|
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (other_device), FALSE);
|
|
|
|
|
|
|
|
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
|
|
|
|
}
|
2019-04-04 12:14:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_input_device_get_seat:
|
|
|
|
* @device: a #ClutterInputDevice
|
|
|
|
*
|
|
|
|
* Returns the seat the device belongs to
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): the device seat
|
|
|
|
**/
|
|
|
|
ClutterSeat *
|
|
|
|
clutter_input_device_get_seat (ClutterInputDevice *device)
|
|
|
|
{
|
2020-11-19 13:51:42 +01:00
|
|
|
ClutterInputDevicePrivate *priv =
|
|
|
|
clutter_input_device_get_instance_private (device);
|
|
|
|
|
2019-04-04 12:14:28 +02:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
|
|
|
|
2020-11-19 13:51:42 +01:00
|
|
|
return priv->seat;
|
2019-04-04 12:14:28 +02:00
|
|
|
}
|