Cleaned up some suspect int* casts, and added assertions to text calls in libspi
[platform/core/uifw/at-spi2-atk.git] / libspi / desktop.c
index d013796..040e698 100644 (file)
@@ -1,4 +1,26 @@
 /*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * 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.
+ */
+
+/*
  * desktop.c: implements Desktop.idl
  *
  */
@@ -11,7 +33,7 @@
 /*
  * This pulls the CORBA definitions for the "Accessibility::Accessible" server
  */
-#include "Desktop.h"
+#include <libspi/Accessibility.h>
 
 /*
  * This pulls the definition for the BonoboObject (Gtk Type)
@@ -31,7 +53,8 @@ static AccessibleClass *parent_class;
 static void
 desktop_init (Desktop  *desktop)
 {
-  ACCESSIBLE (desktop)->atko = atk_simple_object_new();
+  ACCESSIBLE (desktop)->atko = g_object_new (atk_object_get_type(), NULL);
+  desktop->applications = NULL;
   atk_object_set_name (ATK_OBJECT (ACCESSIBLE (desktop)->atko), "main");
 }
 
@@ -62,9 +85,9 @@ impl_desktop_get_child_at_index (PortableServer_Servant servant,
       fprintf (stderr, "getting application %ld\n", (long) index);
       /* */
       fprintf (stderr, "object address %p\n",
-              g_list_nth_data (desktop->applications, index));
+               g_list_nth_data (desktop->applications, index));
       retval =  CORBA_Object_duplicate (
-             (CORBA_Object) g_list_nth_data (desktop->applications, index), ev);
+              (CORBA_Object) g_list_nth_data (desktop->applications, index), ev);
     }
   else
     {
@@ -105,12 +128,12 @@ desktop_get_type (void)
                         NULL /* value table */
                 };
                 /*
-                 *   Here we use bonobo_x_type_unique instead of
+                 *   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_x_type_unique.
+                 * use bonobo_type_unique.
                  */
-                type = bonobo_x_type_unique (
+                type = bonobo_type_unique (
                         PARENT_TYPE,
                         POA_Accessibility_Desktop__init,
                         NULL,