Index: configure.in
===================================================================
--- configure.in	(revision 1213)
+++ configure.in	(working copy)
@@ -17,6 +17,7 @@
 
 dnl required versions of other programs
 m4_define([gtk_required_version],      [2.0.3])
+m4_define([gail_required_version],     [1.9.0])
 m4_define([libart_required_version],   [2.3.8])
 m4_define([pango_required_version],    [1.0.1])
 m4_define([libglade_required_version], [2.0.0])
@@ -82,6 +83,7 @@
 dnl
 CANVAS_MODULES="dnl
   gtk+-2.0 >= gtk_required_version dnl
+  gail >= gail_required_version dnl
   libart-2.0 >= libart_required_version dnl
   pango >= pango_required_version dnl
   pangoft2 >= pango_required_version"
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1213)
+++ ChangeLog	(working copy)
@@ -1,3 +1,35 @@
+2007-01-17  Bill Haneman <billh@gnome.org>
+
+	Roll ATK support for GnomeCanvas into libgnomecanvas, 
+	formerly it was in libgail.  See bug #363103.
+
+	* configure.in:
+	Depend on libgail explicitly, since the ATK support for
+	gnome-canvas uses some libgail-util API.
+	
+	* libgnomecanvas/gnome-canvas.c:
+	(gnome_canvas_init): Register the gail_canvas factory types
+	with ATK when GnomeCanvas is first used.
+
+	* libgnomevanvas/gailcanvas.[ch]: New, bootstraps 
+	ATK support for GnomeCanvas instances and provides
+	ATK implementations for GnomeCanvas.
+
+	* libgnomevanvas/gailcanvasitem.[ch]: New, ATK support
+	for generic canvas items.
+	
+	* libgnomevanvas/gailcanvaswidget.[ch]: New, ATK support
+	for canvas internal widgets.
+	
+	* libgnomevanvas/gailcanvastext.[ch]: New, ATK support 
+	for canvas text objects.	
+	
+	* libgnomevanvas/gailcanvas*factory.[ch]: New,
+	factories for creating the above ATK peers on demand,
+	that is, when gtk_widget_get_accessible() is called
+	on the corresponding GnomeCanvas instances or their
+	sub-parts.
+
 2006-11-27  Sven Herzberg  <herzi@gnome-de.org>
 
 	* docs/reference/tmpl/gnome-canvas.sgml: commiting documentation about
Index: libgnomecanvas/gailcanvastextfactory.c
===================================================================
--- libgnomecanvas/gailcanvastextfactory.c	(revision 0)
+++ libgnomecanvas/gailcanvastextfactory.c	(revision 0)
@@ -0,0 +1,59 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include "gailcanvastextfactory.h"
+#include "gailcanvastext.h"
+
+static void gail_canvas_text_factory_class_init (GailCanvasTextFactoryClass *klass);
+
+static AtkObject * gail_canvas_text_factory_create_accessible (GObject *obj);
+
+static GType gail_canvas_text_factory_get_accessible_type (void);
+
+G_DEFINE_TYPE (GailCanvasTextFactory,
+	       gail_canvas_text_factory,
+	       ATK_TYPE_OBJECT_FACTORY);
+
+static void
+gail_canvas_text_factory_init (GailCanvasTextFactory *foo)
+{
+  ;
+}
+
+static void 
+gail_canvas_text_factory_class_init (GailCanvasTextFactoryClass *klass)
+{
+  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
+
+  class->create_accessible = gail_canvas_text_factory_create_accessible;
+  class->get_accessible_type = gail_canvas_text_factory_get_accessible_type;
+}
+
+static AtkObject* 
+gail_canvas_text_factory_create_accessible (GObject   *obj)
+{
+  return gail_canvas_text_new (obj);
+}
+
+static GType
+gail_canvas_text_factory_get_accessible_type (void)
+{
+  return GAIL_TYPE_CANVAS_TEXT;
+}
Index: libgnomecanvas/libgnomecanvas-2.0.pc.in
===================================================================
--- libgnomecanvas/libgnomecanvas-2.0.pc.in	(revision 1213)
+++ libgnomecanvas/libgnomecanvas-2.0.pc.in	(working copy)
@@ -6,7 +6,7 @@
 Name: libgnomecanvas-2.0
 Description: libgnomecanvas
 Requires: libart-2.0 gtk+-2.0
-Requires.private: pango pangoft2
+Requires.private: pango pangoft2 gail-1.0
 Version: @VERSION@
 Libs: -L${libdir} -lgnomecanvas-2
 Cflags: -I${includedir}/libgnomecanvas-2.0
