aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/e-table/gal-a11y-e-cell.c
diff options
context:
space:
mode:
authorTim Wo <tim.wo@sun.com>2003-11-12 13:12:04 +0800
committerGilbert Fang <gilbertfang@src.gnome.org>2003-11-12 13:12:04 +0800
commit2ba68734fdf438ab3c0e519c03990ad388186a71 (patch)
tree515db92c620a3c27aa8ab088af438eb9479f751a /a11y/e-table/gal-a11y-e-cell.c
parent325bccff550473ec2e4fd223e50242ae75ca1e4d (diff)
downloadgsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar.gz
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar.bz2
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar.lz
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar.xz
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.tar.zst
gsoc2013-evolution-2ba68734fdf438ab3c0e519c03990ad388186a71.zip
new files (gal-a11y-e-cell-tree.c/h) added adding 2 new functions to add
2003-11-03 Tim Wo <tim.wo@sun.com> * gal/a11y/e-table/Makefile.am: new files (gal-a11y-e-cell-tree.c/h) added * gal/a11y/e-table/gal-a11y-e-cell.h: adding 2 new functions to add or remove atk states * gal/a11y/e-table/gal-a11y-e-cell.c (eti_dispose): unref the state_set (eti_ref_state_set): new function (eti_class_init): create and initialize the state_set (eti_init): override the "ref_state_set" function in AtkObjectClass with "eti_ref_state_set" (gal_a11y_e_cell_add_state): adding a return value (gal_a11y_e_cell_remove_state): new function * gal/e-table/e-cell-tree.c: (e_cell_tree_class_init): register GalA11yECellText as the a11y implementation for ECellText. (e_cell_tree_view_get_subcell_view): new function to retrieve the cell_view of subcell in ECellTree * gal/e-table/e-cell-tree.h: adding 1 new function to retrieve the cell_view of subcell in ECellTree * gal/a11y/e-table/gal-a11y-e-cell-tree.c: new file. A11y implementation for ECellTree * gal/a11y/e-table/gal-a11y-e-cell-tree.h: new file. A11y implementation for ECellTree svn path=/trunk/; revision=23296
Diffstat (limited to 'a11y/e-table/gal-a11y-e-cell.c')
-rw-r--r--a11y/e-table/gal-a11y-e-cell.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell.c b/a11y/e-table/gal-a11y-e-cell.c
index a387c6ed6f..69dcf8d621 100644
--- a/a11y/e-table/gal-a11y-e-cell.c
+++ b/a11y/e-table/gal-a11y-e-cell.c
@@ -57,11 +57,24 @@ eti_dispose (GObject *object)
a11y->view_col = -1;
a11y->row = -1;
+ if (a11y->state_set)
+ g_object_unref (a11y->state_set);
+
if (parent_class->dispose)
parent_class->dispose (object);
}
/* Static functions */
+static AtkStateSet *
+eti_ref_state_set (AtkObject *accessible)
+{
+ GalA11yECell *cell = GAL_A11Y_E_CELL (accessible);
+ g_return_val_if_fail (cell->state_set, NULL);
+
+ g_object_ref(cell->state_set);
+ return cell->state_set;
+}
+
static AtkObject*
eti_get_parent (AtkObject *accessible)
{
@@ -154,6 +167,7 @@ eti_class_init (GalA11yECellClass *klass)
atk_object_class->get_parent = eti_get_parent;
atk_object_class->get_index_in_parent = eti_get_index_in_parent;
+ atk_object_class->ref_state_set = eti_ref_state_set;
}
static void
@@ -165,6 +179,10 @@ eti_init (GalA11yECell *a11y)
a11y->model_col = -1;
a11y->view_col = -1;
a11y->row = -1;
+
+ a11y->state_set = atk_state_set_new ();
+ atk_state_set_add_state (a11y->state_set, ATK_STATE_TRANSIENT);
+ atk_state_set_add_state (a11y->state_set, ATK_STATE_ENABLED);
}
@@ -407,9 +425,40 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell,
if (state_type == ATK_STATE_VISIBLE)
g_signal_emit_by_name (cell, "visible_data_changed");
}
+
+ return rc;
}
+ else
+ return FALSE;
}
+gboolean
+gal_a11y_e_cell_remove_state (GalA11yECell *cell,
+ AtkStateType state_type,
+ gboolean emit_signal)
+{
+ if (atk_state_set_contains_state (cell->state_set, state_type)) {
+ gboolean rc;
+
+ rc = atk_state_set_remove_state (cell->state_set, state_type);
+ /*
+ * The signal should only be generated if the value changed,
+ * not when the cell is set up. So states that are set
+ * initially should pass FALSE as the emit_signal argument.
+ */
+
+ if (emit_signal) {
+ atk_object_notify_state_change (ATK_OBJECT (cell), state_type, FALSE);
+ /* If state_type is ATK_STATE_VISIBLE, additional notification */
+ if (state_type == ATK_STATE_VISIBLE)
+ g_signal_emit_by_name (cell, "visible_data_changed");
+ }
+
+ return rc;
+ }
+ else
+ return FALSE;
+}
/**
* gal_a11y_e_cell_get_type:
@@ -451,6 +500,7 @@ gal_a11y_e_cell_get_type (void)
return type;
}
+
AtkObject *
gal_a11y_e_cell_new (ETableItem *item,
ECellView *cell_view,