mirror of
https://github.com/brl/mutter.git
synced 2025-03-10 13:25:05 +00:00
clutter: Add ClutterInputDevice::capabilities property
This is construct-only, and assigned by the backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2331>
This commit is contained in:
parent
ff6f83f05e
commit
15d4402d08
@ -56,6 +56,7 @@ enum
|
|||||||
PROP_NAME,
|
PROP_NAME,
|
||||||
|
|
||||||
PROP_DEVICE_TYPE,
|
PROP_DEVICE_TYPE,
|
||||||
|
PROP_CAPABILITIES,
|
||||||
PROP_SEAT,
|
PROP_SEAT,
|
||||||
PROP_DEVICE_MODE,
|
PROP_DEVICE_MODE,
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ typedef struct _ClutterInputDevicePrivate ClutterInputDevicePrivate;
|
|||||||
struct _ClutterInputDevicePrivate
|
struct _ClutterInputDevicePrivate
|
||||||
{
|
{
|
||||||
ClutterInputDeviceType device_type;
|
ClutterInputDeviceType device_type;
|
||||||
|
ClutterInputCapabilities capabilities;
|
||||||
ClutterInputMode device_mode;
|
ClutterInputMode device_mode;
|
||||||
|
|
||||||
char *device_name;
|
char *device_name;
|
||||||
@ -136,6 +138,10 @@ clutter_input_device_set_property (GObject *gobject,
|
|||||||
priv->device_type = g_value_get_enum (value);
|
priv->device_type = g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_CAPABILITIES:
|
||||||
|
priv->capabilities = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_SEAT:
|
case PROP_SEAT:
|
||||||
priv->seat = g_value_get_object (value);
|
priv->seat = g_value_get_object (value);
|
||||||
break;
|
break;
|
||||||
@ -206,6 +212,10 @@ clutter_input_device_get_property (GObject *gobject,
|
|||||||
g_value_set_enum (value, priv->device_type);
|
g_value_set_enum (value, priv->device_type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_CAPABILITIES:
|
||||||
|
g_value_set_flags (value, priv->capabilities);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_SEAT:
|
case PROP_SEAT:
|
||||||
g_value_set_object (value, priv->seat);
|
g_value_set_object (value, priv->seat);
|
||||||
break;
|
break;
|
||||||
@ -296,6 +306,19 @@ clutter_input_device_class_init (ClutterInputDeviceClass *klass)
|
|||||||
CLUTTER_PARAM_READWRITE |
|
CLUTTER_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT_ONLY);
|
G_PARAM_CONSTRUCT_ONLY);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterInputDevice:seat:
|
* ClutterInputDevice:seat:
|
||||||
*
|
*
|
||||||
@ -451,6 +474,25 @@ clutter_input_device_get_device_type (ClutterInputDevice *device)
|
|||||||
return priv->device_type;
|
return priv->device_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_input_device_get_device_name:
|
* clutter_input_device_get_device_name:
|
||||||
* @device: a #ClutterInputDevice
|
* @device: a #ClutterInputDevice
|
||||||
|
@ -121,6 +121,9 @@ int clutter_input_device_get_pad_feature_group (ClutterInputDevice *de
|
|||||||
ClutterInputDevicePadFeature feature,
|
ClutterInputDevicePadFeature feature,
|
||||||
int n_feature);
|
int n_feature);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
ClutterInputCapabilities clutter_input_device_get_capabilities (ClutterInputDevice *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_INPUT_DEVICE_H__ */
|
#endif /* __CLUTTER_INPUT_DEVICE_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user