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 ++++++++++ libindicator/indicator-object.h | 5 +++++ 2 files changed, 15 insertions(+) (limited to 'libindicator') 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; } diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 9ad1366..a2736d3 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -73,6 +73,7 @@ typedef struct _IndicatorObjectEntry IndicatorObjectEntry; @get_menu: Gets the image for this object. Should be set to #NULL if @get_entries is set. Should NOT ref the object. + @get_accessible_name: Gets the accessible name for this object. @get_entries: Gets all of the entires for this object returning a #GList of #IndicatorObjectEntries. The list should be under the ownership of the caller but the entires will @@ -99,6 +100,7 @@ struct _IndicatorObjectClass { GtkLabel * (*get_label) (IndicatorObject * io); GtkImage * (*get_image) (IndicatorObject * io); GtkMenu * (*get_menu) (IndicatorObject * io); + gchar * (*get_accessible_name) (IndicatorObject * io); GList * (*get_entries) (IndicatorObject * io); guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry); @@ -140,11 +142,14 @@ struct _IndicatorObject { @label: The label to be shown on the panel @image: The image to be shown on the panel @menu: The menu to be added to the menubar + @accessible_name: The accessible name of the + indicator */ struct _IndicatorObjectEntry { GtkLabel * label; GtkImage * image; GtkMenu * menu; + gchar * accessible_name; }; GType indicator_object_get_type (void); -- cgit v1.2.3 From 855d3545376a037fc73712ac5879e4130783b3b1 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 1 Feb 2011 17:49:23 +1100 Subject: use const gchar for variable and prototype --- libindicator/indicator-object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index ea303f8..b79aef4 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -102,7 +102,7 @@ struct _IndicatorObjectClass { GtkLabel * (*get_label) (IndicatorObject * io); GtkImage * (*get_image) (IndicatorObject * io); GtkMenu * (*get_menu) (IndicatorObject * io); - gchar * (*get_accessible_name) (IndicatorObject * io); + const gchar * (*get_accessible_name) (IndicatorObject * io); GList * (*get_entries) (IndicatorObject * io); guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry); @@ -151,7 +151,7 @@ struct _IndicatorObjectEntry { GtkLabel * label; GtkImage * image; GtkMenu * menu; - gchar * accessible_name; + const gchar * accessible_name; }; GType indicator_object_get_type (void); -- 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 +++++++++++++++++++++++++------ libindicator/indicator-object.h | 15 ++++++++++----- 2 files changed, 35 insertions(+), 11 deletions(-) (limited to 'libindicator') 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; diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index b79aef4..4123119 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -57,6 +57,8 @@ typedef enum #define INDICATOR_OBJECT_SIGNAL_MENU_SHOW_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_MENU_SHOW, INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED "show-now-changed" #define INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED, INDICATOR_OBJECT_TYPE)) +#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE "accessible-desc-update" +#define INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID (g_signal_lookup(INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, INDICATOR_OBJECT_TYPE)) typedef struct _IndicatorObject IndicatorObject; typedef struct _IndicatorObjectClass IndicatorObjectClass; @@ -75,7 +77,8 @@ typedef struct _IndicatorObjectEntry IndicatorObjectEntry; @get_menu: Gets the image for this object. Should be set to #NULL if @get_entries is set. Should NOT ref the object. - @get_accessible_name: Gets the accessible name for this object. + @get_accessible_desc: Gets the accessible descriptionfor this + object. @get_entries: Gets all of the entires for this object returning a #GList of #IndicatorObjectEntries. The list should be under the ownership of the caller but the entires will @@ -94,6 +97,7 @@ typedef struct _IndicatorObjectEntry IndicatorObjectEntry; @entry_moved: Slot for #IndicatorObject::entry-moved @menu_show: Slot for #IndicatorObject::menu-show @show_now_changed: Slot for #IndicatorObject::show-now-changed + @accessible_desc_update: Slot for #IndicatorObject::accessible-desc-update */ struct _IndicatorObjectClass { GObjectClass parent_class; @@ -102,7 +106,7 @@ struct _IndicatorObjectClass { GtkLabel * (*get_label) (IndicatorObject * io); GtkImage * (*get_image) (IndicatorObject * io); GtkMenu * (*get_menu) (IndicatorObject * io); - const gchar * (*get_accessible_name) (IndicatorObject * io); + const gchar * (*get_accessible_desc) (IndicatorObject * io); GList * (*get_entries) (IndicatorObject * io); guint (*get_location) (IndicatorObject * io, IndicatorObjectEntry * entry); @@ -119,6 +123,7 @@ struct _IndicatorObjectClass { void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data); void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data); void (*scroll_entry) (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction); + void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data); /* Reserved */ void (*reserved1) (void); @@ -144,14 +149,14 @@ struct _IndicatorObject { @label: The label to be shown on the panel @image: The image to be shown on the panel @menu: The menu to be added to the menubar - @accessible_name: The accessible name of the - indicator + @accessible_desc: The accessible description + of the indicator */ struct _IndicatorObjectEntry { GtkLabel * label; GtkImage * image; GtkMenu * menu; - const gchar * accessible_name; + const gchar * accessible_desc; }; GType indicator_object_get_type (void); -- cgit v1.2.3 From 518f847f4488fedbbd7636b709e151b7ab78cb4d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 16 Feb 2011 15:40:14 -0600 Subject: Bumping the major version of the lib and the indicator directory --- libindicator/Makefile.am | 2 +- libindicator/indicator.pc.in | 2 +- libindicator/indicator3.pc.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libindicator') diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 47a902a..d63f841 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -51,7 +51,7 @@ libindicator_la_LIBADD = \ $(LIBINDICATOR_LIBS) libindicator_la_LDFLAGS = \ - -version-info 2:0:0 \ + -version-info 3:0:0 \ -no-undefined \ -export-symbols-regex "^[^_].*" diff --git a/libindicator/indicator.pc.in b/libindicator/indicator.pc.in index abc5590..4e9b177 100644 --- a/libindicator/indicator.pc.in +++ b/libindicator/indicator.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -indicatordir=${libdir}/indicators/4/ +indicatordir=${libdir}/indicators/5/ iconsdir=@datarootdir@/@PACKAGE@/icons/ Cflags: -I${includedir}/libindicator-0.3 diff --git a/libindicator/indicator3.pc.in b/libindicator/indicator3.pc.in index bb85db6..9fa0eac 100644 --- a/libindicator/indicator3.pc.in +++ b/libindicator/indicator3.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -indicatordir=${libdir}/indicators3/1/ +indicatordir=${libdir}/indicators3/2/ iconsdir=@datarootdir@/@PACKAGE@/icons/ Cflags: -I${includedir}/libindicator-0.3 -- cgit v1.2.3 From 0cfa5a8ad6ea8af5c1de78ecbe101da436e16eb8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 16 Feb 2011 15:44:07 -0600 Subject: Returning reserveds as we're breaking ABI anyway --- libindicator/indicator-object.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libindicator') diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 4123119..67a3bda 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -123,7 +123,7 @@ struct _IndicatorObjectClass { void (*menu_show) (IndicatorObject * io, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data); void (*show_now_changed) (IndicatorObject * io, IndicatorObjectEntry * entry, gboolean show_now_state, gpointer user_data); void (*scroll_entry) (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction); - void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data); + void (*accessible_desc_update) (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data); /* Reserved */ void (*reserved1) (void); @@ -131,6 +131,7 @@ struct _IndicatorObjectClass { void (*reserved3) (void); void (*reserved4) (void); void (*reserved5) (void); + void (*reserved6) (void); }; /** @@ -151,12 +152,22 @@ struct _IndicatorObject { @menu: The menu to be added to the menubar @accessible_desc: The accessible description of the indicator + + @reserved1: Reserved for future use + @reserved2: Reserved for future use + @reserved3: Reserved for future use + @reserved4: Reserved for future use */ struct _IndicatorObjectEntry { GtkLabel * label; GtkImage * image; GtkMenu * menu; const gchar * accessible_desc; + + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); }; GType indicator_object_get_type (void); -- cgit v1.2.3