Added files:
authormarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 4 Sep 2001 16:32:07 +0000 (16:32 +0000)
committermarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 4 Sep 2001 16:32:07 +0000 (16:32 +0000)
libspi/action.c libspi/action.h libspi/editabletext.c libspi/editabletext.h libspi/hyperlink.c libspi/hyperlink.h
libspi/hypertext.c libspi/hypertext.h libspi/image.c libspi/image.h libspi/selection.c libspi/selection.h
libspi/table.c libspi/table.h libspi/text.c libspi/text.h libspi/value.c libspi/value.h
Added server implementations for outstanding ATK interfaces not yet implemented.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@53 e2bd861d-eb25-0410-b326-f6ed22b6b98c

24 files changed:
ChangeLog
cspi/Makefile.am
cspi/spi.h
libspi/Makefile.am
libspi/accessible.c
libspi/action.c [new file with mode: 0644]
libspi/action.h [new file with mode: 0644]
libspi/editabletext.c [new file with mode: 0644]
libspi/editabletext.h [new file with mode: 0644]
libspi/hyperlink.c [new file with mode: 0644]
libspi/hyperlink.h [new file with mode: 0644]
libspi/hypertext.c [new file with mode: 0644]
libspi/hypertext.h [new file with mode: 0644]
libspi/image.c [new file with mode: 0644]
libspi/image.h [new file with mode: 0644]
libspi/selection.c [new file with mode: 0644]
libspi/selection.h [new file with mode: 0644]
libspi/table.c [new file with mode: 0644]
libspi/table.h [new file with mode: 0644]
libspi/text.c [new file with mode: 0644]
libspi/text.h [new file with mode: 0644]
libspi/value.c [new file with mode: 0644]
libspi/value.h [new file with mode: 0644]
po/ChangeLog

index 31f4707..d52d80e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+<2001-09-04 Marc Mulcahy <marc.mulcahy@sun.com>
+       * idl/Action.idl:
+               changed return value of Action from void to boolean to bring in line with ATK.
+
+       * idl/Text.idl:
+               Changed getText funcions to return "out" start and end offsets.
+               Changed getAttributes to take and offset and return the start and end offset of the attribute run.
+               Changed getOffsetAtPoint and getCharacterExtents to take an enum describing whether coordinates are window or screen.
+
+       * Added files:
+               libspi/action.c libspi/action.h libspi/editabletext.c libspi/editabletext.h libspi/hyperlink.c libspi/hyperlink.h
+               libspi/hypertext.c libspi/hypertext.h libspi/image.c libspi/image.h libspi/selection.c libspi/selection.h
+               libspi/table.c libspi/table.h libspi/text.c libspi/text.h libspi/value.c libspi/value.h
+                       Added server implementations for outstanding ATK interfaces not yet implemented.
+
 2001-09-04  Bill Haneman <bill.haneman@sun.com>
 
        * idl/Action.idl:
index 8bbd81c..d25c8a2 100644 (file)
@@ -25,7 +25,16 @@ SPICSOURCES =        spi_main.c              \
                     spi_event.c        \
                     spi_registry.c     \
                     spi_accessible.c   \
+                    spi_action.c\
                     spi_application.c  \
-                    spi_component.c
+                    spi_component.c\
+                    spi_editabletext.c\
+                    spi_hyperlink.c\
+                    spi_hypertext.c\
+                    spi_image.c\
+                    spi_selection.c\
+                    spi_table.c\
+                    spi_text.c\
+                    spi_value.c
 
 spi.c : $(SPICSOURCES)
index 9b9ed85..a008d88 100644 (file)
@@ -827,9 +827,14 @@ AccessibleEditableText_ref (AccessibleEditableText *obj);
 int
 AccessibleEditableText_unref (AccessibleEditableText *obj);
 
+boolean
+AccessibleEditableText_setRunAttributes (AccessibleEditableText *obj,
+                                        const char *attributes,
+                                        long startPos, long endPos);
+
 void
 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
-                                        char *newContents);
+                                        const char *newContents);
 
 void
 AccessibleEditableText_insertText (AccessibleEditableText *obj,
@@ -837,17 +842,6 @@ AccessibleEditableText_insertText (AccessibleEditableText *obj,
                                    char *text,
                                    long length);
 
-boolean
-AccessibleEditableText_selectText (AccessibleEditableText *obj,
-                                   long startPos,
-                                   long endPos);
-
-boolean
-AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
-                                      long startPos,
-                                      long endPos,
-                                      char *attributes);
-
 void
 AccessibleEditableText_copyText (AccessibleText *obj,
                                  long startPos,
@@ -887,7 +881,7 @@ AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
                             long i);
 
 Accessible
-AccessibleHyperlink_getAnchor (AccessibleHyperlink *obj,
+AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
                                long i);
 
 void
@@ -939,8 +933,8 @@ AccessibleImage_getImageDescription (AccessibleImage *obj);
 void
 AccessibleImage_getImageSize (AccessibleImage *obj,
                               long *width,
-                              long *height,
-                              AccessibleCoordType ctype);
+                              long *height);
+
 void
 AccessibleImage_getImagePosition (AccessibleImage *obj,
                                   long *x,
@@ -980,10 +974,10 @@ int
 AccessibleSelection_unref (AccessibleSelection *obj);
 
 long
-AccessibleSelwection_getNSelectedChildren (AccessibleSelection *obj);
+AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj);
 
 Accessible *
-AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
+AccessibleSelection_refSelectedChild (AccessibleSelection *obj,
                                       long selectedChildIndex);
 
 boolean
@@ -1054,7 +1048,7 @@ AccessibleTable_ref (AccessibleTable *obj);
 int
 AccessibleTable_unref (AccessibleTable *obj);
 
-Accessible *
+char *
 AccessibleTable_getCaption (AccessibleTable *obj);
 
 Accessible *
@@ -1067,7 +1061,7 @@ long
 AccessibleTable_getNColumns (AccessibleTable *obj);
 
 Accessible *
-AccessibleTable_getAccessibleAt (AccessibleTable *obj,
+AccessibleTable_refAt (AccessibleTable *obj,
                                  long row,
                                  long column);
 
@@ -1085,10 +1079,12 @@ AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
                                   long index);
 
 char *
-AccessibleTable_getRowDescription (AccessibleTable *obj);
+AccessibleTable_getRowDescription (AccessibleTable *obj,
+                                  long row);
 
 char *
-AccessibleTable_getColumnDescription (AccessibleTable *obj);
+AccessibleTable_getColumnDescription (AccessibleTable *obj,
+                                     long column);
 
 long
 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
@@ -1100,11 +1096,13 @@ AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
                                    long row,
                                    long column);
 
-AccessibleTable *
-AccessibleTable_getRowHeaders (AccessibleTable *obj);
+Accessible *
+AccessibleTable_getRowHeader (AccessibleTable *obj,
+                             long row);
 
-AccessibleTable *
-AccessibleTable_getColumnHeaders (AccessibleTable *obj);
+Accessible *
+AccessibleTable_getColumnHeader (AccessibleTable *obj,
+                                long column);
 
 long
 AccessibleTable_getNSelectedRows (AccessibleTable *obj);
@@ -1156,6 +1154,13 @@ AccessibleText_getText (AccessibleText *obj,
 long
 AccessibleText_getCaretOffset (AccessibleText *obj);
 
+char *
+AccessibleText_refRunAttributes (AccessibleText *obj,
+                                long offset,
+                                long *startOffset,
+                                long *endOfset);
+
+
 boolean
 AccessibleText_setCaretOffset (AccessibleText *obj,
                                long newOffset);
@@ -1163,27 +1168,24 @@ AccessibleText_setCaretOffset (AccessibleText *obj,
 char *
 AccessibleText_getTextBeforeOffset (AccessibleText *obj,
                                     long offset,
-                                    TEXT_BOUNDARY_TYPE type);
+                                    TEXT_BOUNDARY_TYPE type,
+                                   long *startOffset, long *endOffset);
 
 char *
-AccessibleText_getTextAtOffset (Accessible *obj,
-                                long offset,
-                                TEXT_BOUNDARY_TYPE type);
+AccessibleText_getTextAtOffset (AccessibleText *obj,
+                                    long offset,
+                                    TEXT_BOUNDARY_TYPE type,
+                               long *startOffset, long *endOffset);
 
 char *
 AccessibleText_getTextAfterOffset (AccessibleText *obj,
-                                   long offset,
-                                   TEXT_BOUNDARY_TYPE type);
-
+                                    long offset,
+                                    TEXT_BOUNDARY_TYPE type,
+                                  long *startOffset, long *endOffset);
 char
 AccessibleText_getCharacterAtOffset (AccessibleText *obj,
                                      long offset);
 
