[gtk/wip/otte/listview: 876/1040] gdk: Add GDK_DECLARE_EXPORTED_TYPE()



commit 47ba7fc0ac258020971e315f0da8aa87ad2e7302
Author: Benjamin Otte <otte redhat com>
Date:   Wed Dec 11 20:03:00 2019 +0100

    gdk: Add GDK_DECLARE_EXPORTED_TYPE()
    
    This is like G_DECLARE_FINAL_TYPE(), except it doesn't make the class
    struct public, so internally all the subclassing in the world can
    happen.
    
    Some subtle differences:
    - It marks the get_type() function as G_GNUC_CONST
    - It doesn't require the parent type
    - It uses G_DEFINE_AUTOPTR_CLEANUP_FUNC() instead of the private glib
      chainup method.
    
    Port a bunch of GDK and the whole event controller + gesture machinery
    to provew that it works.
    
    As a side effect, we gained a bunch of missing autocleanups.

 gdk/gdk-autocleanup.h          |  8 --------
 gdk/gdkcairocontext.h          |  7 ++-----
 gdk/gdkcairocontextprivate.h   |  6 ------
 gdk/gdkclipboard.h             |  5 +----
 gdk/gdkclipboardprivate.h      |  6 ------
 gdk/gdkcursor.h                |  8 +-------
 gdk/gdkcursorprivate.h         |  6 ------
 gdk/gdkdevice.h                |  7 ++-----
 gdk/gdkdeviceprivate.h         |  5 -----
 gdk/gdkdisplay.h               |  8 +++-----
 gdk/gdkdisplayprivate.h        |  7 -------
 gdk/gdkdrag.h                  |  7 ++-----
 gdk/gdkdragprivate.h           |  7 -------
 gdk/gdkdrawcontext.h           |  7 ++-----
 gdk/gdkdrawcontextprivate.h    |  6 ------
 gdk/gdkdrop.h                  |  7 +------
 gdk/gdkdropprivate.h           |  7 -------
 gdk/gdkglcontext.h             |  9 +++------
 gdk/gdkglcontextprivate.h      |  6 ------
 gdk/gdkgltexture.h             | 11 +----------
 gdk/gdkmemorytexture.h         | 12 +-----------
 gdk/gdktexture.h               | 11 +----------
 gdk/gdktextureprivate.h        |  4 ----
 gdk/gdktypes.h                 | 20 ++++++++++++++++++++
 gdk/gdkvulkancontext.h         |  7 ++-----
 gdk/gdkvulkancontextprivate.h  |  6 ------
 gtk/gtk-autocleanups.h         | 10 ----------
 gtk/gtkeventcontroller.h       | 11 +----------
 gtk/gtkeventcontrollerkey.h    | 11 +----------
 gtk/gtkeventcontrollerlegacy.h | 11 +----------
 gtk/gtkeventcontrollermotion.h | 11 +----------
 gtk/gtkeventcontrollerscroll.h | 13 ++-----------
 gtk/gtkgesture.h               | 10 +---------
 gtk/gtkgestureclick.h          | 11 +----------
 gtk/gtkgesturedrag.h           | 11 +----------
 gtk/gtkgesturelongpress.h      | 11 +----------
 gtk/gtkgesturepan.h            | 11 +----------
 gtk/gtkgesturerotate.h         | 11 +----------
 gtk/gtkgesturesingle.h         | 11 +----------
 gtk/gtkgesturestylus.h         | 11 +----------
 gtk/gtkgestureswipe.h          | 11 +----------
 gtk/gtkgesturezoom.h           | 11 +----------
 42 files changed, 58 insertions(+), 318 deletions(-)
---
diff --git a/gdk/gdk-autocleanup.h b/gdk/gdk-autocleanup.h
index 513725620a..9d724110a6 100644
--- a/gdk/gdk-autocleanup.h
+++ b/gdk/gdk-autocleanup.h
@@ -22,20 +22,12 @@
 #ifndef __GI_SCANNER__
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSurface, g_object_unref)
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
diff --git a/gdk/gdkcairocontext.h b/gdk/gdkcairocontext.h
index d5e3967cfc..2aeb73c9d7 100644
--- a/gdk/gdkcairocontext.h
+++ b/gdk/gdkcairocontext.h
@@ -32,14 +32,11 @@
 
 G_BEGIN_DECLS
 
-#define GDK_TYPE_CAIRO_CONTEXT             (gdk_cairo_context_get_type ())
-#define GDK_CAIRO_CONTEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CAIRO_CONTEXT, 
GdkCairoContext))
-#define GDK_IS_CAIRO_CONTEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_CAIRO_CONTEXT))
-
 #define GDK_CAIRO_ERROR                    (gdk_cairo_error_quark ())
 
+#define GDK_TYPE_CAIRO_CONTEXT (gdk_cairo_context_get_type ())
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_cairo_context_get_type                      (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkCairoContext, gdk_cairo_context, GDK, CAIRO_CONTEXT)
 
 GDK_AVAILABLE_IN_ALL
 cairo_t *               gdk_cairo_context_cairo_create                  (GdkCairoContext        *self);
