2001-11-20 Michael Meeks <michael@ximian.com>
authormichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 02:05:42 +0000 (02:05 +0000)
committermichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 02:05:42 +0000 (02:05 +0000)
* libspi/deviceeventcontroller.c
(_controller_register_with_devices): use g_getenv,
kill stdlib.h include.

* libspi/keystrokelistener.c
(spi_keystroke_listener_get_type): kill
(spi_keystroke_listener_class_init),
(spi_keystroke_listener_init): rename to this.

* libspi/text.c (impl_getAttributes): fix warning / bug.

* libspi/*.[ch]: more headers, includes and over commenting.

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

20 files changed:
ChangeLog
libspi/accessible.c
libspi/accessibleeventlistener.c
libspi/action.c
libspi/component.c
libspi/deviceeventcontroller.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/value.c
registryd/deviceeventcontroller.c
registryd/registry.c

index 23d1dac..73a7cd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2001-11-20  Michael Meeks  <michael@ximian.com>
 
+       * libspi/deviceeventcontroller.c
+       (_controller_register_with_devices): use g_getenv,
+       kill stdlib.h include.
+
+       * libspi/keystrokelistener.c
+       (spi_keystroke_listener_get_type): kill
+       (spi_keystroke_listener_class_init),
+       (spi_keystroke_listener_init): rename to this.
+
+       * libspi/text.c (impl_getAttributes): fix warning / bug.
+
+       * libspi/*.[ch]: more headers, includes and over commenting.
+       
+2001-11-20  Michael Meeks  <michael@ximian.com>
+
        * libspi/*.[ch]: fixup headers, includes and over commenting.
 
        * libspi/image.c (impl__get_imageDescription): const
index f0e6002..8dd694b 100644 (file)
 #include <stdio.h>
 #include <libspi/libspi.h>
 
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+/* Our parent Gtk object type  */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_accessible_parent_class;
 
 /*
index 4820f0b..38ac8f9 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * accessibleeventlistener.c: bonobo implementation of SpiListener.idl,
- *   with added ability to attach/remove in-process callbacks.
- *
- */
+/* accessibleeventlistener.c: implementation of SpiListener.idl */
 
+#include <config.h>
 #ifdef SPI_DEBUG
 #include <stdio.h>
 #endif
+#include <libspi/accessibleeventlistener.h>
 
-#include <config.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "accessibleeventlistener.h"
-
-/*
- * Our parent Gtk object type
- */
+/* Our parent Gtk object type */
 #define PARENT_TYPE SPI_LISTENER_TYPE
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static SpiListenerClass *spi_event_listener_parent_class;
 
 /*
@@ -107,41 +92,9 @@ spi_event_listener_init (SpiEventListener *listener)
         listener->callbacks = NULL;
 }
 
-GType
-spi_event_listener_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiEventListenerClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_event_listener_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiListener),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_event_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,
-                        "SpiEventListener");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC (SpiEventListener,
+                 PARENT_TYPE,
+                 spi_event_listener);
 
 SpiEventListener *
 spi_event_listener_new ()
index 13b1ec7..0268330 100644 (file)
@@ -59,7 +59,7 @@ static GObjectClass *parent_class;
 
 BONOBO_TYPE_FUNC_FULL (SpiAction,
                       Accessibility_Action,
-                      BONOBO_OBJECT_TYPE,
+                      BONOBO_TYPE_OBJECT,
                       spi_action);
 
 static void
index 5a5a687..2b4e148 100644 (file)
@@ -28,7 +28,7 @@
 #include <libspi/component.h>
 
 /* Our parent Gtk object type */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
 /* A pointer to our parent object class */
 static GObjectClass *spi_component_parent_class;
index 1834069..cd25642 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * listener.c: test for accessibility implementation
- *
- */
+/* deviceeventcontroler.c: implement the DeviceEventController interface */
+
+#include <config.h>
 
 #ifdef SPI_DEBUG
-#include <stdio.h>
+#  include <stdio.h>
 #endif
 
-#include <stdlib.h> /* for getenv() */
 #include <X11/Xlib.h>
 #include <X11/extensions/XTest.h>
-#include <config.h>
 #include <gdk/gdkx.h> /* TODO: hide dependency (wrap in single porting file) */
 #include <gdk/gdkwindow.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
 
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "deviceeventcontroller.h"
+#include <libspi/deviceeventcontroller.h>
 
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+/* Our parent Gtk object type */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_device_event_controller_parent_class;
 
 static gboolean kbd_registered = FALSE;
