From 5387135220d102d195314dd7598a0c6314a682aa Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 10 Jan 2024 11:13:05 +0100 Subject: [PATCH] x11: Use subclassing macros for InputDeviceToolX11 Part-of: --- src/backends/x11/meta-input-device-tool-x11.c | 9 ++++++-- src/backends/x11/meta-input-device-tool-x11.h | 22 ++++--------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/backends/x11/meta-input-device-tool-x11.c b/src/backends/x11/meta-input-device-tool-x11.c index bec4d1fad..564df4913 100644 --- a/src/backends/x11/meta-input-device-tool-x11.c +++ b/src/backends/x11/meta-input-device-tool-x11.c @@ -21,8 +21,13 @@ #include "meta-input-device-tool-x11.h" -G_DEFINE_TYPE (MetaInputDeviceToolX11, meta_input_device_tool_x11, - CLUTTER_TYPE_INPUT_DEVICE_TOOL) +struct _MetaInputDeviceToolX11 +{ + ClutterInputDeviceTool parent_instance; +}; + +G_DEFINE_FINAL_TYPE (MetaInputDeviceToolX11, meta_input_device_tool_x11, + CLUTTER_TYPE_INPUT_DEVICE_TOOL) static void meta_input_device_tool_x11_class_init (MetaInputDeviceToolX11Class *klass) diff --git a/src/backends/x11/meta-input-device-tool-x11.h b/src/backends/x11/meta-input-device-tool-x11.h index ac1cf7b92..12dc935cd 100644 --- a/src/backends/x11/meta-input-device-tool-x11.h +++ b/src/backends/x11/meta-input-device-tool-x11.h @@ -23,26 +23,12 @@ #define META_TYPE_INPUT_DEVICE_TOOL_X11 (meta_input_device_tool_x11_get_type ()) -#define META_INPUT_DEVICE_TOOL_X11(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), META_TYPE_INPUT_DEVICE_TOOL_X11, MetaInputDeviceToolX11)) -#define META_IS_INPUT_DEVICE_TOOL_X11(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), META_TYPE_INPUT_DEVICE_TOOL_X11)) -#define META_INPUT_DEVICE_TOOL_X11_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), META_TYPE_INPUT_DEVICE_TOOL_X11, MetaInputDeviceToolX11Class)) -#define META_IS_INPUT_DEVICE_TOOL_X11_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), META_TYPE_INPUT_DEVICE_TOOL_X1)) -#define META_INPUT_DEVICE_TOOL_X11_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), META_TYPE_INPUT_DEVICE_TOOL_X11, MetaInputDeviceToolX11Class)) +G_DECLARE_FINAL_TYPE (MetaInputDeviceToolX11, + meta_input_device_tool_x11, + META, INPUT_DEVICE_TOOL_X11, + ClutterInputDeviceTool) typedef struct _MetaInputDeviceToolX11 MetaInputDeviceToolX11; -typedef struct _MetaInputDeviceToolX11Class MetaInputDeviceToolX11Class; - -struct _MetaInputDeviceToolX11 -{ - ClutterInputDeviceTool parent_instance; -}; - -struct _MetaInputDeviceToolX11Class -{ - ClutterInputDeviceToolClass parent_class; -}; - -GType meta_input_device_tool_x11_get_type (void) G_GNUC_CONST; ClutterInputDeviceTool * meta_input_device_tool_x11_new (guint serial, ClutterInputDeviceToolType type);