2001-12-11 Michael Meeks <michael@ximian.com>
authormichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 11 Dec 2001 14:55:37 +0000 (14:55 +0000)
committermichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 11 Dec 2001 14:55:37 +0000 (14:55 +0000)
* cspi/bonobo/cspi-bonobo-listener.c:
(cspi_kestroke_listener_unref),
(cspi_event_listener_unref): impl. undoing previous
homenous environment - for Bill.

* cspi/spi_table.c (long_seq_to_array): use
malloc instead.

* cspi/spi_main.c: split out all bonoboish bits into
bonobo/

* cspi/spi-impl.h: upd. typedefs.

* cspi/spi_registry.c: update to lowlevel API,
return booleans to indicate success in some places.

* cspi/spi_event.c: update to lowlevel API.

* cspi/bonobo/Makefile.am: add.

* cspi/bonobo/cspi-lowlevel.h: add

* cspi/bonobo/cspi-bonobo.c: add

* cspi/bonobo/cspi-bonobo-listener.[ch]: impl.

* cspi/Makefile.am: remove spi-listener-impl.[ch],
(SUBDIRS): add bonobo, link in the libs.

* cspi/spi-util.c: kill this file.

* TODO: merge in my bits.

2001-12-11  Michael Meeks  <michael@ximian.com>

* test/test-simple.c (test_value, test_table, main):
remove unused variables causing warnings.

* configure.in: cleanup checks - require gail.

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

25 files changed:
ChangeLog
TODO
configure.in
cspi/Makefile.am
cspi/bonobo/cspi-bonobo-listener.c
cspi/bonobo/cspi-bonobo.c
cspi/cspi-lowlevel.h
cspi/spi-impl.h
cspi/spi-listener-impl.c [deleted file]
cspi/spi-listener-impl.h [deleted file]
cspi/spi-listener.h
cspi/spi-private.h
cspi/spi-roletypes.h
cspi/spi-statetypes.h
cspi/spi-util.c [deleted file]
cspi/spi.h
cspi/spi_accessible.c
cspi/spi_application.c
cspi/spi_event.c
cspi/spi_main.c
cspi/spi_registry.c
cspi/spi_selection.c
cspi/spi_table.c
test/accessx-gui.c
test/test-simple.c

index 77e8179..6c7b2ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2001-12-11  Michael Meeks  <michael@ximian.com>
+
+       * cspi/bonobo/cspi-bonobo-listener.c: 
+       (cspi_kestroke_listener_unref),
+       (cspi_event_listener_unref): impl. undoing previous
+       homenous environment - for Bill.
+
+       * cspi/spi_table.c (long_seq_to_array): use
+       malloc instead.
+
+       * cspi/spi_main.c: split out all bonoboish bits into
+       bonobo/
+
+       * cspi/spi-impl.h: upd. typedefs.
+
+       * cspi/spi_registry.c: update to lowlevel API,
+       return booleans to indicate success in some places.
+
+       * cspi/spi_event.c: update to lowlevel API.
+
+       * cspi/bonobo/Makefile.am: add.
+
+       * cspi/bonobo/cspi-lowlevel.h: add
+
+       * cspi/bonobo/cspi-bonobo.c: add
+
+       * cspi/bonobo/cspi-bonobo-listener.[ch]: impl.
+
+       * cspi/Makefile.am: remove spi-listener-impl.[ch],
+       (SUBDIRS): add bonobo, link in the libs.
+
+       * cspi/spi-util.c: kill this file.
+
+       * TODO: merge in my bits.
+
+2001-12-11  Michael Meeks  <michael@ximian.com>
+
+       * test/test-simple.c (test_value, test_table, main):
+       remove unused variables causing warnings.
+
+       * configure.in: cleanup checks - require gail.
+
 2001-12-11  Bill Haneman  <bill.haneman@sun.com>
 
        * idl/Value.idl:
diff --git a/TODO b/TODO
index 6786cbc..e667d33 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,27 +1,46 @@
 TODO:
 
 idl: 
-      possibly change Value.idl interface to return a value
-union. [Bill] *DONE*
+       + possibly change Value.idl interface to return a value union. [Bill]
+       + audit IDL for conformance with bonobo/doc/FAQ's [Java]
+       naming practice [Michael]
+        + possibly change Value.idl interface to return a value
+       union. [Bill] *DONE*
 
 cspi: 
-      API change required if above IDL change is made. [Bill]
+       + API change required if above IDL change is made. [Bill]
+       + move bonobo bits into cspi/bonobo
+       + ensure spi-listener-impl's list notification methods don't
+         have a re-enterancy hazard.
+       + namespace all methods missing a prepending Acessible
+         or SPI_ prefix.
+       + Put LGPL headers everywhere.
+
+registry:
+       + move code into here from libspi
+       + kill the getDeviceWhatnot - and use queryInterface,
+         don't inherit from the Listener interface - use aggregation
+       + fire an event on dead application & re-factor the listen for
+         broken code.
+
+bridge:
+       + move code into here from libspi
 
 libspi: 
-
-      Change the weird string-hash event matching to something sane,
-using GQuark. [Bill]
-
-      Merge the DeviceEvent and KeyEvent structs to avoid the bogus casting of
-these back and forth.
-
-      Complete implementation of support for RelationSet and StateSet, and
-export to cspi. 
-
-      Complete and test the pre-emptive key API so that we don't always do
-AnyKey grabs. [Bill]
+       + remove redundant casts throughout
+       + determine if there are other headers we don't need to install
+       + consider moving the non-impl. parts into registryd/ bridge/ etc.
+       + change the weird string-hash event matching to something sane,
+       using GQuark. [Bill]
+       + merge the DeviceEvent and KeyEvent structs to avoid the
+       bogus casting of these back and forth.
+       + complete implementation of support for RelationSet and
+       StateSet, and export to cspi.
+       + complete and test the pre-emptive key API so that we don't
+       always do AnyKey grabs. [Bill]
 
 test:
-
-      Add tests for AtkTable, and add table elements to the test window.
+       + update test-simple to do complete API tests
+       + Add tests for AtkTable, and add table elements to the test window.
+       + remove comment from test_value; ensure that it works.
 
index 870448a..e4fffef 100644 (file)
@@ -83,27 +83,44 @@ dnl           to make this work with the tarballs.
 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
 
 dnl Checks for libraries
-PKG_CHECK_MODULES(LIBSPI, bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 ORBit-2.0 >= 2.3.94 atk >= 0.2 gtk+-2.0 >= 1.3.2)
+PKG_CHECK_MODULES(LIBSPI, \
+       libbonobo-2.0 >= 1.107.0 \
+       atk >= 0.2 \
+       gtk+-2.0 >= 1.3.2 \
+       gail)
 AC_SUBST(LIBSPI_LIBS)
 AC_SUBST(LIBSPI_CFLAGS)
 
-PKG_CHECK_MODULES(REGISTRYD, bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 atk >= 0.2)
+PKG_CHECK_MODULES(REGISTRYD, \
+       libbonobo-2.0 >= 1.107.0 \
+       atk >= 0.2)
 AC_SUBST(REGISTRYD_LIBS)
 AC_SUBST(REGISTRYD_CFLAGS)
 
-PKG_CHECK_MODULES(TESTS, bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 ORBit-2.0  >= 2.3.94 atk >= 0.2 gtk+-2.0 >= 1.3.2)
+PKG_CHECK_MODULES(TESTS, \
+       libbonobo-2.0 >= 1.107.0 \
+       atk >= 0.2 \
+       gtk+-2.0 >= 1.3.2 \
+       gail)
 AC_SUBST(TESTS_LIBS)
 AC_SUBST(TESTS_CFLAGS)
 
-PKG_CHECK_MODULES(UTILS, gtk+-2.0 >= 1.3.0 gdk-pixbuf-2.0 >= 1.3.0 bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 ORBit-2.0 >= 2.3.94)
+PKG_CHECK_MODULES(UTILS, \
+       libbonobo-2.0 >= 1.107.0 \
+       gtk+-2.0 >= 1.3.0 \
+       gdk-pixbuf-2.0 >= 1.3.0)
 AC_SUBST(UTILS_LIBS)
 AC_SUBST(UTILS_CFLAGS)
 
-PKG_CHECK_MODULES(AT_BRIDGE, bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 ORBit-2.0  >= 2.3.94 atk >= 0.2)
+PKG_CHECK_MODULES(AT_BRIDGE, \
+       libbonobo-2.0 >= 1.107.0 \
+       atk >= 0.2)
 AC_SUBST(AT_BRIDGE_LIBS)
 AC_SUBST(AT_BRIDGE_CFLAGS)
 
