From 5de24f6cd9603be1649278a09eeacf1c01c1f8d2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Jan 2011 16:00:14 -0600 Subject: Adding a function to check whether we should show the indicator with priority. --- libindicator/indicator-object.c | 24 ++++++++++++++++++++++++ libindicator/indicator-object.h | 1 + 2 files changed, 25 insertions(+) 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 @@ -452,6 +452,30 @@ indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entr return 0; } +/** + 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 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 -- cgit v1.2.3