2001-11-20 Michael Meeks <michael@ximian.com>
authormichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 04:32:31 +0000 (04:32 +0000)
committermichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 20 Nov 2001 04:32:31 +0000 (04:32 +0000)
* libspi/registry.c
(impl_accessibility_registry_deregister_global_event_listener):
segv. protection.

* libspi/deviceeventcontroller.c
(spi_device_event_controller_check_key_event): return
FALSE on no virtual method.

* libspi/*..h: make includes work on a correctly pathed install.

* libspi/*.h: include glib/gmacros.h, use G_BEGIN / END _DECLS.

* libspi/application.h: kill unused ( and whacked out )
gboolean *spi_application_set_id (AtkObject *app, long id);

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

30 files changed:
ChangeLog
libspi/Makefile.am
libspi/accessible.h
libspi/accessibleeventlistener.h
libspi/action.h
libspi/application.h
libspi/component.h
libspi/desktop.h
libspi/deviceeventcontroller.c
libspi/deviceeventcontroller.h
libspi/editabletext.h
libspi/eventlistener.h
libspi/hyperlink.h
libspi/hypertext.h
libspi/image.h
libspi/keymasks.h
libspi/keystrokelistener.h
libspi/listener.h
libspi/registry.c
libspi/registry.h
libspi/relation.h
libspi/selection.h
libspi/table.h
libspi/text.h
libspi/value.h
registryd/desktop.h
registryd/deviceeventcontroller.c
registryd/deviceeventcontroller.h
registryd/registry.c
registryd/registry.h

index f9021cc..4446641 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2001-11-20  Michael Meeks  <michael@ximian.com>
 
+       * libspi/registry.c
+       (impl_accessibility_registry_deregister_global_event_listener): 
+       segv. protection.
+
+       * libspi/deviceeventcontroller.c
+       (spi_device_event_controller_check_key_event): return
+       FALSE on no virtual method.
+
+       * libspi/*..h: make includes work on a correctly pathed install.
+
+       * libspi/*.h: include glib/gmacros.h, use G_BEGIN / END _DECLS.
+
+       * libspi/application.h: kill unused ( and whacked out )
+       gboolean *spi_application_set_id (AtkObject *app, long id);
+
+2001-11-20  Michael Meeks  <michael@ximian.com>
+
        * libspi/*.[ch]: further convert to bonobo's type func
        macros, remove redundnant casts etc.
 
index 5bf3880..d2179b2 100644 (file)
@@ -2,8 +2,6 @@ lib_LTLIBRARIES = libspi.la
 
 INCLUDES = -I $(top_srcdir)           \
            -I $(top_builddir)         \
-           -I $(top_srcdir)/libspi    \
-           -I $(top_builddir)/libspi  \
            $(LIBSPI_CFLAGS)
 
 LDFLAGS = $(LIBSPI_LIBS) -lXtst @LT_VERSION_INFO@
index 0a4f117..9d85556 100644 (file)
 #ifndef SPI_ACCESSIBLE_H_
 #define SPI_ACCESSIBLE_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+#include <glib/gmacros.h>
 #include <bonobo/bonobo-object.h>
 #include <atk/atkobject.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_ACCESSIBLE_TYPE        (spi_accessible_get_type ())
 #define SPI_ACCESSIBLE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_ACCESSIBLE_TYPE, SpiAccessible))
 #define SPI_ACCESSIBLE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_ACCESSIBLE_TYPE, SpiAccessibleClass))
@@ -49,8 +47,6 @@ GType          spi_accessible_get_type (void);
 SpiAccessible *spi_accessible_new      (AtkObject *o);
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_ACCESSIBLE_H_ */
index 15722bf..44723b7 100644 (file)
 #ifndef SPI_ACCESSIBLE_EVENT_LISTENER_H_
 #define SPI_ACCESSIBLE_EVENT_LISTENER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#include <libspi/listener.h>
 
-#include "listener.h"
+G_BEGIN_DECLS
 
 #define SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE        (spi_event_listener_get_type ())
 #define SPI_ACCESSIBLE_EVENT_SPI_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE, SpiEventListener))
