mirror of
https://github.com/brl/mutter.git
synced 2025-02-08 17:44:09 +00:00
ClutterVirtualInputDevice: Store the device type
https://bugzilla.gnome.org/show_bug.cgi?id=765009
This commit is contained in:
parent
94016f7257
commit
364b184f41
@ -31,12 +31,14 @@
|
|||||||
|
|
||||||
#include "clutter-device-manager.h"
|
#include "clutter-device-manager.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
|
#include "clutter-enum-types.h"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
||||||
PROP_DEVICE_MANAGER,
|
PROP_DEVICE_MANAGER,
|
||||||
|
PROP_DEVICE_TYPE,
|
||||||
|
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
@ -46,6 +48,7 @@ static GParamSpec *obj_props[PROP_LAST];
|
|||||||
typedef struct _ClutterVirtualInputDevicePrivate
|
typedef struct _ClutterVirtualInputDevicePrivate
|
||||||
{
|
{
|
||||||
ClutterDeviceManager *manager;
|
ClutterDeviceManager *manager;
|
||||||
|
ClutterInputDeviceType device_type;
|
||||||
} ClutterVirtualInputDevicePrivate;
|
} ClutterVirtualInputDevicePrivate;
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (ClutterVirtualInputDevice,
|
G_DEFINE_TYPE_WITH_PRIVATE (ClutterVirtualInputDevice,
|
||||||
@ -109,6 +112,15 @@ clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_dev
|
|||||||
return priv->manager;
|
return priv->manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device)
|
||||||
|
{
|
||||||
|
ClutterVirtualInputDevicePrivate *priv =
|
||||||
|
clutter_virtual_input_device_get_instance_private (virtual_device);
|
||||||
|
|
||||||
|
return priv->device_type;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_virtual_input_device_get_property (GObject *object,
|
clutter_virtual_input_device_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@ -125,6 +137,9 @@ clutter_virtual_input_device_get_property (GObject *object,
|
|||||||
case PROP_DEVICE_MANAGER:
|
case PROP_DEVICE_MANAGER:
|
||||||
g_value_set_object (value, priv->manager);
|
g_value_set_object (value, priv->manager);
|
||||||
break;
|
break;
|
||||||
|
case PROP_DEVICE_TYPE:
|
||||||
|
g_value_set_enum (value, priv->device_type);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -147,6 +162,9 @@ clutter_virtual_input_device_set_property (GObject *object,
|
|||||||
case PROP_DEVICE_MANAGER:
|
case PROP_DEVICE_MANAGER:
|
||||||
priv->manager = g_value_get_object (value);
|
priv->manager = g_value_get_object (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_DEVICE_TYPE:
|
||||||
|
priv->device_type = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -172,6 +190,13 @@ clutter_virtual_input_device_class_init (ClutterVirtualInputDeviceClass *klass)
|
|||||||
P_("The device manager instance"),
|
P_("The device manager instance"),
|
||||||
CLUTTER_TYPE_DEVICE_MANAGER,
|
CLUTTER_TYPE_DEVICE_MANAGER,
|
||||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
obj_props[PROP_DEVICE_TYPE] =
|
||||||
|
g_param_spec_enum ("device-type",
|
||||||
|
P_("Device type"),
|
||||||
|
P_("Device type"),
|
||||||
|
CLUTTER_TYPE_INPUT_DEVICE_TYPE,
|
||||||
|
CLUTTER_POINTER_DEVICE,
|
||||||
|
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
||||||
}
|
}
|
||||||
|
@ -94,4 +94,6 @@ void clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual
|
|||||||
|
|
||||||
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
||||||
|
|
||||||
|
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
|
||||||
|
|
||||||
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
|
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */
|
||||||
|
@ -1961,6 +1961,7 @@ clutter_device_manager_evdev_create_virtual_device (ClutterDeviceManager *manag
|
|||||||
{
|
{
|
||||||
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV,
|
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV,
|
||||||
"device-manager", manager,
|
"device-manager", manager,
|
||||||
|
"device-type", device_type,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user