[devhelp] preliminary toolbar work



commit 9b95c6058126aa8eb9207a94f55563818d5f7136
Author: FrÃdÃric PÃters <fpeters 0d be>
Date:   Fri Feb 1 10:50:17 2013 +0100

    preliminary toolbar work

 .gitmodules     |    3 +++
 Makefile.am     |    2 +-
 autogen.sh      |    1 +
 configure.ac    |    6 ++++++
 libgd           |    1 +
 src/Makefile.am |    5 ++++-
 src/dh-window.c |   39 ++++++++++++++++-----------------------
 7 files changed, 32 insertions(+), 25 deletions(-)
---
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..bfd964e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "libgd"]
+	path = libgd
+	url = git://git.gnome.org/libgd
diff --git a/Makefile.am b/Makefile.am
index 7807d9b..54009b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
-SUBDIRS = po src data misc contrib
+SUBDIRS = libgd po src data misc contrib
 
 EXTRA_DIST =			\
 	autogen.sh		\
diff --git a/autogen.sh b/autogen.sh
index dc0b430..faaf5f0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,7 @@ srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 
 PKG_NAME="Devhelp"
+ACLOCAL_FLAGS="-I libgd $ACLOCAL_FLAGS"
 
 (test -f $srcdir/src/dh-main.c) || {
     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
diff --git a/configure.ac b/configure.ac
index bd18b54..3a88588 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,11 @@ AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 
 AM_PATH_PYTHON([2.3],[],[no])
 
+LIBGD_INIT([
+  main-toolbar
+  static
+])
+
 AC_CONFIG_FILES([
 Makefile
 po/Makefile.in
@@ -133,6 +138,7 @@ data/devhelp.desktop.in
 data/icons/Makefile
 data/ui/Makefile
 data/dtd/Makefile
+libgd/Makefile
 misc/Makefile
 misc/gedit-plugin/Makefile
 contrib/Makefile
diff --git a/libgd b/libgd
new file mode 160000
index 0000000..dbbf10d
--- /dev/null
+++ b/libgd
@@ -0,0 +1 @@
+Subproject commit dbbf10d6eaaba74b44c21fa08cbb34d34dbf53ea
diff --git a/src/Makefile.am b/src/Makefile.am
index 6be4815..8cea1b4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,7 +54,8 @@ devhelp_CFLAGS =					\
 	$(DEVHELP_CFLAGS)
 
 devhelp_LDADD = 					\
-        $(DEVHELP_LIBS)					\
+	$(DEVHELP_LIBS)					\
+	$(top_builddir)/libgd/libgd.la \
         libdevhelp-3.la
 
 lib_LTLIBRARIES = libdevhelp-3.la
@@ -113,6 +114,8 @@ libdevhelp_3_la_CPPFLAGS =				\
 	$(ZLIB_CPPFLAGS)
 
 libdevhelp_3_la_CFLAGS =				\
+	-I$(top_srcdir)/libgd \
+	$(top_builddir)/libgd/libgd.la \
 	$(LIBDEVHELP_CFLAGS)
 
 libdevhelp_3_la_LIBADD =				\
diff --git a/src/dh-window.c b/src/dh-window.c
index 30d86f9..849fb24 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -43,6 +43,8 @@
 #include <gtkosxapplication.h>
 #endif
 
+#include <libgd/gd.h>
+
 #include "dh-book-tree.h"
 #include "dh-book-manager.h"
 #include "dh-book.h"
@@ -1041,34 +1043,25 @@ window_populate (DhWindow *window)
 
         priv = window->priv;
 
-        toolbar = GTK_WIDGET (gtk_builder_get_object (priv->builder, "toolbar"));
+        toolbar = gd_main_toolbar_new ();
+        gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (toolbar),
+                        "go-previous-symbolic",
+                        _("Back"),
+                        TRUE);
+        gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (toolbar),
+                        "go-next-symbolic",
+                        _("Forward"),
+                        TRUE);
+        gd_main_toolbar_add_menu (GD_MAIN_TOOLBAR (toolbar),
+                        "emblem-system-symbolic",
+                        "",
+                        FALSE);
+
 
         /* Add toolbar to main box */
-        gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
-                                     GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
         gtk_box_pack_start (GTK_BOX (priv->main_box), toolbar,
                             FALSE, FALSE, 0);
 
-#ifdef GDK_WINDOWING_QUARTZ
-        {
-                GtkOSXApplication *theApp;
-
-                /* Hide toolbar labels. */
-                gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
-
-                /* Setup menubar. */
-                theApp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
-                gtk_osxapplication_set_menu_bar (theApp, GTK_MENU_SHELL (menubar));
-
-                g_signal_connect (theApp,
-                                  "NSApplicationWillTerminate",
-                                  G_CALLBACK (window_activate_quit),
-                                  window);
-
-                gtk_osxapplication_ready (theApp);
-        }
-#endif
-
         priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
 
         gtk_box_pack_start (GTK_BOX (priv->main_box), priv->hpaned, TRUE, TRUE, 0);



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