home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / gemfut15 / gemfast.h < prev    next >
Text File  |  1990-05-27  |  14KB  |  364 lines

  1. /* tab expansion/compression should be set to 4 */
  2. /**************************************************************************
  3.  *
  4.  * GEMFAST.H - Header file for common VDI and AES symbols.    
  5.  *
  6.  *    This header file contains items compatible with both GEMDEFS and OBDEFS
  7.  *    from the Alcyon system.  Note that there are no 'extern' definitions
  8.  *    for the GEM functions, because they all return a signed int and work
  9.  *    fine as autodefined functions.
  10.  *
  11.  *    If you have a lot of source already coded for #include <gemdefs.h>,
  12.  *    you can create a dummy (empty) obdefs.h file, and code a new gemdefs.h
  13.  *    file which contains only #include <gemfast.h>.    YOU CAN NO LONGER USE
  14.  *    GEMDEFS AND OBDEFS WITH THE GEMFAST BINDINGS!  For the bindings libs
  15.  *    to work correctly, this header file must be used.  
  16.  *
  17.  * Credits dept:
  18.  *     This file bears an amazing similarity to the original Alcyon GEMDEFS
  19.  *     and OBDEFS header files, which are copyrighted by Atari.  What can I
  20.  *     say?  Copyrighted or not, these are the names and values that every-
  21.  *     body uses, so OF COURSE the files look *awful* similar...
  22.  *
  23.  * Maintenance:
  24.  *    12/03/89 - v1.3
  25.  *               > Renamed a lot of functions, a name compatibility block was
  26.  *                 added at the end of this file to smooth the transition.
  27.  *               > Added NO_OBJECT, MU_MENTRY, MU_MEXIT to defines.
  28.  *               > Added XMULTI struct, even though it really belongs to v2.0
  29.  *    05/26/90 - v1.4
  30.  *               > Added RSHDR structure for imbedded resource support.
  31.  *               > Fixed all structures which defined pointers as 'long'...
  32.  *                 - ICONBLK ib_pmask, ib_pdata, ib_ptext
  33.  *                 - BITBLK  bi_pdata
  34.  *                 - USERBLK ub_code
  35.  *                 - PARMBLK pb_tree
  36.  *                 All of these structure elements now define the proper ptr.
  37.  *               > Added AESUTIL_A, AESFAST_A and VDIFAST_A symbols.    This 
  38.  *                 allows specific indication of the presence or abscence of 
  39.  *                 the bindings libraries, allowing a programmer to use the
  40.  *                 GEMFAST.H header without using the rest of GemFast.  This
  41.  *                 also allows conditional compilation code to be more 
  42.  *                 specific:    it can now test for the presence of the header
  43.  *                 file (and handle the differences in the structure defs),
  44.  *                 and it can separately test for the presence of the libs,
  45.  *                 and the extended functions available therein.
  46.  *************************************************************************/
  47.  
  48. #ifndef GEMFAST_H                /* Prevent multiple inclusion */
  49.  
  50. #define GEMFAST_H        1        /* Tell the world GEMFAST header is used */
  51. #define GEMF_VERSION    0x0141    /* Tell the world we are v1.41             */
  52.  
  53. #define AESUTIL_A        1        /* Tell the world AESFAST utils  available */
  54. #define AESFAST_A        1        /* Tell the world AESFAST lib is available */
  55. #define VDIFAST_A        1        /* Tell the world VDIFAST lib is available */
  56.  
  57.                                 /* VDI inside fill styles - new names    */
  58.                                 
  59. #define VIS_HOLLOW    0            /* these names will be phased out soon... */
  60. #define VIS_SOLID    1
  61. #define VIS_PATTERN 2
  62. #define VIS_HATCH    3
  63. #define VIS_UDPTRN    4
  64.                                 /* VDI inside fill patterns - new names */
  65.                                 
  66. #define VIP_HOLLOW    0            /* these names will be phased out soon... */
  67. #define VIP_1PTRN    1
  68. #define VIP_2PTRN    2
  69. #define VIP_3PTRN    3
  70. #define VIP_4PTRN    4
  71. #define VIP_5PTRN    5
  72. #define VIP_6PTRN    6
  73. #define VIP_SOLID    7
  74.                                 /* VDI inside fill patterns  */
  75. #define IS_HOLLOW    0
  76. #define IS_SOLID    1
  77. #define IS_PATTERN    2
  78. #define IS_HATCH    3
  79. #define IS_UDPTRN    4
  80.                                 /* VDI inside fill patterns  */
  81. #define IP_HOLLOW    0
  82. #define IP_1PTRN    1
  83. #define IP_2PTRN    2
  84. #define IP_3PTRN    3
  85. #define IP_4PTRN    4
  86. #define IP_5PTRN    5
  87. #define IP_6PTRN    6
  88. #define IP_SOLID    7
  89.                                /* VDI normal graphics drawing modes */
  90. #define MD_REPLACE    1
  91. #define MD_TRANS    2
  92. #define MD_XOR        3
  93. #define MD_ERASE    4
  94.                                /* VDI bit blt rules */
  95. #define ALL_WHITE    0
  96. #define S_AND_D     1
  97. #define S_AND_NOTD    2
  98. #define S_ONLY        3
  99. #define NOTS_AND_D    4
  100. #define D_ONLY        5
  101. #define S_XOR_D     6
  102. #define S_OR_D        7
  103. #define NOT_SORD    8
  104. #define NOT_SXORD    9
  105. #define D_INVERT    10
  106. #define NOT_D        10
  107. #define S_OR_NOTD    11
  108. #define NOT_S        12
  109. #define NOTS_OR_D    13
  110. #define NOT_SANDD    14
  111. #define ALL_BLACK    15
  112.                                     /* font types */
  113. #define IBM         3
  114. #define SMALL        5
  115.                                     /* evnt_multi flags */
  116. #define MU_KEYBD    0x0001
  117. #define MU_BUTTON    0x0002
  118. #define MU_M1        0x0004
  119. #define MU_M2        0x0008
  120. #define MU_MESAG    0x0010
  121. #define MU_TIMER    0x0020
  122.                                     /* evnt_mouse flags */
  123. #define MU_MENTRY    0x0000
  124. #define MU_MEXIT    0x0001
  125.                                     /* keyboard states */
  126. #define K_RSHIFT    0x0001
  127. #define K_LSHIFT    0x0002
  128. #define K_CTRL        0x0004
  129. #define K_ALT        0x0008
  130.                                     /* event message values */
  131. #define MN_SELECTED 10
  132. #define WM_REDRAW    20
  133. #define WM_TOPPED    21
  134. #define WM_CLOSED    22
  135. #define WM_FULLED    23
  136. #define WM_ARROWED    24
  137. #define WM_HSLID    25
  138. #define WM_VSLID    26
  139. #define WM_SIZED    27
  140. #define WM_MOVED    28
  141. #define WM_NEWTOP    29
  142. #define AC_OPEN     40
  143. #define AC_CLOSE    41
  144.                                     /* form_dial opcodes/ijוåà⑥⇧⑨⇩ üכë≤②קE⌡5D⑤%@ôסó6FVfûµR⇦dקE⌠u$⌡pô⓪סó6FVfûµR⇦dקE⌡4à$öΣãô סó6FVfûµR⇦dקE⌠döΣò4Çô0סáÉÉÉÉÉÉÉÉÆ≥ó◆'7&5÷v⑥FG"◆7G'V7GW&R◆Gù╱W2⇩ó≡סó6FVf/* editable text justification */
  145. #define TE_LEFT     0
  146. #define TE_RIGHT    1
  147. #define TE_CNTR     2
  148.  
  149.                                 /* VDI Memory Form Definition Block */
  150.                              
  151. #ifndef FDADDR                    /* v1.3:  this typedef has been added to */
  152. typedef char *FDADDR;            /* help provide compatibility between     */
  153. #endif                            /* bindings systems.                     */
  154.  
  155. typedef struct fdbstr {
  156.     FDADDR    fd_addr;
  157.     int     fd_w;
  158.     int     fd_h;
  159.     int     fd_wdwidth;
  160.     int     fd_stand;
  161.     int     fd_nplanes;
  162.     int     fd_r1;
  163.     int     fd_r2;
  164.     int     fd_r3;
  165.     } FDB;      
  166.  
  167. #define MFDB    FDB                 /* MFDB added for Laser compatibily */
  168.  
  169.                                     /* Mouse Form Definition Block */
  170. typedef struct mfstr {
  171.     int mf_xhot;
  172.     int mf_yhot;
  173.     int mf_nplanes;
  174.     int mf_fg;
  175.     int mf_bg;
  176.     int mf_mask[16];
  177.     int mf_data[16];
  178.     } MFORM ;
  179.  
  180. typedef struct object {
  181.     int             ob_next;        /* -> object's next sibling     */
  182.     int             ob_head;        /* -> head of object's children */
  183.     int             ob_tail;        /* -> tail of object's children */
  184.     unsigned int    ob_type;        /* type of object                */
  185.     unsigned int    ob_flags;        /* flags                        */
  186.     unsigned int    ob_state;        /* state                        */
  187.     long            ob_spec;        /* whatever...                    */
  188.     int             ob_x;            /* upper left corner of object    */
  189.     int             ob_y;            /* upper left corner of object    */
  190.     int             ob_width;        /* width of obj                 */
  191.     int             ob_height;        /* height of obj                */
  192.     } OBJECT;
  193.  
  194. typedef struct grect {
  195.     int g_x;
  196.     int g_y;
  197.     int g_w;
  198.     int g_h;
  199.     } GRECT;
  200.  
  201. typedef struct vrect {
  202.     int v_x1;
  203.     int v_y1;
  204.     int v_x2;
  205.     int v_y2;
  206.     } VRECT;
  207.  
  208. typedef struct text_edinfo {
  209.     char *te_ptext;             /* ptr to text                 */
  210.     char *te_ptmplt;            /* ptr to template             */
  211.     char *te_pvalid;            /* ptr to validation chrs.     */
  212.     int  te_font;                /* font                      */
  213.     int  te_junk1;                /* junk word                 */
  214.     int  te_just;                /* justification             */
  215.     int  te_color;                /* color information word     */
  216.     int  te_junk2;                /* junk word                 */
  217.     int  te_thickness;            /* border thickness          */
  218.     int  te_txtlen;             /* length of text string     */
  219.     int  te_tmplen;             /* length of template string */
  220.     } TEDINFO;
  221.  
  222. typedef struct icon_block {
  223.     int  *ib_pmask;
  224.     int  *ib_pdata;
  225.     char *ib_ptext;
  226.     int  ib_char;
  227.     int  ib_xchar;
  228.     int  ib_ychar;
  229.     int  ib_xicon;
  230.     int  ib_yicon;
  231.     int  ib_wicon;
  232.     int  ib_hicon;
  233.     int  ib_xtext;
  234.     int  ib_ytext;
  235.     int  ib_wtext;
  236.     int  ib_htext;
  237.     } ICONBLK;
  238.  
  239. typedef struct bit_block {
  240.     int  *bi_pdata;                 /* ptr to bit forms data  */
  241.     int  bi_wb;                     /* width of form in bytes */
  242.     int  bi_hl;                     /* height in lines          */
  243.     int  bi_x;                        /* source x in bit form   */
  244.     int  bi_y;                        /* source y in bit form   */
  245.     int  bi_color;                    /* fg color of blt          */
  246.     } BITBLK;
  247.  
  248. typedef struct user_blk {
  249.     long (*ub_code)();
  250.     long ub_parm;
  251.     } USERBLK;
  252.  
  253. #define appl_blk user_blk
  254. #define APPLBLK  USERBLK
  255.  
  256. typedef struct parm_blk {
  257.     OBJECT    *pb_tree;
  258.     int     pb_obj;
  259.     int     pb_prevstate;
  260.     int     pb_currstate;
  261.     int     pb_x,  pb_y,  pb_w,  pb_h;
  262.     int     pb_xc, pb_yc, pb_wc, pb_hc;
  263.     long    pb_parm;
  264.     } PARMBLK;
  265.  
  266. /*-------------------------------------------------------------------------
  267.  * RSHDR structure...
  268.  *-----------------------------------------------------------------------*/
  269.  
  270. typedef struct rshdr {                                                     
  271.         int             rsh_vrsn;        /* Resource structure version # */
  272.         unsigned int    rsh_object;     /* Offset to first object        */
  273.         unsigned int    rsh_tedinfo;    /* Offset to first tedinfo        */
  274.         unsigned int    rsh_iconblk;    /* Offset to first iconblk        */
  275.         unsigned int    rsh_bitblk;     /* Offset to first bitblk        */
  276.         unsigned int    rsh_frstr;        /* Offset to free string index    */
  277.         unsigned int    rsh_string;     /* Offset to string data        */
  278.         unsigned int    rsh_imdata;     /* Offset to image data         */
  279.         unsigned int    rsh_frimg;        /* Offset to free image index    */
  280.         unsigned int    rsh_trindex;    /* Offset to tree index         */
  281.         unsigned int    rsh_nobs;        /* Number of objects            */
  282.         unsigned int    rsh_ntree;        /* Number object trees            */
  283.         unsigned int    rsh_nted;        /* Number of tedinfo structs    */
  284.         unsigned int    rsh_nib;        /* Number of iconblk structs    */
  285.         unsigned int    rsh_nbb;        /* Number of bitblk structs     */
  286.         unsigned int    rsh_nstring;    /* Number of free strings        */
  287.         unsigned int    rsh_nimages;    /* Number of free images        */
  288.         unsigned int    rsh_rssize;     /* total bytes in resource        */
  289.     } RSHDR;
  290.  
  291. #define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
  292.  
  293. /* ignore following structures, they're being set up for GEMFAST v2.0  - Ian */
  294.  
  295. typedef struct xmouse {
  296.     int retval;
  297.     int bclicks;
  298.     int mask;
  299.     int state;
  300.     int status;
  301.     int mousex;
  302.     int mousey;
  303.     int mouseb;
  304.     int keystate;
  305.     } XMOUSE;
  306.  
  307. typedef struct xmulti {
  308.     int     msgbuf[8];
  309.     int     mflags,
  310.             mbclicks,
  311.             mbmask,
  312.             mbstate,
  313.             mm1flags;
  314.     GRECT    mm1rect;
  315.     int     mm2flags;
  316.     GRECT    mm2rect;
  317.     int     mtlocount,
  318.             mthicount;
  319.     int     mwhich,
  320.             mmox,
  321.             mmoy,
  322.             mmobutton,
  323.             mmokstate,
  324.             mkreturn,
  325.             mbreturn;
  326. } XMULTI;
  327.  
  328. /**************************************************************************
  329.  *
  330.  * Name compatibility stuff.
  331.  *
  332.  *    05/26/90 - v1.4
  333.  *                Added mapping of find_exttype to obj_xtfind.
  334.  *    08/28/89 - v1.3
  335.  *                In v1.3, a big push has been made to make a consistant
  336.  *                naming standard for the AES utilities.    To avoid breaking
  337.  *                a lot of existing code, the following block will direct
  338.  *                the old names to the new routines.
  339.  *
  340.  *************************************************************************/
  341.  
  342. #define objclg_adjust            rc_gadjust
  343. #define objclv_adjust            rc_vadjust
  344.  
  345. #define objrb_which(a,b)        obj_rbfind((a),(b),SELECTED)
  346. #define obj_rbwhich(a,b)        obj_rbfind((a),(b),SELECTED)
  347. #define objxrb_which            obj_rbfind
  348.  
  349. #define objc_xywh                obj_xywh
  350.  
  351. #define find_exttype            obj_xtfind
  352.  
  353. #define objst_change            obj_stchange
  354. #define objfl_change            obj_flchange
  355.  
  356. #define graqon_mouse            gra_qonmouse
  357. #define graqof_mouse            gra_qofmouse
  358. #define graq_mstate             gra_qmstate
  359.  
  360. #endif
  361.  
  362. /*    end of GEMFAST.H */
  363.  
  364.