From 9215e19e801f59a2abd4dd92563cfe50f366f635 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 18 Jan 2011 16:50:37 +1100 Subject: Add accessible_name variable in indicator entry structure --- libindicator/indicator-object.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 988a8ae..c190cd7 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -90,6 +90,7 @@ indicator_object_class_init (IndicatorObjectClass *klass) klass->get_label = NULL; klass->get_menu = NULL; klass->get_image = NULL; + klass->get_accessible_name = NULL; klass->get_entries = get_entries_default; klass->get_location = NULL; @@ -215,6 +216,7 @@ indicator_object_init (IndicatorObject *self) self->priv->entry.menu = NULL; self->priv->entry.label = NULL; self->priv->entry.image = NULL; + self->priv->entry.accessible_name = NULL; self->priv->gotten_entries = FALSE; @@ -395,6 +397,14 @@ get_entries_default (IndicatorObject * io) return NULL; } + if (class->get_accessible_name) { + priv->entry.accessible_name = class->get_accessible_name(io); + } + + if (priv->entry.accessible_name == NULL) { + g_warning("IndicatorObject class does not have an accessible name."); + } + priv->gotten_entries = TRUE; } -- cgit v1.2.3 From f59301296c4090175db9d771adde7e0d991dbdf4 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 8 Feb 2011 14:25:10 +1100 Subject: * accessible_name -> accessible_desc to better reflect the use of the content. * Add accessible-desc-update signal so that indicators can tell indicator-applet/unity that the accessible description has changed --- libindicator/indicator-object.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'libindicator/indicator-object.c') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 58952d7..73c1ca7 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -61,6 +61,7 @@ enum { SCROLL_ENTRY, MENU_SHOW, SHOW_NOW_CHANGED, + ACCESSIBLE_DESC_UPDATE, LAST_SIGNAL }; @@ -91,7 +92,7 @@ indicator_object_class_init (IndicatorObjectClass *klass) klass->get_label = NULL; klass->get_menu = NULL; klass->get_image = NULL; - klass->get_accessible_name = NULL; + klass->get_accessible_desc = NULL; klass->get_entries = get_entries_default; klass->get_location = NULL; @@ -222,6 +223,24 @@ indicator_object_class_init (IndicatorObjectClass *klass) _indicator_object_marshal_VOID__POINTER_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN); + /** + IndicatorObject::accessible-desc-update:: + @arg0: The #IndicatorObject object + @arg1: A pointer to the #IndicatorObjectEntry whos + accessible description has been updated. + + Signaled when an indicator's accessible description + has been updated, so that the displayer of the + indicator can fetch the new description. + */ + signals[ACCESSIBLE_DESC_UPDATE] = g_signal_new (INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicatorObjectClass, accessible_desc_update), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER, G_TYPE_NONE); + return; } @@ -237,7 +256,7 @@ indicator_object_init (IndicatorObject *self) self->priv->entry.menu = NULL; self->priv->entry.label = NULL; self->priv->entry.image = NULL; - self->priv->entry.accessible_name = NULL; + self->priv->entry.accessible_desc = NULL; self->priv->gotten_entries = FALSE; @@ -418,12 +437,12 @@ get_entries_default (IndicatorObject * io) return NULL; } - if (class->get_accessible_name) { - priv->entry.accessible_name = class->get_accessible_name(io); + if (class->get_accessible_desc) { + priv->entry.accessible_desc = class->get_accessible_desc(io); } - if (priv->entry.accessible_name == NULL) { - g_warning("IndicatorObject class does not have an accessible name."); + if (priv->entry.accessible_desc == NULL) { + g_warning("IndicatorObject class does not have an accessible description."); } priv->gotten_entries = TRUE; -- cgit v1.2.3