From: Andrea Zagli Date: Sat, 19 Dec 2015 13:53:35 +0000 (+0100) Subject: Use of new GObject macros. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=db2fc7e2d66e8d4cb87d03b8b9be9fa9efa0c2aa;p=libzakgtkdecoder Use of new GObject macros. --- diff --git a/src/zakgtkdecoder.c b/src/zakgtkdecoder.c index 89d8bd8..0e6f7a0 100644 --- a/src/zakgtkdecoder.c +++ b/src/zakgtkdecoder.c @@ -76,7 +76,7 @@ static void zak_gtk_decoder_on_btn_browse_clicked (GtkButton *button, static GtkWidgetClass *parent_class = NULL; -#define ZAK_GTK_DECODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_FORM_DECODER, ZakGtkDecoderPrivate)) +#define ZAK_GTK_DECODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_GTK_TYPE_DECODER, ZakGtkDecoderPrivate)) typedef struct _ZakGtkDecoderPrivate ZakGtkDecoderPrivate; struct _ZakGtkDecoderPrivate @@ -335,7 +335,7 @@ zak_gtk_decoder_set_key (ZakGtkDecoder *decoder, const gchar *key) { ZakGtkDecoderPrivate *priv; - g_return_if_fail (GTK_IS_FORM_DECODER (decoder)); + g_return_if_fail (ZAK_GTK_IS_DECODER (decoder)); priv = ZAK_GTK_DECODER_GET_PRIVATE (decoder); @@ -348,7 +348,7 @@ gchar { ZakGtkDecoderPrivate *priv; - g_return_val_if_fail (GTK_IS_FORM_DECODER (decoder), NULL); + g_return_val_if_fail (ZAK_GTK_IS_DECODER (decoder), NULL); priv = ZAK_GTK_DECODER_GET_PRIVATE (decoder); @@ -360,7 +360,7 @@ gchar { ZakGtkDecoderPrivate *priv; - g_return_val_if_fail (GTK_IS_FORM_DECODER (decoder), NULL); + g_return_val_if_fail (ZAK_GTK_IS_DECODER (decoder), NULL); priv = ZAK_GTK_DECODER_GET_PRIVATE (decoder); @@ -373,7 +373,7 @@ zak_gtk_decoder_decode (ZakGtkDecoder *decoder) { ZakGtkDecoderPrivate *priv; - g_return_if_fail (GTK_IS_FORM_DECODER (decoder)); + g_return_if_fail (ZAK_GTK_IS_DECODER (decoder)); priv = ZAK_GTK_DECODER_GET_PRIVATE (decoder); @@ -536,7 +536,7 @@ zak_gtk_decoder_size_request (GtkWidget *widget, guint border_width; - g_return_if_fail (GTK_IS_FORM_DECODER (widget)); + g_return_if_fail (ZAK_GTK_IS_DECODER (widget)); g_return_if_fail (requisition != NULL); decoder = ZAK_GTK_DECODER (widget); @@ -569,7 +569,7 @@ zak_gtk_decoder_size_allocate (GtkWidget *widget, guint border_width; - g_return_if_fail (GTK_IS_FORM_DECODER (widget)); + g_return_if_fail (ZAK_GTK_IS_DECODER (widget)); g_return_if_fail (allocation != NULL); decoder = ZAK_GTK_DECODER (widget); diff --git a/src/zakgtkdecoder.h b/src/zakgtkdecoder.h index d7492ee..3636d9f 100644 --- a/src/zakgtkdecoder.h +++ b/src/zakgtkdecoder.h @@ -27,22 +27,8 @@ G_BEGIN_DECLS -#define GTK_TYPE_FORM_DECODER (zak_gtk_decoder_get_type ()) -#define ZAK_GTK_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FORM_DECODER, ZakGtkDecoder)) -#define ZAK_GTK_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM_DECODER, ZakGtkDecoderClass)) -#define GTK_IS_FORM_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FORM_DECODER)) -#define GTK_IS_FORM_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FORM_DECODER)) -#define ZAK_GTK_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FORM_DECODER, ZakGtkDecoderClass)) - - -typedef struct _ZakGtkDecoder ZakGtkDecoder; -typedef struct _ZakGtkDecoderClass ZakGtkDecoderClass; - - -struct _ZakGtkDecoder -{ - GtkBin parent; -}; +#define ZAK_GTK_TYPE_DECODER zak_gtk_decoder_get_type () +G_DECLARE_DERIVABLE_TYPE (ZakGtkDecoder, zak_gtk_decoder, ZAK_GTK, DECODER, GtkBin) struct _ZakGtkDecoderClass { @@ -55,8 +41,6 @@ struct _ZakGtkDecoderClass }; -GType zak_gtk_decoder_get_type (void) G_GNUC_CONST; - GtkWidget *zak_gtk_decoder_new (void); void zak_gtk_decoder_set_key (ZakGtkDecoder *decoder, const gchar *key);