[evolution-patches] bug 50131, gal: table cells can't be focused by using "Grab focus" in at-poke



Hi Mike and all,
   This patch is part of A11y implementation for ETable.

   It affects 2 files:
1. gal/a11y/e-table/gal-a11y-e-cell.c 
(eti_grab_focus): new function to deal with grabing table cell focus
(eti_atk_component_iface_init): Override "grab_focus" virtual function
with eti_grab_focus of AtkComponent interface. (#50131)

2. gal/e-table/e-cell-text.c:
(e_cell_text_class_init): register GalA11yECellText as the a11y
implementation for ECellText.

After applying this patch, one can focus a cell in AT application and
can recognize a text cell (to fetch the text in it).

Would you please review this patch.

Thanks a lot.

-- 
Tim-Wo <tim wo sun com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.814
diff -u -r1.814 ChangeLog
--- ChangeLog	28 Oct 2003 05:40:56 -0000	1.814
+++ ChangeLog	30 Oct 2003 05:51:56 -0000
@@ -1,3 +1,12 @@
+2003-10-30  Tim Wo  <tim wo sun com>
+
+	* gal/a11y/e-table/gal-a11y-e-cell.c (eti_grab_focus): new function
+	to deal with grabing table cell focus
+	(eti_atk_component_iface_init): Override "grab_focus" virtual function
+	with eti_grab_focus of AtkComponent interface. (#50131)
+	* gal/e-table/e-cell-text.c: (e_cell_text_class_init): register
+	GalA11yECellText as the a11y implementation for ECellText.
+
 2003-10-26  Yuedong Du  <yuedong du sun com>
                                                                                 
         * gal/a11y/e-table/Makefile.am: add new file for toggle cell a11y
Index: gal/a11y/e-table/gal-a11y-e-cell.c
===================================================================
RCS file: /cvs/gnome/gal/gal/a11y/e-table/gal-a11y-e-cell.c,v
retrieving revision 1.3
diff -u -r1.3 gal-a11y-e-cell.c
--- gal/a11y/e-table/gal-a11y-e-cell.c	28 Oct 2003 05:41:03 -0000	1.3
+++ gal/a11y/e-table/gal-a11y-e-cell.c	30 Oct 2003 05:51:56 -0000
@@ -7,6 +7,7 @@
  */
 
 #include <config.h>
+#include "gal/e-table/e-table.h"
 #include "gal-a11y-e-cell.h"
 #include "gal-a11y-util.h"
 #include <atk/atkobject.h>
@@ -112,12 +113,33 @@
 		*y += yval;
 }
 
+static gboolean
+eti_grab_focus (AtkComponent *component)
+{
+	GalA11yECell *a11y;
+	gint view_row;
+	GtkWidget *e_table, *toplevel;
+
+	a11y = GAL_A11Y_E_CELL (component);
+	e_table = gtk_widget_get_parent (GNOME_CANVAS_ITEM (a11y->item)->canvas);
+	view_row = e_table_view_to_model_row (E_TABLE (e_table), a11y->row);
+
+	e_selection_model_clear (a11y->item->selection);
+	e_selection_model_select_single_row (a11y->item->selection, view_row);
+
+	gtk_widget_grab_focus (e_table);
+	toplevel = gtk_widget_get_toplevel (e_table);
+	if (GTK_WIDGET_TOPLEVEL (toplevel))
+		gtk_window_present (toplevel);
+}
+
 /* Table IFace */
 
 static void
 eti_atk_component_iface_init (AtkComponentIface *iface)
 {
 	iface->get_extents = eti_get_extents;
+	iface->grab_focus  = eti_grab_focus;
 }
 
 static void
Index: gal/e-table/e-cell-text.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-cell-text.c,v
retrieving revision 1.132
diff -u -r1.132 e-cell-text.c
--- gal/e-table/e-cell-text.c	27 Oct 2003 22:21:18 -0000	1.132
+++ gal/e-table/e-cell-text.c	30 Oct 2003 05:51:58 -0000
@@ -54,6 +54,8 @@
 #include "gal/util/e-text-event-processor-emacs-like.h"
 #include "gal/util/e-i18n.h"
 #include "e-table-tooltip.h"
+#include "gal/a11y/e-table/gal-a11y-e-cell-registry.h"
+#include "gal/a11y/e-table/gal-a11y-e-cell-text.h"
 
 #define d(x)
 #define DO_SELECTION 1
@@ -1724,6 +1726,8 @@
 			use_ellipsis_default = FALSE;
 		}
 	}
+	
+	gal_a11y_e_cell_registry_add_cell_type (NULL, E_CELL_TEXT_TYPE, gal_a11y_e_cell_text_new);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]