home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XAAES_S.ZIP / XAAES / TESTAPP / OBJC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-26  |  1.3 KB  |  74 lines

  1. #include <AES.H>
  2. #include "t1.h"
  3.  
  4. typedef struct {
  5.     short *contrl;
  6.     short *globl;
  7.     short *intin;
  8.     short *intout;
  9.     void  **addrin;
  10.     void  **addrout;
  11. } AESPB;
  12.  
  13. short call_aes(short,void*);
  14. #if USE_DEBUG_VECTOR
  15. #pragma inline d0=call_aes(d0,d1) {"4E43";}
  16. #else
  17. #pragma inline d0=call_aes(d0,d1) {"4E42";}
  18. #endif
  19.  
  20. void main(void)
  21. {
  22.     short Pappl_init[]={10,0,1,0,0};
  23.     AESPB pb;
  24.     short intin[300];
  25.     short intout[300];
  26.     void *addrin[300];
  27.     void *addrout[300];
  28.     short global[15];
  29.     short ap_id,t1,t2,mx,my,mb,s,ob,wx,wy,ww,wh;
  30.     OBJECT *form1;
  31.  
  32.     printf("XaAES Object Tree Test 1\n");
  33.  
  34.     pb.contrl=Pappl_init;
  35.     pb.globl=global;
  36.     pb.intin=intin;
  37.     pb.intout=intout;
  38.     pb.addrin=addrin;
  39.     pb.addrout=addrout;
  40.     
  41.     call_aes(0xc8,&pb);
  42.  
  43.     ap_id=pb.intout[0];
  44.  
  45. //    ap_id=appl_init();
  46.  
  47.     t1=rsrc_load("t1.rsc");
  48.     t2=rsrc_gaddr(R_TREE, FORM1, &form1);
  49.     
  50.     wind_calc(0,0,0,0,200,200,&wx,&wy,&ww,&wh);
  51.     
  52.     t1=wind_create(0, wx,wy,ww,wh);
  53.  
  54.     wind_open(t1,0,0,ww,wh);
  55.     
  56.     if (form1)
  57.         objc_draw(form1,0,5,0,0,800,600);
  58.  
  59.     while(1)
  60.     {
  61.         evnt_button(1,1,1,&mx,&my,&mb,&s);
  62.         ob=objc_find(form1,0,5,mx,my);
  63.         if (ob>0)
  64.         {
  65.             t1=form_button(form1,ob,1,&t2);
  66.             printf("form_button(%d)=%d,newobj=%d\n",ob,t1,t2);
  67.         }
  68.     }
  69.  
  70.     printf("rsrc_free()=%d\n",rsrc_free());
  71.  
  72.     appl_exit();
  73.  
  74. }