[evolution-patches] Patches for gtkhtml, fix several ximian bugzilla bugs



hi, rodo

Here are some patches about gtkhtml against CVS HEAD. 

To better illustrate these patches, I opened several bugs on ximian bugzilla website.
Actually, these bugs had been fixed in our internal CVS tree for days and work well.

Will you please review it ?

Thanks very much

Yours sincerely,
Mengjie Yu


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2060
diff -u -p -r1.2060 ChangeLog
--- ChangeLog	29 Nov 2004 15:53:09 -0000	1.2060
+++ ChangeLog	1 Dec 2004 12:55:02 -0000
@@ -1,3 +1,38 @@
+2004-12-01  Mengjie Yu  <meng-jie yu sun com>
+
+	* gtkhtml.c: (key_press_event), (focus), (gtk_html_class_init):
+	fix #70078 Add new signals when for insert/delete
+	fix #70085 he focus object may be a frame or an iframe, if so, 
+		   we must check its focus object recursively.
+	fix #70086 emit "cursor_move" signal when changing cursor's 
+		   positon
+
+	* gtkhtml.h:
+	fix #70078 add signal field
+
+	* htmlembedded.c: (html_embedded_set_widget):
+	set the a11y name for the widget's atk object.
+
+	* htmlengine-edit-cut-and-paste.c: (insert_object_for_undo),
+	(html_engine_delete):
+	fix #70078 emit signal when insert/delete objects
+
+	* htmlengine-edit-table.c: (delete_column_undo_action):
+	fix #70084 Before doing undo, we need move the cursor back 
+		   to original position.
+
+	* htmlengine.c: (html_engine_parse):
+	fix #70083 We need to set engine is parsing before all 
+		   content are destroied.
+
+	* htmlinterval.c: (do_downtree_lines_intersection),
+	(html_interval_forall):
+	fix #70084 add more judgement to avoid crash.
+
+	* htmltext.c: (html_text_get_slave_at_offset):
+	fix #70087 fixes the wrong behaviour when offset is at the end
+		   of non-last line of a paragraph
+
 2004-11-29  Radek Doulik  <rodo ximian com>
 
 	* htmlengine.c: make sure we free whole array from g_strsplit
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.582
diff -u -p -r1.582 gtkhtml.c
--- gtkhtml.c	19 Nov 2004 10:19:52 -0000	1.582
+++ gtkhtml.c	1 Dec 2004 12:55:23 -0000
@@ -124,6 +124,9 @@ enum {
 	SCROLL,
 	CURSOR_MOVE,
 	COMMAND,
+	CURSOR_CHANGED,
+	OBJECT_INSERTED,
+	OBJECT_DELETED,
 	/* now only last signal */
 	LAST_SIGNAL
 };
