home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / MARK_WC2.LZH / INCLUDE / OBDEFS.H < prev    next >
C/C++ Source or Header  |  1988-04-27  |  5KB  |  203 lines

  1. /************************************************************************/
  2. /*    OBDEFS.H Common OBJECT definitions and structures.        */
  3. /*        Copyright 1985 Atari Corp.                */
  4. /*        Revisions Copyright 1987 Mark Williams Co.        */
  5. /************************************************************************/
  6.  
  7. #define ROOT 0
  8.                     /* max string length    */
  9. #define MAX_LEN 81
  10.                     /* max depth of search or draw    */
  11. #define MAX_DEPTH 8
  12.                     /* inside patterns    */
  13. #define IP_HOLLOW 0
  14. #define IP_1PATT 1
  15. #define IP_2PATT 2
  16. #define IP_3PATT 3
  17. #define IP_4PATT 4
  18. #define IP_5PATT 5
  19. #define IP_6PATT 6
  20. #define IP_SOLID 7
  21.                     /* gsx modes        */
  22. #define MD_REPLACE 1
  23. #define MD_TRANS   2
  24. #define MD_XOR     3
  25. #define MD_ERASE   4
  26.                     /* bit blt rules    */
  27. #define ALL_WHITE  0
  28. #define S_AND_D    1
  29. #define    S_AND_NOTD 2
  30. #define S_ONLY     3
  31. #define NOTS_AND_D 4
  32. #define    D_ONLY     5
  33. #define S_XOR_D    6
  34. #define S_OR_D     7
  35. #define    NOT_SORD   8
  36. #define    NOT_SXORD  9
  37. #define D_INVERT  10
  38. #define    NOT_D     11
  39. #define    S_OR_NOTD 12
  40. #define NOTS_OR_D 13
  41. #define    NOT_SANDD 14
  42. #define ALL_BLACK 15
  43.                     /* font types        */
  44. #define IBM 3
  45. #define SMALL 5
  46.                     /* Graphic types of obs    */
  47. #define G_BOX     20
  48. #define G_TEXT    21
  49. #define G_BOXTEXT 22
  50. #define G_IMAGE   23
  51. #define G_USERDEF 24            /* Some sources call this G_PROGDEF */
  52. #define G_IBOX    25
  53. #define G_BUTTON  26
  54. #define G_BOXCHAR 27
  55. #define G_STRING  28
  56. #define G_FTEXT   29
  57. #define G_FBOXTEXT 30
  58. #define G_ICON    31
  59. #define G_TITLE   32
  60.                     /* Object flags         */
  61. #define NONE       0x0
  62. #define SELECTABLE 0x1
  63. #define DEFAULT    0x2
  64. #define EXIT       0x4
  65. #define EDITABLE   0x8
  66. #define RBUTTON   0x10
  67. #define LASTOB    0x20
  68. #define TOUCHEXIT 0x40
  69. #define HIDETREE  0x80
  70. #define INDIRECT 0x100
  71.                     /* Object states    */
  72. #define NORMAL    0x0
  73. #define SELECTED  0x1
  74. #define CROSSED   0x2
  75. #define CHECKED   0x4
  76. #define DISABLED  0x8
  77. #define OUTLINED 0x10
  78. #define SHADOWED 0x20
  79.                     /* Object colors    */
  80. #define WHITE    0
  81. #define BLACK    1
  82. #define RED      2
  83. #define GREEN    3
  84. #define BLUE     4
  85. #define CYAN     5
  86. #define YELLOW   6
  87. #define MAGENTA  7
  88. #define LWHITE   8
  89. #define LBLACK   9
  90. #define LRED     10
  91. #define LGREEN   11
  92. #define LBLUE    12
  93. #define LCYAN    13
  94. #define LYELLOW  14
  95. #define LMAGENTA 15
  96.                     /* editable text field definitions */
  97. #define EDSTART 0
  98. #define EDINIT  1
  99. #define EDCHAR  2
  100. #define EDEND   3
  101.                     /* editable text justification      */
  102. #define TE_LEFT  0
  103. #define TE_RIGHT 1
  104. #define TE_CNTR  2
  105.  
  106. /*    Structure Definitions */
  107.  
  108. typedef struct object
  109. {
  110.     int        ob_next;    /* -> object's next sibling    */
  111.     int        ob_head;    /* -> head of object's children */
  112.     int        ob_tail;    /* -> tail of object's children */
  113.     unsigned int    ob_type;    /* type of object- BOX, CHAR,...*/
  114.     unsigned int    ob_flags;    /* flags            */
  115.     unsigned int    ob_state;    /* state- SELECTED, OPEN, ...    */
  116.     unsigned long    ob_spec;    /* "out"- -> anything else    */
  117.     int        ob_x;        /* upper left corner of object    */
  118.     int        ob_y;        /* upper left corner of object    */
  119.     int        ob_width;    /* width of obj            */
  120.     int        ob_height;    /* height of obj        */
  121. } OBJECT;
  122.  
  123.  
  124. typedef struct orect
  125. {
  126.     struct orect    *o_link;
  127.     int        o_x;
  128.     int        o_y;
  129.     int        o_w;
  130.     int        o_h;
  131. } ORECT;
  132.  
  133.  
  134. typedef struct grect
  135. {
  136.     int    g_x;
  137.     int    g_y;
  138.     int    g_w;
  139.     int    g_h;
  140. } GRECT;
  141.  
  142.  
  143. typedef struct text_edinfo
  144. {
  145.     unsigned char *    te_ptext;    /* ptr to text (must be 1st)    */
  146.     unsigned char *    te_ptmplt;    /* ptr to template        */
  147.     unsigned char *    te_pvalid;    /* ptr to validation chrs.    */
  148.     int        te_font;    /* font                */
  149.     int        te_junk1;    /* junk word            */
  150.     int        te_just;    /* justification- left, right...*/
  151.     int        te_color;    /* color information word    */
  152.     int        te_junk2;    /* junk word            */
  153.     int        te_thickness;    /* border thickness        */
  154.     int        te_txtlen;    /* length of text string    */
  155.     int        te_tmplen;    /* length of template string    */
  156. } TEDINFO;
  157.  
  158.  
  159. typedef struct icon_block
  160. {
  161.     int *    ib_pmask;
  162.     int *    ib_pdata;
  163.     char *    ib_ptext;
  164.     int    ib_char;
  165.     int    ib_xchar;
  166.     int    ib_ychar;
  167.     int    ib_xicon;
  168.     int    ib_yicon;
  169.     int    ib_wicon;
  170.     int    ib_hicon;
  171.     int    ib_xtext;
  172.     int    ib_ytext;
  173.     int    ib_wtext;
  174.     int    ib_htext;
  175. } ICONBLK;
  176.  
  177. typedef struct bit_block
  178. {
  179.     char *    bi_pdata;        /* ptr to bit forms data    */
  180.     int    bi_wb;            /* width of form in bytes    */
  181.     int    bi_hl;            /* height in lines        */
  182.     int    bi_x;            /* source x in bit form        */
  183.     int    bi_y;            /* source y in bit form        */
  184.     int    bi_color;        /* fg color of blt         */
  185. } BITBLK;
  186.  
  187. typedef struct user_blk
  188. {
  189.     int    (*ub_code)();
  190.     long    ub_parm;
  191. } USERBLK;                /* Some sources call this APPLBLK */
  192.  
  193. typedef struct parm_blk
  194. {
  195.     OBJECT *pb_tree;
  196.     int    pb_obj;
  197.     int    pb_prevstate;
  198.     int    pb_currstate;
  199.     int    pb_x, pb_y, pb_w, pb_h;
  200.     int    pb_xc, pb_yc, pb_wc, pb_hc;
  201.     long    pb_parm;
  202. } PARMBLK;
  203.