@@ -60,24 +48,24 @@ static Display *display;
 static Window root_window;
 
 typedef enum {
-  SPI_DEVICE_TYPE_KBD,
-  SPI_DEVICE_TYPE_MOUSE,
-  SPI_DEVICE_TYPE_LAST_DEFINED
+       SPI_DEVICE_TYPE_KBD,
+       SPI_DEVICE_TYPE_MOUSE,
+       SPI_DEVICE_TYPE_LAST_DEFINED
 } SpiDeviceTypeCategory;
 
 struct _DEControllerListener {
-  CORBA_Object object;
-  SpiDeviceTypeCategory type;
+       CORBA_Object          object;
+       SpiDeviceTypeCategory type;
 };
 
 typedef struct _DEControllerListener DEControllerListener;
 
 struct _DEControllerKeyListener {
-  DEControllerListener listener;
-  Accessibility_KeySet *keys;
-  Accessibility_ControllerEventMask *mask;
-  Accessibility_KeyEventTypeSeq *typeseq;
-  gboolean is_system_global;   
+       DEControllerListener listener;
+       Accessibility_KeySet *keys;
+       Accessibility_ControllerEventMask *mask;
+       Accessibility_KeyEventTypeSeq *typeseq;
+       gboolean is_system_global;      
 };
 
 typedef struct _DEControllerKeyListener DEControllerKeyListener;
@@ -243,7 +231,7 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
           (unsigned long) GDK_ROOT_WINDOW(), GDK_DISPLAY());
 #endif
   /* We must open a new connection to the server to avoid clashing with the GDK event loop */