@@ -866,6 +869,7 @@ key_press_event (GtkWidget *widget, GdkE
 	GtkHTML *html = GTK_HTML (widget);
 	GtkHTMLClass *html_class = GTK_HTML_CLASS (GTK_WIDGET_GET_CLASS (html));
 	gboolean retval, update = TRUE;
+	HTMLEngine *e;
 
 	html->binding_handled = FALSE;
 	html->priv->update_styles = FALSE;
@@ -898,9 +902,20 @@ key_press_event (GtkWidget *widget, GdkE
 		switch (event->keyval) {
 		case GDK_Return:
 		case GDK_KP_Enter:
-			if (html->engine->focus_object) {
+			e = html->engine;
+			/* the toplevel gtkhtml's focus object may be a frame or ifame */
+			while (e->focus_object) {
+				if (HTML_IS_FRAME (e->focus_object))
+					e = GTK_HTML (HTML_FRAME (e->focus_object)->html)->engine;
+				else if (HTML_IS_IFRAME (e->focus_object))
+					e = GTK_HTML (HTML_IFRAME (e->focus_object)->html)->engine;
+				else
+					break;
+			} 
+
+			if (e->focus_object) {
 				gchar *url;
-				url = html_object_get_complete_url (html->engine->focus_object, html->engine->focus_object_offset);
+				url = html_object_get_complete_url (e->focus_object, e->focus_object_offset);
 				if (url) {
 					/* printf ("link clicked: %s\n", url); */
 					g_signal_emit (html, signals [LINK_CLICKED], 0, url);
@@ -2339,6 +2354,8 @@ focus (GtkWidget *w, GtkDirectionType di
 			gtk_widget_grab_focus (w);
 		if (e->caret_mode)
 			html_engine_jump_to_object (e, obj, offset);
+			g_signal_emit (GTK_HTML (w), signals [CURSOR_MOVE], 0, 
+					direction, GTK_HTML_CURSOR_SKIP_ALL);
 
 		return TRUE;
 	}
@@ -2878,6 +2895,34 @@ gtk_html_class_init (GtkHTMLClass *klass
 			      g_cclosure_marshal_VOID__ENUM,
 			      G_TYPE_NONE, 1, GTK_TYPE_HTML_COMMAND);
 
+	signals [CURSOR_CHANGED] = 
+		g_signal_new ("cursor_changed",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (GtkHTMLClass, cursor_changed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+	signals [OBJECT_INSERTED] = 
+		g_signal_new ("object_inserted",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (GtkHTMLClass, text_inserted),
+			      NULL, NULL,
+			      html_g_cclosure_marshal_VOID__INT_INT,
+			      G_TYPE_NONE, 2,
+			      G_TYPE_INT, G_TYPE_INT);
+
+	signals [OBJECT_DELETED] = 
+		g_signal_new ("object_deleted",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (GtkHTMLClass, text_deleted),
+			      NULL, NULL,
+			      html_g_cclosure_marshal_VOID__INT_INT,
+			      G_TYPE_NONE, 2,
+			      G_TYPE_INT, G_TYPE_INT);
 	object_class->destroy = destroy;
 	
 
Index: gtkhtml.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.h,v
retrieving revision 1.154
diff -u -p -r1.154 gtkhtml.h
--- gtkhtml.h	1 Nov 2004 12:20:26 -0000	1.154
+++ gtkhtml.h	1 Dec 2004 12:55:25 -0000
@@ -101,6 +101,9 @@ struct _GtkHTMLClass {
 					   gfloat position);
 	void     (* cursor_move)          (GtkHTML *html, GtkDirectionType dir_type, GtkHTMLCursorSkipType skip);
 	gboolean (* command)              (GtkHTML *html, GtkHTMLCommandType com_type);
+        void (* cursor_changed)       (GtkHTML *html);
+        void (* text_inserted)       (GtkHTML *html, int pos, int len);
+        void (* text_deleted)        (GtkHTML *html, int pos, int len);
 
 	/* properties */
 	GtkHTMLClassProperties *properties;
Index: htmlembedded.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlembedded.c,v
retrieving revision 1.54
diff -u -p -r1.54 htmlembedded.c
--- htmlembedded.c	19 Nov 2004 10:19:52 -0000	1.54
+++ htmlembedded.c	1 Dec 2004 12:55:26 -0000
@@ -395,10 +395,17 @@ html_embedded_allocate (GtkWidget *w, Gt
 void
 html_embedded_set_widget (HTMLEmbedded *emb, GtkWidget *w)
 {
+	AtkObject *a11y;
 	emb->widget = w;
 	
 	d (printf ("set embedded widget: %p widget: %p\n", emb, w));
 	gtk_widget_show (w);
+
+	if (emb->name) {
+		a11y = gtk_widget_get_accessible (w);
+		if ((a11y != NULL) && (atk_object_get_name (a11y) == NULL))
+			atk_object_set_name (a11y, emb->name);
+	}
 
 	g_object_set_data (G_OBJECT (w), "embeddedelement", emb);
 	g_signal_connect (w, "size_allocate", G_CALLBACK (html_embedded_allocate), emb);
Index: htmlengine-edit-cut-and-paste.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine-edit-cut-and-paste.c,v
retrieving revision 1.104
diff -u -p -r1.104 htmlengine-edit-cut-and-paste.c
--- htmlengine-edit-cut-and-paste.c	10 Nov 2004 17:23:42 -0000	1.104
+++ htmlengine-edit-cut-and-paste.c	1 Dec 2004 12:55:34 -0000
@@ -1076,6 +1076,7 @@ insert_object_for_undo (HTMLEngine *e, H
 	html_cursor_jump_to_position_no_spell (e->cursor, e, position_after + (delete_paragraph_before ? 1 : 0));
 	insert_setup_undo (e, len, position_before + (delete_paragraph_before ? 1 : 0),
 			   dir, delete_paragraph_before, delete_paragraph_after);
+	g_signal_emit_by_name (e->widget, "object_inserted", position_before, len);
 }
 
 static void
@@ -1710,6 +1711,8 @@ html_engine_delete (HTMLEngine *e)
 		HTMLCursor *start = html_cursor_dup (e->mark->position < e->cursor->position ? e->mark : e->cursor);
 		HTMLCursor *end = html_cursor_dup (e->mark->position < e->cursor->position ? e->cursor : e->mark);
 		gint start_position = start->position;
+		gint end_position = end->position;
+
 
 		while (start->position < end->position) {
 			if (start->object->parent->parent == end->object->parent->parent) {
@@ -1755,6 +1758,11 @@ html_engine_delete (HTMLEngine *e)
 		if (end)
 			html_cursor_destroy (end);
 		html_cursor_jump_to_position (e->cursor, e, start_position);
+
+		if (end_position - start_position > 0) {
+			int len = end_position - start_position;
+			g_signal_emit_by_name (e->widget, "object_deleted", start_position, len);
+		}
 	}
 	html_undo_level_end (e->undo);
 }
Index: htmlengine-edit-table.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine-edit-table.c,v
retrieving revision 1.75
diff -u -p -r1.75 htmlengine-edit-table.c
--- htmlengine-edit-table.c	20 Apr 2004 09:57:06 -0000	1.75
+++ htmlengine-edit-table.c	1 Dec 2004 12:55:39 -0000
@@ -340,6 +340,7 @@ delete_column_undo_action (HTMLEngine *e
 	DeleteCellsUndo *data = (DeleteCellsUndo *) undo_data;
 	HTMLTable *table;
 
+	html_cursor_jump_to_position (e->cursor, e, position_after);
 	table = html_engine_get_table (e);
 	g_assert (data->size == table->totalRows);
 	html_table_insert_column (table, e, data->pos, data->cells, html_undo_direction_reverse (dir));
Index: htmlengine.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.c,v
retrieving revision 1.622
diff -u -p -r1.622 htmlengine.c
--- htmlengine.c	29 Nov 2004 15:53:09 -0000	1.622
+++ htmlengine.c	1 Dec 2004 12:56:00 -0000
@@ -4937,6 +4937,7 @@ html_engine_parse (HTMLEngine *e)
 {
 	html_engine_stop_parser (e);
 
+	e->parsing = TRUE;
 	/* reset search & replace */
 	if (e->search_info) {
 		html_search_destroy (e->search_info);
@@ -4986,7 +4987,6 @@ html_engine_parse (HTMLEngine *e)
 		e->bgPixmapPtr = NULL;
 	}
 
-	e->parsing = TRUE;
 	e->avoid_para = FALSE;
 
 	e->timerId = gtk_idle_add ((GtkFunction) html_engine_timer_event, e);
Index: htmlinterval.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlinterval.c,v
retrieving revision 1.20
diff -u -p -r1.20 htmlinterval.c
--- htmlinterval.c	15 Oct 2003 14:42:23 -0000	1.20
+++ htmlinterval.c	1 Dec 2004 12:56:00 -0000
@@ -218,8 +218,6 @@ get_downtree_line (HTMLObject *o)
 static HTMLEngine *
 do_downtree_lines_intersection (GSList **l1, GSList **l2, HTMLEngine *e)
 {
-	g_assert ((*l1)->data == (*l2)->data);
-
 	while (*l1 && *l2 && (*l1)->data == (*l2)->data) {
 		e = html_object_get_engine (HTML_OBJECT ((*l1)->data), e);
 		*l1 = g_slist_remove_link (*l1, *l1);
@@ -292,14 +290,16 @@ html_interval_forall (HTMLInterval *i, H
 
 	from_downline = get_downtree_line (i->from.object);
 	to_downline   = get_downtree_line (i->to.object);
-	engine = do_downtree_lines_intersection  (&from_downline, &to_downline, e);
+	if (from_downline && to_downline) {
+		engine = do_downtree_lines_intersection  (&from_downline, &to_downline, e);
 
-	if (from_downline)
-		interval_forall    (HTML_OBJECT (from_downline->data)->parent, from_downline, to_downline,
-				    html_object_get_engine (HTML_OBJECT (from_downline->data)->parent, engine), f, data);
-	else {
-		g_assert (i->from.object == i->to.object);
-		html_object_forall (i->from.object, html_object_get_engine (i->from.object, engine), f, data);
+	if (from_downline && HTML_OBJECT (from_downline->data)->parent)
+			interval_forall    (HTML_OBJECT (from_downline->data)->parent, from_downline, to_downline,
+					    html_object_get_engine (HTML_OBJECT (from_downline->data)->parent, engine), f, data);
+		else {
+			if (i->from.object == i->to.object)
+				html_object_forall (i->from.object, html_object_get_engine (i->from.object, engine), f, data);
+		}
 	}
 
 	g_slist_free (from_downline);
Index: htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.269
diff -u -p -r1.269 htmltext.c
--- htmltext.c	29 Nov 2004 15:53:09 -0000	1.269
+++ htmltext.c	1 Dec 2004 12:56:20 -0000
@@ -2914,8 +2914,7 @@ html_text_get_slave_at_offset (HTMLObjec
 
 	while (o && HTML_IS_TEXT_SLAVE (o)) {
 		if (HTML_IS_TEXT_SLAVE (o) && HTML_TEXT_SLAVE (o)->posStart <= offset
-		    && (offset < HTML_TEXT_SLAVE (o)->posStart + HTML_TEXT_SLAVE (o)->posLen
-			|| (offset == HTML_TEXT_SLAVE (o)->posStart + HTML_TEXT_SLAVE (o)->posLen && HTML_TEXT_SLAVE (o)->owner->text_len == offset)))
+		    && (offset <= HTML_TEXT_SLAVE (o)->posStart + HTML_TEXT_SLAVE (o)->posLen))
 			return HTML_TEXT_SLAVE (o);
 		o = o->next;
 	}
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/ChangeLog,v
retrieving revision 1.12
diff -u -p -r1.12 ChangeLog
--- ChangeLog	1 Nov 2004 09:41:59 -0000	1.12
+++ ChangeLog	1 Dec 2004 12:28:05 -0000
@@ -1,3 +1,51 @@
+2004-12-01  Mengjie Yu  <meng-jie yu sun com>
+
+	* html.c: (html_a11y_ref_state_set), (html_a11y_get_n_children),
+	(html_a11y_ref_child):
+	fix #70083 check defunct state before ref child.
+	Add SHOWING state to stateset.
+
+	* image.c: (html_a11y_image_get_name),
+	(html_a11y_image_get_image_description):change image name description
+
+	* object.c: (get_n_actions), (get_description), (action_get_name),
+	(idle_do_action), (do_action), (atk_action_interface_init),
+	(gtk_html_a11y_get_type), (gtk_html_a11y_get_n_children),
+	(gtk_html_a11y_ref_child), (gtk_html_a11y_get_name),
+	(gtk_html_a11y_class_init), (gtk_html_a11y_cursor_move_cb),
+	(idle_notify_insert), (idle_notify_delete),
+	(gtk_html_a11y_insert_object_cb), (gtk_html_a11y_delete_object_cb),
+	(gtk_html_a11y_new):
+	fix #70078 listen and handle the insert/delete signal. 
+		   For text object, emit text_changed signal.
+	fix #70088 make ui grab work by add a grab focus action interface.
+	fix #70083 refuse ref child when parsing. Add judgement to avoid a11y 
+		   component access null point.
+
+	* table.c: (is_valid), (html_a11y_table_ref_at),
+	(html_a11y_table_get_index_at),
+	(html_a11y_table_get_column_at_index),
+	(html_a11y_table_get_row_at_index),
+	(html_a11y_table_get_n_columns), (html_a11y_table_get_n_rows),
+	(html_a11y_table_get_column_extent_at),
+	(html_a11y_table_get_row_extent_at),
+	(html_a11y_table_get_column_header),
+	(html_a11y_table_get_row_header):
+	add new function to check whether the table is valid.
+
+	* text.c: (get_n_actions), (action_get_name), (do_action),
+	(atk_action_interface_init), (html_a11y_text_get_type),
+	(atk_component_interface_init), (html_a11y_text_finalize),
+	(html_a11y_text_ref_state_set), (html_a11y_text_grab_focus):
+	fix #70078 clear the signal handler
+	add action interface to text so that it can be found by GOK.
+
+	* text.h:
+	fix #70078 add field for signal hanlder
+
+	* utils.c: (acc_unref):
+	fix #70083 Add defunct state after unref a atk object.
+
 2004-11-01  Radek Doulik  <rodo ximian com>
 
 	* Makefile.am (AM_CFLAGS): use AM_FLAGS instead of CFLAGS
Index: html.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/html.c,v
retrieving revision 1.5
diff -u -p -r1.5 html.c
--- html.c	19 Nov 2004 10:19:51 -0000	1.5
+++ html.c	1 Dec 2004 12:28:06 -0000
@@ -200,6 +200,7 @@ html_a11y_ref_state_set (AtkObject *acce
 
 	atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
 	atk_state_set_add_state (state_set, ATK_STATE_ENABLED);
+	atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
 
 	/* printf ("html_a11y_ref_state_set resolves to %p\n", state_set); */
 
@@ -211,6 +212,11 @@ html_a11y_get_n_children (AtkObject *acc
 {
 	HTMLObject *parent;
 	gint n_children = 0;
+	AtkStateSet * ss;
+
+	ss = html_a11y_ref_state_set (accessible);
+	if (atk_state_set_contains_state (ss, ATK_STATE_DEFUNCT))
+		return 0;
 
 	parent = HTML_A11Y_HTML (accessible);
 	if (parent) {
@@ -227,6 +233,12 @@ html_a11y_ref_child (AtkObject *accessib
 {
 	HTMLObject *parent, *child;
 	AtkObject *accessible_child = NULL;
+
+	AtkStateSet * ss;
+
+	ss = html_a11y_ref_state_set(accessible);
+	if (atk_state_set_contains_state (ss, ATK_STATE_DEFUNCT))
+		return NULL;
 
 	parent = HTML_A11Y_HTML (accessible);
 	if (parent) {
Index: image.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/image.c,v
retrieving revision 1.2
diff -u -p -r1.2 image.c
--- image.c	1 Nov 2002 15:34:27 -0000	1.2
+++ image.c	1 Dec 2004 12:28:07 -0000
@@ -29,6 +29,8 @@
 #include "html.h"
 #include "image.h"
 
+#include <glib/gi18n.h>
+
 static void html_a11y_image_class_init    (HTMLA11YImageClass *klass);
 static void html_a11y_image_init          (HTMLA11YImage *a11y_image);
 static void atk_image_interface_init      (AtkImageIface *iface);
@@ -139,8 +141,23 @@ static G_CONST_RETURN gchar *
 html_a11y_image_get_name (AtkObject *accessible)
 {
 	HTMLImage *img = HTML_IMAGE (HTML_A11Y_HTML (accessible));
+	gchar *name, *tmpName;
+
+	if (accessible->name)
+		return accessible->name;
+
+	tmpName = g_strconcat (_("URL is "), img->image_ptr->url, NULL);
+
+	if (img->alt) {
+		name = g_strconcat (tmpName, _(", Alternative Text is "), img->alt, NULL);
+		g_free (tmpName);
+	} else
+		name = tmpName;
 
-	return g_strdup (img->image_ptr->url);
+	atk_object_set_name (accessible, name);
+	g_free (name);
+
+	return accessible->name;
 }
 
 /*
@@ -172,7 +189,5 @@ html_a11y_image_get_image_size (AtkImage
 static G_CONST_RETURN gchar *
 html_a11y_image_get_image_description (AtkImage *image)
 {
-	HTMLImage *img = HTML_IMAGE (HTML_A11Y_HTML (image));
-
-	return g_strdup (img->alt);
+	return  html_a11y_image_get_name (ATK_OBJECT (image));
 }
Index: object.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/object.c,v
retrieving revision 1.5
diff -u -p -r1.5 object.c
--- object.c	26 May 2004 02:26:17 -0000	1.5
+++ object.c	1 Dec 2004 12:28:09 -0000
@@ -20,7 +20,6 @@
  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  *  Boston, MA 02111-1307, USA.
  */
-
 #include "gtkhtml.h"
 #include "htmlengine.h"
 #include "htmlobject.h"
@@ -29,12 +28,114 @@
 #include "paragraph.h"
 #include "utils.h"
 #include "text.h"
+#include <glib/gi18n.h>
+#include <atk/atkstateset.h>
 
 static void gtk_html_a11y_class_init (GtkHTMLA11YClass *klass);
 static void gtk_html_a11y_init       (GtkHTMLA11Y *a11y);
 
 static GtkAccessibleClass *parent_class = NULL;
 
+
+static gint
+get_n_actions (AtkAction *action)
+{
+        return 1;
+}
+
+static G_CONST_RETURN gchar*
+get_description (AtkAction *action,
+                             gint      i)
+{
+        if (i == 0)
+                return "grab";
+
+        return NULL;
+}
+
+static G_CONST_RETURN gchar*
+action_get_name (AtkAction *action, gint      i)
+{
+        if (i == 0)
+                return "grab";
+
+        return NULL;
+}
+
+
+static uint action_idle_handler = 0;
+static gboolean
+idle_do_action (gpointer data)
+{
+	GtkHTMLA11Y * a11y;
+	GtkWidget *widget;
+
+	action_idle_handler = 0;
+
+	a11y = GTK_HTML_A11Y (data);
+	widget = GTK_ACCESSIBLE (a11y)->widget;
+	if (widget == NULL) {
+	/*
+	* State is defunct
+	*/
+	return FALSE;
+	}
+
+	if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget)) {
+		return FALSE;
+	}
+
+	gtk_widget_grab_focus (widget);
+
+	return FALSE;
+}
+
+static gboolean
+do_action (AtkAction * action, gint i)
+{
+	GtkHTMLA11Y * a11y;
+	GtkWidget *widget;
+	gboolean return_value = TRUE;
+
+	a11y = GTK_HTML_A11Y (action);
+	widget = GTK_ACCESSIBLE (action)->widget;
+
+	if (widget == NULL) {
+	/*
+	* State is defunct
+	*/
+	return FALSE;
+	}
+
+	if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+		return FALSE;
+
+
+	switch (i) {
+	case 0:
+		if (action_idle_handler)
+			return_value = FALSE;
+		else
+			action_idle_handler = g_idle_add (idle_do_action, a11y);
+		break;
+	default:
+		return_value = FALSE;
+		break;
+	}
+	return return_value;
+}
+
+static void
+atk_action_interface_init (AtkActionIface *iface)
+{
+        g_return_if_fail (iface != NULL);
+
+        iface->do_action = do_action;
+        iface->get_n_actions = get_n_actions;
+        iface->get_description = get_description;
+        iface->get_name = action_get_name;
+}
+
 GType
 gtk_html_a11y_get_type (void)
 {
@@ -54,6 +155,12 @@ gtk_html_a11y_get_type (void)
 			NULL                                             /* value table */
 		};
 
+                static const GInterfaceInfo atk_action_info = {
+                        (GInterfaceInitFunc) atk_action_interface_init,
+                        (GInterfaceFinalizeFunc) NULL,
+                        NULL
+                };
+
 		/*
 		 * Figure out the size of the class and instance 
 		 * we are deriving from
@@ -69,6 +176,8 @@ gtk_html_a11y_get_type (void)
 		tinfo.instance_size = query.instance_size;
 
 		type = g_type_register_static (derived_atk_type, "GtkHTMLA11Y", &tinfo, 0);
+
+                g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info);
 	}
 
 	return type;
@@ -90,15 +199,39 @@ gtk_html_a11y_initialize (AtkObject *obj
 	g_object_set_data (G_OBJECT (obj), GTK_HTML_ID, data);
 }
 
+
 static gint
 gtk_html_a11y_get_n_children (AtkObject *accessible)
 {
 	HTMLObject *clue;
 	gint n_children = 0;
+	AtkStateSet *ss;
+
+	if (GTK_HTML_A11Y_GTKHTML (accessible)->engine->parsing)
+		return 0;
+
+	ss = atk_object_ref_state_set (accessible);
+	if (atk_state_set_contains_state (ss, ATK_STATE_DEFUNCT)) {
+		g_object_unref (ss);
+		return 0;
+	}
+	g_object_unref (ss);
 
 	clue = GTK_HTML_A11Y_GTKHTML (accessible)->engine->clue;
-	if (clue)
+	if (clue) {
+		AtkObject *atk_clue = html_utils_get_accessible (clue, NULL);
+		if (atk_clue) {
+			AtkStateSet *ss_clue = atk_object_ref_state_set (atk_clue);
+			if (atk_state_set_contains_state (ss_clue, ATK_STATE_DEFUNCT)) {
+				g_object_unref (ss_clue);
+				return 0;
+			}
+			g_object_unref (ss_clue);
+		}
+		
 		n_children = html_object_get_n_children (GTK_HTML_A11Y_GTKHTML (accessible)->engine->clue);
+	}
+		
 
 	/* printf ("gtk_html_a11y_get_n_children resolves to %d\n", n_children); */
 
@@ -110,8 +243,29 @@ gtk_html_a11y_ref_child (AtkObject *acce
 {
 	HTMLObject *child;
 	AtkObject *accessible_child = NULL;
-	
+	AtkStateSet *ss;
+
+	if (GTK_HTML_A11Y_GTKHTML (accessible)->engine->parsing)
+		return NULL;
+
+	ss = atk_object_ref_state_set (accessible);
+	if (atk_state_set_contains_state (ss, ATK_STATE_DEFUNCT)) {
+		g_object_unref (ss);
+		return NULL;
+	}
+	g_object_unref (ss);
+
 	if (GTK_HTML_A11Y_GTKHTML (accessible)->engine->clue) {
+		AtkObject *atk_clue = html_utils_get_accessible (GTK_HTML_A11Y_GTKHTML (accessible)->engine->clue, NULL);
+		if (atk_clue) {
+			AtkStateSet *ss_clue = atk_object_ref_state_set (atk_clue);
+			if (atk_state_set_contains_state (ss_clue, ATK_STATE_DEFUNCT)) {
+				g_object_unref (ss_clue);
+				return NULL;
+			}
+			g_object_unref (ss_clue);
+		}
+
 		child = html_object_get_child (GTK_HTML_A11Y_GTKHTML (accessible)->engine->clue, index);
 		if (child) {
 			accessible_child = html_utils_get_accessible (child, accessible);
@@ -125,6 +279,16 @@ gtk_html_a11y_ref_child (AtkObject *acce
 	return accessible_child;
 }
 
+static G_CONST_RETURN gchar*
+gtk_html_a11y_get_name (AtkObject *obj)
+{
+	G_CONST_RETURN gchar *name;
+	if (obj->name != NULL && strcmp (obj->name, "")) {
+		return obj->name;
+	}
+	return _("HTML Container");
+}
+
 static void
 gtk_html_a11y_class_init (GtkHTMLA11YClass *klass)
 {
@@ -136,6 +300,7 @@ gtk_html_a11y_class_init (GtkHTMLA11YCla
 	atk_class->initialize = gtk_html_a11y_initialize;
 	atk_class->get_n_children = gtk_html_a11y_get_n_children;
 	atk_class->ref_child = gtk_html_a11y_ref_child;
+	atk_class->get_name = gtk_html_a11y_get_name;
 
 	gobject_class->finalize = gtk_html_a11y_finalize;
 }
@@ -178,11 +343,18 @@ gtk_html_a11y_grab_focus_cb(GtkWidget * 
 
 }
 
+static AtkObject * prev_object = NULL;
+
+struct idle_data {
+	AtkObject * a11y;
+	int pos;
+	int len;
+};
+
 static void
 gtk_html_a11y_cursor_move_cb(GtkWidget *widget,  GtkDirectionType dir_type, GtkHTMLCursorSkipType skip)
 {
         AtkObject *focus_object, *obj;
-	static AtkObject * prev_object = NULL;
 
 	focus_object = gtk_html_a11y_get_focus_object (widget);
        obj = gtk_widget_get_accessible (widget);
@@ -201,6 +373,98 @@ gtk_html_a11y_cursor_move_cb(GtkWidget *
         }
 }
 
+static gboolean
+idle_notify_insert (gpointer data)
+{
+	struct idle_data * id = (struct idle_data*)(data);
+
+	if (id != NULL) {
+		HTMLA11YText * text = HTML_A11Y_TEXT (id->a11y);
+		text->insert_idle_handler = 0;
+		g_signal_emit_by_name (id->a11y, "text_changed::insert", id->pos, id->len);
+	}
+	g_free (id);
+
+	return FALSE;
+}
+
+static gboolean
+idle_notify_delete (gpointer data)
+{
+	struct idle_data * id = (struct idle_data*)(data);
+	if (id != NULL) {
+		HTMLA11YText *text = HTML_A11Y_TEXT (id->a11y);
+		text->delete_idle_handler = 0;
+		g_signal_emit_by_name (id->a11y, "text_changed::delete", id->pos, id->len);
+	}
+	g_free (id);
+
+	return FALSE;
+}
+
+static void
+gtk_html_a11y_insert_object_cb (GtkWidget * widget, int pos, int len) 
+{
+	AtkObject * a11y, *obj;
+	HTMLText * text;
+
+        obj = gtk_widget_get_accessible (widget);
+	a11y = gtk_html_a11y_get_focus_object (widget);
+
+	if (prev_object != a11y) {
+		prev_object = a11y;
+        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
+        	atk_focus_tracker_notify (a11y);
+	}
+
+	if (G_IS_HTML_A11Y_TEXT(a11y)) {
+		HTMLA11YText * text = HTML_A11Y_TEXT (a11y);
+		struct idle_data * id = g_malloc (sizeof (struct idle_data));
+
+		id->a11y = a11y;
+		id->pos = pos;
+		id->len = len;
+		if (text->insert_idle_handler) {
+			g_free (text->insert_data);
+			g_source_remove (text->insert_idle_handler);
+		}
+
+		text->insert_idle_handler = g_idle_add (idle_notify_insert, id);
+		text->insert_data = id;
+	} 
+}
+
+static void
+gtk_html_a11y_delete_object_cb (GtkWidget * widget, int pos, int len) 
+{
+	AtkObject * a11y, *obj;
+	HTMLText * text;
+
+        obj = gtk_widget_get_accessible (widget);
+	a11y = gtk_html_a11y_get_focus_object (widget);
+
+	if (prev_object != a11y) {
+		prev_object = a11y;
+        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
+        	atk_focus_tracker_notify (a11y);
+	}
+
+	if (G_IS_HTML_A11Y_TEXT(a11y)) {
+		HTMLA11YText * text = HTML_A11Y_TEXT (a11y);
+
+		struct idle_data * id = g_malloc (sizeof (struct idle_data));
+		id->a11y = a11y;
+		id->pos = pos;
+		id->len = len;
+		if (text->delete_idle_handler) {
+			g_free (text->delete_data);
+			g_source_remove (text->delete_idle_handler);
+		}
+		text->delete_idle_handler = g_idle_add (idle_notify_delete, id);
+		text->delete_data = id;
+	}
+}
+
 AtkObject* 
 gtk_html_a11y_new (GtkWidget *widget)
 {
@@ -214,13 +478,20 @@ gtk_html_a11y_new (GtkWidget *widget)
 	accessible = ATK_OBJECT (object);
 	atk_object_initialize (accessible, widget);
 
-	accessible->role = ATK_ROLE_HTML_CONTAINER;
+	accessible->role = ATK_ROLE_PANEL;
 	g_signal_connect_after(widget, "grab_focus", 
 			G_CALLBACK (gtk_html_a11y_grab_focus_cb),
 			NULL);
 	g_signal_connect_after(widget, "cursor_move",
 			G_CALLBACK(gtk_html_a11y_cursor_move_cb),
 			NULL);
+	g_signal_connect_after(widget, "object_inserted",
+			G_CALLBACK(gtk_html_a11y_insert_object_cb),
+			NULL);
+	g_signal_connect_after(widget, "object_deleted",
+			G_CALLBACK(gtk_html_a11y_delete_object_cb),
+			NULL);
+
 	html_utils_get_accessible(GTK_HTML(widget)->engine->clue, accessible);
 
 	/* printf ("created new gtkhtml accessible object\n"); */
Index: table.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/table.c,v
retrieving revision 1.2
diff -u -p -r1.2 table.c
--- table.c	1 Nov 2002 15:34:27 -0000	1.2
+++ table.c	1 Dec 2004 12:28:12 -0000
@@ -26,8 +26,11 @@
 
 #include "htmltable.h"
 #include "htmltablecell.h"
+#include "gtkhtml.h"
+#include "htmlengine.h"
 
 #include "html.h"
+#include "object.h"
 #include "table.h"
 #include "utils.h"
 
@@ -149,6 +152,30 @@ html_a11y_table_new (HTMLObject *html_ob
 	return accessible;
 }
 
+static gboolean
+is_valid (AtkObject *table)
+{
+	GtkHTMLA11Y * htmla11y = html_a11y_get_gtkhtml_parent (HTML_A11Y (table));
+	GtkHTML *html = GTK_HTML_A11Y_GTKHTML (htmla11y);
+	AtkStateSet *ss;
+
+	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
+	if (!to)
+		return FALSE;
+
+	if (html->engine->parsing)
+		return FALSE;
+
+	ss = atk_object_ref_state_set (ATK_OBJECT (htmla11y));
+	if (atk_state_set_contains_state (ss, ATK_STATE_DEFUNCT)) {
+		g_object_unref (ss);
+		return FALSE;
+	}
+        g_object_unref (ss);
+
+	return TRUE;
+}
+
 /*
  * AtkTable interface
  */
@@ -160,6 +187,10 @@ html_a11y_table_ref_at (AtkTable *table,
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 	HTMLTableCell *cell;
 
+
+	if (!is_valid (ATK_OBJECT (table)))
+		return NULL;
+
 	g_return_val_if_fail (row < to->totalRows, NULL);
 	g_return_val_if_fail (column < to->totalCols, NULL);
 
@@ -179,6 +210,9 @@ html_a11y_table_get_index_at (AtkTable *
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	g_return_val_if_fail (row < to->totalRows, -1);
 	g_return_val_if_fail (column < to->totalCols, -1);
 	g_return_val_if_fail (to->cells [row][column], -1);
@@ -192,6 +226,9 @@ html_a11y_table_get_column_at_index (Atk
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 	HTMLTableCell *cell;
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	cell = HTML_TABLE_CELL (html_object_get_child (HTML_OBJECT (to), index));
 
 	return cell ? cell->col : -1;
@@ -203,6 +240,9 @@ html_a11y_table_get_row_at_index (AtkTab
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 	HTMLTableCell *cell;
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	cell = HTML_TABLE_CELL (html_object_get_child (HTML_OBJECT (to), index));
 
 	return cell ? cell->row : -1;
@@ -213,6 +253,9 @@ html_a11y_table_get_n_columns (AtkTable 
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	return to->totalCols;
 }
 
@@ -221,6 +264,9 @@ html_a11y_table_get_n_rows (AtkTable *ta
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	return to->totalRows;
 }
 
@@ -229,6 +275,9 @@ html_a11y_table_get_column_extent_at (At
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	g_return_val_if_fail (row < to->totalRows, -1);
 	g_return_val_if_fail (column < to->totalCols, -1);
 	g_return_val_if_fail (to->cells [row][column], -1);
@@ -241,6 +290,9 @@ html_a11y_table_get_row_extent_at (AtkTa
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return -1;
+
 	g_return_val_if_fail (row < to->totalRows, -1);
 	g_return_val_if_fail (column < to->totalCols, -1);
 	g_return_val_if_fail (to->cells [row][column], -1);
@@ -254,6 +306,9 @@ html_a11y_table_get_column_header (AtkTa
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
 
+	if (!is_valid (ATK_OBJECT (table)))
+		return NULL;
+
 	g_return_val_if_fail (column < to->totalCols, NULL);
 	g_return_val_if_fail (to->cells [0][column], NULL);
 
@@ -265,6 +320,9 @@ static AtkObject *
 html_a11y_table_get_row_header (AtkTable *table, gint row)
 {
 	HTMLTable *to = HTML_TABLE (HTML_A11Y_HTML (table));
+
+	if (!is_valid (ATK_OBJECT (table)))
+		return NULL;
 
 	g_return_val_if_fail (row < to->totalRows, NULL);
 	g_return_val_if_fail (to->cells [row][0], NULL);
Index: text.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/text.c,v
retrieving revision 1.10
diff -u -p -r1.10 text.c
--- text.c	9 Aug 2004 05:50:30 -0000	1.10
+++ text.c	1 Dec 2004 12:28:19 -0000
@@ -24,6 +24,7 @@
 #include <config.h>
 #include <atk/atkcomponent.h>
 #include <atk/atktext.h>
+#include <glib/gi18n.h>
 
 #include "gtkhtml.h"
 #include "htmlengine.h"
@@ -48,6 +49,8 @@ static void atk_text_interface_init     
 static void html_a11y_text_get_extents   (AtkComponent *component,
 					  gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type);
 static void html_a11y_text_get_size      (AtkComponent *component, gint *width, gint *height);
+static gboolean html_a11y_text_grab_focus (AtkComponent *comp);
+
 static gchar * html_a11y_text_get_text (AtkText *text, gint start_offset, gint end_offset);
 static gchar * html_a11y_text_get_text_after_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type,
 						     gint *start_offset, gint *end_offset);
@@ -87,9 +90,45 @@ static void	html_a11y_text_paste_text	(A
 
 static AtkStateSet* html_a11y_text_ref_state_set	(AtkObject	*accessible);
 
-
 static AtkObjectClass *parent_class = NULL;
 
+static gint
+get_n_actions (AtkAction *action)
+{
+        return 1;
+}
+
+static G_CONST_RETURN gchar*
+action_get_name (AtkAction *action, gint      i)
+{
+        if (i == 0)
+                return _("grab focus");
+
+        return NULL;
+}
+
+static gboolean
+do_action (AtkAction * action, gint i)
+{
+        switch (i) {
+        case 0:
+		return html_a11y_text_grab_focus (ATK_COMPONENT (action));
+        default:
+                return FALSE;
+        }
+}
+
+static void
+atk_action_interface_init (AtkActionIface *iface)
+{
+        g_return_if_fail (iface != NULL);
+
+        iface->do_action = do_action;
+        iface->get_n_actions = get_n_actions;
+        iface->get_name = action_get_name;
+}
+
+
 GType
 html_a11y_text_get_type (void)
 {
@@ -128,10 +167,18 @@ html_a11y_text_get_type (void)
 			NULL
 		};
 
+		static const GInterfaceInfo atk_action_info = {
+			(GInterfaceInitFunc) atk_action_interface_init,
+			(GInterfaceFinalizeFunc) NULL,
+			NULL
+		};
+
+
 		type = g_type_register_static (G_TYPE_HTML_A11Y, "HTMLA11YText", &tinfo, 0);
 		g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
 		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);
+		g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info);
 	}
 
 	return type;
@@ -144,6 +191,7 @@ atk_component_interface_init (AtkCompone
 
 	iface->get_extents = html_a11y_text_get_extents;
 	iface->get_size = html_a11y_text_get_size;
+	iface->grab_focus = html_a11y_text_grab_focus;
 }
 
 static void
@@ -169,6 +217,23 @@ atk_text_interface_init (AtkTextIface *i
 static void
 html_a11y_text_finalize (GObject *obj)
 {
+	HTMLA11YText *text= HTML_A11Y_TEXT (obj);
+
+	g_print ("text object finalize got called\n");
+
+	if (text->insert_idle_handler) {
+		g_source_remove (text->insert_idle_handler);
+		text->insert_idle_handler = 0;
+		g_free (text->insert_data);
+	}
+
+	if (text->delete_idle_handler) {
+		g_source_remove (text->insert_idle_handler);
+		text->insert_idle_handler = 0;
+		g_free (text->delete_data);
+	}
+
+	G_OBJECT_CLASS (parent_class)->finalize (obj);
 }
 
 static void
@@ -248,7 +313,8 @@ html_a11y_text_ref_state_set (AtkObject 
 		atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
 
 	atk_state_set_add_state (state_set, ATK_STATE_MULTI_LINE);
-	atk_state_set_add_state (state_set, ATK_STATE_MULTI_LINE);
+	atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
+	atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
 
 	return state_set;
 }
@@ -295,6 +361,19 @@ html_a11y_text_get_size (AtkComponent *c
 
 	html_a11y_get_size (component, width, height);
 	get_size (obj, width, height);
+}
+
+static gboolean
+html_a11y_text_grab_focus (AtkComponent *comp)
+{
+	GtkHTML *html;
+
+	html = GTK_HTML_A11Y_GTKHTML (html_a11y_get_gtkhtml_parent (HTML_A11Y (comp)));
+	g_return_val_if_fail (html && html->engine && html_engine_get_editable (html->engine), FALSE);
+
+	g_signal_emit_by_name (html, "grab_focus");
+
+        return TRUE;
 }
 
 /*
Index: text.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/text.h,v
retrieving revision 1.2
diff -u -p -r1.2 text.h
--- text.h	1 Nov 2002 15:34:27 -0000	1.2
+++ text.h	1 Dec 2004 12:28:19 -0000
@@ -46,6 +46,10 @@ struct _HTMLA11YText {
 	HTMLA11Y html_a11y_object;
 
 	GailTextUtil *util;
+	guint insert_idle_handler;
+	gpointer insert_data;
+	guint delete_idle_handler;
+	gpointer delete_data;
 };
 
 GType html_a11y_text_get_type (void);
Index: utils.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/utils.c,v
retrieving revision 1.5
diff -u -p -r1.5 utils.c
--- utils.c	1 Sep 2003 04:43:40 -0000	1.5
+++ utils.c	1 Dec 2004 12:28:20 -0000
@@ -88,7 +88,13 @@ create_accessible (HTMLObject *o, AtkObj
 static void
 acc_unref(gpointer data)
 {
+	AtkStateSet * ss;
+
 	g_object_set_data(G_OBJECT(data), HTML_ID, NULL);
+	ss = atk_object_ref_state_set (data);
+
+	atk_state_set_add_state (ss, ATK_STATE_DEFUNCT);
+	atk_object_notify_state_change (data, ATK_STATE_DEFUNCT, TRUE);
 	g_object_unref(G_OBJECT(data));
 }
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.482
diff -u -p -r1.482 ChangeLog
--- ChangeLog	30 Nov 2004 15:21:25 -0000	1.482
+++ ChangeLog	1 Dec 2004 13:34:17 -0000
@@ -1,3 +1,16 @@
+2004-12-01  Mengjie Yu  <meng-jie yu sun com>
+
+	* body.c: (body_properties):add atk name to source entry.
+	* gi-color-combo.c: (color_combo_construct):add atk name to the
+	color preview button.
+	* gi-combo-box.c: (gal_combo_box_init):add atk name to the popup
+	botton.
+	* link.c: (link_widget):set atk names to the entries.
+	* replace.c: (gtk_html_replace_dialog_new):add mnemonic to the 
+	entry.
+	* search.c: (gtk_html_search_dialog_new):add atk desciption to 
+	the search dialog.
+
 2004-11-30  Radek Doulik  <rodo ximian com>
 
 	* gi-*.[ch]: replace all occurences of gal by gi to be sure we
Index: body.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/body.c,v
retrieving revision 1.48
diff -u -p -r1.48 body.c
--- body.c	19 Nov 2004 10:19:51 -0000	1.48
+++ body.c	1 Dec 2004 13:34:20 -0000
@@ -228,6 +228,7 @@ body_properties (GtkHTMLControlData *cd,
 	GSList *group;
 	HTMLColor *color;
 	gint i;
+	AtkObject *a11y;
 
 	*set_data = data;
 	data->cd = cd;
@@ -293,6 +294,9 @@ body_properties (GtkHTMLControlData *cd,
 				     ip->url + off);
 	}
 
+
+	a11y = gtk_widget_get_accessible (gnome_file_entry_gnome_entry (GNOME_FILE_ENTRY (data->pixmap_entry)));
+	atk_object_set_name (a11y, _("Background Image File Path"));
 
 	hbox = gtk_hbox_new (FALSE, 6);
 	gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new_with_mnemonic (_("_Source:")), FALSE, FALSE, 0);
Index: gi-color-combo.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/gi-color-combo.c,v
retrieving revision 1.2
diff -u -p -r1.2 gi-color-combo.c
--- gi-color-combo.c	30 Nov 2004 15:21:25 -0000	1.2
+++ gi-color-combo.c	1 Dec 2004 13:34:24 -0000
@@ -35,6 +35,7 @@
 #include <libgnomecanvas/gnome-canvas.h>
 #include <libgnomecanvas/gnome-canvas-pixbuf.h>
 #include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
+#include <glib/gi18n.h>
 #include "htmlmarshal.h"
 #include "gi-colors.h"
 #include "gi-color-combo.h"
@@ -176,6 +177,7 @@ color_combo_construct (ColorCombo *cc, G
 		       ColorGroup *color_group)
 {
 	GdkColor *color;
+	AtkObject *a11y;
 	g_return_if_fail (cc != NULL);
 	g_return_if_fail (IS_COLOR_COMBO (cc));
 
@@ -183,6 +185,8 @@ color_combo_construct (ColorCombo *cc, G
 	 * Our button with the canvas preview
 	 */
 	cc->preview_button = gtk_button_new ();
+	a11y = gtk_widget_get_accessible (cc->preview_button);
+	atk_object_set_name (a11y, _("color preview"));
 	gtk_button_set_relief (GTK_BUTTON (cc->preview_button), GTK_RELIEF_NONE);
 
 	cc->preview_canvas = GNOME_CANVAS (gnome_canvas_new ());
Index: gi-combo-box.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/gi-combo-box.c,v
retrieving revision 1.3
diff -u -p -r1.3 gi-combo-box.c
--- gi-combo-box.c	30 Nov 2004 15:21:25 -0000	1.3
+++ gi-combo-box.c	1 Dec 2004 13:34:31 -0000
@@ -39,6 +39,7 @@
 #include <gtk/gtktearoffmenuitem.h>
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdkcursor.h>
+#include <glib/gi18n.h>
 #include "gi-combo-box.h"
 #include "gi-utils.h"
 #include "htmlmarshal.h"
@@ -397,7 +398,7 @@ gi_combo_box_init (GiComboBox *combo_box
 {
 	GtkWidget *arrow;
 	GdkCursor *cursor;
-
+	AtkObject *a11y;
 	combo_box->priv = g_new0 (GiComboBoxPrivate, 1);
 
 	/*
@@ -413,6 +414,11 @@ gi_combo_box_init (GiComboBox *combo_box
 	g_signal_connect (combo_box->priv->arrow_button, "toggled",
 			  G_CALLBACK (gtk_combo_toggle_pressed), combo_box);
 	gtk_widget_show_all (combo_box->priv->arrow_button);
+	
+	/* set the a11y name */
+	a11y = gtk_widget_get_accessible (combo_box->priv->arrow_button);
+	atk_object_set_name (a11y, _("Popup"));
+
 
 	/*
 	 * prelight the display widget when mousing over the arrow.
Index: link.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/link.c,v
retrieving revision 1.36
diff -u -p -r1.36 link.c
--- link.c	19 Nov 2004 10:19:52 -0000	1.36
+++ link.c	1 Dec 2004 13:34:33 -0000
@@ -176,6 +176,7 @@ link_widget (GtkHTMLEditLinkProperties *
 {
 	GtkWidget *link_page, *button;
 	GladeXML *xml;
+	AtkObject *a11y;
 
 	xml = glade_xml_new (GLADE_DATADIR "/gtkhtml-editor-properties.glade", "link_page", NULL);
 	if (!xml)
@@ -191,9 +192,13 @@ link_widget (GtkHTMLEditLinkProperties *
 
 	d->entry_url = glade_xml_get_widget (xml, "entry_url");
 	g_signal_connect (d->entry_url, "changed", G_CALLBACK (url_changed), d);
+	a11y = gtk_widget_get_accessible (d->entry_url);
+	atk_object_set_name (a11y, _("URL:"));
 
 	d->entry_description = glade_xml_get_widget (xml, "entry_description");
 	g_signal_connect (d->entry_description, "changed", G_CALLBACK (description_changed), d);
+	a11y = gtk_widget_get_accessible (d->entry_description);
+	atk_object_set_name (a11y, _("Description:"));
 
 	d->label_description = glade_xml_get_widget (xml, "label_description");
 
Index: replace.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/replace.c,v
retrieving revision 1.22
diff -u -p -r1.22 replace.c
--- replace.c	19 Nov 2004 10:19:52 -0000	1.22
+++ replace.c	1 Dec 2004 13:34:35 -0000
@@ -177,10 +177,12 @@ gtk_html_replace_dialog_new (GtkHTML *ht
 		gtk_entry_set_text (GTK_ENTRY (dialog->entry_replace), cd->replace_text_replace);
 
 	gtk_table_set_col_spacings (GTK_TABLE (table), 3);
-	label = gtk_label_new (_("Replace:"));
+	label = gtk_label_new_with_mnemonic (_("R_eplace:"));
+	gtk_label_set_mnemonic_widget (label,dialog-> entry_search);
 	gtk_misc_set_alignment (GTK_MISC (label), .0, .5);
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
-	label = gtk_label_new (_("With:"));
+	label = gtk_label_new_with_mnemonic (_("_With:"));
+	gtk_label_set_mnemonic_widget (label, dialog->entry_replace);
 	gtk_misc_set_alignment (GTK_MISC (label), .0, .5);
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
 
Index: search.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/search.c,v
retrieving revision 1.29
diff -u -p -r1.29 search.c
--- search.c	19 Nov 2004 10:19:52 -0000	1.29
+++ search.c	1 Dec 2004 13:34:37 -0000
@@ -103,7 +103,7 @@ gtk_html_search_dialog_new (GtkHTML *htm
 {
 	GtkHTMLSearchDialog *dialog = g_new (GtkHTMLSearchDialog, 1);
 	GtkWidget *hbox, *vbox;
-
+	AtkObject *a11y;
 	/* we use CANCEL response for close, because we want Esc to close the dialog - see gtkdialog.c */
 	dialog->dialog         = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Find"), NULL, 0,
 									  GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
@@ -115,6 +115,9 @@ gtk_html_search_dialog_new (GtkHTML *htm
 	dialog->regular_exp    = gtk_check_button_new_with_mnemonic (_("_Regular Expression"));
 	dialog->html           = html;
 	dialog->cd             = cd;
+
+	a11y = gtk_widget_get_accessible (dialog->entry);
+	atk_object_set_description (a11y, _("Input the words you want to search here"));
 
 	hbox = gtk_hbox_new (FALSE, 6);
 


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