Added definitions for SpiRemoteObject, a derivative of AtkObject used to
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 2 Jan 2002 21:11:12 +0000 (21:11 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 2 Jan 2002 21:11:12 +0000 (21:11 +0000)
support remote components.

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

libspi/Makefile.am
libspi/remoteobject.c [new file with mode: 0644]
libspi/remoteobject.h [new file with mode: 0644]

index a7e9df9..53235c3 100644 (file)
@@ -28,6 +28,7 @@ libspiinclude_HEADERS = Accessibility.h \
                        libspi.h \
                         listener.h \
                        relation.h \
+                       remoteobject.h \
                        selection.h \
                        table.h \
                        text.h \
@@ -83,6 +84,8 @@ libspi_la_SOURCES = accessible.c         \
                    keystrokelistener.h\
                    relation.c\
                    relation.h\
+                   remoteobject.c\
+                   remoteobject.h\
                    selection.c\
                    selection.h\
                    table.c\
diff --git a/libspi/remoteobject.c b/libspi/remoteobject.c
new file mode 100644 (file)
index 0000000..d1e26ee
--- /dev/null
@@ -0,0 +1,71 @@
+/* AT-SPI : Assistive Technology Service Provider Interface
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#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)
+{
+  SpiRemoteObjectClass *klass; 
+  g_assert (SPI_IS_REMOTE_OBJECT (o));
+  
+  klass = SPI_REMOTE_OBJECT_GET_CLASS (o);
+  if (klass->get_accessible)
+    return (klass->get_accessible) (o);
+  else
+    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;
+} 
+
+GType
+spi_remote_object_get_type (void)
+{
+  static GType type = 0;
+
+  if (!type)
+    {
+      static const GTypeInfo typeInfo =
+      {
+        sizeof (SpiRemoteObjectClass),
+        (GBaseInitFunc) NULL,
+        (GBaseFinalizeFunc) NULL,
+        (GClassInitFunc) spi_remote_object_class_init,
+        (GClassFinalizeFunc) NULL,
+        NULL,
+        sizeof (SpiRemoteObject),
+        0,
+        (GInstanceInitFunc) NULL,
+      } ;
+      type = g_type_register_static (ATK_TYPE_OBJECT, "SpiRemoteObject", &typeInfo, 0) ;
+    }
+  return type;
+}
+
diff --git a/libspi/remoteobject.h b/libspi/remoteobject.h
new file mode 100644 (file)
index 0000000..a67597b
--- /dev/null
@@ -0,0 +1,51 @@
+/* AT-SPI : Assistive Technology Service Provider Interface
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SPI_REMOTE_OBJECT_H_
+#define SPI_REMOTE_OBJECT_H_
+
+#include <atk/atk.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))
+
+typedef struct {
+       AtkObject parent;
+} SpiRemoteObject;
+
+typedef struct {
+        AtkObjectClass parent_class;
+       Accessibility_Accessible (*get_accessible) (SpiRemoteObject *o);
+} SpiRemoteObjectClass;
+
+GType                    spi_remote_object_get_type       (void);
+AtkObject               *spi_remote_object_new            (GObject           *o);
+Accessibility_Accessible spi_remote_object_get_accessible (SpiRemoteObject   *o);
+
+G_END_DECLS
+
+#endif /* SPI_REMOTE_OBJECT_H_ */
+