diff options
author | Tim Wo <tim.wo@sun.com> | 2003-11-21 12:28:04 +0800 |
---|---|---|
committer | Gilbert Fang <gilbertfang@src.gnome.org> | 2003-11-21 12:28:04 +0800 |
commit | 33a1687123f37ddea0d9bea13977c38f5f73b212 (patch) | |
tree | 1ed1e63a3fd4679899561f9e4de507a7b394de29 /a11y/e-table/gal-a11y-e-cell-text.c | |
parent | 1e103f9475ad27be34970a78b0416c5693942c5e (diff) | |
download | gsoc2013-evolution-33a1687123f37ddea0d9bea13977c38f5f73b212.tar.gz gsoc2013-evolution-33a1687123f37ddea0d9bea13977c38f5f73b212.tar.zst gsoc2013-evolution-33a1687123f37ddea0d9bea13977c38f5f73b212.zip |
override the function in base class, to retrieve the content of the text.
2003-11-21 Tim Wo <tim.wo@sun.com>
* gal/a11y/e-table/gal-a11y-e-cell-text.c: (ect_get_name): override
the function in base class, to retrieve the content of the text.
(ect_do_action_edit): begin edit the cell when issuing the action.
(ect_class_init): override the "get_name" function.
(ect_init): add an action "edit" to the object.
(gal_a11y_e_cell_text_get_type): add AtkAction interface to this type.
* gal/a11y/e-table/gal-a11y-e-cell-toggle.c
(gal_a11y_e_cell_toggle_dispose): disconnect the connected signal when
disposing.
(gal_a11y_e_cell_toggle_class_init): to override the dispose function.
(toggle_cell_action): set position of the click event more precisely.
(model_change_cb): set or remove the ATK_STATE_CHECKED flag according
to the value in the model when it changes.
(gal_a11y_e_cell_toggle_new): init the ATK_STATE_CHECKED flag and
connect to the model cell change signal.
* gal/a11y/e-table/gal-a11y-e-cell-toggle.h: add one member to save
the connected signal id.
* gal/a11y/e-table/gal-a11y-e-cell.c: (gal_a11y_e_cell_grab_focus):
notify the selection model that the cursor has been changed.
* gal/a11y/e-table/gal-a11y-e-table-item.c:
(eti_a11y_cursor_changed_cb): emiting a signal to notify the AT
applictions that the active descendant has been changed. (#51055)
svn path=/trunk/; revision=23466
Diffstat (limited to 'a11y/e-table/gal-a11y-e-cell-text.c')
-rw-r--r-- | a11y/e-table/gal-a11y-e-cell-text.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell-text.c b/a11y/e-table/gal-a11y-e-cell-text.c index c5a94144a8..79c14aa428 100644 --- a/a11y/e-table/gal-a11y-e-cell-text.c +++ b/a11y/e-table/gal-a11y-e-cell-text.c @@ -13,6 +13,7 @@ #include <atk/atkobject.h> #include <atk/atktext.h> #include <atk/atkeditabletext.h> +#include <atk/atkaction.h> #define CS_CLASS(a11y) (G_TYPE_INSTANCE_GET_CLASS ((a11y), C_TYPE_STREAM, GalA11yECellTextClass)) static AtkObjectClass *parent_class; @@ -23,6 +24,14 @@ static AtkObjectClass *parent_class; #define e_cell_text_set_selection(a,b,c,d,e) FALSE /* Static functions */ +static G_CONST_RETURN gchar* +ect_get_name (AtkObject * a11y) +{ + GalA11yECell *gaec = GAL_A11Y_E_CELL (a11y); + ECellText *ect = E_CELL_TEXT (gaec->cell_view->ecell); + return e_cell_text_get_text (ect, gaec->item->table_model, gaec->model_col, gaec->row); +} + static gchar * ect_get_text (AtkText *text, gint start_offset, @@ -372,6 +381,13 @@ ect_paste_text (AtkEditableText *text, static void +ect_do_action_edit (AtkAction *action) +{ + GalA11yECell *a11y = GAL_A11Y_E_CELL (action); + e_table_item_enter_edit (a11y->item, a11y->view_col, a11y->row); +} + +static void ect_atk_text_iface_init (AtkTextIface *iface) { iface->get_text = ect_get_text; @@ -408,12 +424,19 @@ ect_atk_editable_text_iface_init (AtkEditableTextIface *iface) static void ect_class_init (GalA11yECellTextClass *klass) { - parent_class = g_type_class_ref (PARENT_TYPE); + AtkObjectClass *a11y = ATK_OBJECT_CLASS (klass); + parent_class = g_type_class_ref (PARENT_TYPE); + a11y->get_name = ect_get_name; } static void ect_init (GalA11yECellText *a11y) { + gal_a11y_e_cell_add_action (a11y, + "edit", + "begin editing this cell", + NULL, + (ACTION_FUNC)ect_do_action_edit); } /** @@ -459,6 +482,7 @@ gal_a11y_e_cell_text_get_type (void) type = g_type_register_static (PARENT_TYPE, "GalA11yECellText", &info, 0); g_type_add_interface_static (type, ATK_TYPE_TEXT, &atk_text_info); g_type_add_interface_static (type, ATK_TYPE_EDITABLE_TEXT, &atk_editable_text_info); + gal_a11y_e_cell_type_add_action_interface (type); } return type; |