aboutsummaryrefslogtreecommitdiff
path: root/libindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-04 16:00:14 -0600
committerTed Gould <ted@gould.cx>2011-01-04 16:00:14 -0600
commit5de24f6cd9603be1649278a09eeacf1c01c1f8d2 (patch)
tree798540cc243d8450e3f703d5a6bc60c1754236f9 /libindicator
parent949766634a89457fe0477938e189352cba93c163 (diff)
downloadlibayatana-indicator-5de24f6cd9603be1649278a09eeacf1c01c1f8d2.tar.gz
libayatana-indicator-5de24f6cd9603be1649278a09eeacf1c01c1f8d2.tar.bz2
libayatana-indicator-5de24f6cd9603be1649278a09eeacf1c01c1f8d2.zip
Adding a function to check whether we should show the indicator with priority.
Diffstat (limited to 'libindicator')
-rw-r--r--libindicator/indicator-object.c24
-rw-r--r--libindicator/indicator-object.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index c1aa6af..7469cb9 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -453,6 +453,30 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr
}
/**
+ indicator_object_get_show_now:
+ @io: #IndicatorObject to query
+ @entry: The #IndicatorObjectEntry to look for.
+
+ This function returns whether the entry should be shown with
+ priority on the panel. If the object does not support checking
+ it assumes that its entries should never have priority.
+
+ Return value: Whether the entry should be shown with priority.
+*/
+guint
+indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entry)
+{
+ g_return_val_if_fail(INDICATOR_IS_OBJECT(io), 0);
+ IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
+
+ if (class->get_show_now) {
+ return class->get_show_now(io, entry);
+ }
+
+ return FALSE;
+}
+
+/**
indicator_object_entry_activate:
@io: #IndicatorObject to query
@entry: The #IndicatorObjectEntry whose entry was shown
diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h
index 3491e1f..6072f4f 100644
--- a/libindicator/indicator-object.h
+++ b/libindicator/indicator-object.h
@@ -148,6 +148,7 @@ IndicatorObject * indicator_object_new_from_file (const gchar * file);
GList * indicator_object_get_entries (IndicatorObject * io);
guint indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
+guint indicator_object_get_show_now (IndicatorObject * io, IndicatorObjectEntry * entry);
void indicator_object_entry_activate (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp);
G_END_DECLS