From f546ac72097fabd106a0cf277d4db389b811014c Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 20 Nov 2001 02:05:42 +0000 Subject: [PATCH] 2001-11-20 Michael Meeks * 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 --- ChangeLog | 15 ++++++++ libspi/accessible.c | 10 ++---- libspi/accessibleeventlistener.c | 63 +++++---------------------------- libspi/action.c | 2 +- libspi/component.c | 2 +- libspi/deviceeventcontroller.c | 55 ++++++++++++----------------- libspi/eventlistener.c | 63 +++++---------------------------- libspi/hyperlink.c | 2 +- libspi/hypertext.c | 2 +- libspi/image.c | 2 +- libspi/keystrokelistener.c | 73 ++++++++------------------------------- libspi/listener.c | 25 ++++---------- libspi/registry.c | 27 ++++----------- libspi/relation.c | 2 +- libspi/selection.c | 2 +- libspi/table.c | 2 +- libspi/text.c | 36 +++++-------------- libspi/value.c | 61 ++++---------------------------- registryd/deviceeventcontroller.c | 55 ++++++++++++----------------- registryd/registry.c | 27 ++++----------- 20 files changed, 134 insertions(+), 392 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23d1dac..73a7cd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2001-11-20 Michael Meeks + * 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 + * libspi/*.[ch]: fixup headers, includes and over commenting. * libspi/image.c (impl__get_imageDescription): const diff --git a/libspi/accessible.c b/libspi/accessible.c index f0e6002..8dd694b 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -26,14 +26,10 @@ #include #include -/* - * 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; /* diff --git a/libspi/accessibleeventlistener.c b/libspi/accessibleeventlistener.c index 4820f0b..38ac8f9 100644 --- a/libspi/accessibleeventlistener.c +++ b/libspi/accessibleeventlistener.c @@ -20,33 +20,18 @@ * 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 #ifdef SPI_DEBUG #include #endif +#include -#include -#include -#include - -/* - * 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 () diff --git a/libspi/action.c b/libspi/action.c index 13b1ec7..0268330 100644 --- a/libspi/action.c +++ b/libspi/action.c @@ -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 diff --git a/libspi/component.c b/libspi/component.c index 5a5a687..2b4e148 100644 --- a/libspi/component.c +++ b/libspi/component.c @@ -28,7 +28,7 @@ #include /* 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; diff --git a/libspi/deviceeventcontroller.c b/libspi/deviceeventcontroller.c index 1834069..cd25642 100644 --- a/libspi/deviceeventcontroller.c +++ b/libspi/deviceeventcontroller.c @@ -20,37 +20,25 @@ * Boston, MA 02111-1307, USA. */ -/* - * listener.c: test for accessibility implementation - * - */ +/* deviceeventcontroler.c: implement the DeviceEventController interface */ + +#include #ifdef SPI_DEBUG -#include +# include #endif -#include /* for getenv() */ #include #include -#include #include /* TODO: hide dependency (wrap in single porting file) */ #include -#include -#include -/* - * This pulls the definition for the BonoboObject (GType) - */ -#include "deviceeventcontroller.h" +#include -/* - * 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) diff --git a/libspi/eventlistener.c b/libspi/eventlistener.c index 4820f0b..38ac8f9 100644 --- a/libspi/eventlistener.c +++ b/libspi/eventlistener.c @@ -20,33 +20,18 @@ * 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 #ifdef SPI_DEBUG #include #endif +#include -#include -#include -#include - -/* - * 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 () diff --git a/libspi/hyperlink.c b/libspi/hyperlink.c index aa4c962..9c93dfd 100644 --- a/libspi/hyperlink.c +++ b/libspi/hyperlink.c @@ -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 diff --git a/libspi/hypertext.c b/libspi/hypertext.c index 42bc900..22466b1 100644 --- a/libspi/hypertext.c +++ b/libspi/hypertext.c @@ -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), diff --git a/libspi/image.c b/libspi/image.c index b957849..5303bb7 100644 --- a/libspi/image.c +++ b/libspi/image.c @@ -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), diff --git a/libspi/keystrokelistener.c b/libspi/keystrokelistener.c index c4f6a28..9a97f1e 100644 --- a/libspi/keystrokelistener.c +++ b/libspi/keystrokelistener.c @@ -20,32 +20,18 @@ * Boston, MA 02111-1307, USA. */ -/* - * listener.c: test for accessibility implementation - * - */ +/* keystrokelistener.c: implement the KeystrokeListener interface */ +#include #ifdef SPI_DEBUG -#include +# include #endif +#include -#include -#include -#include +/* 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) diff --git a/libspi/listener.c b/libspi/listener.c index 372e865..b42b865 100644 --- a/libspi/listener.c +++ b/libspi/listener.c @@ -20,32 +20,19 @@ * Boston, MA 02111-1307, USA. */ -/* - * listener.c: test for accessibility implementation - * - */ +/* listener.c: implements the Listener interface */ #ifdef SPI_DEBUG #include #endif #include -#include -#include - -/* - * This pulls the definition for the BonoboObject (GType) - */ -#include "listener.h" +#include -/* - * 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; diff --git a/libspi/registry.c b/libspi/registry.c index 05fc512..06a7f61 100644 --- a/libspi/registry.c +++ b/libspi/registry.c @@ -20,20 +20,12 @@ * Boston, MA 02111-1307, USA. */ -/* - * registry.c: the main accessibility service registry implementation - */ +/* registry.c: the main accessibility service registry implementation */ +#include #ifdef SPI_DEBUG -#include +# include #endif -#include -#include - -/* - * This pulls the CORBA definitions for the "Accessibility::Registry" server - */ -#include /* * We'd like to replace the dependance on X-isms with a wrapper layer, @@ -43,19 +35,12 @@ #include #include -/* - * This pulls the definition for the BonoboObject (GType) - */ -#include "registry.h" +#include -/* - * 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 { diff --git a/libspi/relation.c b/libspi/relation.c index 1ddb74f..6fae761 100644 --- a/libspi/relation.c +++ b/libspi/relation.c @@ -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), diff --git a/libspi/selection.c b/libspi/selection.c index aa0ff47..cd2e24a 100644 --- a/libspi/selection.c +++ b/libspi/selection.c @@ -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), diff --git a/libspi/table.c b/libspi/table.c index 4264697..487ccb9 100644 --- a/libspi/table.c +++ b/libspi/table.c @@ -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), diff --git a/libspi/text.c b/libspi/text.c index f7f5ddb..a1da102 100644 --- a/libspi/text.c +++ b/libspi/text.c @@ -20,40 +20,20 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ -#include -#include +/* text.c : implements the Text interface */ +#include #include #include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * 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 diff --git a/libspi/value.c b/libspi/value.c index 9610701..cfe6f0d 100644 --- a/libspi/value.c +++ b/libspi/value.c @@ -20,28 +20,12 @@ * Boston, MA 02111-1307, USA. */ -/* - * component.c : bonobo wrapper for accessible component implementation - * - */ +/* value.c : implements the Value interface */ #include -#include - #include +#include -/* - * This pulls the CORBA definitions for the "Accessibility::Accessible" server - */ -#include - -/* - * 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) diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 1834069..cd25642 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -20,37 +20,25 @@ * Boston, MA 02111-1307, USA. */ -/* - * listener.c: test for accessibility implementation - * - */ +/* deviceeventcontroler.c: implement the DeviceEventController interface */ + +#include #ifdef SPI_DEBUG -#include +# include #endif -#include /* for getenv() */ #include #include -#include #include /* TODO: hide dependency (wrap in single porting file) */ #include -#include -#include -/* - * This pulls the definition for the BonoboObject (GType) - */ -#include "deviceeventcontroller.h" +#include -/* - * 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) diff --git a/registryd/registry.c b/registryd/registry.c index 05fc512..06a7f61 100644 --- a/registryd/registry.c +++ b/registryd/registry.c @@ -20,20 +20,12 @@ * Boston, MA 02111-1307, USA. */ -/* - * registry.c: the main accessibility service registry implementation - */ +/* registry.c: the main accessibility service registry implementation */ +#include #ifdef SPI_DEBUG -#include +# include #endif -#include -#include - -/* - * This pulls the CORBA definitions for the "Accessibility::Registry" server - */ -#include /* * We'd like to replace the dependance on X-isms with a wrapper layer, @@ -43,19 +35,12 @@ #include #include -/* - * This pulls the definition for the BonoboObject (GType) - */ -#include "registry.h" +#include -/* - * 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 { -- 2.7.4