2001-11-20 Michael Meeks <michael@ximian.com>
authormichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 03:57:25 +0000 (03:57 +0000)
committermichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 03:57:25 +0000 (03:57 +0000)
* libspi/*.[ch]: further convert to bonobo's type func
macros, remove redundnant casts etc.

* libspi/text.c s/accessibility_text/spi_text/g,
re-order to de-cruft.

* libspi/hypertext.c: re-order to kill a huge slew
of redundant forward decls.

* libspi/relation.c: ditto.

* libspi/image.c: ditto.

* */.cvsignore: update

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

32 files changed:
.cvsignore
ChangeLog
cspi/.cvsignore [new file with mode: 0644]
docs/.cvsignore
libspi/accessible.c
libspi/accessible.h
libspi/accessibleeventlistener.c
libspi/action.c
libspi/application.c
libspi/component.c
libspi/desktop.c
libspi/deviceeventcontroller.c
libspi/editabletext.c
libspi/eventlistener.c
libspi/hyperlink.c
libspi/hypertext.c
libspi/image.c
libspi/keystrokelistener.c
libspi/listener.c
libspi/registry.c
libspi/relation.c
libspi/selection.c
libspi/table.c
libspi/text.c
libspi/text.h
libspi/value.c
po/.cvsignore
registryd/desktop.c
registryd/deviceeventcontroller.c
registryd/registry.c
test/.cvsignore
util/.cvsignore [new file with mode: 0644]

index 0101d03..b8f68f4 100644 (file)
@@ -24,3 +24,4 @@ oaf.spec.in
 stamp-h
 stamp-h.in
 xml-i18n-*
+at-spi-1.0.pc
index 73a7cd4..f9021cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2001-11-20  Michael Meeks  <michael@ximian.com>
 
+       * libspi/*.[ch]: further convert to bonobo's type func
+       macros, remove redundnant casts etc.
+
+       * libspi/text.c s/accessibility_text/spi_text/g,
+       re-order to de-cruft.
+
+       * libspi/hypertext.c: re-order to kill a huge slew
+       of redundant forward decls.
+
+       * libspi/relation.c: ditto.
+
+       * libspi/image.c: ditto.
+
+       * */.cvsignore: update
+       
+2001-11-20  Michael Meeks  <michael@ximian.com>
+
        * libspi/deviceeventcontroller.c
        (_controller_register_with_devices): use g_getenv,
        kill stdlib.h include.
diff --git a/cspi/.cvsignore b/cspi/.cvsignore
new file mode 100644 (file)
index 0000000..c038ed7
--- /dev/null
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
\ No newline at end of file
index 282522d..6a3e62c 100644 (file)
@@ -1,2 +1,18 @@
 Makefile
 Makefile.in
