From e744e385675fb948ffd888668c22ea93c706e1fa Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Fri, 28 Jun 2013 14:30:33 -0400 Subject: Allow indicators to tell the panel where they want to appear Only implemented in IndicatorNg right now, which gets that information from the indicator file. --- libindicator/indicator-object.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 30a6543..1a4ed17 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -115,6 +115,7 @@ static GList * get_entries_default (IndicatorObject*); static GList * get_all_entries (IndicatorObject*); static void indicator_object_entry_being_removed (IndicatorObject*, IndicatorObjectEntry*); static void indicator_object_entry_was_added (IndicatorObject*, IndicatorObjectEntry*); +static gint indicator_object_real_get_position (IndicatorObject*); static IndicatorObjectEntryPrivate * entry_get_private (IndicatorObject*, IndicatorObjectEntry*); G_DEFINE_TYPE (IndicatorObject, indicator_object, G_TYPE_OBJECT); @@ -141,6 +142,7 @@ indicator_object_class_init (IndicatorObjectClass *klass) klass->get_location = NULL; klass->entry_being_removed = NULL; klass->entry_was_added = NULL; + klass->get_position = indicator_object_real_get_position; klass->entry_activate = NULL; klass->entry_activate_window = NULL; @@ -778,6 +780,14 @@ indicator_object_entry_was_added (IndicatorObject * io, IndicatorObjectEntry * e } } +static gint +indicator_object_real_get_position (IndicatorObject *io) +{ + g_return_if_fail (INDICATOR_IS_OBJECT (io)); + + return -1; +} + /** indicator_object_set_environment: @io: #IndicatorObject to set on @@ -942,3 +952,11 @@ indicator_object_entry_is_visible (IndicatorObject * io, IndicatorObjectEntry * return entry_get_private (io, entry)->visibility == ENTRY_VISIBLE; } + +gint +indicator_object_get_position (IndicatorObject *io) +{ + g_return_val_if_fail (INDICATOR_IS_OBJECT (io), FALSE); + + return INDICATOR_OBJECT_GET_CLASS (io)->get_position (io); +} -- cgit v1.2.3 From e7e2b6357c8b4f1dade9c4e4be9b193d747626e2 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Fri, 28 Jun 2013 16:03:16 -0400 Subject: indicator-object: g_return_if_fail -> g_return_val_if_fail --- libindicator/indicator-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 1a4ed17..40f114e 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -783,7 +783,7 @@ indicator_object_entry_was_added (IndicatorObject * io, IndicatorObjectEntry * e static gint indicator_object_real_get_position (IndicatorObject *io) { - g_return_if_fail (INDICATOR_IS_OBJECT (io)); + g_return_val_if_fail (INDICATOR_IS_OBJECT (io), -1); return -1; } -- cgit v1.2.3