From ccac9b84bae42b0ad622d282dc12a65c3f7c7b11 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 10:39:51 -0600 Subject: Adding in the base object for the listener. --- libindicate/listener.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 libindicate/listener.h (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h new file mode 100644 index 0000000..1f0c870 --- /dev/null +++ b/libindicate/listener.h @@ -0,0 +1,53 @@ + +#ifndef INDICATE_LISTENER_H_INCLUDED__ +#define INDICATE_LISTENER_H_INCLUDED__ 1 + +#include +#include + +#include "indicator.h" +#include "server.h" + +G_BEGIN_DECLS + +/* Boilerplate */ +#define INDICATE_TYPE_LISTENER (indicate_server_get_type ()) +#define INDICATE_LISTENER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_LISTENER, IndicateListener)) +#define INDICATE_IS_LISTENER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_LISTENER)) +#define INDICATE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_LISTENER, IndicateListenerClass)) +#define INDICATE_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_LISTENER)) +#define INDICATE_LISTENER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_LISTENER, IndicateListenerClass)) + +typedef struct _IndicateListener IndicateListener; +struct _IndicateListener { + GObject parent; + +}; + +typedef struct _IndicateListenerClass IndicateListenerClass; +struct _IndicateListenerClass { + GObjectClass parent; + + /* Signals */ + void (* indicator_added) (IndicateServer * server, IndicateIndicator * indicator, gchar * type); + void (* indicator_removed) (IndicateServer * server, IndicateIndicator * indicator, gchar * type); + void (* indicator_modified) (IndicateServer * server, IndicateIndicator * indicator, gchar * property); + + void (* server_added) (IndicateServer * server); + void (* server_removed) (IndicateServer * server); + +}; + +GType indicate_listener_get_type (void) G_GNUC_CONST; + +/* Create a new server */ +IndicateListener * indicate_listener_new (void); + + + + + +G_END_DECLS + +#endif /* INDICATE_LISTENER_H_INCLUDED__ */ + -- cgit v1.2.3 From 441032cd3c150032bae9c7ec1c94fcacceee7c90 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 15:33:00 -0600 Subject: Starting to flesh out the listener a little bit, should get a list of names on teh bus at this point --- libindicate/listener.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index 1f0c870..8fc210f 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -5,6 +5,8 @@ #include #include +#include + #include "indicator.h" #include "server.h" @@ -22,6 +24,16 @@ typedef struct _IndicateListener IndicateListener; struct _IndicateListener { GObject parent; + DBusGConnection * session_bus; + DBusGConnection * system_bus; + + DBusGProxy * dbus_proxy_session; + DBusGProxy * dbus_proxy_system; + + GHashTable * proxies_session; + GHashTable * proxies_system; + + GArray * proxy_todo; }; typedef struct _IndicateListenerClass IndicateListenerClass; -- cgit v1.2.3 From 6ba40259a36abf1b1380921478b68e6dd4e2e8d9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 15:42:16 -0600 Subject: Adding a new function --- libindicate/listener.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index 8fc210f..f596494 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -52,7 +52,7 @@ struct _IndicateListenerClass { GType indicate_listener_get_type (void) G_GNUC_CONST; -/* Create a new server */ +/* Create a new listener */ IndicateListener * indicate_listener_new (void); -- cgit v1.2.3 From 4c623e47c0854f9acc2119045fa3f1ae76a82386 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 15:52:40 -0600 Subject: Amazing how a little string can make such a huge difference. --- libindicate/listener.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index f596494..7977711 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -13,7 +13,7 @@ G_BEGIN_DECLS /* Boilerplate */ -#define INDICATE_TYPE_LISTENER (indicate_server_get_type ()) +#define INDICATE_TYPE_LISTENER (indicate_listener_get_type ()) #define INDICATE_LISTENER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_LISTENER, IndicateListener)) #define INDICATE_IS_LISTENER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_LISTENER)) #define INDICATE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_LISTENER, IndicateListenerClass)) -- cgit v1.2.3 From d1c2ed2c5ccdfefc8c63e591a1742d8d61f310c4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 17:10:36 -0600 Subject: Now doing some DBus listening and getting some of the initial configuration built up. --- libindicate/listener.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index 7977711..b86c8a3 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -34,6 +34,7 @@ struct _IndicateListener { GHashTable * proxies_system; GArray * proxy_todo; + guint todo_idle; }; typedef struct _IndicateListenerClass IndicateListenerClass; -- cgit v1.2.3 From 2722037935bb34848b71128776b997c6c158ff8e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 21:49:28 -0600 Subject: Okay, adding the other signals in and keeping track of the indicators that are hanging around. Now, to connect to things external. --- libindicate/listener.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index b86c8a3..5c482ba 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -30,8 +30,8 @@ struct _IndicateListener { DBusGProxy * dbus_proxy_session; DBusGProxy * dbus_proxy_system; - GHashTable * proxies_session; - GHashTable * proxies_system; + GHashTable * proxies_working; + GHashTable * proxies_possible; GArray * proxy_todo; guint todo_idle; -- cgit v1.2.3 From 0d1e01e34d94b47b8785cac9138f529c1fcc55b9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Jan 2009 23:01:16 -0600 Subject: Getting the signals in shape --- libindicate/listener.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libindicate/listener.h') diff --git a/libindicate/listener.h b/libindicate/listener.h index 5c482ba..c40bc07 100644 --- a/libindicate/listener.h +++ b/libindicate/listener.h @@ -20,6 +20,9 @@ G_BEGIN_DECLS #define INDICATE_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_LISTENER)) #define INDICATE_LISTENER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_LISTENER, IndicateListenerClass)) +typedef gchar IndicateListenerServer; +typedef guint IndicateListenerIndicator; + typedef struct _IndicateListener IndicateListener; struct _IndicateListener { GObject parent; @@ -42,13 +45,12 @@ struct _IndicateListenerClass { GObjectClass parent; /* Signals */ - void (* indicator_added) (IndicateServer * server, IndicateIndicator * indicator, gchar * type); - void (* indicator_removed) (IndicateServer * server, IndicateIndicator * indicator, gchar * type); - void (* indicator_modified) (IndicateServer * server, IndicateIndicator * indicator, gchar * property); - - void (* server_added) (IndicateServer * server); - void (* server_removed) (IndicateServer * server); + void (* indicator_added) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type); + void (* indicator_removed) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type); + void (* indicator_modified) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gchar * property); + void (* server_added) (IndicateListenerServer * server); + void (* server_removed) (IndicateListenerServer * server); }; GType indicate_listener_get_type (void) G_GNUC_CONST; -- cgit v1.2.3