aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/e-table/gal-a11y-e-table.c
diff options
context:
space:
mode:
authorYuedong Du <yuedong.du@sun.com>2003-12-17 10:35:20 +0800
committerYuedong Du <york@src.gnome.org>2003-12-17 10:35:20 +0800
commit0a13fd3702b265298268ece517c3c99e519c7b79 (patch)
tree00820c3f4c07e0a5d335f425c5f41334e776f2fb /a11y/e-table/gal-a11y-e-table.c
parente12d64b4eb485713e28eb1b5da075343fc715ea5 (diff)
downloadgsoc2013-evolution-0a13fd3702b265298268ece517c3c99e519c7b79.tar.gz
gsoc2013-evolution-0a13fd3702b265298268ece517c3c99e519c7b79.tar.zst
gsoc2013-evolution-0a13fd3702b265298268ece517c3c99e519c7b79.zip
Fixed bug 51917, add atk support for ClickToAdd
2003-12-16 Yuedong Du <yuedong.du@sun.com> Fixed bug 51917, add atk support for ClickToAdd * gal/a11y/e-table/Makefile.am: add files. * gal/a11y/e-table/gal-a11y-e-table-click-to-add-factory.c: (gal_a11y_e_table_click_to_add_factory_get_accessible_type), (gal_a11y_e_table_click_to_add_factory_create_accessible), (gal_a11y_e_table_click_to_add_factory_class_init), (gal_a11y_e_table_click_to_add_factory_init), (gal_a11y_e_table_click_to_add_factory_get_type): factory for ClickToAdd * gal/a11y/e-table/gal-a11y-e-table-click-to-add-factory.h: ditto * gal/a11y/e-table/gal-a11y-e-table-click-to-add.c: (etcta_get_n_actions), (etcta_get_description), (etcta_action_get_name), (idle_do_action), (etcta_do_action), (atk_action_interface_init): a "click" action interface. (etcta_get_name), (etcta_get_n_children), (etcta_ref_child): create accessible according to which child is available. Either rect or row. (etcta_class_init), (etcta_init), (gal_a11y_e_table_click_to_add_get_type), (etcta_event): listen to canvas event, emit children-changed signal when it found rect/row was changed. (gal_a11y_e_table_click_to_add_new): * gal/a11y/e-table/gal-a11y-e-table-click-to-add.h: * gal/a11y/e-table/gal-a11y-e-table-item-factory.c: (gal_a11y_e_table_item_factory_create_accessible): * gal/a11y/e-table/gal-a11y-e-table.c: (init_child_item), (et_get_n_children), (et_ref_child): change the trick way to create a11y object for a table item. Because ClickToAdd is also a table item, previous way do not work for clicktoadd. * gal/e-table/e-table-click-to-add.c: (etcta_class_init): atk_register the new a11y factory. svn path=/trunk/; revision=23956
Diffstat (limited to 'a11y/e-table/gal-a11y-e-table.c')
-rw-r--r--a11y/e-table/gal-a11y-e-table.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/a11y/e-table/gal-a11y-e-table.c b/a11y/e-table/gal-a11y-e-table.c
index 6cd87f41c6..8f4f246e70 100644
--- a/a11y/e-table/gal-a11y-e-table.c
+++ b/a11y/e-table/gal-a11y-e-table.c
@@ -13,6 +13,7 @@
#include <gal/e-table/e-table.h>
#include <gal/e-table/e-table-group.h>
#include <gal/e-table/e-table-group-leaf.h>
+#include <gal/e-table/e-table-click-to-add.h>
#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableClass))
static AtkObjectClass *parent_class;
@@ -33,7 +34,7 @@ init_child_item (GalA11yETable *a11y)
GalA11yETablePrivate *priv = GET_PRIVATE (a11y);
ETable *table = E_TABLE (GTK_ACCESSIBLE (a11y)->widget);
if (priv->child_item == NULL) {
- priv->child_item = gal_a11y_e_table_item_new (ATK_OBJECT (a11y), E_TABLE_GROUP_LEAF (table->group)->item, 0);
+ priv->child_item = atk_gobject_accessible_for_object (G_OBJECT(E_TABLE_GROUP_LEAF (table->group)->item));
priv->child_item->role = ATK_ROLE_TABLE;
}
}
@@ -52,6 +53,14 @@ et_ref_accessible_at_point (AtkComponent *component,
static gint
et_get_n_children (AtkObject *accessible)
{
+ GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible);
+ ETable * et;
+
+ et = E_TABLE(GTK_ACCESSIBLE (a11y)->widget);
+ if (et && et->use_click_to_add) {
+ return 2;
+ }
+
return 1;
}
@@ -60,11 +69,30 @@ et_ref_child (AtkObject *accessible,
gint i)
{
GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible);
- if (i != 0)
- return NULL;
- init_child_item (a11y);
- g_object_ref (GET_PRIVATE (a11y)->child_item);
- return GET_PRIVATE (a11y)->child_item;
+ ETable * et;
+
+ et = E_TABLE(GTK_ACCESSIBLE (a11y)->widget);
+
+ if (i == 0) {
+ init_child_item (a11y);
+ g_object_ref (GET_PRIVATE (a11y)->child_item);
+ return GET_PRIVATE (a11y)->child_item;
+ } else if (i == 1) {
+ AtkObject * accessible;
+ ETableClickToAdd * etcta;
+
+ if (et && et->use_click_to_add && et->click_to_add) {
+ etcta = E_TABLE_CLICK_TO_ADD(et->click_to_add);
+ if (etcta->rect) {
+ accessible = atk_gobject_accessible_for_object (G_OBJECT(etcta));
+ } else {
+ accessible = atk_gobject_accessible_for_object (G_OBJECT(etcta->row));
+ }
+ return accessible;
+ }
+ }
+
+ return NULL;
}
static void