diff --git a/gdk/gdkcairocontextprivate.h b/gdk/gdkcairocontextprivate.h
index fd45c38573..4a9d369334 100644
--- a/gdk/gdkcairocontextprivate.h
+++ b/gdk/gdkcairocontextprivate.h
@@ -29,12 +29,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_CAIRO_CONTEXT_CLASS(klass)                 (G_TYPE_CHECK_CLASS_CAST ((klass), 
GDK_TYPE_CAIRO_CONTEXT, GdkCairoContextClass))
-#define GDK_IS_CAIRO_CONTEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_CAIRO_CONTEXT))
-#define GDK_CAIRO_CONTEXT_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_CAIRO_CONTEXT, 
GdkCairoContextClass))
-
-typedef struct _GdkCairoContextClass GdkCairoContextClass;
-
 struct _GdkCairoContext
 {
   GdkDrawContext parent_instance;
diff --git a/gdk/gdkclipboard.h b/gdk/gdkclipboard.h
index f3b6bba1cc..5a434c8d50 100644
--- a/gdk/gdkclipboard.h
+++ b/gdk/gdkclipboard.h
@@ -31,11 +31,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_CLIPBOARD            (gdk_clipboard_get_type ())
-#define GDK_CLIPBOARD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CLIPBOARD, GdkClipboard))
-#define GDK_IS_CLIPBOARD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_CLIPBOARD))
-
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_clipboard_get_type          (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkClipboard, gdk_clipboard, GDK, CLIPBOARD)
 
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *            gdk_clipboard_get_display       (GdkClipboard          *clipboard);
diff --git a/gdk/gdkclipboardprivate.h b/gdk/gdkclipboardprivate.h
index 5a774e4684..01d386a0e7 100644
--- a/gdk/gdkclipboardprivate.h
+++ b/gdk/gdkclipboardprivate.h
@@ -22,12 +22,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_CLIPBOARD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_CLIPBOARD, 
GdkClipboardClass))
-#define GDK_IS_CLIPBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_CLIPBOARD))
-#define GDK_CLIPBOARD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_CLIPBOARD, 
GdkClipboardClass))
-
-typedef struct _GdkClipboardClass GdkClipboardClass;
-
 struct _GdkClipboard
 {
   GObject parent;
diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h
index d08baa511a..8f9cf600f9 100644
--- a/gdk/gdkcursor.h
+++ b/gdk/gdkcursor.h
@@ -35,14 +35,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_CURSOR              (gdk_cursor_get_type ())
-#define GDK_CURSOR(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_CURSOR, GdkCursor))
-#define GDK_IS_CURSOR(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_CURSOR))
-
-/* Cursors
- */
-
 GDK_AVAILABLE_IN_ALL
-GType      gdk_cursor_get_type           (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkCursor, gdk_cursor, GDK, CURSOR)
 
 GDK_AVAILABLE_IN_ALL
 GdkCursor* gdk_cursor_new_from_texture   (GdkTexture      *texture,
diff --git a/gdk/gdkcursorprivate.h b/gdk/gdkcursorprivate.h
index aaac3169fb..6acfce3243 100644
--- a/gdk/gdkcursorprivate.h
+++ b/gdk/gdkcursorprivate.h
@@ -29,12 +29,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_CURSOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_CURSOR, GdkCursorClass))
-#define GDK_IS_CURSOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_CURSOR))
-#define GDK_CURSOR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_CURSOR, GdkCursorClass))
-
-typedef struct _GdkCursorClass GdkCursorClass;
-
 struct _GdkCursor
 {
   GObject parent_instance;
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 0179ee04dc..65cf404168 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -29,8 +29,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_DEVICE         (gdk_device_get_type ())
-#define GDK_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice))
-#define GDK_IS_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE))
+GDK_AVAILABLE_IN_ALL
+GDK_DECLARE_EXPORTED_TYPE (GdkDevice, gdk_device, GDK, DEVICE)
 
 typedef struct _GdkTimeCoord GdkTimeCoord;
 
@@ -121,9 +121,6 @@ struct _GdkTimeCoord
   gdouble axes[GDK_MAX_TIMECOORD_AXES];
 };
 
