From 826c32f8b5013203790ee32f6bb30a1c77a88c9a Mon Sep 17 00:00:00 2001 From: mmclouglin Date: Mon, 28 Jan 2002 16:03:16 +0000 Subject: [PATCH] 2002-01-28 Mark McLoughlin * libspi/remoteobject.[ch]: make RemoteObject and interface rather than an atk object. * test/simple-at.c: include netinet/in.h. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@230 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 7 +++++++ libspi/remoteobject.c | 44 ++++++++++++++++---------------------------- libspi/remoteobject.h | 24 +++++++++++------------- test/simple-at.c | 1 + 4 files changed, 35 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2436876..96d67f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-01-28 Mark McLoughlin + + * libspi/remoteobject.[ch]: make RemoteObject and interface rather + than an atk object. + + * test/simple-at.c: include netinet/in.h. + 2002-01-24 Mark McLoughlin * cspi/spi_accessible.c: (Accessible_getRelationSet): diff --git a/libspi/remoteobject.c b/libspi/remoteobject.c index d1e26ee..156f4a5 100644 --- a/libspi/remoteobject.c +++ b/libspi/remoteobject.c @@ -19,31 +19,20 @@ #include "remoteobject.h" -static Accessibility_Accessible -impl_spi_remote_object_get_accessible (SpiRemoteObject *o) /* default impl */ -{ - return CORBA_OBJECT_NIL; -} - Accessibility_Accessible -spi_remote_object_get_accessible (SpiRemoteObject *o) +spi_remote_object_get_accessible (SpiRemoteObject *remote) { - SpiRemoteObjectClass *klass; - g_assert (SPI_IS_REMOTE_OBJECT (o)); + SpiRemoteObjectIface *iface; + + g_return_val_if_fail (SPI_IS_REMOTE_OBJECT (remote), CORBA_OBJECT_NIL); - klass = SPI_REMOTE_OBJECT_GET_CLASS (o); - if (klass->get_accessible) - return (klass->get_accessible) (o); - else + iface = SPI_REMOTE_OBJECT_GET_IFACE (remote); + + if (!iface->get_accessible) return CORBA_OBJECT_NIL; -} -static void -spi_remote_object_class_init (AtkObjectClass *klass) -{ - SpiRemoteObjectClass *parent_class = SPI_REMOTE_OBJECT_CLASS (klass); - parent_class->get_accessible = impl_spi_remote_object_get_accessible; -} + return iface->get_accessible (remote); +} GType spi_remote_object_get_type (void) @@ -54,18 +43,17 @@ spi_remote_object_get_type (void) { static const GTypeInfo typeInfo = { - sizeof (SpiRemoteObjectClass), + sizeof (SpiRemoteObjectIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) spi_remote_object_class_init, + (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, - NULL, - sizeof (SpiRemoteObject), - 0, + NULL, 0, 0, (GInstanceInitFunc) NULL, - } ; - type = g_type_register_static (ATK_TYPE_OBJECT, "SpiRemoteObject", &typeInfo, 0) ; + }; + + type = g_type_register_static (G_TYPE_INTERFACE, "SpiRemoteObject", &typeInfo, 0) ; } + return type; } - diff --git a/libspi/remoteobject.h b/libspi/remoteobject.h index 26f1250..a9de08a 100644 --- a/libspi/remoteobject.h +++ b/libspi/remoteobject.h @@ -20,26 +20,24 @@ #ifndef SPI_REMOTE_OBJECT_H_ #define SPI_REMOTE_OBJECT_H_ -#include +#include #include G_BEGIN_DECLS -#define SPI_REMOTE_OBJECT_TYPE (spi_remote_object_get_type ()) -#define SPI_REMOTE_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_REMOTE_OBJECT_TYPE, SpiRemoteObject)) -#define SPI_REMOTE_OBJECT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SPI_REMOTE_OBJECT_TYPE, SpiRemoteObjectClass)) -#define SPI_IS_REMOTE_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SPI_REMOTE_OBJECT_TYPE)) -#define SPI_IS_REMOTE_OBJECT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SPI_REMOTE_OBJECT_TYPE)) -#define SPI_REMOTE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((o), SPI_REMOTE_OBJECT_TYPE, SpiRemoteObjectClass)) +#define SPI_TYPE_REMOTE_OBJECT (spi_remote_object_get_type ()) +#define SPI_IS_REMOTE_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SPI_TYPE_REMOTE_OBJECT)) +#define SPI_REMOTE_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_TYPE_REMOTE_OBJECT, SpiRemoteObject)) +#define SPI_REMOTE_OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), SPI_TYPE_REMOTE_OBJECT, SpiRemoteObjectIface)) -typedef struct { - AtkObject parent; -} SpiRemoteObject; +typedef struct _SpiRemoteObject SpiRemoteObject; +typedef struct _SpiRemoteObjectIface SpiRemoteObjectIface; + +struct _SpiRemoteObjectIface { + GTypeInterface base_iface; -typedef struct { - AtkObjectClass parent_class; Accessibility_Accessible (*get_accessible) (SpiRemoteObject *o); -} SpiRemoteObjectClass; +}; GType spi_remote_object_get_type (void); Accessibility_Accessible spi_remote_object_get_accessible (SpiRemoteObject *o); diff --git a/test/simple-at.c b/test/simple-at.c index 9a923e5..0c732cb 100644 --- a/test/simple-at.c +++ b/test/simple-at.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "../util/mag_client.h" #include "../cspi/spi-private.h" /* A hack for now */ -- 2.7.4