From f9759edb5b8a2696106f0a60f4b067dc3eb79da3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 7 Jun 2010 21:15:04 -0500 Subject: Strings to build the submenu property --- libdbusmenu-glib/menuitem.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index b04bba8..39d257e 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -58,6 +58,7 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data" #define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE "toggle-type" #define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE "toggle-state" +#define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "child-display" #define DBUSMENU_MENUITEM_TOGGLE_CHECK "checkmark" #define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio" @@ -68,6 +69,8 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_ICON_NAME_BLANK "blank-icon" +#define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU "submenu" + /** * DbusmenuMenuitem: * -- cgit v1.2.3 From 7c4a76f26e59199bd0a7cc87a3618bef8045dc51 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 7 Jun 2010 22:10:17 -0500 Subject: When we're adding the children we're setting the 'submenu' value. --- libdbusmenu-glib/menuitem.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 93c7d38..02a88d0 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -622,6 +622,10 @@ dbusmenu_menuitem_child_append (DbusmenuMenuitem * mi, DbusmenuMenuitem * child) DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi); g_return_val_if_fail(g_list_find(priv->children, child) == NULL, FALSE); + if (priv->children == NULL && !dbusmenu_menuitem_property_exist(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) { + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU); + } + priv->children = g_list_append(priv->children, child); #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), g_list_length(priv->children) - 1); @@ -650,6 +654,10 @@ dbusmenu_menuitem_child_prepend (DbusmenuMenuitem * mi, DbusmenuMenuitem * child DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi); g_return_val_if_fail(g_list_find(priv->children, child) == NULL, FALSE); + if (priv->children == NULL && !dbusmenu_menuitem_property_exist(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) { + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU); + } + priv->children = g_list_prepend(priv->children, child); #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), 0); @@ -707,6 +715,10 @@ dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi); g_return_val_if_fail(g_list_find(priv->children, child) == NULL, FALSE); + if (priv->children == NULL && !dbusmenu_menuitem_property_exist(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) { + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU); + } + priv->children = g_list_insert(priv->children, child, position); #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) signalling child added %d (%s) at %d", ID(mi), LABEL(mi), ID(child), LABEL(child), position); -- cgit v1.2.3 From afdb5eaa19226057d1e3cb261a5bb4eaed1e6af3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 7 Jun 2010 23:00:17 -0500 Subject: When removing items we need to remove the submenu property. --- libdbusmenu-glib/menuitem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 02a88d0..623539c 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -517,6 +517,9 @@ dbusmenu_menuitem_take_children (DbusmenuMenuitem * mi) GList * children = priv->children; priv->children = NULL; g_list_foreach(children, take_children_signal, mi); + + dbusmenu_menuitem_property_remove(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY); + return children; } @@ -691,6 +694,11 @@ dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child) #endif g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE); g_object_unref(G_OBJECT(child)); + + if (priv->children == NULL) { + dbusmenu_menuitem_property_remove(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY); + } + return TRUE; } -- cgit v1.2.3 From 2bfd66b03ef2aefcd8a48e23c81dd1509e1b13dd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 10:19:37 -0500 Subject: Stealing the layout test to make a submenu test --- tests/test-glib-submenu-client.c | 131 +++++++++++++++++++++++++++++++++++++++ tests/test-glib-submenu-server.c | 109 ++++++++++++++++++++++++++++++++ tests/test-glib-submenu.h | 78 +++++++++++++++++++++++ 3 files changed, 318 insertions(+) create mode 100644 tests/test-glib-submenu-client.c create mode 100644 tests/test-glib-submenu-server.c create mode 100644 tests/test-glib-submenu.h diff --git a/tests/test-glib-submenu-client.c b/tests/test-glib-submenu-client.c new file mode 100644 index 0000000..5b40047 --- /dev/null +++ b/tests/test-glib-submenu-client.c @@ -0,0 +1,131 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#include + +#include +#include + +#include "test-glib-submenu.h" + +static guint layouton = 0; +static GMainLoop * mainloop = NULL; +static gboolean passed = TRUE; + +static gboolean +verify_root_to_layout(DbusmenuMenuitem * mi, layout_t * layout) +{ + g_debug("Verifying ID: %d", layout->id); + + if (layout->id != dbusmenu_menuitem_get_id(mi)) { + if (!(dbusmenu_menuitem_get_root(mi) && dbusmenu_menuitem_get_id(mi) == 0)) { + g_debug("Failed as ID %d is not equal to %d", layout->id, dbusmenu_menuitem_get_id(mi)); + return FALSE; + } + } + + GList * children = dbusmenu_menuitem_get_children(mi); + + if (children == NULL && layout->submenu == NULL) { + return TRUE; + } + if (children == NULL || layout->submenu == NULL) { + if (children == NULL) { + g_debug("Failed as there are no children but we have submenus"); + } else { + g_debug("Failed as we have children but no submenu"); + } + return FALSE; + } + + guint i = 0; + for (i = 0; children != NULL && layout->submenu[i].id != -1; children = g_list_next(children), i++) { + if (!verify_root_to_layout(DBUSMENU_MENUITEM(children->data), &layout->submenu[i])) { + return FALSE; + } + } + + if (children == NULL && layout->submenu[i].id == -1) { + return TRUE; + } + + if (children != NULL) { + g_debug("Failed as there are still children but no submenus. (ID: %d)", layout->id); + } else { + g_debug("Failed as there are still submenus but no children. (ID: %d)", layout->id); + } + return FALSE; +} + +static void +layout_updated (DbusmenuClient * client, gpointer data) +{ + g_debug("Layout Updated"); + + DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(client); + layout_t * layout = &layouts[layouton]; + + if (!verify_root_to_layout(menuroot, layout)) { + g_debug("Failed layout: %d", layouton); + passed = FALSE; + } + + layouton++; + + if (layouts[layouton].id == -1) { + g_main_loop_quit(mainloop); + } + + return; +} + +static gboolean +timer_func (gpointer data) +{ + g_debug("Death timer. Oops. Got to: %d", layouton); + passed = FALSE; + g_main_loop_quit(mainloop); + return FALSE; +} + +int +main (int argc, char ** argv) +{ + g_type_init(); + + DbusmenuClient * client = dbusmenu_client_new("org.dbusmenu.test", "/org/test"); + g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL); + + g_timeout_add_seconds(10, timer_func, client); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_object_unref(G_OBJECT(client)); + + if (passed) { + g_debug("Quiting"); + return 0; + } else { + g_debug("Quiting as we're a failure"); + return 1; + } +} diff --git a/tests/test-glib-submenu-server.c b/tests/test-glib-submenu-server.c new file mode 100644 index 0000000..68f7004 --- /dev/null +++ b/tests/test-glib-submenu-server.c @@ -0,0 +1,109 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "test-glib-submenu.h" + + +static DbusmenuMenuitem * +layout2menuitem (layout_t * layout) +{ + if (layout == NULL || layout->id == 0) return NULL; + + DbusmenuMenuitem * local = dbusmenu_menuitem_new_with_id(layout->id); + + if (layout->submenu != NULL) { + guint count; + for (count = 0; layout->submenu[count].id != -1; count++) { + DbusmenuMenuitem * child = layout2menuitem(&layout->submenu[count]); + if (child != NULL) { + dbusmenu_menuitem_child_append(local, child); + } + } + } + + /* g_debug("Layout to menu return: 0x%X", (unsigned int)local); */ + return local; +} + +static guint layouton = 0; +static DbusmenuServer * server = NULL; +static GMainLoop * mainloop = NULL; + +static gboolean +timer_func (gpointer data) +{ + if (layouts[layouton].id == -1) { + g_main_loop_quit(mainloop); + return FALSE; + } + g_debug("Updating to Layout %d", layouton); + + dbusmenu_server_set_root(server, layout2menuitem(&layouts[layouton])); + layouton++; + + return TRUE; +} + +int +main (int argc, char ** argv) +{ + GError * error = NULL; + + g_type_init(); + + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL)))); + + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, "org.dbusmenu.test", 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + + server = dbusmenu_server_new("/org/test"); + + timer_func(NULL); + g_timeout_add(2500, timer_func, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + + return 0; +} diff --git a/tests/test-glib-submenu.h b/tests/test-glib-submenu.h new file mode 100644 index 0000000..b64c4ea --- /dev/null +++ b/tests/test-glib-submenu.h @@ -0,0 +1,78 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +typedef struct _layout_t layout_t; +struct _layout_t { + gint id; + layout_t * submenu; +}; + +layout_t submenu_2[] = { + {id: 2, submenu: NULL}, + {id: 3, submenu: NULL}, + {id: -1, submenu: NULL} +}; +layout_t submenu_3_1[] = { + {id: 3, submenu: NULL}, + {id: 4, submenu: NULL}, + {id: 5, submenu: NULL}, + {id: -1, submenu: NULL} +}; +layout_t submenu_3_2[] = { + {id: 7, submenu: NULL}, + {id: 8, submenu: NULL}, + {id: 9, submenu: NULL}, + {id: -1, submenu: NULL} +}; +layout_t submenu_3[] = { + {id: 2, submenu: submenu_3_1}, + {id: 6, submenu: submenu_3_2}, + {id: -1, submenu: NULL} +}; +layout_t submenu_4_1[] = { + {id: 6, submenu: NULL}, + {id: -1, submenu: NULL} +}; +layout_t submenu_4_2[] = { + {id: 5, submenu: submenu_4_1}, + {id: -1, submenu: NULL} +}; +layout_t submenu_4_3[] = { + {id: 4, submenu: submenu_4_2}, + {id: -1, submenu: NULL} +}; +layout_t submenu_4_4[] = { + {id: 3, submenu: submenu_4_3}, + {id: -1, submenu: NULL} +}; +layout_t submenu_4_5[] = { + {id: 2, submenu: submenu_4_4}, + {id: -1, submenu: NULL} +}; + +layout_t layouts[] = { + {id: 5, submenu: NULL}, + {id: 1, submenu: submenu_2}, + {id: 1, submenu: submenu_3}, + {id: 1, submenu: submenu_4_5}, + {id: -1, submenu: NULL} +}; + -- cgit v1.2.3 From dfe6aaaac398b91de31698656c8faaf85f69bb5b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 13:12:12 -0500 Subject: Building the submenu tests --- tests/Makefile.am | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index cfa1399..f1b50bc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,6 +7,7 @@ TESTS = \ test-glib-properties \ test-glib-proxy \ test-glib-simple-items \ + test-glib-submenu \ test-gtk-label \ test-gtk-reorder @@ -20,6 +21,8 @@ check_PROGRAMS = \ test-glib-proxy-client \ test-glib-proxy-server \ test-glib-proxy-proxy \ + test-glib-submenu-client \ + test-glib-submenu-server \ test-gtk-label-client \ test-gtk-label-server \ test-glib-simple-items \ @@ -75,6 +78,38 @@ test_glib_layout_client_LDADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ $(DBUSMENUGLIB_LIBS) +###################### +# Test Glib Submenu +###################### + +test-glib-submenu: test-glib-submenu-client test-glib-submenu-server Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(DBUS_RUNNER) --task ./test-glib-submenu-client --task-name Client --task ./test-glib-submenu-server --task-name Server --ignore-return >> $@ + @chmod +x $@ + +test_glib_submenu_server_SOURCES = \ + test-glib-submenu.h \ + test-glib-submenu-server.c + +test_glib_submenu_server_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_glib_submenu_server_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + $(DBUSMENUGLIB_LIBS) + +test_glib_submenu_client_SOURCES = \ + test-glib-submenu.h \ + test-glib-submenu-client.c + +test_glib_submenu_client_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_glib_submenu_client_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + $(DBUSMENUGLIB_LIBS) ###################### # Test Glib Object -- cgit v1.2.3 From 02af5e0cd3d8ccca410c77005107623fcf93a710 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 13:12:32 -0500 Subject: Ignoring the submenu tests --- .bzrignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bzrignore b/.bzrignore index 37f2bb8..1e0108e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -71,3 +71,6 @@ libdbusmenu-gtk/DbusmenuGtk-0.2.gir libdbusmenu-gtk/DbusmenuGtk-0.2.tmp.gir libdbusmenu-gtk/DbusmenuGtk-0.2.typelib libdbusmenu-gtk/DbusmenuGtk-0.2.vapi +tests/test-glib-submenu +tests/test-glib-submenu-client +tests/test-glib-submenu-server -- cgit v1.2.3 From 915d4d952f7c2deb8e3f851f4144e203ec686333 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 14:18:36 -0500 Subject: Making the layouts useful for us. --- tests/test-glib-submenu.h | 52 +++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/tests/test-glib-submenu.h b/tests/test-glib-submenu.h index b64c4ea..f585d1b 100644 --- a/tests/test-glib-submenu.h +++ b/tests/test-glib-submenu.h @@ -25,54 +25,30 @@ struct _layout_t { layout_t * submenu; }; -layout_t submenu_2[] = { - {id: 2, submenu: NULL}, - {id: 3, submenu: NULL}, - {id: -1, submenu: NULL} -}; -layout_t submenu_3_1[] = { - {id: 3, submenu: NULL}, - {id: 4, submenu: NULL}, - {id: 5, submenu: NULL}, - {id: -1, submenu: NULL} -}; -layout_t submenu_3_2[] = { +layout_t submenu_l2[] = { + {id: 6, submenu: NULL}, {id: 7, submenu: NULL}, {id: 8, submenu: NULL}, - {id: 9, submenu: NULL}, - {id: -1, submenu: NULL} -}; -layout_t submenu_3[] = { - {id: 2, submenu: submenu_3_1}, - {id: 6, submenu: submenu_3_2}, {id: -1, submenu: NULL} }; -layout_t submenu_4_1[] = { - {id: 6, submenu: NULL}, - {id: -1, submenu: NULL} -}; -layout_t submenu_4_2[] = { - {id: 5, submenu: submenu_4_1}, - {id: -1, submenu: NULL} -}; -layout_t submenu_4_3[] = { - {id: 4, submenu: submenu_4_2}, - {id: -1, submenu: NULL} -}; -layout_t submenu_4_4[] = { - {id: 3, submenu: submenu_4_3}, + +layout_t submenu[] = { + {id: 2, submenu: submenu_l2}, + {id: 3, submenu: submenu_l2}, {id: -1, submenu: NULL} }; -layout_t submenu_4_5[] = { - {id: 2, submenu: submenu_4_4}, + +layout_t no_submenu[] = { + {id: 4, submenu: NULL}, + {id: 5, submenu: NULL}, {id: -1, submenu: NULL} }; layout_t layouts[] = { - {id: 5, submenu: NULL}, - {id: 1, submenu: submenu_2}, - {id: 1, submenu: submenu_3}, - {id: 1, submenu: submenu_4_5}, + {id: 1, submenu: no_submenu}, + {id: 1, submenu: submenu}, + {id: 1, submenu: no_submenu}, + {id: 1, submenu: submenu}, {id: -1, submenu: NULL} }; -- cgit v1.2.3 From 842ccdb932c28bb57976c70929c817b190001b90 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 15:30:35 -0500 Subject: Realization watching for the children display --- tests/test-glib-submenu-client.c | 61 +++++++++++++--------------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/tests/test-glib-submenu-client.c b/tests/test-glib-submenu-client.c index 5b40047..d4f498e 100644 --- a/tests/test-glib-submenu-client.c +++ b/tests/test-glib-submenu-client.c @@ -30,49 +30,22 @@ static guint layouton = 0; static GMainLoop * mainloop = NULL; static gboolean passed = TRUE; -static gboolean -verify_root_to_layout(DbusmenuMenuitem * mi, layout_t * layout) +static void +realization (DbusmenuMenuitem * mi) { - g_debug("Verifying ID: %d", layout->id); - - if (layout->id != dbusmenu_menuitem_get_id(mi)) { - if (!(dbusmenu_menuitem_get_root(mi) && dbusmenu_menuitem_get_id(mi) == 0)) { - g_debug("Failed as ID %d is not equal to %d", layout->id, dbusmenu_menuitem_get_id(mi)); - return FALSE; - } - } - - GList * children = dbusmenu_menuitem_get_children(mi); - - if (children == NULL && layout->submenu == NULL) { - return TRUE; - } - if (children == NULL || layout->submenu == NULL) { - if (children == NULL) { - g_debug("Failed as there are no children but we have submenus"); - } else { - g_debug("Failed as we have children but no submenu"); - } - return FALSE; - } + const gchar * value; + value = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY); - guint i = 0; - for (i = 0; children != NULL && layout->submenu[i].id != -1; children = g_list_next(children), i++) { - if (!verify_root_to_layout(DBUSMENU_MENUITEM(children->data), &layout->submenu[i])) { - return FALSE; + if (layouton % 2 == 0) { + if (value == NULL) { + passed = FALSE; } - } - - if (children == NULL && layout->submenu[i].id == -1) { - return TRUE; - } - - if (children != NULL) { - g_debug("Failed as there are still children but no submenus. (ID: %d)", layout->id); } else { - g_debug("Failed as there are still submenus but no children. (ID: %d)", layout->id); + if (value != NULL) { + passed = FALSE; + } } - return FALSE; + return; } static void @@ -81,13 +54,19 @@ layout_updated (DbusmenuClient * client, gpointer data) g_debug("Layout Updated"); DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(client); - layout_t * layout = &layouts[layouton]; - if (!verify_root_to_layout(menuroot, layout)) { - g_debug("Failed layout: %d", layouton); + + GList * children = dbusmenu_menuitem_get_children(menuroot); + if (children == NULL) { passed = FALSE; + goto exit; + } + + for (; children != NULL; children = g_list_next(children)) { + g_signal_connect(G_OBJECT(children->data), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(realization), NULL); } +exit: layouton++; if (layouts[layouton].id == -1) { -- cgit v1.2.3 From 4ea766fce2d289cedcc6f8de8d7b6e0071786703 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Jun 2010 15:48:01 -0500 Subject: Some more debugging messages. Cleaning up a bit. --- tests/test-glib-submenu-client.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/test-glib-submenu-client.c b/tests/test-glib-submenu-client.c index d4f498e..57762cd 100644 --- a/tests/test-glib-submenu-client.c +++ b/tests/test-glib-submenu-client.c @@ -34,6 +34,8 @@ static void realization (DbusmenuMenuitem * mi) { const gchar * value; + gboolean original = passed; + value = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY); if (layouton % 2 == 0) { @@ -45,6 +47,11 @@ realization (DbusmenuMenuitem * mi) passed = FALSE; } } + + if (original != passed) { + g_debug("Oops, this is where we failed"); + } + return; } @@ -54,19 +61,21 @@ layout_updated (DbusmenuClient * client, gpointer data) g_debug("Layout Updated"); DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(client); - + if (menuroot == NULL) { + g_debug("Root is NULL?"); + return; + } GList * children = dbusmenu_menuitem_get_children(menuroot); if (children == NULL) { + g_debug("No Children on root -- fail"); passed = FALSE; - goto exit; - } - - for (; children != NULL; children = g_list_next(children)) { - g_signal_connect(G_OBJECT(children->data), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(realization), NULL); + } else { + for (; children != NULL; children = g_list_next(children)) { + g_signal_connect(G_OBJECT(children->data), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(realization), NULL); + } } -exit: layouton++; if (layouts[layouton].id == -1) { -- cgit v1.2.3 From 4fe03992b568decdbdfa5dc30de27d4876eb9331 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Wed, 9 Jun 2010 12:24:31 -0400 Subject: Build gtk-doc (LP: #422087) --- INSTALL | 114 +++++++++--- Makefile.am | 1 + autogen.sh | 3 +- configure.ac | 14 ++ docs/Makefile.am | 1 + docs/libdbusmenu-glib/Makefile.am | 1 + docs/libdbusmenu-glib/reference/Makefile.am | 87 +++++++++ .../reference/libdbusmenu-glib-docs.sgml | 33 ++++ docs/libdbusmenu-glib/reference/version.xml.in | 1 + docs/libdbusmenu-gtk/Makefile.am | 1 + docs/libdbusmenu-gtk/reference/Makefile.am | 87 +++++++++ .../reference/libdbusmenu-gtk-docs.sgml | 30 ++++ docs/libdbusmenu-gtk/reference/version.xml.in | 1 + gtk-doc.local.make | 194 +++++++++++++++++++++ 14 files changed, 547 insertions(+), 21 deletions(-) create mode 100644 docs/Makefile.am create mode 100644 docs/libdbusmenu-glib/Makefile.am create mode 100644 docs/libdbusmenu-glib/reference/Makefile.am create mode 100644 docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml create mode 100644 docs/libdbusmenu-glib/reference/version.xml.in create mode 100644 docs/libdbusmenu-gtk/Makefile.am create mode 100644 docs/libdbusmenu-gtk/reference/Makefile.am create mode 100644 docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml create mode 100644 docs/libdbusmenu-gtk/reference/version.xml.in create mode 100644 gtk-doc.local.make diff --git a/INSTALL b/INSTALL index 8b82ade..7d1c323 100644 --- a/INSTALL +++ b/INSTALL @@ -2,10 +2,12 @@ Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. +2006, 2007, 2008, 2009 Free Software Foundation, Inc. - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== @@ -13,7 +15,11 @@ Basic Installation Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -42,7 +48,7 @@ may remove or edit it. you want to change it or regenerate `configure' using a newer version of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. @@ -53,12 +59,22 @@ The simplest way to compile this package is: 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,8 +83,15 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. - 6. Often, you can also type `make uninstall' to remove the installed - files again. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. Compilers and Options ===================== @@ -93,7 +116,8 @@ same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have @@ -120,7 +144,8 @@ Installation Names By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -131,15 +156,46 @@ Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE @@ -152,6 +208,13 @@ find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + Particular systems ================== @@ -159,7 +222,7 @@ Particular systems CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: - ./configure CC="cc -Ae" + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. @@ -174,6 +237,16 @@ and if that doesn't work, try ./configure CC="cc -nodtk" + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== @@ -189,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form: where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -277,7 +351,7 @@ operates. `configure' can determine that directory automatically. `--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: + Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. diff --git a/Makefile.am b/Makefile.am index 658f946..d4bf62b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,7 @@ SUBDIRS = \ libdbusmenu-gtk \ tools \ tests \ + docs \ po DISTCHECK_CONFIGURE_FLAGS = --enable-introspection diff --git a/autogen.sh b/autogen.sh index 3d22cbe..93174f5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,4 +9,5 @@ which gnome-autogen.sh || { USE_GNOME2_MACROS=1 \ USE_COMMON_DOC_BUILD=yes \ -. gnome-autogen.sh +gnome-autogen.sh --enable-gtk-doc + diff --git a/configure.ac b/configure.ac index 33ad44d..171bd9b 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,13 @@ AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +########################### +# GTK Doc +########################### + +GTK_DOC_CHECK([1.4]) +GNOME_DOC_INIT + ########################### # Dependencies - GLib ########################### @@ -119,6 +126,13 @@ libdbusmenu-gtk/dbusmenu-gtk.pc tools/Makefile tools/testapp/Makefile tests/Makefile +docs/Makefile +docs/libdbusmenu-glib/Makefile +docs/libdbusmenu-glib/reference/Makefile +docs/libdbusmenu-glib/reference/version.xml +docs/libdbusmenu-gtk/Makefile +docs/libdbusmenu-gtk/reference/Makefile +docs/libdbusmenu-gtk/reference/version.xml ]) ########################### diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..87ffe5f --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = libdbusmenu-glib libdbusmenu-gtk diff --git a/docs/libdbusmenu-glib/Makefile.am b/docs/libdbusmenu-glib/Makefile.am new file mode 100644 index 0000000..f3ddc22 --- /dev/null +++ b/docs/libdbusmenu-glib/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = reference diff --git a/docs/libdbusmenu-glib/reference/Makefile.am b/docs/libdbusmenu-glib/reference/Makefile.am new file mode 100644 index 0000000..4f511bc --- /dev/null +++ b/docs/libdbusmenu-glib/reference/Makefile.am @@ -0,0 +1,87 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=libdbusmenu-glib + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR=../../../libdbusmenu-glib + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS=--nogtkinit --type-init-func="g_type_init()" + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +# e.g. MKTMPL_OPTIONS=--only-section-tmpl +MKTMPL_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(top_srcdir)/libdbusmenu-glib/*.h +CFILE_GLOB=$(top_srcdir)/libdbusmenu-glib/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES=menuitem-marshal.h server-marshal.h menuitem-private.h + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files=version.xml + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +INCLUDES=-I$(top_srcdir) $(DBUSMENUGLIB_CFLAGS) $(DBUSMENUGTK_CFLAGS) +GTKDOC_LIBS=$(top_builddir)/libdbusmenu-glib/libdbusmenu-glib.la + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.local.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in + +# Files not to distribute +# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types +# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt +#DISTCLEANFILES += + +# Comment this out if you want your docs-status tested during 'make check' +#TESTS = $(GTKDOC_CHECK) + diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml new file mode 100644 index 0000000..ecc25a3 --- /dev/null +++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml @@ -0,0 +1,33 @@ + + +]> + + + libdbusmenu-glib Reference Manual + + + + API + + + + + + + + + + + Object Hierarchy + + + + API Index + + + + + diff --git a/docs/libdbusmenu-glib/reference/version.xml.in b/docs/libdbusmenu-glib/reference/version.xml.in new file mode 100644 index 0000000..d78bda9 --- /dev/null +++ b/docs/libdbusmenu-glib/reference/version.xml.in @@ -0,0 +1 @@ +@VERSION@ diff --git a/docs/libdbusmenu-gtk/Makefile.am b/docs/libdbusmenu-gtk/Makefile.am new file mode 100644 index 0000000..f3ddc22 --- /dev/null +++ b/docs/libdbusmenu-gtk/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = reference diff --git a/docs/libdbusmenu-gtk/reference/Makefile.am b/docs/libdbusmenu-gtk/reference/Makefile.am new file mode 100644 index 0000000..ec1bd28 --- /dev/null +++ b/docs/libdbusmenu-gtk/reference/Makefile.am @@ -0,0 +1,87 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=libdbusmenu-gtk + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR=../../../libdbusmenu-gtk + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS=--nogtkinit --type-init-func="g_type_init()" + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +# e.g. MKTMPL_OPTIONS=--only-section-tmpl +MKTMPL_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB=$(top_srcdir)/libdbusmenu-gtk/*.h +CFILE_GLOB=$(top_srcdir)/libdbusmenu-gtk/*.c + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES= + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files=version.xml + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +INCLUDES=-I$(top_srcdir) $(DBUSMENUGLIB_CFLAGS) $(DBUSMENUGTK_CFLAGS) +GTKDOC_LIBS=$(top_builddir)/libdbusmenu-gtk/libdbusmenu-gtk.la + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.local.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in + +# Files not to distribute +# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types +# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt +#DISTCLEANFILES += + +# Comment this out if you want your docs-status tested during 'make check' +#TESTS = $(GTKDOC_CHECK) + diff --git a/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml new file mode 100644 index 0000000..ae9ab07 --- /dev/null +++ b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml @@ -0,0 +1,30 @@ + + +]> + + + libdbusmenu-gtk Reference Manual + + + + API + + + + + + + + Object Hierarchy + + + + API Index + + + + + diff --git a/docs/libdbusmenu-gtk/reference/version.xml.in b/docs/libdbusmenu-gtk/reference/version.xml.in new file mode 100644 index 0000000..d78bda9 --- /dev/null +++ b/docs/libdbusmenu-gtk/reference/version.xml.in @@ -0,0 +1 @@ +@VERSION@ diff --git a/gtk-doc.local.make b/gtk-doc.local.make new file mode 100644 index 0000000..3dcda60 --- /dev/null +++ b/gtk-doc.local.make @@ -0,0 +1,194 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = sh -c +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) + +DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + +if ENABLE_GTK_DOC +all-local: html-build.stamp +else +all-local: +endif + +docs: html-build.stamp + +$(REPORT_FILES): sgml-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +tmpl/*.sgml: + @true + + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + rm -rf $(srcdir)/html + mkdir $(srcdir)/html + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(srcdir)"; \ + fi + cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + touch html-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + mv -f $${installdir}/$(DOC_MODULE).devhelp \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + ! which gtkdoc-rebase >/dev/null 2>&1 || \ + gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \ + fi + +uninstall-local: + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/xml + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + -cp $(srcdir)/xml/*.xml $(distdir)/xml + -cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + ! which gtkdoc-rebase >/dev/null 2>&1 || \ + gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs -- cgit v1.2.3 From 106ec0527f0c285246c91c645265cc73f86066a3 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Wed, 9 Jun 2010 12:26:34 -0400 Subject: For building with --enable-gtk-doc for distcheck --- Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index d4bf62b..3853d2a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,5 +11,4 @@ SUBDIRS = \ docs \ po -DISTCHECK_CONFIGURE_FLAGS = --enable-introspection - +DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc -- cgit v1.2.3 From 9ab8a923ca3f9b9dc32b450d5916a2d28b04aa8b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 09:18:43 -0500 Subject: Adding server and client dbus interfaces to the ignored header files. --- docs/libdbusmenu-glib/reference/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/libdbusmenu-glib/reference/Makefile.am b/docs/libdbusmenu-glib/reference/Makefile.am index 4f511bc..e8a3610 100644 --- a/docs/libdbusmenu-glib/reference/Makefile.am +++ b/docs/libdbusmenu-glib/reference/Makefile.am @@ -47,7 +47,12 @@ CFILE_GLOB=$(top_srcdir)/libdbusmenu-glib/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES=menuitem-marshal.h server-marshal.h menuitem-private.h +IGNORE_HFILES= \ + menuitem-marshal.h \ + server-marshal.h \ + menuitem-private.h \ + dbusmenu-client.h \ + dbusmenu-server.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -- cgit v1.2.3 From f88fcc0bdeaa4c8b092f8dea52633ba39708767b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 11:01:53 -0500 Subject: Adding in a formal sections definition --- .../reference/libdbusmenu-glib-sections.txt | 157 +++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt new file mode 100644 index 0000000..0186049 --- /dev/null +++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt @@ -0,0 +1,157 @@ +
+client +DbusmenuClient +DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED +DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED +DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM +DBUSMENU_CLIENT_PROP_DBUS_NAME +DBUSMENU_CLIENT_PROP_DBUS_OBJECT +DBUSMENU_CLIENT_TYPES_DEFAULT +DBUSMENU_CLIENT_TYPES_SEPARATOR +DBUSMENU_CLIENT_TYPES_IMAGE +DbusmenuClient +DbusmenuClientClass +DbusmenuClientTypeHandler +dbusmenu_client_new +dbusmenu_client_get_root +dbusmenu_client_add_type_handler +dbusmenu_client_send_event +dbusmenu_client_send_about_to_show + +DBUSMENU_CLIENT +DBUSMENU_IS_CLIENT +DBUSMENU_TYPE_CLIENT +dbusmenu_client_get_type +DBUSMENU_CLIENT_CLASS +DBUSMENU_IS_CLIENT_CLASS +DBUSMENU_CLIENT_GET_CLASS +
+ +
+menuitem +DbusmenuMenuitem +DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED +DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED +DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED +DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED +DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED +DBUSMENU_MENUITEM_SIGNAL_REALIZED +DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID +DBUSMENU_MENUITEM_PROP_TYPE +DBUSMENU_MENUITEM_PROP_VISIBLE +DBUSMENU_MENUITEM_PROP_ENABLED +DBUSMENU_MENUITEM_PROP_LABEL +DBUSMENU_MENUITEM_PROP_ICON_NAME +DBUSMENU_MENUITEM_PROP_ICON_DATA +DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE +DBUSMENU_MENUITEM_PROP_TOGGLE_STATE +DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY +DBUSMENU_MENUITEM_TOGGLE_CHECK +DBUSMENU_MENUITEM_TOGGLE_RADIO +DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED +DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED +DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN +DBUSMENU_MENUITEM_ICON_NAME_BLANK +DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU +DbusmenuMenuitem +dbusmenu_menuitem_about_to_show_cb +dbusmenu_menuitem_buildxml_slot_t +DbusmenuMenuitemClass +dbusmenu_menuitem_new +dbusmenu_menuitem_new_with_id +dbusmenu_menuitem_get_id +dbusmenu_menuitem_get_children +dbusmenu_menuitem_take_children +dbusmenu_menuitem_get_position +dbusmenu_menuitem_get_position_realized +dbusmenu_menuitem_child_append +dbusmenu_menuitem_child_prepend +dbusmenu_menuitem_child_delete +dbusmenu_menuitem_child_add_position +dbusmenu_menuitem_child_reorder +dbusmenu_menuitem_child_find +dbusmenu_menuitem_find_id +dbusmenu_menuitem_property_set +dbusmenu_menuitem_property_set_value +dbusmenu_menuitem_property_set_bool +dbusmenu_menuitem_property_set_int +dbusmenu_menuitem_property_get +dbusmenu_menuitem_property_get_value +dbusmenu_menuitem_property_get_bool +dbusmenu_menuitem_property_get_int +dbusmenu_menuitem_property_exist +dbusmenu_menuitem_properties_list +dbusmenu_menuitem_properties_copy +dbusmenu_menuitem_property_remove +dbusmenu_menuitem_set_root +dbusmenu_menuitem_get_root +dbusmenu_menuitem_foreach +dbusmenu_menuitem_handle_event +dbusmenu_menuitem_send_about_to_show + +DBUSMENU_MENUITEM +DBUSMENU_IS_MENUITEM +DBUSMENU_TYPE_MENUITEM +dbusmenu_menuitem_get_type +DBUSMENU_MENUITEM_CLASS +DBUSMENU_IS_MENUITEM_CLASS +DBUSMENU_MENUITEM_GET_CLASS +
+ +
+server +DbusmenuServer +DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE +DBUSMENU_SERVER_SIGNAL_ID_UPDATE +DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED +DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE +DBUSMENU_SERVER_PROP_DBUS_OBJECT +DBUSMENU_SERVER_PROP_ROOT_NODE +DBUSMENU_SERVER_PROP_VERSION +DbusmenuServer +DbusmenuServerClass +dbusmenu_server_new +dbusmenu_server_set_root + +DBUSMENU_SERVER +DBUSMENU_IS_SERVER +DBUSMENU_TYPE_SERVER +dbusmenu_server_get_type +DBUSMENU_SERVER_CLASS +DBUSMENU_IS_SERVER_CLASS +DBUSMENU_SERVER_GET_CLASS +
+ +
+client-menuitem +DbusmenuClientMenuitem +DBUSMENU_CLIENT_MENUITEM_TYPE +DbusmenuClientMenuitem +DbusmenuClientMenuitemClass +dbusmenu_client_menuitem_new + +DBUSMENU_CLIENT_MENUITEM +DBUSMENU_IS_CLIENT_MENUITEM +dbusmenu_client_menuitem_get_type +DBUSMENU_CLIENT_MENUITEM_CLASS +DBUSMENU_IS_CLIENT_MENUITEM_CLASS +DBUSMENU_CLIENT_MENUITEM_GET_CLASS +
+ +
+menuitem-proxy +DbusmenuMenuitemProxy +DbusmenuMenuitemProxy +DbusmenuMenuitemProxyClass +dbusmenu_menuitem_proxy_new +dbusmenu_menuitem_proxy_get_wrapped + +DBUSMENU_MENUITEM_PROXY +DBUSMENU_IS_MENUITEM_PROXY +DBUSMENU_TYPE_MENUITEM_PROXY +dbusmenu_menuitem_proxy_get_type +DBUSMENU_MENUITEM_PROXY_CLASS +DBUSMENU_IS_MENUITEM_PROXY_CLASS +DBUSMENU_MENUITEM_PROXY_GET_CLASS +
+ -- cgit v1.2.3 From 30e3c1706b06697b0b74f60581b43f93b114896b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 12:21:05 -0500 Subject: 0.3.2 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 171bd9b..938fe84 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.3.1, ted@canonical.com) +AC_INIT(libdbusmenu, 0.3.2, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.3.1, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.3.2, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3 From 47d48f8c3eb464e27f9632f51ce574fc9358143b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 15:17:26 -0500 Subject: Trying a dummy sgml file --- docs/libdbusmenu-glib/reference/Makefile.am | 2 +- docs/libdbusmenu-glib/reference/tmpl/dummy.sgml | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/libdbusmenu-glib/reference/tmpl/dummy.sgml diff --git a/docs/libdbusmenu-glib/reference/Makefile.am b/docs/libdbusmenu-glib/reference/Makefile.am index e8a3610..8119537 100644 --- a/docs/libdbusmenu-glib/reference/Makefile.am +++ b/docs/libdbusmenu-glib/reference/Makefile.am @@ -80,7 +80,7 @@ include $(top_srcdir)/gtk-doc.local.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += version.xml.in +EXTRA_DIST += version.xml.in tmpl/dummy.sgml # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types diff --git a/docs/libdbusmenu-glib/reference/tmpl/dummy.sgml b/docs/libdbusmenu-glib/reference/tmpl/dummy.sgml new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From d6970de44f5ce5e6572761bc68d4252061794c9d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 15:20:24 -0500 Subject: Apparently you can't use EXTRA_DIST like this with gtk-doc. Why be normal? --- docs/libdbusmenu-glib/reference/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/libdbusmenu-glib/reference/Makefile.am b/docs/libdbusmenu-glib/reference/Makefile.am index 8119537..e8a3610 100644 --- a/docs/libdbusmenu-glib/reference/Makefile.am +++ b/docs/libdbusmenu-glib/reference/Makefile.am @@ -80,7 +80,7 @@ include $(top_srcdir)/gtk-doc.local.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += version.xml.in tmpl/dummy.sgml +EXTRA_DIST += version.xml.in # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types -- cgit v1.2.3 From 327143819733e9104a6f9b6ee043289d09a5fae5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 20:19:34 -0500 Subject: Adding a dummy sgml file. --- docs/libdbusmenu-gtk/reference/tmpl/dummy.sgml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/libdbusmenu-gtk/reference/tmpl/dummy.sgml diff --git a/docs/libdbusmenu-gtk/reference/tmpl/dummy.sgml b/docs/libdbusmenu-gtk/reference/tmpl/dummy.sgml new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 4fbdf12b5671ebcc68ce2d41018cd2a567298be8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Jun 2010 21:11:45 -0500 Subject: Adding an extra callback to catch a race condition --- libdbusmenu-glib/client.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index c0d3b7a..fa233a4 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -30,6 +30,8 @@ License version 3 and version 2.1 along with this program. If not, see #include "config.h" #endif +#include + #include #include @@ -397,6 +399,25 @@ dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, c return build_proxies(client); } +/* This is the response to see if the name has an owner. If + it does, then we should build the proxies here. Race condition + check. */ +static void +name_owner_check (DBusGProxy *proxy, gboolean has_owner, GError *error, gpointer userdata) +{ + if (error != NULL) { + return; + } + + if (!has_owner) { + return; + } + + DbusmenuClient * client = DBUSMENU_CLIENT(userdata); + build_proxies(client); + return; +} + /* This function builds the DBus proxy which will look out for the service coming up. */ static void @@ -426,6 +447,13 @@ build_dbus_proxy (DbusmenuClient * client) dbus_g_proxy_connect_signal(priv->dbusproxy, "NameOwnerChanged", G_CALLBACK(dbus_owner_change), client, NULL); + /* Now let's check to make sure we're not in some race + condition case. */ + org_freedesktop_DBus_name_has_owner_async(priv->dbusproxy, + priv->dbus_name, + name_owner_check, + client); + return; } -- cgit v1.2.3 From 16851654b11b15fe43ffb97ce8b4f26a7e2601c6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 17 Jun 2010 14:58:28 -0500 Subject: Wrong name for the property --- libdbusmenu-glib/menuitem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 39d257e..0d79ebb 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -58,7 +58,7 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data" #define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE "toggle-type" #define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE "toggle-state" -#define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "child-display" +#define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "children-display" #define DBUSMENU_MENUITEM_TOGGLE_CHECK "checkmark" #define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio" -- cgit v1.2.3