-GDK_AVAILABLE_IN_ALL
-GType                 gdk_device_get_type       (void) G_GNUC_CONST;
-
 GDK_AVAILABLE_IN_ALL
 const gchar *         gdk_device_get_name       (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index 70c29b7e85..ed5072d660 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -25,11 +25,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_DEVICE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
-#define GDK_IS_DEVICE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
-#define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
-
-typedef struct _GdkDeviceClass GdkDeviceClass;
 typedef struct _GdkDeviceKey GdkDeviceKey;
 
 struct _GdkDeviceKey
diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h
index 34610aa51b..ebbbc3456d 100644
--- a/gdk/gdkdisplay.h
+++ b/gdk/gdkdisplay.h
@@ -34,12 +34,10 @@
 
 G_BEGIN_DECLS
 
-#define GDK_TYPE_DISPLAY              (gdk_display_get_type ())
-#define GDK_DISPLAY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay))
-#define GDK_IS_DISPLAY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY))
-
+#define GDK_TYPE_DISPLAY (gdk_display_get_type ())
 GDK_AVAILABLE_IN_ALL
-GType       gdk_display_get_type (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkDisplay, gdk_display, GDK, DISPLAY)
+
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *gdk_display_open                (const gchar *display_name);
 
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 8c8b76a8bc..dad1c57b87 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -30,13 +30,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_DISPLAY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
-#define GDK_IS_DISPLAY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
-#define GDK_DISPLAY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
-
-
-typedef struct _GdkDisplayClass GdkDisplayClass;
-
 /* Tracks information about the device grab on this display */
 typedef struct
 {
diff --git a/gdk/gdkdrag.h b/gdk/gdkdrag.h
index 80301eb293..0f0546db18 100644
--- a/gdk/gdkdrag.h
+++ b/gdk/gdkdrag.h
@@ -36,8 +36,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_DRAG              (gdk_drag_get_type ())
-#define GDK_DRAG(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG, GdkDrag))
-#define GDK_IS_DRAG(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG))
+GDK_AVAILABLE_IN_ALL
+GDK_DECLARE_EXPORTED_TYPE (GdkDrag, gdk_drag, GDK, DRAG)
 
 /**
  * GdkDragCancelReason:
@@ -53,9 +53,6 @@ typedef enum {
   GDK_DRAG_CANCEL_ERROR
 } GdkDragCancelReason;
 
-GDK_AVAILABLE_IN_ALL
-GType            gdk_drag_get_type             (void) G_GNUC_CONST;
-
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *     gdk_drag_get_display          (GdkDrag *drag);
 GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkdragprivate.h b/gdk/gdkdragprivate.h
index 76fd56bb19..bf2b93a92c 100644
--- a/gdk/gdkdragprivate.h
+++ b/gdk/gdkdragprivate.h
@@ -23,13 +23,6 @@
 G_BEGIN_DECLS
 
 
-#define GDK_DRAG_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG, GdkDragClass))
-#define GDK_IS_DRAG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG))
-#define GDK_DRAG_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG, GdkDragClass))
-
-typedef struct _GdkDragClass GdkDragClass;
-
-
 struct _GdkDragClass {
   GObjectClass parent_class;
 
diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h
index e818ddd62d..d9a1ec8412 100644
--- a/gdk/gdkdrawcontext.h
+++ b/gdk/gdkdrawcontext.h
@@ -30,12 +30,9 @@
 
 G_BEGIN_DECLS
 
-#define GDK_TYPE_DRAW_CONTEXT             (gdk_draw_context_get_type ())
-#define GDK_DRAW_CONTEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_DRAW_CONTEXT, 
GdkDrawContext))
-#define GDK_IS_DRAW_CONTEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_DRAW_CONTEXT))
-
+#define GDK_TYPE_DRAW_CONTEXT (gdk_draw_context_get_type ())
 GDK_AVAILABLE_IN_ALL
-GType gdk_draw_context_get_type (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkDrawContext, gdk_draw_context, GDK, DRAW_CONTEXT)
 
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *            gdk_draw_context_get_display            (GdkDrawContext         *context);
diff --git a/gdk/gdkdrawcontextprivate.h b/gdk/gdkdrawcontextprivate.h
index 8ae1d0e8f8..29175eb4ea 100644
--- a/gdk/gdkdrawcontextprivate.h
+++ b/gdk/gdkdrawcontextprivate.h
@@ -25,12 +25,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_DRAW_CONTEXT_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAW_CONTEXT, 
GdkDrawContextClass))
-#define GDK_IS_DRAW_CONTEXT_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAW_CONTEXT))
-#define GDK_DRAW_CONTEXT_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAW_CONTEXT, 
GdkDrawContextClass))
-
-typedef struct _GdkDrawContextClass GdkDrawContextClass;
-
 struct _GdkDrawContext
 {
   GObject parent_instance;
diff --git a/gdk/gdkdrop.h b/gdk/gdkdrop.h
index 6e29864293..b4c2efa081 100644
--- a/gdk/gdkdrop.h
+++ b/gdk/gdkdrop.h
@@ -30,14 +30,9 @@
 
 G_BEGIN_DECLS
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
-
 #define GDK_TYPE_DROP              (gdk_drop_get_type ())
-#define GDK_DROP(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DROP, GdkDrop))
-#define GDK_IS_DROP(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DROP))
-
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_drop_get_type               (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkDrop, gdk_drop, GDK, DROP)
 
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *            gdk_drop_get_display            (GdkDrop                *self);
diff --git a/gdk/gdkdropprivate.h b/gdk/gdkdropprivate.h
index b20eee2ae7..b73a435ab8 100644
--- a/gdk/gdkdropprivate.h
+++ b/gdk/gdkdropprivate.h
@@ -25,13 +25,6 @@
 G_BEGIN_DECLS
 
 
-#define GDK_DROP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DROP, GdkDropClass))
-#define GDK_IS_DROP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DROP))
-#define GDK_DROP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DROP, GdkDropClass))
-
-typedef struct _GdkDropClass GdkDropClass;
-
-
 struct _GdkDrop {
   GObject parent_instance;
 };
diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h
index 10bac82e9b..ebe6436274 100644
--- a/gdk/gdkglcontext.h
+++ b/gdk/gdkglcontext.h
@@ -30,17 +30,14 @@
 
 G_BEGIN_DECLS
 
-#define GDK_TYPE_GL_CONTEXT             (gdk_gl_context_get_type ())
-#define GDK_GL_CONTEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_CONTEXT, 
GdkGLContext))
-#define GDK_IS_GL_CONTEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_CONTEXT))
-
 #define GDK_GL_ERROR       (gdk_gl_error_quark ())
 
+#define GDK_TYPE_GL_CONTEXT (gdk_gl_context_get_type ())
 GDK_AVAILABLE_IN_ALL
-GQuark gdk_gl_error_quark (void);
+GDK_DECLARE_EXPORTED_TYPE (GdkGLContext, gdk_gl_context, GDK, GL_CONTEXT)
 
 GDK_AVAILABLE_IN_ALL
-GType gdk_gl_context_get_type (void) G_GNUC_CONST;
+GQuark gdk_gl_error_quark (void);
 
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *            gdk_gl_context_get_display              (GdkGLContext  *context);
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index c7acccba43..625378d35b 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -26,12 +26,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_GL_CONTEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GL_CONTEXT, 
GdkGLContextClass))
-#define GDK_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_CONTEXT))
-#define GDK_GL_CONTEXT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_CONTEXT, 
GdkGLContextClass))
-
-typedef struct _GdkGLContextClass       GdkGLContextClass;
-
 struct _GdkGLContext
 {
   GdkDrawContext parent_instance;
diff --git a/gdk/gdkgltexture.h b/gdk/gdkgltexture.h
index 54e4fee7e7..ecc76e44d3 100644
--- a/gdk/gdkgltexture.h
+++ b/gdk/gdkgltexture.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_GL_TEXTURE (gdk_gl_texture_get_type ())
-
-#define GDK_GL_TEXTURE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_TEXTURE, 
GdkGLTexture))
-#define GDK_IS_GL_TEXTURE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_TEXTURE))
-
-typedef struct _GdkGLTexture            GdkGLTexture;
-typedef struct _GdkGLTextureClass       GdkGLTextureClass;
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
-
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_gl_texture_get_type                (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkGLTexture, gdk_gl_texture, GDK, GL_TEXTURE)
 
 GDK_AVAILABLE_IN_ALL
 GdkTexture *            gdk_gl_texture_new                     (GdkGLContext    *context,
diff --git a/gdk/gdkmemorytexture.h b/gdk/gdkmemorytexture.h
index eea2fda324..a1dfe10ea8 100644
--- a/gdk/gdkmemorytexture.h
+++ b/gdk/gdkmemorytexture.h
@@ -87,18 +87,8 @@ typedef enum {
 #endif
 
 #define GDK_TYPE_MEMORY_TEXTURE (gdk_memory_texture_get_type ())
-
-#define GDK_MEMORY_TEXTURE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_MEMORY_TEXTURE, 
GdkMemoryTexture))
-#define GDK_IS_MEMORY_TEXTURE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_MEMORY_TEXTURE))
-
-typedef struct _GdkMemoryTexture        GdkMemoryTexture;
-typedef struct _GdkMemoryTextureClass   GdkMemoryTextureClass;
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMemoryTexture, g_object_unref)
-
-
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_memory_texture_get_type         (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkMemoryTexture, gdk_memory_texture, GDK, MEMORY_TEXTURE)
 
 GDK_AVAILABLE_IN_ALL
 GdkTexture *            gdk_memory_texture_new              (int                width,
diff --git a/gdk/gdktexture.h b/gdk/gdktexture.h
index f3d0bc9765..9758da5f39 100644
--- a/gdk/gdktexture.h
+++ b/gdk/gdktexture.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_TEXTURE (gdk_texture_get_type ())
-
-#define GDK_TEXTURE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_TEXTURE, GdkTexture))
-#define GDK_IS_TEXTURE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_TEXTURE))
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkTexture, g_object_unref)
-
-typedef struct _GdkTextureClass        GdkTextureClass;
-
-
 GDK_AVAILABLE_IN_ALL
-GType                   gdk_texture_get_type                   (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GdkTexture, gdk_texture, GDK, TEXTURE)
 
 GDK_AVAILABLE_IN_ALL
 GdkTexture *            gdk_texture_new_for_pixbuf             (GdkPixbuf       *pixbuf);
diff --git a/gdk/gdktextureprivate.h b/gdk/gdktextureprivate.h
index 07cb5436a3..c7ca9cc6e1 100644
--- a/gdk/gdktextureprivate.h
+++ b/gdk/gdktextureprivate.h
@@ -5,10 +5,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_TEXTURE_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_TEXTURE, 
GdkTextureClass))
-#define GDK_IS_TEXTURE_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_TEXTURE))
-#define GDK_TEXTURE_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_TEXTURE, 
GdkTextureClass))
-
 struct _GdkTexture
 {
   GObject parent_instance;
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index c5e237fffc..a36db887bd 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -592,6 +592,26 @@ typedef enum
  */
 #define GDK_ACTION_ALL (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)
 
+#define GDK_DECLARE_EXPORTED_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME) \
+  GType module_obj_name##_get_type (void) G_GNUC_CONST;                                                  \
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS                                                                       \
+  typedef struct _##ModuleObjName ModuleObjName;                                                         \
+  typedef struct _##ModuleObjName##Class ModuleObjName##Class;                                           \
+                                                                                                         \
+  G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, g_object_unref)                                           \
+                                                                                                         \
+  G_GNUC_UNUSED static inline ModuleObjName * MODULE##_##OBJ_NAME (gconstpointer ptr) {                  \
+    return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); }             \
+  G_GNUC_UNUSED static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_CLASS (gconstpointer ptr) {   \
+    return G_TYPE_CHECK_CLASS_CAST (ptr, module_obj_name##_get_type (), ModuleObjName##Class); }         \
+  G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) {                           \
+    return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); }                            \
+  G_GNUC_UNUSED static inline gboolean MODULE##_IS_##OBJ_NAME##_CLASS (gpointer ptr) {                   \
+    return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); }                               \
+  G_GNUC_UNUSED static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) {    \
+    return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); }       \
+  G_GNUC_END_IGNORE_DEPRECATIONS
+
 G_END_DECLS
 
 #endif /* __GDK_TYPES_H__ */
