[glade/tintou/more-g-declare: 14/21] gladeui: Use G_DECLARE_INTERFACE for GladeDrag



commit 80283c9851789f421f9d0403b07c514980c25561
Author: Corentin Noël <corentin noel collabora com>
Date:   Fri Aug 16 17:25:40 2019 +0200

    gladeui: Use G_DECLARE_INTERFACE for GladeDrag

 gladeui/glade-drag.c |  8 ++++----
 gladeui/glade-drag.h | 11 ++---------
 2 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/gladeui/glade-drag.c b/gladeui/glade-drag.c
index 248467cb..93c9e917 100644
--- a/gladeui/glade-drag.c
+++ b/gladeui/glade-drag.c
@@ -37,7 +37,7 @@ _glade_drag_can_drag (_GladeDrag *source)
   _GladeDragInterface *iface;
 
   g_return_val_if_fail (GLADE_IS_DRAG (source), FALSE);
-  iface = GLADE_DRAG_GET_INTERFACE (source);
+  iface = GLADE_DRAG_GET_IFACE (source);
   
   if (iface->can_drag)
     return iface->can_drag (source);
@@ -51,7 +51,7 @@ _glade_drag_can_drop (_GladeDrag *dest, gint x, gint y, GObject *data)
   _GladeDragInterface *iface;
 
   g_return_val_if_fail (GLADE_IS_DRAG (dest), FALSE);
-  iface = GLADE_DRAG_GET_INTERFACE (dest);
+  iface = GLADE_DRAG_GET_IFACE (dest);
 
   if (iface->can_drop)
     return iface->can_drop (dest, x, y, data);
@@ -65,7 +65,7 @@ _glade_drag_drop (_GladeDrag *dest, gint x, gint y, GObject *data)
   _GladeDragInterface *iface;
 
   g_return_val_if_fail (GLADE_IS_DRAG (dest), FALSE);
-  iface = GLADE_DRAG_GET_INTERFACE (dest);
+  iface = GLADE_DRAG_GET_IFACE (dest);
 
   if (iface->drop)
     return iface->drop (dest, x, y, data);
@@ -79,7 +79,7 @@ _glade_drag_highlight (_GladeDrag *dest, gint x, gint y)
   _GladeDragInterface *iface;
 
   g_return_if_fail (GLADE_IS_DRAG (dest));
-  iface = GLADE_DRAG_GET_INTERFACE (dest);
+  iface = GLADE_DRAG_GET_IFACE (dest);
 
   if (iface->highlight)
     iface->highlight (dest, x, y);
diff --git a/gladeui/glade-drag.h b/gladeui/glade-drag.h
index 85903f79..de3843e2 100644
--- a/gladeui/glade-drag.h
+++ b/gladeui/glade-drag.h
@@ -29,13 +29,8 @@
 
 G_BEGIN_DECLS
 
-#define GLADE_TYPE_DRAG                (_glade_drag_get_type ())
-#define GLADE_DRAG(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_DRAG, _GladeDrag))
-#define GLADE_IS_DRAG(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_DRAG))
-#define GLADE_DRAG_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GLADE_TYPE_DRAG, 
_GladeDragInterface))
-
-typedef struct __GladeDrag _GladeDrag;
-typedef struct __GladeDragInterface _GladeDragInterface;
+#define GLADE_TYPE_DRAG _glade_drag_get_type ()
+G_DECLARE_INTERFACE (_GladeDrag, _glade_drag, GLADE, DRAG, GObject)
 
 struct __GladeDragInterface
 {
@@ -58,8 +53,6 @@ struct __GladeDragInterface
                          gint       y);
 };
 
-GType    _glade_drag_get_type  (void) G_GNUC_CONST;
-
 gboolean _glade_drag_can_drag  (_GladeDrag *source);
 
 gboolean _glade_drag_can_drop  (_GladeDrag *dest,


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