-  display = XOpenDisplay (getenv ("DISPLAY"));
+  display = XOpenDisplay (g_getenv ("DISPLAY"));
   root_window = DefaultRootWindow (display);           
   XSelectInput (display,
                root_window,
@@ -539,7 +527,7 @@ spi_device_event_controller_class_init (SpiDeviceEventControllerClass *klass)
 {
         GObjectClass * object_class = (GObjectClass *) klass;
         POA_Accessibility_DeviceEventController__epv *epv = &klass->epv;
-        spi_device_event_controller_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+        spi_device_event_controller_parent_class = g_type_class_peek_parent (klass);
 
         object_class->finalize = spi_device_event_controller_object_finalize;
 
@@ -560,7 +548,8 @@ spi_device_event_controller_init (SpiDeviceEventController *device_event_control
   kbd_registered = _controller_register_with_devices (device_event_controller);
 }
 
-gboolean spi_device_event_controller_check_key_event (SpiDeviceEventController *controller)
+gboolean
+spi_device_event_controller_check_key_event (SpiDeviceEventController *controller)
 {
        SpiDeviceEventControllerClass *klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
        if (klass->check_key_event)
index 4820f0b..38ac8f9 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * accessibleeventlistener.c: bonobo implementation of SpiListener.idl,
- *   with added ability to attach/remove in-process callbacks.
- *
- */
+/* accessibleeventlistener.c: implementation of SpiListener.idl */
 
+#include <config.h>
 #ifdef SPI_DEBUG
 #include <stdio.h>
 #endif
+#include <libspi/accessibleeventlistener.h>
 
-#include <config.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "accessibleeventlistener.h"
-
-/*
- * Our parent Gtk object type
- */
+/* Our parent Gtk object type */
 #define PARENT_TYPE SPI_LISTENER_TYPE
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static SpiListenerClass *spi_event_listener_parent_class;
 
 /*
@@ -107,41 +92,9 @@ spi_event_listener_init (SpiEventListener *listener)
         listener->callbacks = NULL;
 }
 
-GType
-spi_event_listener_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiEventListenerClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_event_listener_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiListener),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_event_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,
-                        "SpiEventListener");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC (SpiEventListener,
+                 PARENT_TYPE,
+                 spi_event_listener);
 
 SpiEventListener *
 spi_event_listener_new ()
index aa4c962..9c93dfd 100644 (file)
@@ -60,7 +60,7 @@ static GObjectClass *parent_class;
 
 BONOBO_TYPE_FUNC_FULL (SpiHyperlink,
                       Accessibility_Hyperlink,
-                      BONOBO_OBJECT_TYPE,
+                      BONOBO_TYPE_OBJECT,
                       spi_hyperlink);
 
 static void
index 42bc900..22466b1 100644 (file)
@@ -94,7 +94,7 @@ spi_hypertext_get_type (void)
      * use bonobo_type_unique.
      */
     type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
+                              BONOBO_TYPE_OBJECT,
                               POA_Accessibility_Hypertext__init,
                               NULL,
                               G_STRUCT_OFFSET (SpiHypertextClass, epv),
index b957849..5303bb7 100644 (file)
@@ -75,7 +75,7 @@ spi_image_get_type (void)
      * use bonobo_type_unique.
      */
     type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
+                              BONOBO_TYPE_OBJECT,
                               POA_Accessibility_Image__init,
                               NULL,
                               G_STRUCT_OFFSET (SpiImageClass, epv),
index c4f6a28..9a97f1e 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * listener.c: test for accessibility implementation
- *
- */
+/* keystrokelistener.c: implement the KeystrokeListener interface */
 
+#include <config.h>
 #ifdef SPI_DEBUG
-#include <stdio.h>
+#  include <stdio.h>
 #endif
+#include <libspi/keystrokelistener.h>
 
-#include <config.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
+/* Our parent Gtk object type  */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "keystrokelistener.h"
-
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
-
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *keystroke_listener_parent_class;
 
 /*
@@ -112,11 +98,11 @@ impl_key_event (PortableServer_Servant     servant,
 }
 
 static void
-keystroke_listener_class_init (SpiKeystrokeListenerClass *klass)
+spi_keystroke_listener_class_init (SpiKeystrokeListenerClass *klass)
 {
         GObjectClass * object_class = (GObjectClass *) klass;
         POA_Accessibility_KeystrokeListener__epv *epv = &klass->epv;
-        keystroke_listener_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+        keystroke_listener_parent_class = g_type_class_peek_parent (klass);
 
         object_class->finalize = keystroke_listener_object_finalize;
 
@@ -124,46 +110,15 @@ keystroke_listener_class_init (SpiKeystrokeListenerClass *klass)
 }
 
 static void
-keystroke_listener_init (SpiKeystrokeListener *keystroke_listener)
+spi_keystroke_listener_init (SpiKeystrokeListener *keystroke_listener)
 {
        keystroke_listener->callbacks = NULL;
 }
 
-GType
-spi_keystroke_listener_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiKeystrokeListenerClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) keystroke_listener_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiKeystrokeListener),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) keystroke_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_KeystrokeListener__init,
-                        NULL,
-                        G_STRUCT_OFFSET (SpiKeystrokeListenerClass, epv),
-                        &tinfo,
-                        "SpiKeystrokeListener");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiKeystrokeListener,
+                      Accessibility_KeystrokeListener,
+                      BONOBO_TYPE_OBJECT,
+                      spi_keystroke_listener);
 
 SpiKeystrokeListener *
 spi_keystroke_listener_new (void)
index 372e865..b42b865 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * listener.c: test for accessibility implementation
- *
- */
+/* listener.c: implements the Listener interface */
 
 #ifdef SPI_DEBUG
 #include <stdio.h>
 #endif
 
 #include <config.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "listener.h"
+#include <libspi/listener.h>
 
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+/* Our parent Gtk object type */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_listener_parent_class;
 
 /*
@@ -97,7 +84,7 @@ spi_listener_class_init (SpiListenerClass *klass)
 {
         GObjectClass * object_class = (GObjectClass *) klass;
         POA_Accessibility_EventListener__epv *epv = &klass->epv;
-        spi_listener_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+        spi_listener_parent_class = g_type_class_peek_parent (klass);
 
         object_class->finalize = spi_listener_object_finalize;
 
index 05fc512..06a7f61 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * registry.c: the main accessibility service registry implementation
- */
+/* registry.c: the main accessibility service registry implementation */
 
+#include <config.h>
 #ifdef SPI_DEBUG
-#include <stdio.h>
+#  include <stdio.h>
 #endif
-#include <config.h>
-#include <bonobo/Bonobo.h>
-
-/*
- * This pulls the CORBA definitions for the "Accessibility::Registry" server
- */
-#include <libspi/Accessibility.h>
 
 /*
  * We'd like to replace the dependance on X-isms with a wrapper layer,
 #include <X11/Xlib.h>
 #include <gdk/gdkx.h>
 
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "registry.h"
+#include <libspi/registry.h>
 
-/*
- * Our parent GObject type
- */
+/* Our parent GObject type  */
 #define PARENT_TYPE SPI_LISTENER_TYPE
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static SpiListenerClass *spi_registry_parent_class;
 
 typedef enum {
index 1ddb74f..6fae761 100644 (file)
@@ -81,7 +81,7 @@ spi_relation_get_type (void)
      * use bonobo_type_unique.
      */
     type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
+                              BONOBO_TYPE_OBJECT,
                               POA_Accessibility_Relation__init,
                               NULL,
                               G_STRUCT_OFFSET (SpiRelationClass, epv),
index aa0ff47..cd2e24a 100644 (file)
@@ -89,7 +89,7 @@ spi_selection_get_type (void)
      * use bonobo_type_unique.
      */
     type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
+                              BONOBO_TYPE_OBJECT,
                               POA_Accessibility_Selection__init,
                               NULL,
                               G_STRUCT_OFFSET (SpiSelectionClass, epv),
index 4264697..487ccb9 100644 (file)
@@ -141,7 +141,7 @@ spi_table_get_type (void)
      * use bonobo_type_unique.
      */
     type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
+                              BONOBO_TYPE_OBJECT,
                               POA_Accessibility_Table__init,
                               NULL,
                               G_STRUCT_OFFSET (SpiTableClass, epv),
index f7f5ddb..a1da102 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * component.c : bonobo wrapper for accessible component implementation
- *
- */
-#include <config.h>
-#include <bonobo/Bonobo.h>
+/* text.c : implements the Text interface */
 
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <libspi/text.h>
 
-/*
- * This pulls the CORBA definitions for the "Accessibility::Accessible" server
- */
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition of the SpiText bonobo object
- */
-#include "text.h"
+/* Our parent Gtk object type */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
-
-
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_text_parent_class;
 
-/*
- * Static function declarations
- */
+/* Static function declarations */
 
 static void
 accessibility_text_class_init (SpiTextClass *klass);
@@ -447,6 +427,8 @@ impl_getAttributes (PortableServer_Servant _servant,
   g_return_val_if_fail (ATK_IS_TEXT (text->atko), (CORBA_char *)"");
 
   g_print ("getAttributes not yet implemented.\n");
+
+  return CORBA_string_dup ("");
 }
 
 static void 
index 9610701..cfe6f0d 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * component.c : bonobo wrapper for accessible component implementation
- *
- */
+/* value.c : implements the Value interface */
 #include <config.h>
-#include <bonobo/Bonobo.h>
-
 #include <stdio.h>
+#include <libspi/value.h>
 
-/*
- * This pulls the CORBA definitions for the "Accessibility::Accessible" server
- */
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition of the SpiValue bonobo object
- */
-#include "value.h"
-
-/*
- * Static function declarations
- */
+/* Static function declarations */
 
 static void
 spi_value_class_init (SpiValueClass *klass);
@@ -68,41 +52,10 @@ impl__set_currentValue (PortableServer_Servant _servant,
 static GObjectClass *parent_class;
 
 
-GType
-spi_value_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiValueClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_value_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiValue),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_value_init,
-                        NULL /* value table */
-    };
-
-    /*
-     * Bonobo_type_unique auto-generates a load of
-     * CORBA structures for us. All derived types must
-     * use bonobo_type_unique.
-     */
-    type = bonobo_type_unique (
-                              BONOBO_OBJECT_TYPE,
-                              POA_Accessibility_Value__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiValueClass, epv),
-                              &tinfo,
-                              "SpiAccessibleValue");
-  }
-
-  return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiValue,
+                      Accessibility_Value,
+                      BONOBO_TYPE_OBJECT,
+                      spi_value);
 
 static void
 spi_value_class_init (SpiValueClass *klass)