diff --git a/gdk/gdkvulkancontext.h b/gdk/gdkvulkancontext.h
index 7b184b81e9..070108bc04 100644
--- a/gdk/gdkvulkancontext.h
+++ b/gdk/gdkvulkancontext.h
@@ -35,17 +35,14 @@
 G_BEGIN_DECLS
 
 #define GDK_TYPE_VULKAN_CONTEXT             (gdk_vulkan_context_get_type ())
-#define GDK_VULKAN_CONTEXT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_VULKAN_CONTEXT, 
GdkVulkanContext))
-#define GDK_IS_VULKAN_CONTEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_VULKAN_CONTEXT))
+GDK_AVAILABLE_IN_ALL
+GDK_DECLARE_EXPORTED_TYPE (GdkVulkanContext, gdk_vulkan_context, GDK, VULKAN_CONTEXT)
 
 #define GDK_VULKAN_ERROR                    (gdk_vulkan_error_quark ())
 
 GDK_AVAILABLE_IN_ALL
 GQuark gdk_vulkan_error_quark (void);
 
-GDK_AVAILABLE_IN_ALL
-GType gdk_vulkan_context_get_type (void) G_GNUC_CONST;
-
 #ifndef __GI_SCANNER__
 #ifdef GDK_RENDERING_VULKAN
 
