From b1fc022ee6538c36b3b4ecb15dffd00a896e3443 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 10 Jan 2024 11:15:44 +0100 Subject: [PATCH] x11: Use subclassing macros for InputDeviceX11 Part-of: --- src/backends/x11/meta-input-device-x11.c | 12 +++++------- src/backends/x11/meta-input-device-x11.h | 13 +++++-------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c index 6f4d3bb4f..37ee7323a 100644 --- a/src/backends/x11/meta-input-device-x11.c +++ b/src/backends/x11/meta-input-device-x11.c @@ -30,6 +30,8 @@ struct _MetaInputDeviceX11 { + MetaInputDevice parent_instance; + ClutterInputDevice device; int32_t device_id; @@ -71,10 +73,6 @@ typedef struct _MetaX11ScrollInfo guint last_value_valid : 1; } MetaX11ScrollInfo; -struct _MetaInputDeviceX11Class -{ - ClutterInputDeviceClass device_class; -}; #define N_BUTTONS 5 @@ -87,9 +85,9 @@ enum static GParamSpec *props[N_PROPS] = { 0 }; -G_DEFINE_TYPE (MetaInputDeviceX11, - meta_input_device_x11, - META_TYPE_INPUT_DEVICE) +G_DEFINE_FINAL_TYPE (MetaInputDeviceX11, + meta_input_device_x11, + META_TYPE_INPUT_DEVICE) static void meta_input_device_x11_constructed (GObject *object) diff --git a/src/backends/x11/meta-input-device-x11.h b/src/backends/x11/meta-input-device-x11.h index 1d563213f..aa9dbf37e 100644 --- a/src/backends/x11/meta-input-device-x11.h +++ b/src/backends/x11/meta-input-device-x11.h @@ -31,16 +31,13 @@ G_BEGIN_DECLS #define META_TYPE_INPUT_DEVICE_X11 (meta_input_device_x11_get_type ()) -#define META_INPUT_DEVICE_X11(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), META_TYPE_INPUT_DEVICE_X11, MetaInputDeviceX11)) -#define META_IS_INPUT_DEVICE_X11(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), META_TYPE_INPUT_DEVICE_X11)) -#define META_INPUT_DEVICE_X11_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), META_TYPE_INPUT_DEVICE_X11, MetaInputDeviceX11Class)) -#define META_IS_INPUT_DEVICE_X11_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), META_TYPE_INPUT_DEVICE_X11)) -#define META_INPUT_DEVICE_X11_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), META_TYPE_INPUT_DEVICE_X11, MetaInputDeviceX11Class)) + +G_DECLARE_FINAL_TYPE (MetaInputDeviceX11, + meta_input_device_x11, + META, INPUT_DEVICE_X11, + MetaInputDevice) typedef struct _MetaInputDeviceX11 MetaInputDeviceX11; -typedef struct _MetaInputDeviceX11Class MetaInputDeviceX11Class; - -GType meta_input_device_x11_get_type (void) G_GNUC_CONST; void meta_input_device_x11_update_tool (ClutterInputDevice *device, ClutterInputDeviceTool *tool);