2001-11-21 Michael Meeks <michael@ximian.com>
authormichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 21 Nov 2001 10:29:10 +0000 (10:29 +0000)
committermichael <michael@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 21 Nov 2001 10:29:10 +0000 (10:29 +0000)
* test/accessx-gui.c: s/spi_value/value/ - doh.

* libspi/base.[ch]: add.

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

ChangeLog
libspi/Makefile.am
libspi/base.c [new file with mode: 0644]
libspi/base.h [new file with mode: 0644]
test/accessx-gui.c

index d4be1ce..3c0ab03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-21  Michael Meeks  <michael@ximian.com>
+
+       * test/accessx-gui.c: s/spi_value/value/ - doh.
+
+       * libspi/base.[ch]: add.
+
 2001-18-11  Bill Haneman <bill.haneman@sun.com>
 
        * idl/Accessible.idl:
index d2179b2..91f9d5e 100644 (file)
@@ -17,6 +17,7 @@ libspiinclude_HEADERS = Accessibility.h \
                        accessibleeventlistener.h \
                        action.h \
                         application.h \
+                       base.h \
                        component.h \
                         desktop.h \
                        deviceeventcontroller.h \
diff --git a/libspi/base.c b/libspi/base.c
new file mode 100644 (file)
index 0000000..a7f4097
--- /dev/null
@@ -0,0 +1,50 @@
+#include <libspi/base.h>
+
+/* A pointer to our parent object class */
+static GObjectClass *spi_base_parent_class;
+
+static void
+spi_base_dispose (GObject *object)
+{
+       SpiBase *base = SPI_BASE (object);
+
+       if (base->atko) {
+               g_object_unref (base->atko);
+               base->atko = NULL;
+       }
+
+       spi_base_parent_class->dispose (object);
+}
+
+static void
+spi_base_class_init (GObjectClass *klass)
+{
+       spi_base_parent_class = g_type_klass_peek_parent (klass);
+
+       klass->dispose = spi_base_dispose;
+}
+
+static void
+spi_base_init (SpiBase *base)
+{
+}
+
+BONOBO_TYPE_FUNC (SpiBase, BONOBO_TYPE_OBJECT, spi_base);
+
+gpointer
+spi_base_construct (SpiBase   *base,
+                   AtkObject *o)
+{
+       g_return_val_if_fail (ATK_IS_OBJECT (o), NULL);
+       g_return_val_if_fail (SPI_IS_BASE (base), NULL);
+
+       base->atko = g_object_ref (o);
+}
+
+AtkObject *
+spi_base_get_atk_object (SpiBase *base)
+{
+       g_return_val_if_fail (SPI_IS_BASE (base), NULL);
+
+       return base->atko;
+}
diff --git a/libspi/base.h b/libspi/base.h
new file mode 100644 (file)
index 0000000..dae8961
--- /dev/null
@@ -0,0 +1,51 @@
+/* AT-SPI : Assistive Technology Service Provider Interface
+ * Copyright 2001 Ximian, 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_BASE_H_
+#define SPI_BASE_H_
+
+#include <glib/gmacros.h>
+#include <bonobo/bonobo-object.h>
+#include <atk/atkobject.h>
+
+G_BEGIN_DECLS
+
+#define SPI_ACCESSIBLE_TYPE        (spi_accessible_get_type ())
+#define SPI_ACCESSIBLE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), SPI_ACCESSIBLE_TYPE, SpiAccessible))
+#define SPI_ACCESSIBLE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SPI_ACCESSIBLE_TYPE, SpiAccessibleClass))
+#define IS_SPI_ACCESSIBLE(o)       (G_TYPE_CHECK__INSTANCE_TYPE ((o), SPI_ACCESSIBLE_TYPE))
+#define IS_SPI_ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SPI_ACCESSIBLE_TYPE))
+
+typedef struct {
+        BonoboObject parent;
+
+        AtkObject   *atko;
+} SpiBase;
+
+typedef struct {
+        BonoboObjectClass parent_class;
+} SpiBaseClass;
+
+GType      spi_base_get_type       (void);
+gpointer   spi_base_construct      (SpiBase   *base,
+                                   AtkObject *o);
+AtkObject *spi_base_get_atk_object (SpiBase   *base);
+
+G_END_DECLS
+
+#endif /* SPI_BASE_H_ */
index 2de5427..2ce035a 100644 (file)
@@ -20,6 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
@@ -122,10 +123,11 @@ init_xkb ()
   return True;      
 }
 