@@ -53,8 +51,6 @@ void   spi_event_listener_add_callback (SpiEventListener *listener,
 void   spi_event_listener_remove_callback (SpiEventListener *listener,
                                                   VoidSpiEventListenerCB callback);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_ACCESSIBLE_EVENT_SPI_LISTENER_H_ */
index 58ebfe7..cb63045 100644 (file)
 #ifndef SPI_ACTION_H_
 #define SPI_ACTION_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_ACTION_TYPE        (spi_action_get_type ())
 #define SPI_ACTION(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_ACTION_TYPE, SpiAction))
 #define SPI_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_ACTION_TYPE, SpiActionClass))
@@ -54,8 +51,6 @@ spi_action_get_type   (void);
 SpiAction *
 spi_action_interface_new       (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_ACTION_H_ */
index 5cef788..b1c9140 100644 (file)
 #ifndef SPI_APPLICATION_H_
 #define SPI_APPLICATION_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+#include <glib/gmacros.h>
 #include <atk/atkobject.h>
-#include <accessible.h>
-#include <application.h>
+#include <libspi/accessible.h>
+#include <libspi/application.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_APPLICATION_TYPE        (spi_application_get_type ())
 #define SPI_APPLICATION(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_APPLICATION_TYPE, SpiApplication))
 #define SPI_APPLICATION_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_APPLICATION_TYPE, SpiApplicationClass))
@@ -51,13 +50,9 @@ typedef struct {
        GHashTable *generic_event_names;
 } SpiApplicationClass;
 
-GType               spi_application_get_type           (void);
-gboolean            *spi_application_set_id            (AtkObject *app, long id);
-SpiApplication         *spi_application_new               (AtkObject *app_root);
-
+GType           spi_application_get_type (void);
+SpiApplication *spi_application_new      (AtkObject *app_root);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_APPLICATION_H_ */
index d7dd029..667b1fe 100644 (file)
 #ifndef SPI_COMPONENT_H_
 #define SPI_COMPONENT_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_COMPONENT_TYPE        (spi_component_get_type ())
 #define SPI_COMPONENT(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_COMPONENT_TYPE, SpiComponent))
 #define SPI_COMPONENT_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_COMPONENT_TYPE, SpiComponentClass))
@@ -48,8 +45,6 @@ typedef struct {
 GType         spi_component_get_type      (void);
 SpiComponent *spi_component_interface_new (AtkObject *o);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_COMPONENT_H_ */
index fd94c28..7a4e290 100644 (file)
 #ifndef SPI_DESKTOP_H_
 #define SPI_DESKTOP_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-xobject.h>
 #include <atk/atkobject.h>
-#include <accessible.h>
-#include <application.h>
+#include <libspi/accessible.h>
+#include <libspi/application.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_DESKTOP_TYPE        (spi_desktop_get_type ())
 #define SPI_DESKTOP(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_DESKTOP_TYPE, SpiDesktop))
 #define SPI_DESKTOP_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_DESKTOP_TYPE, SpiDesktopClass))
@@ -54,8 +52,6 @@ void                spi_desktop_add_application    (SpiApplication *app);
 void                spi_desktop_remove_application (SpiApplication *app);
 SpiDesktop             *spi_desktop_new               (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_DESKTOP_H_ */
index 13d96f3..f4e19b3 100644 (file)
@@ -227,7 +227,7 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
   /* register with: keyboard hardware code handler */
   /* register with: (translated) keystroke handler */
 #ifdef SPI_DEBUG
-  fprintf (stderr, "About to request events on window %ld of display %x\n",
+  fprintf (stderr, "About to request events on window %ld of display %p\n",
           (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 */
@@ -265,13 +265,10 @@ static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
        static gboolean initialized = FALSE;
-       static gboolean is_active = FALSE;
        XEvent *x_event = g_new0 (XEvent, 1);
        XKeyEvent *x_key_event;
        KeySym keysym;
        gboolean is_consumed = FALSE;
-       char key_name[16];
-       int i;
        Accessibility_KeyStroke key_event;
        static CORBA_Environment ev;
 
@@ -301,10 +298,10 @@ _check_key_event (SpiDeviceEventController *controller)
                     (int) x_key_event->state);
 #endif
 #ifdef SPI_DEBUG
-           fprintf(stderr, "%s%c",
-                   (x_key_event->state & Mod1Mask)?"Alt-":"",
-                   ((x_key_event->state & ShiftMask)^(x_key_event->state & LockMask))?
-                   (char) toupper((int) keysym) : (char) tolower((int)keysym));
+           fprintf (stderr, "%s%c",
+                    (x_key_event->state & Mod1Mask)?"Alt-":"",
+                    ((x_key_event->state & ShiftMask)^(x_key_event->state & LockMask))?
+                    g_ascii_toupper (keysym) : g_ascii_tolower (keysym));
 #endif /* SPI_DEBUG */
              }
            else
@@ -511,11 +508,11 @@ impl_generate_key_event (PortableServer_Servant     servant,
  *     method implementation
  */
 static void
-impl_generate_mouse_event (PortableServer_Servant     servant,
-                          const CORBA_long x,
-                          const CORBA_long y,
-                          const CORBA_char eventName,
-                          CORBA_Environment         *ev)
+impl_generate_mouse_event (PortableServer_Servant servant,
+                          const CORBA_long       x,
+                          const CORBA_long       y,
+                          const CORBA_char      *eventName,
+                          CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
        fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
@@ -554,6 +551,7 @@ spi_device_event_controller_check_key_event (SpiDeviceEventController *controlle
        SpiDeviceEventControllerClass *klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
        if (klass->check_key_event)
                return (klass->check_key_event) (controller);
+       return FALSE;
 }
 
 SpiDeviceEventController *
index b8cfc77..e5e9e28 100644 (file)
 #ifndef SPI_DEVICE_EVENT_CONTROLLER_H_
 #define SPI_DEVICE_EVENT_CONTROLLER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <libspi/Accessibility.h>
-#include "keystrokelistener.h"
-#include "registry.h"
+#include <libspi/keystrokelistener.h>
+#include <libspi/registry.h>
+
+G_BEGIN_DECLS
 
 #define SPI_DEVICE_EVENT_CONTROLLER_TYPE        (spi_device_event_controller_get_type ())
 #define SPI_DEVICE_EVENT_CONTROLLER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_DEVICE_EVENT_CONTROLLER_TYPE, SpiDeviceEventController))
@@ -56,8 +54,6 @@ typedef struct {
 GType                     spi_device_event_controller_get_type   (void);
 SpiDeviceEventController *spi_device_event_controller_new        (void *registry);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* DEVICEEVENTCONTROLLER_H_ */
index 889b668..f61866f 100644 (file)
 #ifndef SPI_EDITABLE_TEXT_H_
 #define SPI_EDITABLE_TEXT_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
-#include "text.h"
+#include <libspi/text.h>
+
+G_BEGIN_DECLS
 
 #define SPI_EDITABLE_TEXT_TYPE        (spi_editable_text_get_type ())
 #define SPI_EDITABLE_TEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_EDITABLE_TEXT_TYPE, SpiEditableText))
@@ -54,8 +51,6 @@ spi_editable_text_get_type   (void);
 SpiEditableText *
 spi_editable_text_interface_new       ( AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_EDITABLE_TEXT_H_ */
index 15722bf..44723b7 100644 (file)
 #ifndef SPI_ACCESSIBLE_EVENT_LISTENER_H_
 #define SPI_ACCESSIBLE_EVENT_LISTENER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#include <libspi/listener.h>
 
-#include "listener.h"
+G_BEGIN_DECLS
 
 #define SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE        (spi_event_listener_get_type ())
 #define SPI_ACCESSIBLE_EVENT_SPI_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_ACCESSIBLE_EVENT_SPI_LISTENER_TYPE, SpiEventListener))
@@ -53,8 +51,6 @@ void   spi_event_listener_add_callback (SpiEventListener *listener,
 void   spi_event_listener_remove_callback (SpiEventListener *listener,
                                                   VoidSpiEventListenerCB callback);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_ACCESSIBLE_EVENT_SPI_LISTENER_H_ */
index 6789517..d79c5e5 100644 (file)
 #ifndef SPI_HYPERLINK_H_
 #define SPI_HYPERLINK_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_HYPERLINK_TYPE        (spi_hyperlink_get_type ())
 #define SPI_HYPERLINK(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_HYPERLINK_TYPE, SpiHyperlink))
 #define SPI_HYPERLINK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_HYPERLINK_TYPE, SpiHyperlinkClass))
@@ -54,8 +51,6 @@ spi_hyperlink_get_type   (void);
 SpiHyperlink *
 spi_hyperlink_new       ();
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_HYPERLINK_H_ */
index 6c00d44..9245597 100644 (file)
 #ifndef SPI_HYPERTEXT_H_
 #define SPI_HYPERTEXT_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_HYPERTEXT_TYPE        (spi_hypertext_get_type ())
 #define SPI_HYPERTEXT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_HYPERTEXT_TYPE, SpiHypertext))
 #define SPI_HYPERTEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_HYPERTEXT_TYPE, SpiHypertextClass))
@@ -51,8 +48,6 @@ struct _HypertextClass {
 GType         spi_hypertext_get_type      (void);
 SpiHypertext *spi_hypertext_interface_new (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_HYPERTEXT_H_ */
index eece399..71085e3 100644 (file)
 #ifndef SPI_IMAGE_H_
 #define SPI_IMAGE_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_IMAGE_TYPE        (spi_image_get_type ())
 #define SPI_IMAGE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_IMAGE_TYPE, SpiImage))
 #define SPI_IMAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_IMAGE_TYPE, SpiImageClass))
@@ -54,8 +51,6 @@ spi_image_get_type   (void);
 SpiImage *
 spi_image_interface_new       (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_IMAGE_H_ */
index b8843f5..cd43911 100644 (file)
@@ -1,11 +1,10 @@
 #ifndef _SPI_KEYMASKS_H_
 #define _SPI_KEYMASKS_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <X11/Xlib.h>
+#include <glib/gmacros.h>
+
+G_BEGIN_DECLS
 
 typedef unsigned long SpiKeyMaskType;
 
@@ -18,9 +17,6 @@ typedef unsigned long SpiKeyMaskType;
 #define SPI_KEYMASK_SHIFTLOCK LockMask
 #define SPI_KEYMASK_UNMODIFIED 0
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
 
 #endif
index a2b4c11..ea2052c 100644 (file)
 #ifndef SPI_KEYSTROKE_LISTENER_H_
 #define SPI_KEYSTROKE_LISTENER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atkobject.h>
 #include <libspi/Accessibility.h>
-#include "keymasks.h"
+#include <libspi/keymasks.h>
+
+G_BEGIN_DECLS
 
 #define SPI_KEYSTROKE_LISTENER_TYPE        (spi_keystroke_listener_get_type ())
 #define SPI_KEYSTROKE_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_KEYSTROKE_LISTENER_TYPE, SpiKeystrokeListener))
@@ -58,8 +56,6 @@ void                   spi_keystroke_listener_remove_callback (SpiKeystrokeListe
                                                               BooleanKeystrokeListenerCB callback);
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* KEYSTROKE_SPI_LISTENER_H_ */
index f9302fa..2c2533b 100644 (file)
 #ifndef SPI_LISTENER_H_
 #define SPI_LISTENER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atkobject.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_LISTENER_TYPE        (spi_listener_get_type ())
 #define SPI_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_LISTENER_TYPE, SpiListener))
 #define SPI_LISTENER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_LISTENER_TYPE, SpiListenerClass))
@@ -49,8 +47,6 @@ typedef struct {
 GType               spi_listener_get_type   (void);
 SpiListener            *spi_listener_new       (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_LISTENER_H_ */
index fc4fb86..7e278b5 100644 (file)
@@ -33,6 +33,7 @@
  * Anyone want to help?
  */
 #include <X11/Xlib.h>
+#include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
 #include <libspi/registry.h>
@@ -186,7 +187,6 @@ compare_listener_corbaref (gconstpointer p1, gconstpointer p2)
 static void
 parse_event_type (EventTypeStruct *etype, char *event_name)
 {
-  guint nbytes = 0;
   gchar **split_string;
 
   split_string = g_strsplit(event_name, ":", 4);
@@ -296,7 +296,6 @@ impl_accessibility_registry_register_global_event_listener (
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
   SpiListenerStruct *ls = g_malloc (sizeof (SpiListenerStruct));
   EventTypeStruct etype;
-  gboolean is_toolkit_specific = TRUE;
 
   fprintf(stderr, "registering for events of type %s\n", event_name);
 
@@ -395,9 +394,13 @@ impl_accessibility_registry_deregister_global_event_listener (
       listeners = &registry->toolkit_listeners;
       break;
     default:
+      listeners = NULL;
       break;
     }
 
+  if (!listeners)
+         return;
+
   ls.event_type_hash = etype.hash;
   list = g_list_find_custom (*listeners, &ls, compare_listener_hash);
 
@@ -561,7 +564,8 @@ _registry_notify_listeners ( GList *listeners,
     }
 }
 
-static gboolean _device_event_controller_hook (gpointer p)
+static gboolean
+_device_event_controller_hook (gpointer p)
 {
     SpiRegistry *registry = (SpiRegistry *)p;
     SpiDeviceEventController *controller = registry->device_event_controller;
index b9df482..61b0ed9 100644 (file)
 #ifndef SPI_REGISTRY_H_
 #define SPI_REGISTRY_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib/gmain.h>
-#include <libspi/Accessibility.h>
-#include "listener.h"
-#include "desktop.h"
-#include "deviceeventcontroller.h"
+#include <libspi/listener.h>
+#include <libspi/desktop.h>
+#include <libspi/deviceeventcontroller.h>
+
+G_BEGIN_DECLS
 
 #define SPI_REGISTRY_TYPE        (spi_registry_get_type ())
 #define SPI_REGISTRY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_REGISTRY_TYPE, SpiRegistry))
@@ -55,11 +52,9 @@ typedef struct {
         POA_Accessibility_Registry__epv epv;
 } SpiRegistryClass;
 
-GType               spi_registry_get_type   (void);
-SpiRegistry            *spi_registry_new       (void);
+GType        spi_registry_get_type (void);
+SpiRegistry *spi_registry_new      (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_REGISTRY_H_ */
index 59806af..b923557 100644 (file)
 #ifndef SPI_RELATION_H_
 #define SPI_RELATION_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_RELATION_TYPE        (spi_relation_get_type ())
 #define SPI_RELATION(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_RELATION_TYPE, SpiRelation))
 #define SPI_RELATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_RELATION_TYPE, SpiRelationClass))
@@ -55,8 +52,6 @@ spi_relation_get_type   (void);
 SpiRelation *
 spi_relation_new       (AtkRelation *relation);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_RELATION_H_ */
index 89b644b..7bf6736 100644 (file)
 #ifndef SPI_SELECTION_H_
 #define SPI_SELECTION_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_SELECTION_TYPE        (spi_selection_get_type ())
 #define SPI_SELECTION(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_SELECTION_TYPE, SpiSelection))
 #define SPI_SELECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_SELECTION_TYPE, SpiSelectionClass))
@@ -54,8 +51,6 @@ spi_selection_get_type   (void);
 SpiSelection *
 spi_selection_interface_new       (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_SELECTION_H_ */
index e8acfa4..29f4fcd 100644 (file)
 #ifndef SPI_TABLE_H_
 #define SPI_TABLE_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_TABLE_TYPE        (spi_table_get_type ())
 #define SPI_TABLE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_TABLE_TYPE, SpiTable))
 #define SPI_TABLE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_TABLE_TYPE, SpiTableClass))
@@ -54,8 +51,6 @@ spi_table_get_type   (void);
 SpiTable *
 spi_table_interface_new       (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_TABLE_H_ */
index df70d92..f8fe59f 100644 (file)
 #ifndef SPI_TEXT_H_
 #define SPI_TEXT_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
-#include "accessible.h"
+#include <libspi/accessible.h>
+
+G_BEGIN_DECLS
 
 #define SPI_TEXT_TYPE         (spi_text_get_type ())
 #define SPI_TEXT(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_TEXT_TYPE, SpiText))
@@ -52,8 +49,6 @@ struct _SpiTextClass {
 GType    spi_text_get_type      (void);
 SpiText *spi_text_interface_new (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_TEXT_H_ */
index 9c63c5d..2c841e5 100644 (file)
 #ifndef SPI_VALUE_H_
 #define SPI_VALUE_H_
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <atk/atk.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_VALUE_TYPE        (spi_value_get_type ())
 #define SPI_VALUE(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPI_VALUE_TYPE, SpiValue))
 #define SPI_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), SPI_VALUE_TYPE, SpiValueClass))
@@ -48,14 +45,9 @@ struct _ValueClass {
   POA_Accessibility_Value__epv epv;
 };
 
-GType
-spi_value_get_type   (void);
-
-SpiValue *
-spi_value_interface_new       (AtkObject *obj);
+GType     spi_value_get_type      (void);
+SpiValue *spi_value_interface_new (AtkObject *obj);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_VALUE_H_ */
index fd94c28..7a4e290 100644 (file)
 #ifndef SPI_DESKTOP_H_
 #define SPI_DESKTOP_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-xobject.h>
 #include <atk/atkobject.h>
-#include <accessible.h>
-#include <application.h>
+#include <libspi/accessible.h>
+#include <libspi/application.h>
 #include <libspi/Accessibility.h>
 
+G_BEGIN_DECLS
+
 #define SPI_DESKTOP_TYPE        (spi_desktop_get_type ())
 #define SPI_DESKTOP(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_DESKTOP_TYPE, SpiDesktop))
 #define SPI_DESKTOP_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_DESKTOP_TYPE, SpiDesktopClass))
@@ -54,8 +52,6 @@ void                spi_desktop_add_application    (SpiApplication *app);
 void                spi_desktop_remove_application (SpiApplication *app);
 SpiDesktop             *spi_desktop_new               (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_DESKTOP_H_ */
index 13d96f3..f4e19b3 100644 (file)
@@ -227,7 +227,7 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
   /* register with: keyboard hardware code handler */
   /* register with: (translated) keystroke handler */
 #ifdef SPI_DEBUG
-  fprintf (stderr, "About to request events on window %ld of display %x\n",
+  fprintf (stderr, "About to request events on window %ld of display %p\n",
           (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 */
@@ -265,13 +265,10 @@ static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
        static gboolean initialized = FALSE;
-       static gboolean is_active = FALSE;
        XEvent *x_event = g_new0 (XEvent, 1);
        XKeyEvent *x_key_event;
        KeySym keysym;
        gboolean is_consumed = FALSE;
-       char key_name[16];
-       int i;
        Accessibility_KeyStroke key_event;
        static CORBA_Environment ev;
 
@@ -301,10 +298,10 @@ _check_key_event (SpiDeviceEventController *controller)
                     (int) x_key_event->state);
 #endif
 #ifdef SPI_DEBUG
-           fprintf(stderr, "%s%c",
-                   (x_key_event->state & Mod1Mask)?"Alt-":"",
-                   ((x_key_event->state & ShiftMask)^(x_key_event->state & LockMask))?
-                   (char) toupper((int) keysym) : (char) tolower((int)keysym));
+           fprintf (stderr, "%s%c",
+                    (x_key_event->state & Mod1Mask)?"Alt-":"",
+                    ((x_key_event->state & ShiftMask)^(x_key_event->state & LockMask))?
+                    g_ascii_toupper (keysym) : g_ascii_tolower (keysym));
 #endif /* SPI_DEBUG */
              }
            else
@@ -511,11 +508,11 @@ impl_generate_key_event (PortableServer_Servant     servant,
  *     method implementation
  */
 static void
-impl_generate_mouse_event (PortableServer_Servant     servant,
-                          const CORBA_long x,
-                          const CORBA_long y,
-                          const CORBA_char eventName,
-                          CORBA_Environment         *ev)
+impl_generate_mouse_event (PortableServer_Servant servant,
+                          const CORBA_long       x,
+                          const CORBA_long       y,
+                          const CORBA_char      *eventName,
+                          CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
        fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
@@ -554,6 +551,7 @@ spi_device_event_controller_check_key_event (SpiDeviceEventController *controlle
        SpiDeviceEventControllerClass *klass = SPI_DEVICE_EVENT_CONTROLLER_GET_CLASS (controller);
        if (klass->check_key_event)
                return (klass->check_key_event) (controller);
+       return FALSE;
 }
 
 SpiDeviceEventController *
index b8cfc77..e5e9e28 100644 (file)
 #ifndef SPI_DEVICE_EVENT_CONTROLLER_H_
 #define SPI_DEVICE_EVENT_CONTROLLER_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <bonobo/bonobo-object.h>
 #include <libspi/Accessibility.h>
-#include "keystrokelistener.h"
-#include "registry.h"
+#include <libspi/keystrokelistener.h>
+#include <libspi/registry.h>
+
+G_BEGIN_DECLS
 
 #define SPI_DEVICE_EVENT_CONTROLLER_TYPE        (spi_device_event_controller_get_type ())
 #define SPI_DEVICE_EVENT_CONTROLLER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_DEVICE_EVENT_CONTROLLER_TYPE, SpiDeviceEventController))
@@ -56,8 +54,6 @@ typedef struct {
 GType                     spi_device_event_controller_get_type   (void);
 SpiDeviceEventController *spi_device_event_controller_new        (void *registry);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* DEVICEEVENTCONTROLLER_H_ */
index fc4fb86..7e278b5 100644 (file)
@@ -33,6 +33,7 @@
  * Anyone want to help?
  */
 #include <X11/Xlib.h>
+#include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
 #include <libspi/registry.h>
@@ -186,7 +187,6 @@ compare_listener_corbaref (gconstpointer p1, gconstpointer p2)
 static void
 parse_event_type (EventTypeStruct *etype, char *event_name)
 {
-  guint nbytes = 0;
   gchar **split_string;
 
   split_string = g_strsplit(event_name, ":", 4);
@@ -296,7 +296,6 @@ impl_accessibility_registry_register_global_event_listener (
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
   SpiListenerStruct *ls = g_malloc (sizeof (SpiListenerStruct));
   EventTypeStruct etype;
-  gboolean is_toolkit_specific = TRUE;
 
   fprintf(stderr, "registering for events of type %s\n", event_name);
 
@@ -395,9 +394,13 @@ impl_accessibility_registry_deregister_global_event_listener (
       listeners = &registry->toolkit_listeners;
       break;
     default:
+      listeners = NULL;
       break;
     }
 
+  if (!listeners)
+         return;
+
   ls.event_type_hash = etype.hash;
   list = g_list_find_custom (*listeners, &ls, compare_listener_hash);
 
@@ -561,7 +564,8 @@ _registry_notify_listeners ( GList *listeners,
     }
 }
 
-static gboolean _device_event_controller_hook (gpointer p)
+static gboolean
+_device_event_controller_hook (gpointer p)
 {
     SpiRegistry *registry = (SpiRegistry *)p;
     SpiDeviceEventController *controller = registry->device_event_controller;
index b9df482..61b0ed9 100644 (file)
 #ifndef SPI_REGISTRY_H_
 #define SPI_REGISTRY_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <glib/gmain.h>
-#include <libspi/Accessibility.h>
-#include "listener.h"
-#include "desktop.h"
-#include "deviceeventcontroller.h"
+#include <libspi/listener.h>
+#include <libspi/desktop.h>
+#include <libspi/deviceeventcontroller.h>
+
+G_BEGIN_DECLS
 
 #define SPI_REGISTRY_TYPE        (spi_registry_get_type ())
 #define SPI_REGISTRY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_REGISTRY_TYPE, SpiRegistry))
@@ -55,11 +52,9 @@ typedef struct {
         POA_Accessibility_Registry__epv epv;
 } SpiRegistryClass;
 
-GType               spi_registry_get_type   (void);
-SpiRegistry            *spi_registry_new       (void);
+GType        spi_registry_get_type (void);
+SpiRegistry *spi_registry_new      (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* SPI_REGISTRY_H_ */