aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-09 16:12:45 -0600
committerTed Gould <ted@canonical.com>2009-01-09 16:12:45 -0600
commitf8ca55562f8b06ac5358cc54ffd1b272db7110de (patch)
treebf3d5aac55d6682b9e251b6775b7c45a0064bf96
parent5ed10dfc4cb460190959667a93846c6c091b4b0b (diff)
downloadlibayatana-indicator-f8ca55562f8b06ac5358cc54ffd1b272db7110de.tar.gz
libayatana-indicator-f8ca55562f8b06ac5358cc54ffd1b272db7110de.tar.bz2
libayatana-indicator-f8ca55562f8b06ac5358cc54ffd1b272db7110de.zip
Fleshing out the server some in adding function and prototypes.
-rw-r--r--libindicate/server.c48
-rw-r--r--libindicate/server.h7
2 files changed, 54 insertions, 1 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index 271a335..d166bb0 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -40,6 +40,18 @@ indicate_server_class_init (IndicateServerClass * class)
gobj->finalize = indicate_server_finalize;
+ dbus_g_object_type_install_info(INDICATE_TYPE_SERVER,
+ &dbus_glib_indicate_server_object_info);
+
+ class->get_desktop = NULL;
+ class->get_indicator_count = NULL;
+ class->get_indicator_count_by_type = NULL;
+ class->get_indicator_list = NULL;
+ class->get_indicator_list_by_type = NULL;
+ class->get_indicator_property = NULL;
+ class->get_indicator_property_group = NULL;
+ class->get_indicator_properties = NULL;
+ class->show_indicator_to_user = NULL;
return;
}
@@ -47,7 +59,8 @@ indicate_server_class_init (IndicateServerClass * class)
static void
indicate_server_init (IndicateServer * server)
{
-
+ server->path = g_strdup("/org/freedesktop/indicate");
+ server->indicators = NULL;
return;
}
@@ -55,7 +68,11 @@ indicate_server_init (IndicateServer * server)
static void
indicate_server_finalize (GObject * obj)
{
+ IndicateServer * server = INDICATE_SERVER(obj);
+ if (server->path) {
+ g_free(server->path);
+ }
return;
}
@@ -70,6 +87,35 @@ indicate_server_error_quark (void)
return quark;
}
+
+void
+indicate_server_show (IndicateServer * server)
+{
+ DBusGConnection * connection;
+
+ connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+
+ dbus_g_connection_register_g_object(connection,
+ server->path,
+ G_OBJECT(server));
+
+ return;
+}
+
+void
+indicator_server_add_indicator (IndicateServer * server, IndicateIndicator * indicator)
+{
+
+
+}
+
+void
+indicator_server_remove_indicator (IndicateServer * server, IndicateIndicator * indicator)
+{
+
+
+}
+
/* Virtual Functions */
gboolean
indicate_server_get_desktop (IndicateServer * server, gchar ** desktop_path, GError **error)
diff --git a/libindicate/server.h b/libindicate/server.h
index 28529dd..19a92a4 100644
--- a/libindicate/server.h
+++ b/libindicate/server.h
@@ -5,6 +5,8 @@
#include <glib.h>
#include <glib-object.h>
+#include "indicator.h"
+
/* Boilerplate */
#define INDICATE_TYPE_SERVER (indicate_server_get_type ())
#define INDICATE_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_SERVER, IndicateServer))
@@ -17,6 +19,8 @@ typedef struct _IndicateServer IndicateServer;
struct _IndicateServer {
GObject parent;
+ gchar * path;
+ GSList * indicators;
};
typedef struct _IndicateServerClass IndicateServerClass;
@@ -51,6 +55,9 @@ void indicate_server_set_desktop_file (const gchar * path);
void indicate_server_show (IndicateServer * server);
void indicate_server_hide (IndicateServer * server);
+void indicator_server_add_indicator (IndicateServer * server, IndicateIndicator * indicator);
+void indicator_server_remove_indicator (IndicateServer * server, IndicateIndicator * indicator);
+
/* DBus API */
gboolean indicate_server_get_desktop (IndicateServer * server, gchar ** desktop_path, GError **error);
gboolean indicate_server_get_indicator_count (IndicateServer * server, guint * count, GError **error);