clutter: Drop clutter_input_device_get_device_id()
Move the GObject property to MetaInputDeviceX11, and throw away the rest. This is no longer public API. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1569>
This commit is contained in:

committed by
Marge Bot

parent
20e6464087
commit
23ae8b4519
@ -49,6 +49,15 @@ struct _MetaInputDeviceX11Class
|
||||
|
||||
#define N_BUTTONS 5
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_ID,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *props[N_PROPS] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (MetaInputDeviceX11,
|
||||
meta_input_device_x11,
|
||||
META_TYPE_INPUT_DEVICE)
|
||||
@ -58,8 +67,6 @@ meta_input_device_x11_constructed (GObject *object)
|
||||
{
|
||||
MetaInputDeviceX11 *device_xi2 = META_INPUT_DEVICE_X11 (object);
|
||||
|
||||
g_object_get (object, "id", &device_xi2->device_id, NULL);
|
||||
|
||||
if (G_OBJECT_CLASS (meta_input_device_x11_parent_class)->constructed)
|
||||
G_OBJECT_CLASS (meta_input_device_x11_parent_class)->constructed (object);
|
||||
|
||||
@ -136,6 +143,42 @@ meta_input_device_x11_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (meta_input_device_x11_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_device_x11_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ID:
|
||||
device_x11->device_id = g_value_get_int (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_device_x11_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MetaInputDeviceX11 *device_x11 = META_INPUT_DEVICE_X11 (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ID:
|
||||
g_value_set_int (value, device_x11->device_id);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
meta_input_device_x11_get_group_n_modes (ClutterInputDevice *device,
|
||||
int group)
|
||||
@ -221,11 +264,24 @@ meta_input_device_x11_class_init (MetaInputDeviceX11Class *klass)
|
||||
|
||||
gobject_class->constructed = meta_input_device_x11_constructed;
|
||||
gobject_class->finalize = meta_input_device_x11_finalize;
|
||||
gobject_class->set_property = meta_input_device_x11_set_property;
|
||||
gobject_class->get_property = meta_input_device_x11_get_property;
|
||||
|
||||
device_class->keycode_to_evdev = meta_input_device_x11_keycode_to_evdev;
|
||||
device_class->is_grouped = meta_input_device_x11_is_grouped;
|
||||
device_class->get_group_n_modes = meta_input_device_x11_get_group_n_modes;
|
||||
device_class->is_mode_switch_button = meta_input_device_x11_is_mode_switch_button;
|
||||
|
||||
props[PROP_ID] =
|
||||
g_param_spec_int ("id",
|
||||
P_("Id"),
|
||||
P_("Unique identifier of the device"),
|
||||
-1, G_MAXINT,
|
||||
0,
|
||||
CLUTTER_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
g_object_class_install_properties (gobject_class, N_PROPS, props);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user