]> saetta.ns0.it Git - libgtkform/commitdiff
Started Glade catalog for GtkFormUI.
authorAndrea Zagli <azagli@libero.it>
Sat, 30 Apr 2011 14:38:04 +0000 (16:38 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 30 Apr 2011 14:38:04 +0000 (16:38 +0200)
14 files changed:
configure.ac
ui/Makefile.am
ui/glade/Makefile.am [new file with mode: 0644]
ui/glade/gtkformui.xml [new file with mode: 0644]
ui/glade/icons/Makefile.am [new file with mode: 0644]
ui/glade/icons/hicolor/16x16/Makefile.am [new file with mode: 0644]
ui/glade/icons/hicolor/16x16/actions/Makefile.am [new file with mode: 0644]
ui/glade/icons/hicolor/16x16/actions/widget-gtkformui-gtkformdecoder.png [new file with mode: 0644]
ui/glade/icons/hicolor/22x22/Makefile.am [new file with mode: 0644]
ui/glade/icons/hicolor/22x22/actions/Makefile.am [new file with mode: 0644]
ui/glade/icons/hicolor/22x22/actions/widget-gtkformui-gtkformdecoder.png [new file with mode: 0644]
ui/glade/icons/hicolor/Makefile.am [new file with mode: 0644]
ui/gtkformdecoder.c
ui/gtkformdecoder.h

index a8e542323432eda82fdf17903c56f6c53f088ac0..da603b4a206c80335fa7899cb17c67266be8c578 100644 (file)
@@ -39,6 +39,10 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
 AM_GLIB_GNU_GETTEXT
 
 # Checks for libraries.
+PKG_CHECK_EXISTS(gladeui-1.0 >= 3.2.0, [GLADEUI_FOUND=yes], [GLADEUI_FOUND=no])
+
+AM_CONDITIONAL(GLADEUI, test $GLADEUI_FOUND = yes)
+
 PKG_CHECK_MODULES(GTKFORM, [gtk+-2.0 >= 2.12.0
                             libxml-2.0 >= 2.0.0
                             libgdaex >= 0.1.0
@@ -73,4 +77,17 @@ AC_CONFIG_FILES([
   data/Makefile
   po/Makefile.in
 ])
+
+if test $GLADEUI_FOUND = yes; then
+AC_CONFIG_FILES([
+  ui/glade/Makefile
+  ui/glade/icons/Makefile
+  ui/glade/icons/hicolor/Makefile
+  ui/glade/icons/hicolor/16x16/Makefile
+  ui/glade/icons/hicolor/16x16/actions/Makefile
+  ui/glade/icons/hicolor/22x22/Makefile
+  ui/glade/icons/hicolor/22x22/actions/Makefile
+])
+fi
+
 AC_OUTPUT
index 649b3d86bfd3d3278b90b30ee096ae6fb6c1d620..54a8f2b8da63f887ab5a7e8ba8e8e1a1152e5cbf 100644 (file)
@@ -1,3 +1,7 @@
+if GLADEUI
+SUBDIRS = glade
+endif
+
 AM_CPPFLAGS = $(WARN_CFLAGS) \
               $(DISABLE_DEPRECATED_CFLAGS) \
               $(GTKFORMUI_CFLAGS) \
diff --git a/ui/glade/Makefile.am b/ui/glade/Makefile.am
new file mode 100644 (file)
index 0000000..8d22cb8
--- /dev/null
@@ -0,0 +1,16 @@
+SUBDIRS = icons
+
+moduledir = `pkg-config --variable=moduledir gladeui-1.0`
+
+catalogsdir = `pkg-config --variable=catalogdir gladeui-1.0`
+
+catalogs_DATA = gtkformui.xml
+
+EXTRA_DIST = $(catalogs_DATA)
+
+install-exec-hook:
+       cd $(moduledir) && \
+       ln -s -f $(libdir)/libgtkformui.so .
+
+uninstall-hook:
+       rm -f $(moduledir)/libgtkformui.so
diff --git a/ui/glade/gtkformui.xml b/ui/glade/gtkformui.xml
new file mode 100644 (file)
index 0000000..48be43e
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glade-catalog name="gtkformui" library="gtkformui" depends="gtk+" domain="gtkformui" book="gtkformui">
+
+       <glade-widget-classes>
+               <glade-widget-class name="GtkFormDecoder" generic-name="gtkformdecoder" title="Decoder">
+                       <properties>
+                       </properties>
+               </glade-widget-class>
+       </glade-widget-classes>
+
+       <glade-widget-group name="gtk-control-display" title="Control and Display">
+               <glade-widget-class-ref name="GtkFormDecoder" />
+       </glade-widget-group>
+
+</glade-catalog>
diff --git a/ui/glade/icons/Makefile.am b/ui/glade/icons/Makefile.am
new file mode 100644 (file)
index 0000000..658356b
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = hicolor
diff --git a/ui/glade/icons/hicolor/16x16/Makefile.am b/ui/glade/icons/hicolor/16x16/Makefile.am
new file mode 100644 (file)
index 0000000..0224d45
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = actions
diff --git a/ui/glade/icons/hicolor/16x16/actions/Makefile.am b/ui/glade/icons/hicolor/16x16/actions/Makefile.am
new file mode 100644 (file)
index 0000000..ccf8100
--- /dev/null
@@ -0,0 +1,5 @@
+iconsdir = `pkg-config --variable=pixmapdir gladeui-1.0`/hicolor/16x16/actions
+
+icons_DATA = widget-gtkformui-gtkformdecoder.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/ui/glade/icons/hicolor/16x16/actions/widget-gtkformui-gtkformdecoder.png b/ui/glade/icons/hicolor/16x16/actions/widget-gtkformui-gtkformdecoder.png
new file mode 100644 (file)
index 0000000..ec4e622
Binary files /dev/null and b/ui/glade/icons/hicolor/16x16/actions/widget-gtkformui-gtkformdecoder.png differ
diff --git a/ui/glade/icons/hicolor/22x22/Makefile.am b/ui/glade/icons/hicolor/22x22/Makefile.am
new file mode 100644 (file)
index 0000000..0224d45
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = actions
diff --git a/ui/glade/icons/hicolor/22x22/actions/Makefile.am b/ui/glade/icons/hicolor/22x22/actions/Makefile.am
new file mode 100644 (file)
index 0000000..35aa85a
--- /dev/null
@@ -0,0 +1,5 @@
+iconsdir = `pkg-config --variable=pixmapdir gladeui-1.0`/hicolor/22x22/actions
+
+icons_DATA = widget-gtkformui-gtkformdecoder.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/ui/glade/icons/hicolor/22x22/actions/widget-gtkformui-gtkformdecoder.png b/ui/glade/icons/hicolor/22x22/actions/widget-gtkformui-gtkformdecoder.png
new file mode 100644 (file)
index 0000000..7945a48
Binary files /dev/null and b/ui/glade/icons/hicolor/22x22/actions/widget-gtkformui-gtkformdecoder.png differ
diff --git a/ui/glade/icons/hicolor/Makefile.am b/ui/glade/icons/hicolor/Makefile.am
new file mode 100644 (file)
index 0000000..fc1d169
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = 16x16 22x22
index a651d96e1694791cafe3cd2ccfbf61b14b4930a3..9ec781a70ef572c98cc0699a1f0c5f921e3e11ff 100644 (file)
@@ -43,6 +43,9 @@ static void gtk_form_decoder_get_property (GObject *object,
                                            GValue *value,
                                            GParamSpec *pspec);
 
+static void gtk_form_decoder_on_btn_browse_clicked (GtkButton *button,
+                                        gpointer user_data);
+
 static GtkWidgetClass *parent_class = NULL;
 
 
@@ -76,6 +79,21 @@ gtk_form_decoder_class_init (GtkFormDecoderClass *klass)
 
        widget_class->size_request = gtk_form_decoder_size_request;
        widget_class->size_allocate = gtk_form_decoder_size_allocate;
+
+       /**
+        * GtkFormDecoder::btn_browse_clicked:
+        * @gtk_form_decoder:
+        *
+        */
+       klass->btn_browse_clicked_signal_id = g_signal_new ("btn-browse-clicked",
+                                                      G_TYPE_FROM_CLASS (object_class),
+                                                      G_SIGNAL_RUN_LAST,
+                                                      0,
+                                                      NULL,
+                                                      NULL,
+                                                      g_cclosure_marshal_VOID__VOID,
+                                                      G_TYPE_NONE,
+                                                      0);
 }
 
 static void
@@ -83,12 +101,13 @@ gtk_form_decoder_init (GtkFormDecoder *decoder)
 {
        GtkFormDecoderPrivate *priv = GTK_FORM_DECODER_GET_PRIVATE (decoder);
 
-       priv->hbox = gtk_hbox_new (FALSE, 0);
+       priv->hbox = gtk_hbox_new (FALSE, 5);
        gtk_container_add (GTK_CONTAINER (decoder), priv->hbox);
        gtk_widget_show (priv->hbox);
 
        priv->txt_decoded = gtk_entry_new ();
        gtk_box_pack_start (GTK_BOX (priv->hbox), priv->txt_decoded, TRUE, TRUE, 0);
+       gtk_editable_set_editable (GTK_EDITABLE (priv->txt_decoded), FALSE);
        gtk_widget_show (priv->txt_decoded);
 
        priv->btn_browse = gtk_button_new_with_label ("...");
@@ -96,6 +115,9 @@ gtk_form_decoder_init (GtkFormDecoder *decoder)
        gtk_widget_set_no_show_all (priv->btn_browse, TRUE);
        gtk_widget_show (priv->btn_browse);
 
+       g_signal_connect (G_OBJECT (priv->btn_browse), "clicked",
+                         G_CALLBACK (gtk_form_decoder_on_btn_browse_clicked), (gpointer)decoder);
+
        priv->lbl_key = gtk_label_new ("");
        gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lbl_key, FALSE, FALSE, 0);
        gtk_widget_set_no_show_all (priv->lbl_key, TRUE);
@@ -212,3 +234,12 @@ gtk_form_decoder_size_allocate (GtkWidget *widget,
                        gtk_widget_size_allocate (bin->child, &child_allocation);
                }
 }
+
+static void
+gtk_form_decoder_on_btn_browse_clicked (GtkButton *button,
+                                        gpointer user_data)
+{
+       GtkFormDecoderClass *klass = GTK_FORM_DECODER_GET_CLASS ((GtkFormDecoder *)user_data);
+
+       g_signal_emit (G_OBJECT (user_data), klass->btn_browse_clicked_signal_id, 0);
+}
index c7a09c7be0565b5fdc66c1c2ad49664a020fc7e5..12dcf184af50994bcf6472d8e9df887616b4de5c 100644 (file)
@@ -29,10 +29,10 @@ G_BEGIN_DECLS
 
 #define GTK_TYPE_FORM_DECODER           (gtk_form_decoder_get_type ())
 #define GTK_FORM_DECODER(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FORM_DECODER, GtkFormDecoder))
-#define GTK_FORM_DECODER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM_DECODER, GtkFormDecoder))
+#define GTK_FORM_DECODER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM_DECODER, GtkFormDecoderClass))
 #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 GTK_FORM_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FORM_DECODER, GtkFormDecoder))
+#define GTK_FORM_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FORM_DECODER, GtkFormDecoderClass))
 
 
 typedef struct _GtkFormDecoder GtkFormDecoder;
@@ -47,6 +47,8 @@ struct _GtkFormDecoder
 struct _GtkFormDecoderClass
 {
        GtkBinClass parent_class;
+
+       guint btn_browse_clicked_signal_id;
 };