From 308e4db1bc070b6f548817fa6fe9297e64434613 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 15:35:55 -0600 Subject: Fleshing out the get_location function as much as they're implemented here. --- libindicator/indicator-object.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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; +} -- cgit v1.2.3