+html-build.stamp
+html.stamp
+sgml-build.stamp
+sgml.stamp
+tmpl-build.stamp
+tmpl.stamp
+at-spi-unused.txt
+scan-build.stamp
+at-spi.signals
+at-spi.hierarchy
+at-spi.args
+at-spi-decl.txt
+at-spi-decl-list.txt
+html
+at-spi-undocumented.txt
+sgml
index 8dd694b..ecb6f3b 100644 (file)
@@ -270,8 +270,7 @@ BONOBO_TYPE_FUNC_FULL (SpiAccessible,
 SpiAccessible *
 spi_accessible_new (AtkObject *o)
 {
-    SpiAccessible *retval =
-               SPI_ACCESSIBLE (g_object_new (spi_accessible_get_type (), NULL));
+    SpiAccessible *retval = g_object_new (SPI_ACCESSIBLE_TYPE, NULL);
     CORBA_Environment ev;
     CORBA_exception_init (&ev);
     g_object_ref (o);
index 4050eb6..0a4f117 100644 (file)
@@ -45,8 +45,8 @@ typedef struct {
         POA_Accessibility_Accessible__epv epv;
 } SpiAccessibleClass;
 
-GType                  spi_accessible_get_type   (void);
-SpiAccessible             *spi_accessible_new       (AtkObject *o);
+GType          spi_accessible_get_type (void);
+SpiAccessible *spi_accessible_new      (AtkObject *o);
 
 
 #ifdef __cplusplus
index 38ac8f9..cf30cd4 100644 (file)
@@ -99,19 +99,21 @@ BONOBO_TYPE_FUNC (SpiEventListener,
 SpiEventListener *
 spi_event_listener_new ()
 {
-    SpiEventListener *retval =
-    SPI_ACCESSIBLE_EVENT_SPI_LISTENER (g_object_new (spi_event_listener_get_type (), NULL));
+    SpiEventListener *retval = g_object_new (
+           SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE, NULL);
     return retval;
 }
 
-void   spi_event_listener_add_callback (SpiEventListener *listener,
-                                               VoidSpiEventListenerCB callback)
+void
+spi_event_listener_add_callback (SpiEventListener *listener,
+                                VoidSpiEventListenerCB callback)
 {
   listener->callbacks = g_list_append (listener->callbacks, callback);
 }
 
-void   spi_event_listener_remove_callback (SpiEventListener *listener,
-                                                  VoidSpiEventListenerCB callback)
+void
+spi_event_listener_remove_callback (SpiEventListener *listener,
+                                   VoidSpiEventListenerCB callback)
 {
   listener->callbacks = g_list_remove (listener->callbacks, callback);
 }
index 0268330..1a23332 100644 (file)
@@ -98,8 +98,7 @@ spi_action_finalize (GObject *obj)
 SpiAction *
 spi_action_interface_new (AtkObject *obj)
 {
-  SpiAction *new_action = 
-    SPI_ACTION(g_object_new (SPI_ACTION_TYPE, NULL));
+  SpiAction *new_action = g_object_new (SPI_ACTION_TYPE, NULL);
   new_action->atko = obj;
   g_object_ref (obj);
   return new_action;
index bca3dea..e7d1a66 100644 (file)
@@ -328,8 +328,8 @@ spi_application_class_init (SpiApplicationClass *klass)
 static void
 spi_application_init (SpiApplication  *application)
 {
-  SPI_ACCESSIBLE (application)->atko = g_object_new (atk_object_get_type(), NULL);
-  application->toolkit_listeners = (GList *) NULL;
+  application->parent.atko = g_object_new (ATK_TYPE_OBJECT, NULL);
+  application->toolkit_listeners = NULL;
   the_app = application;
 }
 
@@ -340,9 +340,8 @@ BONOBO_TYPE_FUNC_FULL (SpiApplication,
 SpiApplication *
 spi_application_new (AtkObject *app_root)
 {
-    SpiApplication *retval =
-               SPI_APPLICATION (g_object_new (spi_application_get_type (), NULL));
-    SPI_ACCESSIBLE (retval)->atko = app_root;
+    SpiApplication *retval = g_object_new (SPI_APPLICATION_TYPE, NULL);
+    retval->parent.atko = app_root;
     g_object_ref (G_OBJECT (app_root));
     return retval;
 }
index 2b4e148..a9ad7a1 100644 (file)
@@ -202,8 +202,7 @@ BONOBO_TYPE_FUNC_FULL (SpiComponent,
 SpiComponent *
 spi_component_interface_new (AtkObject *o)
 {
-    SpiComponent *retval =
-               SPI_COMPONENT (g_object_new (SPI_COMPONENT_TYPE, NULL));
+    SpiComponent *retval = g_object_new (SPI_COMPONENT_TYPE, NULL);
     retval->atko = o;
     g_object_ref (o);
     return retval;
index 241fbc1..82dfd92 100644 (file)
@@ -36,7 +36,7 @@ static SpiAccessibleClass *parent_class;
 static void
 spi_desktop_init (SpiDesktop  *desktop)
 {
-  SPI_ACCESSIBLE (desktop)->atko = g_object_new (atk_object_get_type(), NULL);
+  SPI_ACCESSIBLE (desktop)->atko = g_object_new (ATK_TYPE_OBJECT, NULL);
   desktop->applications = NULL;
   atk_object_set_name (ATK_OBJECT (SPI_ACCESSIBLE (desktop)->atko), "main");
 }
@@ -100,7 +100,7 @@ BONOBO_TYPE_FUNC_FULL (SpiDesktop,
 SpiDesktop *
 spi_desktop_new (void)
 {
-    SpiDesktop *retval = SPI_DESKTOP (g_object_new (SPI_DESKTOP_TYPE, NULL));
+    SpiDesktop *retval = g_object_new (SPI_DESKTOP_TYPE, NULL);
 
     return retval;
 }
index cd25642..13d96f3 100644 (file)
@@ -560,8 +560,8 @@ SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
   SpiRegistry *registry = SPI_REGISTRY (registryp);    
-  SpiDeviceEventController *retval = 
-         SPI_DEVICE_EVENT_CONTROLLER (g_object_new (SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL));
+  SpiDeviceEventController *retval = g_object_new (
+         SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
   bonobo_object_ref (registry);
   return retval;
index a9867c8..551e2b6 100644 (file)
@@ -108,8 +108,8 @@ spi_editable_text_finalize (GObject *obj)
 SpiEditableText *
 spi_editable_text_interface_new (AtkObject *obj)
 {
-  SpiEditableText *new_editable =
-    SPI_EDITABLE_TEXT(g_object_new (SPI_EDITABLE_TEXT_TYPE, NULL));
+  SpiEditableText *new_editable = g_object_new (
+         SPI_EDITABLE_TEXT_TYPE, NULL);
   (SPI_TEXT (new_editable))->atko = obj;
   g_object_ref (obj);
   return new_editable;
index 38ac8f9..cf30cd4 100644 (file)
@@ -99,19 +99,21 @@ BONOBO_TYPE_FUNC (SpiEventListener,
 SpiEventListener *
 spi_event_listener_new ()
 {
-    SpiEventListener *retval =
-    SPI_ACCESSIBLE_EVENT_SPI_LISTENER (g_object_new (spi_event_listener_get_type (), NULL));
+    SpiEventListener *retval = g_object_new (
+           SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE, NULL);
     return retval;
 }
 
-void   spi_event_listener_add_callback (SpiEventListener *listener,
-                                               VoidSpiEventListenerCB callback)
+void
+spi_event_listener_add_callback (SpiEventListener *listener,
+                                VoidSpiEventListenerCB callback)
 {
   listener->callbacks = g_list_append (listener->callbacks, callback);
 }
 
-void   spi_event_listener_remove_callback (SpiEventListener *listener,
-                                                  VoidSpiEventListenerCB callback)
+void
+spi_event_listener_remove_callback (SpiEventListener *listener,
+                                   VoidSpiEventListenerCB callback)
 {
   listener->callbacks = g_list_remove (listener->callbacks, callback);
 }
index 9c93dfd..eb31975 100644 (file)
@@ -99,8 +99,8 @@ spi_hyperlink_finalize (GObject *obj)
 SpiHyperlink *
 spi_hyperlink_new (AtkHyperlink *hyperlink)
 {
-  SpiHyperlink *new_hyperlink = 
-    SPI_HYPERLINK(g_object_new (SPI_HYPERLINK_TYPE, NULL));
+  SpiHyperlink *new_hyperlink = g_object_new (
+         SPI_HYPERLINK_TYPE, NULL);
   g_object_ref (hyperlink);
   new_hyperlink->hyperlink = hyperlink;
   return new_hyperlink;
index 22466b1..cb4f98e 100644 (file)
 
 /* Static function declarations */
 
-static void
-spi_hypertext_class_init (SpiHypertextClass *klass);
-static void
-spi_hypertext_init (SpiHypertext *hypertext);
-static void
-spi_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
-spi_hypertext_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiHypertextClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_hypertext_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiHypertext),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_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_TYPE_OBJECT,
-                              POA_Accessibility_Hypertext__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiHypertextClass, epv),
-                              &tinfo,
-                              "SpiAccessibleHypertext");
-  }
-
-  return type;
-}
-
-static void
-spi_hypertext_class_init (SpiHypertextClass *klass)
-{
-  GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_Hypertext__epv *epv = &klass->epv;
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = spi_hypertext_finalize;
-
-  /* Initialize epv table */
-
-  epv->getNLinks = impl_getNLinks;
-  epv->getLink = impl_getLink;
-  epv->getLinkIndex = impl_getLinkIndex;
-}
-
-static void
-spi_hypertext_init (SpiHypertext *hypertext)
-{
-}
-
 static void
 spi_hypertext_finalize (GObject *obj)
 {
@@ -138,8 +43,7 @@ spi_hypertext_finalize (GObject *obj)
 SpiHypertext *
 spi_hypertext_interface_new (AtkObject *obj)
 {
-  SpiHypertext *new_hypertext = 
-    SPI_HYPERTEXT(g_object_new (SPI_HYPERTEXT_TYPE, NULL));
+  SpiHypertext *new_hypertext = g_object_new (SPI_HYPERTEXT_TYPE, NULL);
   new_hypertext->atko = obj;
   g_object_ref (obj);
   return new_hypertext;
@@ -191,3 +95,28 @@ impl_getLinkIndex (PortableServer_Servant _servant,
                                  (gint) characterIndex);
 }
 
+static void
+spi_hypertext_class_init (SpiHypertextClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Hypertext__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = spi_hypertext_finalize;
+
+  /* Initialize epv table */
+
+  epv->getNLinks = impl_getNLinks;
+  epv->getLink = impl_getLink;
+  epv->getLinkIndex = impl_getLinkIndex;
+}
+
+static void
+spi_hypertext_init (SpiHypertext *hypertext)
+{
+}
+
+BONOBO_TYPE_FUNC_FULL (SpiHypertext,
+                      Accessibility_Hypertext,
+                      BONOBO_TYPE_OBJECT,
+                      spi_hypertext);
index 5303bb7..645490c 100644 (file)
 #include <stdio.h>
 #include <libspi/image.h>
 
-/* Static function declarations */
-
-static void
-spi_image_class_init (SpiImageClass *klass);
-static void
-spi_image_init (SpiImage *image);
-static void
-spi_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);
-
-
+/* A pointer to our parent object class */
 static GObjectClass *parent_class;
 
-GType
-spi_image_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiImageClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_image_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiImage),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_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_TYPE_OBJECT,
-                              POA_Accessibility_Image__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiImageClass, epv),
-                              &tinfo,
-                              "SpiAccessibleImage");
-  }
-
-  return type;
-}
-
-static void
-spi_image_class_init (SpiImageClass *klass)
-{
-  GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_Image__epv *epv = &klass->epv;
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = spi_image_finalize;
-
-
-  /* Initialize epv table */
-
-  epv->getImagePosition = impl_getImagePosition;
-  epv->getImageSize = impl_getImageSize;
-  epv->_get_imageDescription = impl__get_imageDescription;
-}
-
-static void
-spi_image_init (SpiImage *image)
-{
-}
-
 static void
 spi_image_finalize (GObject *obj)
 {
@@ -120,8 +41,7 @@ spi_image_finalize (GObject *obj)
 SpiImage *
 spi_image_interface_new (AtkObject *obj)
 {
-  SpiImage *new_image = 
-    SPI_IMAGE(g_object_new (SPI_IMAGE_TYPE, NULL));
+  SpiImage *new_image = g_object_new (SPI_IMAGE_TYPE, NULL);
   new_image->atko = obj;
   g_object_ref (obj);
   return new_image;
@@ -172,4 +92,29 @@ impl__get_imageDescription (PortableServer_Servant servant,
 }
 
 
+static void
+spi_image_class_init (SpiImageClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Image__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = spi_image_finalize;
+
+
+  /* Initialize epv table */
+
+  epv->getImagePosition = impl_getImagePosition;
+  epv->getImageSize = impl_getImageSize;
+  epv->_get_imageDescription = impl__get_imageDescription;
+}
+
+static void
+spi_image_init (SpiImage *image)
+{
+}
 
+BONOBO_TYPE_FUNC_FULL (SpiImage,
+                      Accessibility_Image,
+                      BONOBO_TYPE_OBJECT,
+                      spi_image);
index 9a97f1e..6e4d69d 100644 (file)
@@ -123,7 +123,7 @@ BONOBO_TYPE_FUNC_FULL (SpiKeystrokeListener,
 SpiKeystrokeListener *
 spi_keystroke_listener_new (void)
 {
-    SpiKeystrokeListener *retval =
-               SPI_KEYSTROKE_LISTENER (g_object_new (spi_keystroke_listener_get_type (), NULL));
+    SpiKeystrokeListener *retval = g_object_new (
+           SPI_KEYSTROKE_LISTENER_TYPE, NULL);
     return retval;
 }
index b42b865..f751904 100644 (file)
@@ -96,46 +96,14 @@ spi_listener_init (SpiListener *listener)
 {
 }
 
-GType
-spi_listener_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiListenerClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_listener_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiListener),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_listener_init,
-                        NULL /* value table */
-                };
-                /*
-                 *   Here we use bonobo_type_unique instead of
-                 * gtk_type_unique, this auto-generates a load of
-                 * CORBA structures for us. All derived types must
-                 * use bonobo_type_unique.
-                 */
-                type = bonobo_type_unique (
-                        PARENT_TYPE,
-                        POA_Accessibility_EventListener__init,
-                        NULL,
-                        G_STRUCT_OFFSET (SpiListenerClass, epv),
-                        &tinfo,
-                        "SpiListener");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiListener,
+                      Accessibility_EventListener,
+                      PARENT_TYPE,
+                      spi_listener);
 
 SpiListener *
 spi_listener_new (void)
 {
-    SpiListener *retval =
-               SPI_LISTENER (g_object_new (spi_listener_get_type (), NULL));
+    SpiListener *retval = g_object_new (SPI_LISTENER_TYPE, NULL);
     return retval;
 }
index 06a7f61..fc4fb86 100644 (file)
@@ -605,46 +605,14 @@ spi_registry_init (SpiRegistry *registry)
   registry->kbd_event_hook = _device_event_controller_hook;
 }
 
-GType
-spi_registry_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiRegistryClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_registry_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiRegistry),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_registry_init,
-                        NULL /* value table */
-                };
-                /*
-                 *   Here we use bonobo_type_unique instead of
-                 * gtk_type_unique, this auto-generates a load of
-                 * CORBA structures for us. All derived types must
-                 * use bonobo_type_unique.
-                 */
-                type = bonobo_type_unique (
-                        PARENT_TYPE,
-                        POA_Accessibility_Registry__init,
-                        NULL,
-                        G_STRUCT_OFFSET (SpiRegistryClass, epv),
-                        &tinfo,
-                        "SpiRegistry");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiRegistry,
+                      Accessibility_Registry,
+                      PARENT_TYPE,
+                      spi_registry);
 
 SpiRegistry *
 spi_registry_new (void)
 {
-    SpiRegistry *retval =
-               SPI_REGISTRY (g_object_new (spi_registry_get_type (), NULL));
+    SpiRegistry *retval = g_object_new (SPI_REGISTRY_TYPE, NULL);
     return retval;
 }
