]> saetta.ns0.it Git - libzakgtkdecoder/commitdiff
Use of new GObject macros.
authorAndrea Zagli <azagli@libero.it>
Sat, 19 Dec 2015 13:53:35 +0000 (14:53 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 19 Dec 2015 13:53:35 +0000 (14:53 +0100)
src/zakgtkdecoder.c
src/zakgtkdecoder.h

index 89d8bd830c13f9cd0dc8a3a3b00c6be9a73f9a14..0e6f7a0ebbf13545c28a99568b911103825e36c8 100644 (file)
@@ -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);
index d7492eeb2dd8d0be397981b3c6ceee66c35cfb82..3636d9f22548ea568545d22e25c74b549b0d7972 100644 (file)
 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);