+2002-01-28 Mark McLoughlin <mark@skynet.ie>
+
+ * 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 <mark@skynet.ie>
* cspi/spi_accessible.c: (Accessible_getRelationSet):
#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)
{
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;
}
-
#ifndef SPI_REMOTE_OBJECT_H_
#define SPI_REMOTE_OBJECT_H_
-#include <atk/atk.h>
+#include <glib-object.h>
#include <libspi/Accessibility.h>
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);
#include <ctype.h>
#include <unistd.h>
#include <sys/socket.h>
+#include <netinet/in.h>
#include <sys/un.h>
#include "../util/mag_client.h"
#include "../cspi/spi-private.h" /* A hack for now */