diff --git a/gdk/gdkvulkancontextprivate.h b/gdk/gdkvulkancontextprivate.h
index c543f9f997..a0e11db787 100644
--- a/gdk/gdkvulkancontextprivate.h
+++ b/gdk/gdkvulkancontextprivate.h
@@ -32,12 +32,6 @@
 
 G_BEGIN_DECLS
 
-#define GDK_VULKAN_CONTEXT_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_VULKAN_CONTEXT, 
GdkVulkanContextClass))
-#define GDK_IS_VULKAN_CONTEXT_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_VULKAN_CONTEXT))
-#define GDK_VULKAN_CONTEXT_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_VULKAN_CONTEXT, 
GdkVulkanContextClass))
-
-typedef struct _GdkVulkanContextClass GdkVulkanContextClass;
-
 struct _GdkVulkanContext
 {
   GdkDrawContext parent_instance;
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index 1ed3d765b1..70715cf0fc 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -66,7 +66,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEditable, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEntry, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEntryBuffer, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEntryCompletion, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEventController, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkExpander, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFileChooserButton, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFileChooserDialog, g_object_unref)
@@ -81,15 +80,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontChooserDialog, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontChooserWidget, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFrame, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGLArea, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGesture, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureDrag, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureLongPress, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureClick, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGesturePan, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureRotate, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureSingle, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureSwipe, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureZoom, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGrid, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkHeaderBar, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkIMContext, g_object_unref)
diff --git a/gtk/gtkeventcontroller.h b/gtk/gtkeventcontroller.h
index e5a999961a..e94c651279 100644
--- a/gtk/gtkeventcontroller.h
+++ b/gtk/gtkeventcontroller.h
@@ -24,8 +24,6 @@
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
-typedef struct _GtkEventControllerClass GtkEventControllerClass;
-
 #include <gdk/gdk.h>
 #include <gtk/gtktypes.h>
 #include <gtk/gtkenums.h>
@@ -33,15 +31,8 @@ typedef struct _GtkEventControllerClass GtkEventControllerClass;
 G_BEGIN_DECLS
 
 #define GTK_TYPE_EVENT_CONTROLLER         (gtk_event_controller_get_type ())
-#define GTK_EVENT_CONTROLLER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER, 
GtkEventController))
-#define GTK_EVENT_CONTROLLER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER, 
GtkEventControllerClass))
-#define GTK_IS_EVENT_CONTROLLER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER))
-#define GTK_IS_EVENT_CONTROLLER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER))
-#define GTK_EVENT_CONTROLLER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER, 
GtkEventControllerClass))
-
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_event_controller_get_type       (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkEventController, gtk_event_controller, GTK, EVENT_CONTROLLER)
 
 GDK_AVAILABLE_IN_ALL
 GtkWidget  * gtk_event_controller_get_widget     (GtkEventController *controller);
diff --git a/gtk/gtkeventcontrollerkey.h b/gtk/gtkeventcontrollerkey.h
index 755947d255..1d8497f748 100644
--- a/gtk/gtkeventcontrollerkey.h
+++ b/gtk/gtkeventcontrollerkey.h
@@ -31,17 +31,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_EVENT_CONTROLLER_KEY         (gtk_event_controller_key_get_type ())
-#define GTK_EVENT_CONTROLLER_KEY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKey))
-#define GTK_EVENT_CONTROLLER_KEY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_KEY, 
GtkEventControllerKeyClass))
-#define GTK_IS_EVENT_CONTROLLER_KEY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GTK_TYPE_EVENT_CONTROLLER_KEY))
-#define GTK_IS_EVENT_CONTROLLER_KEY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_KEY))
-#define GTK_EVENT_CONTROLLER_KEY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKeyClass))
-
-typedef struct _GtkEventControllerKey GtkEventControllerKey;
-typedef struct _GtkEventControllerKeyClass GtkEventControllerKeyClass;
-
 GDK_AVAILABLE_IN_ALL
-GType               gtk_event_controller_key_get_type  (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkEventControllerKey, gtk_event_controller_key, GTK, EVENT_CONTROLLER_KEY)
 
 GDK_AVAILABLE_IN_ALL
 GtkEventController *gtk_event_controller_key_new (void);
