diff options
-rw-r--r-- | gtk/a11y/Makefile.am | 4 | ||||
-rw-r--r-- | gtk/a11y/gail.c | 3 | ||||
-rw-r--r-- | gtk/a11y/gailbutton.c | 1397 | ||||
-rw-r--r-- | gtk/a11y/gailbutton.h | 61 | ||||
-rw-r--r-- | gtk/a11y/gtkbuttonaccessible.c | 466 | ||||
-rw-r--r-- | gtk/a11y/gtkbuttonaccessible.h | 52 | ||||
-rw-r--r-- | gtk/a11y/gtklinkbuttonaccessible.c | 2 | ||||
-rw-r--r-- | gtk/a11y/gtklinkbuttonaccessible.h | 6 | ||||
-rw-r--r-- | gtk/a11y/gtkscalebuttonaccessible.c | 2 | ||||
-rw-r--r-- | gtk/a11y/gtkscalebuttonaccessible.h | 6 | ||||
-rw-r--r-- | gtk/a11y/gtktogglebuttonaccessible.c | 2 | ||||
-rw-r--r-- | gtk/a11y/gtktogglebuttonaccessible.h | 6 | ||||
-rw-r--r-- | gtk/gtkbutton.c | 3 | ||||
-rw-r--r-- | tests/a11y/about.txt | 99 | ||||
-rw-r--r-- | tests/a11y/accessible-name.txt | 31 | ||||
-rw-r--r-- | tests/a11y/appchooser.txt | 179 | ||||
-rw-r--r-- | tests/a11y/assistant.txt | 260 | ||||
-rw-r--r-- | tests/a11y/buttons.txt | 124 | ||||
-rw-r--r-- | tests/a11y/colorchooser.txt | 107 | ||||
-rw-r--r-- | tests/a11y/hello-world.txt | 31 | ||||
-rw-r--r-- | tests/a11y/link.txt | 31 | ||||
-rw-r--r-- | tests/a11y/lockbutton.txt | 85 | ||||
-rw-r--r-- | tests/a11y/notebook.txt | 62 | ||||
-rw-r--r-- | tests/a11y/pickers.txt | 163 | ||||
-rw-r--r-- | tests/a11y/tree.txt | 132 |
25 files changed, 594 insertions, 2720 deletions
diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am index 922c077fcb..bd3e3da86d 100644 --- a/gtk/a11y/Makefile.am +++ b/gtk/a11y/Makefile.am @@ -7,7 +7,7 @@ gail_c_sources = \ gtkarrowaccessible.c \ gailbooleancell.c \ gtkboxaccessible.c \ - gailbutton.c \ + gtkbuttonaccessible.c \ gailcell.c \ gailcellparent.c \ gtkcheckmenuitemaccessible.c \ @@ -58,7 +58,7 @@ gail_private_h_sources = \ gtkarrowaccessible.h \ gailbooleancell.h \ gtkboxaccessible.h \ - gailbutton.h \ + gtkbuttonaccessible.h \ gailcell.h \ gailcellparent.h \ gtkcheckmenuitemaccessible.h \ diff --git a/gtk/a11y/gail.c b/gtk/a11y/gail.c index cb8cfc4d80..60d9088d6d 100644 --- a/gtk/a11y/gail.c +++ b/gtk/a11y/gail.c @@ -24,7 +24,6 @@ #include <gtk/gtkx.h> #include "gailbooleancell.h" -#include "gailbutton.h" #include "gailcell.h" #include "gailcontainer.h" #include "gailcontainercell.h" @@ -84,7 +83,6 @@ static GQuark quark_focus_object = 0; GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU, GailMenu, gail_menu, GTK_TYPE_MENU) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN) @@ -834,7 +832,6 @@ gail_accessibility_module_init (void) GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WIDGET, gail_widget); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CONTAINER, gail_container); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BUTTON, gail_button); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU_BAR, gail_menu_shell); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU, gail_menu); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WINDOW, gail_window); diff --git a/gtk/a11y/gailbutton.c b/gtk/a11y/gailbutton.c deleted file mode 100644 index 3ee8cebcc3..0000000000 --- a/gtk/a11y/gailbutton.c +++ /dev/null @@ -1,1397 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001, 2002, 2003 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include <string.h> -#include <gtk/gtk.h> -#include "gailbutton.h" -#include <libgail-util/gailmisc.h> - -#define GAIL_BUTTON_ATTACHED_MENUS "gtk-attached-menus" - -static void gail_button_class_init (GailButtonClass *klass); -static void gail_button_init (GailButton *button); - -static const gchar* gail_button_get_name (AtkObject *obj); -static gint gail_button_get_n_children (AtkObject *obj); -static AtkObject* gail_button_ref_child (AtkObject *obj, - gint i); -static AtkStateSet* gail_button_ref_state_set (AtkObject *obj); -static void gail_button_notify_label_gtk (GObject *obj, - GParamSpec *pspec, - gpointer data); -static void gail_button_label_map_gtk (GtkWidget *widget, - gpointer data); - -static void gail_button_real_initialize (AtkObject *obj, - gpointer data); -static void gail_button_finalize (GObject *object); -static void gail_button_init_textutil (GailButton *button, - GtkWidget *label); - -static void gail_button_pressed_enter_handler (GtkWidget *widget); -static void gail_button_released_leave_handler (GtkWidget *widget); -static gint gail_button_real_add_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data); - - -static void atk_action_interface_init (AtkActionIface *iface); -static gboolean gail_button_do_action (AtkAction *action, - gint i); -static gint gail_button_get_n_actions (AtkAction *action); -static const gchar* gail_button_get_keybinding (AtkAction *action, - gint i); -static const gchar* gail_button_action_get_name(AtkAction *action, - gint i); -static void gail_button_notify_label_weak_ref (gpointer data, - GObject *obj); -static void gail_button_notify_weak_ref (gpointer data, - GObject *obj); - - -/* AtkImage.h */ -static void atk_image_interface_init (AtkImageIface *iface); -static const gchar* gail_button_get_image_description - (AtkImage *image); -static void gail_button_get_image_position - (AtkImage *image, - gint *x, - gint *y, - AtkCoordType coord_type); -static void gail_button_get_image_size (AtkImage *image, - gint *width, - gint *height); -static gboolean gail_button_set_image_description - (AtkImage *image, - const gchar *description); - -/* atktext.h */ -static void atk_text_interface_init (AtkTextIface *iface); - -static gchar* gail_button_get_text (AtkText *text, - gint start_pos, - gint end_pos); -static gunichar gail_button_get_character_at_offset(AtkText *text, - gint offset); -static gchar* gail_button_get_text_before_offset(AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset); -static gchar* gail_button_get_text_at_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset); -static gchar* gail_button_get_text_after_offset(AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset); -static gint gail_button_get_character_count (AtkText *text); -static void gail_button_get_character_extents (AtkText *text, - gint offset, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coords); -static gint gail_button_get_offset_at_point (AtkText *text, - gint x, - gint y, - AtkCoordType coords); -static AtkAttributeSet* gail_button_get_run_attributes - (AtkText *text, - gint offset, - gint *start_offset, - gint *end_offset); -static AtkAttributeSet* gail_button_get_default_attributes - (AtkText *text); -static GtkImage* get_image_from_button (GtkWidget *button); -static GtkWidget* get_label_from_button (GtkWidget *button, - gint index, - gboolean allow_many); -static gint get_n_labels_from_button (GtkWidget *button); -static void set_role_for_button (AtkObject *accessible, - GtkWidget *button); - -static gint get_n_attached_menus (GtkWidget *widget); -static GtkWidget* get_nth_attached_menu (GtkWidget *widget, - gint index); - -G_DEFINE_TYPE_WITH_CODE (GailButton, gail_button, GAIL_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)) - -static void -gail_button_class_init (GailButtonClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - GailContainerClass *container_class; - - container_class = (GailContainerClass*)klass; - - gobject_class->finalize = gail_button_finalize; - - class->get_name = gail_button_get_name; - class->get_n_children = gail_button_get_n_children; - class->ref_child = gail_button_ref_child; - class->ref_state_set = gail_button_ref_state_set; - class->initialize = gail_button_real_initialize; - - container_class->add_gtk = gail_button_real_add_gtk; - container_class->remove_gtk = NULL; -} - -static void -gail_button_init (GailButton *button) -{ - button->click_keybinding = NULL; - button->textutil = NULL; -} - -static const gchar* -gail_button_get_name (AtkObject *obj) -{ - const gchar* name = NULL; - - g_return_val_if_fail (GAIL_IS_BUTTON (obj), NULL); - - name = ATK_OBJECT_CLASS (gail_button_parent_class)->get_name (obj); - if (name == NULL) - { - /* - * Get the text on the label - */ - GtkWidget *widget; - GtkWidget *child; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL); - - child = get_label_from_button (widget, 0, FALSE); - if (GTK_IS_LABEL (child)) - name = gtk_label_get_text (GTK_LABEL (child)); - else - { - GtkImage *image; - - image = get_image_from_button (widget); - if (GTK_IS_IMAGE (image)) - { - AtkObject *atk_obj; - - atk_obj = gtk_widget_get_accessible (GTK_WIDGET (image)); - name = atk_object_get_name (atk_obj); - } - } - } - return name; -} - -static void -gail_button_real_initialize (AtkObject *obj, - gpointer data) -{ - GailButton *button = GAIL_BUTTON (obj); - GtkWidget *label; - GtkWidget *widget; - - ATK_OBJECT_CLASS (gail_button_parent_class)->initialize (obj, data); - - button->state = GTK_STATE_NORMAL; - - g_signal_connect (data, - "pressed", - G_CALLBACK (gail_button_pressed_enter_handler), - NULL); - g_signal_connect (data, - "enter", - G_CALLBACK (gail_button_pressed_enter_handler), - NULL); - g_signal_connect (data, - "released", - G_CALLBACK (gail_button_released_leave_handler), - NULL); - g_signal_connect (data, - "leave", - G_CALLBACK (gail_button_released_leave_handler), - NULL); - - - widget = GTK_WIDGET (data); - label = get_label_from_button (widget, 0, FALSE); - if (GTK_IS_LABEL (label)) - { - if (gtk_widget_get_mapped (label)) - gail_button_init_textutil (button, label); - else - g_signal_connect (label, - "map", - G_CALLBACK (gail_button_label_map_gtk), - button); - } - - set_role_for_button (obj, data); -} - -static void -gail_button_label_map_gtk (GtkWidget *widget, - gpointer data) -{ - GailButton *button; - - button = GAIL_BUTTON (data); - gail_button_init_textutil (button, widget); -} - -static void -gail_button_notify_label_gtk (GObject *obj, - GParamSpec *pspec, - gpointer data) -{ - AtkObject* atk_obj = ATK_OBJECT (data); - GtkLabel *label; - GailButton *gail_button; - - if (strcmp (pspec->name, "label") == 0) - { - const gchar* label_text; - - label = GTK_LABEL (obj); - - label_text = gtk_label_get_text (label); - - gail_button = GAIL_BUTTON (atk_obj); - gail_text_util_text_setup (gail_button->textutil, label_text); - - if (atk_obj->name == NULL) - { - /* - * The label has changed so notify a change in accessible-name - */ - g_object_notify (G_OBJECT (atk_obj), "accessible-name"); - } - /* - * The label is the only property which can be changed - */ - g_signal_emit_by_name (atk_obj, "visible_data_changed"); - } -} - -static void -gail_button_notify_weak_ref (gpointer data, GObject* obj) -{ - GtkLabel *label = NULL; - - AtkObject* atk_obj = ATK_OBJECT (obj); - if (data && GTK_IS_WIDGET (data)) - { - label = GTK_LABEL (data); - if (label) - { - g_signal_handlers_disconnect_by_func (label, - (GCallback) gail_button_notify_label_gtk, - GAIL_BUTTON (atk_obj)); - g_object_weak_unref (G_OBJECT (label), - gail_button_notify_label_weak_ref, - GAIL_BUTTON (atk_obj)); - } - } -} - -static void -gail_button_notify_label_weak_ref (gpointer data, GObject* obj) -{ - GtkLabel *label = NULL; - GailButton *button = NULL; - - label = GTK_LABEL (obj); - if (data && GAIL_IS_BUTTON (data)) - { - button = GAIL_BUTTON (ATK_OBJECT (data)); - if (button) - g_object_weak_unref (G_OBJECT (button), gail_button_notify_weak_ref, - label); - } -} - - -static void -gail_button_init_textutil (GailButton *button, - GtkWidget *label) -{ - const gchar *label_text; - - if (button->textutil) - g_object_unref (button->textutil); - button->textutil = gail_text_util_new (); - label_text = gtk_label_get_text (GTK_LABEL (label)); - gail_text_util_text_setup (button->textutil, label_text); - g_object_weak_ref (G_OBJECT (button), - gail_button_notify_weak_ref, label); - g_object_weak_ref (G_OBJECT (label), - gail_button_notify_label_weak_ref, button); - g_signal_connect (label, - "notify", - (GCallback) gail_button_notify_label_gtk, - button); -} - -static gint -gail_button_real_add_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data) -{ - GtkLabel *label; - GailButton *button; - - if (GTK_IS_LABEL (widget)) - { - const gchar* label_text; - - label = GTK_LABEL (widget); - - - button = GAIL_BUTTON (data); - if (!button->textutil) - gail_button_init_textutil (button, widget); - else - { - label_text = gtk_label_get_text (label); - gail_text_util_text_setup (button->textutil, label_text); - } - } - - return 1; -} - -static void -atk_action_interface_init (AtkActionIface *iface) -{ - iface->do_action = gail_button_do_action; - iface->get_n_actions = gail_button_get_n_actions; - iface->get_keybinding = gail_button_get_keybinding; - iface->get_name = gail_button_action_get_name; -} - -static gboolean -gail_button_do_action (AtkAction *action, - gint i) -{ - GtkWidget *widget; - gboolean return_value = TRUE; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action)); - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget)) - return FALSE; - - switch (i) - { - case 0: - gtk_button_clicked (GTK_BUTTON (widget)); - break; - default: - return_value = FALSE; - break; - } - return return_value; -} - -static gint -gail_button_get_n_actions (AtkAction *action) -{ - return 1; -} - -static const gchar* -gail_button_get_keybinding (AtkAction *action, - gint i) -{ - GailButton *button; - gchar *return_value = NULL; - - button = GAIL_BUTTON (action); - switch (i) - { - case 0: - { - /* - * We look for a mnemonic on the label - */ - GtkWidget *widget; - GtkWidget *label; - guint key_val; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (button)); - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL); - - label = get_label_from_button (widget, 0, FALSE); - if (GTK_IS_LABEL (label)) - { - key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); - if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); - } - if (return_value == NULL) - { - /* Find labelled-by relation */ - AtkRelationSet *set; - AtkRelation *relation; - GPtrArray *target; - gpointer target_object; - - set = atk_object_ref_relation_set (ATK_OBJECT (action)); - if (set) - { - relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY); - if (relation) - { - target = atk_relation_get_target (relation); - - target_object = g_ptr_array_index (target, 0); - label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object)); - } - g_object_unref (set); - } - - if (GTK_IS_LABEL (label)) - { - key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); - if (key_val != GDK_KEY_VoidSymbol) - return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); - } - } - g_free (button->click_keybinding); - button->click_keybinding = return_value; - break; - } - default: - break; - } - return return_value; -} - -static const gchar* -gail_button_action_get_name (AtkAction *action, - gint i) -{ - const gchar *return_value; - - switch (i) - { - case 0: - /* - * This action is a "click" to activate a button or "toggle" to change - * the state of a toggle button check box or radio button. - */ - return_value = "click"; - break; - default: - return_value = NULL; - break; - } - return return_value; -} - -static gint -gail_button_get_n_children (AtkObject* obj) -{ - GtkWidget *widget; - gint n_children; - - g_return_val_if_fail (GAIL_IS_BUTTON (obj), 0); - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - /* - * Check whether we have an attached menus for PanelMenuButton - */ - n_children = get_n_attached_menus (widget); - if (n_children > 0) - return n_children; - - n_children = get_n_labels_from_button (widget); - if (n_children <= 1) - n_children = 0; - - return n_children; -} - -static AtkObject* -gail_button_ref_child (AtkObject *obj, - gint i) -{ - GtkWidget *widget; - GtkWidget *child_widget; - AtkObject *child; - - g_return_val_if_fail (GAIL_IS_BUTTON (obj), NULL); - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - if (i >= gail_button_get_n_children (obj)) - return NULL; - - if (get_n_attached_menus (widget) > 0) - { - child_widget = get_nth_attached_menu (widget, i); - } - else - child_widget = NULL; - - if (!child_widget) - { - if (get_n_labels_from_button (widget) > 1) - { - child_widget = get_label_from_button (widget, i, TRUE); - } - } - - if (child_widget) - { - child = gtk_widget_get_accessible (child_widget); - g_object_ref (child); - } - else - child = NULL; - - return child; -} - -static AtkStateSet* -gail_button_ref_state_set (AtkObject *obj) -{ - AtkStateSet *state_set; - GtkWidget *widget; - - state_set = ATK_OBJECT_CLASS (gail_button_parent_class)->ref_state_set (obj); - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); - - if (widget == NULL) - return state_set; - - if (gtk_widget_get_state (widget) == GTK_STATE_ACTIVE) - atk_state_set_add_state (state_set, ATK_STATE_ARMED); - - if (!gtk_widget_get_can_focus (widget)) - atk_state_set_remove_state (state_set, ATK_STATE_SELECTABLE); - - - return state_set; -} - -/* - * This is the signal handler for the "pressed" or "enter" signal handler - * on the GtkButton. - * - * If the state is now GTK_STATE_ACTIVE we notify a property change - */ -static void -gail_button_pressed_enter_handler (GtkWidget *widget) -{ - AtkObject *accessible; - - if (gtk_widget_get_state (widget) == GTK_STATE_ACTIVE) - { - accessible = gtk_widget_get_accessible (widget); - atk_object_notify_state_change (accessible, ATK_STATE_ARMED, TRUE); - GAIL_BUTTON (accessible)->state = GTK_STATE_ACTIVE; - } -} - -/* - * This is the signal handler for the "released" or "leave" signal handler - * on the GtkButton. - * - * If the state was GTK_STATE_ACTIVE we notify a property change - */ -static void -gail_button_released_leave_handler (GtkWidget *widget) -{ - AtkObject *accessible; - - accessible = gtk_widget_get_accessible (widget); - if (GAIL_BUTTON (accessible)->state == GTK_STATE_ACTIVE) - { - atk_object_notify_state_change (accessible, ATK_STATE_ARMED, FALSE); - GAIL_BUTTON (accessible)->state = GTK_STATE_NORMAL; - } -} - -static void -atk_image_interface_init (AtkImageIface *iface) -{ - iface->get_image_description = gail_button_get_image_description; - iface->get_image_position = gail_button_get_image_position; - iface->get_image_size = gail_button_get_image_size; - iface->set_image_description = gail_button_set_image_description; -} - -static GtkImage* -get_image_from_button (GtkWidget *button) -{ - GtkWidget *child; - GList *list; - GtkImage *image = NULL; - - child = gtk_bin_get_child (GTK_BIN (button)); - if (GTK_IS_IMAGE (child)) - image = GTK_IMAGE (child); - else - { - if (GTK_IS_ALIGNMENT (child)) - child = gtk_bin_get_child (GTK_BIN (child)); - if (GTK_IS_CONTAINER (child)) - { - list = gtk_container_get_children (GTK_CONTAINER (child)); - if (!list) - return NULL; - if (GTK_IS_IMAGE (list->data)) - image = GTK_IMAGE (list->data); - g_list_free (list); - } - } - - return image; -} - -static const gchar* -gail_button_get_image_description (AtkImage *image) { - - GtkWidget *widget; - GtkImage *button_image; - AtkObject *obj; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - button_image = get_image_from_button (widget); - - if (button_image != NULL) - { - obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); - return atk_image_get_image_description (ATK_IMAGE (obj)); - } - else - return NULL; -} - -static void -gail_button_get_image_position (AtkImage *image, - gint *x, - gint *y, - AtkCoordType coord_type) -{ - GtkWidget *widget; - GtkImage *button_image; - AtkObject *obj; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); - - if (widget == NULL) - { - /* - * State is defunct - */ - *x = G_MININT; - *y = G_MININT; - return; - } - - button_image = get_image_from_button (widget); - - if (button_image != NULL) - { - obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); - atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type); - } - else - { - *x = G_MININT; - *y = G_MININT; - } -} - -static void -gail_button_get_image_size (AtkImage *image, - gint *width, - gint *height) -{ - GtkWidget *widget; - GtkImage *button_image; - AtkObject *obj; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); - - if (widget == NULL) - { - /* - * State is defunct - */ - *width = -1; - *height = -1; - return; - } - - button_image = get_image_from_button (widget); - - if (button_image != NULL) - { - obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); - atk_image_get_image_size (ATK_IMAGE (obj), width, height); - } - else - { - *width = -1; - *height = -1; - } -} - -static gboolean -gail_button_set_image_description (AtkImage *image, - const gchar *description) -{ - GtkWidget *widget; - GtkImage *button_image; - AtkObject *obj; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); - - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - button_image = get_image_from_button (widget); - - if (button_image != NULL) - { - obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); - return atk_image_set_image_description (ATK_IMAGE (obj), description); - } - else - return FALSE; -} - -/* atktext.h */ - -static void -atk_text_interface_init (AtkTextIface *iface) -{ - iface->get_text = gail_button_get_text; - iface->get_character_at_offset = gail_button_get_character_at_offset; - iface->get_text_before_offset = gail_button_get_text_before_offset; - iface->get_text_at_offset = gail_button_get_text_at_offset; - iface->get_text_after_offset = gail_button_get_text_after_offset; - iface->get_character_count = gail_button_get_character_count; - iface->get_character_extents = gail_button_get_character_extents; - iface->get_offset_at_point = gail_button_get_offset_at_point; - iface->get_run_attributes = gail_button_get_run_attributes; - iface->get_default_attributes = gail_button_get_default_attributes; -} - -static gchar* -gail_button_get_text (AtkText *text, - gint start_pos, - gint end_pos) -{ - GtkWidget *widget; - GtkWidget *label; - GailButton *button; - const gchar *label_text; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return NULL; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL (label)) - return NULL; - - button = GAIL_BUTTON (text); - if (!button->textutil) - gail_button_init_textutil (button, label); - - label_text = gtk_label_get_text (GTK_LABEL (label)); - - if (label_text == NULL) - return NULL; - else - { - return gail_text_util_get_substring (button->textutil, - start_pos, end_pos); - } -} - -static gchar* -gail_button_get_text_before_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) -{ - GtkWidget *widget; - GtkWidget *label; - GailButton *button; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return NULL; - - /* Get label */ - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return NULL; - - button = GAIL_BUTTON (text); - if (!button->textutil) - gail_button_init_textutil (button, label); - - return gail_text_util_get_text (button->textutil, - gtk_label_get_layout (GTK_LABEL (label)), GAIL_BEFORE_OFFSET, - boundary_type, offset, start_offset, end_offset); -} - -static gchar* -gail_button_get_text_at_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) -{ - GtkWidget *widget; - GtkWidget *label; - GailButton *button; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return NULL; - - /* Get label */ - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return NULL; - - button = GAIL_BUTTON (text); - if (!button->textutil) - gail_button_init_textutil (button, label); - - return gail_text_util_get_text (button->textutil, - gtk_label_get_layout (GTK_LABEL (label)), GAIL_AT_OFFSET, - boundary_type, offset, start_offset, end_offset); -} - -static gchar* -gail_button_get_text_after_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) -{ - GtkWidget *widget; - GtkWidget *label; - GailButton *button; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - { - /* State is defunct */ - return NULL; - } - - /* Get label */ - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return NULL; - - button = GAIL_BUTTON (text); - if (!button->textutil) - gail_button_init_textutil (button, label); - - return gail_text_util_get_text (button->textutil, - gtk_label_get_layout (GTK_LABEL (label)), GAIL_AFTER_OFFSET, - boundary_type, offset, start_offset, end_offset); -} - -static gint -gail_button_get_character_count (AtkText *text) -{ - GtkWidget *widget; - GtkWidget *label; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return 0; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return 0; - - return g_utf8_strlen (gtk_label_get_text (GTK_LABEL (label)), -1); -} - -static void -gail_button_get_character_extents (AtkText *text, - gint offset, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coords) -{ - GtkWidget *widget; - GtkWidget *label; - PangoRectangle char_rect; - gint index, x_layout, y_layout; - const gchar *label_text; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return; - - gtk_label_get_layout_offsets (GTK_LABEL (label), &x_layout, &y_layout); - label_text = gtk_label_get_text (GTK_LABEL (label)); - index = g_utf8_offset_to_pointer (label_text, offset) - label_text; - pango_layout_index_to_pos (gtk_label_get_layout (GTK_LABEL (label)), index, &char_rect); - - gail_misc_get_extents_from_pango_rectangle (label, &char_rect, - x_layout, y_layout, x, y, width, height, coords); -} - -static gint -gail_button_get_offset_at_point (AtkText *text, - gint x, - gint y, - AtkCoordType coords) -{ - GtkWidget *widget; - GtkWidget *label; - gint index, x_layout, y_layout; - const gchar *label_text; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return -1; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return -1; - - gtk_label_get_layout_offsets (GTK_LABEL (label), &x_layout, &y_layout); - - index = gail_misc_get_index_at_point_in_layout (label, - gtk_label_get_layout (GTK_LABEL (label)), - x_layout, y_layout, x, y, coords); - label_text = gtk_label_get_text (GTK_LABEL (label)); - if (index == -1) - { - if (coords == ATK_XY_WINDOW || coords == ATK_XY_SCREEN) - return g_utf8_strlen (label_text, -1); - - return index; - } - else - return g_utf8_pointer_to_offset (label_text, label_text + index); -} - -static AtkAttributeSet* -gail_button_get_run_attributes (AtkText *text, - gint offset, - gint *start_offset, - gint *end_offset) -{ - GtkWidget *widget; - GtkWidget *label; - AtkAttributeSet *at_set = NULL; - GtkJustification justify; - GtkTextDirection dir; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return NULL; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return NULL; - - /* Get values set for entire label, if any */ - justify = gtk_label_get_justify (GTK_LABEL (label)); - if (justify != GTK_JUSTIFY_CENTER) - { - at_set = gail_misc_add_attribute (at_set, - ATK_TEXT_ATTR_JUSTIFICATION, - g_strdup (atk_text_attribute_get_value (ATK_TEXT_ATTR_JUSTIFICATION, justify))); - } - dir = gtk_widget_get_direction (label); - if (dir == GTK_TEXT_DIR_RTL) - { - at_set = gail_misc_add_attribute (at_set, - ATK_TEXT_ATTR_DIRECTION, - g_strdup (atk_text_attribute_get_value (ATK_TEXT_ATTR_DIRECTION, dir))); - } - - at_set = gail_misc_layout_get_run_attributes (at_set, - gtk_label_get_layout (GTK_LABEL (label)), - (gchar *) gtk_label_get_text (GTK_LABEL (label)), - offset, - start_offset, - end_offset); - return at_set; -} - -static AtkAttributeSet* -gail_button_get_default_attributes (AtkText *text) -{ - GtkWidget *widget; - GtkWidget *label; - AtkAttributeSet *at_set = NULL; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return NULL; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return NULL; - - at_set = gail_misc_get_default_attributes (at_set, - gtk_label_get_layout (GTK_LABEL (label)), - widget); - return at_set; -} - -static gunichar -gail_button_get_character_at_offset (AtkText *text, - gint offset) -{ - GtkWidget *widget; - GtkWidget *label; - const gchar *string; - gchar *index; - - widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); - - if (widget == NULL) - /* State is defunct */ - return '\0'; - - label = get_label_from_button (widget, 0, FALSE); - - if (!GTK_IS_LABEL(label)) - return '\0'; - string = gtk_label_get_text (GTK_LABEL (label)); - if (offset >= g_utf8_strlen (string, -1)) - return '\0'; - index = g_utf8_offset_to_pointer (string, offset); - - return g_utf8_get_char (index); -} - -static void -gail_button_finalize (GObject *object) -{ - GailButton *button = GAIL_BUTTON (object); - - g_free (button->click_keybinding); - if (button->textutil) - { - g_object_unref (button->textutil); - } - G_OBJECT_CLASS (gail_button_parent_class)->finalize (object); -} - -static GtkWidget* -find_label_child (GtkContainer *container, - gint *index, - gboolean allow_many) -{ - GList *children, *tmp_list; - GtkWidget *child; - - children = gtk_container_get_children (container); - - child = NULL; - for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next) - { - if (GTK_IS_LABEL (tmp_list->data)) - { - if (!allow_many) - { - if (child) - { - child = NULL; - break; - } - child = GTK_WIDGET (tmp_list->data); - } - else - { - if (*index == 0) - { - child = GTK_WIDGET (tmp_list->data); - break; - } - (*index)--; - } - } - /* - * Label for button which are GtkTreeView column headers are in a - * GtkHBox in a GtkAlignment. - */ - else if (GTK_IS_ALIGNMENT (tmp_list->data)) - { - GtkWidget *widget; - - widget = gtk_bin_get_child (GTK_BIN (tmp_list->data)); - if (GTK_IS_LABEL (widget)) - { - if (!allow_many) - { - if (child) - { - child = NULL; - break; - } - child = widget; - } - else - { - if (*index == 0) - { - child = widget; - break; - } - (*index)--; - } - } - } - else if (GTK_IS_CONTAINER (tmp_list->data)) - { - child = find_label_child (GTK_CONTAINER (tmp_list->data), index, allow_many); - if (child) - break; - } - } - g_list_free (children); - return child; -} - -static GtkWidget* -get_label_from_button (GtkWidget *button, - gint index, - gboolean allow_many) -{ - GtkWidget *child; - - if (index > 0 && !allow_many) - g_warning ("Inconsistent values passed to get_label_from_button"); - - child = gtk_bin_get_child (GTK_BIN (button)); - if (GTK_IS_ALIGNMENT (child)) - child = gtk_bin_get_child (GTK_BIN (child)); - - if (GTK_IS_CONTAINER (child)) - child = find_label_child (GTK_CONTAINER (child), &index, allow_many); - else if (!GTK_IS_LABEL (child)) - child = NULL; - - return child; -} - -static void -count_labels (GtkContainer *container, - gint *n_labels) -{ - GList *children, *tmp_list; - - children = gtk_container_get_children (container); - - for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next) - { - if (GTK_IS_LABEL (tmp_list->data)) - { - (*n_labels)++; - } - /* - * Label for button which are GtkTreeView column headers are in a - * GtkHBox in a GtkAlignment. - */ - else if (GTK_IS_ALIGNMENT (tmp_list->data)) - { - GtkWidget *widget; - - widget = gtk_bin_get_child (GTK_BIN (tmp_list->data)); - if (GTK_IS_LABEL (widget)) - (*n_labels)++; - } - else if (GTK_IS_CONTAINER (tmp_list->data)) - { - count_labels (GTK_CONTAINER (tmp_list->data), n_labels); - } - } - g_list_free (children); -} - -static gint -get_n_labels_from_button (GtkWidget *button) -{ - GtkWidget *child; - gint n_labels; - - n_labels = 0; - - child = gtk_bin_get_child (GTK_BIN (button)); - if (GTK_IS_ALIGNMENT (child)) - child = gtk_bin_get_child (GTK_BIN (child)); - - if (GTK_IS_CONTAINER (child)) - count_labels (GTK_CONTAINER (child), &n_labels); - - return n_labels; -} - -static void -set_role_for_button (AtkObject *accessible, - GtkWidget *button) -{ - GtkWidget *parent; - AtkRole role; - - parent = gtk_widget_get_parent (button); - if (GTK_IS_TREE_VIEW (parent)) - { - role = ATK_ROLE_TABLE_COLUMN_HEADER; - /* - * Even though the accessible parent of the column header will - * be reported as the table because the parent widget of the - * GtkTreeViewColumn's button is the GtkTreeView we set - * the accessible parent for column header to be the table - * to ensure that atk_object_get_index_in_parent() returns - * the correct value; see gail_widget_get_index_in_parent(). - */ - atk_object_set_parent (accessible, gtk_widget_get_accessible (parent)); - } - else - role = ATK_ROLE_PUSH_BUTTON; - - accessible->role = role; -} - -static gint -get_n_attached_menus (GtkWidget *widget) -{ - GList *list_menus; - - if (widget == NULL) - return 0; - - list_menus = g_object_get_data (G_OBJECT (widget), GAIL_BUTTON_ATTACHED_MENUS); - if (list_menus == NULL) - return 0; - - return g_list_length (list_menus); -} - -static GtkWidget* -get_nth_attached_menu (GtkWidget *widget, - gint index) -{ - GtkWidget *attached_menu; - GList *list_menus; - - if (widget == NULL) - return NULL; - - list_menus = g_object_get_data (G_OBJECT (widget), GAIL_BUTTON_ATTACHED_MENUS); - if (list_menus == NULL || - index >= g_list_length (list_menus)) - return NULL; - - attached_menu = (GtkWidget *) g_list_nth_data (list_menus, index); - - return attached_menu; -} diff --git a/gtk/a11y/gailbutton.h b/gtk/a11y/gailbutton.h deleted file mode 100644 index 38b95e7017..0000000000 --- a/gtk/a11y/gailbutton.h +++ /dev/null @@ -1,61 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_BUTTON_H__ -#define __GAIL_BUTTON_H__ - -#include "gailcontainer.h" -#include "gailtextutil.h" - -G_BEGIN_DECLS - -#define GAIL_TYPE_BUTTON (gail_button_get_type ()) -#define GAIL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BUTTON, GailButton)) -#define GAIL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_BUTTON, GailButtonClass)) -#define GAIL_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BUTTON)) -#define GAIL_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BUTTON)) -#define GAIL_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BUTTON, GailButtonClass)) - -typedef struct _GailButton GailButton; -typedef struct _GailButtonClass GailButtonClass; - -struct _GailButton -{ - GailContainer parent; - - /* - * Cache the widget state so we know the previous state when it changed - */ - gint8 state; - - gchar *click_keybinding; - - GailTextUtil *textutil; -}; - -GType gail_button_get_type (void); - -struct _GailButtonClass -{ - GailContainerClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_BUTTON_H__ */ diff --git a/gtk/a11y/gtkbuttonaccessible.c b/gtk/a11y/gtkbuttonaccessible.c new file mode 100644 index 0000000000..64b6d251a3 --- /dev/null +++ b/gtk/a11y/gtkbuttonaccessible.c @@ -0,0 +1,466 @@ +/* GAIL - The GNOME Accessibility Implementation Library + * Copyright 2001, 2002, 2003 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include <string.h> +#include <gtk/gtk.h> +#include "gtkbuttonaccessible.h" +#include <libgail-util/gailmisc.h> + + +static void atk_action_interface_init (AtkActionIface *iface); +static void atk_image_interface_init (AtkImageIface *iface); + +G_DEFINE_TYPE_WITH_CODE (GtkButtonAccessible, gtk_button_accessible, GAIL_TYPE_CONTAINER, + G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) + G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init)) + +static void +state_changed_cb (GtkWidget *widget, GtkStateFlags previous_flags) +{ + AtkObject *accessible; + GtkStateFlags flags; + gboolean was_active; + gboolean active; + + flags = gtk_widget_get_state_flags (widget); + + was_active = (previous_flags & GTK_STATE_FLAG_ACTIVE) != 0; + active = (flags & GTK_STATE_FLAG_ACTIVE) != 0; + + accessible = gtk_widget_get_accessible (widget); + if (active && !was_active) + atk_object_notify_state_change (accessible, ATK_STATE_ARMED, TRUE); + else if (!active && was_active) + atk_object_notify_state_change (accessible, ATK_STATE_ARMED, FALSE); +} + +static void +gtk_button_accessible_initialize (AtkObject *obj, + gpointer data) +{ + GtkWidget *parent; + + ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->initialize (obj, data); + + g_signal_connect (data, "state-flags-changed", G_CALLBACK (state_changed_cb), NULL); + + parent = gtk_widget_get_parent (gtk_accessible_get_widget (GTK_ACCESSIBLE (obj))); + if (GTK_IS_TREE_VIEW (parent)) + { + /* Even though the accessible parent of the column header will + * be reported as the table because the parent widget of the + * GtkTreeViewColumn's button is the GtkTreeView we set + * the accessible parent for column header to be the table + * to ensure that atk_object_get_index_in_parent() returns + * the correct value; see gail_widget_get_index_in_parent(). + */ + atk_object_set_parent (obj, gtk_widget_get_accessible (parent)); + obj->role = ATK_ROLE_TABLE_COLUMN_HEADER; + } + else + obj->role = ATK_ROLE_PUSH_BUTTON; +} + +static GtkWidget * +get_image_from_button (GtkWidget *button) +{ + GtkWidget *image; + + image = gtk_button_get_image (GTK_BUTTON (button)); + if (GTK_IS_IMAGE (image)) + return image; + + return NULL; +} + +static GtkWidget * +find_label_child (GtkContainer *container) +{ + GList *children, *tmp_list; + GtkWidget *child; + + children = gtk_container_get_children (container); + + child = NULL; + for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next) + { + if (GTK_IS_LABEL (tmp_list->data)) + { + child = GTK_WIDGET (tmp_list->data); + break; + } + else if (GTK_IS_CONTAINER (tmp_list->data)) + { + child = find_label_child (GTK_CONTAINER (tmp_list->data)); + if (child) + break; + } + } + g_list_free (children); + return child; +} + +static GtkWidget * +get_label_from_button (GtkWidget *button) +{ + GtkWidget *child; + + child = gtk_bin_get_child (GTK_BIN (button)); + if (GTK_IS_ALIGNMENT (child)) + child = gtk_bin_get_child (GTK_BIN (child)); + + if (GTK_IS_CONTAINER (child)) + child = find_label_child (GTK_CONTAINER (child)); + else if (!GTK_IS_LABEL (child)) + child = NULL; + + return child; +} + +static const gchar * +gtk_button_accessible_get_name (AtkObject *obj) +{ + const gchar *name = NULL; + GtkWidget *widget; + GtkWidget *child; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); + if (widget == NULL) + return NULL; + + name = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->get_name (obj); + if (name != NULL) + return name; + + child = get_label_from_button (widget); + if (GTK_IS_LABEL (child)) + name = gtk_label_get_text (GTK_LABEL (child)); + else + { + GtkWidget *image; + + image = get_image_from_button (widget); + if (GTK_IS_IMAGE (image)) + { + AtkObject *atk_obj; + + atk_obj = gtk_widget_get_accessible (image); + name = atk_object_get_name (atk_obj); + } + } + + return name; +} + +static gint +gtk_button_accessible_get_n_children (AtkObject* obj) +{ + return 0; +} + +static AtkObject * +gtk_button_accessible_ref_child (AtkObject *obj, + gint i) +{ + return NULL; +} + +static AtkStateSet * +gtk_button_accessible_ref_state_set (AtkObject *obj) +{ + AtkStateSet *state_set; + GtkWidget *widget; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); + if (widget == NULL) + return NULL; + + state_set = ATK_OBJECT_CLASS (gtk_button_accessible_parent_class)->ref_state_set (obj); + + if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_ACTIVE) != 0) + atk_state_set_add_state (state_set, ATK_STATE_ARMED); + + if (!gtk_widget_get_can_focus (widget)) + atk_state_set_remove_state (state_set, ATK_STATE_SELECTABLE); + + return state_set; +} + +static void +gtk_button_accessible_notify_gtk (GObject *obj, + GParamSpec *pspec) +{ + GtkWidget *widget = GTK_WIDGET (obj); + AtkObject *atk_obj = gtk_widget_get_accessible (widget); + + if (strcmp (pspec->name, "label") == 0) + { + if (atk_obj->name == NULL) + g_object_notify (G_OBJECT (atk_obj), "accessible-name"); + + g_signal_emit_by_name (atk_obj, "visible_data_changed"); + } + else + GAIL_WIDGET_CLASS (gtk_button_accessible_parent_class)->notify_gtk (obj, pspec); +} + +static void +gtk_button_accessible_class_init (GtkButtonAccessibleClass *klass) +{ + AtkObjectClass *class = ATK_OBJECT_CLASS (klass); + GailContainerClass *container_class = (GailContainerClass*)klass; + GailWidgetClass *widget_class = (GailWidgetClass*)klass; + + class->get_name = gtk_button_accessible_get_name; + class->get_n_children = gtk_button_accessible_get_n_children; + class->ref_child = gtk_button_accessible_ref_child; + class->ref_state_set = gtk_button_accessible_ref_state_set; + class->initialize = gtk_button_accessible_initialize; + + widget_class->notify_gtk = gtk_button_accessible_notify_gtk; + + container_class->add_gtk = NULL; + container_class->remove_gtk = NULL; +} + +static void +gtk_button_accessible_init (GtkButtonAccessible *button) +{ +} + +static gboolean +gtk_button_accessible_do_action (AtkAction *action, + gint i) +{ + GtkWidget *widget; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action)); + if (widget == NULL) + return FALSE; + + if (i != 0) + return FALSE; + + if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget)) + return FALSE; + + gtk_button_clicked (GTK_BUTTON (widget)); + return TRUE; +} + +static gint +gtk_button_accessible_get_n_actions (AtkAction *action) +{ + return 1; +} + +static const gchar * +gtk_button_accessible_get_keybinding (AtkAction *action, + gint i) +{ + GtkButtonAccessible *button; + gchar *return_value = NULL; + GtkWidget *widget; + GtkWidget *label; + guint key_val; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action)); + if (widget == NULL) + return NULL; + + if (i != 0) + return NULL; + + button = GTK_BUTTON_ACCESSIBLE (action); + + label = get_label_from_button (widget); + if (GTK_IS_LABEL (label)) + { + key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); + if (key_val != GDK_KEY_VoidSymbol) + return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + } + if (return_value == NULL) + { + /* Find labelled-by relation */ + AtkRelationSet *set; + AtkRelation *relation; + GPtrArray *target; + gpointer target_object; + + set = atk_object_ref_relation_set (ATK_OBJECT (action)); + if (set) + { + relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY); + if (relation) + { + target = atk_relation_get_target (relation); + target_object = g_ptr_array_index (target, 0); + label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object)); + } + g_object_unref (set); + } + + if (GTK_IS_LABEL (label)) + { + key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); + if (key_val != GDK_KEY_VoidSymbol) + return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK); + } + } + return return_value; +} + +static const gchar * +gtk_button_accessible_action_get_name (AtkAction *action, + gint i) +{ + if (i != 0) + return NULL; + + return "click"; +} + +static void +atk_action_interface_init (AtkActionIface *iface) +{ + iface->do_action = gtk_button_accessible_do_action; + iface->get_n_actions = gtk_button_accessible_get_n_actions; + iface->get_keybinding = gtk_button_accessible_get_keybinding; + iface->get_name = gtk_button_accessible_action_get_name; +} + +static const gchar * +gtk_button_accessible_get_image_description (AtkImage *image) +{ + GtkWidget *widget; + GtkWidget *button_image; + AtkObject *obj; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); + if (widget == NULL) + return NULL; + + button_image = get_image_from_button (widget); + if (GTK_IS_IMAGE (button_image)) + { + obj = gtk_widget_get_accessible (button_image); + return atk_image_get_image_description (ATK_IMAGE (obj)); + } + + return NULL; +} + +static void +gtk_button_accessible_get_image_position (AtkImage *image, + gint *x, + gint *y, + AtkCoordType coord_type) +{ + GtkWidget *widget; + GtkImage *button_image; + AtkObject *obj; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); + if (widget == NULL) + { + *x = G_MININT; + *y = G_MININT; + return; + } + + button_image = get_image_from_button (widget); + + if (button_image != NULL) + { + obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); + atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type); + } + else + { + *x = G_MININT; + *y = G_MININT; + } +} + +static void +gtk_button_accessible_get_image_size (AtkImage *image, + gint *width, + gint *height) +{ + GtkWidget *widget; + GtkImage *button_image; + AtkObject *obj; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); + if (widget == NULL) + { + *width = -1; + *height = -1; + return; + } + + button_image = get_image_from_button (widget); + + if (button_image != NULL) + { + obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); + atk_image_get_image_size (ATK_IMAGE (obj), width, height); + } + else + { + *width = -1; + *height = -1; + } +} + +static gboolean +gtk_button_accessible_set_image_description (AtkImage *image, + const gchar *description) +{ + GtkWidget *widget; + GtkImage *button_image; + AtkObject *obj; + + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image)); + + if (widget == NULL) + return FALSE; + + button_image = get_image_from_button (widget); + + if (button_image != NULL) + { + obj = gtk_widget_get_accessible (GTK_WIDGET (button_image)); + return atk_image_set_image_description (ATK_IMAGE (obj), description); + } + + return FALSE; +} + +static void +atk_image_interface_init (AtkImageIface *iface) +{ + iface->get_image_description = gtk_button_accessible_get_image_description; + iface->get_image_position = gtk_button_accessible_get_image_position; + iface->get_image_size = gtk_button_accessible_get_image_size; + iface->set_image_description = gtk_button_accessible_set_image_description; +} diff --git a/gtk/a11y/gtkbuttonaccessible.h b/gtk/a11y/gtkbuttonaccessible.h new file mode 100644 index 0000000000..66986da94e --- /dev/null +++ b/gtk/a11y/gtkbuttonaccessible.h @@ -0,0 +1,52 @@ +/* GAIL - The GNOME Accessibility Implementation Library + * Copyright 2001 Sun Microsystems Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTK_BUTTON_ACCESSIBLE_H__ +#define __GTK_BUTTON_ACCESSIBLE_H__ + +#include "gailcontainer.h" +#include "gailtextutil.h" + +G_BEGIN_DECLS + +#define GTK_TYPE_BUTTON_ACCESSIBLE (gtk_button_accessible_get_type ()) +#define GTK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessible)) +#define GTK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass)) +#define GTK_IS_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON_ACCESSIBLE)) +#define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE)) +#define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass)) + +typedef struct _GtkButtonAccessible GtkButtonAccessible; +typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass; + +struct _GtkButtonAccessible +{ + GailContainer parent; +}; + +struct _GtkButtonAccessibleClass +{ + GailContainerClass parent_class; +}; + +GType gtk_button_accessible_get_type (void); + +G_END_DECLS + +#endif /* __GTK_BUTTON_ACCESSIBLE_H__ */ diff --git a/gtk/a11y/gtklinkbuttonaccessible.c b/gtk/a11y/gtklinkbuttonaccessible.c index fc2590cbfb..961b718af5 100644 --- a/gtk/a11y/gtklinkbuttonaccessible.c +++ b/gtk/a11y/gtklinkbuttonaccessible.c @@ -190,7 +190,7 @@ gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl) static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface); -G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GAIL_TYPE_BUTTON, +G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, atk_hypertext_impl_interface_init)) static void diff --git a/gtk/a11y/gtklinkbuttonaccessible.h b/gtk/a11y/gtklinkbuttonaccessible.h index ff944c726c..5f3693beb6 100644 --- a/gtk/a11y/gtklinkbuttonaccessible.h +++ b/gtk/a11y/gtklinkbuttonaccessible.h @@ -20,7 +20,7 @@ #ifndef __GTK_LINK_BUTTON_ACCESSIBLE_H__ #define __GTK_LINK_BUTTON_ACCESSIBLE_H__ -#include "gailbutton.h" +#include "gtkbuttonaccessible.h" G_BEGIN_DECLS @@ -36,14 +36,14 @@ typedef struct _GtkLinkButtonAccessibleClass GtkLinkButtonAccessibleClass; struct _GtkLinkButtonAccessible { - GailButton parent; + GtkButtonAccessible parent; AtkHyperlink *link; }; struct _GtkLinkButtonAccessibleClass { - GailButtonClass parent_class; + GtkButtonAccessibleClass parent_class; }; GType gtk_link_button_accessible_get_type (void); diff --git a/gtk/a11y/gtkscalebuttonaccessible.c b/gtk/a11y/gtkscalebuttonaccessible.c index 60592c3c25..c5e33e4198 100644 --- a/gtk/a11y/gtkscalebuttonaccessible.c +++ b/gtk/a11y/gtkscalebuttonaccessible.c @@ -28,7 +28,7 @@ static void atk_action_interface_init (AtkActionIface *iface); static void atk_value_interface_init (AtkValueIface *iface); -G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible, GAIL_TYPE_BUTTON, +G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init)); diff --git a/gtk/a11y/gtkscalebuttonaccessible.h b/gtk/a11y/gtkscalebuttonaccessible.h index 442c55a6b1..b1e854eda6 100644 --- a/gtk/a11y/gtkscalebuttonaccessible.h +++ b/gtk/a11y/gtkscalebuttonaccessible.h @@ -21,7 +21,7 @@ #define __GTK_SCALE_BUTTON_ACCESSIBLE_H__ #include <gtk/gtk.h> -#include "gailbutton.h" +#include "gtkbuttonaccessible.h" G_BEGIN_DECLS @@ -37,12 +37,12 @@ typedef struct _GtkScaleButtonAccessibleClass GtkScaleButtonAccessibleClass; struct _GtkScaleButtonAccessible { - GailButton parent; + GtkButtonAccessible parent; }; struct _GtkScaleButtonAccessibleClass { - GailButtonClass parent_class; + GtkButtonAccessibleClass parent_class; }; GType gtk_scale_button_accessible_get_type (void); diff --git a/gtk/a11y/gtktogglebuttonaccessible.c b/gtk/a11y/gtktogglebuttonaccessible.c index 04322f6932..b742a96d8a 100644 --- a/gtk/a11y/gtktogglebuttonaccessible.c +++ b/gtk/a11y/gtktogglebuttonaccessible.c @@ -24,7 +24,7 @@ #include "gtktogglebuttonaccessible.h" -G_DEFINE_TYPE (GtkToggleButtonAccessible, gtk_toggle_button_accessible, GAIL_TYPE_BUTTON) +G_DEFINE_TYPE (GtkToggleButtonAccessible, gtk_toggle_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE) static void gtk_toggle_button_accessible_toggled (GtkWidget *widget) diff --git a/gtk/a11y/gtktogglebuttonaccessible.h b/gtk/a11y/gtktogglebuttonaccessible.h index 0159cfc562..dea92d3893 100644 --- a/gtk/a11y/gtktogglebuttonaccessible.h +++ b/gtk/a11y/gtktogglebuttonaccessible.h @@ -20,7 +20,7 @@ #ifndef __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__ #define __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__ -#include "gailbutton.h" +#include "gtkbuttonaccessible.h" G_BEGIN_DECLS @@ -36,12 +36,12 @@ typedef struct _GtkToggleButtonAccessibleClass GtkToggleButtonAccessibleClass; struct _GtkToggleButtonAccessible { - GailButton parent; + GtkButtonAccessible parent; }; struct _GtkToggleButtonAccessibleClass { - GailButtonClass parent_class; + GtkButtonAccessibleClass parent_class; }; GType gtk_toggle_button_accessible_get_type (void); diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 3072635094..6b967846fb 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -58,6 +58,7 @@ #include "gtktypebuiltins.h" #include "gtkprivate.h" #include "gtkintl.h" +#include "a11y/gtkbuttonaccessible.h" static const GtkBorder default_default_border = { 1, 1, 1, 1 }; @@ -528,6 +529,8 @@ gtk_button_class_init (GtkButtonClass *klass) GTK_PARAM_READABLE)); g_type_class_add_private (gobject_class, sizeof (GtkButtonPrivate)); + + gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_BUTTON_ACCESSIBLE); } static void diff --git a/tests/a11y/about.txt b/tests/a11y/about.txt index c2c0fed15d..69735d9ee5 100644 --- a/tests/a11y/about.txt +++ b/tests/a11y/about.txt @@ -316,7 +316,7 @@ window1 <AtkComponent> layer: widget alpha: 1 - License + unnamed-GtkToggleButtonAccessible-8 "toggle button" parent: unnamed-GtkBoxAccessible-7 index: 0 @@ -326,44 +326,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: License - character count: 7 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>l - Credits + unnamed-GtkToggleButtonAccessible-9 "toggle button" parent: unnamed-GtkBoxAccessible-7 index: 1 @@ -373,44 +342,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Credits - character count: 7 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>r - Close + unnamed-GtkButtonAccessible-10 "push button" parent: unnamed-GtkBoxAccessible-7 index: 2 @@ -420,37 +358,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Close - character count: 5 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) diff --git a/tests/a11y/accessible-name.txt b/tests/a11y/accessible-name.txt index 43356e77ab..004c07590f 100644 --- a/tests/a11y/accessible-name.txt +++ b/tests/a11y/accessible-name.txt @@ -16,37 +16,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) diff --git a/tests/a11y/appchooser.txt b/tests/a11y/appchooser.txt index c27d4161f2..51e091cadb 100644 --- a/tests/a11y/appchooser.txt +++ b/tests/a11y/appchooser.txt @@ -106,7 +106,7 @@ window1 columns: 1 column 0 description: <column 0 header> - + unnamed-GtkButtonAccessible-6 "table column header" parent: unnamed-GtkTreeViewAccessible-5 index: 0 @@ -116,43 +116,12 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: - character count: 0 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - + unnamed-GtkButtonAccessible-6 "table column header" parent: unnamed-GtkTreeViewAccessible-5 index: 0 @@ -162,43 +131,12 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: - character count: 0 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - unnamed-GailContainerCell-6 + unnamed-GailContainerCell-7 "table cell" parent: unnamed-GtkTreeViewAccessible-5 index: 1 @@ -336,7 +274,7 @@ Click "Show other applications", for more options, or "Find applications online" <AtkAction> action 0 name: activate action 0 description: activate the cell - unnamed-GailImageCell-7 + unnamed-GailImageCell-8 "table cell" index: 3 state: enabled focusable focused selectable sensitive transient visible @@ -391,7 +329,7 @@ Click "Show other applications", for more options, or "Find applications online" <AtkAction> action 0 name: activate action 0 description: activate the cell - unnamed-GtkScrollbarAccessible-8 + unnamed-GtkScrollbarAccessible-9 "scroll bar" parent: unnamed-GtkScrolledWindowAccessible-4 index: 1 @@ -407,7 +345,7 @@ Click "Show other applications", for more options, or "Find applications online" maximum value: 0.000000 current value: 0.000000 minimum increment: 39.800000 - unnamed-GtkScrollbarAccessible-9 + unnamed-GtkScrollbarAccessible-10 "scroll bar" parent: unnamed-GtkScrolledWindowAccessible-4 index: 2 @@ -423,7 +361,7 @@ Click "Show other applications", for more options, or "Find applications online" maximum value: 0.000000 current value: 0.000000 minimum increment: 29.800000 - Show other applications + unnamed-GtkButtonAccessible-11 "push button" parent: unnamed-GtkBoxAccessible-3 index: 1 @@ -433,43 +371,12 @@ Click "Show other applications", for more options, or "Find applications online" <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Show other applications - character count: 23 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click - unnamed-GtkBoxAccessible-10 + unnamed-GtkBoxAccessible-12 "filler" parent: unnamed-GtkBoxAccessible-0 index: 1 @@ -478,9 +385,9 @@ Click "Show other applications", for more options, or "Find applications online" <AtkComponent> layer: widget alpha: 1 - Select + unnamed-GtkButtonAccessible-13 "push button" - parent: unnamed-GtkBoxAccessible-10 + parent: unnamed-GtkBoxAccessible-12 index: 0 name: Select state: enabled focusable sensitive showing visible default @@ -488,46 +395,15 @@ Click "Show other applications", for more options, or "Find applications online" <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Select - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>s - Cancel + unnamed-GtkButtonAccessible-14 "push button" - parent: unnamed-GtkBoxAccessible-10 + parent: unnamed-GtkBoxAccessible-12 index: 1 name: Cancel state: enabled focusable sensitive showing visible @@ -535,37 +411,6 @@ Click "Show other applications", for more options, or "Find applications online" <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Cancel - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) diff --git a/tests/a11y/assistant.txt b/tests/a11y/assistant.txt index ce8e074315..0a92cda657 100644 --- a/tests/a11y/assistant.txt +++ b/tests/a11y/assistant.txt @@ -15,37 +15,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Button 1 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -60,37 +29,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Button 2 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -105,7 +43,7 @@ window1 <AtkComponent> layer: widget alpha: 1 - Close + unnamed-GtkButtonAccessible-2 "push button" parent: unnamed-GtkBoxAccessible-0 index: 0 @@ -115,44 +53,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Close - character count: 5 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>c - Cancel + unnamed-GtkButtonAccessible-3 "push button" parent: unnamed-GtkBoxAccessible-0 index: 1 @@ -162,44 +69,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Cancel - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>c - Finish + unnamed-GtkButtonAccessible-4 "push button" parent: unnamed-GtkBoxAccessible-0 index: 2 @@ -209,44 +85,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Finish - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>f - Go Back + unnamed-GtkButtonAccessible-5 "push button" parent: unnamed-GtkBoxAccessible-0 index: 3 @@ -256,44 +101,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Go Back - character count: 7 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>b - Continue + unnamed-GtkButtonAccessible-6 "push button" parent: unnamed-GtkBoxAccessible-0 index: 4 @@ -303,44 +117,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Continue - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>o - Apply + unnamed-GtkButtonAccessible-7 "push button" parent: unnamed-GtkBoxAccessible-0 index: 5 @@ -350,37 +133,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Apply - character count: 5 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) diff --git a/tests/a11y/buttons.txt b/tests/a11y/buttons.txt index 0f58210c78..8a420ecba4 100644 --- a/tests/a11y/buttons.txt +++ b/tests/a11y/buttons.txt @@ -40,37 +40,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -88,37 +57,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -134,37 +72,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -180,37 +87,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) diff --git a/tests/a11y/colorchooser.txt b/tests/a11y/colorchooser.txt index f1f4428f4d..84c82abbd1 100644 --- a/tests/a11y/colorchooser.txt +++ b/tests/a11y/colorchooser.txt @@ -102,7 +102,7 @@ window1 <AtkComponent> layer: widget alpha: 1 - unnamed-GailButton-10 + unnamed-GtkButtonAccessible-10 "push button" parent: unnamed-GtkBoxAccessible-5 index: 1 @@ -112,12 +112,8 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: (null) - character count: 0 - caret offset: 0 <AtkImage> - image size: 20 x 20 + image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click @@ -1313,7 +1309,7 @@ window1 <AtkComponent> layer: widget alpha: 1 - Help + unnamed-GtkButtonAccessible-58 "push button" parent: unnamed-GtkBoxAccessible-57 index: 0 @@ -1323,44 +1319,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Help - character count: 4 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>h - OK + unnamed-GtkButtonAccessible-59 "push button" parent: unnamed-GtkBoxAccessible-57 index: 1 @@ -1370,44 +1335,13 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: OK - character count: 2 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) <AtkAction> action 0 name: click action 0 keybinding: <Alt>o - Cancel + unnamed-GtkButtonAccessible-60 "push button" parent: unnamed-GtkBoxAccessible-57 index: 2 @@ -1417,37 +1351,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Cancel - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) diff --git a/tests/a11y/hello-world.txt b/tests/a11y/hello-world.txt index feb415a4b5..f6ed440985 100644 --- a/tests/a11y/hello-world.txt +++ b/tests/a11y/hello-world.txt @@ -16,37 +16,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) diff --git a/tests/a11y/link.txt b/tests/a11y/link.txt index 3dd8a18436..10143fa01a 100644 --- a/tests/a11y/link.txt +++ b/tests/a11y/link.txt @@ -16,37 +16,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Hello World! - character count: 12 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) diff --git a/tests/a11y/lockbutton.txt b/tests/a11y/lockbutton.txt index 508c966336..b7763eb2da 100644 --- a/tests/a11y/lockbutton.txt +++ b/tests/a11y/lockbutton.txt @@ -10,6 +10,7 @@ window1 "push button" parent: window1 index: 0 + name: Lock description: Dialog is unlocked. Click to prevent further changes state: enabled focusable sensitive showing visible @@ -17,90 +18,8 @@ Click to prevent further changes <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: (null) - character count: 0 - caret offset: 0 <AtkImage> - image size: 16 x 16 + image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - Lock - "label" - parent: button1 - index: 0 - name: Lock - state: enabled multi-line sensitive showing visible - toolkit: gail - <AtkComponent> - layer: widget - alpha: 1 - <AtkText> - text: Lock - character count: 4 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word - Unlock - "label" - parent: button1 - index: 1 - name: Unlock - state: enabled multi-line sensitive - toolkit: gail - <AtkComponent> - layer: widget - alpha: 1 - <AtkText> - text: Unlock - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word diff --git a/tests/a11y/notebook.txt b/tests/a11y/notebook.txt index 6f5d744b0f..63877936f8 100644 --- a/tests/a11y/notebook.txt +++ b/tests/a11y/notebook.txt @@ -35,37 +35,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Yes - character count: 3 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) @@ -90,37 +59,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: No - character count: 2 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: 20 x 20 image description: (null) diff --git a/tests/a11y/pickers.txt b/tests/a11y/pickers.txt index e5e3ce053e..07e51ed18b 100644 --- a/tests/a11y/pickers.txt +++ b/tests/a11y/pickers.txt @@ -24,7 +24,7 @@ window1 <AtkComponent> layer: widget alpha: 1 - (None) + unnamed-GtkButtonAccessible-0 "push button" parent: button4 index: 0 @@ -34,43 +34,12 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: (None) - character count: 6 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - unnamed-GtkComboBoxAccessible-0 + unnamed-GtkComboBoxAccessible-1 "combo box" parent: button4 index: 1 @@ -82,9 +51,9 @@ window1 <AtkAction> action 0 name: press <AtkSelection> - unnamed-GailMenu-1 + unnamed-GailMenu-2 "menu" - parent: unnamed-GtkComboBoxAccessible-0 + parent: unnamed-GtkComboBoxAccessible-1 index: 0 state: enabled selectable sensitive toolkit: gail @@ -92,9 +61,9 @@ window1 layer: popup alpha: 1 <AtkSelection> - unnamed-GailMenuItem-2 + unnamed-GtkMenuItemAccessible-3 "menu item" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 0 state: enabled selectable sensitive visible toolkit: gail @@ -103,10 +72,11 @@ window1 alpha: 1 <AtkAction> action 0 name: click - unnamed-GailMenuItem-3 + unnamed-GtkMenuItemAccessible-4 "menu item" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 1 + name: File System state: enabled selectable sensitive visible toolkit: gail <AtkComponent> @@ -114,10 +84,11 @@ window1 alpha: 1 <AtkAction> action 0 name: click - unnamed-GailMenuItem-4 + unnamed-GtkMenuItemAccessible-5 "menu item" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 2 + name: _F15-Livecd-Desk state: enabled selectable sensitive visible toolkit: gail <AtkComponent> @@ -125,28 +96,33 @@ window1 alpha: 1 <AtkAction> action 0 name: click - unnamed-GtkSeparatorMenuItemAccessible-5 + unnamed-GtkMenuItemAccessible-6 "separator" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 3 state: enabled selectable sensitive visible toolkit: gail <AtkComponent> - layer: widget + layer: popup alpha: 1 - unnamed-GtkSeparatorMenuItemAccessible-6 + <AtkAction> + action 0 name: click + unnamed-GtkMenuItemAccessible-7 "separator" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 4 state: enabled selectable sensitive visible toolkit: gail <AtkComponent> - layer: widget + layer: popup alpha: 1 - unnamed-GailMenuItem-7 + <AtkAction> + action 0 name: click + unnamed-GtkMenuItemAccessible-8 "menu item" - parent: unnamed-GailMenu-1 + parent: unnamed-GailMenu-2 index: 5 + name: Other... state: enabled selectable sensitive visible toolkit: gail <AtkComponent> @@ -158,98 +134,17 @@ window1 "push button" parent: grid1 index: 1 + name: Sans state: enabled focusable sensitive showing visible toolkit: gail <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: (null) - character count: 0 - caret offset: 0 <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - Sans - "label" - parent: button3 - index: 0 - name: Sans - state: enabled multi-line sensitive showing visible - toolkit: gail - <AtkComponent> - layer: widget - alpha: 1 - <AtkText> - text: Sans - character count: 4 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word - 12 - "label" - parent: button3 - index: 1 - name: 12 - state: enabled multi-line sensitive showing visible - toolkit: gail - <AtkComponent> - layer: widget - alpha: 1 - <AtkText> - text: 12 - character count: 2 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word button2 "push button" parent: grid1 @@ -259,10 +154,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: (null) - character count: 0 - caret offset: 0 <AtkImage> image size: -1 x -1 image description: (null) @@ -280,7 +171,7 @@ window1 <AtkAction> action 0 name: press <AtkSelection> - unnamed-GailMenu-8 + unnamed-GailMenu-9 "menu" parent: button1 index: 0 diff --git a/tests/a11y/tree.txt b/tests/a11y/tree.txt index 564ddf72af..ead1ad477e 100644 --- a/tests/a11y/tree.txt +++ b/tests/a11y/tree.txt @@ -24,7 +24,7 @@ window1 selected rows: 0 column 0 description: Column 1 <column 0 header> - Column 1 + unnamed-GtkButtonAccessible-0 "table column header" parent: tree1 index: 0 @@ -34,37 +34,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Column 1 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) @@ -72,7 +41,7 @@ window1 action 0 name: click column 1 description: Column 2 <column 1 header> - Column 2 + unnamed-GtkButtonAccessible-1 "table column header" parent: tree1 index: 1 @@ -82,43 +51,12 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Column 2 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - Column 1 + unnamed-GtkButtonAccessible-0 "table column header" parent: tree1 index: 0 @@ -128,43 +66,12 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Column 1 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) <AtkAction> action 0 name: click - Column 2 + unnamed-GtkButtonAccessible-1 "table column header" parent: tree1 index: 1 @@ -174,37 +81,6 @@ window1 <AtkComponent> layer: widget alpha: 1 - <AtkText> - text: Column 2 - character count: 8 - caret offset: 0 - default attributes: bg-color: <omitted> - bg-full-height: 0 - bg-stipple: false - direction: <omitted> - editable: false - family-name: <omitted> - fg-color: <omitted> - fg-stipple: false - indent: 0 - invisible: false - justification: left - language: <omitted> - left-margin: 0 - pixels-above-lines: 0 - pixels-below-lines: 0 - pixels-inside-wrap: 0 - right-margin: 0 - rise: 0 - scale: 1 - size: <omitted> - stretch: <omitted> - strikethrough: false - style: <omitted> - underline: none - variant: <omitted> - weight: <omitted> - wrap-mode: word <AtkImage> image size: -1 x -1 image description: (null) |