home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / utility / gemfut15.lzh / GEMFAST.H < prev    next >
C/C++ Source or Header  |  1990-05-27  |  14KB  |  501 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 */
  145. #define FMD_START    0
  146. #define FMD_GROW    1
  147. #define FMD_SHRINK    2
  148. #define FMD_FINISH    3
  149.                                     /* rsrc_gaddr structure types */
  150. #define ROOT        0                /* this name used by MWC */
  151. #define R_TREE        0 
  152. #define R_OBJECT    1
  153. #define R_TEDINFO    2
  154. #define R_ICONBLK    3
  155. #define R_BITBLK    4
  156. #define R_STRING    5
  157. #define R_IMAGEDATA 6
  158. #define R_OBSPEC    7
  159. #define R_TEPTEXT    8
  160. #define R_TEPTMPLT    9
  161. #define R_TEPVALID    10
  162. #define R_IBPMASK    11 
  163. #define R_IBPDATA    12     
  164. #define R_IBPTEXT    13
  165. #define R_BIPDATA    14
  166. #define R_FRSTR     15
  167. #define R_FRIMG     16 
  168.                                     /* Window Attributes */
  169. #define NAME        0x0001
  170. #define CLOSER        0x0002
  171. #define FULLER        0x0004
  172. #define MOVER        0x0008
  173. #define INFO        0x0010
  174. #define SIZER        0x0020
  175. #define UPARROW     0x0040
  176. #define DNARROW     0x0080
  177. #define VSLIDE        0x0100
  178. #define LFARROW     0x0200
  179. #define RTARROW     0x0400
  180. #define HSLIDE        0x0800
  181.                                     /* wind_calc flags */
  182. #define WC_BORDER    0
  183. #define WC_WORK     1
  184.                                     /* wind_get flags */
  185. #define WF_KIND     1
  186. #define WF_NAME     2
  187. #define WF_INFO     3
  188. #define WF_WORKXYWH 4
  189. #define WF_CURRXYWH 5
  190. #define WF_PREVXYWH 6
  191. #define WF_FULLXYWH 7
  192. #define WF_HSLIDE    8
  193. #define WF_VSLIDE    9
  194. #define WF_TOP        10
  195. #define WF_FIRSTXYWH 11
  196. #define WF_NEXTXYWH 12
  197. #define WF_RESVD    13
  198. #define WF_NEWDESK    14
  199. #define WF_HSLSIZE    15
  200. #define WF_VSLSIZE    16
  201. #define WF_SCREEN    17
  202.                                     /* wind_update flags */
  203. #define END_UPDATE    0
  204. #define BEG_UPDATE    1
  205. #define END_MCTRL    2
  206. #define BEG_MCTRL    3
  207.                                     /* graf_mouse mouse types*/
  208. #define ARROW        0
  209. #define TEXT_CRSR    1
  210. #define HOURGLASS    2                /* this name used by MWC (why?) */
  211. #define BUSY_BEE    2
  212. #define BEE         2
  213. #define POINT_HAND    3
  214. #define FLAT_HAND    4
  215. #define THIN_CROSS    5
  216. #define THICK_CROSS 6
  217. #define OUTLN_CROSS 7
  218. #define USER_DEF    255
  219. #define M_OFF        256
  220. #define M_ON        257
  221.                                 /* max depth of search or draw    */
  222. #define MAX_DEPTH    8
  223.                                 /* value returned by objc_find(), et. al. */
  224. #define NO_OBJECT    -1
  225.                                 /* object types */
  226. #define G_BOX        20
  227. #define G_TEXT        21
  228. #define G_BOXTEXT    22
  229. #define G_IMAGE     23
  230. #define G_USERDEF    24
  231. #define G_PROGDEF    24
  232. #define G_IBOX        25
  233. #define G_BUTTON    26
  234. #define G_BOXCHAR    27
  235. #define G_STRING    28
  236. #define G_FTEXT     29
  237. #define G_FBOXTEXT    30
  238. #define G_ICON        31
  239. #define G_TITLE     32
  240.                                 /* object flags */
  241. #define NONE        0x0000
  242. #define SELECTABLE    0x0001
  243. #define DEFAULT     0x0002
  244. #define EXIT        0x0004
  245. #define EDITABLE    0x0008
  246. #define RBUTTON     0x0010
  247. #define LASTOB        0x0020
  248. #define TOUCHEXIT    0x0040
  249. #define HIDETREE    0x0080
  250. #define INDIRECT    0x0100
  251.                                 /* Object states */
  252. #define NORMAL        0x0000
  253. #define SELECTED    0x0001
  254. #define CROSSED     0x0002
  255. #define CHECKED     0x0004
  256. #define DISABLED    0x0008
  257. #define OUTLINED    0x0010
  258. #define SHADOWED    0x0020
  259.                                 /* Object colors    */
  260. #define WHITE        0
  261. #define BLACK        1
  262. #define RED         2
  263. #define GREEN        3
  264. #define BLUE        4
  265. #define CYAN        5
  266. #define YELLOW        6
  267. #define MAGENTA     7
  268. #define LWHITE        8
  269. #define LBLACK        9
  270. #define LRED        10
  271. #define LGREEN        11
  272. #define LBLUE        12
  273. #define LCYAN        13
  274. #define LYELLOW     14
  275. #define LMAGENTA    15
  276.                                 /* editable text field definitions */
  277. #define EDSTART     0
  278. #define EDINIT        1
  279. #define EDCHAR        2
  280. #define EDEND        3
  281.                                 /* editable text justification */
  282. #define TE_LEFT     0
  283. #define TE_RIGHT    1
  284. #define TE_CNTR     2
  285.  
  286.                                 /* VDI Memory Form Definition Block */
  287.                              
  288. #ifndef FDADDR                    /* v1.3:  this typedef has been added to */
  289. typedef char *FDADDR;            /* help provide compatibility between     */
  290. #endif                            /* bindings systems.                     */
  291.  
  292. typedef struct fdbstr {
  293.     FDADDR    fd_addr;
  294.     int     fd_w;
  295.     int     fd_h;
  296.     int     fd_wdwidth;
  297.     int     fd_stand;
  298.     int     fd_nplanes;
  299.     int     fd_r1;
  300.     int     fd_r2;
  301.     int     fd_r3;
  302.     } FDB;      
  303.  
  304. #define MFDB    FDB                 /* MFDB added for Laser compatibily */
  305.  
  306.                                     /* Mouse Form Definition Block */
  307. typedef struct mfstr {
  308.     int mf_xhot;
  309.     int mf_yhot;
  310.     int mf_nplanes;
  311.     int mf_fg;
  312.     int mf_bg;
  313.     int mf_mask[16];
  314.     int mf_data[16];
  315.     } MFORM ;
  316.  
  317. typedef struct object {
  318.     int             ob_next;        /* -> object's next sibling     */
  319.     int             ob_head;        /* -> head of object's children */
  320.     int             ob_tail;        /* -> tail of object's children */
  321.     unsigned int    ob_type;        /* type of object                */
  322.     unsigned int    ob_flags;        /* flags                        */
  323.     unsigned int    ob_state;        /* state                        */
  324.     long            ob_spec;        /* whatever...                    */
  325.     int             ob_x;            /* upper left corner of object    */
  326.     int             ob_y;            /* upper left corner of object    */
  327.     int             ob_width;        /* width of obj                 */
  328.     int             ob_height;        /* height of obj                */
  329.     } OBJECT;
  330.  
  331. typedef struct grect {
  332.     int g_x;
  333.     int g_y;
  334.     int g_w;
  335.     int g_h;
  336.     } GRECT;
  337.  
  338. typedef struct vrect {
  339.     int v_x1;
  340.     int v_y1;
  341.     int v_x2;
  342.     int v_y2;
  343.     } VRECT;
  344.  
  345. typedef struct text_edinfo {
  346.     char *te_ptext;             /* ptr to text                 */
  347.     char *te_ptmplt;            /* ptr to template             */
  348.     char *te_pvalid;            /* ptr to validation chrs.     */
  349.     int  te_font;                /* font                      */
  350.     int  te_junk1;                /* junk word                 */
  351.     int  te_just;                /* justification             */
  352.     int  te_color;                /* color information word     */
  353.     int  te_junk2;                /* junk word                 */
  354.     int  te_thickness;            /* border thickness          */
  355.     int  te_txtlen;             /* length of text string     */
  356.     int  te_tmplen;             /* length of template string */
  357.     } TEDINFO;
  358.  
  359. typedef struct icon_block {
  360.     int  *ib_pmask;
  361.     int  *ib_pdata;
  362.     char *ib_ptext;
  363.     int  ib_char;
  364.     int  ib_xchar;
  365.     int  ib_ychar;
  366.     int  ib_xicon;
  367.     int  ib_yicon;
  368.     int  ib_wicon;
  369.     int  ib_hicon;
  370.     int  ib_xtext;
  371.     int  ib_ytext;
  372.     int  ib_wtext;
  373.     int  ib_htext;
  374.     } ICONBLK;
  375.  
  376. typedef struct bit_block {
  377.     int  *bi_pdata;                 /* ptr to bit forms data  */
  378.     int  bi_wb;                     /* width of form in bytes */
  379.     int  bi_hl;                     /* height in lines          */
  380.     int  bi_x;                        /* source x in bit form   */
  381.     int  bi_y;                        /* source y in bit form   */
  382.     int  bi_color;                    /* fg color of blt          */
  383.     } BITBLK;
  384.  
  385. typedef struct user_blk {
  386.     long (*ub_code)();
  387.     long ub_parm;
  388.     } USERBLK;
  389.  
  390. #define appl_blk user_blk
  391. #define APPLBLK  USERBLK
  392.  
  393. typedef struct parm_blk {
  394.     OBJECT    *pb_tree;
  395.     int     pb_obj;
  396.     int     pb_prevstate;
  397.     int     pb_currstate;
  398.     int     pb_x,  pb_y,  pb_w,  pb_h;
  399.     int     pb_xc, pb_yc, pb_wc, pb_hc;
  400.     long    pb_parm;
  401.     } PARMBLK;
  402.  
  403. /*-------------------------------------------------------------------------
  404.  * RSHDR structure...
  405.  *-----------------------------------------------------------------------*/
  406.  
  407. typedef struct rshdr {                                                     
  408.         int             rsh_vrsn;        /* Resource structure version # */
  409.         unsigned int    rsh_object;     /* Offset to first object        */
  410.         unsigned int    rsh_tedinfo;    /* Offset to first tedinfo        */
  411.         unsigned int    rsh_iconblk;    /* Offset to first iconblk        */
  412.         unsigned int    rsh_bitblk;     /* Offset to first bitblk        */
  413.         unsigned int    rsh_frstr;        /* Offset to free string index    */
  414.         unsigned int    rsh_string;     /* Offset to string data        */
  415.         unsigned int    rsh_imdata;     /* Offset to image data         */
  416.         unsigned int    rsh_frimg;        /* Offset to free image index    */
  417.         unsigned int    rsh_trindex;    /* Offset to tree index         */
  418.         unsigned int    rsh_nobs;        /* Number of objects            */
  419.         unsigned int    rsh_ntree;        /* Number object trees            */
  420.         unsigned int    rsh_nted;        /* Number of tedinfo structs    */
  421.         unsigned int    rsh_nib;        /* Number of iconblk structs    */
  422.         unsigned int    rsh_nbb;        /* Number of bitblk structs     */
  423.         unsigned int    rsh_nstring;    /* Number of free strings        */
  424.         unsigned int    rsh_nimages;    /* Number of free images        */
  425.         unsigned int    rsh_rssize;     /* total bytes in resource        */
  426.     } RSHDR;
  427.  
  428. #define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
  429.  
  430. /* ignore following structures, they're being set up for GEMFAST v2.0  - Ian */
  431.  
  432. typedef struct xmouse {
  433.     int retval;
  434.     int bclicks;
  435.     int mask;
  436.     int state;
  437.     int status;
  438.     int mousex;
  439.     int mousey;
  440.     int mouseb;
  441.     int keystate;
  442.     } XMOUSE;
  443.  
  444. typedef struct xmulti {
  445.     int     msgbuf[8];
  446.     int     mflags,
  447.             mbclicks,
  448.             mbmask,
  449.             mbstate,
  450.             mm1flags;
  451.     GRECT    mm1rect;
  452.     int     mm2flags;
  453.     GRECT    mm2rect;
  454.     int     mtlocount,
  455.             mthicount;
  456.     int     mwhich,
  457.             mmox,
  458.             mmoy,
  459.             mmobutton,
  460.             mmokstate,
  461.             mkreturn,
  462.             mbreturn;
  463. } XMULTI;
  464.  
  465. /**************************************************************************
  466.  *
  467.  * Name compatibility stuff.
  468.  *
  469.  *    05/26/90 - v1.4
  470.  *                Added mapping of find_exttype to obj_xtfind.
  471.  *    08/28/89 - v1.3
  472.  *                In v1.3, a big push has been made to make a consistant
  473.  *                naming standard for the AES utilities.    To avoid breaking
  474.  *                a lot of existing code, the following block will direct
  475.  *                the old names to the new routines.
  476.  *
  477.  *************************************************************************/
  478.  
  479. #define objclg_adjust            rc_gadjust
  480. #define objclv_adjust            rc_vadjust
  481.  
  482. #define objrb_which(a,b)        obj_rbfind((a),(b),SELECTED)
  483. #define obj_rbwhich(a,b)        obj_rbfind((a),(b),SELECTED)
  484. #define objxrb_which            obj_rbfind
  485.  
  486. #define objc_xywh                obj_xywh
  487.  
  488. #define find_exttype            obj_xtfind
  489.  
  490. #define objst_change            obj_stchange
  491. #define objfl_change            obj_flchange
  492.  
  493. #define graqon_mouse            gra_qonmouse
  494. #define graqof_mouse            gra_qofmouse
  495. #define graq_mstate             gra_qmstate
  496.  
  497. #endif
  498.  
  499. /*    end of GEMFAST.H */
  500.  
  501.