index 1834069..cd25642 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * listener.c: test for accessibility implementation
- *
- */
+/* deviceeventcontroler.c: implement the DeviceEventController interface */
+
+#include <config.h>
 
 #ifdef SPI_DEBUG
-#include <stdio.h>
+#  include <stdio.h>
 #endif
 
-#include <stdlib.h> /* for getenv() */
 #include <X11/Xlib.h>
 #include <X11/extensions/XTest.h>
-#include <config.h>
 #include <gdk/gdkx.h> /* TODO: hide dependency (wrap in single porting file) */
 #include <gdk/gdkwindow.h>
-#include <bonobo/Bonobo.h>
-#include <libspi/Accessibility.h>
 
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "deviceeventcontroller.h"
+#include <libspi/deviceeventcontroller.h>
 
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+/* Our parent Gtk object type */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_device_event_controller_parent_class;
 
 static gboolean kbd_registered = FALSE;
@@ -60,24 +48,24 @@ static Display *display;
 static Window root_window;
 
 typedef enum {
-  SPI_DEVICE_TYPE_KBD,
-  SPI_DEVICE_TYPE_MOUSE,
-  SPI_DEVICE_TYPE_LAST_DEFINED
+       SPI_DEVICE_TYPE_KBD,
+       SPI_DEVICE_TYPE_MOUSE,
+       SPI_DEVICE_TYPE_LAST_DEFINED
 } SpiDeviceTypeCategory;
 
 struct _DEControllerListener {
-  CORBA_Object object;
-  SpiDeviceTypeCategory type;
+       CORBA_Object          object;
+       SpiDeviceTypeCategory type;
 };
 
 typedef struct _DEControllerListener DEControllerListener;
 
 struct _DEControllerKeyListener {
-  DEControllerListener listener;
-  Accessibility_KeySet *keys;
-  Accessibility_ControllerEventMask *mask;
-  Accessibility_KeyEventTypeSeq *typeseq;
-  gboolean is_system_global;   
+       DEControllerListener listener;
+       Accessibility_KeySet *keys;
+       Accessibility_ControllerEventMask *mask;
+       Accessibility_KeyEventTypeSeq *typeseq;
+       gboolean is_system_global;      
 };
 
 typedef struct _DEControllerKeyListener DEControllerKeyListener;
