[gnome-bluetooth] settings: Use G_DECLARE_DERIVABLE_TYPE



commit c1a4e577ea546ac7a666f8df02c564802a589475
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 27 12:10:48 2021 -0300

    settings: Use G_DECLARE_DERIVABLE_TYPE
    
    Cleanup the header a bit.

 lib/bluetooth-settings-widget.h | 31 ++++---------------------------
 1 file changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.h b/lib/bluetooth-settings-widget.h
index 395a985e..9c54c607 100644
--- a/lib/bluetooth-settings-widget.h
+++ b/lib/bluetooth-settings-widget.h
@@ -23,36 +23,13 @@
 #include <gtk/gtk.h>
 
 #define BLUETOOTH_TYPE_SETTINGS_WIDGET (bluetooth_settings_widget_get_type())
-#define BLUETOOTH_SETTINGS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
-                               BLUETOOTH_TYPE_SETTINGS_WIDGET, BluetoothSettingsWidget))
-#define BLUETOOTH_SETTINGS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
-                               BLUETOOTH_TYPE_SETTINGS_WIDGET, BluetoothSettingsWidgetClass))
-#define BLUETOOTH_IS_SETTINGS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
-                                               BLUETOOTH_TYPE_SETTINGS_WIDGET))
-#define BLUETOOTH_IS_SETTINGS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \
-                                               BLUETOOTH_TYPE_SETTINGS_WIDGET))
-#define BLUETOOTH_GET_SETTINGS_WIDGET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \
-                               BLUETOOTH_TYPE_SETTINGS_WIDGET, BluetoothSettingsWidgetClass))
+G_DECLARE_DERIVABLE_TYPE (BluetoothSettingsWidget, bluetooth_settings_widget, BLUETOOTH, SETTINGS_WIDGET, 
GtkBox)
 
-/**
- * BluetoothSettingsWidget:
- *
- * The <structname>BluetoothSettingsWidget</structname> struct contains
- * only private fields and should not be directly accessed.
- */
-typedef struct _BluetoothSettingsWidget BluetoothSettingsWidget;
-typedef struct _BluetoothSettingsWidgetClass BluetoothSettingsWidgetClass;
-
-struct _BluetoothSettingsWidget {
-       GtkBox parent;
+struct _BluetoothSettingsWidgetClass
+{
+  GtkBoxClass parent_class;
 };
 
-struct _BluetoothSettingsWidgetClass {
-       GtkBoxClass parent_class;
-};
-
-GType bluetooth_settings_widget_get_type (void);
-
 GtkWidget *bluetooth_settings_widget_new (void);
 
 gboolean bluetooth_settings_widget_get_default_adapter_powered (BluetoothSettingsWidget *widget);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]