[mutter] window/wayland: Use G_DECLARE_FINAL_TYPE



commit cc444d4991c96fb8cdeba515d62125a070410ca6
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Jul 5 18:22:51 2019 +0200

    window/wayland: Use G_DECLARE_FINAL_TYPE
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/907

 src/meta/window.h                 |  2 ++
 src/wayland/meta-window-wayland.h | 15 ++++-----------
 2 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/src/meta/window.h b/src/meta/window.h
index 6261fffbb..dda5acea1 100644
--- a/src/meta/window.h
+++ b/src/meta/window.h
@@ -99,6 +99,8 @@ typedef enum
 #define META_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_WINDOW))
 #define META_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_WINDOW, MetaWindowClass))
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaWindow, g_object_unref)
+
 typedef struct _MetaWindowClass   MetaWindowClass;
 
 META_EXPORT
diff --git a/src/wayland/meta-window-wayland.h b/src/wayland/meta-window-wayland.h
index f0f72add3..e5d06765a 100644
--- a/src/wayland/meta-window-wayland.h
+++ b/src/wayland/meta-window-wayland.h
@@ -31,17 +31,10 @@
 
 G_BEGIN_DECLS
 
-#define META_TYPE_WINDOW_WAYLAND            (meta_window_wayland_get_type())
-#define META_WINDOW_WAYLAND(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_WAYLAND, 
MetaWindowWayland))
-#define META_WINDOW_WAYLAND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_WINDOW_WAYLAND, 
MetaWindowWaylandClass))
-#define META_IS_WINDOW_WAYLAND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_WAYLAND))
-#define META_IS_WINDOW_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_WINDOW_WAYLAND))
-#define META_WINDOW_WAYLAND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_WINDOW_WAYLAND, 
MetaWindowWaylandClass))
-
-GType meta_window_wayland_get_type (void);
-
-typedef struct _MetaWindowWayland      MetaWindowWayland;
-typedef struct _MetaWindowWaylandClass MetaWindowWaylandClass;
+#define META_TYPE_WINDOW_WAYLAND (meta_window_wayland_get_type())
+G_DECLARE_FINAL_TYPE (MetaWindowWayland, meta_window_wayland,
+                      META, WINDOW_WAYLAND,
+                      MetaWindow)
 
 MetaWindow * meta_window_wayland_new       (MetaDisplay        *display,
                                             MetaWaylandSurface *surface);


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