aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-15 15:35:55 -0600
committerTed Gould <ted@gould.cx>2010-01-15 15:35:55 -0600
commit308e4db1bc070b6f548817fa6fe9297e64434613 (patch)
treea15c51f34d822637b309004897473da6000c1ffa
parentd334db5071495817e9dea5b50a2fc27709058410 (diff)
downloadlibayatana-indicator-308e4db1bc070b6f548817fa6fe9297e64434613.tar.gz
libayatana-indicator-308e4db1bc070b6f548817fa6fe9297e64434613.tar.bz2
libayatana-indicator-308e4db1bc070b6f548817fa6fe9297e64434613.zip
Fleshing out the get_location function as much as they're implemented here.
-rw-r--r--libindicator/indicator-object.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index 3b00c97..f186a4f 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -88,6 +88,7 @@ indicator_object_class_init (IndicatorObjectClass *klass)
klass->get_image = NULL;
klass->get_entries = get_entries_default;
+ klass->get_location = NULL;
/**
IndicatorObject::entry-added:
@@ -366,3 +367,29 @@ indicator_object_get_entries (IndicatorObject * io)
g_error("No get_entries function on object. It must have been deleted?!?!");
return NULL;
}
+
+/**
+ indicator_object_get_location:
+ @io: #IndicatorObject to query
+ @entry: The #IndicatorObjectEntry to look for.
+
+ This function looks on the class for the object and calls
+ it's #IndicatorObjectClass::get_location function. If the
+ function doesn't exist it returns zero.
+
+ Return value: Location of the @entry in the display or
+ zero if no location is specified.
+*/
+guint
+indicator_object_get_location (IndicatorObject * io, IndicatorObjectEntry * entry)
+{
+ g_return_val_if_fail(INDICATOR_IS_OBJECT(io), 0);
+ IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
+
+ if (class->get_location) {
+ return class->get_location(io, entry);
+ }
+
+ g_error("No get_entries function on object. It must have been deleted?!?!");
+ return 0;
+}