From 0f7fdf8d2c567a641083646a43e6ebec1faf9078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Mon, 21 Nov 2011 03:52:39 +0100 Subject: Use different directory for headers of gtk3 library --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..7860433 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -33,7 +33,7 @@ glib_enum_headers = $(srcdir)/genericmenuitem.h # Include Directory ##################### -libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-gtk$(VER)/ +libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu$(VER)-0.4/libdbusmenu-gtk/ libdbusmenu_gtkinclude_HEADERS = \ dbusmenu-gtk.h \ diff --git a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in index c297db3..c320a57 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu-0.4 +Cflags: -I${includedir}/libdbusmenu3-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-3.0 Libs: -L${libdir} -ldbusmenu-gtk3 -- cgit v1.2.3 From 82f99f0a30316807d0c261308bc207e74eacbd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Thu, 5 Jan 2012 20:39:42 +0100 Subject: Separate libdbusmenu-glib and libdbusmenu-gtk include directories --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in | 2 +- libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 7860433..2b3075f 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -33,7 +33,7 @@ glib_enum_headers = $(srcdir)/genericmenuitem.h # Include Directory ##################### -libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu$(VER)-0.4/libdbusmenu-gtk/ +libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-gtk$(VER)-0.4/libdbusmenu-gtk/ libdbusmenu_gtkinclude_HEADERS = \ dbusmenu-gtk.h \ diff --git a/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in index 9a1b460..cae4c10 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu-0.4 +Cflags: -I${includedir}/libdbusmenu-gtk-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-2.0 Libs: -L${libdir} -ldbusmenu-gtk diff --git a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in index c320a57..ba4c1aa 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu3-0.4 +Cflags: -I${includedir}/libdbusmenu-gtk3-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-3.0 Libs: -L${libdir} -ldbusmenu-gtk3 -- cgit v1.2.3 From 248e0c0f0ce3883579caa56369e7e92340ae9c64 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 12 Jan 2012 11:35:50 +0100 Subject: in gtk3, use stock signals instead of Ubuntu-specific ones --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 35 +++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9e0967f 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 92932c5..5f50dc6 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -66,10 +66,13 @@ static void image_notify_cb (GtkWidget * widget, static void action_notify_cb (GtkAction * action, GParamSpec * pspec, gpointer data); -static void child_added_cb (GtkContainer * menu, +static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, +#ifdef WITH_GTK3 + gint position, +#endif gpointer data); -static void child_removed_cb (GtkContainer * menu, +static void item_removed_cb (GtkContainer * menu, GtkWidget * widget, gpointer data); static void theme_changed_cb (GtkIconTheme * theme, @@ -184,9 +187,9 @@ parse_data_free (gpointer data) if (pdata != NULL && pdata->shell != NULL) { g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_added_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_inserted_cb), NULL); g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_removed_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_removed_cb), NULL); g_object_remove_weak_pointer(G_OBJECT(pdata->shell), (gpointer*)&pdata->shell); } @@ -290,12 +293,16 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), - "child-added", - G_CALLBACK (child_added_cb), +#ifdef WITH_GTK3 + "insert", +#else + "child-added" +#endif + G_CALLBACK (item_inserted_cb), mi); g_signal_connect (G_OBJECT (menu), - "child-removed", - G_CALLBACK (child_removed_cb), + "remove", + G_CALLBACK (item_removed_cb), mi); g_object_add_weak_pointer(G_OBJECT (menu), (gpointer*)&pdata->shell); @@ -1137,7 +1144,12 @@ widget_add_cb (GtkWidget *widget, /* A child item was added to a menu we're watching. Let's try to integrate it. */ static void -child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_inserted_cb (GtkContainer *menu, + GtkWidget *widget, +#ifdef WITH_GTK3 + gint position, +#endif + gpointer data) { DbusmenuMenuitem *menuitem = (DbusmenuMenuitem *)data; @@ -1152,9 +1164,9 @@ child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) parse_menu_structure_helper(widget, &recurse); } -/* A child item was added to a menu we're watching. Let's try to integrate it. */ +/* A child item was removed from a menu we're watching. */ static void -child_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) { gpointer pmi = g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM); if (pmi == NULL) { @@ -1216,4 +1228,3 @@ should_show_image (GtkImage *image) return FALSE; } - -- cgit v1.2.3 From 145fba945cdc582ccdf5dc483acb7f170325549b Mon Sep 17 00:00:00 2001 From: Mikkel Kamstrup Erlandsen Date: Mon, 16 Jan 2012 12:57:11 +0100 Subject: Fix build with gtk3 by ifdeffing the GtkBox/HBox construction in genericmenuitem.c --- libdbusmenu-gtk/genericmenuitem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index ef77a2e..098de67 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -241,7 +241,12 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) /* We need to put the child into a new box and make the box the child of the menu item. Basically we're inserting a box in the middle. */ + #ifdef HAVE_GTK3 + GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, + get_toggle_space(GTK_WIDGET(menu_item))); + #else GtkWidget * hbox = gtk_hbox_new(FALSE, get_toggle_space(GTK_WIDGET(menu_item))); + #endif g_object_ref(child); gtk_container_remove(GTK_CONTAINER(menu_item), child); gtk_box_pack_start(GTK_BOX(hbox), child, FALSE, FALSE, 0); @@ -457,7 +462,12 @@ genericmenuitem_set_image (Genericmenuitem * menu_item, GtkWidget * image) /* We need to put the child into a new box and make the box the child of the menu item. Basically we're inserting a box in the middle. */ + #ifdef HAVE_GTK3 + GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, + get_toggle_space(GTK_WIDGET(menu_item))); + #else GtkWidget * hbox = gtk_hbox_new(FALSE, get_toggle_space(GTK_WIDGET(menu_item))); + #endif g_object_ref(child); gtk_container_remove(GTK_CONTAINER(menu_item), child); gtk_box_pack_end(GTK_BOX(hbox), child, TRUE, TRUE, 0); -- cgit v1.2.3 From 9a01ce5b74bd5d2012a59e9d55a49531da1c4d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 23 Jan 2012 14:38:36 +0100 Subject: Change icon-data to contains raw png bytes, without base64 encoding Reasons: - base64 encoding is not necessary because dbusmenu properties can use any dbus-supported types. - faster: no need to base64 decode/encode images - more efficient: base64-encoded data is 1/3 bigger than raw data --- libdbusmenu-gtk/menuitem.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index 0f511bc..19ea1a0 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -66,11 +66,9 @@ dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * return FALSE; } - gchar * prop_str = g_base64_encode((guchar *)png_data, png_data_len); gboolean propreturn = FALSE; - propreturn = dbusmenu_menuitem_property_set(menuitem, property, prop_str); + propreturn = dbusmenu_menuitem_property_set_byte_array(menuitem, property, (guchar *)png_data, png_data_len); - g_free(prop_str); g_free(png_data); return propreturn; @@ -94,20 +92,17 @@ dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * g_return_val_if_fail(DBUSMENU_IS_MENUITEM(menuitem), NULL); g_return_val_if_fail(property != NULL && property[0] != '\0', NULL); - const gchar * value = dbusmenu_menuitem_property_get(menuitem, property); + gsize length = 0; + const guchar * icondata = dbusmenu_menuitem_property_get_byte_array(menuitem, property, &length); /* There is no icon */ - if (value == NULL || value[0] == '\0') { + if (length == 0) { return NULL; } - - gsize length = 0; - guchar * icondata = g_base64_decode(value, &length); GInputStream * input = g_memory_input_stream_new_from_data(icondata, length, NULL); if (input == NULL) { g_warning("Cound not create input stream from icon property data"); - g_free(icondata); return NULL; } @@ -120,7 +115,6 @@ dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * } g_object_unref(input); - g_free(icondata); return icon; } -- cgit v1.2.3 From d0065933d25307a95644e3ab984de0f4f848d6ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:33:24 -0600 Subject: Remove custom WITH_GTK3 and use the HAVE_GTK3 --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 9e0967f..b4564d1 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 5f50dc6..d222f10 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -68,7 +68,7 @@ static void action_notify_cb (GtkAction * action, gpointer data); static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data); @@ -293,7 +293,7 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 "insert", #else "child-added" @@ -1146,7 +1146,7 @@ widget_add_cb (GtkWidget *widget, static void item_inserted_cb (GtkContainer *menu, GtkWidget *widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data) -- cgit v1.2.3 From 4eae3efbe5c3aa84035b2ade9ceedd68b7b3e895 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:36:57 -0600 Subject: Move the no-error on deprications into the Makefiles so it's always after the -Wall --- libdbusmenu-gtk/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9f297f5 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -62,7 +62,10 @@ libdbusmenu_gtk_la_LDFLAGS = \ -export-symbols-regex "^[^_].*" libdbusmenu_gtk_la_CFLAGS = \ - $(DBUSMENUGTK_CFLAGS) -I$(top_srcdir) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" + $(DBUSMENUGTK_CFLAGS) \ + -I$(top_srcdir) \ + -Wall -Werror -Wno-error=deprecated-declarations \ + -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" libdbusmenu_gtk_la_LIBADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ -- cgit v1.2.3