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
#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;
/*
* 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;
/*
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 ()
BONOBO_TYPE_FUNC_FULL (SpiAction,
Accessibility_Action,
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
spi_action);
static void
#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;
* 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;
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;
(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,
{
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;
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)
* 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;
/*
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 ()
BONOBO_TYPE_FUNC_FULL (SpiHyperlink,
Accessibility_Hyperlink,
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
spi_hyperlink);
static 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),
* use bonobo_type_unique.
*/
type = bonobo_type_unique (
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
POA_Accessibility_Image__init,
NULL,
G_STRUCT_OFFSET (SpiImageClass, epv),
* 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;
/*
}
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;
}
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)
* 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;
/*
{
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;
* 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 {
* use bonobo_type_unique.
*/
type = bonobo_type_unique (
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
POA_Accessibility_Relation__init,
NULL,
G_STRUCT_OFFSET (SpiRelationClass, epv),
* use bonobo_type_unique.
*/
type = bonobo_type_unique (
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
POA_Accessibility_Selection__init,
NULL,
G_STRUCT_OFFSET (SpiSelectionClass, epv),
* use bonobo_type_unique.
*/
type = bonobo_type_unique (
- BONOBO_OBJECT_TYPE,
+ BONOBO_TYPE_OBJECT,
POA_Accessibility_Table__init,
NULL,
G_STRUCT_OFFSET (SpiTableClass, epv),
* 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);
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
* 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);
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)
* 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;
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;
(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,
{
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;
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)
* 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 {