index 6fae761..73bc192 100644 (file)
 #include <stdio.h>
 #include <libspi/relation.h>
 
-/* Static function declarations */
-
-static void
-spi_relation_class_init (SpiRelationClass *klass);
-static void
-spi_relation_init (SpiRelation *relation);
-static void
-spi_relation_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);
-
+/* A pointer to our parent object class */
 static GObjectClass *parent_class;
 
-GType
-spi_relation_get_type (void)
+static void
+spi_relation_finalize (GObject *obj)
 {
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiRelationClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_relation_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiRelation),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_relation_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_TYPE_OBJECT,
-                              POA_Accessibility_Relation__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiRelationClass, epv),
-                              &tinfo,
-                              "SpiAccessibleRelation");
-  }
+  SpiRelation *relation = SPI_RELATION(obj);
+  g_object_unref (relation->relation);
+  relation->relation = NULL;
+  parent_class->finalize (obj);
+}
 
-  return type;
+SpiRelation *
+spi_relation_new (AtkRelation *obj)
+{
+  SpiRelation *new_relation = g_object_new (SPI_RELATION_TYPE, NULL);
+  new_relation->relation = obj;
+  g_object_ref (obj);
+  return new_relation;
 }
 
 static void
@@ -111,22 +66,7 @@ spi_relation_init (SpiRelation *relation)
 {
 }
 