-static AccessXControlStruct *control_struct_new (unsigned int mask,
-                                                short int *val_ptr,
-                                                char *label,
-                                                char *val_label)
+static AccessXControlStruct *
+control_struct_new (unsigned int mask,
+                   short int *val_ptr,
+                   char *label,
+                   char *val_label)
 {
   AccessXControlStruct *control = g_new0 (AccessXControlStruct, 1);
   control->mask = mask;
@@ -242,7 +244,7 @@ basic_toggles_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -317,7 +319,7 @@ basic_toggles_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -351,7 +353,7 @@ basic_toggles_box ()
 static GtkWidget*
 repeat_keys_box ()
 {
-  GtkWidget *outer_hbox, *hbox, *vbox, *label, *button, *range, *frame;
+  GtkWidget *outer_hbox, *vbox, *label, *button, *range, *frame;
   GtkAdjustment *adjustment;
   AccessXControlStruct *control =
          control_struct_new (XkbRepeatKeysMask, &xkb->ctrls->repeat_delay, NULL, NULL);
@@ -392,7 +394,7 @@ repeat_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -409,7 +411,7 @@ repeat_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -438,7 +440,7 @@ repeat_keys_box ()
 static GtkWidget*
 mouse_keys_box ()
 {
-  GtkWidget *outer_hbox, *hbox, *vbox, *label, *button, *range, *frame;
+  GtkWidget *outer_hbox, *vbox, *label, *button, *range, *frame;
   GtkAdjustment *adjustment;
   AccessXControlStruct *control =
          control_struct_new (XkbMouseKeysMask, &xkb->ctrls->mk_delay, NULL, NULL);
@@ -480,7 +482,7 @@ mouse_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -497,7 +499,7 @@ mouse_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -514,7 +516,7 @@ mouse_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -531,7 +533,7 @@ mouse_keys_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -576,7 +578,7 @@ mouse_keys_box ()
 static GtkWidget*
 timeout_box ()
 {
-  GtkWidget *outer_hbox, *hbox, *vbox, *label, *button, *range;
+  GtkWidget *hbox, *label, *button, *range;
   GtkAdjustment *adjustment;
   AccessXControlStruct *control =
          control_struct_new (XkbAccessXTimeoutMask, &xkb->ctrls->ax_timeout, NULL, NULL);
@@ -603,7 +605,7 @@ timeout_box ()
                                            "GtkScale::digits", 0,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, control,
                            NULL);
   
@@ -671,7 +673,7 @@ create_gui ()
 static void
 create_gui_x ()
 {
-  GtkWidget *window, *button, *container, *hbox, *vbox, *range, *frame, *label;
+  GtkWidget *window, *button, *container, *hbox, *range;
   GtkAdjustment *adjustment;
   int i;
   static AccessXControlStruct* controls[N_CONTROLS];
@@ -691,6 +693,7 @@ create_gui_x ()
                         "GtkWidget::visible", TRUE,
                         NULL);
 
+  i = 0; /* FIXME: this looks bogus */
   button = g_object_connect (gtk_widget_new (gtk_check_button_get_type (),
                                             "GtkButton::label", "Access X Timeout",
                                             "GtkWidget::parent", hbox,
@@ -707,7 +710,7 @@ create_gui_x ()
                                            "GtkWidget::visible", TRUE,
                                            "GtkScale::adjustment", adjustment,
                                            NULL),
-                           "signal::spi_value_changed",
+                           "signal::value_changed",
                            set_accessx_control_value, controls[i],
                            NULL);
          
@@ -756,4 +759,6 @@ main(int argc, char **argv)
   create_gui ();
   
   gtk_main ();  
+
+  return 0;
 }