diff --git a/gtk/gtkeventcontrollerlegacy.h b/gtk/gtkeventcontrollerlegacy.h
index 748bebb59a..16a5b8b543 100644
--- a/gtk/gtkeventcontrollerlegacy.h
+++ b/gtk/gtkeventcontrollerlegacy.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_EVENT_CONTROLLER_LEGACY         (gtk_event_controller_legacy_get_type ())
-#define GTK_EVENT_CONTROLLER_LEGACY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GTK_TYPE_EVENT_CONTROLLER_LEGACY, GtkEventControllerLegacy))
-#define GTK_EVENT_CONTROLLER_LEGACY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), 
GTK_TYPE_EVENT_CONTROLLER_LEGACY, GtkEventControllerLegacyClass))
-#define GTK_IS_EVENT_CONTROLLER_LEGACY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GTK_TYPE_EVENT_CONTROLLER_LEGACY))
-#define GTK_IS_EVENT_CONTROLLER_LEGACY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), 
GTK_TYPE_EVENT_CONTROLLER_LEGACY))
-#define GTK_EVENT_CONTROLLER_LEGACY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GTK_TYPE_EVENT_CONTROLLER_LEGACY, GtkEventControllerLegacyClass))
-
-typedef struct _GtkEventControllerLegacy GtkEventControllerLegacy;
-typedef struct _GtkEventControllerLegacyClass GtkEventControllerLegacyClass;
-
 GDK_AVAILABLE_IN_ALL
-GType               gtk_event_controller_legacy_get_type   (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkEventControllerLegacy, gtk_event_controller_legacy, GTK, 
EVENT_CONTROLLER_LEGACY)
 
 GDK_AVAILABLE_IN_ALL
 GtkEventController *gtk_event_controller_legacy_new        (void);
diff --git a/gtk/gtkeventcontrollermotion.h b/gtk/gtkeventcontrollermotion.h
index dbbc8c5621..6fcccc5af6 100644
--- a/gtk/gtkeventcontrollermotion.h
+++ b/gtk/gtkeventcontrollermotion.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_EVENT_CONTROLLER_MOTION         (gtk_event_controller_motion_get_type ())
-#define GTK_EVENT_CONTROLLER_MOTION(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotion))
-#define GTK_EVENT_CONTROLLER_MOTION_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), 
GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
-#define GTK_IS_EVENT_CONTROLLER_MOTION(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GTK_TYPE_EVENT_CONTROLLER_MOTION))
-#define GTK_IS_EVENT_CONTROLLER_MOTION_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), 
GTK_TYPE_EVENT_CONTROLLER_MOTION))
-#define GTK_EVENT_CONTROLLER_MOTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
-
-typedef struct _GtkEventControllerMotion GtkEventControllerMotion;
-typedef struct _GtkEventControllerMotionClass GtkEventControllerMotionClass;
-
 GDK_AVAILABLE_IN_ALL
-GType               gtk_event_controller_motion_get_type (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkEventControllerMotion, gtk_event_controller_motion, GTK, 
EVENT_CONTROLLER_MOTION)
 
 GDK_AVAILABLE_IN_ALL
 GtkEventController *gtk_event_controller_motion_new      (void);
