Changed "ID" attribute of Accessible to long (from string).
[platform/core/uifw/at-spi2-atk.git] / test / app.c
index 1dfafdc..c4d29f4 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <libbonobo.h>
+#include <bonobo-activation/bonobo-activation.h>
 #include <atk/atkobject.h>
 #include <libspi/Accessibility.h>
 #include "accessible.h"
 #include "application.h"
 
+#define APP_STATIC_BUFF_SZ 30
+
 int
 main(int argc, char **argv)
 {
@@ -35,7 +38,7 @@ main(int argc, char **argv)
         CORBA_Object oclient;
         AtkObject *atko;
         char *obj_id;
-        char sbuf[30];
+        char sbuf[APP_STATIC_BUFF_SZ];
 
         Accessibility_Registry registry;
         Accessibility_Event e;
@@ -50,10 +53,10 @@ main(int argc, char **argv)
           }
 
         /* Create the accesssible application server object */
-        /* TODO: get app name and pid */
-        sprintf(sbuf, "application-%s", argv[1]);
+        snprintf(sbuf, APP_STATIC_BUFF_SZ, "application-%s", argv[0]);
+
         atko = g_object_new (atk_object_get_type(), NULL);
-        atk_object_set_name (atko, "sbuf");
+        atk_object_set_name (atko, sbuf);
         atk_object_set_description( atko, "test application for accessibility SPI");
         app = application_new(atko);
 
@@ -61,9 +64,8 @@ main(int argc, char **argv)
         accessible = accessible_new (atko);
         fprintf(stderr, "accessible created.\n");
 
-        /* FIXME: this type of event struct will leak, needs to be redefined */
-        e.target = bonobo_object_corba_objref ( bonobo_object (accessible));
-        e.type = CORBA_string_dup ("test");
+        e.source = bonobo_object_corba_objref ( bonobo_object (accessible));
+        e.type = CORBA_string_dup ("focus:");
 
         obj_id = "OAFIID:Accessibility_Registry:proto0.1";