home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / LATTIC_3.ZIP / HEADERS / AES.H next >
C/C++ Source or Header  |  1990-07-09  |  13KB  |  528 lines

  1. /*
  2.  * aes.h - AES interface header file
  3.  *
  4.  * Started 16/9/89 Alex G. Kiernan
  5.  *
  6.  * Copyright (c) 1989 HiSoft
  7.  */
  8.  
  9. #ifndef _AES_H
  10. #define _AES_H
  11.  
  12. __regargs int _AESif(short);
  13.  
  14. extern void *_AESpb[6];
  15.  
  16. extern short _AEScontrol[5];
  17. extern short _AESglobal[15];
  18. extern short _AESintin[16];
  19. extern short _AESintout[7];
  20. extern void *_AESaddrin[3];
  21. extern void *_AESaddrout[1];
  22.  
  23. /* Application library definitions */
  24. typedef struct
  25. {
  26.     long ap_event;
  27.     long ap_value;
  28. } EVNTREC;
  29.  
  30. int appl_init(void);
  31. #ifndef __NO_AES_DEFINES
  32. #define appl_init() (_AESpb[0]=_AEScontrol,_AESpb[1]=_AESglobal,\
  33. _AESpb[2]=_AESintin,_AESpb[3]=_AESintout,_AESpb[4]=_AESaddrin,\
  34. _AESpb[5]=_AESaddrout,_AESif(0))
  35. #endif
  36. int appl_read(int,int,void *);
  37. int appl_write(int,int,void *);
  38. int appl_find(const char *);
  39. #ifndef __NO_AES_DEFINES
  40. #define appl_find(a)    (_AESaddrin[0]=a,_AESif(12))
  41. #endif
  42. int appl_tplay(EVNTREC *,int,int);
  43. int appl_trecord(EVNTREC *,int);
  44. int appl_exit(void);
  45. #ifndef __NO_AES_DEFINES
  46. #define appl_exit()    _AESif(36)
  47. #endif
  48.  
  49. /* Event library definitions */
  50. #define MU_KEYBD    0x0001    
  51. #define MU_BUTTON    0x0002
  52. #define MU_M1        0x0004
  53. #define MU_M2        0x0008
  54. #define MU_MESAG    0x0010
  55. #define MU_TIMER    0x0020
  56.  
  57. #define K_RSHIFT    0x0001
  58. #define K_LSHIFT    0x0002
  59. #define K_CTRL        0x0004
  60. #define K_ALT        0x0008
  61.  
  62. #define MN_SELECTED    10
  63.  
  64. #define WM_REDRAW    20
  65. #define WM_TOPPED    21
  66. #define WM_CLOSED    22
  67. #define WM_FULLED    23
  68. #define WM_ARROWED    24
  69. #define WM_HSLID    25
  70. #define WM_VSLID    26
  71. #define WM_SIZED    27
  72. #define WM_MOVED    28
  73. #define WM_NEWTOP    29
  74.  
  75. #define AC_OPEN        40
  76. #define AC_CLOSE    41
  77.  
  78. #define WA_UPPAGE    0
  79. #define WA_DNPAGE    1
  80. #define WA_UPLINE    2
  81. #define WA_DNLINE    3
  82. #define WA_LFPAGE    4
  83. #define WA_RTPAGE    5
  84. #define WA_LFLINE    6
  85. #define WA_RTLINE    7
  86.  
  87. int evnt_keybd(void);
  88. #ifndef __NO_AES_DEFINES
  89. #define evnt_keybd()    _AESif(40)
  90. #endif
  91. int evnt_button(int,int,int,short *,short *,short *,short *);
  92. int evnt_mouse(int,int,int,int,int,short *,short *,short *,short *);
  93. int evnt_mesag(short *);
  94. #ifndef __NO_AES_DEFINES
  95. #define evnt_mesag(a)    (_AESaddrin[0]=a,_AESif(52))
  96. #endif
  97. int evnt_timer(int,int);
  98. int evnt_multi(int,int,int,int,int,int,int,int,int,int,int,int,int,int,short *,int,int,short *,short *,short *,short *,short *,short *);
  99. int evnt_dclick(int,int);
  100.  
  101. /* Object library definitions */
  102. #define ROOT        0
  103. #define NIL            -1
  104.  
  105. #define MAX_DEPTH    8    /* max depth of search or draw */
  106.                     
  107. #define IP_HOLLOW    0    /* inside patterns */
  108. #define IP_1PATT    1
  109. #define IP_2PATT    2
  110. #define IP_3PATT    3
  111. #define IP_4PATT    4
  112. #define IP_5PATT    5
  113. #define IP_6PATT    6
  114. #define IP_SOLID    7
  115.                     
  116. #define IBM            3    /* font types */
  117. #define SMALL        5
  118.                         
  119. #define G_BOX        20    /* Graphic types of obs    */
  120. #define G_TEXT        21
  121. #define G_BOXTEXT    22
  122. #define G_IMAGE        23
  123. #define G_PROGDEF    24
  124. #define    G_USERDEF    G_PROGDEF
  125. #define G_IBOX        25
  126. #define G_BUTTON    26
  127. #define G_BOXCHAR    27
  128. #define G_STRING    28
  129. #define G_FTEXT        29
  130. #define G_FBOXTEXT    30
  131. #define G_ICON        31
  132. #define G_TITLE        32
  133.                         
  134. #define NONE        0x0000    /* Object flags    */
  135. #define SELECTABLE    0x0001
  136. #define DEFAULT        0x0002
  137. #define EXIT        0x0004
  138. #define EDITABLE    0x0008
  139. #define RBUTTON        0x0010
  140. #define LASTOB        0x0020
  141. #define TOUCHEXIT    0x0040
  142. #define HIDETREE    0x0080
  143. #define INDIRECT    0x0100
  144.  
  145. #define NORMAL        0x0000    /* Object states */
  146. #define SELECTED    0x0001
  147. #define CROSSED        0x0002
  148. #define CHECKED        0x0004
  149. #define DISABLED    0x0008
  150. #define OUTLINED    0x0010
  151. #define SHADOWED    0x0020
  152.                         
  153. #define WHITE        0    /* Object colors */
  154. #define BLACK        1
  155. #define RED            2
  156. #define GREEN        3
  157. #define BLUE        4
  158. #define CYAN        5
  159. #define YELLOW        6
  160. #define MAGENTA        7
  161. #define LWHITE        8
  162. #define LBLACK        9
  163. #define LRED        10
  164. #define LGREEN        11
  165. #define LBLUE        12
  166. #define LCYAN        13
  167. #define LYELLOW        14
  168. #define LMAGENTA    15
  169.                     
  170. #define TE_LEFT        0    /* editable text justification */
  171. #define TE_RIGHT    1
  172. #define TE_CNTR        2
  173.  
  174. typedef struct object
  175. {
  176.     short ob_next;
  177.     short ob_head;
  178.     short ob_tail;
  179.     unsigned short ob_type;
  180.     unsigned short ob_flags;
  181.     unsigned short ob_state;
  182.     void *ob_spec;
  183.     short ob_x;
  184.     short ob_y;
  185.     short ob_width;
  186.     short ob_height;
  187. } OBJECT;
  188.  
  189. typedef struct text_edinfo
  190. {
  191.     char *te_ptext;
  192.     char *te_ptmplt;
  193.     char *te_pvalid;
  194.     short te_font;
  195.     short te_junk1;
  196.     short te_just;
  197.     short te_color;
  198.     short te_junk2;
  199.     short te_thickness;
  200.     short te_txtlen;
  201.     short te_tmplen;
  202. } TEDINFO;
  203.  
  204. typedef struct icon_block
  205. {
  206.     short *ib_pmask;
  207.     short *ib_pdata;
  208.     char *ib_ptext;
  209.     short ib_char;
  210.     short ib_xchar;
  211.     short ib_ychar;
  212.     short ib_xicon;
  213.     short ib_yicon;
  214.     short ib_wicon;
  215.     short ib_hicon;
  216.     short ib_xtext;
  217.     short ib_ytext;
  218.     short ib_wtext;
  219.     short ib_htext;
  220. } ICONBLK;
  221.  
  222. typedef struct bit_block
  223. {
  224.     short *bi_pdata;
  225.     short bi_wb;
  226.     short bi_hl;
  227.     short bi_x;
  228.     short bi_y;
  229.     short bi_color;
  230. } BITBLK;
  231.  
  232. typedef struct parm_blk
  233. {
  234.     OBJECT *pb_tree;
  235.     short pb_obj;
  236.     short pb_prevstate;
  237.     short pb_currstate;
  238.     short pb_x;
  239.     short pb_y;
  240.     short pb_w;
  241.     short pb_h;
  242.     short pb_xc;
  243.     short pb_yc;
  244.     short pb_wc;
  245.     short pb_hc;
  246.     long pb_parm;
  247. } PARMBLK;
  248.  
  249. /* Lattice 3 flavour */
  250. typedef struct user_blk
  251. {
  252.     int (*ub_code)(PARMBLK *);
  253.     long ub_parm;
  254. } USERBLK;
  255.  
  256. /* Rest of the world flavour */
  257. typedef struct appl_blk
  258. {
  259.     int (*ab_code)(PARMBLK *);
  260.     long ab_parm;
  261. } APPLBLK;
  262.  
  263. typedef struct grect
  264. {
  265.     short g_x;
  266.     short g_y;
  267.     short g_w;
  268.     short g_h;
  269. } GRECT;
  270.  
  271. int objc_add(OBJECT *,int,int);
  272. int objc_delete(OBJECT *,int);
  273. int objc_draw(OBJECT *,int,int,int,int,int,int);
  274. int objc_find(OBJECT *,int,int,int,int);
  275. int objc_offset(OBJECT *,int,short *,short *);
  276. int objc_order(OBJECT *,int,int);
  277. int objc_edit(OBJECT *,int,int,short *,int);
  278. int objc_change(OBJECT *,int,int,int,int,int,int,int,int);
  279.  
  280. /* HiSoft extras */
  281. int objc_xywh(OBJECT *,int,GRECT *);
  282. void objc_walk(OBJECT *,int,int,int,int (*)(OBJECT *,int));
  283.  
  284. /* Menu library definitions */
  285. int menu_bar(OBJECT *, int);
  286. int menu_icheck(OBJECT *,int,int);
  287. int menu_ienable(OBJECT *,int,int);
  288. int menu_tnormal(OBJECT *,int,int);
  289. int menu_text(OBJECT *,int,const char *);
  290. int menu_register(int,const char *);
  291.  
  292. /* Form library definitions */
  293. #define ED_START    0    /* editable text field definitions */
  294. #define EDSTART    ED_START
  295. #define ED_INIT    1
  296. #define EDINIT    ED_INIT    
  297. #define ED_CHAR    2
  298. #define EDCHAR    ED_CHAR
  299. #define ED_END    3
  300. #define EDEND    ED_END
  301.                     
  302. #define FMD_START    0
  303. #define FMD_GROW    1
  304. #define FMD_SHRINK    2
  305. #define FMD_FINISH    3
  306.  
  307. int form_do(OBJECT *,int);
  308. int form_dial(int,int,int,int,int,int,int,int,int);
  309. int form_alert(int,const char *);
  310. int form_error(int);
  311. #ifndef __NO_AES_DEFINES
  312. #define form_error(a)    (_AESintin[0]=a,_AESif(172))
  313. #endif
  314. int form_center(OBJECT *,short *,short *,short *,short *);
  315. int form_keybd(OBJECT *,int,int,int,short *,short *);
  316. int form_button(OBJECT *,int,int,short *);
  317.  
  318. /* Graphics library definitions */
  319. #define    ARROW        0
  320. #define    TEXT_CRSR    1
  321. #define    HOURGLASS    2
  322. #define    BUSYBEE    HOURGLASS
  323. #define    POINT_HAND    3
  324. #define    FLAT_HAND    4
  325. #define    THIN_CROSS    5
  326. #define    THICK_CROSS    6
  327. #define    OUTLN_CROSS    7
  328. #define    USER_DEF    255
  329. #define M_OFF        256
  330. #define M_ON        257
  331.  
  332. int graf_rubberbox(int,int,int,int,short *,short *);
  333. int graf_dragbox(int,int,int,int,int,int,int,int,short *,short *);
  334. int graf_movebox(int,int,int,int,int,int);
  335. int graf_growbox(int,int,int,int,int,int,int,int);
  336. int graf_shrinkbox(int,int,int,int,int,int,int,int);
  337. int graf_watchbox(OBJECT *,int,int,int);
  338. int graf_slidebox(OBJECT *,int,int,int);
  339. int graf_handle(short *,short *,short *,short *);
  340. int graf_mouse(int,void *);
  341. int graf_mkstate(short *,short *,short *,short *);
  342.  
  343. /* Scrap library definitions */
  344. int scrp_read(char *);
  345. int scrp_write(const char *);
  346. #ifndef __NO_AES_DEFINES
  347. #define scrp_read(a)    (_AESaddrin[0]=a,_AESif(280))
  348. #define scrp_write(a)    (_AESaddrin[0]=a,_AESif(284))
  349. #endif
  350.  
  351. /* File selector library definitions */
  352. int fsel_input(char *,char *,short *);
  353. int fsel_exinput(char *,char *,short *,const char *);
  354.  
  355. /* Window library definitions */
  356. #define NAME        0x0001
  357. #define CLOSE        0x0002
  358. #define CLOSER        CLOSE
  359. #define FULL        0x0004
  360. #define FULLER        FULL
  361. #define MOVE        0x0008
  362. #define MOVER        MOVE
  363. #define INFO        0x0010
  364. #define SIZE        0x0020
  365. #define SIZER        SIZE
  366. #define UPARROW        0x0040
  367. #define DNARROW        0x0080
  368. #define VSLIDE        0x0100
  369. #define LFARROW        0x0200
  370. #define RTARROW        0x0400
  371. #define HSLIDE        0x0800
  372.  
  373. #define WF_KIND        1
  374. #define WF_NAME     2
  375. #define WF_INFO     3
  376. #define WF_WXYWH    4
  377. #define WF_WORKXYWH    WF_WXYWH
  378. #define WF_CXYWH    5
  379. #define WF_CURRXYWH    WF_CXYWH
  380. #define WF_PXYWH    6
  381. #define WF_PREVXYWH    WF_PXYWH
  382. #define WF_FXYWH    7
  383. #define WF_FULLXYWH    WF_FXYWH
  384. #define WF_HSLIDE    8
  385. #define WF_VSLIDE    9
  386. #define WF_TOP        10
  387. #define WF_FIRSTXYWH    11
  388. #define WF_NEXTXYWH    12
  389. #define WF_IGNORE    13
  390. #define WF_NEWDESK    14
  391. #define WF_HSLSIZE    15
  392. #define WF_HSLSIZ    WF_HSLSIZE
  393. #define WF_VSLSIZE    16
  394. #define    WF_VSLSIZ    WF_VSLSIZE
  395. #define WF_SCREEN    17
  396.  
  397. #define    END_UPDATE    0
  398. #define    BEG_UPDATE    1
  399. #define    END_MCTRL    2
  400. #define    BEG_MCTRL    3
  401.  
  402. #define WC_BORDER    0
  403. #define WC_WORK        1
  404.  
  405. #define DESK    0
  406.  
  407. int wind_create(int,int,int,int,int);
  408. int wind_open(int,int,int,int,int);
  409. int wind_close(int);
  410. int wind_delete(int);
  411. #ifndef __NO_AES_DEFINES
  412. #define wind_close(a)    (_AESintin[0]=a,_AESif(368))
  413. #define wind_delete(a)    (_AESintin[0]=a,_AESif(372))
  414. #endif
  415. int wind_get(int,int,short *,short *,short *,short *);
  416. int wind_set(int,int,...);
  417. int wind_find(int,int);
  418. int wind_update(int);
  419. #ifndef __NO_AES_DEFINES
  420. #define wind_update(a)    (_AESintin[0]=a,_AESif(388))
  421. #endif
  422. int wind_calc(int,int,int,int,int,int,short *,short *,short *,short *);
  423. int wind_new(void);
  424. #ifndef __NO_AES_DEFINES
  425. #define wind_new()    _AESif(396)
  426. #endif
  427.  
  428. /*  HiSoft extras */
  429. int wind_newdesk(OBJECT *,int);
  430. int wind_info(int,const char *);
  431. int wind_title(int,const char *);
  432. int wind_redraw(int,GRECT *,int (*)(int,GRECT *));
  433.  
  434. /* Resource library definitions */
  435. #define R_TREE        0
  436. #define R_OBJECT    1
  437. #define R_TEDINFO    2
  438. #define R_ICONBLK    3
  439. #define R_BITBLK    4
  440. #define R_STRING    5    /* gets pointer to free strings */
  441. #define R_IMAGEDATA    6    /* gets pointer to free images */
  442. #define R_OBSPEC    7
  443. #define R_TEPTEXT    8    /* sub ptrs in TEDINFO */
  444. #define R_TEPTMPLT    9
  445. #define R_TEPVALID    10
  446. #define R_IBPMASK    11    /* sub ptrs in ICONBLK */
  447. #define R_IBPDATA    12
  448. #define R_IBPTEXT    13
  449. #define R_BIPDATA    14    /* sub ptrs in BITBLK */
  450. #define R_FRSTR        15    /* gets addr of ptr to free strings */
  451. #define R_FRIMG        16    /* gets addr of ptr to free images */
  452.  
  453. typedef struct
  454. {
  455.     short rsh_vrsn;            /* RCS version no. */
  456.     unsigned short rsh_object;    /* offset to object[] */
  457.     unsigned short rsh_tedinfo;    /* offset to tedinfo[] */
  458.     unsigned short rsh_iconblk;    /* offset to iconblk[] */
  459.     unsigned short rsh_bitblk;    /* offset to bitblk[] */
  460.     unsigned short rsh_frstr;        /* offset to free string index */
  461.     unsigned short rsh_string;    /* offset to first string */
  462.     unsigned short rsh_imdata;    /* offset to image data */
  463.     unsigned short rsh_frimg;        /* offset to free image index */
  464.     unsigned short rsh_trindex;    /* offset to object tree index */
  465.     short rsh_nobs;            /* number of objects */
  466.     short rsh_ntree;            /* number of trees */
  467.     short rsh_nted;            /* number of tedinfos */
  468.     short rsh_nib;            /* number of icon blocks */
  469.     short rsh_nbb;            /* number of blt blocks */
  470.     short rsh_nstring;        /* number of free strings */
  471.     short rsh_nimages;        /* number of free images */
  472.     unsigned short rsh_rssize;    /* total bytes in resource */
  473. } RSHDR;
  474.  
  475. int rsrc_load(const char *);
  476. int rsrc_free(void);
  477. #ifndef __NO_AES_DEFINES
  478. #define rsrc_load(a)    (_AESaddrin[0]=a,_AESif(400))
  479. #define rsrc_free()    _AESif(404)
  480. #endif
  481. int rsrc_gaddr(int,int,void *);
  482. int rsrc_saddr(int,int,void *);
  483. int rsrc_obfix(OBJECT *,int);
  484.  
  485. /* Shell library definitions */
  486. int shel_read(char *,char *);
  487. int shel_write(int,int,int,const char *,const char *);
  488. int shel_get(char *,int);
  489. int shel_put(const char *,int);
  490. int shel_find(char *);
  491. #ifndef __NO_AES_DEFINES
  492. #define shel_find(a)    (_AESaddrin[0]=a,_AESif(456))
  493. #endif
  494. int shel_envrn(char *, const char *);
  495.  
  496. /* Rectangle manipulation definitions */
  497. void rc_constrain(const GRECT *,GRECT *);
  498. void rc_copy(const GRECT *,GRECT *);
  499. int rc_equal(const GRECT *,const GRECT *);
  500. int rc_intersect(const GRECT *,GRECT *);
  501. int rc_inside(int,int,const GRECT *);
  502. void rc_union(const GRECT *,GRECT *);
  503.  
  504. /* Macro for Lattice 3 compatability */
  505. #ifdef SPTR
  506. #define ADDR(a) (a)
  507. #else
  508. #define    ADDR(a)    ((long)(a)>>16),((long)(a))
  509. #endif
  510.  
  511. /* Useful AES functions */
  512. #ifndef min
  513. int min(int,int);
  514. int __builtin_min(int,int);
  515. #define min(a,b)    __builtin_min(a,b)
  516. #endif
  517.  
  518. #ifndef max
  519. int max(int,int);
  520. int __builtin_max(int,int);
  521. #define max(a,b)    __builtin_max(a,b)
  522. #endif
  523.  
  524. unsigned short umul_div(unsigned short,unsigned short,unsigned short);
  525.  
  526. #define NULL    ((void *)0)
  527. #endif
  528.