diff --git a/gtk/gtkeventcontrollerscroll.h b/gtk/gtkeventcontrollerscroll.h
index cba616dae6..b66d1d225b 100644
--- a/gtk/gtkeventcontrollerscroll.h
+++ b/gtk/gtkeventcontrollerscroll.h
@@ -30,14 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_EVENT_CONTROLLER_SCROLL         (gtk_event_controller_scroll_get_type ())
-#define GTK_EVENT_CONTROLLER_SCROLL(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScroll))
-#define GTK_EVENT_CONTROLLER_SCROLL_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), 
GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
-#define GTK_IS_EVENT_CONTROLLER_SCROLL(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GTK_TYPE_EVENT_CONTROLLER_SCROLL))
-#define GTK_IS_EVENT_CONTROLLER_SCROLL_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), 
GTK_TYPE_EVENT_CONTROLLER_SCROLL))
-#define GTK_EVENT_CONTROLLER_SCROLL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
-
-typedef struct _GtkEventControllerScroll GtkEventControllerScroll;
-typedef struct _GtkEventControllerScrollClass GtkEventControllerScrollClass;
+GDK_AVAILABLE_IN_ALL
+GDK_DECLARE_EXPORTED_TYPE (GtkEventControllerScroll, gtk_event_controller_scroll, GTK, 
EVENT_CONTROLLER_SCROLL)
 
 /**
  * GtkEventControllerScrollFlags:
@@ -60,9 +54,6 @@ typedef enum {
   GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES  = (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL | 
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL),
 } GtkEventControllerScrollFlags;
 
-GDK_AVAILABLE_IN_ALL
-GType               gtk_event_controller_scroll_get_type  (void) G_GNUC_CONST;
-
 GDK_AVAILABLE_IN_ALL
 GtkEventController *gtk_event_controller_scroll_new       (GtkEventControllerScrollFlags  flags);
 GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkgesture.h b/gtk/gtkgesture.h
index 7513853157..fa0eaecb9f 100644
--- a/gtk/gtkgesture.h
+++ b/gtk/gtkgesture.h
@@ -30,16 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE         (gtk_gesture_get_type ())
-#define GTK_GESTURE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE, GtkGesture))
-#define GTK_GESTURE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE, GtkGestureClass))
-#define GTK_IS_GESTURE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE))
-#define GTK_IS_GESTURE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE))
-#define GTK_GESTURE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE, GtkGestureClass))
-
-typedef struct _GtkGestureClass GtkGestureClass;
-
 GDK_AVAILABLE_IN_ALL
-GType       gtk_gesture_get_type             (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGesture, gtk_gesture, GTK, GESTURE)
 
 GDK_AVAILABLE_IN_ALL
 GdkDevice * gtk_gesture_get_device           (GtkGesture       *gesture);
diff --git a/gtk/gtkgestureclick.h b/gtk/gtkgestureclick.h
index ea86fdb6d5..75a8ac1e36 100644
--- a/gtk/gtkgestureclick.h
+++ b/gtk/gtkgestureclick.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_CLICK         (gtk_gesture_click_get_type ())
-#define GTK_GESTURE_CLICK(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_CLICK, 
GtkGestureClick))
-#define GTK_GESTURE_CLICK_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_CLICK, 
GtkGestureClickClass))
-#define GTK_IS_GESTURE_CLICK(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_CLICK))
-#define GTK_IS_GESTURE_CLICK_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_CLICK))
-#define GTK_GESTURE_CLICK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_CLICK, 
GtkGestureClickClass))
-
-typedef struct _GtkGestureClick GtkGestureClick;
-typedef struct _GtkGestureClickClass GtkGestureClickClass;
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_gesture_click_get_type (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureClick, gtk_gesture_click, GTK, GESTURE_CLICK)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture * gtk_gesture_click_new      (void);
diff --git a/gtk/gtkgesturedrag.h b/gtk/gtkgesturedrag.h
index 2493e65de4..6541f620b6 100644
--- a/gtk/gtkgesturedrag.h
+++ b/gtk/gtkgesturedrag.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_DRAG         (gtk_gesture_drag_get_type ())
-#define GTK_GESTURE_DRAG(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_DRAG, 
GtkGestureDrag))
-#define GTK_GESTURE_DRAG_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_DRAG, 
GtkGestureDragClass))
-#define GTK_IS_GESTURE_DRAG(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_DRAG))
-#define GTK_IS_GESTURE_DRAG_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_DRAG))
-#define GTK_GESTURE_DRAG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_DRAG, 
GtkGestureDragClass))
-
-typedef struct _GtkGestureDrag GtkGestureDrag;
-typedef struct _GtkGestureDragClass GtkGestureDragClass;
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_gesture_drag_get_type          (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureDrag, gtk_gesture_drag, GTK, GESTURE_DRAG)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture * gtk_gesture_drag_new               (void);
diff --git a/gtk/gtkgesturelongpress.h b/gtk/gtkgesturelongpress.h
index da983355cd..c0153009fb 100644
--- a/gtk/gtkgesturelongpress.h
+++ b/gtk/gtkgesturelongpress.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_LONG_PRESS         (gtk_gesture_long_press_get_type ())
-#define GTK_GESTURE_LONG_PRESS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_LONG_PRESS, 
GtkGestureLongPress))
-#define GTK_GESTURE_LONG_PRESS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_LONG_PRESS, 
GtkGestureLongPressClass))
-#define GTK_IS_GESTURE_LONG_PRESS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_LONG_PRESS))
-#define GTK_IS_GESTURE_LONG_PRESS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_LONG_PRESS))
-#define GTK_GESTURE_LONG_PRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_LONG_PRESS, 
GtkGestureLongPressClass))
-
-typedef struct _GtkGestureLongPress GtkGestureLongPress;
-typedef struct _GtkGestureLongPressClass GtkGestureLongPressClass;
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_gesture_long_press_get_type   (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureLongPress, gtk_gesture_long_press, GTK, GESTURE_LONG_PRESS)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture * gtk_gesture_long_press_new        (void);
diff --git a/gtk/gtkgesturepan.h b/gtk/gtkgesturepan.h
index 496f4db57b..9084495784 100644
--- a/gtk/gtkgesturepan.h
+++ b/gtk/gtkgesturepan.h
@@ -29,17 +29,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_PAN         (gtk_gesture_pan_get_type ())
-#define GTK_GESTURE_PAN(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_PAN, GtkGesturePan))
-#define GTK_GESTURE_PAN_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_PAN, 
GtkGesturePanClass))
-#define GTK_IS_GESTURE_PAN(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_PAN))
-#define GTK_IS_GESTURE_PAN_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_PAN))
-#define GTK_GESTURE_PAN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_PAN, 
GtkGesturePanClass))
-
-typedef struct _GtkGesturePan GtkGesturePan;
-typedef struct _GtkGesturePanClass GtkGesturePanClass;
-
 GDK_AVAILABLE_IN_ALL
-GType             gtk_gesture_pan_get_type        (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGesturePan, gtk_gesture_pan, GTK, GESTURE_PAN)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture *      gtk_gesture_pan_new             (GtkOrientation  orientation);
diff --git a/gtk/gtkgesturerotate.h b/gtk/gtkgesturerotate.h
index 1c7529bd4a..2375f001be 100644
--- a/gtk/gtkgesturerotate.h
+++ b/gtk/gtkgesturerotate.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_ROTATE         (gtk_gesture_rotate_get_type ())
-#define GTK_GESTURE_ROTATE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_ROTATE, 
GtkGestureRotate))
-#define GTK_GESTURE_ROTATE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_ROTATE, 
GtkGestureRotateClass))
-#define GTK_IS_GESTURE_ROTATE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_ROTATE))
-#define GTK_IS_GESTURE_ROTATE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_ROTATE))
-#define GTK_GESTURE_ROTATE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_ROTATE, 
GtkGestureRotateClass))
-
-typedef struct _GtkGestureRotate GtkGestureRotate;
-typedef struct _GtkGestureRotateClass GtkGestureRotateClass;
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_gesture_rotate_get_type        (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureRotate, gtk_gesture_rotate, GTK, GESTURE_ROTATE)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture * gtk_gesture_rotate_new             (void);
diff --git a/gtk/gtkgesturesingle.h b/gtk/gtkgesturesingle.h
index 09dc9b6bb8..787df3b631 100644
--- a/gtk/gtkgesturesingle.h
+++ b/gtk/gtkgesturesingle.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_SINGLE         (gtk_gesture_single_get_type ())
-#define GTK_GESTURE_SINGLE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_SINGLE, 
GtkGestureSingle))
-#define GTK_GESTURE_SINGLE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_SINGLE, 
GtkGestureSingleClass))
-#define GTK_IS_GESTURE_SINGLE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_SINGLE))
-#define GTK_IS_GESTURE_SINGLE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_SINGLE))
-#define GTK_GESTURE_SINGLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_SINGLE, 
GtkGestureSingleClass))
-
-typedef struct _GtkGestureSingle GtkGestureSingle;
-typedef struct _GtkGestureSingleClass GtkGestureSingleClass;
-
 GDK_AVAILABLE_IN_ALL
-GType       gtk_gesture_single_get_type       (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureSingle, gtk_gesture_single, GTK, GESTURE_SINGLE)
 
 GDK_AVAILABLE_IN_ALL
 gboolean    gtk_gesture_single_get_touch_only (GtkGestureSingle *gesture);
diff --git a/gtk/gtkgesturestylus.h b/gtk/gtkgesturestylus.h
index cb4c13efb6..48c6224610 100644
--- a/gtk/gtkgesturestylus.h
+++ b/gtk/gtkgesturestylus.h
@@ -28,17 +28,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_STYLUS         (gtk_gesture_stylus_get_type ())
-#define GTK_GESTURE_STYLUS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_STYLUS, 
GtkGestureStylus))
-#define GTK_GESTURE_STYLUS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_STYLUS, 
GtkGestureStylusClass))
-#define GTK_IS_GESTURE_STYLUS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_STYLUS))
-#define GTK_IS_GESTURE_STYLUS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_STYLUS))
-#define GTK_GESTURE_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_STYLUS, 
GtkGestureStylusClass))
-
-typedef struct _GtkGestureStylus GtkGestureStylus;
-typedef struct _GtkGestureStylusClass GtkGestureStylusClass;
-
 GDK_AVAILABLE_IN_ALL
-GType             gtk_gesture_stylus_get_type (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK, GESTURE_STYLUS)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture *      gtk_gesture_stylus_new      (void);
diff --git a/gtk/gtkgestureswipe.h b/gtk/gtkgestureswipe.h
index 330ae7eb69..4b973f6676 100644
--- a/gtk/gtkgestureswipe.h
+++ b/gtk/gtkgestureswipe.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_SWIPE         (gtk_gesture_swipe_get_type ())
-#define GTK_GESTURE_SWIPE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_SWIPE, 
GtkGestureSwipe))
-#define GTK_GESTURE_SWIPE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_SWIPE, 
GtkGestureSwipeClass))
-#define GTK_IS_GESTURE_SWIPE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_SWIPE))
-#define GTK_IS_GESTURE_SWIPE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_SWIPE))
-#define GTK_GESTURE_SWIPE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_SWIPE, 
GtkGestureSwipeClass))
-
-typedef struct _GtkGestureSwipe GtkGestureSwipe;
-typedef struct _GtkGestureSwipeClass GtkGestureSwipeClass;
-
 GDK_AVAILABLE_IN_ALL
-GType           gtk_gesture_swipe_get_type      (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureSwipe, gtk_gesture_swipe, GTK, GESTURE_SWIPE)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture *    gtk_gesture_swipe_new           (void);
diff --git a/gtk/gtkgesturezoom.h b/gtk/gtkgesturezoom.h
index 0a02852c58..a5fda5270e 100644
--- a/gtk/gtkgesturezoom.h
+++ b/gtk/gtkgesturezoom.h
@@ -30,17 +30,8 @@
 G_BEGIN_DECLS
 
 #define GTK_TYPE_GESTURE_ZOOM         (gtk_gesture_zoom_get_type ())
-#define GTK_GESTURE_ZOOM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_ZOOM, 
GtkGestureZoom))
-#define GTK_GESTURE_ZOOM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_ZOOM, 
GtkGestureZoomClass))
-#define GTK_IS_GESTURE_ZOOM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_ZOOM))
-#define GTK_IS_GESTURE_ZOOM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_ZOOM))
-#define GTK_GESTURE_ZOOM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_ZOOM, 
GtkGestureZoomClass))
-
-typedef struct _GtkGestureZoom GtkGestureZoom;
-typedef struct _GtkGestureZoomClass GtkGestureZoomClass;
-
 GDK_AVAILABLE_IN_ALL
-GType        gtk_gesture_zoom_get_type        (void) G_GNUC_CONST;
+GDK_DECLARE_EXPORTED_TYPE (GtkGestureZoom, gtk_gesture_zoom, GTK, GESTURE_ZOOM)
 
 GDK_AVAILABLE_IN_ALL
 GtkGesture * gtk_gesture_zoom_new             (void);



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