-char *
-AccessibleText_getAttributes (AccessibleText *obj,
-                              long startOffset,
-                              long endOffset);
-
 boolean
 AccessibleText_getCharacterExtents (AccessibleText *obj,
                                     long offset,
@@ -1197,18 +1199,28 @@ AccessibleText_getOffsetAtPoint (AccessibleText *obj,
                                  long x,
                                  long y);
 
-char *
-AccessibleText_getSelectedText (AccessibleText *obj);
+long
+AccessibleText_getNSelections (AccessibleText *obj);
 
 void
-AccessibleText_getSelectionBounds (AccessibleText *obj,
-                                   long *startOffset,
-                                   long *endOffset);
+AccessibleText_getSelection (AccessibleText *obj,
+                            long selectionNum, long *startOffset,
+                            long *endOffset);
+
+
+boolean
+AccessibleText_addSelection (AccessibleText *obj,
+                            long startOffset, long endOffset);
+
+boolean
+AccessibleText_removeSelection (AccessibleText *obj,
+                               long selectionNum);
 
 boolean
-AccessibleText_setSelectionBounds (AccessibleText *obj,
-                                   long startOffset,
-                                   long endOffset);
+AccessibleText_setSelection (AccessibleText *obj,
+                            long selectionNum,
+                            long startOffset,
+                            long endOffset);
 
 /*
  *
index af5a601..f3d02aa 100644 (file)
@@ -15,9 +15,18 @@ CFLAGS += $(DEBUG_CFLAGS)
 libspiincludedir = $(includedir)/libspi
 
 libspiinclude_HEADERS = accessible.h       \
-                       component.h        \
+                       action.h\
                         application.h      \
+                       component.h\
                         desktop.h          \
+                       editabletext.h\
+                       hyperlink.h\
+                       hypertext.h\
+                       image.h\
+                       selection.h\
+                       table.h\
+                       text.h\
+                       value.h\
                         listener.h         \
                        accessibleeventlistener.h       \
                         registry.h         \
@@ -41,12 +50,30 @@ CLEANFILES+=$(IDL_OUT) Accessibility-imodule.c
 
 libspi_la_SOURCES = accessible.c         \
                     accessible.h         \
-                    application.c        \
+                    action.c\
+                   action.h\
+                   application.c        \
                     application.h        \
                    component.c          \
                    component.h          \
                     desktop.c            \
                     desktop.h            \
+                   editabletext.c\
+                   editabletext.h\
+                   hyperlink.c\
+                   hyperlink.h\
+                   hypertext.c\
+                   hypertext.h\
+                   image.c\
+                   image.h\
+                   selection.c\
+                   selection.h\
+                   table.c\
+                   table.h\
+                   text.c\
+                   text.h\
+                   value.c\
+                   value.h\
                     listener.c           \
                     listener.h           \
                    accessibleeventlistener.c   \
index 9dd14f8..e811ef4 100644 (file)
@@ -256,19 +256,17 @@ accessible_new (AtkObject *o)
     retval->atko = ATK_OBJECT (o);
 
     /*
-     * TODO: add interface containers/constructors for ACTION, EDITABLE_TEXT, HYPERTEXT,
+     * TODO: add interface containers/constructors for EDITABLE_TEXT, HYPERTEXT,
      *  IMAGE, SELECTION, TABLE, TEXT, VALUE.
      */
 
     /* add appropriate ATK interfaces */
 
-    /* Action: not yet implemented
     if (ATK_IS_ACTION (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (action_interface_new (o)));
+                                     bonobo_object (action_new (ATK_ACTION(o))));
       }
-    */
 
     if (ATK_IS_COMPONENT (o))
       {
@@ -276,38 +274,49 @@ accessible_new (AtkObject *o)
                                      bonobo_object (component_interface_new (o)));
       }
 
