2001-11-20 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / libspi / registry.c
index 957be22..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 {
@@ -64,6 +49,8 @@ typedef enum {
   ETYPE_PROPERTY,
   ETYPE_WINDOW,
   ETYPE_TOOLKIT,
+  ETYPE_KEYBOARD,
+  
   ETYPE_LAST_DEFINED
 } EventTypeCategory;
 
@@ -314,7 +301,7 @@ impl_accessibility_registry_register_global_event_listener (
   fprintf(stderr, "registering for events of type %s\n", event_name);
 
   /* parse, check major event type and add listener accordingly */
-  parse_event_type (&etype, event_name);
+  parse_event_type (&etype, (char*) event_name);
   ls->event_type_hash = etype.hash;
   ls->event_type_cat = etype.type_cat;
 
@@ -393,7 +380,7 @@ impl_accessibility_registry_deregister_global_event_listener (
   GList *list;
   GList **listeners;
 
-  parse_event_type (&etype, event_name);
+  parse_event_type (&etype, (char *) event_name);
   switch (etype.type_cat)
     {
     case (ETYPE_OBJECT) :
@@ -490,7 +477,8 @@ impl_accessibility_registry_get_device_event_controller (PortableServer_Servant
 {
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
   if (!registry->device_event_controller)
-    registry->device_event_controller = g_object_new (SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
+    registry->device_event_controller = spi_device_event_controller_new (registry);
+
   return CORBA_Object_duplicate (BONOBO_OBJREF (registry->device_event_controller), ev);
 }
 
@@ -517,6 +505,7 @@ impl_registry_notify_event (PortableServer_Servant servant,
     case (ETYPE_TOOLKIT) :
       _registry_notify_listeners (registry->toolkit_listeners, e, ev); 
       break;
+    case (ETYPE_KEYBOARD) :
     default:
       break;
     }