diff options
author | dwheeler <dwheeler@88473608-6f18-0410-8b6c-91216bd3049c> | 2008-01-17 22:57:08 +0000 |
---|---|---|
committer | dwheeler <dwheeler@88473608-6f18-0410-8b6c-91216bd3049c> | 2008-01-17 22:57:08 +0000 |
commit | f965b55b4d9b2a2ff0a54c8f88dffea1419ed74b (patch) | |
tree | 94422df8880e8a151734a221e361bf237d8c3c57 | |
parent | 1a1997205843854c98f094ba20c5c1f97914449c (diff) |
Add to test calls to set up two views and their titles
git-svn-id: svn+ssh://svn-nitpicker.cl.cam.ac.uk/linpicker/trunk@158 88473608-6f18-0410-8b6c-91216bd3049c
-rw-r--r-- | nitpicker-common.c | 9 | ||||
-rw-r--r-- | nitpicker-skelimpl.c | 5 | ||||
-rw-r--r-- | nitpicker-stubs.c | 5 | ||||
-rw-r--r-- | nitpicker-test-client.c | 32 | ||||
-rw-r--r-- | nitpicker.h | 6 | ||||
-rw-r--r-- | nitpicker.idl | 6 | ||||
-rw-r--r-- | view.c | 4 |
7 files changed, 38 insertions, 29 deletions
diff --git a/nitpicker-common.c b/nitpicker-common.c index 2f8cdb3..7e0cfe9 100644 --- a/nitpicker-common.c +++ b/nitpicker-common.c @@ -40,8 +40,8 @@ void (*_impl_refresh)(PortableServer_Servant _servant, const CORBA_long buf_id, _impl_refresh (_o_servant, *(const CORBA_long *)_o_args[0], *(const CORBA_long *)_o_args[1], *(const CORBA_long *)_o_args[2], *(const CORBA_long *)_o_args[3], *(const CORBA_long *)_o_args[4], _o_ev); } void _ORBIT_skel_small_nitpicker_new_view(POA_nitpicker *_o_servant, gpointer _o_retval,gpointer *_o_args,CORBA_Context _o_ctx,CORBA_Environment *_o_ev, -CORBA_long (*_impl_new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, const Nitevent listener, CORBA_Environment *ev)) { -*(CORBA_long *)_o_retval = _impl_new_view (_o_servant, *(const CORBA_long *)_o_args[0], *(const Nitevent *)_o_args[1], _o_ev); +CORBA_long (*_impl_new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, CORBA_Environment *ev)) { +*(CORBA_long *)_o_retval = _impl_new_view (_o_servant, *(const CORBA_long *)_o_args[0], _o_ev); } void _ORBIT_skel_small_nitpicker_destroy_view(POA_nitpicker *_o_servant, gpointer _o_retval,gpointer *_o_args,CORBA_Context _o_ctx,CORBA_Environment *_o_ev, void (*_impl_destroy_view)(PortableServer_Servant _servant, const CORBA_long view_id, CORBA_Environment *ev)) { @@ -221,8 +221,7 @@ static ORBit_IArg nitpicker_refresh__arginfo [] = { { TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, (char *)"h" } }; static ORBit_IArg nitpicker_new_view__arginfo [] = { - { TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, (char *)"buf_id" }, - { TC_Nitevent, ORBit_I_ARG_IN , (char *)"listener" } + { TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, (char *)"buf_id" } }; static ORBit_IArg nitpicker_destroy_view__arginfo [] = { { TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, (char *)"view_id" } @@ -309,7 +308,7 @@ TC_void, (char *)"refresh", 7, 0 } , { - { 2, 2, nitpicker_new_view__arginfo, FALSE }, + { 1, 1, nitpicker_new_view__arginfo, FALSE }, { 0, 0, NULL, FALSE }, { 0, 0, NULL, FALSE }, TC_CORBA_long, (char *)"new_view", 8, diff --git a/nitpicker-skelimpl.c b/nitpicker-skelimpl.c index 1a9ad2d..00c596d 100644 --- a/nitpicker-skelimpl.c +++ b/nitpicker-skelimpl.c @@ -111,7 +111,6 @@ CORBA_Environment *ev); static CORBA_long impl_nitpicker_new_view(impl_POA_nitpicker *servant, const CORBA_long buf_id, -const Nitevent listener, CORBA_Environment *ev); #endif @@ -470,11 +469,11 @@ CORBA_Environment *ev) static CORBA_long impl_nitpicker_new_view(impl_POA_nitpicker *servant, const CORBA_long buf_id, -const Nitevent listener, CORBA_Environment *ev) { /* ------ insert method code here ------ */ - return nitpicker_new_view(CONVERT_SERVANT(servant), buf_id, listener, ev); + /* return nitpicker_new_view(CONVERT_SERVANT(servant), buf_id, listener, ev); */ + return nitpicker_new_view(CONVERT_SERVANT(servant), buf_id, ev); /* ------ ---------- end ------------ ------ */ } #endif diff --git a/nitpicker-stubs.c b/nitpicker-stubs.c index 185ce83..322d7d1 100644 --- a/nitpicker-stubs.c +++ b/nitpicker-stubs.c @@ -71,11 +71,10 @@ ORBit_c_stub_invoke (_obj, &nitpicker__iinterface.methods, 6, NULL, _args, NULL, (ORBitSmallSkeleton) _ORBIT_skel_small_nitpicker_refresh); } -CORBA_long nitpicker_new_view(nitpicker _obj, const CORBA_long buf_id, const Nitevent listener, CORBA_Environment *ev){ +CORBA_long nitpicker_new_view(nitpicker _obj, const CORBA_long buf_id, CORBA_Environment *ev){ CORBA_long _ORBIT_retval; -gpointer _args[2]; +gpointer _args[1]; _args[0] = (gpointer)&buf_id; -_args[1] = (gpointer)&listener; ORBit_c_stub_invoke (_obj, &nitpicker__iinterface.methods, 7, &_ORBIT_retval, _args, NULL, ev, nitpicker__classid, G_STRUCT_OFFSET (POA_nitpicker__epv, new_view), (ORBitSmallSkeleton) _ORBIT_skel_small_nitpicker_new_view); diff --git a/nitpicker-test-client.c b/nitpicker-test-client.c index d7e85db..e80961c 100644 --- a/nitpicker-test-client.c +++ b/nitpicker-test-client.c @@ -195,31 +195,37 @@ client_run (nitpicker service, if (shm_unlink(buffer_ds)) { perror("unlinking shared memory object"); } -#ifdef UNUSED // TODO: Port and add the code below. We will need to first // create a "Nitevent" object to pass via nitpicker_new_view_call. - vid1 = nitpicker_new_view_call(service, buf_id, &myself, ev); + // vid1 = nitpicker_new_view_call(service, buf_id, &myself, ev); + + vid1 = nitpicker_new_view(service, buf_id, ev); printf("nitpicker_new_view_call returned vid1=%d\n", vid1); views[vid1].x = 240; views[vid1].y = 100; views[vid1].w = 300; views[vid1].h = 140; - views[vid1].x += (client_output_port - default_client_output_port); - views[vid1].y += (client_output_port - default_client_output_port); - ret = nitpicker_set_view_port_call(&nit, vid1, 0, 0, views[vid1].x, views[vid1].y, - views[vid1].w, views[vid1].h, 1, &env); + // views[vid1].x += (client_output_port - default_client_output_port); + // views[vid1].y += (client_output_port - default_client_output_port); + ret = nitpicker_set_view_port(service, + vid1, 0, 0, views[vid1].x, views[vid1].y, + views[vid1].w, views[vid1].h, 1, ev); - nitpicker_set_view_title_call(&nit, vid1, "Trusted Colour Haze 1", &env); + nitpicker_set_view_title(service, vid1, + "Trusted Colour Haze 1", ev); - vid2 = nitpicker_new_view_call(&nit, buf_id, &myself, &env); + vid2 = nitpicker_new_view(service, buf_id, ev); printf("nitpicker_new_view_call returned vid2=%d\n", vid2); views[vid2].x = 350; views[vid2].y = 200; views[vid2].w = 250; views[vid2].h = 180; - views[vid2].x += (client_output_port - default_client_output_port); - views[vid2].y += (client_output_port - default_client_output_port); - ret = nitpicker_set_view_port_call(&nit, vid2, 0, 0, views[vid2].x, views[vid2].y, - views[vid2].w, views[vid2].h, 1, &env); + // views[vid2].x += (client_output_port - default_client_output_port); + // views[vid2].y += (client_output_port - default_client_output_port); + ret = nitpicker_set_view_port(service, vid2, + 0, 0, views[vid2].x, views[vid2].y, + views[vid2].w, views[vid2].h, 1, ev); - nitpicker_set_view_title_call(&nit, vid2, "Trusted Colour Haze 2", &env); + nitpicker_set_view_title(service, vid2, + "Trusted Colour Haze 2", ev); +#ifdef UNUSED // vid3 = nitpicker_new_view_call(&nit, buf_id, &myself, &env); // printf("nitpicker_new_view_call returned vid3=%d\n", vid3); // diff --git a/nitpicker.h b/nitpicker.h index 21fc132..57528b2 100644 --- a/nitpicker.h +++ b/nitpicker.h @@ -125,7 +125,7 @@ CORBA_long (*get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CO CORBA_long (*import_buffer)(PortableServer_Servant _servant, const CORBA_char * ds, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev); void (*remove_buffer)(PortableServer_Servant _servant, const CORBA_long buf_id, CORBA_Environment *ev); void (*refresh)(PortableServer_Servant _servant, const CORBA_long buf_id, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev); -CORBA_long (*new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, const Nitevent listener, CORBA_Environment *ev); +CORBA_long (*new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, CORBA_Environment *ev); void (*destroy_view)(PortableServer_Servant _servant, const CORBA_long view_id, CORBA_Environment *ev); CORBA_long (*set_view_port)(PortableServer_Servant _servant, const CORBA_long view_id, const CORBA_long buf_x, const CORBA_long buf_y, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, const CORBA_long do_redraw, CORBA_Environment *ev); CORBA_long (*stack_view)(PortableServer_Servant _servant, const CORBA_long view_id, const CORBA_long neighbor_id, const CORBA_long behind, const CORBA_long do_redraw, CORBA_Environment *ev); @@ -153,7 +153,7 @@ void _ORBIT_skel_small_nitpicker_get_screen_info(POA_nitpicker *_ORBIT_servant, void _ORBIT_skel_small_nitpicker_import_buffer(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_import_buffer)(PortableServer_Servant _servant, const CORBA_char * ds, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_remove_buffer(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, void (*_impl_remove_buffer)(PortableServer_Servant _servant, const CORBA_long buf_id, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_refresh(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, void (*_impl_refresh)(PortableServer_Servant _servant, const CORBA_long buf_id, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev)); -void _ORBIT_skel_small_nitpicker_new_view(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, const Nitevent listener, CORBA_Environment *ev)); +void _ORBIT_skel_small_nitpicker_new_view(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_new_view)(PortableServer_Servant _servant, const CORBA_long buf_id, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_destroy_view(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, void (*_impl_destroy_view)(PortableServer_Servant _servant, const CORBA_long view_id, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_set_view_port(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_set_view_port)(PortableServer_Servant _servant, const CORBA_long view_id, const CORBA_long buf_x, const CORBA_long buf_y, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, const CORBA_long do_redraw, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_stack_view(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_stack_view)(PortableServer_Servant _servant, const CORBA_long view_id, const CORBA_long neighbor_id, const CORBA_long behind, const CORBA_long do_redraw, CORBA_Environment *ev)); @@ -169,7 +169,7 @@ CORBA_long nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, CORBA_long* CORBA_long nitpicker_import_buffer(nitpicker _obj, const CORBA_char * ds, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev); void nitpicker_remove_buffer(nitpicker _obj, const CORBA_long buf_id, CORBA_Environment *ev); void nitpicker_refresh(nitpicker _obj, const CORBA_long buf_id, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev); -CORBA_long nitpicker_new_view(nitpicker _obj, const CORBA_long buf_id, const Nitevent listener, CORBA_Environment *ev); +CORBA_long nitpicker_new_view(nitpicker _obj, const CORBA_long buf_id, CORBA_Environment *ev); void nitpicker_destroy_view(nitpicker _obj, const CORBA_long view_id, CORBA_Environment *ev); CORBA_long nitpicker_set_view_port(nitpicker _obj, const CORBA_long view_id, const CORBA_long buf_x, const CORBA_long buf_y, const CORBA_long x, const CORBA_long y, const CORBA_long w, const CORBA_long h, const CORBA_long do_redraw, CORBA_Environment *ev); CORBA_long nitpicker_stack_view(nitpicker _obj, const CORBA_long view_id, const CORBA_long neighbor_id, const CORBA_long behind, const CORBA_long do_redraw, CORBA_Environment *ev); diff --git a/nitpicker.idl b/nitpicker.idl index 2779f73..c32a7c3 100644 --- a/nitpicker.idl +++ b/nitpicker.idl @@ -75,7 +75,11 @@ interface nitpicker { * \param token private token to be associated with the view * \param listener receiver of events regarding the view */ - long new_view(in long buf_id, in Nitevent listener); + /* TODO: We will temporarily NOT pass Nitevent. This means there's + no way to distinguish the listener, but we want to get through + the single-client case before we handle X clients. */ + /* long new_view(in long buf_id, in Nitevent listener); */ + long new_view(in long buf_id); /*** CLOSE VIEW ***/ @@ -536,11 +536,13 @@ void activate_view(view *nv) { ***************************/ /*** INTERFACE: CREATE NEW VIEW ***/ -CORBA_long nitpicker_new_view(CORBA_Object _obj, int buf_id, const Nitevent listener, CORBA_Environment *ev){ +// CORBA_long nitpicker_new_view(CORBA_Object _obj, int buf_id, const Nitevent listener, CORBA_Environment *ev){ +CORBA_long nitpicker_new_view(CORBA_Object _obj, int buf_id, CORBA_Environment *ev){ int id; client *c; buffer *b; + Nitevent listener = (void *) 0; // TODO: Remove listener /* look up client data structure */ if (!(c = find_client(_obj))) return -1; |