diff options
author | Yuedong Du <yuedong.du@sun.com> | 2003-10-11 11:00:59 +0800 |
---|---|---|
committer | Yuedong Du <york@src.gnome.org> | 2003-10-11 11:00:59 +0800 |
commit | 5bbde1a63071c17b11f01132030ac15a8e803755 (patch) | |
tree | a5a191f48cf597bc82b766f4e2a33b25fcc5386e /a11y/e-table/gal-a11y-e-table-item-factory.c | |
parent | 49b3179c746b0157119d4dcd750e1338f65c6438 (diff) | |
download | gsoc2013-evolution-5bbde1a63071c17b11f01132030ac15a8e803755.tar.gz gsoc2013-evolution-5bbde1a63071c17b11f01132030ac15a8e803755.tar.zst gsoc2013-evolution-5bbde1a63071c17b11f01132030ac15a8e803755.zip |
add new files. set the right role. new file.
2003-10-11 Yuedong Du <yuedong.du@sun.com>
* gal/a11y/e-table/Makefile.am: add new files.
* gal/a11y/e-table/gal-a11y-e-cell.c: (gal_a11y_e_cell_construct):
set the right role.
* gal/a11y/e-table/gal-a11y-e-table-item-factory.c: new file.
(gal_a11y_e_table_item_factory_get_accessible_type),
(gal_a11y_e_table_item_factory_create_accessible),
(gal_a11y_e_table_item_factory_class_init),
(gal_a11y_e_table_item_factory_init),
(gal_a11y_e_table_item_factory_get_type): factory for the table item
a11y object. in create_accessible, we judge the type of widget
then set correct role.
* gal/a11y/e-table/gal-a11y-e-table-item-factory.h: ditto.
* gal/a11y/e-table/gal-a11y-e-tree-factory.c: new file.
(gal_a11y_e_tree_factory_get_accessible_type),
(gal_a11y_e_tree_factory_create_accessible),
(gal_a11y_e_tree_factory_class_init),
(gal_a11y_e_tree_factory_init), (gal_a11y_e_tree_factory_get_type):
factory for a11y object of etree. Mostly copyed from
gal-a11y-e-table-factory.c.
* gal/a11y/e-table/gal-a11y-e-tree-factory.h: ditto
* gal/a11y/e-table/gal-a11y-e-tree.c: (init_child_item),
(et_ref_accessible_at_point), (et_get_n_children), (et_ref_child),
(et_class_init), (et_atk_component_iface_init), (et_init),
(gal_a11y_e_tree_get_type), (gal_a11y_e_tree_new):a11y object for
etree object, mostly copied from gal-a11y-e-table.c. init_child_item
set correct role for the table item.
* gal/a11y/e-table/gal-a11y-e-tree.h: ditto.
* gal/e-table/e-table-item.c: (eti_class_init): register factory
for table item a11y object.
* gal/e-table/e-tree.c: (e_tree_get_item), (e_tree_class_init):
add new access fuction to get the table item of etree.
* gal/e-table/e-tree.h: ditto
svn path=/trunk/; revision=22867
Diffstat (limited to 'a11y/e-table/gal-a11y-e-table-item-factory.c')
-rw-r--r-- | a11y/e-table/gal-a11y-e-table-item-factory.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/a11y/e-table/gal-a11y-e-table-item-factory.c b/a11y/e-table/gal-a11y-e-table-item-factory.c new file mode 100644 index 0000000000..c5fd5c410c --- /dev/null +++ b/a11y/e-table/gal-a11y-e-table-item-factory.c @@ -0,0 +1,96 @@ +/* + * Authors: Yuedong Du <yuedong.du@sun.com> + * + * Copyright (C) 2003 Ximian, Inc. + */ + +#include <config.h> +#include "gal-a11y-e-table-item-factory.h" +#include "gal-a11y-e-table-item.h" +#include "gal-a11y-e-table.h" +#include <gal/e-table/e-table.h> +#include <gal/e-table/e-tree.h> +#include <atk/atk.h> + + +#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableItemFactoryClass)) +static AtkObjectFactoryClass *parent_class; +#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY) + +/* Static functions */ + +static GType +gal_a11y_e_table_item_factory_get_accessible_type (void) +{ + return GAL_A11Y_TYPE_E_TABLE_ITEM; +} + +static AtkObject* +gal_a11y_e_table_item_factory_create_accessible (GObject *obj) +{ + AtkObject * accessible; + ETableItem * eti; + GnomeCanvas * gc; + GtkWidget * table; + + g_return_if_fail (E_IS_TABLE_ITEM(obj)); + eti = E_TABLE_ITEM(obj); + gc = GNOME_CANVAS_ITEM(eti)->canvas; + + table = gtk_widget_get_parent(GTK_WIDGET(gc)); + + accessible = gtk_widget_get_accessible (table); + accessible = atk_object_ref_accessible_child (accessible, 0); + + return accessible; +} + +static void +gal_a11y_e_table_item_factory_class_init (GalA11yETableItemFactoryClass *klass) +{ + AtkObjectFactoryClass *factory_class = ATK_OBJECT_FACTORY_CLASS (klass); + + parent_class = g_type_class_ref (PARENT_TYPE); + + factory_class->create_accessible = gal_a11y_e_table_item_factory_create_accessible; + factory_class->get_accessible_type = gal_a11y_e_table_item_factory_get_accessible_type; +} + +static void +gal_a11y_e_table_item_factory_init (GalA11yETableItemFactory *factory) +{ +} + +/** + * gal_a11y_e_table_factory_get_type: + * @void: + * + * Registers the &GalA11yETableFactory class if necessary, and returns the type ID + * associated to it. + * + * Return value: The type ID of the &GalA11yETableFactory class. + **/ +GType +gal_a11y_e_table_item_factory_get_type (void) +{ + static GType type = 0; + + if (!type) { + GTypeInfo info = { + sizeof (GalA11yETableItemFactoryClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) gal_a11y_e_table_item_factory_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (GalA11yETableItemFactory), + 0, + (GInstanceInitFunc) gal_a11y_e_table_item_factory_init, + NULL /* value_table */ + }; + + type = g_type_register_static (PARENT_TYPE, "GalA11yETableItemFactory", &info, 0); + } + + return type; +} |