aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2010-06-19 09:32:56 -0400
committerMichael Terry <michael.terry@canonical.com>2010-06-19 09:32:56 -0400
commitce0a5c849081e8d6f54a28f771dce0136a4e4b93 (patch)
tree8535f2dbb2fa740afe4620135c4385961b9e67ea /libdbusmenu-gtk
parent3d800bf9b0133a613d28c31957c081d157a89af8 (diff)
downloadlibdbusmenu-ce0a5c849081e8d6f54a28f771dce0136a4e4b93.tar.gz
libdbusmenu-ce0a5c849081e8d6f54a28f771dce0136a4e4b93.tar.bz2
libdbusmenu-ce0a5c849081e8d6f54a28f771dce0136a4e4b93.zip
support gtk3 version of libdbusmenu-gtk
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/Makefile.am47
-rw-r--r--libdbusmenu-gtk/dbusmenu-gtk3.pc.in14
-rw-r--r--libdbusmenu-gtk/menu.c4
3 files changed, 57 insertions, 8 deletions
diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am
index 2be63b7..4f38b63 100644
--- a/libdbusmenu-gtk/Makefile.am
+++ b/libdbusmenu-gtk/Makefile.am
@@ -2,17 +2,21 @@
CLEANFILES =
EXTRA_DIST = \
- dbusmenu-gtk.pc.in
+ dbusmenu-gtk.pc.in \
+ dbusmenu-gtk3.pc.in
lib_LTLIBRARIES = \
- libdbusmenu-gtk.la
+ libdbusmenu-gtk.la \
+ libdbusmenu-gtk3.la
libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-0.1/libdbusmenu-gtk/
+libdbusmenu_gtk3includedir=$(includedir)/libdbusmenu3-0.1/libdbusmenu-gtk/
libdbusmenu_gtkinclude_HEADERS = \
client.h \
menu.h \
menuitem.h
+libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS)
libdbusmenu_gtk_la_SOURCES = \
client.h \
@@ -23,20 +27,27 @@ libdbusmenu_gtk_la_SOURCES = \
menu.c \
menuitem.h \
menuitem.c
+libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES)
libdbusmenu_gtk_la_LDFLAGS = \
-version-info $(LIBDBUSMENU_CURRENT):$(LIBDBUSMENU_REVISION):$(LIBDBUSMENU_AGE) \
-no-undefined \
-export-symbols-regex "^[^_].*"
+libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS)
libdbusmenu_gtk_la_CFLAGS = \
$(DBUSMENUGTK_CFLAGS) -I$(top_srcdir) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\""
+libdbusmenu_gtk3_la_CFLAGS = \
+ $(DBUSMENUGTK3_CFLAGS) -I$(top_srcdir) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\""
libdbusmenu_gtk_la_LIBADD = \
../libdbusmenu-glib/libdbusmenu-glib.la \
$(DBUSMENUGTK_LIBS)
+libdbusmenu_gtk3_la_LIBADD = \
+ ../libdbusmenu-glib/libdbusmenu-glib.la \
+ $(DBUSMENUGTK3_LIBS)
-pkgconfig_DATA = dbusmenu-gtk.pc
+pkgconfig_DATA = dbusmenu-gtk.pc dbusmenu-gtk3.pc
pkgconfigdir = $(libdir)/pkgconfig
#########################
@@ -64,7 +75,16 @@ DbusmenuGtk_0_2_gir_CFLAGS = $(DBUSMENUGTK_CFLAGS) -I$(top_srcdir)
DbusmenuGtk_0_2_gir_LIBS = libdbusmenu-gtk.la
DbusmenuGtk_0_2_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
-INTROSPECTION_GIRS += DbusmenuGtk-0.2.gir
+DbusmenuGtk3-0.2.gir: libdbusmenu-gtk3.la
+DbusmenuGtk3_0_2_gir_INCLUDES = \
+ GObject-2.0 \
+ Gtk-3.0 \
+ Dbusmenu-Glib-0.2
+DbusmenuGtk3_0_2_gir_CFLAGS = $(DBUSMENUGTK3_CFLAGS) -I$(top_srcdir)
+DbusmenuGtk3_0_2_gir_LIBS = libdbusmenu-gtk3.la
+DbusmenuGtk3_0_2_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
+
+INTROSPECTION_GIRS += DbusmenuGtk-0.2.gir DbusmenuGtk3-0.2.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
@@ -83,7 +103,7 @@ endif
if HAVE_INTROSPECTION
vapidir = $(datadir)/vala/vapi
-vapi_DATA = DbusmenuGtk-0.2.vapi
+vapi_DATA = DbusmenuGtk-0.2.vapi DbusmenuGtk3-0.2.vapi
DbusmenuGtk-0.2.vapi: DbusmenuGtk-0.2.tmp.gir Makefile.am
$(VALA_API_GEN) --library=DbusmenuGtk-0.2 \
@@ -94,13 +114,28 @@ DbusmenuGtk-0.2.vapi: DbusmenuGtk-0.2.tmp.gir Makefile.am
--vapidir=$(top_builddir)/libdbusmenu-glib \
$<
+DbusmenuGtk3-0.2.vapi: DbusmenuGtk3-0.2.tmp.gir Makefile.am
+ $(VALA_API_GEN) --library=DbusmenuGtk3-0.2 \
+ --pkg gdk-pixbuf-3.0 \
+ --pkg gtk+-3.0 \
+ --pkg atk \
+ --pkg Dbusmenu-Glib-0.2 \
+ --vapidir=$(top_builddir)/libdbusmenu-glib \
+ $<
+
DbusmenuGtk-0.2.tmp.gir: DbusmenuGtk-0.2.gir
$(SED) \
-e "s|GdkPixbuf.Pixbuf|Gdk.Pixbuf|g" \
-e "s|Atk.ImplementorIface|Atk.Implementor|g" \
$< > $@
-CLEANFILES += $(vapi_DATA) DbusmenuGtk-0.2.tmp.gir
+DbusmenuGtk3-0.2.tmp.gir: DbusmenuGtk3-0.2.gir
+ $(SED) \
+ -e "s|GdkPixbuf.Pixbuf|Gdk.Pixbuf|g" \
+ -e "s|Atk.ImplementorIface|Atk.Implementor|g" \
+ $< > $@
+
+CLEANFILES += $(vapi_DATA) DbusmenuGtk-0.2.tmp.gir DbusmenuGtk3-0.2.tmp.gir
endif
diff --git a/libdbusmenu-gtk/dbusmenu-gtk3.pc.in b/libdbusmenu-gtk/dbusmenu-gtk3.pc.in
new file mode 100644
index 0000000..e2c4cc3
--- /dev/null
+++ b/libdbusmenu-gtk/dbusmenu-gtk3.pc.in
@@ -0,0 +1,14 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+bindir=@bindir@
+includedir=@includedir@
+
+Cflags: -I${includedir}/libdbusmenu-3.1
+Requires: dbus-glib-1 dbusmenu-glib
+Libs: -L${libdir} -ldbusmenu-gtk3
+
+Name: libdbusmenu-gtk3
+Description: libdbusmenu-gtk3.
+Version: @VERSION@
+
diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c
index 4fa546b..3e6f2dd 100644
--- a/libdbusmenu-gtk/menu.c
+++ b/libdbusmenu-gtk/menu.c
@@ -237,7 +237,7 @@ root_child_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint posit
GtkMenuItem * mi = dbusmenu_gtkclient_menuitem_get(priv->client, child);
if (mi != NULL) {
GtkWidget * item = GTK_WIDGET(mi);
- gtk_menu_insert(GTK_MENU(menu), item, dbusmenu_menuitem_get_position_realized(child, root));
+ gtk_menu_shell_insert(GTK_MENU_SHELL(menu), item, dbusmenu_menuitem_get_position_realized(child, root));
#ifdef MASSIVEDEBUGGING
menu_pos_t menu_pos;
menu_pos.mi = mi;
@@ -299,7 +299,7 @@ child_realized (DbusmenuMenuitem * child, gpointer userdata)
GtkWidget * child_widget = GTK_WIDGET(dbusmenu_gtkclient_menuitem_get(priv->client, child));
if (child_widget != NULL) {
- gtk_menu_append(menu, child_widget);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), child_widget);
gtk_menu_reorder_child(GTK_MENU(menu), child_widget, dbusmenu_menuitem_get_position_realized(child, dbusmenu_client_get_root(DBUSMENU_CLIENT(priv->client))));
} else {
g_warning("Child is realized, but doesn't have a GTK Widget!");