From d8c7246f702c687b4f532cfb66c5eeb545aa175d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 11 Jan 2010 14:05:24 -0600 Subject: Setting the fallback functions so that we can go round trip on setting up this API. --- src/libappindicator/app-indicator.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/libappindicator/app-indicator.c') diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 7560a97..9f0ca54 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -64,8 +64,9 @@ struct _AppIndicatorPrivate { gchar *icon_name; gchar *attention_icon_name; gchar * icon_path; - DbusmenuServer *menuservice; - GtkWidget *menu; + DbusmenuServer *menuservice; + GtkWidget *menu; + GtkStatusIcon * status_icon; /* Fun stuff */ DBusGProxy *watcher_proxy; @@ -122,6 +123,8 @@ static void app_indicator_get_property (GObject * object, guint prop_id, GValue /* Other stuff */ static void check_connect (AppIndicator * self); static void register_service_cb (DBusGProxy * proxy, GError * error, gpointer data); +static GtkStatusIcon * fallback (AppIndicator * self); +static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); /* GObject type */ G_DEFINE_TYPE (AppIndicator, app_indicator, G_TYPE_OBJECT); @@ -141,6 +144,10 @@ app_indicator_class_init (AppIndicatorClass *klass) object_class->set_property = app_indicator_set_property; object_class->get_property = app_indicator_get_property; + /* Our own funcs */ + klass->fallback = fallback; + klass->unfallback = unfallback; + /* Properties */ g_object_class_install_property (object_class, PROP_ID, @@ -568,6 +575,24 @@ category_from_enum (AppIndicatorCategory category) return value->value_nick; } +/* Creates a StatusIcon that can be used when the application + indicator area isn't available. */ +static GtkStatusIcon * +fallback (AppIndicator * self) +{ + + return NULL; +} + +/* Removes the status icon as the application indicator area + is now up and running again. */ +static void +unfallback (AppIndicator * self, GtkStatusIcon * status_icon) +{ + + return; +} + /* ************************* */ /* Public Functions */ -- cgit v1.2.3