X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test%2Fapp.c;h=dc676d3563b71a667c39866d43f0a640f54598cb;hb=8d44f439f509885221b67efc841a1b429cdd8236;hp=1dfafdc906d87ec3b9c6eff7358396854377f296;hpb=ee75de39f4e8247f694b328163fc974ba791305f;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/test/app.c b/test/app.c index 1dfafdc..dc676d3 100644 --- a/test/app.c +++ b/test/app.c @@ -23,11 +23,14 @@ #include #include #include +#include #include #include #include "accessible.h" #include "application.h" +#define APP_STATIC_BUFF_SZ 30 + int main(int argc, char **argv) { @@ -35,12 +38,12 @@ 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; - Accessible *accessible; - Application *app; + SpiAccessible *accessible; + SpiApplication *app; CORBA_exception_init(&ev); @@ -50,20 +53,19 @@ 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); + app = spi_application_new(atko); - /* Create the Accessible 'source' for the event */ - accessible = accessible_new (atko); + /* Create the SpiAccessible 'source' for the event */ + accessible = spi_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";