aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/e-table/gal-a11y-e-table-item.c
diff options
context:
space:
mode:
authorLi Yuan <li.yuan@sun.com>2005-05-20 10:25:01 +0800
committerHarry Lu <haip@src.gnome.org>2005-05-20 10:25:01 +0800
commitef769539607b93774280c2111ba6d2f159e121c7 (patch)
tree4f4868b2e3f9486efab30d2b11d8108565b16582 /a11y/e-table/gal-a11y-e-table-item.c
parent85bf0e61d2559728a4fe6b39ead80a248bac817a (diff)
downloadgsoc2013-evolution-ef769539607b93774280c2111ba6d2f159e121c7.tar.gz
gsoc2013-evolution-ef769539607b93774280c2111ba6d2f159e121c7.tar.zst
gsoc2013-evolution-ef769539607b93774280c2111ba6d2f159e121c7.zip
add two files to sort table items. add table header. ditto.
2005-05-20 Li Yuan <li.yuan@sun.com> * gal/a11y/e-table/Makefile.am: * gal/a11y/e-table/gal-a11y-e-table-column-header.c: * gal/a11y/e-table/gal-a11y-e-table-column-header.h: add two files to sort table items. * gal/a11y/e-table/gal-a11y-e-cell.c: (gal_a11y_e_cell_get_index_in_parent): add table header. * gal/a11y/e-table/gal-a11y-e-table-item.c: (eti_get_n_children): (eti_ref_child), (eti_get_n_rows), (eti_get_column_header): ditto. Fixes #302154 svn path=/trunk/; revision=29394
Diffstat (limited to 'a11y/e-table/gal-a11y-e-table-item.c')
-rw-r--r--a11y/e-table/gal-a11y-e-table-item.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/a11y/e-table/gal-a11y-e-table-item.c b/a11y/e-table/gal-a11y-e-table-item.c
index a6945d351c..3ba5a0067a 100644
--- a/a11y/e-table/gal-a11y-e-table-item.c
+++ b/a11y/e-table/gal-a11y-e-table-item.c
@@ -26,6 +26,7 @@
#include "gal-a11y-e-table-click-to-add.h"
#include "gal-a11y-e-cell-registry.h"
#include "gal-a11y-e-cell.h"
+#include "gal-a11y-e-table-column-header.h"
#define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yETableItemClass))
static GObjectClass *parent_class;
@@ -205,7 +206,7 @@ eti_get_n_children (AtkObject *accessible)
return 0;
return atk_table_get_n_columns (ATK_TABLE (accessible)) *
- atk_table_get_n_rows (ATK_TABLE (accessible));
+ (atk_table_get_n_rows (ATK_TABLE (accessible)) + 1);
}
static AtkObject*
@@ -219,7 +220,15 @@ eti_ref_child (AtkObject *accessible, gint index)
if (!item)
return NULL;
- /* don't support column header now */
+ if (index < item->cols) {
+ ETableCol *ecol;
+ AtkObject *child;
+
+ ecol = e_table_header_get_column (item->header, index);
+ child = gal_a11y_e_table_column_header_new (ecol, item);
+ return child;
+ }
+ index -= item->cols;
col = index % item->cols;
row = index / item->cols;
@@ -416,7 +425,7 @@ eti_get_n_rows (AtkTable *table)
if (!item)
return -1;
- return item->rows;
+ return item->rows + 1;
}
static gint
@@ -501,12 +510,7 @@ eti_get_column_header (AtkTable *table, gint column)
ecol = e_table_header_get_column (item->header, column);
if (ecol) {
- atk_obj = atk_gobject_accessible_for_object (G_OBJECT (ecol));
- if (atk_obj) {
- if (ecol->text)
- atk_object_set_name (atk_obj, ecol->text);
- atk_object_set_role (atk_obj, ATK_ROLE_TABLE_COLUMN_HEADER);
- }
+ atk_obj = gal_a11y_e_table_column_header_new (ecol, item);
}
return atk_obj;