-PKG_CHECK_MODULES(LIBCSPI, bonobo-activation-2.0 >= 0.9.1 libbonobo-2.0 >= 1.97.0 ORBit-2.0  >= 2.3.94 atk >= 0.2)
+PKG_CHECK_MODULES(LIBCSPI, \
+       libbonobo-2.0 >= 1.107.0 \
+       atk >= 0.2)
 AC_SUBST(LIBCSPI_LIBS)
 AC_SUBST(LIBCSPI_CFLAGS)
 
@@ -158,6 +175,7 @@ registryd/Accessibility_Registry.server
 at-bridge/Makefile
 test/Makefile
 cspi/Makefile
+cspi/bonobo/Makefile
 util/Makefile
 util/Accessibility_Util.server
 ])
index 2d99a32..bb9b125 100644 (file)
@@ -1,3 +1,5 @@
+SUBDIRS = bonobo
+
 NULL=
 
 lib_LTLIBRARIES = libcspi.la
@@ -8,7 +10,9 @@ INCLUDES = -I $(top_srcdir)           \
 
 LDFLAGS = $(LIBCSPI_LIBS) @LT_VERSION_INFO@
 
-LDADD = ../libspi/libspi.la $(LIBCSPI_LIBS)
+LDADD =                                \
+       ../libspi/libspi.la     \
+       $(LIBCSPI_LIBS)
 
 libcspidir = $(includedir)/at-spi-1.0/cspi
 libcspi_HEADERS =              \
@@ -19,6 +23,7 @@ libcspi_HEADERS =             \
        spi-statetypes.h
 
 libcspi_la_SOURCES =           \
+       cspi-lowlevel.h         \
        spi_accessible.c        \
        spi_action.c            \
        spi_application.c       \
@@ -28,13 +33,13 @@ libcspi_la_SOURCES =                \
        spi_hyperlink.c         \
        spi_hypertext.c         \
        spi_image.c             \
-       spi-listener-impl.h     \
-       spi-listener-impl.c     \
        spi_main.c              \
        spi-private.h           \
        spi_registry.c          \
        spi_selection.c         \
        spi_table.c             \
        spi_text.c              \
-       spi-util.c              \
        spi_value.c
+
+libcspi_la_LIBADD =            \
+       bonobo/libcspi-bonobo.la
index 1d1eabd..554c78f 100644 (file)
@@ -121,14 +121,14 @@ cspi_event_listener_class_init (CSpiEventListenerClass *klass)
   klass->event = cspi_event;
 }
 
-CORBA_Object
+gpointer
 cspi_event_listener_new (void)
 {
   CSpiEventListener *listener;
 
   listener = g_object_new (cspi_event_listener_get_type (), NULL);
 
-  return CORBA_Object_duplicate (BONOBO_OBJREF (listener), cspi_ev ());
+  return listener;
 }
 
 void
