From 8903841582ea26b4987fbe04b5a5545d8d65f729 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Oct 2009 15:12:46 -0500 Subject: Boom! Now we're implementing dbus. --- src/custom-service.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index d96a9de..382fd71 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -1,12 +1,6 @@ -#include "notification-item-client.h" - -void _notification_watcher_server_register_service (void) { }; -void _notification_watcher_server_registered_services (void) { }; -void _notification_watcher_server_protocol_version (void) { }; -void _notification_watcher_server_register_notification_host (void) { }; -void _notification_watcher_server_is_notification_host_registered (void) { }; -#include "notification-watcher-server.h" +#include "notification-item-client.h" +#include "custom-service-appstore.h" int main (int argc, char ** argv) -- cgit v1.2.3 From f2c4a15e281e697bd6222efe80432014f0cef32f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Oct 2009 15:55:28 -0500 Subject: Building our app store --- src/custom-service.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index 382fd71..b191bac 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -1,10 +1,19 @@ #include "notification-item-client.h" #include "custom-service-appstore.h" + +static GMainLoop * mainloop = NULL; +static CustomServiceAppstore * appstore = NULL; int main (int argc, char ** argv) { + g_type_init(); + + appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); return 0; } -- cgit v1.2.3 From 3d1c4c46fd56576b228bc59dc7b3af3bf82db642 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 17:19:25 -0600 Subject: Boom, make us an indicator service. --- src/custom-service.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index b191bac..2f8ecf5 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -1,15 +1,18 @@ +#include "libindicator/indicator-service.h" #include "notification-item-client.h" #include "custom-service-appstore.h" static GMainLoop * mainloop = NULL; static CustomServiceAppstore * appstore = NULL; +static IndicatorService * service = NULL; int main (int argc, char ** argv) { g_type_init(); + service = indicator_service_new("org.ayatana.indicator.custom"); appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); mainloop = g_main_loop_new(NULL, FALSE); -- cgit v1.2.3 From 9aff9ba7149a1757f124db54599637801fa76ae6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 19:52:47 -0600 Subject: Getting the name into a header. --- src/custom-service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index 2f8ecf5..df3d58a 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -2,6 +2,7 @@ #include "libindicator/indicator-service.h" #include "notification-item-client.h" #include "custom-service-appstore.h" +#include "dbus-shared.h" static GMainLoop * mainloop = NULL; static CustomServiceAppstore * appstore = NULL; @@ -12,7 +13,7 @@ main (int argc, char ** argv) { g_type_init(); - service = indicator_service_new("org.ayatana.indicator.custom"); + service = indicator_service_new(INDICATOR_CUSTOM_DBUS_ADDR); appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); mainloop = g_main_loop_new(NULL, FALSE); -- cgit v1.2.3 From ced0ec2c7e9e9138fb42422e662bf03deb957343 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 17:13:47 -0600 Subject: Connecting the watcher and the appstore. And actually building one. We're on DBus now. --- src/custom-service.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index df3d58a..3205bc2 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -2,10 +2,12 @@ #include "libindicator/indicator-service.h" #include "notification-item-client.h" #include "custom-service-appstore.h" +#include "custom-service-watcher.h" #include "dbus-shared.h" static GMainLoop * mainloop = NULL; static CustomServiceAppstore * appstore = NULL; +static CustomServiceWatcher * watcher = NULL; static IndicatorService * service = NULL; int @@ -15,6 +17,7 @@ main (int argc, char ** argv) service = indicator_service_new(INDICATOR_CUSTOM_DBUS_ADDR); appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); + watcher = custom_service_watcher_new(appstore); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); -- cgit v1.2.3 From f22ff6a153ca3b6ebc6cab0177913823f0251be7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 23 Nov 2009 12:02:40 -0600 Subject: Cleaning up main a little bit and handling the 'disconnected' case that doesn't yet quite exist. --- src/custom-service.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c index 3205bc2..5bd9b96 100644 --- a/src/custom-service.c +++ b/src/custom-service.c @@ -5,22 +5,52 @@ #include "custom-service-watcher.h" #include "dbus-shared.h" +/* The base main loop */ static GMainLoop * mainloop = NULL; +/* Where the application registry lives */ static CustomServiceAppstore * appstore = NULL; +/* Interface for applications */ static CustomServiceWatcher * watcher = NULL; +/* The service management interface */ static IndicatorService * service = NULL; + +/* Recieves the disonnection signal from the service + object and closes the mainloop. */ +static void +service_disconnected (IndicatorService * service, gpointer data) +{ + g_debug("Service disconnected"); + if (mainloop != NULL) { + g_main_loop_quit(mainloop); + } + return; +} +/* Builds up the core objects and puts us spinning into + a main loop. */ int main (int argc, char ** argv) { g_type_init(); + /* Bring us up as a basic indicator service */ service = indicator_service_new(INDICATOR_CUSTOM_DBUS_ADDR); + g_signal_connect(G_OBJECT(service), "disconnected", G_CALLBACK(service_disconnected), NULL); + + /* Building our app store */ appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); + + /* Adding a watcher for the Apps coming up */ watcher = custom_service_watcher_new(appstore); + /* Building and executing our main loop */ mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); + /* Unref'ing all the objects */ + g_object_unref(G_OBJECT(watcher)); + g_object_unref(G_OBJECT(appstore)); + g_object_unref(G_OBJECT(service)); + return 0; } -- cgit v1.2.3 From fc1e08a7c7873005d9161da2ea677908d07f3fcc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 30 Nov 2009 09:52:16 -0600 Subject: Total insane rename. Probably broke more than a few things. --- src/custom-service.c | 56 ---------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/custom-service.c (limited to 'src/custom-service.c') diff --git a/src/custom-service.c b/src/custom-service.c deleted file mode 100644 index 5bd9b96..0000000 --- a/src/custom-service.c +++ /dev/null @@ -1,56 +0,0 @@ - -#include "libindicator/indicator-service.h" -#include "notification-item-client.h" -#include "custom-service-appstore.h" -#include "custom-service-watcher.h" -#include "dbus-shared.h" - -/* The base main loop */ -static GMainLoop * mainloop = NULL; -/* Where the application registry lives */ -static CustomServiceAppstore * appstore = NULL; -/* Interface for applications */ -static CustomServiceWatcher * watcher = NULL; -/* The service management interface */ -static IndicatorService * service = NULL; - -/* Recieves the disonnection signal from the service - object and closes the mainloop. */ -static void -service_disconnected (IndicatorService * service, gpointer data) -{ - g_debug("Service disconnected"); - if (mainloop != NULL) { - g_main_loop_quit(mainloop); - } - return; -} - -/* Builds up the core objects and puts us spinning into - a main loop. */ -int -main (int argc, char ** argv) -{ - g_type_init(); - - /* Bring us up as a basic indicator service */ - service = indicator_service_new(INDICATOR_CUSTOM_DBUS_ADDR); - g_signal_connect(G_OBJECT(service), "disconnected", G_CALLBACK(service_disconnected), NULL); - - /* Building our app store */ - appstore = CUSTOM_SERVICE_APPSTORE(g_object_new(CUSTOM_SERVICE_APPSTORE_TYPE, NULL)); - - /* Adding a watcher for the Apps coming up */ - watcher = custom_service_watcher_new(appstore); - - /* Building and executing our main loop */ - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - /* Unref'ing all the objects */ - g_object_unref(G_OBJECT(watcher)); - g_object_unref(G_OBJECT(appstore)); - g_object_unref(G_OBJECT(service)); - - return 0; -} -- cgit v1.2.3