diff options
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | libdbusmenu-gtk/Makefile.am | 47 | ||||
-rw-r--r-- | libdbusmenu-gtk/dbusmenu-gtk3.pc.in | 14 | ||||
-rw-r--r-- | libdbusmenu-gtk/menu.c | 4 |
4 files changed, 67 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 938fe84..ff8dc78 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,7 @@ AC_SUBST(DBUSMENUGLIB_LIBS) ########################### GTK_REQUIRED_VERSION=2.16 +GTK3_REQUIRED_VERSION=2.90 PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION @@ -57,6 +58,14 @@ PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION AC_SUBST(DBUSMENUGTK_CFLAGS) AC_SUBST(DBUSMENUGTK_LIBS) +PKG_CHECK_MODULES(DBUSMENUGTK3, gtk+-3.0 >= $GTK3_REQUIRED_VERSION + glib-2.0 >= $GLIB_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_REQUIRED_VERSION + libxml-2.0 >= $XML_REQUIRED_VERSION) + +AC_SUBST(DBUSMENUGTK3_CFLAGS) +AC_SUBST(DBUSMENUGTK3_LIBS) + ########################### # Dependencies - Testing ########################### @@ -123,6 +132,7 @@ libdbusmenu-glib/Makefile libdbusmenu-glib/dbusmenu-glib.pc libdbusmenu-gtk/Makefile libdbusmenu-gtk/dbusmenu-gtk.pc +libdbusmenu-gtk/dbusmenu-gtk3.pc tools/Makefile tools/testapp/Makefile tests/Makefile 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!"); |