diff options
author | Ted Gould <ted@canonical.com> | 2009-05-26 15:34:45 +0200 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-05-26 15:34:45 +0200 |
commit | 67b8e020399db87d2865843c7c4ad651f07ac31d (patch) | |
tree | a871c3a01849c8763593409bf25d06cc7e74f733 /src | |
parent | a604ba6030a9b039c21923106700645a08989a9f (diff) | |
download | ayatana-indicator-messages-67b8e020399db87d2865843c7c4ad651f07ac31d.tar.gz ayatana-indicator-messages-67b8e020399db87d2865843c7c4ad651f07ac31d.tar.bz2 ayatana-indicator-messages-67b8e020399db87d2865843c7c4ad651f07ac31d.zip |
First pass, build the listener and do fun stuff like that.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-service.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/src/indicator-service.c b/src/indicator-service.c index 683a7ab..3c3506f 100644 --- a/src/indicator-service.c +++ b/src/indicator-service.c @@ -24,12 +24,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gtk/gtk.h> #include <libindicate/listener.h> -#include <libindicator/indicator.h> -INDICATOR_SET_VERSION -INDICATOR_SET_NAME("messages") +#include <libdbusmenu-glib/server.h> #include "im-menu-item.h" #include "app-menu-item.h" +#include "dbus-data.h" static IndicateListener * listener; static GList * serverList; @@ -471,43 +470,27 @@ indicator_removed (IndicateListener * listener, IndicateListenerServer * server, return; } -GtkLabel * -get_label (void) -{ - return NULL; -} +static GMainLoop * mainloop = NULL; -GtkImage * -get_icon (void) +int +main (int argc, char ** argv) { - design_team_size = gtk_icon_size_register("design-team-size", 22, 22); - - main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE); - gtk_widget_show(main_image); - - return GTK_IMAGE(main_image); -} + g_type_init(); -GtkMenu * -get_menu (void) -{ listener = indicate_listener_ref_default(); serverList = NULL; - GtkWidget * submenu = gtk_menu_new(); - gtk_widget_show(submenu); + DbusmenuMenuitem * submenu = dbusmenu_menuitem_new(); + DbusmenuServer * server = dbusmenu_server_new(INDICATOR_MESSAGES_DBUS_OBJECT); + dbusmenu_server_set_root(server, submenu); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), submenu); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), submenu); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), submenu); g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), submenu); - return GTK_MENU(submenu); -} - -int -main (int argc, char ** argv) -{ + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); return 0; } |