@@ -136,8 +136,7 @@ cspi_event_listener_add_cb (AccessibleEventListener  *al,
                            AccessibleEventListenerCB callback,
                            void                     *user_data)
 {
-  CSpiEventListener *listener = bonobo_object (
-    ORBit_small_get_servant (CSPI_OBJREF (al)));
+  CSpiEventListener *listener = al;
 
   g_return_if_fail (CSPI_IS_EVENT_LISTENER (listener));
 
@@ -149,8 +148,7 @@ void
 cspi_event_listener_remove_cb (AccessibleEventListener  *al,
                               AccessibleEventListenerCB callback)
 {
-  CSpiEventListener *listener = bonobo_object (
-    ORBit_small_get_servant (CSPI_OBJREF (al)));
+  CSpiEventListener *listener = al;
 
   g_return_if_fail (CSPI_IS_EVENT_LISTENER (listener));
 
@@ -160,7 +158,6 @@ cspi_event_listener_remove_cb (AccessibleEventListener  *al,
 /*
  * Key event dispatcher
  */
-
 static gboolean
 cspi_key_event (SpiKeystrokeListener          *listener,
                const Accessibility_KeyStroke *keystroke)
@@ -251,14 +248,14 @@ BONOBO_TYPE_FUNC (CSpiKeystrokeListener,
                  spi_keystroke_listener_get_type (),
                  cspi_keystroke_listener);
 
-CORBA_Object
+gpointer
 cspi_keystroke_listener_new (void)
 {
   CSpiEventListener *listener;
 
   listener = g_object_new (cspi_keystroke_listener_get_type (), NULL);
 
-  return CORBA_Object_duplicate (BONOBO_OBJREF (listener), cspi_ev ());
+  return listener;
 }
 
 void
@@ -266,8 +263,7 @@ cspi_keystroke_listener_add_cb (AccessibleKeystrokeListener  *al,
                                AccessibleKeystrokeListenerCB callback,
                                void                         *user_data)
 {
-  CSpiKeystrokeListener *listener = bonobo_object (
-    ORBit_small_get_servant (CSPI_OBJREF (al)));
+  CSpiKeystrokeListener *listener = al;
 
   g_return_if_fail (CSPI_IS_KEYSTROKE_LISTENER (listener));
 
@@ -279,10 +275,35 @@ void
 cspi_keystroke_listener_remove_cb (AccessibleKeystrokeListener  *al,
                                   AccessibleKeystrokeListenerCB callback)
 {
-  CSpiKeystrokeListener *listener = bonobo_object (
-    ORBit_small_get_servant (CSPI_OBJREF (al)));
+  CSpiKeystrokeListener *listener = al;
 
   g_return_if_fail (CSPI_IS_KEYSTROKE_LISTENER (listener));
 
   listener->callbacks = event_list_remove_by_cb (listener->callbacks, callback);
 }
+
+void
+cspi_event_listener_unref (AccessibleEventListener *listener)
+{
+  bonobo_object_unref (BONOBO_OBJECT (listener));
+}
+
+void
+cspi_keystroke_listener_unref (AccessibleKeystrokeListener *listener)
+{
+  bonobo_object_unref (BONOBO_OBJECT (listener));
+}
+
+
+CORBA_Object
+cspi_event_listener_get_corba (AccessibleEventListener *listener)
+{
+  return BONOBO_OBJREF (listener);
+}
+
+CORBA_Object
+cspi_keystroke_listener_get_corba (AccessibleKeystrokeListener *listener)
+{
+  return BONOBO_OBJREF (listener);
+}
+
index 891b029..57e16de 100644 (file)
@@ -1,6 +1,6 @@
-#include "../cspi-lowlevel.h"
-
+#include <string.h>
 #include <libbonobo.h>
+#include "../cspi-lowlevel.h"
 
 void
 cspi_dup_ref (CORBA_Object object)
@@ -40,3 +40,61 @@ cspi_check_ev (const char *error_string)
     }
 }
 
+char *
+cspi_exception_get_text (void)
+{
+  char *ret, *txt;
+
+  txt = bonobo_exception_get_text (cspi_ev ());
+  ret = strdup (txt);
+  g_free (txt);
+
+  return ret;
+}
+
+CORBA_Object
+cspi_init (void)
+{
+  char *obj_id;
+  CORBA_Object registry;
+  CORBA_Environment ev;
+
+  if (!bonobo_init (0, NULL))
+    {
+      g_error ("Could not initialize Bonobo");
+    }
+
+  obj_id = "OAFIID:Accessibility_Registry:proto0.1";
+
+  CORBA_exception_init (&ev);
+
+  registry = bonobo_activation_activate_from_id (
+    obj_id, 0, NULL, &ev);
+
+  if (ev._major != CORBA_NO_EXCEPTION)
+    {
+      g_error ("AT-SPI error: during registry activation: %s\n",
+              bonobo_exception_get_text (&ev));
+    }
+
+  if (registry == CORBA_OBJECT_NIL)
+    {
+      g_error ("Could not locate registry");
+    }
+
+  bonobo_activate ();
+
+  return registry;
+}
+
+void
+cspi_main (void)
+{
+  bonobo_main ();
+}
+
+void
+cspi_main_quit (void)
+{
+  bonobo_main_quit ();
+}
index 9797f7f..12f1696 100644 (file)
 
 /* Misc CORBA / bonobo bits */
 
-SPIBoolean   cspi_check_ev       (const char *error_string);
-void         cspi_dup_ref        (CORBA_Object object);
-void         cspi_release_unref  (CORBA_Object object);
+SPIBoolean   cspi_check_ev           (const char *error_string);
+void         cspi_dup_ref            (CORBA_Object object);
+void         cspi_release_unref      (CORBA_Object object);
+char        *cspi_exception_get_text (void);
+CORBA_Object cspi_init               (void);
+void         cspi_main               (void);
+void         cspi_main_quit          (void);
 
 /* Listener bits */
 
-CORBA_Object cspi_event_listener_new           (void);
+gpointer     cspi_event_listener_new           (void);
+void         cspi_event_listener_unref         (AccessibleEventListener      *listener);
+CORBA_Object cspi_event_listener_get_corba     (AccessibleEventListener      *listener);
 void         cspi_event_listener_add_cb        (AccessibleEventListener      *listener,
                                                AccessibleEventListenerCB     callback,
                                                void                         *user_data);
 void         cspi_event_listener_remove_cb     (AccessibleEventListener      *listener,
                                                AccessibleEventListenerCB     callback);
 
-CORBA_Object cspi_keystroke_listener_new       (void);
+gpointer     cspi_keystroke_listener_new       (void);
+void         cspi_keystroke_listener_unref     (AccessibleKeystrokeListener  *listener);
+CORBA_Object cspi_keystroke_listener_get_corba (AccessibleKeystrokeListener  *listener);
 void         cspi_keystroke_listener_add_cb    (AccessibleKeystrokeListener  *listener,
                                                AccessibleKeystrokeListenerCB callback,
                                                void                         *user_data);
index 5f6ff70..82c529d 100644 (file)
@@ -4,7 +4,13 @@
 #ifndef _SPI_IMPL_H_
 #define _SPI_IMPL_H_
 
-typedef struct _Accessible Accessible;
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+typedef struct _Accessible AccessibleUnknown;
+typedef AccessibleUnknown  Accessible;
+
 typedef Accessible AccessibleAction;
 typedef Accessible AccessibleApplication;
 typedef Accessible AccessibleComponent;
@@ -19,11 +25,15 @@ typedef Accessible AccessibleTable;
 typedef Accessible AccessibleText;
 typedef Accessible AccessibleValue;
 typedef Accessible AccessibilityRegistry;
-typedef Accessible GenericInterface;
 
-typedef struct _CSpiEventListener     AccessibleEventListener;
-typedef struct _CSpiKeystrokeListener AccessibleKeystrokeListener;
+typedef void AccessibleEventListener;
+typedef void AccessibleKeystrokeListener;
 
 typedef unsigned int SPIBoolean;
 
+
+#ifdef  __cplusplus
+}
+#endif
+
 #endif
diff --git a/cspi/spi-listener-impl.c b/cspi/spi-listener-impl.c
deleted file mode 100644 (file)
index c87aa31..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-#include <cspi/spi-private.h>
-#include <cspi/spi-listener-impl.h>
-
-typedef struct
-{
-  union
-    {
-      AccessibleEventListenerCB     event;
-      AccessibleKeystrokeListenerCB key_event;
-      gpointer                      method;
-    } cb;
-  gpointer user_data;
-} EventHandler;
-
-GObjectClass *event_parent_class;
-GObjectClass *keystroke_parent_class;
-
-/*
- * Misc. helpers.
- */
-
-static EventHandler *
-event_handler_new (gpointer method, gpointer user_data)
-{
-  EventHandler *eh = g_new0 (EventHandler, 1);
-
-  eh->cb.method = method;
-  eh->user_data = user_data;
-
-  return eh;
-}
-
-static void
-event_handler_free (EventHandler *handler)
-{
-  g_free (handler);
-}
-
-static GList *
-event_list_remove_by_callback (GList *list, gpointer callback)
-{
-  GList *l, *next;
-       
-  for (l = list; l; l = next)
-    {
-      EventHandler *eh = l->data;
-      next = l->next;
-      
-      list = g_list_delete_link (list, l);
-      
-      event_handler_free (eh);
-    }
-
-  return list;
-}
-
-/*
- * Standard event dispatcher
- */
-
-BONOBO_CLASS_BOILERPLATE (CSpiEventListener, cspi_event_listener,
-                         GObject, spi_event_listener_get_type ())
-
-static void
-cspi_event (SpiEventListener    *listener,
-           Accessibility_Event *event)
-{
-  GList *l;
-  CSpiEventListener *clistener = (CSpiEventListener *) listener;
-  AccessibleEvent    aevent;
-  Accessible        *source;
-
-  source = cspi_object_add (bonobo_object_dup_ref (event->source, cspi_ev ()));
-
-  aevent.type    = event->type;
-  aevent.source  = source;
-  aevent.detail1 = event->detail1;
-  aevent.detail2 = event->detail2;
-
-  /* FIXME: re-enterancy hazard on this list */
-  for (l = clistener->callbacks; l; l = l->next)
-    {
-      EventHandler *eh = l->data;
-
-      eh->cb.event (&aevent, eh->user_data);
-    }
-
-  cspi_object_unref (source);
-}
-
-static void
-cspi_event_listener_instance_init (CSpiEventListener *listener)
-{
-}
-
-static void
-cspi_event_listener_finalize (GObject *object)
-{
-  CSpiEventListener *listener = (CSpiEventListener *) object;
-  GList *l;
-  
-  for (l = listener->callbacks; l; l = l->next)
-    {
-      event_handler_free (l->data);
-    }
-  
-  g_list_free (listener->callbacks);
-
-  event_parent_class->finalize (object);
-}
-
-static void
-cspi_event_listener_class_init (CSpiEventListenerClass *klass)
-{
-  GObjectClass *object_class = (GObjectClass *) klass;
-
-  event_parent_class = g_type_class_peek_parent (klass);
-  object_class->finalize = cspi_event_listener_finalize;
-
-  klass->event = cspi_event;
-}
-
-CSpiEventListener *
-cspi_event_listener_new (void)
-{
-  return g_object_new (cspi_event_listener_get_type (), NULL);
-}
-
-void
-cspi_event_listener_add_callback (CSpiEventListener        *listener,
-                                 AccessibleEventListenerCB callback,
-                                 void                     *user_data)
-{
-  g_return_if_fail (CSPI_IS_EVENT_LISTENER (listener));
-  listener->callbacks = g_list_prepend (listener->callbacks,
-                                       event_handler_new (callback, user_data));
-}
-
-void
-cspi_event_listener_remove_callback (CSpiEventListener        *listener,
-                                    AccessibleEventListenerCB callback)
-{
-  g_return_if_fail (CSPI_IS_EVENT_LISTENER (listener));
-  listener->callbacks = event_list_remove_by_callback (listener->callbacks, callback);
-}
-
-/*
- * Key event dispatcher
- */
-
-static gboolean
-cspi_key_event (SpiKeystrokeListener          *listener,
-               const Accessibility_KeyStroke *keystroke)
-{
-  GList *l;
-  CSpiKeystrokeListener *clistener = (CSpiKeystrokeListener *) listener;
-  AccessibleKeystroke akeystroke;
-  gboolean handled = FALSE;
-
-#ifdef SPI_KEYEVENT_DEBUG
-  fprintf (stderr, "%s%c",
-          (keystroke->modifiers & SPI_KEYMASK_ALT)?"Alt-":"",
-          ((keystroke->modifiers & SPI_KEYMASK_SHIFT)^(keystroke->modifiers & SPI_KEYMASK_SHIFTLOCK))?
-          (char) toupper((int) keystroke->keyID) : (char) tolower((int) keystroke->keyID));
-  
-  fprintf (stderr, "Key:\tsym %ld\n\tmods %x\n\tcode %d\n\ttime %ld\n",
-          (long) keystroke->keyID,
-          (unsigned int) keystroke->modifiers,
-          (int) keystroke->keycode,
-          (long int) keystroke->timestamp);
-#endif
-
-  switch (keystroke->type)
-    {
-      case Accessibility_KEY_PRESSED:
-       akeystroke.type = SPI_KEY_PRESSED;
-       break;
-      case Accessibility_KEY_RELEASED:
-       akeystroke.type = SPI_KEY_RELEASED;
-       break;
-      default:
-       akeystroke.type = 0;
-       break;
-    }
-  akeystroke.keyID     = keystroke->keyID;
-  akeystroke.keycode   = keystroke->keycode;
-  akeystroke.timestamp = keystroke->timestamp;
-  akeystroke.modifiers = keystroke->modifiers;
-
-  /* FIXME: re-enterancy hazard on this list */
-  for (l = clistener->callbacks; l; l = l->next)
-    {
-      EventHandler *eh = l->data;
-
-      if ((handled = eh->cb.key_event (&akeystroke, eh->user_data)))
-        {
-         break;
-       }
-    }
-  
-  return handled;
-}
-
-static void
-cspi_keystroke_listener_init (CSpiKeystrokeListener *listener)
-{
-}
-
-
-static void
-cspi_keystroke_listener_finalize (GObject *object)
-{
-  CSpiKeystrokeListener *listener = (CSpiKeystrokeListener *) object;
-  GList *l;
-  
-  for (l = listener->callbacks; l; l = l->next)
-    {
-      event_handler_free (l->data);
-    }
-  
-  g_list_free (listener->callbacks);
-
-  keystroke_parent_class->finalize (object);
-}
-
-static void
-cspi_keystroke_listener_class_init (CSpiKeystrokeListenerClass *klass)
-{
-  GObjectClass *object_class = (GObjectClass *) klass;
-
-  keystroke_parent_class = g_type_class_peek_parent (klass);
-  object_class->finalize = cspi_keystroke_listener_finalize;
-
-  klass->key_event = cspi_key_event;
-}
-
-BONOBO_TYPE_FUNC (CSpiKeystrokeListener, 
-                 spi_keystroke_listener_get_type (),
-                 cspi_keystroke_listener);
-
-CSpiKeystrokeListener *
-cspi_keystroke_listener_new (void)
-{
-  return g_object_new (cspi_keystroke_listener_get_type (), NULL);
-}
-
-void
-cspi_keystroke_listener_add_callback (CSpiKeystrokeListener        *listener,
-                                     AccessibleKeystrokeListenerCB callback,
-                                     void                         *user_data)
-{
-  g_return_if_fail (CSPI_IS_KEYSTROKE_LISTENER (listener));
-  listener->callbacks = g_list_prepend (listener->callbacks,
-                                       event_handler_new (callback, user_data));
-}
-
-void
-cspi_keystroke_listener_remove_callback (CSpiKeystrokeListener        *listener,
-                                        AccessibleKeystrokeListenerCB callback)
-{
-  g_return_if_fail (CSPI_IS_KEYSTROKE_LISTENER (listener));
-  listener->callbacks = event_list_remove_by_callback (listener->callbacks, callback);
-}
diff --git a/cspi/spi-listener-impl.h b/cspi/spi-listener-impl.h
deleted file mode 100644 (file)
index a533879..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef __SPI_LISTENER_IMPL_H__
-#define __SPI_LISTENER_IMP_H__
-
-#include <libspi/eventlistener.h>
-#include <libspi/keystrokelistener.h>
-#include <cspi/spi-impl.h>
-#include <cspi/spi-listener.h>
-
-G_BEGIN_DECLS
-
-#define CSPI_EVENT_LISTENER_TYPE        (cspi_event_listener_get_type ())
-#define CSPI_EVENT_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), CSPI_EVENT_LISTENER_TYPE, CSpiEventListener))
-#define CSPI_EVENT_LISTENER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), CSPI_EVENT_LISTENER_TYPE, CSpiEventListenerClass))
-#define CSPI_IS_EVENT_LISTENER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), CSPI_EVENT_LISTENER_TYPE))
-#define CSPI_IS_EVENT_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CSPI_EVENT_LISTENER_TYPE))
-
-typedef struct _CSpiEventListener CSpiEventListener;
-struct _CSpiEventListener {
-       SpiEventListener parent;
-       GList           *callbacks;
-};
-typedef SpiEventListenerClass CSpiEventListenerClass;
-
-GType              cspi_event_listener_get_type        (void);
-CSpiEventListener *cspi_event_listener_new             (void);
-void               cspi_event_listener_add_callback    (CSpiEventListener        *listener,
-                                                       AccessibleEventListenerCB callback,
-                                                       void                     *user_data);
-void               cspi_event_listener_remove_callback (CSpiEventListener        *listener,
-                                                       AccessibleEventListenerCB callback);
-
-#define CSPI_KEYSTROKE_LISTENER_TYPE        (cspi_keystroke_listener_get_type ())
-#define CSPI_KEYSTROKE_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), CSPI_KEYSTROKE_LISTENER_TYPE, CSpiKeystrokeListener))
-#define CSPI_KEYSTROKE_LISTENER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), CSPI_KEYSTROKE_LISTENER_TYPE, CSpiKeystrokeListenerClass))
-#define CSPI_IS_KEYSTROKE_LISTENER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), CSPI_KEYSTROKE_LISTENER_TYPE))
-#define CSPI_IS_KEYSTROKE_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CSPI_KEYSTROKE_LISTENER_TYPE))
-
-typedef struct _CSpiKeystrokeListener CSpiKeystrokeListener;
-struct _CSpiKeystrokeListener {
-       SpiKeystrokeListener parent;
-       GList               *callbacks;
-};
-typedef SpiKeystrokeListenerClass CSpiKeystrokeListenerClass;
-
-GType                  cspi_keystroke_listener_get_type        (void);
-CSpiKeystrokeListener *cspi_keystroke_listener_new             (void);
-void                   cspi_keystroke_listener_add_callback    (CSpiKeystrokeListener        *listener,
-                                                               AccessibleKeystrokeListenerCB callback,
-                                                               void                         *user_data);
-void                   cspi_keystroke_listener_remove_callback (CSpiKeystrokeListener        *listener,
-                                                               AccessibleKeystrokeListenerCB callback);
-
-G_END_DECLS
-
-#endif /* __SPI_LISTENER_IMPL_H__ */
index 0f9e600..e37390e 100644 (file)
@@ -3,7 +3,9 @@
 
 #include <cspi/spi-impl.h>
 
-G_BEGIN_DECLS
+#ifdef  __cplusplus
+extern "C" {
+#endif
 
 /*
  * Structure used to encapsulate event information
@@ -43,6 +45,8 @@ typedef void       (*AccessibleEventListenerCB)     (AccessibleEvent     *event,
 typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystroke *stroke,
                                                     void                *user_data);
 
-G_END_DECLS
+#ifdef  __cplusplus
+}
+#endif
 
 #endif
index 7d0ff20..633572e 100644 (file)
@@ -1,13 +1,11 @@
 #ifndef _SPI_PRIVATE_H_
 #define _SPI_PRIVATE_H_
 
-/*
- * Private internal implementation details of at-spi.
- */
+/* Private internal implementation details of at-spi. */
 
-#include <libbonobo.h>
 #include <libspi/Accessibility.h>
 #include <cspi/spi.h>
+#include "cspi/cspi-lowlevel.h"
 #include "cspi/spi-listener.h"
 
 struct _Accessible {
@@ -26,7 +24,6 @@ void                   cspi_object_ref       (Accessible          *accessible);
 void                   cspi_object_unref     (Accessible          *accessible);
 SPIBoolean             cspi_accessible_is_a  (Accessible          *obj,
                                              const char          *interface_name);
-SPIBoolean             cspi_check_ev         (const char          *error_string);
 
 #define cspi_return_if_fail(val)               \
        if (!(val))                             \
index 843064b..76b75be 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef _SPI_ROLETYPES_H_
 #define _SPI_ROLETYPES_H_
 
-#include <glib/gmacros.h>
-
-G_BEGIN_DECLS
+#ifdef  __cplusplus
+extern "C" {
+#endif
 
 /**
  * AccessibleRole:
@@ -148,6 +148,8 @@ typedef enum
 
 const char* AccessibleRole_getName (AccessibleRole role);
 
-G_END_DECLS
+#ifdef  __cplusplus
+}
+#endif
 
 #endif
index 1cb123a..778ab8a 100644 (file)
@@ -1,15 +1,11 @@
 #ifndef _SPI_STATETYPES_H_
 #define _SPI_STATETYPES_H_
 
-#include <glib/gmacros.h>
-
-G_BEGIN_DECLS
+#ifdef  __cplusplus
+extern "C" {
+#endif
 
-/*
- *
- * Enumerated type for accessible state
- *
- */
+/* Enumerated type for accessible state */
 
 typedef enum
 {
@@ -90,6 +86,8 @@ typedef enum
   SPI_STATE_LAST_DEFINED
 } AccessibleState;
 
-G_END_DECLS
+#ifdef  __cplusplus
+}
+#endif
 
 #endif
diff --git a/cspi/spi-util.c b/cspi/spi-util.c
deleted file mode 100644 (file)
index f9bb545..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <stdlib.h>
-#include <cspi/spi-private.h>
-
-/**
- * SPI_freeString:
- * @s: a character string returned from another at-spi call.
- *
- * Free a character string returned from an at-spi call.  Clients of
- * at-spi should use this function instead of free () or g_free().
- * This API should not be used to free strings
- * from other libraries or allocated by the client.
- **/
-void
-SPI_freeString (char *s)
-{
-  CORBA_free (s);
-}
-
-SPIBoolean
-cspi_check_ev (const char *error_string)
-{
-  CORBA_Environment *ev = cspi_ev ();
-
-  if (ev->_major != CORBA_NO_EXCEPTION)
-    {
-      char *err;
-
-      err = bonobo_exception_get_text (ev);
-
-      fprintf (stderr, "Warning: AT-SPI error: %s: %s\n",
-              error_string, err);
-
-      g_free (err);
-
-      CORBA_exception_free (ev);
-
-      return FALSE;
-    }
-  else
-    {
-      return TRUE;
-    }
-}
index 184a0ee..574e669 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _SPI_H
 #define _SPI_H
 
-#include <glib/gmacros.h>
-
 #include <cspi/spi-impl.h>
 /*
  * Definitions for AccessibleRole, AccessibleState,
@@ -17,7 +15,9 @@
  */
 #include <libspi/keymasks.h>
 
-G_BEGIN_DECLS
+#ifdef  __cplusplus
+extern "C" {
+#endif
 
 /*
  * Enumerated type for text boundary types
@@ -167,13 +167,13 @@ SPIBoolean  deregisterGlobalEventListener    (AccessibleEventListener *listener,
                                              const char              *eventType);
 SPIBoolean  deregisterGlobalEventListenerAll (AccessibleEventListener *listener);
 
-void        registerAccessibleKeystrokeListener (
+SPIBoolean  registerAccessibleKeystrokeListener (
                                               AccessibleKeystrokeListener *listener,
                                              AccessibleKeySet             *keys,
                                              AccessibleKeyMaskType         modmask,
                                              AccessibleKeyEventMask        eventmask,
                                              AccessibleKeyListenerSyncType sync_type);
-void        deregisterAccessibleKeystrokeListener (
+SPIBoolean  deregisterAccessibleKeystrokeListener (
                                               AccessibleKeystrokeListener *listener,
                                              AccessibleKeyMaskType        modmask);
 
@@ -181,9 +181,9 @@ int         getDesktopCount                  (void);
 Accessible *getDesktop                       (int i);
 int         getDesktopList                   (Accessible **list);
 
-void        generateKeyEvent                 (long int                    keyval,
+SPIBoolean  generateKeyEvent                 (long int                    keyval,
                                              AccessibleKeySynthType      synth_type);
-void        generateMouseEvent               (long int x, long int y, char *name);
+SPIBoolean  generateMouseEvent               (long int x, long int y, char *name);
 
 /* Accessible function prototypes  */
 
@@ -223,253 +223,65 @@ AccessibleSelection *    Accessible_getSelection    (Accessible *obj);
 AccessibleTable *        Accessible_getTable        (Accessible *obj);
 AccessibleText *         Accessible_getText         (Accessible *obj);
 AccessibleValue *        Accessible_getValue        (Accessible *obj);
-GenericInterface *       Accessible_queryInterface  (Accessible *obj,
+AccessibleUnknown *      Accessible_queryInterface  (Accessible *obj,
                                                     const char *interface_name);
 
-/*
- * AccessibleAction function prototypes
- */
-
-void AccessibleAction_ref    (AccessibleAction *obj);
-void AccessibleAction_unref  (AccessibleAction *obj);
-long
-AccessibleAction_getNActions (AccessibleAction *obj);
-
-/**
- * AccessibleAction_getName:
- * @obj: a pointer to the #AccessibleAction implementor to query.
- * @i: a long integer indicating which action to query.
- *
- * Get the name of the '@i-th' action invokable on an
- *      object implementing #AccessibleAction.
- *
- * Returns: the 'event type' name of the action, as a UTF-8 string.
- *
- **/
-char *
-AccessibleAction_getName (AccessibleAction *obj, long int i);
-
-/**
- * AccessibleAction_getDescription:
- * @obj: a pointer to the #AccessibleAction to query.
- * @i: a long integer indicating which action to query.
- *
- * Get the description of '@i-th' action invokable on an
- *      object implementing #AccessibleAction.
- *
- * Returns: a UTF-8 string describing the '@i-th' invokable action.
- *
- **/
-char *
-AccessibleAction_getDescription (AccessibleAction *obj,
-                                 long int i);
-
-SPIBoolean
-AccessibleAction_doAction (AccessibleAction *obj,
-                           long int i);
-
-/**
- * AccessibleAction_getKeybinding:
- * @obj: a pointer to the #AccessibleAction implementor to query.
- * @i: a long integer indicating which action to query.
- *
- * Get the keybindings for the @i-th action invokable on an
- *      object implementing #AccessibleAction, if any are defined.
- *
- * Returns: a UTF-8 string which can be parsed to determine the @i-th
- * invokable action's keybindings.
- *
- **/
-char *
-AccessibleAction_getKeyBinding (AccessibleAction *obj,
-                                long int i);
-
-/*
- *
- * AccessibleApplication function prototypes
- *
- */
-
-/**
- * AccessibleApplication_unref:
- * @obj: a pointer to the #AccessibleApplication on which to operate.
- *
- * Decrement the reference count for an #AccessibleApplication.
- *
- * Returns: (no return code implemented yet).
- *
- **/
-void
-AccessibleApplication_ref (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_unref:
- * @obj: a pointer to the #AccessibleApplication object on which to operate.
- *
- * Decrement the reference count for an #AccessibleApplication.
- *
- * Returns: (no return code implemented yet).
- *
- **/
-void
-AccessibleApplication_unref (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_getToolkitName:
- * @obj: a pointer to the #AccessibleApplication to query.
- *
- * Get the name of the UI toolkit used by an #AccessibleApplication.
- *
- * Returns: a UTF-8 string indicating which UI toolkit is
- *          used by an application.
- *
- **/
-char *
-AccessibleApplication_getToolkitName (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_getVersion:
- * @obj: a pointer to the #AccessibleApplication being queried.
- *
- * Get the version of the at-spi bridge exported by an
- *      #AccessibleApplication instance.
- *
- * Returns: a UTF-8 string indicating the application's
- *          at-spi version.
- *
- **/
-char *
-AccessibleApplication_getVersion (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_getID:
- * @obj: a pointer to the #AccessibleApplication being queried.
- *
- * Get the unique ID assigned by the Registry to an
- *      #AccessibleApplication instance.
- * (Not Yet Implemented by the registry).
- *
- * Returns: a unique #long integer associated with the application
- *          by the Registry, or 0 if the application is not registered.
- **/
-long
-AccessibleApplication_getID (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_pause:
- * @obj: a pointer to the #Accessible object on which to operate.
- *
- * Attempt to pause the application (used when client event queue is
- *  over-full).
- * Not Yet Implemented.
- *
- * Returns: #TRUE if the application was paused successfully, #FALSE otherwise.
- *
- **/
-SPIBoolean
-AccessibleApplication_pause (AccessibleApplication *obj);
-
-/**
- * AccessibleApplication_resume:
- * @obj: a pointer to the #Accessible object on which to operate.
- *
- * Attempt to resume the application (used after #AccessibleApplication_pause).
- * Not Yet Implemented.
- *
- * Returns: #TRUE if application processing resumed successfully, #FALSE otherwise.
- *
- **/
-SPIBoolean
-AccessibleApplication_resume (AccessibleApplication *obj);
-
-/*
- *
- * AccessibleComponent function prototypes
- *
- */
-
-void
-AccessibleComponent_ref (AccessibleComponent *obj);
-
-void
-AccessibleComponent_unref (AccessibleComponent *obj);
-
-SPIBoolean
-AccessibleComponent_contains (AccessibleComponent *obj,
-                              long int x,
-                              long int y,
-                              AccessibleCoordType ctype);
-
-Accessible *
-AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
-                                          long int x,
-                                          long int y,
-                                          AccessibleCoordType ctype);
-
-/**
- * AccessibleComponent_getExtents:
- * @obj: a pointer to the #AccessibleComponent to query.
- * @x: a pointer to a #long into which the minimum x coordinate will be returned.
- * @y: a pointer to a #long into which the minimum y coordinate will be returned.
- * @width: a pointer to a #long into which the x extents (width) will be returned.
- * @height: a pointer to a #long into which the y extents (height) will be returned.
- * @ctype: the desired coordinate system into which to return the results,
- *         (e.g. COORD_TYPE_WINDOW, COORD_TYPE_SCREEN).
- *
- * Get the bounding box of the specified #AccessibleComponent.
- *
- **/
-void
-AccessibleComponent_getExtents (AccessibleComponent *obj,
-                                long int *x,
-                                long int *y,
-                                long int *width,
-                                long int *height,
-                                AccessibleCoordType ctype);
-
-void
-AccessibleComponent_getPosition (AccessibleComponent *obj,
-                                 long int *x,
-                                 long int *y,
-                                 AccessibleCoordType ctype);
-
-void
-AccessibleComponent_getSize (AccessibleComponent *obj,
-                             long int *width,
-                             long int *height);
-
-/**
- * AccessibleComponent_getLayer:
- * @obj: a pointer to the #AccessibleComponent to query.
- *
- * Query which layer the component is painted into, to help determine its 
- *      visibility in terms of stacking order.
- *
- * Returns: the #AccessibleComponentLayer into which this component is painted.
- **/
+/* AccessibleAction function prototypes  */
+
+void       AccessibleAction_ref            (AccessibleAction *obj);
+void       AccessibleAction_unref          (AccessibleAction *obj);
+long       AccessibleAction_getNActions    (AccessibleAction *obj);
+char      *AccessibleAction_getName        (AccessibleAction *obj,
+                                           long int          i);
+char      *AccessibleAction_getDescription (AccessibleAction *obj,
+                                           long int          i);
+SPIBoolean AccessibleAction_doAction       (AccessibleAction *obj,
+                                           long int          i);
+char      *AccessibleAction_getKeyBinding  (AccessibleAction *obj,
+                                           long int          i);
+
+/* AccessibleApplication function prototypes  */
+
+void       AccessibleApplication_ref            (AccessibleApplication *obj);
+void       AccessibleApplication_unref          (AccessibleApplication *obj);
+char      *AccessibleApplication_getToolkitName (AccessibleApplication *obj);
+char      *AccessibleApplication_getVersion     (AccessibleApplication *obj);
+long       AccessibleApplication_getID          (AccessibleApplication *obj);
+SPIBoolean AccessibleApplication_pause          (AccessibleApplication *obj);
+SPIBoolean AccessibleApplication_resume         (AccessibleApplication *obj);
+
+/* AccessibleComponent function prototypes */
+
+void        AccessibleComponent_ref         (AccessibleComponent *obj);
+void        AccessibleComponent_unref       (AccessibleComponent *obj);
+SPIBoolean  AccessibleComponent_contains    (AccessibleComponent *obj,
+                                            long int             x,
+                                            long int             y,
+                                            AccessibleCoordType  ctype);
+Accessible *AccessibleComponent_getAccessibleAtPoint (
+                                             AccessibleComponent *obj,
+                                            long int             x,
+                                            long int             y,
+                                            AccessibleCoordType  ctype);
+void        AccessibleComponent_getExtents  (AccessibleComponent *obj,
+                                            long int            *x,
+                                            long int            *y,
+                                            long int            *width,
+                                            long int            *height,
+                                            AccessibleCoordType  ctype);
+void        AccessibleComponent_getPosition (AccessibleComponent *obj,
+                                            long int            *x,
+                                            long int            *y,
+                                            AccessibleCoordType  ctype);
+void        AccessibleComponent_getSize     (AccessibleComponent *obj,
+                                            long int            *width,
+                                            long int            *height);
 AccessibleComponentLayer
-AccessibleComponent_getLayer (AccessibleComponent *obj);
+            AccessibleComponent_getLayer    (AccessibleComponent *obj);
+void        AccessibleComponent_grabFocus   (AccessibleComponent *obj);
+short       AccessibleComponent_getMDIZOrder(AccessibleComponent *obj);
 
-/**
- * AccessibleComponent_getMDIZOrder:
- * @obj: a pointer to the #AccessibleComponent to query.
- *
- * Query the z stacking order of a component which is in the MDI layer.
- *
- * Returns: a short integer indicating the stacking order of the component 
- *       in the MDI layer, or -1 if the component is not in the MDI layer.
- **/
-short
-AccessibleComponent_getMDIZOrder (AccessibleComponent *obj);
-
-void
-AccessibleComponent_grabFocus (AccessibleComponent *obj);
-
-/*
- *
- * AccessibleEditableText function prototypes
- *
- */
+/* AccessibleEditableText function prototypes  */
 
 void
 AccessibleEditableText_ref (AccessibleEditableText *obj);
@@ -872,31 +684,21 @@ AccessibleText_setSelection (AccessibleText *obj,
                             long int startOffset,
                             long int endOffset);
 
-/*
- *
- * AccessibleValue Function Prototypes:
- *
- */
-
-void AccessibleValue_ref   (AccessibleValue *obj);
-void AccessibleValue_unref (AccessibleValue *obj);
-
-float
-AccessibleValue_getMinimumValue (AccessibleValue *obj);
-
-float
-AccessibleValue_getCurrentValue (AccessibleValue *obj);
+/* AccessibleValue Function Prototypes:  */
 
-float
-AccessibleValue_getMaximumValue (AccessibleValue *obj);
+void       AccessibleValue_ref             (AccessibleValue *obj);
+void       AccessibleValue_unref           (AccessibleValue *obj);
+float      AccessibleValue_getMinimumValue (AccessibleValue *obj);
+float      AccessibleValue_getCurrentValue (AccessibleValue *obj);
+float      AccessibleValue_getMaximumValue (AccessibleValue *obj);
+SPIBoolean AccessibleValue_setCurrentValue (AccessibleValue *obj,
+                                           float            newValue);
 
-SPIBoolean
-AccessibleValue_setCurrentValue (AccessibleValue *obj,
-                                 float newValue);
-
-void
-SPI_freeString (char *s);
+/* Misc methods */
+void SPI_freeString (char *s);
 
-G_END_DECLS
+#ifdef  __cplusplus
+}
+#endif
 
 #endif
index 78db9f6..e8c1f9c 100644 (file)
@@ -699,7 +699,7 @@ Accessible_getValue (Accessible *obj)
  *          by @obj, or NULL otherwise.
  *
  **/
-GenericInterface *
+AccessibleUnknown *
 Accessible_queryInterface (Accessible *obj,
                           const char *interface_name)
 {
index 7ed57d7..c7c6d93 100644 (file)
@@ -11,7 +11,6 @@
  * @obj: a pointer to the #AccessibleApplication on which to operate.
  *
  * Increment the reference count for an #AccessibleApplication.
- *
  **/
 void
 AccessibleApplication_ref (AccessibleApplication *obj)
@@ -24,7 +23,6 @@ AccessibleApplication_ref (AccessibleApplication *obj)
  * @obj: a pointer to the #AccessibleApplication object on which to operate.
  *
  * Decrement the reference count for an #AccessibleApplication.
- *
  **/
 void
 AccessibleApplication_unref (AccessibleApplication *obj)
@@ -93,7 +91,7 @@ AccessibleApplication_getVersion (AccessibleApplication *obj)
  *
  * Returns: a unique #long integer associated with the application
  *          by the Registry, or 0 if the application is not registered.
-**/
+ **/
 long
 AccessibleApplication_getID (AccessibleApplication *obj)
 {
index 7574c93..c1adea8 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include <cspi/spi-private.h>
-#include <cspi/spi-listener-impl.h>
 
 /**
  * createAccessibleEventListener:
@@ -66,7 +65,7 @@ AccessibleEventListener_addCallback (AccessibleEventListener *listener,
                                     AccessibleEventListenerCB callback,
                                     void                     *user_data)
 {
-  cspi_event_listener_add_callback (listener, callback, user_data);
+  cspi_event_listener_add_cb (listener, callback, user_data);
   return TRUE;
 }
 
@@ -79,8 +78,7 @@ AccessibleEventListener_addCallback (AccessibleEventListener *listener,
 void
 AccessibleEventListener_unref (AccessibleEventListener *listener)
 {
-  /* Would prefer this not to be bonobo api */
-  bonobo_object_unref (BONOBO_OBJECT (listener));
+  cspi_event_listener_unref (listener);
 }
 
 /**
@@ -97,7 +95,7 @@ SPIBoolean
 AccessibleEventListener_removeCallback (AccessibleEventListener  *listener,
                                        AccessibleEventListenerCB callback)
 {
-  cspi_event_listener_remove_callback (listener, callback);
+  cspi_event_listener_remove_cb (listener, callback);
   return TRUE;
 }
 
@@ -115,12 +113,12 @@ AccessibleKeystrokeListener *
 createAccessibleKeystrokeListener (AccessibleKeystrokeListenerCB callback,
                                   void                         *user_data)
 {
-  CSpiKeystrokeListener *listener = cspi_keystroke_listener_new ();
+  AccessibleKeystrokeListener *listener = cspi_keystroke_listener_new ();
   if (callback)
     {
       AccessibleKeystrokeListener_addCallback (listener, callback, user_data);
     }
-  return (AccessibleKeystrokeListener *)listener;
+  return listener;
 }
 
 /**
@@ -139,7 +137,7 @@ AccessibleKeystrokeListener_addCallback (AccessibleKeystrokeListener *listener,
                                         AccessibleKeystrokeListenerCB callback,
                                         void                         *user_data)
 {
-  cspi_keystroke_listener_add_callback (listener, callback, user_data);
+  cspi_keystroke_listener_add_cb (listener, callback, user_data);
   return TRUE;
 }
 
@@ -157,7 +155,7 @@ SPIBoolean
 AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listener,
                                            AccessibleKeystrokeListenerCB callback)
 {
-  cspi_keystroke_listener_remove_callback (listener, callback);
+  cspi_keystroke_listener_remove_cb (listener, callback);
   return TRUE;
 }
 
@@ -170,6 +168,5 @@ AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listene
 void
 AccessibleKeystrokeListener_unref (AccessibleKeystrokeListener *listener)
 {
-  /* Would prefer this not to be bonobo api */
-  bonobo_object_unref (BONOBO_OBJECT (listener));
+  cspi_keystroke_listener_unref (listener);
 }
index 0bc3a6c..f5cde18 100644 (file)
@@ -45,17 +45,16 @@ spi_object_release (gpointer  value)
   g_print ("releasing %p => %p\n", a, a->objref);
 #endif
 
-  bonobo_object_release_unref (a->objref, NULL);
+  cspi_release_unref (a->objref);
 
   memset (a, 0xaa, sizeof (Accessible));
   a->ref_count = -1;
 
 #ifndef DEBUG_OBJECTS
-  g_free (a);
+  free (a);
 #endif
 }
 
-
 SPIBoolean
 cspi_accessible_is_a (Accessible *obj,
                      const char *interface_name)
@@ -71,17 +70,17 @@ cspi_accessible_is_a (Accessible *obj,
   unknown = Bonobo_Unknown_queryInterface (CSPI_OBJREF (obj),
                                           interface_name, cspi_ev ());
 
-  if (BONOBO_EX (cspi_ev ()))
+  if (ev._major != CORBA_NO_EXCEPTION)
     {
       g_error ("Exception '%s' checking if is '%s'",
-              bonobo_exception_get_text (cspi_ev ()),
+              cspi_exception_get_text (),
               interface_name);
     }
 
   if (unknown != CORBA_OBJECT_NIL)
     {
       retval = TRUE;
-      bonobo_object_release_unref (unknown, NULL);
+      cspi_release_unref (unknown);
     }
   else
     {
@@ -122,7 +121,7 @@ cspi_exception (void)
 {
   SPIBoolean retval;
 
-  if (BONOBO_EX (&ev))
+  if (ev._major != CORBA_NO_EXCEPTION)
     {
       CORBA_exception_free (&ev);
       retval = TRUE;
@@ -154,14 +153,14 @@ cspi_object_add (CORBA_Object corba_object)
         {
           g_assert (ref->ref_count > 0);
          ref->ref_count++;
-          bonobo_object_release_unref (corba_object, NULL);
+          cspi_release_unref (corba_object);
 #ifdef DEBUG_OBJECTS
           g_print ("returning cached %p => %p\n", ref, ref->objref);
 #endif
        }
       else
         {
-          ref = g_new (Accessible, 1);
+          ref = malloc (sizeof (Accessible));
 
 #ifdef DEBUG_OBJECTS
           g_print ("allocating %p => %p\n", ref, corba_object);
@@ -213,7 +212,7 @@ cspi_cleanup (void)
 
   if (registry != CORBA_OBJECT_NIL)
     {
-      bonobo_object_release_unref (registry, NULL);
+      cspi_release_unref (registry);
       registry = CORBA_OBJECT_NIL;
     }
 }
@@ -230,9 +229,6 @@ static gboolean SPI_inited = FALSE;
 int
 SPI_init (void)
 {
-  int argc = 0;
-  char *obj_id;
-
   if (SPI_inited)
     {
       return 1;
@@ -242,28 +238,7 @@ SPI_init (void)
 
   CORBA_exception_init (&ev);
 
-  if (!bonobo_init (&argc, NULL))
-    {
-      g_error ("Could not initialize Bonobo");
-    }
-
-  obj_id = "OAFIID:Accessibility_Registry:proto0.1";
-
-  registry = bonobo_activation_activate_from_id (
-         obj_id, 0, NULL, cspi_ev ());
-
-  if (ev._major != CORBA_NO_EXCEPTION)
-    {
-      g_error ("AT-SPI error: during registry activation: %s\n",
-              bonobo_exception_get_text (cspi_ev ()));
-    }
-
-  if (registry == CORBA_OBJECT_NIL)
-    {
-      g_error ("Could not locate registry");
-    }
-
-  bonobo_activate ();
+  registry = cspi_init ();
 
   g_atexit (cspi_cleanup);
   
@@ -282,7 +257,7 @@ SPI_init (void)
 void
 SPI_event_main (void)
 {
-  bonobo_main ();
+  cspi_main ();
 }
 
 /**
@@ -294,7 +269,7 @@ SPI_event_main (void)
 void
 SPI_event_quit (void)
 {
-  bonobo_main_quit ();
+  cspi_main_quit ();
 }
 
 /**
@@ -374,3 +349,18 @@ SPI_exit (void)
 
   return leaked;
 }
+
+/**
+ * SPI_freeString:
+ * @s: a character string returned from another at-spi call.
+ *
+ * Free a character string returned from an at-spi call.  Clients of
+ * at-spi should use this function instead of free () or g_free().
+ * This API should not be used to free strings
+ * from other libraries or allocated by the client.
+ **/
+void
+SPI_freeString (char *s)
+{
+  CORBA_free (s);
+}
index c8996eb..17b7b36 100644 (file)
@@ -79,7 +79,6 @@
  * Add an in-process callback function to an existing AccessibleEventListener.
  *
  * Returns: #TRUE if successful, otherwise #FALSE.
- *
  **/
 SPIBoolean
 registerGlobalEventListener (AccessibleEventListener *listener,
@@ -87,12 +86,15 @@ registerGlobalEventListener (AccessibleEventListener *listener,
 {
   SPIBoolean retval;
 
+  if (!listener)
+    {
+      return FALSE;
+    }
+
   Accessibility_Registry_registerGlobalEventListener (
-                         cspi_registry (),
-                         (Accessibility_EventListener)
-                            BONOBO_OBJREF (bonobo_object (listener)),
-                         eventType,
-                         cspi_ev ());
+    cspi_registry (),
+    cspi_event_listener_get_corba (listener),
+    eventType, cspi_ev ());
 
   retval = !cspi_exception ();
  
@@ -110,18 +112,23 @@ registerGlobalEventListener (AccessibleEventListener *listener,
  *            listener reference.
  *
  * Returns: #TRUE if successful, otherwise #FALSE.
- *
  **/
 SPIBoolean
 deregisterGlobalEventListenerAll (AccessibleEventListener *listener)
 {
+  if (!listener)
+    {
+      return FALSE;
+    }
+
   Accessibility_Registry_deregisterGlobalEventListenerAll (
-                         cspi_registry (),
-                        (Accessibility_EventListener) BONOBO_OBJREF (listener),
-                        cspi_ev ());
+    cspi_registry (),
+    cspi_event_listener_get_corba (listener),
+    cspi_ev ());
 
   return !cspi_exception ();
 }
+
 /**
  * deregisterGlobalEventListener:
  * @listener: the #AccessibleEventListener registered against an event type.
@@ -132,17 +139,20 @@ deregisterGlobalEventListenerAll (AccessibleEventListener *listener)
  *             event type.
  *
  * Returns: #TRUE if successful, otherwise #FALSE.
- *
  **/
 SPIBoolean
 deregisterGlobalEventListener (AccessibleEventListener *listener,
                               const char              *eventType)
 {
+  if (!listener)
+    {
+      return FALSE;
+    }
+
   Accessibility_Registry_deregisterGlobalEventListener (
-         cspi_registry (),
-         (Accessibility_EventListener) BONOBO_OBJREF (listener),
-         (CORBA_char *) eventType,
-         cspi_ev ());
+    cspi_registry (), 
+    cspi_event_listener_get_corba (listener),
+    (CORBA_char *) eventType, cspi_ev ());
 
   return !cspi_exception ();
 }
@@ -155,7 +165,6 @@ deregisterGlobalEventListener (AccessibleEventListener *listener,
  *       function always returns '1'.
  *
  * Returns: an integer indicating the number of active virtual desktops.
- *
  **/
 int
 getDesktopCount ()
@@ -179,14 +188,13 @@ getDesktopCount ()
  *       function always returns '1'.
  *
  * Returns: a pointer to the 'i-th' virtual desktop's #Accessible representation.
- *
  **/
 Accessible*
 getDesktop (int i)
 {
-  return cspi_object_add (Accessibility_Registry_getDesktop (cspi_registry (),
-                                                            (CORBA_short) i,
-                                                            cspi_ev ()));
+  return cspi_object_add (
+    Accessibility_Registry_getDesktop (
+      cspi_registry (), (CORBA_short) i, cspi_ev ()));
 }
 
 /**
@@ -232,8 +240,10 @@ getDesktopList (Accessible **list)
  *             all windows (CSPI_KEYLISTENER_ALL_WINDOWS), or
  *             non-preemptively (CSPI_KEYLISTENER_NOSYNC).
  *             ( Other sync_type values may be available in the future.)
+ *
+ * Returns: #TRUE if successful, otherwise #FALSE.
  **/
-void
+SPIBoolean
 registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
                                     AccessibleKeySet *keys,
                                     AccessibleKeyMaskType modmask,
@@ -246,10 +256,15 @@ registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
   Accessibility_ControllerEventMask   controller_event_mask;
   Accessibility_DeviceEventController device_event_controller;
 
+  if (!listener)
+    {
+      return FALSE;
+    }
+
   device_event_controller = 
     Accessibility_Registry_getDeviceEventController (cspi_registry (), cspi_ev ());
 
-  cspi_return_if_ev ("getting event controller");
+  cspi_return_val_if_ev ("getting event controller", FALSE);
 
   /* copy the keyval filter values from the C api into the CORBA KeySet */
   if (keys)
@@ -261,7 +276,7 @@ registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
           /* we overload the keyset long w/keycodes, the - bit acts as a flag */
           key_set._buffer[i] = (keys->keysyms[i]) ? keys->keysyms[i] :
                                                 -keys->keycodes[i];
-         /* g_print ("key-set %d = %d\n", i, (int) key_set->_buffer[i]); */
+         /* fprintf (stderr, "key-set %d = %d\n", i, (int) key_set->_buffer[i]); */
         }
     }
   else
@@ -299,15 +314,17 @@ registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
   controller_event_mask.refcount = (CORBA_unsigned_short) 1;
 
   Accessibility_DeviceEventController_registerKeystrokeListener (
-         device_event_controller,
-         BONOBO_OBJREF (listener),
-         &key_set,
-         &controller_event_mask,
-         &key_events,
-         (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0),
-         cspi_ev ());
-
-  bonobo_object_release_unref (device_event_controller, cspi_ev ());
+    device_event_controller,
+    cspi_event_listener_get_corba (listener),
+    &key_set,
+    &controller_event_mask,
+    &key_events,
+    (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0),
+    cspi_ev ());
+
+  cspi_release_unref (device_event_controller);
+
+  return TRUE;
 }
 
 /**
@@ -319,8 +336,10 @@ registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
  *
  * Removes a keystroke event listener from the registry's listener queue,
  *            ceasing notification of events with modifiers matching @modmask.
+ *
+ * Returns: #TRUE if successful, otherwise #FALSE.
  **/
-void
+SPIBoolean
 deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
                                       AccessibleKeyMaskType modmask)
 {
@@ -329,10 +348,15 @@ deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
   Accessibility_KeyEventTypeSeq       key_events;
   Accessibility_DeviceEventController device_event_controller;
 
+  if (!listener)
+    {
+      return FALSE;
+    }
+
   device_event_controller = 
     Accessibility_Registry_getDeviceEventController (cspi_registry (), cspi_ev ());
 
-  cspi_return_if_ev ("getting keystroke listener");
+  cspi_return_val_if_ev ("getting keystroke listener", FALSE);
 
   controller_event_mask.value = (CORBA_unsigned_long) modmask;
   controller_event_mask.refcount = (CORBA_unsigned_short) 1;
@@ -344,15 +368,17 @@ deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
   key_set._length = 0;
 
   Accessibility_DeviceEventController_deregisterKeystrokeListener (
-         device_event_controller,
-         BONOBO_OBJREF (listener),
-         &key_set,
-         &controller_event_mask,
-         &key_events,
-         (CORBA_boolean) TRUE,
-         cspi_ev ());
-
-  bonobo_object_release_unref (device_event_controller, NULL);
+    device_event_controller,
+    cspi_event_listener_get_corba (listener),
+    &key_set,
+    &controller_event_mask,
+    &key_events,
+    (CORBA_boolean) TRUE,
+    cspi_ev ());
+
+  cspi_release_unref (device_event_controller);
+
+  return TRUE;
 }
 
 /**
@@ -367,8 +393,9 @@ deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
  * Synthesize a keyboard event (as if a hardware keyboard event occurred in the
  * current UI context).
  *
+ * Returns: #TRUE if successful, otherwise #FALSE.
  **/
-void
+SPIBoolean
 generateKeyEvent (long int keyval, AccessibleKeySynthType synth_type)
 {
 /* TODO: check current modifier status and
@@ -377,14 +404,16 @@ generateKeyEvent (long int keyval, AccessibleKeySynthType synth_type)
   Accessibility_DeviceEventController device_event_controller = 
          Accessibility_Registry_getDeviceEventController (cspi_registry (), cspi_ev ());
 
-  cspi_return_if_ev ("getting event controller");
+  cspi_return_val_if_ev ("getting event controller", FALSE);
 
   Accessibility_DeviceEventController_generateKeyEvent (device_event_controller,
                                                        keyval,
                                                        (unsigned long) synth_type,
                                                        cspi_ev ());
 
-  bonobo_object_release_unref (device_event_controller, NULL);
+  cspi_release_unref (device_event_controller);
+
+  return TRUE;
 }
 
 /**
@@ -399,10 +428,11 @@ generateKeyEvent (long int keyval, AccessibleKeySynthType synth_type)
  * tempted to generate mouse events, rather than this method.
  * Not Yet Implemented.
  *
+ * Returns: #TRUE if successful, otherwise #FALSE.
  **/
-void
+SPIBoolean
 generateMouseEvent (long x, long y, char *name)
 {
-  ;
+  return FALSE;
 }
 
index 25f45b2..d66d5cd 100644 (file)
@@ -193,7 +193,7 @@ AccessibleSelection_selectAll (AccessibleSelection *obj)
 
   cspi_check_ev ("selectAll");
 
-  return TRUE; /* TODO: change the bonobo method to return SPIBoolean */
+  return TRUE; /* TODO: change the CORBA method to return SPIBoolean */
 }
 
 /**
index db61c3d..62b4b53 100644 (file)
@@ -410,7 +410,7 @@ long_seq_to_array (Accessibility_LongSeq *seq, long int **array)
 
   length = seq->_length;
 
-  j = *array = g_new (long, length);
+  j = *array = malloc (sizeof (long) * length);
 
   for (i = 0; i < length; i++)
     {
index 743045a..bac78ed 100644 (file)
@@ -622,7 +622,7 @@ timeout_box ()
 }
 
 static void
-create_gui ()
+create_gui (void)
 {
   GtkWidget *window, *button, *container, *hbox;
   
@@ -672,7 +672,7 @@ create_gui ()
 }
 
 static void
-create_gui_x ()
+create_gui_x (void)
 {
   GtkWidget *window, *button, *container, *hbox, *range;
   GtkAdjustment *adjustment;
@@ -687,8 +687,6 @@ create_gui_x ()
   controls[6] = control_struct_new (XkbMouseKeysAccelMask, &xkb->ctrls->mk_time_to_max, NULL, "Accel");
   controls[7] = control_struct_new (XkbAccessXTimeoutMask, &xkb->ctrls->ax_timeout, "AccessX timeout", "Sec");
   
-  
-  
   hbox = gtk_widget_new (gtk_hbox_get_type(),
                         "GtkWidget::parent", container,
                         "GtkWidget::visible", TRUE,
index 614da7f..6337646 100644 (file)
@@ -210,7 +210,7 @@ test_editable_text (AccessibleEditableText *etext)
 static void
 test_table (AccessibleTable *table)
 {
-       char *str;
+       Accessible *header;
        gint index;
        gint rows, columns;
 
@@ -220,19 +220,18 @@ test_table (AccessibleTable *table)
        g_assert (rows > 0);
 
        columns = AccessibleTable_getNColumns (table);
-       g_assert (columns > 0); /* weird that this fails, surely a bug ? */
+       g_assert (columns > 0);
 
-       index = AccessibleTable_getIndexAt (table, rows-1, columns-1);
+       index = AccessibleTable_getIndexAt (table, rows - 1, columns - 1);
 
-       g_assert (AccessibleTable_getRowAtIndex (table, index) == rows-1);
+       g_assert (AccessibleTable_getRowAtIndex (table, index) == rows - 1);
 
-       g_assert (AccessibleTable_getColumnAtIndex (table, index) == columns-1);
+       g_assert (AccessibleTable_getColumnAtIndex (table, index) == columns - 1);
 
-       g_assert (AccessibleTable_getColumnHeader (table, 0));
-                  /* maybe bogus assertion */
+       g_assert ((header = AccessibleTable_getColumnHeader (table, 0)));
+       Accessible_unref (header);
 
        AccessibleTable_isSelected (table, 0, 0);
-                  /* no assertion, but see if warnings are thrown */
        
        /* FIXME: lots more tests */
 }
@@ -264,7 +263,6 @@ test_text (AccessibleText *text)
 static void
 test_value (AccessibleValue *value)
 {
-       char *str;
        float original_value;
        
         /* Note: test_value assertions are known not to work as of Dec 09 */
@@ -563,7 +561,7 @@ main (int argc, char **argv)
 {
        int leaked;
        TestWindow *win;
-       const char *modules, *tmp;
+       const char *modules;
        AccessibleEventListener *global_listener;
 
        modules = g_getenv ("GTK_MODULES");