-    /* Others: not yet implemented
     if (ATK_IS_EDITABLE_TEXT (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (editable_text_interface_new (o)));
+                                     bonobo_object (editable_text_new (ATK_EDITABLE_TEXT(o))));
       }
+
     else if (ATK_IS_HYPERTEXT (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (hypertext_interface_new (o)));
+                                     bonobo_object (hypertext_new (o)));
       }
+
     else if (ATK_IS_TEXT (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (text_interface_new (o)));
+                                     bonobo_object (text_new (o)));
+      }
+
+    if (ATK_IS_HYPERLINK (o))
+      {
+       bonobo_object_add_interface (bonobo_object (retval),
+                                    bonobo_object (hyperlink_new(ATK_HYPERLINK(o))));
       }
+
     if (ATK_IS_IMAGE (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (image_interface_new (o)));
+                                     bonobo_object (image_new (o)));
       }
+
     if (ATK_IS_SELECTION (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (selection_interface_new (o)));
+                                     bonobo_object (selection_new (o)));
       }
+
     if (ATK_IS_TABLE (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
-                                     bonobo_object (table_interface_new (o)));
+                                     bonobo_object (table_new (o)));
       }
-    if (ATK_IS_VALUE (o))
+
+    /* if (ATK_IS_VALUE (o))
       {
         bonobo_object_add_interface (bonobo_object (retval),
                                      bonobo_object (value_interface_new (o)));
diff --git a/libspi/action.c b/libspi/action.c
new file mode 100644 (file)
index 0000000..a3e0ddb
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the Action bonobo object
+ */
+#include "action.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+action_class_init (ActionClass *klass);
+static void
+action_init (Action *action);
+static void
+action_finalize (GObject *obj);
+static CORBA_long
+impl__get_nActions(PortableServer_Servant servant,
+                CORBA_Environment * ev);
+static CORBA_string
+impl_getDescription (PortableServer_Servant servant,
+                    const CORBA_long index,
+                    CORBA_Environment * ev);
+static CORBA_boolean 
+impl_doAction (PortableServer_Servant servant,
+              const CORBA_long index, CORBA_Environment * ev);
+static CORBA_string
+impl_getName (PortableServer_Servant servant,
+             const CORBA_long index,
+             CORBA_Environment * ev);
+static CORBA_string
+impl_getKeyBinding (PortableServer_Servant servant,
+                   const CORBA_long index,
+                   CORBA_Environment * ev);
+
+static GObjectClass *parent_class;
+
+GType
+action_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (ActionClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) action_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Action),
+      0, /* n preallocs */
+      (GInstanceInitFunc) action_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Action__init,
+                              NULL,
+                              G_STRUCT_OFFSET (ActionClass, epv),
+                              &tinfo,
+                              "AccessibleAction");
+  }
+
+  return type;
+}
+
+static void
+action_class_init (ActionClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Action__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = action_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->_get_nActions = impl__get_nActions;
+  epv->doAction = impl_doAction;
+  epv->getDescription = impl_getDescription;
+  epv->getName = impl_getName;
+  epv->getKeyBinding = impl_getKeyBinding;
+}
+
+static void
+action_init (Action *action)
+{
+}
+
+static void
+action_finalize (GObject *obj)
+{
+  Action *action = ACTION (obj);
+  action->atk_action = NULL;
+  parent_class->finalize (obj);
+}
+
+Action *
+action_new (AtkAction *action)
+{
+  Action *new_action = 
+    ACTION(g_object_new (ACTION_TYPE, NULL));
+  new_action->atk_action = action;
+  return new_action;
+}
+
+static CORBA_long
+impl__get_nActions(PortableServer_Servant servant,
+           CORBA_Environment * ev)
+{
+  Action *action = ACTION (bonobo_object_from_servant(servant));
+  return (CORBA_long) atk_action_get_n_actions (action->atk_action);
+}
+
+static CORBA_boolean
+impl_doAction (PortableServer_Servant servant,
+              const CORBA_long index, CORBA_Environment * ev)
+{
+  Action *action = ACTION (bonobo_object_from_servant (servant));
+  return (CORBA_boolean) atk_action_do_action (action->atk_action, (gint) index);
+}
+
+
+static CORBA_string
+impl_getDescription (PortableServer_Servant servant,
+               const CORBA_long index,
+               CORBA_Environment * ev)
+{
+  Action *action = ACTION (bonobo_object_from_servant(servant));
+  return CORBA_string_dup (atk_action_get_description (action->atk_action, (gint) index));
+}
+
+
+static CORBA_string
+impl_getName (PortableServer_Servant servant,
+               const CORBA_long index,
+               CORBA_Environment * ev)
+{
+  Action *action = ACTION (bonobo_object_from_servant(servant));
+  return CORBA_string_dup (atk_action_get_name (action->atk_action, (gint) index));
+}
+
+static CORBA_string
+impl_getKeyBinding (PortableServer_Servant servant,
+                   const CORBA_long index,
+                   CORBA_Environment * ev)
+{
+  Action *action = ACTION (bonobo_object_from_servant(servant));
+  return CORBA_string_dup (atk_action_get_keybinding (action->atk_action, (gint) index));
+}
diff --git a/libspi/action.h b/libspi/action.h
new file mode 100644 (file)
index 0000000..a256dcf
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 ACTION_H_
+#define ACTION_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define ACTION_TYPE        (action_get_type ())
+#define ACTION(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), ACTION_TYPE, Action))
+#define ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), ACTION_TYPE, ActionClass))
+#define IS_ACTION(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), ACTION_TYPE))
+#define IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ACTION_TYPE))
+
+typedef struct _Action Action;
+typedef struct _ActionClass ActionClass;
+
+struct _Action {
+  BonoboObject parent;
+  AtkAction *atk_action;
+};
+
+struct _ActionClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Action__epv epv;
+};
+
+GType
+action_get_type   (void);
+
+Action *
+action_new       (AtkAction *action);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ACTION_H_ */
diff --git a/libspi/editabletext.c b/libspi/editabletext.c
new file mode 100644 (file)
index 0000000..ecc8edd
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the EditableText bonobo object
+ */
+#include "editabletext.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+editable_text_class_init (EditableTextClass *klass);
+static void
+editable_text_init (EditableText *editable);
+static void
+editable_text_finalize (GObject *obj);
+static CORBA_boolean
+impl_setAttributes (PortableServer_Servant _servant,
+                      const CORBA_char * attributes,
+                      const CORBA_long startPos,
+                      const CORBA_long endPos,
+                      CORBA_Environment * ev);
+static void
+impl_setTextContents (PortableServer_Servant _servant,
+                     const CORBA_char * newContents,
+                     CORBA_Environment * ev);
+static void 
+impl_insertText (PortableServer_Servant _servant,
+                const CORBA_long position,
+                const CORBA_char * text,
+                const CORBA_long length,
+                CORBA_Environment * ev);
+static void 
+impl_copyText (PortableServer_Servant _servant,
+              const CORBA_long startPos, const CORBA_long endPos,
+              CORBA_Environment * ev);
+static void 
+impl_cutText (PortableServer_Servant _servant,
+             const CORBA_long startPos, const CORBA_long endPos,
+             CORBA_Environment * ev);
+static void 
+impl_deleteText (PortableServer_Servant _servant,
+                const CORBA_long startPos, const CORBA_long endPos,
+                CORBA_Environment * ev);
+static void
+impl_pasteText (PortableServer_Servant _servant,
+               const CORBA_long position, CORBA_Environment * ev);
+
+static GObjectClass *parent_class;
+
+GType
+editable_text_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (EditableTextClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) editable_text_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (EditableText),
+      0, /* n preallocs */
+      (GInstanceInitFunc) editable_text_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_EditableText__init,
+                              NULL,
+                              G_STRUCT_OFFSET (EditableTextClass, epv),
+                              &tinfo,
+                              "AccessibleEditableText");
+  }
+
+  return type;
+}
+
+static void
+editable_text_class_init (EditableTextClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_EditableText__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = editable_text_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->setAttributes = impl_setAttributes;
+  epv->setTextContents = impl_setTextContents;
+  epv->insertText = impl_insertText;
+  epv->copyText = impl_copyText;
+  epv->cutText = impl_cutText;
+  epv->deleteText = impl_deleteText;
+  epv->pasteText = impl_pasteText;
+}
+
+static void
+editable_text_init (EditableText *editable)
+{
+}
+
+static void
+editable_text_finalize (GObject *obj)
+{
+  EditableText *editable = EDITABLE_TEXT(obj);
+  editable->atk_editable_text = NULL;
+  parent_class->finalize (obj);
+}
+
+EditableText *
+editable_text_new (AtkEditableText *editable)
+{
+  EditableText *new_editable =
+    EDITABLE_TEXT(g_object_new (EDITABLE_TEXT_TYPE, NULL));
+  new_editable->atk_editable_text = editable;
+  return new_editable;
+}
+
+
+
+static CORBA_boolean
+impl_setAttributes (PortableServer_Servant _servant,
+                      const CORBA_char * attributes,
+                      const CORBA_long startPos,
+                      const CORBA_long endPos,
+                                        CORBA_Environment * ev)
+{
+  g_print ("setRunAttributes not implemented.\n");
+}
+
+
+
+static void
+impl_setTextContents (PortableServer_Servant _servant,
+                     const CORBA_char * newContents,
+                     CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT(bonobo_object_from_servant (_servant));
+  atk_editable_text_set_text_contents (editable->atk_editable_text,
+                                      (gchar *) newContents);
+}
+
+
+
+static void 
+impl_insertText (PortableServer_Servant _servant,
+                const CORBA_long position,
+                const CORBA_char * text,
+                const CORBA_long length,
+                CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant));
+  atk_editable_text_insert_text (editable->atk_editable_text,
+                                (gchar *) text,
+                                (gint) length,
+                                (gint *) &position);
+}
+
+
+static void 
+impl_copyText (PortableServer_Servant _servant,
+              const CORBA_long startPos, const CORBA_long endPos,
+              CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant));
+  atk_editable_text_copy_text (editable->atk_editable_text,
+                              (gint) startPos, (gint) endPos);
+}
+
+
+
+static void 
+impl_cutText (PortableServer_Servant _servant,
+             const CORBA_long startPos, const CORBA_long endPos,
+             CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant));
+  atk_editable_text_cut_text (editable->atk_editable_text,
+                                (gint) startPos, (gint) endPos);
+}
+
+
+
+
+static void 
+impl_deleteText (PortableServer_Servant _servant,
+                const CORBA_long startPos, const CORBA_long endPos,
+                CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant));
+  atk_editable_text_delete_text (editable->atk_editable_text,
+                                (gint) startPos, (gint) endPos);
+}
+
+
+static void
+impl_pasteText (PortableServer_Servant _servant,
+               const CORBA_long position, CORBA_Environment * ev)
+{
+  EditableText *editable = EDITABLE_TEXT (bonobo_object_from_servant(_servant));
+  atk_editable_text_paste_text (editable->atk_editable_text, position);
+}
+
diff --git a/libspi/editabletext.h b/libspi/editabletext.h
new file mode 100644 (file)
index 0000000..61abdfa
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 EDITABLE_TEXT_H_
+#define EDITABLE_TEXT_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define EDITABLE_TEXT_TYPE        (editable_text_get_type ())
+#define EDITABLE_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDITABLE_TEXT_TYPE, EditableText))
+#define EDITABLE_TEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EDITABLE_TEXT_TYPE, EditableText))
+#define IS_EDITABLE_TEXT(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), EDITABLE_TEXT_TYPE))
+#define IS_EDITABLE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDITABLE_TEXT_TYPE))
+
+typedef struct _EditableText EditableText;
+typedef struct _EditableTextClass EditableTextClass;
+
+struct _EditableText {
+  BonoboObject parent;
+  AtkEditableText *atk_editable_text;
+};
+
+struct _EditableTextClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_EditableText__epv epv;
+};
+
+GType
+editable_text_get_type   (void);
+
+EditableText *
+editable_text_new       (AtkEditableText *editable);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* EDITABLE_TEXT_H_ */
diff --git a/libspi/hyperlink.c b/libspi/hyperlink.c
new file mode 100644 (file)
index 0000000..2d55b8b
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the hyperlink bonobo object
+ */
+#include "hyperlink.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+hyperlink_class_init (HyperlinkClass *klass);
+static void
+hyperlink_init (Hyperlink *hyperlink);
+static void
+hyperlink_finalize (GObject *obj);
+static CORBA_string
+impl_getURI (PortableServer_Servant _servant,
+            const CORBA_long i, CORBA_Environment * ev);
+static CORBA_short
+impl__get_n_anchors (PortableServer_Servant _servant,
+                    CORBA_Environment * ev);
+static CORBA_long
+impl__get_startIndex (PortableServer_Servant _servant,
+                     CORBA_Environment * ev);
+static CORBA_long
+impl__get_endIndex (PortableServer_Servant _servant,
+                   CORBA_Environment * ev);
+static Accessibility_Accessible
+impl_getObject (PortableServer_Servant _servant,
+               const CORBA_long i,
+               CORBA_Environment * ev);
+static CORBA_boolean
+impl_isValid (PortableServer_Servant _servant,
+             CORBA_Environment * ev);
+
+static GObjectClass *parent_class;
+
+GType
+hyperlink_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (HyperlinkClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) hyperlink_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Hyperlink),
+      0, /* n preallocs */
+      (GInstanceInitFunc) hyperlink_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Hyperlink__init,
+                              NULL,
+                              G_STRUCT_OFFSET (HyperlinkClass, epv),
+                              &tinfo,
+                              "AccessibleHyperlink");
+  }
+
+  return type;
+}
+
+static void
+hyperlink_class_init (HyperlinkClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Hyperlink__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = hyperlink_finalize;
+
+  /* Initialize epv table */
+
+  epv->_get_n_anchors = impl__get_n_anchors;
+  epv->getURI = impl_getURI;
+  epv->_get_startIndex = impl__get_startIndex;
+  epv->_get_endIndex = impl__get_endIndex;
+  epv->getObject = impl_getObject;
+  epv->isValid = impl_isValid;
+}
+
+static void
+hyperlink_init (Hyperlink *hyperlink)
+{
+}
+
+static void
+hyperlink_finalize (GObject *obj)
+{
+  Hyperlink *hyperlink = HYPERLINK(obj);
+  hyperlink->atk_hyperlink = NULL;
+  parent_class->finalize (obj);
+}
+
+Hyperlink *
+hyperlink_new (AtkHyperlink *hyperlink)
+{
+  Hyperlink *new_hyperlink = 
+    HYPERLINK(g_object_new (HYPERLINK_TYPE, NULL));
+  new_hyperlink->atk_hyperlink = hyperlink;
+  return new_hyperlink;
+}
+
+
+
+static CORBA_short
+impl__get_n_anchors (PortableServer_Servant _servant,
+                    CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  return (CORBA_short) atk_hyperlink_get_n_anchors (link->atk_hyperlink);
+}
+
+
+
+static CORBA_long
+impl__get_startIndex (PortableServer_Servant _servant,
+                     CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  return (CORBA_long) atk_hyperlink_get_start_index (link->atk_hyperlink);
+}
+
+
+
+static CORBA_long
+impl__get_endIndex (PortableServer_Servant _servant,
+                   CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  return (CORBA_long) atk_hyperlink_get_end_index (link->atk_hyperlink);
+}
+
+
+
+static CORBA_string
+impl_getURI (PortableServer_Servant _servant,
+  const CORBA_long i, CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  gchar *uri;
+  CORBA_char *rv;
+  uri = atk_hyperlink_get_uri (link->atk_hyperlink, (gint) i);
+  rv = CORBA_string_dup (uri);
+  g_free (uri);
+  return rv;
+} 
+
+
+
+static Accessibility_Accessible
+impl_getObject (PortableServer_Servant _servant,
+               const CORBA_long i,
+               CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  AtkObject *atk_object;
+  Accessibility_Accessible rv;
+  atk_object = atk_hyperlink_get_object (link->atk_hyperlink, (gint) i);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object)));
+  return rv;
+}
+
+
+
+static CORBA_boolean
+impl_isValid (PortableServer_Servant _servant,
+             CORBA_Environment * ev)
+{
+  Hyperlink *link = HYPERLINK(bonobo_object_from_servant(_servant));
+  return (CORBA_boolean) atk_hyperlink_is_valid (link->atk_hyperlink);
+}
+
+
diff --git a/libspi/hyperlink.h b/libspi/hyperlink.h
new file mode 100644 (file)
index 0000000..e51b577
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 HYPERLINK_H_
+#define HYPERLINK_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define HYPERLINK_TYPE        (hyperlink_get_type ())
+#define HYPERLINK(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), HYPERLINK_TYPE, Hyperlink))
+#define HYPERLINK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), HYPERLINK_TYPE, HyperlinkClass))
+#define IS_HYPERLINK(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), HYPERLINK_TYPE))
+#define IS_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HYPERLINK_TYPE))
+
+typedef struct _Hyperlink Hyperlink;
+typedef struct _HyperlinkClass HyperlinkClass;
+
+struct _Hyperlink {
+  BonoboObject parent;
+  AtkHyperlink *atk_hyperlink;
+};
+
+struct _HyperlinkClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Hyperlink__epv epv;
+};
+
+GType
+hyperlink_get_type   (void);
+
+Hyperlink *
+hyperlink_new       (AtkHyperlink *hyperlink);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* HYPERLINK_H_ */
diff --git a/libspi/hypertext.c b/libspi/hypertext.c
new file mode 100644 (file)
index 0000000..82f58a7
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the hypertext bonobo object
+ */
+#include "hypertext.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+hypertext_class_init (HypertextClass *klass);
+static void
+hypertext_init (Hypertext *hypertext);
+static void
+hypertext_finalize (GObject *obj);
+static CORBA_short
+impl__get_n_anchors (PortableServer_Servant _servant,
+                    CORBA_Environment * ev);
+static CORBA_string
+impl__get_uri (PortableServer_Servant _servant,
+              CORBA_Environment * ev);
+static CORBA_long
+impl__get_startIndex (PortableServer_Servant _servant,
+                     CORBA_Environment * ev);
+static CORBA_long
+impl__get_endIndex (PortableServer_Servant _servant,
+                   CORBA_Environment * ev);
+static Accessibility_Accessible
+impl_getAnchor (PortableServer_Servant _servant,
+               const CORBA_long i,
+               CORBA_Environment * ev);
+static Accessibility_Accessible
+impl_getObject (PortableServer_Servant _servant,
+               const CORBA_long i,
+               CORBA_Environment * ev);
+static CORBA_long
+impl_getNLinks (PortableServer_Servant _servant,
+               CORBA_Environment * ev);
+static Accessibility_Hyperlink
+impl_getLink (PortableServer_Servant _servant,
+             const CORBA_long linkIndex,
+             CORBA_Environment * ev);
+static CORBA_long
+impl_getLinkIndex (PortableServer_Servant _servant,
+                  const CORBA_long characterIndex,
+                  CORBA_Environment * ev);
+
+static GObjectClass *parent_class;
+
+GType
+hypertext_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (HypertextClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) hypertext_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Hypertext),
+      0, /* n preallocs */
+      (GInstanceInitFunc) hypertext_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Hypertext__init,
+                              NULL,
+                              G_STRUCT_OFFSET (HypertextClass, epv),
+                              &tinfo,
+                              "AccessibleHypertext");
+  }
+
+  return type;
+}
+
+static void
+hypertext_class_init (HypertextClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Hypertext__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = hypertext_finalize;
+
+  /* Initialize epv table */
+
+  epv->getNLinks = impl_getNLinks;
+  epv->getLink = impl_getLink;
+  epv->getLinkIndex = impl_getLinkIndex;
+}
+
+static void
+hypertext_init (Hypertext *hypertext)
+{
+}
+
+static void
+hypertext_finalize (GObject *obj)
+{
+  Hypertext *hypertext = HYPERTEXT(obj);
+  hypertext->atk_hypertext = NULL;
+  parent_class->finalize (obj);
+}
+
+Hypertext *
+hypertext_new (AtkHypertext *hypertext)
+{
+  Hypertext *new_hypertext = 
+    HYPERTEXT(g_object_new (HYPERTEXT_TYPE, NULL));
+  new_hypertext->atk_hypertext = hypertext;
+  return new_hypertext;
+}
+
+
+
+static CORBA_long
+impl_getNLinks (PortableServer_Servant _servant,
+               CORBA_Environment * ev)
+{
+  Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant));
+  return (CORBA_long)
+    atk_hypertext_get_n_links (hypertext->atk_hypertext);
+}
+
+
+
+static Accessibility_Hyperlink
+impl_getLink (PortableServer_Servant _servant,
+             const CORBA_long linkIndex,
+                                         CORBA_Environment * ev)
+{
+  AtkHyperlink *link;
+  Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant));
+  Accessibility_Hyperlink rv;
+  
+  link = atk_hypertext_get_link (hypertext->atk_hypertext,
+                                (gint) linkIndex);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(hyperlink_new(link)));
+  return rv;
+}
+
+
+
+static CORBA_long
+impl_getLinkIndex (PortableServer_Servant _servant,
+                  const CORBA_long characterIndex,
+                                 CORBA_Environment * ev)
+{
+  Hypertext *hypertext = HYPERTEXT(bonobo_object_from_servant(_servant));
+  return (CORBA_long)
+    atk_hypertext_get_link_index (hypertext->atk_hypertext,
+                                 (gint) characterIndex);
+}
+
diff --git a/libspi/hypertext.h b/libspi/hypertext.h
new file mode 100644 (file)
index 0000000..7fbe157
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 HYPERTEXT_H_
+#define HYPERTEXT_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define HYPERTEXT_TYPE        (hypertext_get_type ())
+#define HYPERTEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), HYPERTEXT_TYPE, Hypertext))
+#define HYPERTEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), HYPERTEXT_TYPE, HypertextClass))
+#define IS_HYPERTEXT(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), HYPERTEXT_TYPE))
+#define IS_HYPETEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HYPERTEXT_TYPE))
+
+typedef struct _Hypertext Hypertext;
+typedef struct _HypertextClass HypertextClass;
+
+struct _Hypertext {
+  BonoboObject parent;
+  AtkHypertext *atk_hypertext;
+};
+
+struct _HypertextClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Hypertext__epv epv;
+};
+
+GType
+hypertext_get_type   (void);
+
+Hypertext *
+hypertext_new       (AtkHypertext *hypertext);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* HYPERTEXT_H_ */
diff --git a/libspi/image.c b/libspi/image.c
new file mode 100644 (file)
index 0000000..6428ff8
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the image bonobo object
+ */
+#include "image.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+image_class_init (ImageClass *klass);
+static void
+image_init (Image *image);
+static void
+image_finalize (GObject *obj);
+static void 
+impl_getImagePosition (PortableServer_Servant _servant,
+                      CORBA_long * x, CORBA_long * y,
+                      const CORBA_short coordType,
+                      CORBA_Environment * ev);
+static void 
+impl_getImageSize (PortableServer_Servant _servant,
+                  CORBA_long * width, CORBA_long * height,
+                  CORBA_Environment * ev);
+static CORBA_string 
+impl__get_imageDescription (PortableServer_Servant _servant,
+                         CORBA_Environment * ev);
+
+
+static GObjectClass *parent_class;
+
+GType
+image_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (ImageClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) image_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Image),
+      0, /* n preallocs */
+      (GInstanceInitFunc) image_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Image__init,
+                              NULL,
+                              G_STRUCT_OFFSET (ImageClass, epv),
+                              &tinfo,
+                              "AccessibleImage");
+  }
+
+  return type;
+}
+
+static void
+image_class_init (ImageClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Image__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = image_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->getImagePosition = impl_getImagePosition;
+  epv->getImageSize = impl_getImageSize;
+  epv->_get_imageDescription = impl__get_imageDescription;
+}
+
+static void
+image_init (Image *image)
+{
+}
+
+static void
+image_finalize (GObject *obj)
+{
+  Image *image = IMAGE (obj);
+  image->atk_image = NULL;
+  parent_class->finalize (obj);
+}
+
+Image *
+image_new (AtkImage *image)
+{
+  Image *new_image = 
+    IMAGE(g_object_new (IMAGE_TYPE, NULL));
+  new_image->atk_image = image;
+  return new_image;
+}
+
+
+
+static void 
+impl_getImagePosition (PortableServer_Servant _servant,
+                      CORBA_long * x, CORBA_long * y,
+                      const CORBA_short coordType,
+                      CORBA_Environment * ev)
+{
+  Image *image = IMAGE (bonobo_object_from_servant(_servant));
+  atk_image_get_image_position (image->atk_image,
+                               (gint *) x, (gint *) y,
+                               (AtkCoordType) coordType);
+}
+
+
+
+static void 
+impl_getImageSize (PortableServer_Servant _servant,
+                  CORBA_long * width, CORBA_long * height,
+                           CORBA_Environment * ev)
+{
+  Image *image = IMAGE (bonobo_object_from_servant(_servant));
+  atk_image_get_image_size (image->atk_image,
+                           (gint *) width, (gint *) height);
+}
+
+
+
+static CORBA_string 
+impl__get_imageDescription (PortableServer_Servant _servant,
+                         CORBA_Environment * ev)
+{
+  Image *image = IMAGE (bonobo_object_from_servant(_servant));
+  return CORBA_string_dup (
+                          atk_image_get_image_description (image->atk_image));
+}
+
+
+
diff --git a/libspi/image.h b/libspi/image.h
new file mode 100644 (file)
index 0000000..596359e
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 IMAGE_H_
+#define IMAGE_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define IMAGE_TYPE        (image_get_type ())
+#define IMAGE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMAGE_TYPE, Image))
+#define IMAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), IMAGE_TYPE, ImageClass))
+#define IS_IMAGE(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), IMAGE_TYPE))
+#define IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMAGE_TYPE))
+
+typedef struct _Image Image;
+typedef struct _ImageClass ImageClass;
+
+struct _Image {
+  BonoboObject parent;
+  AtkImage *atk_image;
+};
+
+struct _ImageClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Image__epv epv;
+};
+
+GType
+image_get_type   (void);
+
+Image *
+image_new       (AtkImage *image);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* IMAGE_H_ */
diff --git a/libspi/selection.c b/libspi/selection.c
new file mode 100644 (file)
index 0000000..6f726b2
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the selection bonobo object
+ */
+#include "selection.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+selection_class_init (SelectionClass *klass);
+static void
+selection_init (Selection *selection);
+static void
+selection_finalize (GObject *obj);
+static CORBA_long
+impl__get_nSelectedChildren (PortableServer_Servant _servant,
+                            CORBA_Environment * ev);
+static Accessibility_Accessible
+impl_getSelectedChild (PortableServer_Servant _servant,
+                      const CORBA_long selectedChildIndex,
+                      CORBA_Environment * ev);
+static CORBA_boolean
+impl_selectChild (PortableServer_Servant _servant,
+                 const CORBA_long childIndex,
+                 CORBA_Environment * ev);
+static CORBA_boolean
+impl_deselectSelectedChild (PortableServer_Servant _servant,
+                           const CORBA_long selectedChildIndex,
+                           CORBA_Environment * ev);
+static CORBA_boolean
+impl_isChildSelected (PortableServer_Servant _servant,
+                     const CORBA_long childIndex,
+                     CORBA_Environment * ev);
+static void 
+impl_selectAll (PortableServer_Servant _servant,
+               CORBA_Environment * ev);
+static void 
+impl_clearSelection (PortableServer_Servant _servant,
+                    CORBA_Environment * ev);
+
+
+static GObjectClass *parent_class;
+
+GType
+selection_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (SelectionClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) selection_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Selection),
+      0, /* n preallocs */
+      (GInstanceInitFunc) selection_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Selection__init,
+                              NULL,
+                              G_STRUCT_OFFSET (SelectionClass, epv),
+                              &tinfo,
+                              "AccessibleSelection");
+  }
+
+  return type;
+}
+
+static void
+selection_class_init (SelectionClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Selection__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = selection_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->_get_nSelectedChildren = impl__get_nSelectedChildren;
+  epv->getSelectedChild = impl_getSelectedChild;
+  epv->selectChild = impl_selectChild;
+  epv->deselectSelectedChild = impl_deselectSelectedChild;
+  epv->isChildSelected = impl_isChildSelected;
+  epv->selectAll = impl_selectAll;
+  epv->clearSelection = impl_clearSelection;
+}
+
+static void
+selection_init (Selection *selection)
+{
+}
+
+static void
+selection_finalize (GObject *obj)
+{
+  Selection *selection = SELECTION (obj);
+  selection->atk_selection = NULL;
+  parent_class->finalize (obj);
+}
+
+Selection *
+selection_new (AtkSelection *selection)
+{
+  Selection *new_selection = 
+    SELECTION(g_object_new (SELECTION_TYPE, NULL));
+  new_selection->atk_selection = selection;
+  return new_selection;
+}
+
+
+
+static CORBA_long
+impl__get_nSelectedChildren (PortableServer_Servant _servant,
+                            CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_selection_get_selection_count (selection->atk_selection);
+} 
+
+
+
+
+static Accessibility_Accessible
+impl_getSelectedChild (PortableServer_Servant _servant,
+                      const CORBA_long selectedChildIndex,
+                      CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  AtkObject *atk_object;
+  Accessibility_Accessible rv;
+
+  atk_object = atk_selection_ref_selection (selection->atk_selection, (gint) selectedChildIndex);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object)));
+  return rv;
+}
+
+
+
+static CORBA_boolean
+impl_selectChild (PortableServer_Servant _servant,
+                 const CORBA_long childIndex,
+                 CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_selection_add_selection (selection->atk_selection, (gint) childIndex);
+}
+
+
+
+
+static CORBA_boolean
+impl_deselectSelectedChild (PortableServer_Servant _servant,
+                           const CORBA_long selectedChildIndex,
+                           CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_selection_remove_selection (selection->atk_selection, (gint) selectedChildIndex);
+}
+
+
+
+static CORBA_boolean
+impl_isChildSelected (PortableServer_Servant _servant,
+                     const CORBA_long childIndex,
+                     CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_selection_is_child_selected (selection->atk_selection, (gint) childIndex);
+}
+
+
+
+static void 
+impl_selectAll (PortableServer_Servant _servant,
+               CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  atk_selection_select_all_selection (selection->atk_selection);
+}
+
+
+
+static void 
+impl_clearSelection (PortableServer_Servant _servant,
+                    CORBA_Environment * ev)
+{
+  Selection *selection = SELECTION (bonobo_object_from_servant (_servant));
+  atk_selection_clear_selection (selection->atk_selection);
+}
+
diff --git a/libspi/selection.h b/libspi/selection.h
new file mode 100644 (file)
index 0000000..3771983
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 SELECTION_H_
+#define SELECTION_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define SELECTION_TYPE        (selection_get_type ())
+#define SELECTION(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SELECTION_TYPE, Selection))
+#define SELECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SELECTION_TYPE, SelectionClass))
+#define IS_SELECTION(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), SELECTION_TYPE))
+#define IS_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SELECTION_TYPE))
+
+typedef struct _Selection Selection;
+typedef struct _SelectionClass SelectionClass;
+
+struct _Selection {
+  BonoboObject parent;
+  AtkSelection *atk_selection;
+};
+
+struct _SelectionClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Selection__epv epv;
+};
+
+GType
+selection_get_type   (void);
+
+Selection *
+selection_new       (AtkSelection *selection);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SELECTION_H_ */
diff --git a/libspi/table.c b/libspi/table.c
new file mode 100644 (file)
index 0000000..98c704c
--- /dev/null
@@ -0,0 +1,504 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the Table bonobo object
+ */
+#include "table.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+table_class_init (TableClass *klass);
+static void
+table_init (Table *table);
+static void
+table_finalize (GObject *obj);
+static Accessibility_Accessible
+impl__get_caption (PortableServer_Servant _servant,
+                  CORBA_Environment * ev);
+static Accessibility_Accessible
+impl__get_summary (PortableServer_Servant _servant,
+                  CORBA_Environment * ev);
+static CORBA_long
+impl__get_nRows (PortableServer_Servant _servant,
+                CORBA_Environment * ev);
+static CORBA_long
+impl__get_nRows (PortableServer_Servant _servant,
+                CORBA_Environment * ev);
+static CORBA_long
+impl__get_nColumns (PortableServer_Servant _servant,
+                   CORBA_Environment * ev);
+static Accessibility_Accessible
+impl_getAccessibleAt (PortableServer_Servant _servant,
+                     const CORBA_long row,
+                     const CORBA_long column,
+                     CORBA_Environment * ev);
+static CORBA_long
+impl_getIndexAt (PortableServer_Servant _servant,
+                const CORBA_long row, const CORBA_long column,
+                CORBA_Environment * ev);
+static CORBA_long
+impl_getRowAtIndex (PortableServer_Servant _servant,
+                   const CORBA_long index,
+                   CORBA_Environment * ev);
+static CORBA_long
+impl_getColumnAtIndex (PortableServer_Servant _servant,
+                      const CORBA_long index,
+                      CORBA_Environment * ev);
+static CORBA_string
+impl_getRowDescription (PortableServer_Servant _servant,
+                       const CORBA_long row,
+                       CORBA_Environment * ev);
+static CORBA_string
+impl_getColumnDescription (PortableServer_Servant _servant,
+                          const CORBA_long column,
+                          CORBA_Environment * ev);
+static CORBA_long
+impl_getRowExtentAt (PortableServer_Servant _servant,
+                    const CORBA_long row,
+                    const CORBA_long column,
+                    CORBA_Environment * ev);
+static CORBA_long
+impl_getColumnExtentAt (PortableServer_Servant _servant,
+                       const CORBA_long row,
+                       const CORBA_long column,
+                       CORBA_Environment * ev);
+static Accessibility_Table
+impl_getRowHeader (PortableServer_Servant _servant,
+                  const CORBA_long row,
+                  CORBA_Environment * ev);
+static        Accessibility_Table
+impl_getColumnHeader (PortableServer_Servant _servant,
+                     const CORBA_long column,
+                     CORBA_Environment * ev);
+static Accessibility_LongSeq *
+impl_getSelectedRows (PortableServer_Servant _servant,
+                     CORBA_Environment * ev);
+static Accessibility_LongSeq *
+impl_getSelectedColumns (PortableServer_Servant _servant,
+                        CORBA_Environment * ev);
+static CORBA_boolean
+impl_isRowSelected (PortableServer_Servant _servant,
+                   const CORBA_long row,
+                   CORBA_Environment * ev);
+static CORBA_boolean
+impl_isColumnSelected (PortableServer_Servant _servant,
+                      const CORBA_long column,
+                      CORBA_Environment * ev);
+static CORBA_boolean
+impl_isSelected (PortableServer_Servant _servant,
+                const CORBA_long row,
+                const CORBA_long column,
+                CORBA_Environment * ev);
+
+
+static GObjectClass *parent_class;
+
+GType
+table_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (TableClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) table_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Table),
+      0, /* n preallocs */
+      (GInstanceInitFunc) table_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Table__init,
+                              NULL,
+                              G_STRUCT_OFFSET (TableClass, epv),
+                              &tinfo,
+                              "AccessibleTable");
+  }
+
+  return type;
+}
+
+static void
+table_class_init (TableClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Table__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = table_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->_get_caption = impl__get_caption;
+  epv->_get_summary = impl__get_summary;
+  epv->_get_nRows = impl__get_nRows;
+  epv->_get_nColumns = impl__get_nColumns;
+  epv->getAccessibleAt = impl_getAccessibleAt;
+  epv->getIndexAt = impl_getIndexAt;
+  epv->getRowAtIndex = impl_getRowAtIndex;
+  epv->getColumnAtIndex = impl_getColumnAtIndex;
+  epv->getRowDescription = impl_getRowDescription;
+  epv->getColumnDescription = impl_getColumnDescription;
+  epv->getRowExtentAt = impl_getRowExtentAt;
+  epv->getColumnExtentAt = impl_getColumnExtentAt;
+  epv->getRowHeader = impl_getRowHeader;
+  epv->getColumnHeader = impl_getColumnHeader;
+  epv->getSelectedRows = impl_getSelectedRows;
+  epv->getSelectedColumns = impl_getSelectedColumns;
+  epv->isRowSelected = impl_isRowSelected;
+  epv->isColumnSelected = impl_isColumnSelected;
+  epv->isSelected = impl_isSelected;
+}
+
+static void
+table_init (Table *table)
+{
+}
+
+static void
+table_finalize (GObject *obj)
+{
+  Table *table = TABLE (obj);
+  table->atk_table = NULL;
+  parent_class->finalize (obj);
+}
+
+Table *
+table_new (AtkTable *table)
+{
+  Table *new_table =
+    TABLE(g_object_new (TABLE_TYPE, NULL));
+  new_table->atk_table = table;
+  return new_table;
+}
+
+
+
+static Accessibility_Accessible
+impl__get_caption (PortableServer_Servant _servant,
+                  CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  AtkObject *atk_object;
+  Accessibility_Accessible rv;
+
+  atk_object = g_object_new (ATK_TYPE_OBJECT, NULL);
+  atk_object_set_name (atk_object, atk_table_get_caption (table->atk_table));
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object)));
+  return rv;
+}
+
+
+
+static Accessibility_Accessible
+impl__get_summary (PortableServer_Servant _servant,
+                  CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  AtkObject *atk_object;
+  Accessibility_Accessible rv;
+
+  atk_object = atk_table_get_summary (table->atk_table);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object)));
+  return rv;
+}
+
+
+
+static CORBA_long
+impl__get_nRows (PortableServer_Servant _servant,
+                CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_n_rows (table->atk_table);
+}
+
+
+
+static CORBA_long
+impl__get_nColumns (PortableServer_Servant _servant,
+                   CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_n_columns (table->atk_table);
+}
+
+
+
+static Accessibility_Accessible
+impl_getAccessibleAt (PortableServer_Servant _servant,
+                     const CORBA_long row,
+                     const CORBA_long column,
+                     CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  AtkObject *atk_object;
+  Accessibility_Accessible rv;
+
+  atk_object = atk_table_ref_at (table->atk_table,
+                                            (gint) row, (gint) column);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(atk_object)));
+  return rv;
+}
+
+
+
+static CORBA_long
+impl_getIndexAt (PortableServer_Servant _servant,
+                const CORBA_long row, const CORBA_long column,
+                CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_index_at (table->atk_table,
+                           (gint) row, (gint) column);
+}
+
+
+
+static CORBA_long
+impl_getRowAtIndex (PortableServer_Servant _servant,
+                   const CORBA_long index,
+                   CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_row_at_index (table->atk_table, (gint) index);
+}
+
+
+
+static CORBA_long
+impl_getColumnAtIndex (PortableServer_Servant _servant,
+                      const CORBA_long index,
+                      CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_column_at_index (table->atk_table, (gint) index);
+}
+
+
+
+static CORBA_string
+impl_getRowDescription (PortableServer_Servant _servant,
+                       const CORBA_long row,
+                       CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return CORBA_string_dup (
+                          atk_table_get_row_description (table->atk_table, (gint) row));
+}
+
+
+
+static CORBA_string
+impl_getColumnDescription (PortableServer_Servant _servant,
+                          const CORBA_long column,
+                          CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return CORBA_string_dup (
+                          atk_table_get_column_description (table->atk_table, (gint) column));
+}
+
+
+
+static CORBA_long
+impl_getRowExtentAt (PortableServer_Servant _servant,
+                    const CORBA_long row,
+                    const CORBA_long column,
+                    CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_row_extent_at (table->atk_table,
+                                (gint) row, (gint) column);
+}
+
+
+
+static CORBA_long
+impl_getColumnExtentAt (PortableServer_Servant _servant,
+                       const CORBA_long row,
+                       const CORBA_long column,
+                       CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_table_get_column_extent_at (table->atk_table,
+                                (gint) row, (gint) column);
+}
+
+
+
+static Accessibility_Table
+impl_getRowHeader (PortableServer_Servant _servant,
+                  const CORBA_long row,
+                  CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  AtkObject *header;
+  Accessibility_Table rv;
+
+  header = atk_table_get_row_header (table->atk_table, (gint) row);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(header)));
+  return rv;
+}
+
+
+
+static        Accessibility_Table
+impl_getColumnHeader (PortableServer_Servant _servant,
+                     const CORBA_long column,
+                     CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  AtkObject *header;
+  Accessibility_Table rv;
+
+  header = atk_table_get_column_header (table->atk_table, (gint) column);
+  rv = bonobo_object_corba_objref (BONOBO_OBJECT(accessible_new(header)));
+  return rv;
+}
+
+
+
+static Accessibility_LongSeq *
+impl_getSelectedRows (PortableServer_Servant _servant,
+                     CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  gint *selectedRows;
+  gint length;
+  Accessibility_LongSeq *retval;
+
+  length = atk_table_get_selected_rows (table->atk_table, &selectedRows);
+
+  g_return_val_if_fail (length, NULL);
+  retval = Accessibility_LongSeq__alloc ();
+  retval->_maximum = retval->_length = (CORBA_long) length;
+  retval->_buffer = Accessibility_LongSeq_allocbuf (length);
+
+  while (--length)
+    retval->_buffer[length] = (CORBA_long) selectedRows[length];
+  g_free ((gpointer) selectedRows);
+  return retval;
+}
+
+
+
+static Accessibility_LongSeq *
+impl_getSelectedColumns (PortableServer_Servant _servant,
+                        CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  gint *selectedColumns;
+  gint length;
+  Accessibility_LongSeq *retval;
+
+  length = atk_table_get_selected_columns (table->atk_table, &selectedColumns);
+
+  g_return_val_if_fail (length, NULL);
+
+  retval = Accessibility_LongSeq__alloc ();
+  retval->_maximum = retval->_length = (CORBA_long) length;
+  retval->_buffer = Accessibility_LongSeq_allocbuf (length);
+
+  while (--length)
+    retval->_buffer[length] = (CORBA_long) selectedColumns[length];
+  g_free ((gpointer) selectedColumns);
+  return retval;
+}
+
+
+
+static CORBA_boolean
+impl_isRowSelected (PortableServer_Servant _servant,
+                   const CORBA_long row,
+                   CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_table_is_row_selected (table->atk_table, (gint) row);
+}
+
+
+
+static CORBA_boolean
+impl_isColumnSelected (PortableServer_Servant _servant,
+                      const CORBA_long column,
+                      CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_table_is_column_selected (table->atk_table, (gint) column);
+}
+
+
+
+static CORBA_boolean
+impl_isSelected (PortableServer_Servant _servant,
+                const CORBA_long row,
+                const CORBA_long column,
+                CORBA_Environment * ev)
+{
+  Table *table = TABLE (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_table_is_selected (table->atk_table,
+                          (gint) row, (gint) column);
+}
+
+
+
diff --git a/libspi/table.h b/libspi/table.h
new file mode 100644 (file)
index 0000000..da987e5
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 TABLE_H_
+#define TABLE_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define TABLE_TYPE        (table_get_type ())
+#define TABLE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), TABLE_TYPE, Table))
+#define TABLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), TABLE_TYPE, TableClass))
+#define IS_TABLE(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), TABLE_TYPE))
+#define IS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TABLE_TYPE))
+
+typedef struct _Table Table;
+typedef struct _TableClass TableClass;
+
+struct _Table {
+  BonoboObject parent;
+  AtkTable *atk_table;
+};
+
+struct _TableClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Table__epv epv;
+};
+
+GType
+table_get_type   (void);
+
+Table *
+table_new       (AtkTable *table);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* TABLE_H_ */
diff --git a/libspi/text.c b/libspi/text.c
new file mode 100644 (file)
index 0000000..04a7bf5
--- /dev/null
@@ -0,0 +1,475 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the Text bonobo object
+ */
+#include "text.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+text_class_init (TextClass *klass);
+static void
+text_init (Text *text);
+static void
+text_finalize (GObject *obj);
+static CORBA_string
+impl_getText (PortableServer_Servant _servant,
+             const CORBA_long startOffset,
+             const CORBA_long endOffset,
+             CORBA_Environment * ev);
+CORBA_string
+impl_getTextAfterOffset (PortableServer_Servant _servant,
+                        const CORBA_long offset,
+                        const
+                        Accessibility_TEXT_BOUNDARY_TYPE
+                        type, CORBA_long * startOffset,
+                        CORBA_long * endOffset,
+                        CORBA_Environment * ev);
+static CORBA_string
+impl_getTextAtOffset (PortableServer_Servant _servant,
+                     const CORBA_long offset,
+                     const Accessibility_TEXT_BOUNDARY_TYPE
+                     type, CORBA_long * startOffset,
+                     CORBA_long * endOffset,
+                     CORBA_Environment * ev);
+static CORBA_wchar
+impl_getCharacterAtOffset (PortableServer_Servant _servant,
+                          const CORBA_long offset,
+                          CORBA_Environment * ev);
+static CORBA_string
+impl_getTextBeforeOffset (PortableServer_Servant _servant,
+                         const CORBA_long offset,
+                         const
+                         Accessibility_TEXT_BOUNDARY_TYPE
+                         type, CORBA_long * startOffset,
+                         CORBA_long * endOffset,
+                         CORBA_Environment * ev);
+static CORBA_long
+impl__get_caretOffset (PortableServer_Servant _servant,
+                    CORBA_Environment * ev);
+static CORBA_string
+impl_getAttributes (PortableServer_Servant _servant,
+                      const CORBA_long offset,
+                      CORBA_long * startOffset,
+                      CORBA_long * endOffset,
+                      CORBA_Environment * ev);
+static void 
+impl_getCharacterExtents (PortableServer_Servant _servant,
+                         const CORBA_long offset, CORBA_long * x,
+                         CORBA_long * y, CORBA_long * width,
+                         CORBA_long * height,
+                         const CORBA_short coordType,
+                         CORBA_Environment * ev);
+static CORBA_long
+impl__get_characterCount (PortableServer_Servant _servant,
+                       CORBA_Environment * ev);
+static CORBA_long
+impl_getOffsetAtPoint (PortableServer_Servant _servant,
+                      const CORBA_long x, const CORBA_long y,
+                      const CORBA_short coordType,
+                      CORBA_Environment * ev);
+static CORBA_long
+impl_getNSelections (PortableServer_Servant _servant,
+                    CORBA_Environment * ev);
+static void 
+impl_getSelection (PortableServer_Servant _servant,
+                  const CORBA_long selectionNum,
+                  CORBA_long * startOffset, CORBA_long * endOffset,
+                  CORBA_Environment * ev);
+static CORBA_boolean
+impl_addSelection (PortableServer_Servant _servant,
+                  const CORBA_long startOffset,
+                  const CORBA_long endOffset,
+                  CORBA_Environment * ev);
+static CORBA_boolean
+impl_removeSelection (PortableServer_Servant _servant,
+                     const CORBA_long selectionNum,
+                     CORBA_Environment * ev);
+static CORBA_boolean
+impl_setSelection (PortableServer_Servant _servant,
+                  const CORBA_long selectionNum,
+                  const CORBA_long startOffset,
+                  const CORBA_long endOffset,
+                  CORBA_Environment * ev);
+static void
+impl_setCaretOffset (PortableServer_Servant _servant,
+                    const CORBA_long value,
+                    CORBA_Environment * ev);
+  
+
+static GObjectClass *parent_class;
+
+GType
+text_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (TextClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) text_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Text),
+      0, /* n preallocs */
+      (GInstanceInitFunc) text_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Text__init,
+                              NULL,
+                              G_STRUCT_OFFSET (TextClass, epv),
+                              &tinfo,
+                              "AccessibleText");
+  }
+
+  return type;
+}
+
+static void
+text_class_init (TextClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Text__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = text_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->getText = impl_getText;
+  epv->getTextAfterOffset = impl_getTextAfterOffset;
+  epv->getCharacterAtOffset = impl_getCharacterAtOffset;
+  epv->getTextAtOffset = impl_getTextAtOffset;
+  epv->getTextBeforeOffset = impl_getTextBeforeOffset;
+  epv->_get_caretOffset = impl__get_caretOffset;
+  epv->getAttributes = impl_getAttributes;
+  epv->getCharacterExtents = impl_getCharacterExtents;
+  epv->_get_characterCount = impl__get_characterCount;
+  epv->getOffsetAtPoint = impl_getOffsetAtPoint;
+  epv->getNSelections = impl_getNSelections;
+  epv->getSelection = impl_getSelection;
+  epv->addSelection = impl_addSelection;
+  epv->removeSelection = impl_removeSelection;
+  epv->setSelection = impl_setSelection;
+  epv->setCaretOffset = impl_setCaretOffset;
+}
+
+static void
+text_init (Text *text)
+{
+}
+
+static void
+text_finalize (GObject *obj)
+{
+  Text *text = TEXT (obj);
+  text->atk_text = NULL;
+  parent_class->finalize (obj);
+}
+
+Text *
+text_new (AtkText *text)
+{
+  Text *new_text = 
+    TEXT(g_object_new (TEXT_TYPE, NULL));
+  new_text->atk_text = text;
+  return new_text;
+}
+
+
+
+static CORBA_string
+impl_getText (PortableServer_Servant _servant,
+             const CORBA_long startOffset,
+             const CORBA_long endOffset,
+             CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  gchar *txt;
+  CORBA_char *rv;
+
+  txt = atk_text_get_text (text->atk_text,
+                      (gint) startOffset, (gint) endOffset);
+  rv = CORBA_string_dup (txt);
+  g_free (txt);
+  return rv;
+}
+
+
+
+CORBA_string
+impl_getTextAfterOffset (PortableServer_Servant _servant,
+                        const CORBA_long offset,
+                        const
+                        Accessibility_TEXT_BOUNDARY_TYPE
+                        type, CORBA_long * startOffset,
+                        CORBA_long * endOffset,
+                        CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  gchar *txt;
+  CORBA_char *rv;
+
+  txt = atk_text_get_text_after_offset (text->atk_text,
+                                   (gint) offset, (AtkTextBoundary) type,
+                                   (gint *) startOffset, (gint *) endOffset);
+  rv = CORBA_string_dup (txt);
+  g_free (txt);
+  return rv;
+}
+
+
+
+static CORBA_string
+impl_getTextAtOffset (PortableServer_Servant _servant,
+                     const CORBA_long offset,
+                     const Accessibility_TEXT_BOUNDARY_TYPE
+                     type, CORBA_long * startOffset,
+                     CORBA_long * endOffset,
+                     CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  gchar *txt;
+  CORBA_char *rv;
+
+  txt = atk_text_get_text_at_offset (text->atk_text,
+                                   (gint) offset, (AtkTextBoundary) type,
+                                   (gint *) startOffset, (gint *) endOffset);
+  rv = CORBA_string_dup (txt);
+  g_free (txt);
+  return rv;
+}
+
+
+
+static CORBA_wchar
+impl_getCharacterAtOffset (PortableServer_Servant _servant,
+                          const CORBA_long offset,
+                          CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_wchar)
+    atk_text_get_character_at_offset (text->atk_text, (gint) offset);
+}
+
+
+static CORBA_string
+impl_getTextBeforeOffset (PortableServer_Servant _servant,
+                         const CORBA_long offset,
+                         const
+                         Accessibility_TEXT_BOUNDARY_TYPE
+                         type, CORBA_long * startOffset,
+                         CORBA_long * endOffset,
+                         CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  gchar *txt;
+  CORBA_char *rv;
+
+  txt = atk_text_get_text_before_offset (text->atk_text,
+                                   (gint) offset, (AtkTextBoundary) type,
+                                   (gint *) startOffset, (gint *) endOffset);
+  rv = CORBA_string_dup (txt);
+  g_free (txt);
+}
+
+
+static CORBA_long
+impl__get_caretOffset (PortableServer_Servant _servant,
+                    CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_text_get_caret_offset (text->atk_text);
+}
+
+
+
+static CORBA_string
+impl_getAttributes (PortableServer_Servant _servant,
+                      const CORBA_long offset,
+                      CORBA_long * startOffset,
+                      CORBA_long * endOffset,
+                      CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  g_print ("getAttributes not implemented.\n");
+}
+
+
+
+static void 
+impl_getCharacterExtents (PortableServer_Servant _servant,
+                         const CORBA_long offset, CORBA_long * x,
+                         CORBA_long * y, CORBA_long * width,
+                         CORBA_long * height,
+                         const CORBA_short coordType,
+                         CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  atk_text_get_character_extents (text->atk_text, (gint) offset,
+                                 (gint *) x, (gint *) y, (gint *) width, (gint *) height,
+                                 (AtkCoordType) coordType);
+}
+
+
+
+static CORBA_long
+impl__get_characterCount (PortableServer_Servant _servant,
+                       CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_text_get_character_count (text->atk_text);
+}
+
+
+
+static CORBA_long
+impl_getOffsetAtPoint (PortableServer_Servant _servant,
+                      const CORBA_long x, const CORBA_long y,
+                      const CORBA_short coordType,
+                      CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_text_get_offset_at_point (text->atk_text,
+                                 (gint) x, (gint) y, (AtkCoordType) coordType);
+}
+
+
+
+static CORBA_long
+impl_getNSelections (PortableServer_Servant _servant,
+                    CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_long)
+    atk_text_get_n_selections (text->atk_text);
+}
+
+
+
+static void 
+impl_getSelection (PortableServer_Servant _servant,
+                  const CORBA_long selectionNum,
+                  CORBA_long * startOffset, CORBA_long * endOffset,
+                  CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  atk_text_get_selection (text->atk_text, (gint) selectionNum,
+                         (gint *) startOffset, (gint *) endOffset);
+}
+
+
+
+static CORBA_boolean
+impl_addSelection (PortableServer_Servant _servant,
+                  const CORBA_long startOffset,
+                  const CORBA_long endOffset,
+                  CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_text_add_selection (text->atk_text,
+                           (gint) startOffset, (gint) endOffset);
+}
+
+
+
+static CORBA_boolean
+impl_removeSelection (PortableServer_Servant _servant,
+                     const CORBA_long selectionNum,
+                     CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_text_remove_selection (text->atk_text, (gint) selectionNum);
+}
+
+
+
+static CORBA_boolean
+impl_setSelection (PortableServer_Servant _servant,
+                  const CORBA_long selectionNum,
+                  const CORBA_long startOffset,
+                  const CORBA_long endOffset,
+                  CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_text_set_selection (text->atk_text,
+                           (gint) selectionNum, (gint) startOffset, (gint) endOffset);
+}
+
+
+
+static void
+impl_setCaretOffset (PortableServer_Servant _servant,
+                    const CORBA_long value,
+                    CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+  return (CORBA_boolean)
+    atk_text_set_caret_offset (text->atk_text, (gint) value);
+}
+
+
+
+static void 
+impl_getRowColAtOffset (PortableServer_Servant _servant,
+                       const CORBA_long offset, CORBA_long * row,
+                       CORBA_long * column, CORBA_Environment * ev)
+{
+  Text *text = TEXT (bonobo_object_from_servant (_servant));
+}
+
diff --git a/libspi/text.h b/libspi/text.h
new file mode 100644 (file)
index 0000000..9d9d0fd
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 TEXT_H_
+#define TEXT_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define TEXT_TYPE        (text_get_type ())
+#define TEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEXT_TYPE, Text))
+#define TEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), TEXT_TYPE, TextClass))
+#define IS_TEXT(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), TEXT_TYPE))
+#define IS_TEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEXT_TYPE))
+
+typedef struct _Text Text;
+typedef struct _TextClass TextClass;
+
+struct _Text {
+  BonoboObject parent;
+  AtkText *atk_text;
+};
+
+struct _TextClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Text__epv epv;
+};
+
+GType
+text_get_type   (void);
+
+Text *
+text_new       (AtkText *text);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* TEXT_H_ */
diff --git a/libspi/value.c b/libspi/value.c
new file mode 100644 (file)
index 0000000..5d23c7a
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
+ * component.c : bonobo wrapper for accessible component implementation
+ *
+ */
+#include <config.h>
+#include <bonobo/Bonobo.h>
+
+#include <stdio.h>
+
+/*
+ * This pulls the CORBA definitions for the "Accessibility::Accessible" server
+ */
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition of the Value bonobo object
+ */
+#include "value.h"
+
+/*
+ * Static function declarations
+ */
+
+static void
+value_class_init (ValueClass *klass);
+static void
+value_init (Value *value);
+static void
+value_finalize (GObject *obj);
+static CORBA_float
+impl__get_minimumValue (PortableServer_Servant _servant,
+                       CORBA_Environment * ev);
+static        CORBA_float
+impl__get_maximumValue (PortableServer_Servant _servant,
+                       CORBA_Environment * ev);
+static CORBA_float
+impl__get_currentValue (PortableServer_Servant _servant,
+                       CORBA_Environment * ev);
+static void 
+impl__set_currentValue (PortableServer_Servant _servant,
+                       const CORBA_float value,
+                       CORBA_Environment * ev);
+
+
+
+static GObjectClass *parent_class;
+
+
+GType
+value_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type) {
+    static const GTypeInfo tinfo = {
+      sizeof (ValueClass),
+      (GBaseInitFunc) NULL,
+      (GBaseFinalizeFunc) NULL,
+      (GClassInitFunc) value_class_init,
+      (GClassFinalizeFunc) NULL,
+      NULL, /* class data */
+      sizeof (Value),
+      0, /* n preallocs */
+      (GInstanceInitFunc) value_init,
+                        NULL /* value table */
+    };
+
+    /*
+     * Bonobo_type_unique auto-generates a load of
+     * CORBA structures for us. All derived types must
+     * use bonobo_type_unique.
+     */
+    type = bonobo_type_unique (
+                              BONOBO_OBJECT_TYPE,
+                              POA_Accessibility_Value__init,
+                              NULL,
+                              G_STRUCT_OFFSET (ValueClass, epv),
+                              &tinfo,
+                              "AccessibleValue");
+  }
+
+  return type;
+}
+
+static void
+value_class_init (ValueClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Value__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = value_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->_get_minimumValue = impl__get_minimumValue;
+  epv->_get_maximumValue = impl__get_maximumValue;
+  epv->_get_currentValue = impl__get_currentValue;
+  epv->_set_currentValue = impl__set_currentValue;
+}
+
+static void
+value_init (Value *value)
+{
+}
+
+static void
+value_finalize (GObject *obj)
+{
+  Value *value = VALUE (obj);
+  value->atk_value = NULL;
+  parent_class->finalize (obj);
+}
+
+Value *
+value_new (AtkValue *value)
+{
+  Value *new_value = 
+    VALUE(g_object_new (VALUE_TYPE, NULL));
+  new_value->atk_value = value;
+  return new_value;
+}
+
+
+
+static CORBA_float
+impl__get_minimumValue (PortableServer_Servant _servant,
+                      CORBA_Environment * ev)
+{
+  Value *value = VALUE (bonobo_object_from_servant (_servant));
+  GValue gvalue = {0, };
+
+  g_value_init (&gvalue, G_TYPE_FLOAT);
+  atk_value_get_minimum_value (value->atk_value, &gvalue);
+  return (CORBA_float) g_value_get_float (&gvalue);
+}
+
+
+
+static        CORBA_float
+impl__get_maximumValue (PortableServer_Servant _servant,
+                       CORBA_Environment * ev)
+{
+  Value *value = VALUE (bonobo_object_from_servant (_servant));
+  GValue gvalue = {0, };
+
+  g_value_init (&gvalue, G_TYPE_FLOAT);
+  atk_value_get_maximum_value (value->atk_value, &gvalue);
+  return (CORBA_float) g_value_get_float (&gvalue);
+}
+
+
+
+static CORBA_float
+impl__get_currentValue (PortableServer_Servant _servant,
+                       CORBA_Environment * ev)
+{
+  Value *value = VALUE (bonobo_object_from_servant (_servant));
+  GValue gvalue = {0, };
+
+  g_value_init (&gvalue, G_TYPE_FLOAT);
+  atk_value_get_current_value (value->atk_value, &gvalue);
+  return (CORBA_float) g_value_get_float (&gvalue);
+}
+
+
+static void 
+impl__set_currentValue (PortableServer_Servant _servant,
+                       const CORBA_float value,
+                       CORBA_Environment * ev)
+{
+  Value *val = VALUE (bonobo_object_from_servant (_servant));
+  GValue gvalue = {0, };
+
+  g_value_init (&gvalue, G_TYPE_FLOAT);
+  g_value_set_float (&gvalue, (gfloat) value);
+  atk_value_set_current_value (val->atk_value, &gvalue);
+}
+
+
diff --git a/libspi/value.h b/libspi/value.h
new file mode 100644 (file)
index 0000000..5a4387e
--- /dev/null
@@ -0,0 +1,61 @@
+/* ATK -  Accessibility Toolkit
+ * 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 VALUE_H_
+#define VALUE_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atk.h>
+#include <libspi/Accessibility.h>
+
+#define VALUE_TYPE        (value_get_type ())
+#define VALUE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALUE_TYPE, Value))
+#define ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), VALUE_TYPE, ValueClass))
+#define IS_VALUE(obj)       (G_TYPE_CHECK__INSTANCE_TYPE ((obj), VALUE_TYPE))
+#define IS_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALUE_TYPE))
+
+typedef struct _Value Value;
+typedef struct _ValueClass ValueClass;
+
+struct _Value {
+  BonoboObject parent;
+  AtkValue *atk_value;
+};
+
+struct _ValueClass {
+  BonoboObjectClass parent_class;
+  POA_Accessibility_Value__epv epv;
+};
+
+GType
+value_get_type   (void);
+
+Value *
+value_new       (AtkValue *value);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* VALUE_H_ */
index e69de29..03ca73a 100644 (file)
@@ -0,0 +1,72 @@
+2001-09-04  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.39.
+
+2001-09-04  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-03  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-03  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-03  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-03  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-03  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-01  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-01  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-09-01  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-31  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.39.
+
+2001-08-30  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-30  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-30  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-30  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-30  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-29  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+
+2001-08-22  gettextize  <bug-gnu-utils@gnu.org>
+
+       * Makefile.in.in: Upgrade to gettext-0.10.38.
+