home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / TURBOC_1.LZH / INCLUDE / AES.H next >
Text File  |  1990-03-02  |  19KB  |  601 lines

  1. /*      AES.H
  2.  
  3.         GEM AES Definitions
  4.  
  5.         Copyright (c) Borland International 1988
  6.         All Rights Reserved.
  7. */
  8.  
  9.  
  10. #if  !defined( __AES__ )
  11. #define __AES__
  12.  
  13. /****** GEMparams *******************************************************/
  14.  
  15. typedef struct
  16. {
  17.     int    contrl[15];
  18.     int    global[80];
  19.     int    intin[128];
  20.     int    intout[45];
  21.     int    ptsout[128];
  22.     void   *addrin[128];
  23.     void   *addrout[6];
  24.     int    ptsin[128];
  25. } GEMPARBLK;
  26.  
  27. extern  GEMPARBLK _GemParBlk;
  28. extern    int       _app;
  29.  
  30. /****** Application definitions *****************************************/
  31.  
  32. int appl_init( void );
  33. int appl_read( int ap_rid, int ap_rlength, void *ap_rpbuff );
  34. int appl_write( int ap_wid, int ap_wlength, void *ap_wpbuff );
  35. int appl_find( const char *ap_fpname );
  36. int appl_tplay( void *ap_tpmem, int ap_tpnum, int ap_tpscale );
  37. int appl_trecord( void *ap_trmem, int ap_trcount );
  38. int appl_exit( void );
  39.  
  40.  
  41. /****** Event definitions ***********************************************/
  42.  
  43. #define MU_KEYBD        0x0001
  44. #define MU_BUTTON       0x0002
  45. #define MU_M1           0x0004
  46. #define MU_M2           0x0008
  47. #define MU_MESAG        0x0010
  48. #define MU_TIMER        0x0020
  49.  
  50. #define MN_SELECTED     10
  51. #define WM_REDRAW       20
  52. #define WM_TOPPED       21
  53. #define WM_CLOSED       22
  54. #define WM_FULLED       23
  55. #define WM_ARROWED      24
  56. #define WM_HSLID        25
  57. #define WM_VSLID        26
  58. #define WM_SIZED        27
  59. #define WM_MOVED        28
  60. #define WM_NEWTOP       29
  61. #define AC_OPEN         40
  62. #define AC_CLOSE        41
  63. #define CT_UPDATE       50
  64. #define CT_MOVE         51
  65. #define CT_NEWTOP       52
  66.  
  67.  
  68. /* Keybord states */
  69.  
  70. #define K_RSHIFT        0x0001
  71. #define K_LSHIFT        0x0002
  72. #define K_CTRL          0x0004
  73. #define K_ALT           0x0008
  74.  
  75.  
  76. typedef struct
  77. {
  78.         int             m_out;
  79.         int             m_x;
  80.         int             m_y;
  81.         int             m_w;
  82.         int             m_h;
  83. } MOBLK;
  84.  
  85.  
  86. int evnt_keybd( void );
  87. int evnt_button( int ev_bclicks, int ev_bmask, int ev_bstate,
  88.                  int *ev_bmx, int *ev_bmy, int *ev_bbutton,
  89.                  int *ev_bkstate );
  90. int evnt_mouse( int ev_moflags, int ev_mox, int ev_moy,
  91.                 int ev_mowidth, int ev_moheight, int *ev_momx,
  92.                 int *ev_momy, int *ev_mobutton,
  93.                 int *ev_mokstate );
  94. int evnt_mesag( int *ev_mgpbuff );
  95. int evnt_timer( int ev_tlocount, int ev_thicount );
  96. int evnt_multi( int ev_mflags, int ev_mbclicks, int ev_mbmask,
  97.                 int ev_mbstate, int ev_mm1flags, int ev_mm1x,
  98.                 int ev_mm1y, int ev_mm1width, int ev_mm1height,
  99.                 int ev_mm2flags, int ev_mm2x, int ev_mm2y,
  100.                 int ev_mm2width, int ev_mm2height,
  101.                 int *ev_mmgpbuff, int ev_mtlocount,
  102.                 int ev_mthicount, int *ev_mmox, int *ev_mmoy,
  103.                 int *ev_mmbutton, int *ev_mmokstate,
  104.                 int *ev_mkreturn, int *ev_mbreturn );
  105. int evnt_dclick( int ev_dnew, int ev_dgetset );
  106.  
  107.  
  108. /****** Object definitions **********************************************/
  109.  
  110. #define G_BOX           20
  111. #define G_TEXT          21
  112. #define G_BOXTEXT       22
  113. #define G_IMAGE         23
  114. #define G_USERDEF       24
  115. #define G_IBOX          25
  116. #define G_BUTTON        26
  117. #define G_BOXCHAR       27
  118. #define G_STRING        28
  119. #define G_FTEXT         29
  120. #define G_FBOXTEXT      30
  121. #define G_ICON          31
  122. #define G_TITLE         32
  123.  
  124.  
  125. /* Object flags */
  126.  
  127. #define NONE            0x0000
  128. #define SELECTABLE      0x0001
  129. #define DEFAULT         0x0002
  130. #define EXIT            0x0004
  131. #define EDITABLE        0x0008
  132. #define RBUTTON         0x0010
  133. #define LASTOB          0x0020
  134. #define TOUCHEXIT       0x0040
  135. #define HIDETREE        0x0080
  136. #define INDIRECT        0x0100
  137.  
  138.  
  139. /* Object states */
  140.  
  141. #define NORMAL          0x00
  142. #define SELECTED        0x01
  143. #define CROSSED         0x02
  144. #define CHECKED         0x04
  145. #define DISABLED        0x08
  146. #define OUTLINED        0x10
  147. #define SHADOWED        0x20
  148.  
  149.  
  150. /* Object colors */
  151. #if !defined(__COLORS)
  152. #define __COLORS    /*     
  153.                         using AES-colors and BGI-colors 
  154.                         is not possible
  155.                     */
  156.  
  157. #define WHITE            0
  158. #define BLACK            1
  159. #define RED              2
  160. #define GREEN            3
  161. #define BLUE             4
  162. #define CYAN             5
  163. #define YELLOW           6
  164. #define MAGENTA          7
  165. #define LWHITE           8
  166. #define LBLACK           9
  167. #define LRED            10
  168. #define LGREEN          11
  169. #define LBLUE           12
  170. #define LCYAN           13
  171. #define LYELLOW         14
  172. #define LMAGENTA        15
  173.  
  174. #endif
  175.  
  176. #define ROOT             0
  177. #define MAX_LEN         81              /* max string length */
  178. #define MAX_DEPTH        8              /* max depth of search or draw */
  179.  
  180.  
  181. #define IBM             3               /* font types */
  182. #define SMALL           5
  183.  
  184.  
  185. #define ED_START        0               /* editable text field definitions */
  186. #define ED_INIT         1
  187. #define ED_CHAR         2
  188. #define ED_END          3
  189.  
  190. #define TE_LEFT         0               /* editable text justification */
  191. #define TE_RIGHT        1
  192. #define TE_CNTR         2
  193.  
  194.  
  195. typedef struct orect
  196. {
  197.         struct  orect   *o_link;
  198.         int     o_x;
  199.         int     o_y;
  200.         int     o_w;
  201.         int     o_h;
  202. } ORECT;
  203.  
  204.  
  205. typedef struct
  206. {
  207.         int     g_x;
  208.         int     g_y;
  209.         int     g_w;
  210.         int     g_h;
  211. } GRECT;
  212.  
  213.  
  214. /* Object structures */
  215.  
  216. typedef struct
  217. {
  218.         char            *te_ptext;      /* ptr to text (must be 1st)    */
  219.         char            *te_ptmplt;     /* ptr to template              */
  220.         char            *te_pvalid;     /* ptr to validation            */
  221.         int             te_font;        /* font                         */
  222.         int             te_junk1;       /* junk int                     */
  223.         int             te_just;        /* justification: left, right...*/
  224.         int             te_color;       /* color information            */
  225.         int             te_junk2;       /* junk int                     */
  226.         int             te_thickness;   /* border thickness             */
  227.         int             te_txtlen;      /* text string length           */
  228.         int             te_tmplen;      /* template string length       */
  229. } TEDINFO;
  230.  
  231.  
  232. typedef struct
  233. {
  234.         int     *ib_pmask;
  235.         int     *ib_pdata;
  236.         char    *ib_ptext;
  237.         int     ib_char;
  238.         int     ib_xchar;
  239.         int     ib_ychar;
  240.         int     ib_xicon;
  241.         int     ib_yicon;
  242.         int     ib_wicon;
  243.         int     ib_hicon;
  244.         int     ib_xtext;
  245.         int     ib_ytext;
  246.         int     ib_wtext;
  247.         int     ib_htext;
  248.         int     ib_resvd;
  249. } ICONBLK;
  250.  
  251.  
  252. typedef struct
  253. {
  254.         int     *bi_pdata;              /* ptr to bit forms data        */
  255.         int     bi_wb;                  /* width of form in bytes       */
  256.         int     bi_hl;                  /* height in lines              */
  257.         int     bi_x;                   /* source x in bit form         */
  258.         int     bi_y;                   /* source y in bit form         */
  259.         int     bi_color;               /* foreground color             */
  260. } BITBLK;
  261.  
  262.  
  263. struct __parmblk;
  264.  
  265. #ifndef __STDC__    /* 
  266.                      *    using this structure is not possible
  267.                      *    if ANSI keywords only is ON
  268.                      */
  269. typedef struct
  270. {
  271.         int cdecl (*ub_code)(struct __parmblk *parmblock);
  272.         long      ub_parm;
  273. } USERBLK;
  274. #endif
  275.  
  276. typedef struct
  277. {
  278.     unsigned character   :    8;
  279.     signed   framesize   :    8;
  280.     unsigned framecol    :    4;
  281.     unsigned textcol     :    4;
  282.     unsigned textmode    :    1;
  283.     unsigned fillpattern :    3;
  284.     unsigned interiorcol :    4;
  285. } bfobspec;
  286.  
  287. typedef union
  288. {
  289.     long     index;
  290.     bfobspec obspec;
  291.     TEDINFO  *tedinfo;
  292.     ICONBLK  *iconblk;
  293.     BITBLK   *bitblk;
  294. #ifndef __STDC__
  295.     USERBLK *userblk;
  296. #endif
  297.     char    *free_string;
  298. } OBSPEC;
  299.  
  300.  
  301. typedef struct
  302. {
  303.         int             ob_next;        /* -> object's next sibling     */
  304.         int             ob_head;        /* -> head of object's children */
  305.         int             ob_tail;        /* -> tail of object's children */
  306.         unsigned int    ob_type;        /* object type: BOX, CHAR,...   */
  307.         unsigned int    ob_flags;       /* object flags                 */
  308.         unsigned int    ob_state;       /* state: SELECTED, OPEN, ...   */
  309.         OBSPEC          ob_spec;        /* "out": -> anything else      */
  310.         int             ob_x;           /* upper left corner of object  */
  311.         int             ob_y;           /* upper left corner of object  */
  312.         int             ob_width;       /* object width                 */
  313.         int             ob_height;      /* object height                */
  314. } OBJECT;
  315.  
  316.  
  317. typedef struct __parmblk
  318. {
  319.         OBJECT  *pb_tree;
  320.         int     pb_obj;
  321.         int     pb_prevstate;
  322.         int     pb_currstate;
  323.         int     pb_x, pb_y, pb_w, pb_h;
  324.         int     pb_xc, pb_yc, pb_wc, pb_hc;
  325.         long    pb_parm;
  326. } PARMBLK;
  327.  
  328.  
  329. /****** Menu definitions ************************************************/
  330.  
  331. int menu_bar( OBJECT *me_btree, int me_bshow );
  332. int menu_icheck( OBJECT *me_ctree, int me_citem, int me_ccheck );
  333. int menu_ienable( OBJECT *me_etree, int me_eitem,
  334.                   int me_eenable );
  335. int menu_tnormal( OBJECT *me_ntree, int me_ntitle,
  336.                   int me_nnormal );
  337. int menu_text( OBJECT *me_ttree, int me_titem,
  338.                const char *me_ttext );
  339. int menu_register( int me_rapid, const char *me_rpstring );
  340.  
  341.  
  342. /* Object prototypes */
  343.  
  344. int objc_add( OBJECT *ob_atree, int ob_aparent, int ob_achild );
  345. int objc_delete( OBJECT *ob_dltree, int ob_dlobject );
  346. int objc_draw( OBJECT *ob_drtree, int ob_drstartob,
  347.                int ob_drdepth, int ob_drxclip, int ob_dryclip,
  348.                int ob_drwclip, int ob_drhclip );
  349. int objc_find( OBJECT *ob_ftree, int ob_fstartob, int ob_fdepth,
  350.                int ob_fmx, int ob_fmy );
  351. int objc_offset( OBJECT *ob_oftree, int ob_ofobject,
  352.                  int *ob_ofxoff, int *ob_ofyoff );
  353. int objc_order( OBJECT *ob_ortree, int ob_orobject,
  354.                 int ob_ornewpos );
  355. int objc_edit( OBJECT *ob_edtree, int ob_edobject,
  356.                int ob_edchar, int *ob_edidx, int ob_edkind );
  357. int objc_change( OBJECT *ob_ctree, int ob_cobject,
  358.                  int ob_cresvd, int ob_cxclip, int ob_cyclip,
  359.                  int ob_cwclip, int ob_chclip,
  360.                  int ob_cnewstate, int ob_credraw );
  361.  
  362.  
  363. /****** Form definitions ************************************************/
  364.  
  365. #define FMD_START       0
  366. #define FMD_GROW        1
  367. #define FMD_SHRINK      2
  368. #define FMD_FINISH      3
  369.  
  370. int form_do( OBJECT *fo_dotree, int fo_dostartob );
  371. int form_dial( int fo_diflag, int fo_dilittlx,
  372.                int fo_dilittly, int fo_dilittlw,
  373.                int fo_dilittlh, int fo_dibigx,
  374.                int fo_dibigy, int fo_dibigw, int fo_dibigh );
  375. int form_alert( int fo_adefbttn, const char *fo_astring );
  376. int form_error( int fo_enum );
  377. int form_center( OBJECT *fo_ctree, int *fo_cx, int *fo_cy,
  378.                  int *fo_cw, int *fo_ch );
  379. int form_keybd( OBJECT *fo_ktree, int fo_kobject, int fo_kobnext,
  380.                 int fo_kchar, int *fo_knxtobject, int *fo_knxtchar );
  381. int form_button( OBJECT *fo_btree, int fo_bobject, int fo_bclicks,
  382.                 int *fo_bnxtobj );
  383.  
  384.  
  385. /****** Graph definitions ************************************************/
  386.  
  387.  
  388. /* Mouse forms */
  389.  
  390. #define ARROW             0
  391. #define TEXT_CRSR         1
  392. #define HOURGLASS         2
  393. #define BUSYBEE           2
  394. #define POINT_HAND        3
  395. #define FLAT_HAND         4
  396. #define THIN_CROSS        5
  397. #define THICK_CROSS       6
  398. #define OUTLN_CROSS       7
  399. #define USER_DEF        255
  400. #define M_OFF           256
  401. #define M_ON            257
  402.  
  403.  
  404. /* Mouse form definition block */
  405.  
  406. typedef struct mfstr
  407. {
  408.         int     mf_xhot;
  409.         int     mf_yhot;
  410.         int     mf_nplanes;
  411.         int     mf_fg;
  412.         int     mf_bg;
  413.         int     mf_mask[16];
  414.         int     mf_data[16];
  415. } MFORM;
  416.  
  417.  
  418. int graf_rubberbox( int gr_rx, int gr_ry, int gr_minwidth,
  419.                     int gr_minheight, int *gr_rlastwidth,
  420.                     int *gr_rlastheight );
  421. int graf_rubbox( int gr_rx, int gr_ry, int gr_minwidth,
  422.                     int gr_minheight, int *gr_rlastwidth,
  423.                     int *gr_rlastheight );
  424. int graf_dragbox( int gr_dwidth, int gr_dheight,
  425.                   int gr_dstartx, int gr_dstarty,
  426.                   int gr_dboundx, int gr_dboundy,
  427.                   int gr_dboundw, int gr_dboundh,
  428.                   int *gr_dfinishx, int *gr_dfinishy );
  429. int graf_movebox( int gr_mwidth, int gr_mheight,
  430.                   int gr_msourcex, int gr_msourcey,
  431.                   int gr_mdestx, int gr_mdesty );
  432. int graf_mbox( int gr_mwidth, int gr_mheight,
  433.                   int gr_msourcex, int gr_msourcey,
  434.                   int gr_mdestx, int gr_mdesty );
  435. int graf_growbox( int gr_gstx, int gr_gsty,
  436.                   int gr_gstwidth, int gr_gstheight,
  437.                   int gr_gfinx, int gr_gfiny,
  438.                   int gr_gfinwidth, int gr_gfinheight );
  439. int graf_shrinkbox( int gr_sfinx, int gr_sfiny,
  440.                     int gr_sfinwidth, int gr_sfinheight,
  441.                     int gr_sstx, int gr_ssty,
  442.                     int gr_sstwidth, int gr_sstheight );
  443. int graf_watchbox( OBJECT *gr_wptree, int gr_wobject,
  444.                    int gr_winstate, int gr_woutstate );
  445. int graf_slidebox( OBJECT *gr_slptree, int gr_slparent,
  446.                    int gr_slobject, int gr_slvh );
  447. int graf_handle( int *gr_hwchar, int *gr_hhchar,
  448.                  int *gr_hwbox, int *gr_hhbox );
  449. int graf_mouse( int gr_monumber, MFORM *gr_mofaddr );
  450. int graf_mkstate( int *gr_mkmx, int *gr_mkmy,
  451.                   int *gr_mkmstate, int *gr_mkkstate );
  452.  
  453.  
  454. /****** Scrap definitions ***********************************************/
  455.  
  456. int scrp_read( char *sc_rpscrap );
  457. int scrp_write( char *sc_wpscrap );
  458.  
  459.  
  460. /****** File selector definitions ***************************************/
  461.  
  462. int fsel_input( char *fs_iinpath, char *fs_iinsel,
  463.                 int *fs_iexbutton );
  464. int fsel_exinput( char *fs_einpath, char *fs_einsel,
  465.                 int *fs_eexbutton, char *fs_elabel );
  466.  
  467.  
  468. /****** Window definitions **********************************************/
  469.  
  470. #define NAME    0x0001
  471. #define CLOSER  0x0002
  472. #define FULLER  0x0004
  473. #define MOVER   0x0008
  474. #define INFO    0x0010
  475. #define SIZER   0x0020
  476. #define UPARROW 0x0040
  477. #define DNARROW 0x0080
  478. #define VSLIDE  0x0100
  479. #define LFARROW 0x0200
  480. #define RTARROW 0x0400
  481. #define HSLIDE  0x0800
  482.  
  483. #define WF_KIND                  1
  484. #define WF_NAME                  2
  485. #define WF_INFO                  3
  486. #define WF_WORKXYWH              4
  487. #define WF_CURRXYWH              5
  488. #define WF_PREVXYWH              6
  489. #define WF_FULLXYWH              7
  490. #define WF_HSLIDE                8
  491. #define WF_VSLIDE                9
  492. #define WF_TOP                  10
  493. #define WF_FIRSTXYWH            11
  494. #define WF_NEXTXYWH             12
  495. #define WF_RESVD                13
  496. #define WF_NEWDESK              14
  497. #define WF_HSLSIZE              15
  498. #define WF_VSLSIZE              16
  499. #define WF_SCREEN               17
  500.  
  501. #define WA_UPPAGE 0
  502. #define WA_DNPAGE 1
  503. #define WA_UPLINE 2
  504. #define WA_DNLINE 3
  505. #define WA_LFPAGE 4
  506. #define WA_RTPAGE 5
  507. #define WA_LFLINE 6
  508. #define WA_RTLINE 7
  509.  
  510. #define WC_BORDER 0                     /* wind calc flags */
  511. #define WC_WORK   1
  512.  
  513. #define END_UPDATE 0                    /* update flags */
  514. #define BEG_UPDATE 1
  515. #define END_MCTRL  2
  516. #define BEG_MCTRL  3
  517.  
  518.  
  519. int wind_create( int wi_crkind, int wi_crwx, int wi_crwy,
  520.                  int wi_crww, int wi_crwh );
  521. int wind_open( int wi_ohandle, int wi_owx, int wi_owy,
  522.                int wi_oww, int wi_owh );
  523. int wind_close( int wi_clhandle );
  524. int wind_delete( int wi_dhandle );
  525. int wind_get( int wi_ghandle, int wi_gfield, ... );
  526. int wind_set( int wi_shandle, int wi_sfield, ... );
  527. int wind_find( int wi_fmx, int wi_fmy );
  528. int wind_update( int wi_ubegend );
  529. int wind_calc( int wi_ctype, int wi_ckind, int wi_cinx,
  530.                int wi_ciny, int wi_cinw, int wi_cinh,
  531.                int *coutx, int *couty, int *coutw,
  532.                int *couth );
  533. void wind_new( void );
  534.  
  535.  
  536. /****** Resource definitions ********************************************/
  537.  
  538.                                 /* data structure types */
  539. #define R_TREE           0
  540. #define R_OBJECT         1
  541. #define R_TEDINFO        2
  542. #define R_ICONBLK        3
  543. #define R_BITBLK         4
  544. #define R_STRING         5              /* gets pointer to free strings */
  545. #define R_IMAGEDATA      6              /* gets pointer to free images */
  546. #define R_OBSPEC         7
  547. #define R_TEPTEXT        8              /* sub ptrs in TEDINFO */
  548. #define R_TEPTMPLT       9
  549. #define R_TEPVALID      10
  550. #define R_IBPMASK       11              /* sub ptrs in ICONBLK */
  551. #define R_IBPDATA       12
  552. #define R_IPBTEXT       13
  553. #define R_BIPDATA       14              /* sub ptrs in BITBLK */
  554. #define R_FRSTR         15              /* gets addr of ptr to free strings */
  555. #define R_FRIMG         16              /* gets addr of ptr to free images  */
  556.  
  557.                                 /* used in RSCREATE.C */
  558. typedef struct rshdr
  559. {
  560.         unsigned     rsh_vrsn;
  561.         unsigned     rsh_object;
  562.         unsigned     rsh_tedinfo;
  563.         unsigned     rsh_iconblk;    /* list of ICONBLKS */
  564.         unsigned     rsh_bitblk;
  565.         unsigned     rsh_frstr;
  566.         unsigned     rsh_string;
  567.         unsigned     rsh_imdata;     /* image data */
  568.         unsigned     rsh_frimg;
  569.         unsigned     rsh_trindex;
  570.         unsigned     rsh_nobs;       /* counts of various structs */
  571.         unsigned     rsh_ntree;
  572.         unsigned     rsh_nted;
  573.         unsigned     rsh_nib;
  574.         unsigned     rsh_nbb;
  575.         unsigned     rsh_nstring;
  576.         unsigned     rsh_nimages;
  577.         unsigned     rsh_rssize;     /* total bytes in resource */
  578. } RSHDR;
  579.  
  580. int rsrc_load( const char *re_lpfname );
  581. int rsrc_free( void );
  582. int rsrc_gaddr( int re_gtype, int re_gindex, void *gaddr );
  583. int rsrc_saddr( int re_stype, int re_sindex, void *saddr );
  584. int rsrc_obfix( OBJECT *re_otree, int re_oobject );
  585.  
  586.  
  587.  
  588. /****** Shell definitions ***********************************************/
  589. int shel_read( char *sh_rpcmd, char *sh_rptail );
  590. int shel_write( int sh_wdoex, int sh_wisgr, int sh_wiscr,
  591.                 char *sh_wpcmd, char *sh_wptail );
  592. int shel_get( char *sh_gaddr, int sh_glen );
  593. int shel_put( char *sh_paddr, int sh_plen );
  594. int shel_find( char *sh_fpbuff );
  595. int shel_envrn( char **sh_epvalue, char *sh_eparm );
  596.  
  597.  
  598. #endif
  599.  
  600. /************************************************************************/
  601.