From 59bdc695443632baa8a7765930e5acd6d2166627 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Mon, 8 Jan 2024 13:51:02 +0100 Subject: [PATCH] native: Use subclassing macros for InputSettingsNative Part-of: --- .../native/meta-input-settings-native.c | 10 ++++++++- .../native/meta-input-settings-native.h | 22 ++++--------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c index 9d007ed53..840272cab 100644 --- a/src/backends/native/meta-input-settings-native.c +++ b/src/backends/native/meta-input-settings-native.c @@ -28,7 +28,15 @@ #include "backends/native/meta-input-thread.h" #include "backends/native/meta-input-settings-native.h" -G_DEFINE_TYPE (MetaInputSettingsNative, meta_input_settings_native, META_TYPE_INPUT_SETTINGS) +struct _MetaInputSettingsNative +{ + MetaInputSettings parent_instance; + MetaSeatImpl *seat_impl; +}; + +G_DEFINE_FINAL_TYPE (MetaInputSettingsNative, + meta_input_settings_native, + META_TYPE_INPUT_SETTINGS) enum { diff --git a/src/backends/native/meta-input-settings-native.h b/src/backends/native/meta-input-settings-native.h index 168f32d11..eabfec70e 100644 --- a/src/backends/native/meta-input-settings-native.h +++ b/src/backends/native/meta-input-settings-native.h @@ -28,26 +28,12 @@ #include "backends/meta-input-settings-private.h" #define META_TYPE_INPUT_SETTINGS_NATIVE (meta_input_settings_native_get_type ()) -#define META_INPUT_SETTINGS_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_INPUT_SETTINGS_NATIVE, MetaInputSettingsNative)) -#define META_INPUT_SETTINGS_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_INPUT_SETTINGS_NATIVE, MetaInputSettingsNativeClass)) -#define META_IS_INPUT_SETTINGS_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_INPUT_SETTINGS_NATIVE)) -#define META_IS_INPUT_SETTINGS_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_INPUT_SETTINGS_NATIVE)) -#define META_INPUT_SETTINGS_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_INPUT_SETTINGS_NATIVE, MetaInputSettingsNativeClass)) typedef struct _MetaInputSettingsNative MetaInputSettingsNative; -typedef struct _MetaInputSettingsNativeClass MetaInputSettingsNativeClass; -struct _MetaInputSettingsNative -{ - MetaInputSettings parent_instance; - MetaSeatImpl *seat_impl; -}; - -struct _MetaInputSettingsNativeClass -{ - MetaInputSettingsClass parent_class; -}; - -GType meta_input_settings_native_get_type (void) G_GNUC_CONST; +G_DECLARE_FINAL_TYPE (MetaInputSettingsNative, + meta_input_settings_native, + META, INPUT_SETTINGS_NATIVE, + MetaInputSettings) MetaInputSettings * meta_input_settings_native_new_in_impl (MetaSeatImpl *seat_impl);