aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-05-05 18:48:58 +0100
committerTed Gould <ted@canonical.com>2009-05-05 18:48:58 +0100
commit8b7a878309959f34b08b321f0f04457a31f52826 (patch)
tree5c304c348e361e71a0a86b2b8428562aff71d7ab /libdbusmenu-glib
parent59a21ee084758c2ba4774a86767f8c593ff94f72 (diff)
downloadlibdbusmenu-8b7a878309959f34b08b321f0f04457a31f52826.tar.gz
libdbusmenu-8b7a878309959f34b08b321f0f04457a31f52826.tar.bz2
libdbusmenu-8b7a878309959f34b08b321f0f04457a31f52826.zip
Adding in a signal for the layout being updated
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c25
-rw-r--r--libdbusmenu-glib/client.h10
2 files changed, 35 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 143e4be..bb2f588 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -15,6 +15,14 @@ enum {
PROP_DBUSNAME
};
+/* Signals */
+enum {
+ LAYOUT_UPDATED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate;
struct _DbusmenuClientPrivate
@@ -64,6 +72,22 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass)
object_class->set_property = set_property;
object_class->get_property = get_property;
+ /**
+ DbusmenuClient::layout-update:
+ @arg0: The #DbusmenuClient object
+
+ Tells that the layout has been updated and parsed by
+ this object and is ready for grabbing by the calling
+ application.
+ */
+ signals[LAYOUT_UPDATED] = g_signal_new(DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED,
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (DbusmenuClientClass, layout_updated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, G_TYPE_NONE);
+
g_object_class_install_property (object_class, PROP_DBUSOBJECT,
g_param_spec_string(DBUSMENU_CLIENT_PROP_DBUS_OBJECT, "DBus Object we represent",
"The Object on the client that we're getting our data from.",
@@ -330,6 +354,7 @@ update_layout_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data)
parse_layout(client, xml);
priv->layoutcall = NULL;
+ g_signal_emit(G_OBJECT(client), signals[LAYOUT_UPDATED], 0, TRUE);
return;
}
diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h
index bc4559a..d4c5ee9 100644
--- a/libdbusmenu-glib/client.h
+++ b/libdbusmenu-glib/client.h
@@ -15,6 +15,8 @@ G_BEGIN_DECLS
#define DBUSMENU_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_CLIENT))
#define DBUSMENU_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_CLIENT, DbusmenuClientClass))
+#define DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED "layout-updated"
+
#define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name"
#define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object"
@@ -23,6 +25,14 @@ typedef struct _DbusmenuClientClass DbusmenuClientClass;
struct _DbusmenuClientClass {
GObjectClass parent_class;
+
+ void (*layout_updated)(void);
+
+ /* Reserved for future use */
+ void (*reserved1) (void);
+ void (*reserved2) (void);
+ void (*reserved3) (void);
+ void (*reserved4) (void);
};
struct _DbusmenuClient {