-static void
-spi_relation_finalize (GObject *obj)
-{
-  SpiRelation *relation = SPI_RELATION(obj);
-  g_object_unref (relation->relation);
-  relation->relation = NULL;
-  parent_class->finalize (obj);
-}
-
-SpiRelation *
-spi_relation_new (AtkRelation *obj)
-{
-  SpiRelation *new_relation = 
-    SPI_RELATION (g_object_new (SPI_RELATION_TYPE, NULL));
-  new_relation->relation = obj;
-  g_object_ref (obj);
-  return new_relation;
-}
-
+BONOBO_TYPE_FUNC_FULL (SpiRelation,
+                      Accessibility_Relation,
+                      BONOBO_TYPE_OBJECT,
+                      spi_relation);
index cd2e24a..f51c360 100644 (file)
 #include <libspi/accessible.h>
 #include <libspi/selection.h>
 
-/* Static function declarations */
-
-static void
-spi_selection_class_init (SpiSelectionClass *klass);
-static void
-spi_selection_init (SpiSelection *selection);
-static void
-spi_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);
-
-
+/* A pointer to our parent object class */
 static GObjectClass *parent_class;
 
-GType
-spi_selection_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiSelectionClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_selection_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiSelection),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_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_TYPE_OBJECT,
-                              POA_Accessibility_Selection__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiSelectionClass, epv),
-                              &tinfo,
-                              "SpiAccessibleSelection");
-  }
-
-  return type;
-}
-
-static void
-spi_selection_class_init (SpiSelectionClass *klass)
-{
-  GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_Selection__epv *epv = &klass->epv;
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = spi_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
-spi_selection_init (SpiSelection *selection)
-{
-}
-
 static void
 spi_selection_finalize (GObject *obj)
 {
@@ -138,8 +42,7 @@ spi_selection_finalize (GObject *obj)
 SpiSelection *
 spi_selection_interface_new (AtkObject *obj)
 {
-  SpiSelection *new_selection = 
-    SPI_SELECTION(g_object_new (SPI_SELECTION_TYPE, NULL));
+  SpiSelection *new_selection = g_object_new (SPI_SELECTION_TYPE, NULL);
   new_selection->atko = obj;
   g_object_ref (obj);
   return new_selection;
@@ -249,3 +152,33 @@ impl_clearSelection (PortableServer_Servant _servant,
   atk_selection_clear_selection (ATK_SELECTION(selection->atko));
 }
 
+static void
+spi_selection_class_init (SpiSelectionClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Selection__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = spi_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
+spi_selection_init (SpiSelection *selection)
+{
+}
+
+BONOBO_TYPE_FUNC_FULL (SpiSelection,
+                      Accessibility_Selection,
+                      BONOBO_TYPE_OBJECT,
+                      spi_selection);
index 487ccb9..63011d2 100644 (file)
 #include <libspi/accessible.h>
 #include <libspi/table.h>
 
-/* Static function declarations */
-
-static void
-spi_table_class_init (SpiTableClass *klass);
-static void
-spi_table_init (SpiTable *table);
-static void
-spi_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);
-
-
+/* A pointer to our parent object class */
 static GObjectClass *parent_class;
 
-GType
-spi_table_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiTableClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_table_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiTable),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_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_TYPE_OBJECT,
-                              POA_Accessibility_Table__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiTableClass, epv),
-                              &tinfo,
-                              "SpiAccessibleTable");
-  }
-
-  return type;
-}
-
-static void
-spi_table_class_init (SpiTableClass *klass)
-{
-  GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_Table__epv *epv = &klass->epv;
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = spi_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
-spi_table_init (SpiTable *table)
-{
-}
-
 static void
 spi_table_finalize (GObject *obj)
 {
@@ -202,8 +42,7 @@ spi_table_finalize (GObject *obj)
 SpiTable *
 spi_table_interface_new (AtkObject *obj)
 {
-  SpiTable *new_table =
-    SPI_TABLE(g_object_new (SPI_TABLE_TYPE, NULL));
+  SpiTable *new_table = g_object_new (SPI_TABLE_TYPE, NULL);
   new_table->atko = obj;
   g_object_ref (obj);
   return new_table;
@@ -503,5 +342,45 @@ impl_isSelected (PortableServer_Servant _servant,
                           (gint) row, (gint) column);
 }
 
+static void
+spi_table_class_init (SpiTableClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Table__epv *epv = &klass->epv;
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = spi_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
+spi_table_init (SpiTable *table)
+{
+}
 
+BONOBO_TYPE_FUNC_FULL (SpiTable,
+                      Accessibility_Table,
+                      BONOBO_TYPE_OBJECT,
+                      spi_table);
index a1da102..0ce1bd1 100644 (file)
 /* A pointer to our parent object class */
 static GObjectClass *spi_text_parent_class;
 
-/* Static function declarations */
-
-static void
-accessibility_text_class_init (SpiTextClass *klass);
-
-static void
-accessibility_text_init (SpiText *text);
-
-static void
-accessibility_text_object_finalize (GObject *obj);
-
-static CORBA_string
-impl_getText (PortableServer_Servant _servant,
-             const CORBA_long startOffset,
-             const CORBA_long endOffset,
-             CORBA_Environment * ev);
-
-static 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_unsigned_long
-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 CORBA_boolean
-impl_setCaretOffset (PortableServer_Servant _servant,
-                    const CORBA_long value,
-                    CORBA_Environment * ev); 
-
-GType
-accessibility_text_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiTextClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) accessibility_text_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiText),
-      0, /* n preallocs */
-      (GInstanceInitFunc) accessibility_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 (
-                              PARENT_TYPE,
-                              POA_Accessibility_Text__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiTextClass, epv),
-                              &tinfo,
-                              "SpiAccessibleText");
-  }
-
-  return type;
-}
-
-static void
-accessibility_text_class_init (SpiTextClass *klass)
-{
-  GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_Text__epv *epv = &klass->epv;
-  spi_text_parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = accessibility_text_object_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
-accessibility_text_init (SpiText *text)
-{
-}
-
-static void
-accessibility_text_object_finalize (GObject *obj)
-{
-  SpiText *text = SPI_TEXT (obj);
-  g_object_unref (text->atko);
-  text->atko = NULL;
-  spi_text_parent_class->finalize (obj);
-}
-
-SpiText *
-spi_text_interface_new (AtkObject *obj)
-{
-  SpiText *new_text = 
-    SPI_TEXT (g_object_new (accessibility_text_get_type (), NULL));
-  new_text->atko = obj;
-  g_object_ref (obj);
-  return new_text;
-}
-
-
-
 static CORBA_string
 impl_getText (PortableServer_Servant _servant,
              const CORBA_long startOffset,
@@ -622,3 +422,59 @@ impl_getRowColAtOffset (PortableServer_Servant _servant,
   g_print ("getRowColAtOffset not yet implemented\n");
 }
 
+static void
+spi_text_object_finalize (GObject *obj)
+{
+  SpiText *text = SPI_TEXT (obj);
+  g_object_unref (text->atko);
+  text->atko = NULL;
+  spi_text_parent_class->finalize (obj);
+}
+
+static void
+spi_text_class_init (SpiTextClass *klass)
+{
+  GObjectClass * object_class = (GObjectClass *) klass;
+  POA_Accessibility_Text__epv *epv = &klass->epv;
+  spi_text_parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = spi_text_object_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
+spi_text_init (SpiText *text)
+{
+}
+
+BONOBO_TYPE_FUNC_FULL (SpiText,
+                      Accessibility_Text,
+                      PARENT_TYPE,
+                      spi_text);
+
+SpiText *
+spi_text_interface_new (AtkObject *obj)
+{
+  SpiText *new_text = g_object_new (SPI_TEXT_TYPE, NULL);
+  new_text->atko = obj;
+  g_object_ref (obj);
+  return new_text;
+}
index 7818d75..df70d92 100644 (file)
@@ -30,30 +30,27 @@ extern "C" {
 #include <libspi/Accessibility.h>
 #include "accessible.h"
 
-#define SPI_TEXT_TYPE        (accessibility_text_get_type ())
-#define SPI_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_TEXT_TYPE, SpiText))
-#define SPI_TEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_TEXT_TYPE, SpiTextClass))
-#define IS_TEXT(obj)       (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPI_TEXT_TYPE))
-#define IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPI_TEXT_TYPE))
+#define SPI_TEXT_TYPE         (spi_text_get_type ())
+#define SPI_TEXT(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_TEXT_TYPE, SpiText))
+#define SPI_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SPI_TEXT_TYPE, SpiTextClass))
+#define IS_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPI_TEXT_TYPE))
+#define IS_TEXT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), SPI_TEXT_TYPE))
 
-typedef struct _Text SpiText;
-typedef struct _TextClass SpiTextClass;
+typedef struct _SpiText      SpiText;
+typedef struct _SpiTextClass SpiTextClass;
 
-struct _Text {
+struct _SpiText {
   BonoboObject parent;
   AtkObject *atko;
 };
 
-struct _TextClass {
+struct _SpiTextClass {
   BonoboObjectClass parent_class;
   POA_Accessibility_Text__epv epv;
 };
 
-GType
-accessibility_text_get_type   (void);
-
-SpiText *
-spi_text_interface_new       (AtkObject *obj);
+GType    spi_text_get_type      (void);
+SpiText *spi_text_interface_new (AtkObject *obj);
 
 #ifdef __cplusplus
 }
index cfe6f0d..e9cdb09 100644 (file)
@@ -92,8 +92,7 @@ spi_value_finalize (GObject *obj)
 SpiValue *
 spi_value_interface_new (AtkObject *obj)
 {
-  SpiValue *new_value = 
-    SPI_VALUE(g_object_new (SPI_VALUE_TYPE, NULL));
+  SpiValue *new_value = g_object_new (SPI_VALUE_TYPE, NULL);
   new_value->atko = obj;
   g_object_ref (obj);
   return new_value;
index 9523bef..f7d3ee7 100644 (file)
@@ -6,4 +6,5 @@ Makefile.in.in
 Makefile.in.in.orig
 stamp-cat-id
 cat-id-tbl.c
+po2tbl.sed
 POTFILES
index 241fbc1..82dfd92 100644 (file)
@@ -36,7 +36,7 @@ static SpiAccessibleClass *parent_class;
 static void
 spi_desktop_init (SpiDesktop  *desktop)
 {
-  SPI_ACCESSIBLE (desktop)->atko = g_object_new (atk_object_get_type(), NULL);
+  SPI_ACCESSIBLE (desktop)->atko = g_object_new (ATK_TYPE_OBJECT, NULL);
   desktop->applications = NULL;
   atk_object_set_name (ATK_OBJECT (SPI_ACCESSIBLE (desktop)->atko), "main");
 }
@@ -100,7 +100,7 @@ BONOBO_TYPE_FUNC_FULL (SpiDesktop,
 SpiDesktop *
 spi_desktop_new (void)
 {
-    SpiDesktop *retval = SPI_DESKTOP (g_object_new (SPI_DESKTOP_TYPE, NULL));
+    SpiDesktop *retval = g_object_new (SPI_DESKTOP_TYPE, NULL);
 
     return retval;
 }
index cd25642..13d96f3 100644 (file)
@@ -560,8 +560,8 @@ SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
   SpiRegistry *registry = SPI_REGISTRY (registryp);    
-  SpiDeviceEventController *retval = 
-         SPI_DEVICE_EVENT_CONTROLLER (g_object_new (SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL));
+  SpiDeviceEventController *retval = g_object_new (
+         SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
   bonobo_object_ref (registry);
   return retval;
index 06a7f61..fc4fb86 100644 (file)
@@ -605,46 +605,14 @@ spi_registry_init (SpiRegistry *registry)
   registry->kbd_event_hook = _device_event_controller_hook;
 }
 
-GType
-spi_registry_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiRegistryClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_registry_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiRegistry),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_registry_init,
-                        NULL /* value table */
-                };
-                /*
-                 *   Here we use bonobo_type_unique instead of
-                 * gtk_type_unique, this auto-generates a load of
-                 * CORBA structures for us. All derived types must
-                 * use bonobo_type_unique.
-                 */
-                type = bonobo_type_unique (
-                        PARENT_TYPE,
-                        POA_Accessibility_Registry__init,
-                        NULL,
-                        G_STRUCT_OFFSET (SpiRegistryClass, epv),
-                        &tinfo,
-                        "SpiRegistry");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiRegistry,
+                      Accessibility_Registry,
+                      PARENT_TYPE,
+                      spi_registry);
 
 SpiRegistry *
 spi_registry_new (void)
 {
-    SpiRegistry *retval =
-               SPI_REGISTRY (g_object_new (spi_registry_get_type (), NULL));
+    SpiRegistry *retval = g_object_new (SPI_REGISTRY_TYPE, NULL);
     return retval;
 }
index 7f5aea2..c1f450f 100644 (file)
@@ -4,3 +4,6 @@ Makefile.in
 Makefile
 app
 at
+accessx-gui
+simple-at
+keysynth-demo
diff --git a/util/.cvsignore b/util/.cvsignore
new file mode 100644 (file)
index 0000000..38326f6
--- /dev/null
@@ -0,0 +1,9 @@
+Accessibility_Util.server
+Makefile
+Magnifier.h
+Magnifier-common.c
+Magnifier-skels.c
+Magnifier-stubs.c
+magnifier
+mag_control
+Makefile.in