Use G_DECLARE_FINAL_TYPE for GtkTicker.

Sun, 31 Mar 2019 23:26:07 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 31 Mar 2019 23:26:07 -0400
changeset 39554
5db4b5afd647
parent 39553
5f6c287230d1
child 39555
1f7690fa7761

Use G_DECLARE_FINAL_TYPE for GtkTicker.

pidgin/plugins/ticker/gtkticker.c file | annotate | diff | comparison | revisions
pidgin/plugins/ticker/gtkticker.h file | annotate | diff | comparison | revisions
--- a/pidgin/plugins/ticker/gtkticker.c	Sun Mar 31 23:03:16 2019 -0400
+++ b/pidgin/plugins/ticker/gtkticker.c	Sun Mar 31 23:26:07 2019 -0400
@@ -26,6 +26,19 @@
 
 #include "gtk3compat.h"
 
+struct _GtkTicker
+{
+	GtkContainer container;
+	guint interval;	/* how often to scootch */
+	gint spacing;	/* inter-child horizontal spacing */
+	guint scootch;	/* how many pixels to move each scootch */
+	gint timer;		/* timer object */
+	gint total;		/* total width of widgets */
+	gint width;		/* width of containing window */
+	gboolean dirty;
+	GList *children;
+};
+
 static void gtk_ticker_compute_offsets (GtkTicker    *ticker);
 static void gtk_ticker_class_init    (GtkTickerClass    *klass);
 static void gtk_ticker_init          (GtkTicker         *ticker);
--- a/pidgin/plugins/ticker/gtkticker.h	Sun Mar 31 23:03:16 2019 -0400
+++ b/pidgin/plugins/ticker/gtkticker.h	Sun Mar 31 23:26:07 2019 -0400
@@ -32,37 +32,12 @@
 
 G_BEGIN_DECLS
 
-#define GTK_TYPE_TICKER            (gtk_ticker_get_type())
-#define GTK_TICKER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_TICKER, GtkTicker))
-#define GTK_TICKER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_TICKER, GtkTickerClass))
-#define GTK_IS_TICKER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_TICKER))
-#define GTK_IS_TICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_TICKER))
+#define GTK_TYPE_TICKER  gtk_ticker_get_type()
 
-
-typedef struct _GtkTicker        GtkTicker;
-typedef struct _GtkTickerClass   GtkTickerClass;
 typedef struct _GtkTickerChild   GtkTickerChild;
 
 /* XXX children move from right to left, should be able to go other way */
 
-struct _GtkTicker
-{
-  GtkContainer container;
-  guint interval;	/* how often to scootch */
-  gint spacing;	/* inter-child horizontal spacing */
-  guint scootch;	/* how many pixels to move each scootch */
-  gint timer;		/* timer object */
-  gint total;		/* total width of widgets */
-  gint width;		/* width of containing window */
-  gboolean dirty;
-  GList *children;
-};
-
-struct _GtkTickerClass
-{
-  GtkContainerClass parent_class;
-};
-
 struct _GtkTickerChild
 {
   GtkWidget *widget;
@@ -72,7 +47,7 @@
 
 
 G_MODULE_EXPORT
-GType      gtk_ticker_get_type          (void);
+G_DECLARE_FINAL_TYPE(GtkTicker, gtk_ticker, GTK, TICKER, GtkContainer)
 void       gtk_ticker_register_type     (PurplePlugin *plugin);
 
 GtkWidget* gtk_ticker_new               (void);

mercurial