[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] XaAES and mt_wind_xget_grect( ... WF_FIRSTAREAXYWH...)
Hello
It is not possible to have value outside window, max value can be FULLAREA
(perhaps you prefer it will be restrict to WORK_AREA more logical, I just see
it in myaes, in fact we think to this extension to restrict to smaller area,
not have bigger one)
I have find 2 bugs in your source code
vh should not be answer by appl_init() but with graf_handle()
And loop test is wrong you should have
do
{ ....
} while(res);
regards
Olivier
> Hi!
>
> From my understanding of AES API the attached piece of code
> should IMHO only update the WORK area of the AES window.
>
> The wind_xget( WF_FIRSTAREAXYWH ) returns a rectagle that
> is greater then the window work area in this example.
>
> Can someone have a look at that and tell me what am I doing
> wrong? XaAES and MyAES seem to behave the same...
Are you sure you have a window
>
> thanks!
>
> Standa
>
>
> ==== Cut ====
>
> #include <mt_gem.h>
> #include <osbind.h>
>
> #include <stdio.h>
>
>
> int main( void)
> {
> short aes_global[15];
> short h, vh, res, dum;
> GRECT r1, gout;
> short work_in[11]; /**< array input of v_opnvwrk() function */
> short work_out[57]; /**< array output of v_opnvwrk() function */
>
>
> vh = mt_appl_init( aes_global );
>
> work_in[0] = Getrez() + 2;
> for( dum = 1; dum < 10; work_in[ dum ++] = 1);
> work_in[10] = 2;
>
> v_opnvwk( work_in, &vh, work_out);
>
> h = mt_wind_create( NAME | CLOSER, 0,0,1024,1024, aes_global);
> mt_wind_open( h, 100, 50, 300, 200, aes_global);
>
> mt_evnt_keybd(aes_global);
>
> #if 1
> r1.g_x = 0;
> r1.g_y = 0;
> r1.g_w = 1024;
> r1.g_h = 1024;
> res = mt_wind_xget_grect( h, WF_FIRSTAREAXYWH, &r1, &gout,
> aes_global);
> #else
> res = mt_wind_get_grect( h, WF_FIRSTXYWH, &gout, aes_global);
> #endif
> {
> short pxy[4] = {gout.g_x,gout.g_y,gout.g_w + gout.g_x -
> 1,gout.g_h + gout.g_y - 1};
> vsf_color( vh, G_WHITE);
> v_bar( vh, pxy);
> v_gtext( vh, pxy[0], pxy[1], "test" );
> }
>
> do {
> fprintf( stderr, "out %d,%d,%d,%d\r\n", gout.g_x, gout.g_y,
> gout.g_w, gout.g_h );
> res = mt_wind_get_grect( h, WF_NEXTXYWH, &gout, aes_global);
> } while ( !res );
>
>
> mt_evnt_keybd(aes_global);
>
> mt_appl_exit( aes_global );
>
> return 0;
> }
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
>
>
--