From 72650a318c8d65419fa53929e004ee48f98e6b09 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 10:30:47 -0600 Subject: Adding a property for icon theme path collection. --- libdbusmenu-glib/dbus-menu.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 3b42f7d..738a0b0 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -189,6 +189,15 @@ License version 3 and version 2.1 along with this program. If not, see + + + A list of directories that should be used for finding icons using + the icon naming spec. Idealy there should only be one for the icon + theme, but additional ones are often added by applications for + app specific icons. + + + -- cgit v1.2.3 From d5b20b1b8f51a56c05a20aa58e54d6d231f30729 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 12:10:20 -0600 Subject: Prototypes and stubs for the get/set icon paths --- libdbusmenu-glib/server.c | 15 +++++++++++++++ libdbusmenu-glib/server.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 91e7a25..259167b 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1685,3 +1685,18 @@ dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status) return; } + +const GStrv +dbusmenu_server_get_icon_paths (DbusmenuServer * server) +{ + + return NULL; +} + +void +dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths) +{ + + + return; +} diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index 54cf5fc..bed567f 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -119,6 +119,9 @@ void dbusmenu_server_set_text_direction (DbusmenuServer * DbusmenuStatus dbusmenu_server_get_status (DbusmenuServer * server); void dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status); +const GStrv dbusmenu_server_get_icon_paths (DbusmenuServer * server); +void dbusmenu_server_set_icon_paths (DbusmenuServer * server, + GStrv icon_paths); /** SECIONT:server -- cgit v1.2.3 From 3786fda6e30b90f71e55cb325a342a019a548007 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 12:22:53 -0600 Subject: Adding some documentation --- libdbusmenu-glib/server.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 259167b..8d55cea 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1686,6 +1686,16 @@ dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status) return; } +/** + dbusmenu_server_get_icon_paths: + @server: The #DbusmenuServer to get the icon paths from + + Gets the stored and exported icon paths from the server. + + Return value: A NULL-terminated list of icon paths with + memory managed by the server. Duplicate if you want + to keep them. +*/ const GStrv dbusmenu_server_get_icon_paths (DbusmenuServer * server) { @@ -1693,6 +1703,13 @@ dbusmenu_server_get_icon_paths (DbusmenuServer * server) return NULL; } +/** + dbusmenu_server_set_icon_paths: + @server: The #DbusmenuServer to set the icon paths on + + Sets the icon paths for the server. This will replace previously + set icon theme paths. +*/ void dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths) { -- cgit v1.2.3 From aff9b26c5c82ce54126d9cecc0a66a3abb5bfcc7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 13:39:21 -0600 Subject: Adding a private variable for the string list --- libdbusmenu-glib/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 8d55cea..6199a39 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -59,6 +59,7 @@ struct _DbusmenuServerPrivate DbusmenuTextDirection text_direction; DbusmenuStatus status; + GStrv icon_dirs; GArray * prop_array; guint property_idle; @@ -368,6 +369,7 @@ dbusmenu_server_init (DbusmenuServer *self) default_text_direction(self); priv->status = DBUSMENU_STATUS_NORMAL; + priv->icon_dirs = NULL; return; } @@ -425,6 +427,13 @@ dbusmenu_server_dispose (GObject *object) static void dbusmenu_server_finalize (GObject *object) { + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object); + + if (priv->icon_dirs != NULL) { + g_strfreev(priv->icon_dirs); + priv->icon_dirs = NULL; + } + G_OBJECT_CLASS (dbusmenu_server_parent_class)->finalize (object); return; } -- cgit v1.2.3 From b6260e5ce88bda9aef711e1fdddc75cd807dd5f7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 13:40:56 -0600 Subject: Fleshing out getting the dirs --- libdbusmenu-glib/server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 6199a39..123472d 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1706,10 +1706,11 @@ dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status) to keep them. */ const GStrv -dbusmenu_server_get_icon_paths (DbusmenuServer * server) +dbusmenu_server_get_icon_paths (DbusmenuServer * server) { - - return NULL; + g_return_val_if_fail(DBUSMENU_IS_SERVER(server), NULL); + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + return priv->icon_dirs; } /** -- cgit v1.2.3 From a72bcc0edc0da201b2cf112e057ee2273d4dd6d8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 14:03:09 -0600 Subject: Fleshing out the function to set the icon dirs --- libdbusmenu-glib/server.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 123472d..d969a55 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -85,7 +85,8 @@ enum { PROP_ROOT_NODE, PROP_VERSION, PROP_TEXT_DIRECTION, - PROP_STATUS + PROP_STATUS, + PROP_ICON_THEME_DIRS }; /* Errors */ @@ -1723,7 +1724,41 @@ dbusmenu_server_get_icon_paths (DbusmenuServer * server) void dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths) { + g_return_if_fail(DBUSMENU_IS_SERVER(server)); + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + + if (priv->icon_dirs != NULL) { + g_strfreev(priv->icon_dirs); + priv->icon_dirs = NULL; + } + + if (icon_paths != NULL) { + priv->icon_dirs = g_strdupv(icon_paths); + } + if (priv->bus != NULL && priv->dbusobject != NULL) { + GVariantBuilder params; + g_variant_builder_init(¶ms, G_VARIANT_TYPE_ARRAY); + g_variant_builder_add_value(¶ms, g_variant_new_string(DBUSMENU_INTERFACE)); + GVariant * items = NULL; + if (priv->icon_dirs != NULL) { + GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("icon-theme-path"), g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1)); + items = g_variant_new_array(NULL, &dict, 1); + } else { + items = g_variant_new_array(G_VARIANT_TYPE("{sv}"), NULL, 0); + } + g_variant_builder_add_value(¶ms, items); + g_variant_builder_add_value(¶ms, g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0)); + GVariant * vparams = g_variant_builder_end(¶ms); + + g_dbus_connection_emit_signal(priv->bus, + NULL, + priv->dbusobject, + "org.freedesktop.DBus.Properties", + "PropertiesChanged", + vparams, + NULL); + } return; } -- cgit v1.2.3 From 08409e83ad0cc9beeb27f3f4dce9b98a43138576 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 22 Feb 2011 14:16:45 -0600 Subject: Handle the property being grabbed over dbus --- libdbusmenu-glib/server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index d969a55..22aec70 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -754,6 +754,16 @@ bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar * return g_variant_new_uint32(DBUSMENU_VERSION_NUMBER); } else if (g_strcmp0(property, "text-direction") == 0) { return g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction)); + } else if (g_strcmp0(property, "icon-theme-path") == 0) { + GVariant * dirs = NULL; + + if (priv->icon_dirs != NULL) { + dirs = g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1); + } else { + dirs = g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0); + } + + return dirs; } else { g_warning("Unknown property '%s'", property); } -- cgit v1.2.3 From d693a90a23e498b50052040f90d761d0b57c5914 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 2 Mar 2011 22:41:48 -0600 Subject: Changing property name to match DBus recommendations --- libdbusmenu-glib/dbus-menu.xml | 2 +- libdbusmenu-glib/server.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 956844e..efb55d4 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -189,7 +189,7 @@ License version 3 and version 2.1 along with this program. If not, see - + A list of directories that should be used for finding icons using the icon naming spec. Idealy there should only be one for the icon diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 14c0c53..7421747 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -754,7 +754,7 @@ bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar * return g_variant_new_uint32(DBUSMENU_VERSION_NUMBER); } else if (g_strcmp0(property, "TextDirection") == 0) { return g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction)); - } else if (g_strcmp0(property, "icon-theme-path") == 0) { + } else if (g_strcmp0(property, "IconThemePath") == 0) { GVariant * dirs = NULL; if (priv->icon_dirs != NULL) { @@ -1773,7 +1773,7 @@ dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths) g_variant_builder_add_value(¶ms, g_variant_new_string(DBUSMENU_INTERFACE)); GVariant * items = NULL; if (priv->icon_dirs != NULL) { - GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("icon-theme-path"), g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1)); + GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("IconThemePath"), g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1)); items = g_variant_new_array(NULL, &dict, 1); } else { items = g_variant_new_array(G_VARIANT_TYPE("{sv}"), NULL, 0); -- cgit v1.2.3 From 653e6aaf8dfbc91f728cd8766991a50c2fc6f275 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 2 Mar 2011 22:47:54 -0600 Subject: Adding the private variable for icon directories --- libdbusmenu-glib/client.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 83ca056..a91e9f6 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -98,6 +98,7 @@ struct _DbusmenuClientPrivate DbusmenuTextDirection text_direction; DbusmenuStatus status; + GStrv icon_dirs; }; typedef struct _newItemPropData newItemPropData; @@ -358,6 +359,7 @@ dbusmenu_client_init (DbusmenuClient *self) priv->text_direction = DBUSMENU_TEXT_DIRECTION_NONE; priv->status = DBUSMENU_STATUS_NORMAL; + priv->icon_dirs = NULL; return; } @@ -466,6 +468,11 @@ dbusmenu_client_finalize (GObject *object) g_hash_table_destroy(priv->type_handlers); } + if (priv->icon_dirs != NULL) { + g_strfreev(priv->icon_dirs); + priv->icon_dirs = NULL; + } + G_OBJECT_CLASS (dbusmenu_client_parent_class)->finalize (object); return; } -- cgit v1.2.3 From 75eb455e972b3e04b2fc8b89ead2815dff070fa5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 2 Mar 2011 22:53:09 -0600 Subject: Handle getting the property and/or getting an update to it. --- libdbusmenu-glib/client.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index a91e9f6..9954683 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1071,6 +1071,7 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(user_data); DbusmenuTextDirection olddir = priv->text_direction; DbusmenuStatus oldstatus = priv->status; + gboolean dirs_changed = FALSE; /* Invalidate first */ gchar * invalid; @@ -1082,6 +1083,13 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva if (g_strcmp0(invalid, "Status") == 0) { priv->status = DBUSMENU_STATUS_NORMAL; } + if (g_strcmp0(invalid, "IconThemePath") == 0) { + if (priv->icon_dirs != NULL) { + dirs_changed = TRUE; + g_strfreev(priv->icon_dirs); + priv->icon_dirs = NULL; + } + } } /* Check updates */ @@ -1105,6 +1113,15 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva priv->status = dbusmenu_status_get_value_from_nick(g_variant_get_string(str, NULL)); } + if (g_strcmp0(key, "IconThemePath") == 0) { + if (priv->icon_dirs != NULL) { + g_strfreev(priv->icon_dirs); + priv->icon_dirs = NULL; + } + + priv->icon_dirs = g_variant_dup_strv(value, NULL); + dirs_changed = TRUE; + } g_variant_unref(value); g_free(key); @@ -1118,6 +1135,10 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva g_object_notify(G_OBJECT(user_data), DBUSMENU_CLIENT_PROP_STATUS); } + if (dirs_changed) { + // TODO: We need to tell someone! + } + return; } -- cgit v1.2.3 From 9dd7d767dfc3388d549e2b2ed6004618dcf84270 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 10:31:22 -0600 Subject: Adding a signal for theme directories changing. --- libdbusmenu-glib/client-marshal.list | 1 + libdbusmenu-glib/client.c | 15 +++++++++++++++ libdbusmenu-glib/client.h | 10 +++++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libdbusmenu-glib/client-marshal.list b/libdbusmenu-glib/client-marshal.list index 96f9302..980c5c3 100644 --- a/libdbusmenu-glib/client-marshal.list +++ b/libdbusmenu-glib/client-marshal.list @@ -1,3 +1,4 @@ VOID: OBJECT, UINT VOID: OBJECT, STRING, VARIANT, UINT, POINTER VOID: ENUM +VOID: POINTER diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 9954683..30fe1ba 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -62,6 +62,7 @@ enum { NEW_MENUITEM, ITEM_ACTIVATE, EVENT_RESULT, + ICON_THEME_DIRS, LAST_SIGNAL }; @@ -273,6 +274,20 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) NULL, NULL, _dbusmenu_client_marshal_VOID__OBJECT_STRING_VARIANT_UINT_POINTER, G_TYPE_NONE, 5, G_TYPE_OBJECT, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_UINT, G_TYPE_POINTER); + /** + DbusmenuClient::icon-theme-dirs-changed: + @arg0: The #DbusmenuClient object + @arg1: A #GStrv of theme directories + + Signaled when the theme directories are changed by the server. + */ + signals[ICON_THEME_DIRS] = g_signal_new(DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED, + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (DbusmenuClientClass, icon_theme_dirs), + NULL, NULL, + _dbusmenu_client_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); g_object_class_install_property (object_class, PROP_DBUSOBJECT, g_param_spec_string(DBUSMENU_CLIENT_PROP_DBUS_OBJECT, "DBus Object we represent", diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 28d4dd3..f69270f 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -75,11 +75,11 @@ G_BEGIN_DECLS */ #define DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT "event-result" /** - * DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED: + * DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED: * - * String to attach to signal #DbusmenuClient::text-direction-changed + * String to attach to signal #DbusmenuClient::icon-theme-dirs-changed */ -#define DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED "text-direction-changed" +#define DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED "icon-theme-dirs-changed" /** * DBUSMENU_CLIENT_PROP_DBUS_NAME: @@ -139,12 +139,12 @@ typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; @new_menuitem: Slot for #DbusmenuClient::new-menuitem. @item_activate: Slot for #DbusmenuClient::item-activate. @event_result: Slot for #DbusmenuClient::event-error. + @icon_theme_dirs: Slot for #DbusmenuClient::icon-theme-dirs-changed. @reserved1: Reserved for future use. @reserved2: Reserved for future use. @reserved3: Reserved for future use. @reserved4: Reserved for future use. @reserved5: Reserved for future use. - @reserved6: Reserved for future use. A simple class that takes all of the information from a #DbusmenuServer over DBus and makes the same set of @@ -159,6 +159,7 @@ struct _DbusmenuClientClass { void (*new_menuitem) (DbusmenuMenuitem * newitem); void (*item_activate) (DbusmenuMenuitem * item, guint timestamp); void (*event_result) (DbusmenuMenuitem * item, gchar * event, GVariant * data, guint timestamp, GError * error); + void (*icon_theme_dirs) (DbusmenuMenuitem * item, gpointer theme_dirs, GError * error); /*< Private >*/ void (*reserved1) (void); @@ -166,7 +167,6 @@ struct _DbusmenuClientClass { void (*reserved3) (void); void (*reserved4) (void); void (*reserved5) (void); - void (*reserved6) (void); }; /** -- cgit v1.2.3 From c975ec882ef2842aec03e799c5fc807d8dc6c3b4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 10:34:54 -0600 Subject: Emit the signal when needed --- libdbusmenu-glib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 30fe1ba..26c7942 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1151,7 +1151,7 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva } if (dirs_changed) { - // TODO: We need to tell someone! + g_signal_emit(G_OBJECT(user_data), signals[ICON_THEME_DIRS], 0, priv->icon_dirs, TRUE); } return; -- cgit v1.2.3 From baacc6da45b252e8c510a6e69fd7332f51dd961e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 10:37:07 -0600 Subject: Changing comment so it can get some GIR lovin' --- libdbusmenu-glib/server.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 7421747..810fc05 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1728,15 +1728,15 @@ dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status) } /** - dbusmenu_server_get_icon_paths: - @server: The #DbusmenuServer to get the icon paths from - - Gets the stored and exported icon paths from the server. - - Return value: A NULL-terminated list of icon paths with - memory managed by the server. Duplicate if you want - to keep them. -*/ + * dbusmenu_server_get_icon_paths: + * @server: The #DbusmenuServer to get the icon paths from + * + * Gets the stored and exported icon paths from the server. + * + * Return value: (transfer none): A NULL-terminated list of icon paths with + * memory managed by the server. Duplicate if you want + * to keep them. + */ const GStrv dbusmenu_server_get_icon_paths (DbusmenuServer * server) { -- cgit v1.2.3 From 10a95caedd896115b4d479c0328d575ce20e32d9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 10:43:26 -0600 Subject: Add a 'get' function for the icon theme directories. --- libdbusmenu-glib/client.c | 17 +++++++++++++++++ libdbusmenu-glib/client.h | 1 + 2 files changed, 18 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 26c7942..f041730 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -2055,4 +2055,21 @@ dbusmenu_client_get_status (DbusmenuClient * client) return priv->status; } +/** + * dbusmenu_client_get_icon_paths: + * @client: The #DbusmenuClient to get the icon paths from + * + * Gets the stored and exported icon paths from the client. + * + * Return value: (transfer none): A NULL-terminated list of icon paths with + * memory managed by the client. Duplicate if you want + * to keep them. + */ +const GStrv +dbusmenu_client_get_icon_paths (DbusmenuClient * client) +{ + g_return_val_if_fail(DBUSMENU_IS_CLIENT(client), NULL); + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + return priv->icon_dirs; +} diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index f69270f..93f4280 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -224,6 +224,7 @@ gboolean dbusmenu_client_add_type_handler_full (DbusmenuClient * cli DbusmenuClientTypeDestroyHandler destroy_func); DbusmenuTextDirection dbusmenu_client_get_text_direction (DbusmenuClient * client); DbusmenuStatus dbusmenu_client_get_status (DbusmenuClient * client); +const GStrv dbusmenu_client_get_icon_paths (DbusmenuClient * client); /** SECTION:client -- cgit v1.2.3 From a5f4f2898eec5e8dda5ec302c57ab9610ac9d1f3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 10:59:21 -0600 Subject: Should be a tuple --- libdbusmenu-glib/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 810fc05..fa517f5 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1769,7 +1769,7 @@ dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths) if (priv->bus != NULL && priv->dbusobject != NULL) { GVariantBuilder params; - g_variant_builder_init(¶ms, G_VARIANT_TYPE_ARRAY); + g_variant_builder_init(¶ms, G_VARIANT_TYPE_TUPLE); g_variant_builder_add_value(¶ms, g_variant_new_string(DBUSMENU_INTERFACE)); GVariant * items = NULL; if (priv->icon_dirs != NULL) { -- cgit v1.2.3 From 1e1969a77b03f79504305ecfc6098249b52862c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 3 Mar 2011 11:00:53 -0600 Subject: Fixing the sections to match our new funcs --- docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt index b1e2d8c..4ee1401 100644 --- a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt +++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt @@ -6,7 +6,7 @@ DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE -DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED +DBUSMENU_CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED DBUSMENU_CLIENT_PROP_DBUS_NAME DBUSMENU_CLIENT_PROP_DBUS_OBJECT DBUSMENU_CLIENT_PROP_STATUS @@ -19,6 +19,7 @@ DbusmenuClientClass DbusmenuClientTypeHandler DbusmenuClientTypeDestroyHandler dbusmenu_client_new +dbusmenu_client_get_icon_paths dbusmenu_client_get_root dbusmenu_client_get_status dbusmenu_client_get_text_direction @@ -152,6 +153,8 @@ DBUSMENU_SERVER_GET_CLASS DbusmenuServerPrivate dbusmenu_server_get_type +dbusmenu_server_get_icon_paths +dbusmenu_server_set_icon_paths
-- cgit v1.2.3