@@ -243,7 +231,7 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
           (unsigned long) GDK_ROOT_WINDOW(), GDK_DISPLAY());
 #endif
   /* We must open a new connection to the server to avoid clashing with the GDK event loop */
-  display = XOpenDisplay (getenv ("DISPLAY"));
+  display = XOpenDisplay (g_getenv ("DISPLAY"));
   root_window = DefaultRootWindow (display);           
   XSelectInput (display,
                root_window,
@@ -539,7 +527,7 @@ spi_device_event_controller_class_init (SpiDeviceEventControllerClass *klass)
 {
         GObjectClass * object_class = (GObjectClass *) klass;
         POA_Accessibility_DeviceEventController__epv *epv = &klass->epv;
-        spi_device_event_controller_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+        spi_device_event_controller_parent_class = g_type_class_peek_parent (klass);
 
         object_class->finalize = spi_device_event_controller_object_finalize;
 
@@ -560,7 +548,8 @@ spi_device_event_controller_init (SpiDeviceEventController *device_event_control
   kbd_registered = _controller_register_with_devices (device_event_controller);
 }
 
-gboolean spi_device_event_controller_check_key_event (SpiDeviceEventController *controller)
+gboolean
+spi_device_event_controller_check_key_event (SpiDeviceEventController *controller)
 {
        SpiDeviceEventControllerClass *klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
        if (klass->check_key_event)
index 05fc512..06a7f61 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * registry.c: the main accessibility service registry implementation
- */
+/* registry.c: the main accessibility service registry implementation */
 
+#include <config.h>
 #ifdef SPI_DEBUG
-#include <stdio.h>
+#  include <stdio.h>
 #endif
-#include <config.h>
-#include <bonobo/Bonobo.h>
-
-/*
- * This pulls the CORBA definitions for the "Accessibility::Registry" server
- */
-#include <libspi/Accessibility.h>
 
 /*
  * We'd like to replace the dependance on X-isms with a wrapper layer,
 #include <X11/Xlib.h>
 #include <gdk/gdkx.h>
 
-/*
- * This pulls the definition for the BonoboObject (GType)
- */
-#include "registry.h"
+#include <libspi/registry.h>
 
-/*
- * Our parent GObject type
- */
+/* Our parent GObject type  */
 #define PARENT_TYPE SPI_LISTENER_TYPE
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static SpiListenerClass *spi_registry_parent_class;
 
 typedef enum {