diff options
author | dwheeler <dwheeler@88473608-6f18-0410-8b6c-91216bd3049c> | 2008-01-29 20:12:01 +0000 |
---|---|---|
committer | dwheeler <dwheeler@88473608-6f18-0410-8b6c-91216bd3049c> | 2008-01-29 20:12:01 +0000 |
commit | 0b09c701498600ebe7717e8e8827f051aa541a71 (patch) | |
tree | 920a12f0f49258a0a02a7b93beb3c5ff20888cf4 | |
parent | da831928e0421f5b226bf8960867a2171891fc6a (diff) |
Add 'depth' as separate parameter from 'mode'
git-svn-id: svn+ssh://svn-nitpicker.cl.cam.ac.uk/linpicker/trunk@195 88473608-6f18-0410-8b6c-91216bd3049c
-rw-r--r-- | nitpicker-common.c | 7 | ||||
-rw-r--r-- | nitpicker-skelimpl.c | 4 | ||||
-rw-r--r-- | nitpicker-stubs.c | 7 | ||||
-rw-r--r-- | nitpicker-test-client.c | 17 | ||||
-rw-r--r-- | nitpicker.h | 6 | ||||
-rw-r--r-- | nitpicker.idl | 3 | ||||
-rw-r--r-- | view.c | 5 |
7 files changed, 26 insertions, 23 deletions
diff --git a/nitpicker-common.c b/nitpicker-common.c index 7e0cfe9..b8de3ca 100644 --- a/nitpicker-common.c +++ b/nitpicker-common.c @@ -24,8 +24,8 @@ CORBA_long (*_impl_donate_memory)(PortableServer_Servant _servant, const CORBA_c *(CORBA_long *)_o_retval = _impl_donate_memory (_o_servant, *(const CORBA_char * *)_o_args[0], *(const CORBA_long *)_o_args[1], *(const CORBA_long *)_o_args[2], _o_ev); } void _ORBIT_skel_small_nitpicker_get_screen_info(POA_nitpicker *_o_servant, gpointer _o_retval,gpointer *_o_args,CORBA_Context _o_ctx,CORBA_Environment *_o_ev, -CORBA_long (*_impl_get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev)) { -*(CORBA_long *)_o_retval = _impl_get_screen_info (_o_servant, *(CORBA_long* *)_o_args[0], *(CORBA_long* *)_o_args[1], *(CORBA_long* *)_o_args[2], _o_ev); +CORBA_long (*_impl_get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev)) { +*(CORBA_long *)_o_retval = _impl_get_screen_info (_o_servant, *(CORBA_long* *)_o_args[0], *(CORBA_long* *)_o_args[1], *(CORBA_long* *)_o_args[2], *(CORBA_long* *)_o_args[3], _o_ev); } void _ORBIT_skel_small_nitpicker_import_buffer(POA_nitpicker *_o_servant, gpointer _o_retval,gpointer *_o_args,CORBA_Context _o_ctx,CORBA_Environment *_o_ev, CORBA_long (*_impl_import_buffer)(PortableServer_Servant _servant, const CORBA_char * ds, const CORBA_long w, const CORBA_long h, CORBA_Environment *ev)) { @@ -203,6 +203,7 @@ static ORBit_IArg nitpicker_donate_memory__arginfo [] = { static ORBit_IArg nitpicker_get_screen_info__arginfo [] = { { TC_CORBA_long, ORBit_I_ARG_OUT | ORBit_I_COMMON_FIXED_SIZE, (char *)"w" }, { TC_CORBA_long, ORBit_I_ARG_OUT | ORBit_I_COMMON_FIXED_SIZE, (char *)"h" }, + { TC_CORBA_long, ORBit_I_ARG_OUT | ORBit_I_COMMON_FIXED_SIZE, (char *)"depth" }, { TC_CORBA_long, ORBit_I_ARG_OUT | ORBit_I_COMMON_FIXED_SIZE, (char *)"mode" } }; static ORBit_IArg nitpicker_import_buffer__arginfo [] = { @@ -280,7 +281,7 @@ ORBit_IMethod nitpicker__imethods [] = { 0| ORBit_I_COMMON_FIXED_SIZE } , { - { 3, 3, nitpicker_get_screen_info__arginfo, FALSE }, + { 4, 4, nitpicker_get_screen_info__arginfo, FALSE }, { 0, 0, NULL, FALSE }, { 0, 0, NULL, FALSE }, TC_CORBA_long, (char *)"get_screen_info", 15, diff --git a/nitpicker-skelimpl.c b/nitpicker-skelimpl.c index b96f7de..2f5daed 100644 --- a/nitpicker-skelimpl.c +++ b/nitpicker-skelimpl.c @@ -72,6 +72,7 @@ static CORBA_long impl_nitpicker_get_screen_info(impl_POA_nitpicker *servant, CORBA_long* w, CORBA_long* h, +CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev); #endif @@ -401,11 +402,12 @@ static CORBA_long impl_nitpicker_get_screen_info(impl_POA_nitpicker *servant, CORBA_long* w, CORBA_long* h, +CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev) { /* ------ insert method code here ------ */ - nitpicker_get_screen_info(CONVERT_SERVANT(servant), w, h, mode, ev); + nitpicker_get_screen_info(CONVERT_SERVANT(servant), w, h, depth, mode, ev); /* ------ ---------- end ------------ ------ */ return 0; diff --git a/nitpicker-stubs.c b/nitpicker-stubs.c index 322d7d1..14ad3c9 100644 --- a/nitpicker-stubs.c +++ b/nitpicker-stubs.c @@ -31,12 +31,13 @@ ORBit_c_stub_invoke (_obj, &nitpicker__iinterface.methods, 2, &_ORBIT_retval, _a return _ORBIT_retval; } -CORBA_long nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev){ +CORBA_long nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, CORBA_long* h, CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev){ CORBA_long _ORBIT_retval; -gpointer _args[3]; +gpointer _args[4]; _args[0] = &w; _args[1] = &h; -_args[2] = &mode; +_args[2] = &depth; +_args[3] = &mode; ORBit_c_stub_invoke (_obj, &nitpicker__iinterface.methods, 3, &_ORBIT_retval, _args, NULL, ev, nitpicker__classid, G_STRUCT_OFFSET (POA_nitpicker__epv, get_screen_info), (ORBitSmallSkeleton) _ORBIT_skel_small_nitpicker_get_screen_info); diff --git a/nitpicker-test-client.c b/nitpicker-test-client.c index 56d9d4c..3aeb568 100644 --- a/nitpicker-test-client.c +++ b/nitpicker-test-client.c @@ -34,7 +34,7 @@ static CORBA_ORB global_orb = CORBA_OBJECT_NIL; /* global orb */ //static PortableServer_POA root_poa = CORBA_OBJECT_NIL; /* root POA */ -static int scr_width, scr_height, scr_mode; +static int scr_width, scr_height, scr_depth, scr_mode; static int userstate; static int curr_win; static int omx, omy; @@ -131,7 +131,6 @@ client_run (nitpicker service, max_getpid_len; char donation_ds[SHARED_BUFFER_INFO_NAME_LENGTH], buffer_ds[SHARED_BUFFER_INFO_NAME_LENGTH]; int donation_fd, buffer_fd; // File descriptor - int scr_width, scr_height, scr_mode; int buffer_size; int buf_id; unsigned char *addr; @@ -164,11 +163,9 @@ client_run (nitpicker service, ret = nitpicker_donate_memory( service, donation_ds, 10, 10, ev ); printf( "nitpicker_donate_memory returned %d\n", ret ); - nitpicker_get_screen_info( service, &scr_width, &scr_height, &scr_mode, ev ); - printf( "scr_width=%d, scr_height=%d, scr_mode=%d\n", scr_width, scr_height, scr_mode ); - /* TODO: We can't trust scr_mode, set to 32 */ - scr_mode = 32; - + nitpicker_get_screen_info( service, &scr_width, &scr_height, + &scr_depth, &scr_mode, ev ); + printf( "scr_width=%d, scr_height=%d, scr_depth=%d, scr_mode=%d\n", scr_width, scr_height, scr_depth, scr_mode ); snprintf( buffer_ds, SHARED_BUFFER_INFO_NAME_LENGTH, "/testnit-%d-buffer", getpid() ); buffer_fd = shm_open( buffer_ds, O_RDWR | O_CREAT, 0600 ); @@ -178,10 +175,10 @@ client_run (nitpicker service, shm_unlink(donation_ds); exit(1); } - /* buffer_size = BUF_W*BUF_H*scr_mode/8; */ + /* buffer_size = BUF_W*BUF_H*scr_depth/8; */ /* Calculate buffer size. - * Presumes width*height*mode divisible by 8 */ - buffer_size = scr_width*scr_height*scr_mode/8; + * Presumes width*height*depth divisible by 8 */ + buffer_size = scr_width*scr_height*scr_depth/8; if (ftruncate(buffer_fd, buffer_size)) { diff --git a/nitpicker.h b/nitpicker.h index 57528b2..ac27a2e 100644 --- a/nitpicker.h +++ b/nitpicker.h @@ -121,7 +121,7 @@ typedef struct { CORBA_long (*alive)(PortableServer_Servant _servant, CORBA_Environment *ev); CORBA_long (*kill_graphics)(PortableServer_Servant _servant, CORBA_Environment *ev); CORBA_long (*donate_memory)(PortableServer_Servant _servant, const CORBA_char * ds, const CORBA_long max_views, const CORBA_long max_buffers, CORBA_Environment *ev); -CORBA_long (*get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev); +CORBA_long (*get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev); 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); @@ -149,7 +149,7 @@ extern void POA_nitpicker__fini(PortableServer_Servant servant, CORBA_Environmen void _ORBIT_skel_small_nitpicker_alive(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_alive)(PortableServer_Servant _servant, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_kill_graphics(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_kill_graphics)(PortableServer_Servant _servant, CORBA_Environment *ev)); void _ORBIT_skel_small_nitpicker_donate_memory(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_donate_memory)(PortableServer_Servant _servant, const CORBA_char * ds, const CORBA_long max_views, const CORBA_long max_buffers, CORBA_Environment *ev)); -void _ORBIT_skel_small_nitpicker_get_screen_info(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev)); +void _ORBIT_skel_small_nitpicker_get_screen_info(POA_nitpicker *_ORBIT_servant, gpointer _ORBIT_retval, gpointer *_ORBIT_args, CORBA_Context ctx,CORBA_Environment *ev, CORBA_long (*_impl_get_screen_info)(PortableServer_Servant _servant, CORBA_long* w, CORBA_long* h, CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev)); 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)); @@ -165,7 +165,7 @@ void _ORBIT_skel_small_nitpicker_set_mousemode(POA_nitpicker *_ORBIT_servant, gp CORBA_long nitpicker_alive(nitpicker _obj, CORBA_Environment *ev); CORBA_long nitpicker_kill_graphics(nitpicker _obj, CORBA_Environment *ev); CORBA_long nitpicker_donate_memory(nitpicker _obj, const CORBA_char * ds, const CORBA_long max_views, const CORBA_long max_buffers, CORBA_Environment *ev); -CORBA_long nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev); +CORBA_long nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, CORBA_long* h, CORBA_long* depth, CORBA_long* mode, CORBA_Environment *ev); 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); diff --git a/nitpicker.idl b/nitpicker.idl index c32a7c3..6a1f7ac 100644 --- a/nitpicker.idl +++ b/nitpicker.idl @@ -54,7 +54,8 @@ interface nitpicker { /*** REQUEST INFORMATION ABOUT PHYSICAL SCREEN ***/ // WARNING: Note that in CORBA IDL, "out" doesn't include the *. - long get_screen_info(out long w, out long h, out long mode); + long get_screen_info(out long w, out long h, + out long depth, out long mode); /*** INJECT NEW BUFFER ***/ @@ -807,10 +807,11 @@ view *v, *nv, *lv; /*** INTERFACE: GET SCRREN INFO ***/ int nitpicker_get_screen_info(nitpicker _obj, CORBA_long* w, -CORBA_long* h, CORBA_long* mode, CORBA_Environment *ev) { +CORBA_long* h, CORBA_long *depth, CORBA_long* mode, CORBA_Environment *ev) { *w = screen_width; *h = screen_height; - *mode = scr_depth; /* TODO: Calculate mode.. or change to replying depth */ + *depth = scr_depth; /* TODO: Calculate mode and depth */ + *mode = 0; } |