Index: libgnomecanvas/gailcanvastextfactory.h
===================================================================
--- libgnomecanvas/gailcanvastextfactory.h	(revision 0)
+++ libgnomecanvas/gailcanvastextfactory.h	(revision 0)
@@ -0,0 +1,53 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_TEXT_FACTORY_H__
+#define __GAIL_CANVAS_TEXT_FACTORY_H__
+
+#include <atk/atkobjectfactory.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_TEXT_FACTORY                 (gail_canvas_text_factory_get_type ())
+#define GAIL_CANVAS_TEXT_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_TEXT_FACTORY, GailCanvasTextFactory))
+#define GAIL_CANVAS_TEXT_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_TEXT_FACTORY, GailCanvasTextFactoryClass))
+#define GAIL_IS_CANVAS_TEXT_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_TEXT_FACTORY))
+#define GAIL_IS_CANVAS_TEXT_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_TEXT_FACTORY))
+#define GAIL_CANVAS_TEXT_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_TEXT_FACTORY, GailCanvasTextFactoryClass))
+
+
+typedef struct _GailCanvasTextFactory                GailCanvasTextFactory;
+typedef struct _GailCanvasTextFactoryClass           GailCanvasTextFactoryClass;
+
+struct _GailCanvasTextFactory
+{
+  AtkObjectFactory parent;
+};
+
+struct _GailCanvasTextFactoryClass
+{
+  AtkObjectFactoryClass parent_class;
+};
+
+GType gail_canvas_text_factory_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_TEXT_FACTORY_H__ */
+
Index: libgnomecanvas/gailcanvasgroup.c
===================================================================
--- libgnomecanvas/gailcanvasgroup.c	(revision 0)
+++ libgnomecanvas/gailcanvasgroup.c	(revision 0)
@@ -0,0 +1,103 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/gnome-canvas.h>
+#include "gailcanvasgroup.h"
+
+static void       gail_canvas_group_class_init      (GailCanvasGroupClass *klass);
+static gint       gail_canvas_group_get_n_children  (AtkObject            *obj);
+static AtkObject* gail_canvas_group_ref_child       (AtkObject            *obj,
+                                                     gint                 i);
+
+G_DEFINE_TYPE(GailCanvasGroup,
+	      gail_canvas_group,
+	      GAIL_TYPE_CANVAS_ITEM);
+
+static void
+gail_canvas_group_init (GailCanvasGroup *foo)
+{
+  ;
+}
+
+AtkObject*
+gail_canvas_group_new (GObject *obj)
+{
+  gpointer object;
+  AtkObject *atk_object;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_GROUP (obj), NULL);
+  object = g_object_new (GAIL_TYPE_CANVAS_GROUP, NULL);
+  atk_object = ATK_OBJECT (object);
+  atk_object_initialize (atk_object, obj);
+  atk_object->role = ATK_ROLE_PANEL;
+  return atk_object;
+}
+
+static void
+gail_canvas_group_class_init (GailCanvasGroupClass *klass)
+{
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+  class->get_n_children = gail_canvas_group_get_n_children;
+  class->ref_child = gail_canvas_group_ref_child;
+}
+
+static gint
+gail_canvas_group_get_n_children (AtkObject *obj)
+{
+  AtkGObjectAccessible *atk_gobject;
+  GnomeCanvasGroup *group;
+  GObject *g_obj;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (obj), 0);
+  atk_gobject = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobject);
+  g_return_val_if_fail (GNOME_IS_CANVAS_GROUP (g_obj), 0);
+  group = GNOME_CANVAS_GROUP (g_obj);
+  return g_list_length (group->item_list);
+}
+
+
+static AtkObject *
+gail_canvas_group_ref_child (AtkObject *obj,
+                             gint      i)
+{
+  AtkGObjectAccessible *atk_gobject;
+  GnomeCanvasGroup *group;
+  GnomeCanvasItem *item;
+  AtkObject *accessible;
+  GObject *g_obj;
+  GList *list_item;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (obj), NULL);
+  atk_gobject = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobject);
+  g_return_val_if_fail (GNOME_IS_CANVAS_GROUP (g_obj), NULL);
+  group = GNOME_CANVAS_GROUP (g_obj);
+
+  list_item = g_list_nth (group->item_list, i);
+  if (!list_item)
+	  return NULL;
+  g_return_val_if_fail (list_item->data, NULL);
+  item = GNOME_CANVAS_ITEM (list_item->data);
+  accessible = atk_gobject_accessible_for_object (G_OBJECT (item));
+  g_object_ref (accessible);
+  return accessible;
+}
Index: libgnomecanvas/gailcanvasitem.c
===================================================================
--- libgnomecanvas/gailcanvasitem.c	(revision 0)
+++ libgnomecanvas/gailcanvasitem.c	(revision 0)
@@ -0,0 +1,515 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <math.h>
+#include <gtk/gtk.h>
+#include <libgnomecanvas/gnome-canvas.h>
+#include <libgnomecanvas/gnome-canvas-util.h>
+#include "gailcanvasitem.h"
+#include <libgail-util/gailmisc.h>
+
+static void       gail_canvas_item_class_init               (GailCanvasItemClass *klass);
+static void       gail_canvas_item_initialize               (AtkObject         *obj,
+		                                             gpointer          data);
+static AtkObject* gail_canvas_item_get_parent               (AtkObject         *obj);
+static gint       gail_canvas_item_get_index_in_parent      (AtkObject         *obj);
+static AtkStateSet* gail_canvas_item_ref_state_set          (AtkObject         *obj);
+
+static void       gail_canvas_item_component_interface_init (AtkComponentIface *iface);
+static guint      gail_canvas_item_add_focus_handler        (AtkComponent      *component,
+					                     AtkFocusHandler   handler);
+static void       gail_canvas_item_get_extents              (AtkComponent      *component,
+					                     gint              *x,
+					                     gint              *y,
+					                     gint              *width,
+					                     gint              *height,
+					                     AtkCoordType      coord_type);
+static gint       gail_canvas_item_get_mdi_zorder           (AtkComponent      *component);
+static gboolean   gail_canvas_item_grab_focus               (AtkComponent      *component);
+static void       gail_canvas_item_remove_focus_handler     (AtkComponent      *component,
+					                     guint             handler_id);
+static gboolean   is_item_on_screen                         (GnomeCanvasItem   *item);
+static void       get_item_extents                          (GnomeCanvasItem   *item,
+					                     gint              *x,
+					                     gint              *y,
+					                     gint              *width,
+					                     gint              *height);
+static gboolean   is_item_in_window                         (GnomeCanvasItem   *item,
+					                     gint              x,
+					                     gint              y,
+					                     gint              width,
+					                     gint              height);
+
+static AtkGObjectAccessibleClass *parent_class = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GailCanvasItem,
+			 gail_canvas_item,
+			 ATK_TYPE_GOBJECT_ACCESSIBLE,
+			 G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT,
+						gail_canvas_item_component_interface_init));
+
+static void
+gail_canvas_item_init (GailCanvasItem *foo)
+{
+  ;
+}
+
+AtkObject*
+gail_canvas_item_new (GObject *obj)
+{
+  gpointer object;
+  AtkObject *atk_object;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (obj), NULL);
+  object = g_object_new (GAIL_TYPE_CANVAS_ITEM, NULL);
+  atk_object = ATK_OBJECT (object);
+  atk_object_initialize (atk_object, obj);
+  atk_object->role = ATK_ROLE_UNKNOWN;
+  return atk_object;
+}
+
+static void
+gail_canvas_item_initialize (AtkObject   *obj,
+		             gpointer    data)
+{
+  ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
+
+  g_object_set_data (G_OBJECT (obj), "atk-component-layer",
+                     GINT_TO_POINTER (ATK_LAYER_MDI));
+}
+
+static void
+gail_canvas_item_class_init (GailCanvasItemClass *klass)
+{
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+  parent_class = g_type_class_peek_parent (klass);
+
+  class->get_parent = gail_canvas_item_get_parent;
+  class->get_index_in_parent = gail_canvas_item_get_index_in_parent;
+  class->ref_state_set = gail_canvas_item_ref_state_set;
+  class->initialize = gail_canvas_item_initialize;
+}
+
+static AtkObject *
+gail_canvas_item_get_parent (AtkObject *obj)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GObject *g_obj;
+  GnomeCanvasItem *item;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (obj), NULL);
+  if (obj->accessible_parent)
+    return obj->accessible_parent;
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobj);
+  if (g_obj == NULL)
+    /* Object is defunct */
+    return NULL;
+
+  item = GNOME_CANVAS_ITEM (g_obj);
+  if (item->parent)
+    return atk_gobject_accessible_for_object (G_OBJECT (item->parent));
+  else
+    return gtk_widget_get_accessible (GTK_WIDGET (item->canvas));
+}
+
+static gint
+gail_canvas_item_get_index_in_parent (AtkObject *obj)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GObject *g_obj;
+  GnomeCanvasItem *item;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (obj), -1);
+  if (obj->accessible_parent)
+    {
+      gint n_children, i;
+      gboolean found = FALSE;
+
+      n_children = atk_object_get_n_accessible_children (obj->accessible_parent);
+      for (i = 0; i < n_children; i++)
+        {
+          AtkObject *child;
+
+          child = atk_object_ref_accessible_child (obj->accessible_parent, i);
+          if (child == obj)
+            found = TRUE;
+
+          g_object_unref (child);
+          if (found)
+            return i;
+        }
+      return -1;
+    }
+
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobj);
+  if (g_obj == NULL)
+    /* Object is defunct */
+    return -1;
+
+  item = GNOME_CANVAS_ITEM (g_obj);
+  if (item->parent)
+    {
+      return g_list_index (GNOME_CANVAS_GROUP (item->parent)->item_list, item);
+    }
+  else
+    {
+      g_return_val_if_fail (item->canvas->root == item, -1);
+      return 0;
+    }
+}
+
+static AtkStateSet*
+gail_canvas_item_ref_state_set (AtkObject         *obj)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GObject *g_obj;
+  GnomeCanvasItem *item;
+  AtkStateSet *state_set;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (obj), NULL);
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (obj);
+
+  state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (obj);
+
+  g_obj = atk_gobject_accessible_get_object (atk_gobj);
+  if (g_obj == NULL)
+    {
+    /* Object is defunct */
+      atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
+    }
+  else
+    {
+      item = GNOME_CANVAS_ITEM (g_obj);
+
+      if (item->object.flags & GNOME_CANVAS_ITEM_VISIBLE)
+        {
+          atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);
+          if (is_item_on_screen (item))
+            {
+              atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
+            }
+        }
+      if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (item->canvas)))
+        {
+          atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
+
+          if (item->canvas->focused_item == item)
+            {
+              atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
+            }
+        }
+    }
+
+  return state_set;
+}
+
+static void
+gail_canvas_item_component_interface_init (AtkComponentIface *iface)
+{
+  g_return_if_fail (iface != NULL);
+
+  iface->add_focus_handler = gail_canvas_item_add_focus_handler;
+  iface->get_extents = gail_canvas_item_get_extents;
+  iface->get_mdi_zorder = gail_canvas_item_get_mdi_zorder;
+  iface->grab_focus = gail_canvas_item_grab_focus;
+  iface->remove_focus_handler = gail_canvas_item_remove_focus_handler;
+}
+
+static guint
+gail_canvas_item_add_focus_handler (AtkComponent    *component,
+                                    AtkFocusHandler handler)
+{
+  GSignalMatchType match_type;
+  gulong ret;
+  guint signal_id;
+
+  match_type = G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC;
+  signal_id = g_signal_lookup ("focus-event", ATK_TYPE_OBJECT);
+
+  ret = g_signal_handler_find (component, match_type, signal_id, 0, NULL,
+                               (gpointer) handler, NULL);
+  if (!ret)
+    {
+      return g_signal_connect_closure_by_id (component,
+                                             signal_id, 0,
+                                             g_cclosure_new (
+                                             G_CALLBACK (handler), NULL,
+                                             (GClosureNotify) NULL),
+                                             FALSE);
+    }
+  else
+    {
+      return 0;
+    }
+}
+
+static void
+gail_canvas_item_get_extents (AtkComponent *component,
+                              gint         *x,
+                              gint         *y,
+                              gint         *width,
+                              gint         *height,
+                              AtkCoordType coord_type)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GObject *obj;
+  GnomeCanvasItem *item;
+  gint window_x, window_y;
+  gint toplevel_x, toplevel_y;
+  gint local_x, local_y;
+
+  g_return_if_fail (GAIL_IS_CANVAS_ITEM (component));
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (component);
+  obj = atk_gobject_accessible_get_object (atk_gobj);
+
+  if (obj == NULL) 
+    /* item is defunct */
+    return;
+
+  /* Get the GnomeCanvasItem */
+  item = GNOME_CANVAS_ITEM (obj);
+
+  /* If this item has no parent canvas, something's broken */
+  g_return_if_fail (GTK_IS_WIDGET (item->canvas));
+
+  get_item_extents (item, &local_x, &local_y, width, height);  
+  if (!is_item_in_window (item, local_x, local_y, *width, *height))
+    {
+      *x = G_MININT;
+      *y = G_MININT;
+      return;
+    }
+
+  gail_misc_get_origins (GTK_WIDGET (item->canvas), &window_x, &window_y,
+                         &toplevel_x, &toplevel_y);
+  *x = local_x + window_x - toplevel_x;
+  *y = local_y + window_y - toplevel_y;
+
+  /* If screen coordinates are requested, modify x and y appropriately */
+  if (coord_type == ATK_XY_SCREEN)
+    {
+      *x += toplevel_x;
+      *y += toplevel_y;
+    }
+  return;
+}
+
+static gint
+gail_canvas_item_get_mdi_zorder (AtkComponent *component)
+{
+  g_return_val_if_fail (ATK_OBJECT (component), -1); 
+
+  return gail_canvas_item_get_index_in_parent (ATK_OBJECT (component));
+}
+
+static gboolean
+gail_canvas_item_grab_focus (AtkComponent    *component)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GObject *obj;
+  GnomeCanvasItem *item;
+  GtkWidget *toplevel;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_ITEM (component), FALSE);
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (component);
+  obj = atk_gobject_accessible_get_object (atk_gobj);
+
+  /* Get the GnomeCanvasItem */
+  item = GNOME_CANVAS_ITEM (obj);
+  if (item == NULL)
+    /* item is defunct */
+    return FALSE;
+
+  gnome_canvas_item_grab_focus (item);
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->canvas));
+  if (GTK_WIDGET_TOPLEVEL (toplevel))
+    gtk_window_present (GTK_WINDOW (toplevel));
+
+  return TRUE;
+}
+
+static void
+gail_canvas_item_remove_focus_handler (AtkComponent *component,
+                                       guint        handler_id)
+{
+  g_signal_handler_disconnect (ATK_OBJECT (component), handler_id);
+}
+
+static gboolean 
+is_item_on_screen (GnomeCanvasItem *item)
+{
+  gint x, y, width, height;
+ 
+  get_item_extents (item, &x, &y, &width, &height);
+  return is_item_in_window (item, x, y, width, height);
+}
+
+static void
+get_item_extents (GnomeCanvasItem   *item,
+                  gint              *x,
+                  gint              *y,
+                  gint              *width,
+                  gint              *height)
+{
+  double bx1, by1, bx2, by2;
+  double i2c[6];
+  ArtPoint p1, p2, p3, p4;
+  ArtPoint q1, q2, q3, q4;
+  double min_x1, min_y1, min_x2, min_y2;
+  double max_x1, max_y1, max_x2, max_y2;
+  int x1, y1, x2, y2;
+  int scroll_x, scroll_y;
+
+  /* Get the bounding box in item-relative coordinates */
+
+  bx1 = by1 = bx2 = by2 = 0.0;
+
+  if (GNOME_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (item))->bounds)
+    (* GNOME_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (item))->bounds) (item, &bx1, &by1, &bx2, &by2);
+
+  /* Get the item coordinates -> canvas pixel coordinates affine */
+
+  gnome_canvas_item_i2c_affine (item, i2c);
+
+  /* Convert the bounding box to canvas pixel coordinates and find its minimum
+   * surrounding rectangle.
+   */
+  
+  p1.x = p2.x = bx1;
+  p1.y = p4.y = by1;
+  p3.x = p4.x = bx2;
+  p2.y = p3.y = by2;
+
+  art_affine_point (&q1, &p1, i2c);
+  art_affine_point (&q2, &p2, i2c);
+  art_affine_point (&q3, &p3, i2c);
+  art_affine_point (&q4, &p4, i2c);
+
+  if (q1.x < q2.x)
+    {
+      min_x1 = q1.x;
+      max_x1 = q2.x;
+    }
+  else
+    {
+      min_x1 = q2.x;
+      max_x1 = q1.x;
+    }
+
+  if (q1.y < q2.y)
+    {
+      min_y1 = q1.y;
+      max_y1 = q2.y;
+    }
+  else
+    {
+      min_y1 = q2.y;
+      max_y1 = q1.y;
+    }
+
+  if (q3.x < q4.x)
+    {
+      min_x2 = q3.x;
+      max_x2 = q4.x;
+    }
+  else
+    {
+      min_x2 = q4.x;
+      max_x2 = q3.x;
+    }
+
+  if (q3.y < q4.y)
+    {
+      min_y2 = q3.y;
+      max_y2 = q4.y;
+    }
+  else
+    {
+      min_y2 = q4.y;
+      max_y2 = q3.y;
+    }
+
+  bx1 = MIN (min_x1, min_x2);
+  by1 = MIN (min_y1, min_y2);
+  bx2 = MAX (max_x1, max_x2);
+  by2 = MAX (max_y1, max_y2);
+
+  /* Convert to integer coordinates */
+
+  x1 = floor (bx1);
+  y1 = floor (by1);
+  x2 = ceil (bx2);
+  y2 = ceil (by2);
+
+  gnome_canvas_get_scroll_offsets (item->canvas, &scroll_x, &scroll_y);
+
+  if (x)
+    *x = x1 - scroll_x;
+
+  if (y)
+    *y = y1 - scroll_y;
+
+  if (width)
+    *width = x2 - x1;
+
+  if (height)
+    *height = y2 - y1;
+}
+
+static gboolean
+is_item_in_window (GnomeCanvasItem   *item,
+                   gint              x,
+                   gint              y,
+                   gint              width,
+                   gint              height)
+{
+  GtkWidget *widget;
+  gboolean retval;
+
+  widget = GTK_WIDGET (item->canvas);
+  if (widget->window)
+    {
+      int window_width, window_height;
+ 
+      gdk_window_get_geometry (widget->window, NULL, NULL, 
+                               &window_width, &window_height, NULL);
+      /*
+       * Check whether rectangles intersect
+       */
+      if (x + width <= 0  ||
+          y + height <= 0 ||
+          x > window_width  ||
+          y > window_height)
+        {
+          retval = FALSE;
+        }
+      else
+        {
+          retval = TRUE;
+        }
+    }
+  else
+    {
+      retval = FALSE;
+    }
+  return retval;
+}
Index: libgnomecanvas/gailcanvasgroup.h
===================================================================
--- libgnomecanvas/gailcanvasgroup.h	(revision 0)
+++ libgnomecanvas/gailcanvasgroup.h	(revision 0)
@@ -0,0 +1,55 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_GROUP_H__
+#define __GAIL_CANVAS_GROUP_H__
+
+#include <libgnomecanvas/gnome-canvas.h>
+#include <atk/atk.h>
+#include "gailcanvasitem.h"
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_GROUP                  (gail_canvas_group_get_type ())
+#define GAIL_CANVAS_GROUP(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_GROUP, GailCanvasGroup))
+#define GAIL_CANVAS_GROUP_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_GROUP, GailCanvasGroupClass))
+#define GAIL_IS_CANVAS_GROUP(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_GROUP))
+#define GAIL_IS_CANVAS_GROUP_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_GROUP))
+#define GAIL_CANVAS_GROUP_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_GROUP, GailCanvasGroupClass))
+
+typedef struct _GailCanvasGroup                 GailCanvasGroup;
+typedef struct _GailCanvasGroupClass            GailCanvasGroupClass;
+
+struct _GailCanvasGroup
+{
+  GailCanvasItem parent;
+};
+
+GType gail_canvas_group_get_type (void);
+
+struct _GailCanvasGroupClass
+{
+  GailCanvasItemClass parent_class;
+};
+
+AtkObject* gail_canvas_group_new (GObject *obj);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_GROUP_H__ */
Index: libgnomecanvas/gailcanvasitem.h
===================================================================
--- libgnomecanvas/gailcanvasitem.h	(revision 0)
+++ libgnomecanvas/gailcanvasitem.h	(revision 0)
@@ -0,0 +1,54 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_ITEM_H__
+#define __GAIL_CANVAS_ITEM_H__
+
+#include <libgnomecanvas/gnome-canvas.h>
+#include <atk/atk.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_ITEM                  (gail_canvas_item_get_type ())
+#define GAIL_CANVAS_ITEM(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_ITEM, GailCanvasItem))
+#define GAIL_CANVAS_ITEM_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_ITEM, GailCanvasItemClass))
+#define GAIL_IS_CANVAS_ITEM(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_ITEM))
+#define GAIL_IS_CANVAS_ITEM_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_ITEM))
+#define GAIL_CANVAS_ITEM_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_ITEM, GailCanvasItemClass))
+
+typedef struct _GailCanvasItem                 GailCanvasItem;
+typedef struct _GailCanvasItemClass            GailCanvasItemClass;
+
+struct _GailCanvasItem
+{
+  AtkGObjectAccessible parent;
+};
+
+GType gail_canvas_item_get_type (void);
+
+struct _GailCanvasItemClass
+{
+  AtkGObjectAccessibleClass parent_class;
+};
+
+AtkObject* gail_canvas_item_new (GObject *obj);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_ITEM_H__ */
Index: libgnomecanvas/gailcanvaswidgetfactory.c
===================================================================
--- libgnomecanvas/gailcanvaswidgetfactory.c	(revision 0)
+++ libgnomecanvas/gailcanvaswidgetfactory.c	(revision 0)
@@ -0,0 +1,58 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "gailcanvaswidgetfactory.h"
+#include "gailcanvaswidget.h"
+
+static void gail_canvas_widget_factory_class_init (GailCanvasWidgetFactoryClass *klass);
+
+static AtkObject * gail_canvas_widget_factory_create_accessible (GObject *obj);
+
+static GType gail_canvas_widget_factory_get_accessible_type (void);
+
+G_DEFINE_TYPE (GailCanvasWidgetFactory,
+	       gail_canvas_widget_factory,
+	       ATK_TYPE_OBJECT_FACTORY);
+
+static void
+gail_canvas_widget_factory_init (GailCanvasWidgetFactory *foo)
+{
+  ;
+}
+
+static void 
+gail_canvas_widget_factory_class_init (GailCanvasWidgetFactoryClass *klass)
+{
+  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
+
+  class->create_accessible = gail_canvas_widget_factory_create_accessible;
+  class->get_accessible_type = gail_canvas_widget_factory_get_accessible_type;
+}
+
+static AtkObject* 
+gail_canvas_widget_factory_create_accessible (GObject   *obj)
+{
+  return gail_canvas_widget_new (obj);
+}
+
+static GType
+gail_canvas_widget_factory_get_accessible_type (void)
+{
+  return GAIL_TYPE_CANVAS_WIDGET;
+}
Index: libgnomecanvas/gailcanvas.c
===================================================================
--- libgnomecanvas/gailcanvas.c	(revision 0)
+++ libgnomecanvas/gailcanvas.c	(revision 0)
@@ -0,0 +1,229 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/gnome-canvas.h>
+#include <libgnomecanvas/gnome-canvas-text.h>
+#include <libgnomecanvas/gnome-canvas-rich-text.h>
+#include "gailcanvas.h"
+#include "gailcanvasitem.h"
+#include "gailcanvasgroupfactory.h"
+#include "gailcanvastextfactory.h"
+#include "gailcanvasitemfactory.h"
+#include "gailcanvaswidgetfactory.h"
+
+static void       gail_canvas_class_init          (GailCanvasClass *klass);
+static void       gail_canvas_real_initialize     (AtkObject       *obj,
+                                                   gpointer        data);
+
+static gint       gail_canvas_get_n_children      (AtkObject       *obj);
+static AtkObject* gail_canvas_ref_child           (AtkObject       *obj,
+                                                   gint            i);
+
+static void       adjustment_changed              (GtkAdjustment   *adjustment,
+                                                   GnomeCanvas     *canvas);
+
+
+
+GType
+gail_canvas_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type)
+    {
+      GType parent_type = g_type_parent (GNOME_TYPE_CANVAS_ITEM);      
+      AtkObjectFactory *factory = atk_registry_get_factory (
+				   atk_get_default_registry (), 
+				   parent_type);
+      GType atkobject_parent_type = atk_object_factory_get_accessible_type (factory);
+      GTypeQuery query;
+      g_type_query (atkobject_parent_type, &query);
+      static GTypeInfo tinfo =
+      {
+        0, /* class size */
+        (GBaseInitFunc) NULL, /* base init */
+        (GBaseFinalizeFunc) NULL, /* base finalize */
+        (GClassInitFunc) gail_canvas_class_init, /* class init */
+        (GClassFinalizeFunc) NULL, /* class finalize */
+        NULL, /* class data */
+        0, /* instance size */
+        0, /* nb preallocs */
+        (GInstanceInitFunc) NULL, /* instance init */
+        NULL /* value table */
+      };
+      tinfo.class_size = query.class_size;
+      tinfo.instance_size = query.instance_size;
+
+      /* use the size obtained from the parent type factory */
+      type = g_type_register_static (parent_type,
+                                     "GailCanvas", &tinfo, 0);
+    }
+
+  return type;
+}
+
+static AtkObjectClass *parent_atk_object_class;
+
+/**
+ * Tell ATK how to create the appropriate AtkObject peers 
+ **/
+void
+gail_canvas_init (GType widget_type)
+{
+  atk_registry_set_factory_type (atk_get_default_registry (),
+				 widget_type, 
+				 gail_canvas_widget_factory_get_type ());
+  atk_registry_set_factory_type (atk_get_default_registry (),
+				 GNOME_TYPE_CANVAS_GROUP, 
+				 gail_canvas_group_factory_get_type ());
+  atk_registry_set_factory_type (atk_get_default_registry (),
+				 GNOME_TYPE_CANVAS_TEXT, 
+				 gail_canvas_text_factory_get_type ());
+  atk_registry_set_factory_type (atk_get_default_registry (),
+				 GNOME_TYPE_CANVAS_RICH_TEXT, 
+				 gail_canvas_text_factory_get_type ());
+  atk_registry_set_factory_type (atk_get_default_registry (),
+				 GNOME_TYPE_CANVAS_ITEM, 
+				 gail_canvas_item_factory_get_type ());
+}
+
+static void
+gail_canvas_class_init (GailCanvasClass *klass)
+{
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+  parent_atk_object_class = g_type_class_peek_parent (klass);
+
+  class->get_n_children = gail_canvas_get_n_children;
+  class->ref_child = gail_canvas_ref_child;
+  class->initialize = gail_canvas_real_initialize;
+}
+
+AtkObject* 
+gail_canvas_new (GtkWidget *widget)
+{
+  GObject *object;
+  AtkObject *accessible;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS (widget), NULL);
+
+  object = g_object_new (GAIL_TYPE_CANVAS, NULL);
+
+  accessible = ATK_OBJECT (object);
+  atk_object_initialize (accessible, widget);
+
+  return accessible;
+}
+
+
+static void
+gail_canvas_real_initialize (AtkObject *obj,
+                             gpointer  data)
+{
+  GnomeCanvas *canvas;
+  GtkAdjustment *adj;
+
+  parent_atk_object_class->initialize (obj, data);
+
+  canvas = GNOME_CANVAS (data);
+
+  adj = canvas->layout.hadjustment;
+  g_signal_connect (adj,
+                    "value_changed",
+                    G_CALLBACK (adjustment_changed),
+                    canvas);
+
+  adj = canvas->layout.vadjustment;
+  g_signal_connect (adj,
+                    "value_changed",
+                    G_CALLBACK (adjustment_changed),
+                    canvas);
+
+  obj->role =  ATK_ROLE_LAYERED_PANE;
+}
+
+static gint 
+gail_canvas_get_n_children (AtkObject* obj)
+{
+  GtkAccessible *accessible;
+  GtkWidget *widget;
+  GnomeCanvas *canvas;
+  GnomeCanvasGroup *root_group;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS (obj), 0);
+
+  accessible = GTK_ACCESSIBLE (obj);
+  widget = accessible->widget;
+  if (widget == NULL)
+    /* State is defunct */
+    return 0;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS (widget), 0);
+
+  canvas = GNOME_CANVAS (widget);
+  root_group = gnome_canvas_root (canvas);
+  g_return_val_if_fail (root_group, 0);
+  return 1;
+}
+
+static AtkObject* 
+gail_canvas_ref_child (AtkObject *obj,
+		       gint       i)
+{
+  GtkAccessible *accessible;
+  GtkWidget *widget;
+  GnomeCanvas *canvas;
+  GnomeCanvasGroup *root_group;
+  AtkObject *atk_object;
+
+  /* Canvas only has one child, so return NULL if anything else is requested */
+  if (i != 0)
+    return NULL;
+  g_return_val_if_fail (GAIL_IS_CANVAS (obj), NULL);
+
+  accessible = GTK_ACCESSIBLE (obj);
+  widget = accessible->widget;
+  if (widget == NULL)
+    /* State is defunct */
+    return NULL;
+  g_return_val_if_fail (GNOME_IS_CANVAS (widget), NULL);
+
+  canvas = GNOME_CANVAS (widget);
+  root_group = gnome_canvas_root (canvas);
+  g_return_val_if_fail (root_group, NULL);
+
+  atk_object = atk_gobject_accessible_for_object (G_OBJECT (root_group));
+  g_object_ref (atk_object);
+  return atk_object;
+}
+
+static void
+adjustment_changed (GtkAdjustment *adjustment,
+                    GnomeCanvas   *canvas)
+{
+  AtkObject *atk_obj;
+
+  /*
+   * The scrollbars have changed
+   */
+  atk_obj = gtk_widget_get_accessible (GTK_WIDGET (canvas));
+
+  g_signal_emit_by_name (atk_obj, "visible_data_changed");
+}
+
Index: libgnomecanvas/gailcanvaswidgetfactory.h
===================================================================
--- libgnomecanvas/gailcanvaswidgetfactory.h	(revision 0)
+++ libgnomecanvas/gailcanvaswidgetfactory.h	(revision 0)
@@ -0,0 +1,53 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_WIDGET_FACTORY_H__
+#define __GAIL_CANVAS_WIDGET_FACTORY_H__
+
+#include <atk/atkobjectfactory.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_WIDGET_FACTORY                 (gail_canvas_widget_factory_get_type ())
+#define GAIL_CANVAS_WIDGET_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_WIDGET_FACTORY, GailCanvasWidgetFactory))
+#define GAIL_CANVAS_WIDGET_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_WIDGET_FACTORY, GailCanvasWidgetFactoryClass))
+#define GAIL_IS_CANVAS_WIDGET_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_WIDGET_FACTORY))
+#define GAIL_IS_CANVAS_WIDGET_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_WIDGET_FACTORY))
+#define GAIL_CANVAS_WIDGET_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_WIDGET_FACTORY, GailCanvasWidgetFactoryClass))
+
+
+typedef struct _GailCanvasWidgetFactory                GailCanvasWidgetFactory;
+typedef struct _GailCanvasWidgetFactoryClass           GailCanvasWidgetFactoryClass;
+
+struct _GailCanvasWidgetFactory
+{
+  AtkObjectFactory parent;
+};
+
+struct _GailCanvasWidgetFactoryClass
+{
+  AtkObjectFactoryClass parent_class;
+};
+
+GType gail_canvas_widget_factory_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_WIDGET_FACTORY_H__ */
+
Index: libgnomecanvas/gailcanvaswidget.c
===================================================================
--- libgnomecanvas/gailcanvaswidget.c	(revision 0)
+++ libgnomecanvas/gailcanvaswidget.c	(revision 0)
@@ -0,0 +1,115 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/gnome-canvas.h>
+#include <libgnomecanvas/gnome-canvas-widget.h>
+#include "gailcanvaswidget.h"
+
+static void       gail_canvas_widget_class_init               (GailCanvasWidgetClass *klass);
+
+static gint       gail_canvas_widget_get_n_children           (AtkObject            *obj);
+static AtkObject* gail_canvas_widget_ref_child                (AtkObject            *obj,
+                                                               gint                 i);
+
+G_DEFINE_TYPE (GailCanvasWidget,
+	       gail_canvas_widget,
+	       GAIL_TYPE_CANVAS_ITEM);
+
+static void
+gail_canvas_widget_init (GailCanvasWidget *foo)
+{
+  ;
+}
+
+AtkObject*
+gail_canvas_widget_new (GObject *obj)
+{
+  gpointer object;
+  AtkObject *atk_object;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_WIDGET (obj), NULL);
+  object = g_object_new (GAIL_TYPE_CANVAS_WIDGET, NULL);
+  atk_object = ATK_OBJECT (object);
+  atk_object_initialize (atk_object, obj);
+  atk_object->role = ATK_ROLE_PANEL;
+  return atk_object;
+}
+
+static void
+gail_canvas_widget_class_init (GailCanvasWidgetClass *klass)
+{
+  AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+  class->get_n_children = gail_canvas_widget_get_n_children;
+  class->ref_child = gail_canvas_widget_ref_child;
+}
+
+static gint 
+gail_canvas_widget_get_n_children (AtkObject *obj)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GnomeCanvasWidget *canvas_widget;
+  GObject *g_obj;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_WIDGET (obj), 0);
+
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobj);
+  if (g_obj == NULL)
+    /* State is defunct */
+    return 0;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_WIDGET (g_obj), 0);
+
+  canvas_widget = GNOME_CANVAS_WIDGET (g_obj);
+  g_return_val_if_fail (canvas_widget->widget, 0);
+  return 1;
+}
+
+static AtkObject *
+gail_canvas_widget_ref_child (AtkObject *obj,
+                              gint      i)
+{
+  AtkGObjectAccessible *atk_gobj;
+  GnomeCanvasWidget *canvas_widget;
+  GObject *g_obj;
+  AtkObject *atk_child;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_WIDGET (obj), NULL);
+
+  if (i != 0)
+    return NULL;
+
+  atk_gobj = ATK_GOBJECT_ACCESSIBLE (obj);
+  g_obj = atk_gobject_accessible_get_object (atk_gobj);
+  if (g_obj == NULL)
+    /* State is defunct */
+    return NULL;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_WIDGET (g_obj), NULL);
+
+  canvas_widget = GNOME_CANVAS_WIDGET (g_obj);
+  g_return_val_if_fail (canvas_widget->widget, NULL);
+
+  atk_child = gtk_widget_get_accessible (canvas_widget->widget);
+  g_object_ref (atk_child);
+  atk_object_set_parent (atk_child, obj);
+  return atk_child;
+}
Index: libgnomecanvas/gailcanvasgroupfactory.c
===================================================================
--- libgnomecanvas/gailcanvasgroupfactory.c	(revision 0)
+++ libgnomecanvas/gailcanvasgroupfactory.c	(revision 0)
@@ -0,0 +1,77 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include "gailcanvasgroupfactory.h"
+#include "gailcanvasgroup.h"
+
+static void gail_canvas_group_factory_class_init (GailCanvasGroupFactoryClass *klass);
+
+static AtkObject * gail_canvas_group_factory_create_accessible (GObject *obj);
+
+static GType gail_canvas_group_factory_get_accessible_type (void);
+
+GType
+gail_canvas_group_factory_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) 
+  {
+    static const GTypeInfo tinfo =
+    {
+      sizeof (GailCanvasGroupFactoryClass),
+      (GBaseInitFunc) NULL, /* base init */
+      (GBaseFinalizeFunc) NULL, /* base finalize */
+      (GClassInitFunc) gail_canvas_group_factory_class_init, /* class init */
+      (GClassFinalizeFunc) NULL, /* class finalize */
+      NULL, /* class data */
+      sizeof (GailCanvasGroupFactory), /* instance size */
+      0, /* nb preallocs */
+      (GInstanceInitFunc) NULL, /* instance init */
+      NULL /* value table */
+    };
+    type = g_type_register_static (
+                           ATK_TYPE_OBJECT_FACTORY, 
+                           "GailCanvasGroupFactory" , &tinfo, 0);
+  }
+
+  return type;
+}
+
+static void 
+gail_canvas_group_factory_class_init (GailCanvasGroupFactoryClass *klass)
+{
+  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
+
+  class->create_accessible = gail_canvas_group_factory_create_accessible;
+  class->get_accessible_type = gail_canvas_group_factory_get_accessible_type;
+}
+
+static AtkObject* 
+gail_canvas_group_factory_create_accessible (GObject   *obj)
+{
+  return gail_canvas_group_new (obj);
+}
+
+static GType
+gail_canvas_group_factory_get_accessible_type (void)
+{
+  return GAIL_TYPE_CANVAS_GROUP;
+}
Index: libgnomecanvas/gailcanvastext.c
===================================================================
--- libgnomecanvas/gailcanvastext.c	(revision 0)
+++ libgnomecanvas/gailcanvastext.c	(revision 0)
@@ -0,0 +1,523 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+#include "gailcanvasitem.h"
+#include "gailcanvastext.h"
+#include <libgail-util/gail-util.h>
+
+struct _GailCanvasText
+{
+  GailCanvasItem parent;
+  GailTextUtil *textutil;
+};
+
+static void           gail_canvas_text_class_init          (GailCanvasTextClass *klass);
+static void           gail_canvas_text_text_interface_init (AtkTextIface        *iface);
+static gchar*         gail_canvas_text_get_text            (AtkText             *text,
+                                                            gint                start_offset,
+                                                            gint                end_offset);
+static gchar*         gail_canvas_text_get_text_after_offset 
+                                                           (AtkText             *text,
+                                                            gint                offset,
+                                                            AtkTextBoundary     boundary_type,
+                                                            gint                *start_offset,
+                                                            gint                *end_offset);
+static gchar*         gail_canvas_text_get_text_at_offset  (AtkText             *text,
+                                                            gint                offset,
+                                                            AtkTextBoundary     boundary_type,
+                                                            gint                *start_offset,
+                                                            gint                *end_offset);
+static gchar*         gail_canvas_text_get_text_before_offset 
+                                                           (AtkText             *text,
+                                                            gint                offset,
+                                                            AtkTextBoundary     boundary_type,
+                                                            gint                *start_offset,
+                                                            gint                *end_offset);
+static gunichar       gail_canvas_text_get_character_at_offset 
+                                                            (AtkText            *text,
+                                                             gint               offset);
+static gint           gail_canvas_text_get_character_count  (AtkText            *text);
+static gint           gail_canvas_text_get_caret_offset     (AtkText            *text);
+static gboolean       gail_canvas_text_set_caret_offset     (AtkText            *text,
+                                                             gint               offset);
+static gint           gail_canvas_text_get_offset_at_point  (AtkText            *text,
+                                                             gint               x,
+                                                             gint               y,
+				                             AtkCoordType       coords);
+static void           gail_canvas_text_get_character_extents (AtkText           *text,
+                                                              gint              offset,
+                                                              gint              *x,
+                                                              gint              *y,
+                                                              gint              *width,
+                                                              gint              *height,
+                                                              AtkCoordType      coords);
+static AtkAttributeSet* 
+                      gail_canvas_text_get_run_attributes    (AtkText           *text,
+                                                              gint              offset,
+                                                              gint              *start_offset,
+                                                              gint              *end_offset);
+static AtkAttributeSet* 
+                      gail_canvas_text_get_default_attributes (AtkText          *text);
+static gint           gail_canvas_text_get_n_selections      (AtkText           *text);
+static gchar*         gail_canvas_text_get_selection         (AtkText           *text,
+                                                              gint              selection_num,
+                                                              gint              *start_pos,
+                                                              gint              *end_pos);
+static gboolean       gail_canvas_text_add_selection         (AtkText           *text,
+                                                              gint              start_pos,
+                                                              gint              end_pos);
+static gboolean       gail_canvas_text_remove_selection      (AtkText           *text,
+                                                              gint              selection_num);
+static gboolean       gail_canvas_text_set_selection         (AtkText           *text,
+                                                              gint              selection_num,
+                                                              gint              start_pos,
+                                                              gint              end_pos);
+static gchar*         get_text_near_offset                   (AtkText           *text,
+                                                              GailOffsetType    function,
+                                                              AtkTextBoundary   boundary_type,
+                                                              gint              offset,
+                                                              gint              *start_offset,
+                                                              gint              *end_offset);
+
+G_DEFINE_TYPE_WITH_CODE(GailCanvasText, 
+			gail_canvas_text, 
+			GAIL_TYPE_CANVAS_ITEM, 
+			G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT,
+					       gail_canvas_text_text_interface_init);)
+
+static void
+gail_canvas_text_init (GailCanvasText *foo)
+{
+  ;
+}
+
+AtkObject*
+gail_canvas_text_new (GObject *obj)
+{
+  gpointer object;
+  AtkObject *atk_object;
+  GailCanvasText *gail_text;
+
+  g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (obj), NULL);
+  object = g_object_new (GAIL_TYPE_CANVAS_TEXT, NULL);
+  atk_object = ATK_OBJECT (object);
+  gail_text = GAIL_CANVAS_TEXT (object);
+
+  atk_object_initialize (atk_object, obj);
+  gail_text->textutil = gail_text_util_new ();
+
+  if (GNOME_IS_CANVAS_RICH_TEXT (obj))
+    {
+      gail_text_util_buffer_setup (gail_text->textutil,
+				     gnome_canvas_rich_text_get_buffer (GNOME_CANVAS_RICH_TEXT (obj)));
+    }
+  else if (GNOME_IS_CANVAS_TEXT (obj))
+    {
+      gail_text_util_text_setup (gail_text->textutil,
+				   GNOME_CANVAS_TEXT (obj)->text);
+    }
+
+  atk_object->role =  ATK_ROLE_TEXT;
+  return atk_object;
+}
+
+static void
+gail_canvas_text_class_init (GailCanvasTextClass *klass)
+{
+}
+
+static void
+gail_canvas_text_text_interface_init (AtkTextIface *iface)
+{
+  g_return_if_fail (iface != NULL);
+
+  iface->get_text = gail_canvas_text_get_text;
+  iface->get_text_after_offset = gail_canvas_text_get_text_after_offset;
+  iface->get_text_at_offset = gail_canvas_text_get_text_at_offset;
+  iface->get_text_before_offset = gail_canvas_text_get_text_before_offset;
+  iface->get_character_at_offset = gail_canvas_text_get_character_at_offset;
+  iface->get_character_count = gail_canvas_text_get_character_count;
+  iface->get_caret_offset = gail_canvas_text_get_caret_offset;
+  iface->set_caret_offset = gail_canvas_text_set_caret_offset;
+  iface->get_offset_at_point = gail_canvas_text_get_offset_at_point;
+  iface->get_character_extents = gail_canvas_text_get_character_extents;
+  iface->get_n_selections = gail_canvas_text_get_n_selections;
+  iface->get_selection = gail_canvas_text_get_selection;
+  iface->add_selection = gail_canvas_text_add_selection;
+  iface->remove_selection = gail_canvas_text_remove_selection;
+  iface->set_selection = gail_canvas_text_set_selection;
+  iface->get_run_attributes = gail_canvas_text_get_run_attributes;
+  iface->get_default_attributes = gail_canvas_text_get_default_attributes;
+}
+
+static gchar*
+gail_canvas_text_get_text (AtkText *text,
+                           gint    start_offset,
+                           gint    end_offset)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter start, end;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), NULL);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, NULL);
+
+  buffer = gail_text->textutil->buffer;
+  gtk_text_buffer_get_iter_at_offset (buffer, &start, start_offset);
+  gtk_text_buffer_get_iter_at_offset (buffer, &end, end_offset);
+
+  return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+}
+
+static gchar*
+gail_canvas_text_get_text_after_offset (AtkText         *text,
+                                        gint            offset,
+                                        AtkTextBoundary boundary_type,
+                                        gint            *start_offset,
+                                        gint            *end_offset)
+{
+  return get_text_near_offset (text, GAIL_AFTER_OFFSET,
+                               boundary_type, offset, 
+                               start_offset, end_offset);
+}
+
+static gchar*
+gail_canvas_text_get_text_at_offset (AtkText         *text,
+                                     gint            offset,
+                                     AtkTextBoundary boundary_type,
+                                     gint            *start_offset,
+                                     gint            *end_offset)
+{
+  return get_text_near_offset (text, GAIL_AT_OFFSET,
+                               boundary_type, offset, 
+                               start_offset, end_offset);
+}
+
+static gchar*
+gail_canvas_text_get_text_before_offset (AtkText         *text,
+                                         gint            offset,
+                                         AtkTextBoundary boundary_type,
+                                         gint            *start_offset,
+                                         gint            *end_offset)
+{
+  return get_text_near_offset (text, GAIL_BEFORE_OFFSET,
+                               boundary_type, offset, 
+                               start_offset, end_offset);
+}
+
+static gunichar
+gail_canvas_text_get_character_at_offset (AtkText *text,
+                                          gint    offset)
+{
+  GailCanvasText *gail_item;
+  GtkTextIter start, end;
+  GtkTextBuffer *buffer;
+  gchar *string;
+  gchar *index;
+  gunichar unichar;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), '\0');
+  gail_item = GAIL_CANVAS_TEXT (text);
+  buffer = gail_item->textutil->buffer;
+  if (offset >= gtk_text_buffer_get_char_count (buffer))
+    return '\0';
+
+  gtk_text_buffer_get_start_iter (buffer, &start);
+  gtk_text_buffer_get_end_iter (buffer, &end);
+  string = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+  index = g_utf8_offset_to_pointer (string, offset);
+
+  unichar = g_utf8_get_char (index);
+  g_free (string);
+  return unichar;
+}
+
+static gint
+gail_canvas_text_get_character_count (AtkText *text)
+{
+  GtkTextBuffer *buffer;
+  GailCanvasText *gail_text;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), 0);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, 0);
+  buffer = gail_text->textutil->buffer;
+  return gtk_text_buffer_get_char_count (buffer);
+}
+
+static gint
+gail_canvas_text_get_caret_offset (AtkText *text)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextMark *cursor_mark;
+  GtkTextIter cursor_itr;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), 0);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, 0);
+  buffer = gail_text->textutil->buffer;
+  cursor_mark = gtk_text_buffer_get_insert (buffer);
+  gtk_text_buffer_get_iter_at_mark (buffer, &cursor_itr, cursor_mark);
+  return gtk_text_iter_get_offset (&cursor_itr);
+}
+
+static gboolean
+gail_canvas_text_set_caret_offset (AtkText *text,
+                                   gint    offset)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter pos_itr;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), FALSE);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, FALSE);
+  buffer = gail_text->textutil->buffer;
+  gtk_text_buffer_get_iter_at_offset (buffer,  &pos_itr, offset);
+  gtk_text_buffer_move_mark_by_name (buffer, "insert", &pos_itr);
+  return TRUE;
+}
+
+static gint
+gail_canvas_text_get_offset_at_point (AtkText      *text,
+                                      gint         x,
+                                      gint         y,
+                                      AtkCoordType coords)
+{
+  return -1;
+}
+
+static void
+gail_canvas_text_get_character_extents (AtkText      *text,
+                                        gint         offset,
+                                        gint         *x,
+                                        gint         *y,
+                                        gint         *width,
+                                        gint         *height,
+                                        AtkCoordType coords)
+{
+  return;
+}
+
+static AtkAttributeSet*
+gail_canvas_text_get_run_attributes (AtkText *text,
+                                     gint    offset,
+                                     gint    *start_offset,
+                                     gint    *end_offset)
+{
+  GailCanvasText *gail_text;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), NULL);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, NULL);
+
+  return gail_misc_buffer_get_run_attributes (gail_text->textutil->buffer,
+                                              offset, start_offset, end_offset);
+}
+
+static AtkAttributeSet*
+gail_canvas_text_get_default_attributes (AtkText *text)
+{
+  return NULL;
+}
+
+static gint
+gail_canvas_text_get_n_selections (AtkText *text)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter start, end;
+  gint select_start, select_end;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), -1);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, -1);
+  buffer = gail_text->textutil->buffer;
+  
+  gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
+  select_start = gtk_text_iter_get_offset (&start);
+  select_end = gtk_text_iter_get_offset (&end);
+
+  if (select_start != select_end)
+     return 1;
+  else
+     return 0;
+}
+
+static gchar*
+gail_canvas_text_get_selection (AtkText *text,
+                                gint    selection_num,
+                                gint    *start_pos,
+                                gint    *end_pos)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter start, end;
+
+ /* Only let the user get the selection if one is set, and if the
+  * selection_num is 0.
+  */
+  if (selection_num != 0)
+     return NULL;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), NULL);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, NULL);
+  buffer = gail_text->textutil->buffer;
+
+  gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
+  *start_pos = gtk_text_iter_get_offset (&start);
+  *end_pos = gtk_text_iter_get_offset (&end);
+
+  if (*start_pos != *end_pos)
+    return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+  else
+    return NULL;
+}
+
+static gboolean
+gail_canvas_text_add_selection (AtkText *text,
+                                gint    start_pos,
+                                gint    end_pos)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter pos_itr;
+  GtkTextIter start, end;
+  gint select_start, select_end;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), FALSE);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, FALSE);
+  buffer = gail_text->textutil->buffer;
+
+  gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
+  select_start = gtk_text_iter_get_offset (&start);
+  select_end = gtk_text_iter_get_offset (&end);
+
+ /* If there is already a selection, then don't allow another to be added,
+  * since GtkTextView only supports one selected region.
+  */
+  if (select_start == select_end)
+    {
+      gtk_text_buffer_get_iter_at_offset (buffer,  &pos_itr, start_pos);
+      gtk_text_buffer_move_mark_by_name (buffer, "insert", &pos_itr);
+      gtk_text_buffer_get_iter_at_offset (buffer,  &pos_itr, end_pos);
+      gtk_text_buffer_move_mark_by_name (buffer, "selection_bound", &pos_itr);
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
+static gboolean
+gail_canvas_text_remove_selection (AtkText *text,
+                                 gint    selection_num)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextMark *cursor_mark;
+  GtkTextIter cursor_itr;
+  GtkTextIter start, end;
+  gint select_start, select_end;
+
+  if (selection_num != 0)
+     return FALSE;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), FALSE);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, FALSE);
+  buffer = gail_text->textutil->buffer;
+
+  gtk_text_buffer_get_selection_bounds(buffer, &start, &end);
+  select_start = gtk_text_iter_get_offset(&start);
+  select_end = gtk_text_iter_get_offset(&end);
+
+  if (select_start != select_end)
+    {
+     /* Setting the start & end of the selected region to the caret position
+      * turns off the selection.
+      */
+      cursor_mark = gtk_text_buffer_get_insert (buffer);
+      gtk_text_buffer_get_iter_at_mark (buffer, &cursor_itr, cursor_mark);
+      gtk_text_buffer_move_mark_by_name (buffer, "insert", &cursor_itr);
+      gtk_text_buffer_move_mark_by_name (buffer, "selection_bound", &cursor_itr);
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
+
+
+static gboolean
+gail_canvas_text_set_selection (AtkText *text,
+                              gint    selection_num,
+                              gint    start_pos,
+                              gint    end_pos)
+{
+  GailCanvasText *gail_text;
+  GtkTextBuffer *buffer;
+  GtkTextIter pos_itr;
+  GtkTextIter start, end;
+  gint select_start, select_end;
+
+ /* Only let the user move the selection if one is set, and if the
+  * selection_num is 0
+  */
+  if (selection_num != 0)
+     return FALSE;
+
+  g_return_val_if_fail (GAIL_IS_CANVAS_TEXT (text), FALSE);
+  gail_text = GAIL_CANVAS_TEXT (text);
+  g_return_val_if_fail (gail_text->textutil, FALSE);
+  buffer = gail_text->textutil->buffer;
+
+  gtk_text_buffer_get_selection_bounds(buffer, &start, &end);
+  select_start = gtk_text_iter_get_offset(&start);
+  select_end = gtk_text_iter_get_offset(&end);
+
+  if (select_start != select_end)
+    {
+      gtk_text_buffer_get_iter_at_offset (buffer,  &pos_itr, start_pos);
+      gtk_text_buffer_move_mark_by_name (buffer, "insert", &pos_itr);
+      gtk_text_buffer_get_iter_at_offset (buffer,  &pos_itr, end_pos);
+      gtk_text_buffer_move_mark_by_name (buffer, "selection_bound", &pos_itr);
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
+static gchar*
+get_text_near_offset (AtkText          *text,
+                      GailOffsetType   function,
+                      AtkTextBoundary  boundary_type,
+                      gint             offset,
+                      gint             *start_offset,
+                      gint             *end_offset)
+{
+  return gail_text_util_get_text (GAIL_CANVAS_TEXT (text)->textutil, NULL,
+                                  function, boundary_type, offset, 
+                                  start_offset, end_offset);
+}
Index: libgnomecanvas/gailcanvas.h
===================================================================
--- libgnomecanvas/gailcanvas.h	(revision 0)
+++ libgnomecanvas/gailcanvas.h	(revision 0)
@@ -0,0 +1,52 @@
+/* gailcanvas.h - code from GAIL, the 
+ * Gnome Accessibility Implementation Library
+ * Copyright 2001-2006 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_H__
+#define __GAIL_CANVAS_H__
+
+#include <gtk/gtkaccessible.h>
+
+/* This code provides the ATK implementation for gnome-canvas widgets. */
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS                  (gail_canvas_get_type ())
+#define GAIL_CANVAS(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS, GailCanvas))
+#define GAIL_CANVAS_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS, GailCanvasClass))
+#define GAIL_IS_CANVAS(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS))
+#define GAIL_IS_CANVAS_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS))
+#define GAIL_CANVAS_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS, GailCanvasClass))
+
+typedef struct _GailCanvas                 GailCanvas;
+typedef struct _GailCanvasClass            GailCanvasClass;
+
+GType gail_canvas_get_type (void);
+
+struct _GailCanvas;
+
+struct _GailCanvasClass;
+
+AtkObject* gail_canvas_new (GtkWidget *widget);
+
+void gail_canvas_init (GType canvas_type);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_H__ */
Index: libgnomecanvas/gnome-canvas.c
===================================================================
--- libgnomecanvas/gnome-canvas.c	(revision 1213)
+++ libgnomecanvas/gnome-canvas.c	(working copy)
@@ -81,6 +81,7 @@
 #include <gdk/gdkprivate.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtksignal.h>
+#include "gailcanvas.h"
 #include "gnome-canvas.h"
 #include "gnome-canvas-i18n.h"
 #include "libart_lgpl/art_rect.h"
@@ -159,8 +160,9 @@
 
 		canvas_item_type = g_type_register_static (GTK_TYPE_OBJECT, "GnomeCanvasItem",
 							   &object_info, 0);
+		/* Tell ATK how to create the appropriate AtkObject peers */
+		gail_canvas_init (canvas_item_type);
 	}
-
 	return canvas_item_type;
 }
 
Index: libgnomecanvas/gailcanvasitemfactory.c
===================================================================
--- libgnomecanvas/gailcanvasitemfactory.c	(revision 0)
+++ libgnomecanvas/gailcanvasitemfactory.c	(revision 0)
@@ -0,0 +1,59 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include "gailcanvasitemfactory.h"
+#include "gailcanvasitem.h"
+
+static void gail_canvas_item_factory_class_init (GailCanvasItemFactoryClass *klass);
+
+static AtkObject* gail_canvas_item_factory_create_accessible (GObject *obj);
+
+static GType gail_canvas_item_factory_get_accessible_type (void);
+
+G_DEFINE_TYPE (GailCanvasItemFactory,
+	       gail_canvas_item_factory,
+	       ATK_TYPE_OBJECT_FACTORY);
+
+static void
+gail_canvas_item_factory_init (GailCanvasItemFactory *foo)
+{
+  ;
+}
+
+static void 
+gail_canvas_item_factory_class_init (GailCanvasItemFactoryClass *klass)
+{
+  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
+
+  class->create_accessible = gail_canvas_item_factory_create_accessible;
+  class->get_accessible_type = gail_canvas_item_factory_get_accessible_type;
+}
+
+static AtkObject* 
+gail_canvas_item_factory_create_accessible (GObject   *obj)
+{
+  return gail_canvas_item_new (obj);
+}
+
+static GType
+gail_canvas_item_factory_get_accessible_type (void)
+{
+  return GAIL_TYPE_CANVAS_ITEM;
+}
Index: libgnomecanvas/gailcanvaswidget.h
===================================================================
--- libgnomecanvas/gailcanvaswidget.h	(revision 0)
+++ libgnomecanvas/gailcanvaswidget.h	(revision 0)
@@ -0,0 +1,55 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_WIDGET_H__
+#define __GAIL_CANVAS_WIDGET_H__
+
+#include <libgnomecanvas/gnome-canvas.h>
+#include <atk/atk.h>
+#include "gailcanvasitem.h"
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_WIDGET                  (gail_canvas_widget_get_type ())
+#define GAIL_CANVAS_WIDGET(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_WIDGET, GailCanvasWidget))
+#define GAIL_CANVAS_WIDGET_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_WIDGET, GailCanvasWidgetClass))
+#define GAIL_IS_CANVAS_WIDGET(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_WIDGET))
+#define GAIL_IS_CANVAS_WIDGET_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_WIDGET))
+#define GAIL_CANVAS_WIDGET_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_WIDGET, GailCanvasWidgetClass))
+
+typedef struct _GailCanvasWidget                 GailCanvasWidget;
+typedef struct _GailCanvasWidgetClass            GailCanvasWidgetClass;
+
+struct _GailCanvasWidget
+{
+  GailCanvasItem parent;
+};
+
+GType gail_canvas_widget_get_type (void);
+
+struct _GailCanvasWidgetClass
+{
+  GailCanvasItemClass parent_class;
+};
+
+AtkObject* gail_canvas_widget_new (GObject *obj);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_WIDGET_H__ */
Index: libgnomecanvas/gailcanvasgroupfactory.h
===================================================================
--- libgnomecanvas/gailcanvasgroupfactory.h	(revision 0)
+++ libgnomecanvas/gailcanvasgroupfactory.h	(revision 0)
@@ -0,0 +1,53 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_GROUP_FACTORY_H__
+#define __GAIL_CANVAS_GROUP_FACTORY_H__
+
+#include <atk/atkobjectfactory.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_GROUP_FACTORY                 (gail_canvas_group_factory_get_type ())
+#define GAIL_CANVAS_GROUP_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_GROUP_FACTORY, GailCanvasGroupFactory))
+#define GAIL_CANVAS_GROUP_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_GROUP_FACTORY, GailCanvasGroupFactoryClass))
+#define GAIL_IS_CANVAS_GROUP_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_GROUP_FACTORY))
+#define GAIL_IS_CANVAS_GROUP_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_GROUP_FACTORY))
+#define GAIL_CANVAS_GROUP_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_GROUP_FACTORY, GailCanvasGroupFactoryClass))
+
+
+typedef struct _GailCanvasGroupFactory                GailCanvasGroupFactory;
+typedef struct _GailCanvasGroupFactoryClass           GailCanvasGroupFactoryClass;
+
+struct _GailCanvasGroupFactory
+{
+  AtkObjectFactory parent;
+};
+
+struct _GailCanvasGroupFactoryClass
+{
+  AtkObjectFactoryClass parent_class;
+};
+
+GType gail_canvas_group_factory_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_GROUP_FACTORY_H__ */
+
Index: libgnomecanvas/gailcanvastext.h
===================================================================
--- libgnomecanvas/gailcanvastext.h	(revision 0)
+++ libgnomecanvas/gailcanvastext.h	(revision 0)
@@ -0,0 +1,52 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_TEXT_H__
+#define __GAIL_CANVAS_TEXT_H__
+
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <atk/atk.h>
+#include "gailcanvasitem.h"
+#include <libgail-util/gailtextutil.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_TEXT                  (gail_canvas_text_get_type ())
+#define GAIL_CANVAS_TEXT(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_TEXT, GailCanvasText))
+#define GAIL_CANVAS_TEXT_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_TEXT, GailCanvasTextClass))
+#define GAIL_IS_CANVAS_TEXT(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_TEXT))
+#define GAIL_IS_CANVAS_TEXT_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_TEXT))
+#define GAIL_CANVAS_TEXT_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_TEXT, GailCanvasTextClass))
+
+typedef struct _GailCanvasText                 GailCanvasText;
+typedef struct _GailCanvasTextClass            GailCanvasTextClass;
+
+GType
+gail_canvas_text_get_type (void);
+
+struct _GailCanvasTextClass
+{
+  GailCanvasItemClass parent_class;
+};
+
+AtkObject* gail_canvas_text_new (GObject *obj);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_TEXT_H__ */
Index: libgnomecanvas/gailcanvasitemfactory.h
===================================================================
--- libgnomecanvas/gailcanvasitemfactory.h	(revision 0)
+++ libgnomecanvas/gailcanvasitemfactory.h	(revision 0)
@@ -0,0 +1,53 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GAIL_CANVAS_ITEM_FACTORY_H__
+#define __GAIL_CANVAS_ITEM_FACTORY_H__
+
+#include <atk/atkobjectfactory.h>
+
+G_BEGIN_DECLS
+
+#define GAIL_TYPE_CANVAS_ITEM_FACTORY                 (gail_canvas_item_factory_get_type ())
+#define GAIL_CANVAS_ITEM_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CANVAS_ITEM_FACTORY, GailCanvasItemFactory))
+#define GAIL_CANVAS_ITEM_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CANVAS_ITEM_FACTORY, GailCanvasItemFactoryClass))
+#define GAIL_IS_CANVAS_ITEM_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CANVAS_ITEM_FACTORY))
+#define GAIL_IS_CANVAS_ITEM_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CANVAS_ITEM_FACTORY))
+#define GAIL_CANVAS_ITEM_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CANVAS_ITEM_FACTORY, GailCanvasItemFactoryClass))
+
+
+typedef struct _GailCanvasItemFactory                GailCanvasItemFactory;
+typedef struct _GailCanvasItemFactoryClass           GailCanvasItemFactoryClass;
+
+struct _GailCanvasItemFactory
+{
+  AtkObjectFactory parent;
+};
+
+struct _GailCanvasItemFactoryClass
+{
+  AtkObjectFactoryClass parent_class;
+};
+
+GType gail_canvas_item_factory_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GAIL_CANVAS_ITEM_FACTORY_H__ */
+
Index: libgnomecanvas/Makefile.am
===================================================================
--- libgnomecanvas/Makefile.am	(revision 1213)
+++ libgnomecanvas/Makefile.am	(working copy)
@@ -24,7 +24,7 @@
 
 libgnomecanvasincludedir = $(includedir)/libgnomecanvas-2.0/libgnomecanvas
 
-libgnomecanvasinclude_HEADERS =			\
+libgnomecanvas_public_h_sources =			\
 	gnome-canvas-shape.h			\
 	gnome-canvas-bpath.h			\
 	gnome-canvas-clipgroup.h		\
@@ -40,10 +40,20 @@
 	gnome-canvas.h				\
 	libgnomecanvas.h
 
-libgnomecanvas_2_la_SOURCES =			\
-	$(libgnomecanvasinclude_HEADERS)	\
+libgnomecanvas_private_h_sources = 	\
+	gnome-canvas-shape-private.h	\
+	gailcanvas.h			\
+	gailcanvasitem.h		\
+	gailcanvasgroup.h		\
+	gailcanvaswidget.h		\
+	gailcanvastext.h		\
+	gailcanvasitemfactory.h		\
+	gailcanvasgroupfactory.h	\
+	gailcanvaswidgetfactory.h	\
+	gailcanvastextfactory.h
+
+libgnomecanvas_c_sources =			\
 	gnome-canvas-shape.c			\
-	gnome-canvas-shape-private.h		\
 	gnome-canvas-bpath.c			\
 	gnome-canvas-path-def.c			\
 	gnome-canvas-clipgroup.c		\
@@ -57,8 +67,24 @@
 	gnome-canvas-util.c			\
 	gnome-canvas-widget.c			\
 	gnome-canvas.c				\
-	libgnomecanvastypes.c
+	libgnomecanvastypes.c			\
+	gailcanvas.c				\
+	gailcanvasitem.c			\
+	gailcanvasgroup.c			\
+	gailcanvaswidget.c			\
+	gailcanvastext.c			\
+	gailcanvasitemfactory.c			\
+	gailcanvasgroupfactory.c		\
+	gailcanvaswidgetfactory.c		\
+	gailcanvastextfactory.c	
 
+libgnomecanvas_2_la_SOURCES =			\
+	$(libgnomecanvas_c_sources)	\
+	$(libgnomecanvas_private_h_sources)
+
+libgnomecanvasinclude_HEADERS = 	\
+	$(libgnomecanvas_public_h_sources)
+
 $(libgnomecanvas_2_la_OBJECTS): $(marshal_sources)
 
 marshal_sources =				\
Index: docs/reference/Makefile.am
===================================================================
--- docs/reference/Makefile.am	(revision 1213)
+++ docs/reference/Makefile.am	(working copy)
@@ -22,7 +22,9 @@
 
 # Header files to ignore when scanning.
 IGNORE_HFILES=gnome-canvas-shape-private.h gnome-canvas-i18n.h \
-  gnome-canvas-marshal.h
+  gnome-canvas-marshal.h gailcanvas.h gailcanvasitem.h gailcanvaswidget.h \
+  gailcanvasgroup.h gailcanvasgroupfactory.h gailcanvasitemfactory.h \
+  gailcanvastextfactory.h gailcanvaswidgetfactory.h gailcanvastext.h
 
 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
 # contains GtkObjects/GObjects and you want to document signals and properties.
