[gnome-shell] Added StButtonAccessible
- From: Alejandro PiÃeiro Iglesias <apinheiro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Added StButtonAccessible
- Date: Mon, 1 Aug 2011 17:29:53 +0000 (UTC)
commit 4322a20cbecf1aa8e9aba0eafc3fecbbd71f3bd7
Author: Alejandro PiÃeiro <apinheiro igalia com>
Date: Mon May 23 21:35:28 2011 +0200
Added StButtonAccessible
Basic skeleton and the proper role (ATK_ROLE_PUSH_BUTTON)
src/st/st-button.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 76 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-button.c b/src/st/st-button.c
index 47647cf..67d7b55 100644
--- a/src/st/st-button.c
+++ b/src/st/st-button.c
@@ -45,6 +45,8 @@
#include "st-texture-cache.h"
#include "st-private.h"
+#include <st/st-widget-accessible.h>
+
enum
{
PROP_0,
@@ -84,6 +86,8 @@ static guint button_signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (StButton, st_button, ST_TYPE_BIN);
+static GType st_button_accessible_get_type (void) G_GNUC_CONST;
+
static void
st_button_update_label_style (StButton *button)
{
@@ -392,6 +396,7 @@ st_button_class_init (StButtonClass *klass)
actor_class->leave_event = st_button_leave;
widget_class->style_changed = st_button_style_changed;
+ widget_class->get_accessible_type = st_button_accessible_get_type;
pspec = g_param_spec_string ("label",
"Label",
@@ -686,3 +691,74 @@ st_button_fake_release (StButton *button)
clutter_ungrab_pointer ();
}
}
+
+/******************************************************************************/
+/*************************** ACCESSIBILITY SUPPORT ****************************/
+/******************************************************************************/
+
+#define ST_TYPE_BUTTON_ACCESSIBLE st_button_accessible_get_type ()
+
+#define ST_BUTTON_ACCESSIBLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ ST_TYPE_BUTTON_ACCESSIBLE, StButtonAccessible))
+
+#define ST_IS_BUTTON_ACCESSIBLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ ST_TYPE_BUTTON_ACCESSIBLE))
+
+#define ST_BUTTON_ACCESSIBLE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ ST_TYPE_BUTTON_ACCESSIBLE, StButtonAccessibleClass))
+
+#define ST_IS_BUTTON_ACCESSIBLE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ ST_TYPE_BUTTON_ACCESSIBLE))
+
+#define ST_BUTTON_ACCESSIBLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ ST_TYPE_BUTTON_ACCESSIBLE, StButtonAccessibleClass))
+
+typedef struct _StButtonAccessible StButtonAccessible;
+typedef struct _StButtonAccessibleClass StButtonAccessibleClass;
+
+struct _StButtonAccessible
+{
+ StWidgetAccessible parent;
+};
+
+struct _StButtonAccessibleClass
+{
+ StWidgetAccessibleClass parent_class;
+};
+
+static void st_button_accessible_class_init (StButtonAccessibleClass *klass);
+static void st_button_accessible_init (StButtonAccessible *button);
+
+/* AtkObject */
+static void st_button_accessible_initialize (AtkObject *obj,
+ gpointer data);
+
+G_DEFINE_TYPE (StButtonAccessible, st_button_accessible, ST_TYPE_WIDGET_ACCESSIBLE)
+
+static void
+st_button_accessible_class_init (StButtonAccessibleClass *klass)
+{
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
+
+ atk_class->initialize = st_button_accessible_initialize;
+}
+
+static void
+st_button_accessible_init (StButtonAccessible *self)
+{
+ /* initialization done on AtkObject->initialize */
+}
+
+static void
+st_button_accessible_initialize (AtkObject *obj,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (st_button_accessible_parent_class)->initialize (obj, data);
+
+ obj->role = ATK_ROLE_PUSH_BUTTON;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]