Author: rpmcruz Date: Fri Dec 14 10:14:07 2007 New Revision: 43073 URL: http://svn.opensuse.org/viewcvs/yast?rev=43073&view=rev Log: Removed our custom accessibility stuff. Let's see if this works better for #346987. Modified: trunk/gtk/unstable/src/ygtkwizard.c Modified: trunk/gtk/unstable/src/ygtkwizard.c URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/ygtkwizard.c?rev... ============================================================================== --- trunk/gtk/unstable/src/ygtkwizard.c (original) +++ trunk/gtk/unstable/src/ygtkwizard.c Fri Dec 14 10:14:07 2007 @@ -1087,150 +1087,6 @@ (*callback) (containee, callback_data); } -/* Accessibility support */ - -static gint ygtk_wizard_accessible_get_n_children (AtkObject *accessible) -{ - return 1 /* content*/ + 5 /* buttons*/; -} - -static AtkObject *ygtk_wizard_accessible_ref_child (AtkObject *accessible, - gint index) -{ - GtkWidget *widget = GTK_ACCESSIBLE (accessible)->widget; - if (!widget) - return NULL; - YGtkWizard *wizard = YGTK_WIZARD (widget); - - if (index == 0) { - GtkWidget *child = GTK_BIN (wizard)->child; - if (child) - return g_object_ref (G_OBJECT (child)); - return NULL; - } - - if (index >= 1 && index <= 5) { - GtkWidget *buttons[5] = { wizard->m_back_button, wizard->m_abort_button, - wizard->m_next_button, wizard->m_help_button, - wizard->m_release_notes_button }; - GtkWidget *button = buttons [index-1]; - - if (GTK_WIDGET_VISIBLE (button)) - return g_object_ref (G_OBJECT (button)); - return NULL; - } - // out of range - return NULL; -} - -static void ygtk_wizard_accessible_class_init (AtkObjectClass *class) -{ - class->get_n_children = ygtk_wizard_accessible_get_n_children; - class->ref_child = ygtk_wizard_accessible_ref_child; -} - -static GType ygtk_wizard_accessible_get_type (void) -{ - static GType type = 0; - if (!type) { - AtkObjectFactory *factory; - GType derived_type; - GTypeQuery query; - GType derived_atk_type; - - derived_type = g_type_parent (YGTK_TYPE_WIZARD); - factory = atk_registry_get_factory (atk_get_default_registry (), derived_type); - derived_atk_type = atk_object_factory_get_accessible_type (factory); - g_type_query (derived_atk_type, &query); - - GTypeInfo type_info = { 0 }; - type_info.class_size = query.class_size; - type_info.class_init = (GClassInitFunc) ygtk_wizard_accessible_class_init; - type_info.instance_size = query.instance_size; - - type = g_type_register_static (derived_atk_type, "YGtkWizardAccessible", - &type_info, 0); - -/* - type = g_type_register_static_simple (derived_atk_type, - "YGtkWizardAccessible", query.class_size, - (GClassInitFunc) ygtk_wizard_accessible_class_init, - query.instance_size, NULL, 0); -*/ - } - return type; -} - -static AtkObject *ygtk_wizard_accessible_new (GObject *obj) -{ - AtkObject *accessible; - g_return_val_if_fail (YGTK_IS_WIZARD (obj), NULL); - - accessible = g_object_new (ygtk_wizard_accessible_get_type (), NULL); - atk_object_initialize (accessible, obj); - return accessible; -} - -static GType ygtk_wizard_accessible_factory_get_accessible_type() -{ - return ygtk_wizard_accessible_get_type (); -} - -static AtkObject*ygtk_wizard_accessible_factory_create_accessible (GObject *obj) -{ - return ygtk_wizard_accessible_new (obj); -} - -static void ygtk_wizard_accessible_factory_class_init (AtkObjectFactoryClass *class) -{ - class->create_accessible = ygtk_wizard_accessible_factory_create_accessible; - class->get_accessible_type = ygtk_wizard_accessible_factory_get_accessible_type; -} - -static GType ygtk_wizard_accessible_factory_get_type (void) -{ - static GType type = 0; - if (!type) { - GTypeInfo type_info = { 0 }; - type_info.class_size = sizeof (AtkObjectFactoryClass); - type_info.class_init = (GClassInitFunc) ygtk_wizard_accessible_factory_class_init; - type_info.instance_size = sizeof (AtkObjectFactory); - - type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, - "YGtkWizardAccessibleFactory", &type_info, 0); - -/* - type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY, - "YGtkWizardAccessibleFactory", sizeof (AtkObjectFactoryClass), - (GClassInitFunc) ygtk_wizard_accessible_factory_class_init, - sizeof (AtkObjectFactory), NULL, 0); -*/ - } - return type; -} - -static AtkObject *ygtk_wizard_get_accessible (GtkWidget *widget) -{ - static gboolean first_time = TRUE; - if (first_time) { - AtkObjectFactory *factory; - AtkRegistry *registry; - GType derived_type; - GType derived_atk_type; - - derived_type = g_type_parent (YGTK_TYPE_WIZARD); - registry = atk_get_default_registry (); - factory = atk_registry_get_factory (registry, derived_type); - derived_atk_type = atk_object_factory_get_accessible_type (factory); - if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE)) { - atk_registry_set_factory_type (registry, YGTK_TYPE_WIZARD, - ygtk_wizard_accessible_factory_get_type ()); - } - first_time = FALSE; - } - return GTK_WIDGET_CLASS (ygtk_wizard_parent_class)->get_accessible (widget); -} - static void ygtk_wizard_class_init (YGtkWizardClass *klass) { ygtk_wizard_parent_class = g_type_class_peek_parent (klass); @@ -1241,7 +1097,6 @@ widget_class->realize = ygtk_wizard_realize; widget_class->size_request = ygtk_wizard_size_request; widget_class->size_allocate = ygtk_wizard_size_allocate; - widget_class->get_accessible = ygtk_wizard_get_accessible; GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); container_class->forall = ygtk_wizard_forall; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org