home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d911 / gadoutline.lha / GadOutline / Programmer / programmer.lha / Includes / libraries / gadoutline.h
C/C++ Source or Header  |  1993-07-28  |  128KB  |  3,016 lines

  1.  
  2. #ifndef LIBRARIES_GADOUTLINE_H
  3. #define LIBRARIES_GADOUTLINE_H
  4.  
  5. #ifndef EXEC_MEMORY_H
  6. #include <exec/memory.h>
  7. #endif
  8.  
  9. #ifndef INTUITION_GADGETCLASS_H
  10. #include <intuition/gadgetclass.h>
  11. #endif
  12.  
  13. #ifndef LIBRARIES_GADTOOLS_H
  14. #include <libraries/gadtools.h>
  15. #endif
  16.  
  17. /**
  18.  ** Command ID bit definitions.
  19.  **/
  20. typedef unsigned long CMDID;
  21.  
  22. #define STDID_STARTBIT (0)      // Standard ID code for command / gadget
  23. #define STDID_NUMBITS (10)
  24. #define GRPID_STARTBIT (12)     // Group ID code
  25. #define GRPID_NUMBITS (20)
  26.  
  27. // Bit allocation:
  28. //
  29. // 3  2    2    2    1    1    0    0    0
  30. // 1  8    4    0    6    2    8    4    0
  31. // GGGG GGGG GGGG GGGG GGGG xxSS SSSS SSSS
  32. //
  33. // G = Group ID bits
  34. // S = Standard ID bits
  35. // x = reserved.  always set to 0.
  36.  
  37. #define GETSTDID(cmdid) ((ULONG)( ( ((CMDID)(cmdid)) >> STDID_STARTBIT ) \
  38.                                   & ((1<<STDID_NUMBITS)-1) ))
  39. #define GETGRPID(cmdid) ((ULONG)( ( ((CMDID)(cmdid)) >> GRPID_STARTBIT ) \
  40.                                   & ((1<<GRPID_NUMBITS)-1) ))
  41.  
  42. #define GO_CMDID(grpid,stdid) \
  43.         ((CMDID)( (((ULONG)(grpid)&((1<<GRPID_NUMBITS)-1))<<GRPID_STARTBIT) \
  44.                 | (((ULONG)(stdid)&((1<<STDID_NUMBITS)-1))<<STDID_STARTBIT) \
  45.         ))
  46.  
  47. #define GO_GRPID_A  0x00100
  48. #define GO_GRPID_B  0x00200
  49. #define GO_GRPID_C  0x00400
  50. #define GO_GRPID_D  0x00800
  51. #define GO_GRPID_E  0x01000
  52. #define GO_GRPID_F  0x02000
  53. #define GO_GRPID_G  0x04000
  54. #define GO_GRPID_H  0x08000
  55. #define GO_GRPID_I  0x10000
  56. #define GO_GRPID_J  0x20000
  57. #define GO_GRPID_K  0x40000
  58. #define GO_GRPID_L  0x80000
  59.  
  60. #define GO_GRPID_MASK 0xFFF00
  61. #define GO_GRPID_CODE 0x000FF
  62.  
  63. /**
  64.  ** Definition for a standard weight distribution; used below.
  65.  **/
  66. typedef unsigned short WDIST;
  67.  
  68. #define LEFTDIST_STARTBIT (0)   // All leftover weight that's not used below:
  69. #define LEFTDIST_NUMBITS (2)
  70. #define SPCLDIST_STARTBIT (2)   // Weight of the last [below/right] space.
  71. #define SPCLDIST_NUMBITS (2)
  72. #define TXTLDIST_STARTBIT (4)   // Weight of the last [below/right] text.
  73. #define TXTLDIST_NUMBITS (2)
  74. #define BODYDIST_STARTBIT (6)   // Weight of the body.
  75. #define BODYDIST_NUMBITS (2)
  76. #define TXTFDIST_STARTBIT (8)   // Weight of the first [above/left] text.
  77. #define TXTFDIST_NUMBITS (2)
  78. #define SPCFDIST_STARTBIT (10)  // Weight of the first [above/left] space.
  79. #define SPCFDIST_NUMBITS (2)
  80.  
  81. // Bit allocation:
  82. //
  83. // 1  1    0    0    0
  84. // 5  2    8    4    0
  85. // xxxx SSTT bbtt ssLL
  86. //
  87. // S = Space above/left weight
  88. // T = Text above/left weight
  89. // B = Body weight
  90. // t = Text below/right weight
  91. // s = Space below/right weight
  92. // L = left over space [all space not used above.]
  93. // x = reserved.  always set to 0.
  94.  
  95. #define GETLEFTDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> LEFTDIST_STARTBIT ) \
  96.                                       & ((1<<LEFTDIST_NUMBITS)-1) ))
  97. #define GETSPCLDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> SPCLDIST_STARTBIT ) \
  98.                                       & ((1<<SPCLDIST_NUMBITS)-1) ))
  99. #define GETTXTLDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> TXTLDIST_STARTBIT ) \
  100.                                       & ((1<<TXTLDIST_NUMBITS)-1) ))
  101. #define GETBODYDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> BODYDIST_STARTBIT ) \
  102.                                       & ((1<<BODYDIST_NUMBITS)-1) ))
  103. #define GETTXTFDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> TXTFDIST_STARTBIT ) \
  104.                                       & ((1<<TXTFDIST_NUMBITS)-1) ))
  105. #define GETSPCFDIST(wdist)  ((UBYTE)( ( ((WDIST)(wdist)) >> SPCFDIST_STARTBIT ) \
  106.                                       & ((1<<SPCFDIST_NUMBITS)-1) ))
  107.  
  108. #define GO_WDIST(spcf,txtf,body,spcl,txtl,left) \
  109.         ((WDIST)( (((UWORD)(spcf)&((1<<SPCFDIST_NUMBITS)-1))<<SPCFDIST_STARTBIT) \
  110.                 | (((UWORD)(txtf)&((1<<TXTFDIST_NUMBITS)-1))<<TXTFDIST_STARTBIT) \
  111.                 | (((UWORD)(body)&((1<<BODYDIST_NUMBITS)-1))<<BODYDIST_STARTBIT) \
  112.                 | (((UWORD)(txtl)&((1<<TXTLDIST_NUMBITS)-1))<<TXTLDIST_STARTBIT) \
  113.                 | (((UWORD)(spcl)&((1<<SPCLDIST_NUMBITS)-1))<<SPCLDIST_STARTBIT) \
  114.                 | (((UWORD)(left)&((1<<LEFTDIST_NUMBITS)-1))<<LEFTDIST_STARTBIT) \
  115.         ))
  116.  
  117. /**
  118.  ** Definition for how much weight an object gets in a group.
  119.  **/
  120. typedef unsigned long WEIGHT;
  121.  
  122. #define BOXWGT_STARTBIT (0)     // Weight of this entire box.
  123. #define BOXWGT_NUMBITS (8)
  124. #define VERWGT_STARTBIT (8)     // Vertical distribution of weight.
  125. #define VERWGT_NUMBITS (12)
  126. #define HORWGT_STARTBIT (20)    // Horizontal distribution of weight.
  127. #define HORWGT_NUMBITS (12)
  128.  
  129. // Bit allocation:
  130. //
  131. // 3  2    2    2    1    1    0    0    0
  132. // 1  8    4    0    6    2    8    4    0
  133. // HHHH HHHH HHHH VVVV VVVV VVVV BBBB BBBB
  134. //
  135. // H = Horizonal weight distribution within box.  [Type WDIST]
  136. // V = Vertical weight distribution within box.  [Type WDIST]
  137. // B = Weight of entire box within its group.
  138. // x = reserved.  always set to 0.
  139.  
  140. #define GETBOXWGT(weight)   ((ULONG)( ( ((WEIGHT)(weight)) >> BOXWGT_STARTBIT ) \
  141.                                       & ((1<<BOXWGT_NUMBITS)-1) ))
  142. #define GETVERWGT(weight)   ((WDIST)( ( ((WEIGHT)(weight)) >> VERWGT_STARTBIT ) \
  143.                                       & ((1<<VERWGT_NUMBITS)-1) ))
  144. #define GETHORWGT(weight)   ((WDIST)( ( ((WEIGHT)(weight)) >> HORWGT_STARTBIT ) \
  145.                                       & ((1<<HORWGT_NUMBITS)-1) ))
  146.  
  147. #define GO_WEIGHT(horiz,vert,box) \
  148.         ((WEIGHT)( (((ULONG)(horiz)&((1<<HORWGT_NUMBITS)-1))<<HORWGT_STARTBIT) \
  149.                  | (((WDIST)(vert)&((1<<VERWGT_NUMBITS)-1))<<VERWGT_STARTBIT) \
  150.                  | (((WDIST)(box)&((1<<BOXWGT_NUMBITS)-1))<<BOXWGT_STARTBIT) \
  151.         ))
  152.  
  153. /**
  154.  ** Outline command definitions
  155.  **/
  156. typedef unsigned long OUTCMD;
  157.  
  158. #define CMDSUBC_STARTBIT (0)
  159. #define CMDSUBC_NUMBITS (16)
  160. #define CMDCODE_STARTBIT (16)
  161. #define CMDCODE_NUMBITS (4)
  162. #define CMDKIND_STARTBIT (20)
  163. #define CMDKIND_NUMBITS (4)
  164. #define CMDTAGS_STARTBIT (24)
  165. #define CMDTAGS_NUMBITS (2)
  166. #define CMDPARS_STARTBIT (28)
  167. #define CMDPARS_NUMBITS (3)
  168.  
  169. // Bit allocation:
  170. //
  171. // 3  2    2    2    1    1    0    0    0
  172. // 1  8    4    0    6    2    8    4    0
  173. // xPPP xxTT KKKK CCCC SSSS SSSS SSSS SSSS
  174. //
  175. // P = Command's number of parameters
  176. // T = Command's number of tag lists
  177. // K = Command's kind bits
  178. // C = Command's code bits
  179. // S = Command's sub-code bits
  180. // x = reserved.  always set to 0.
  181.  
  182. #define GETCMDPARS(outcmd)  ((ULONG)( ( ((OUTCMD)(outcmd)) >> CMDPARS_STARTBIT ) \
  183.                                       & ((1<<CMDPARS_NUMBITS)-1) ))
  184. #define GETCMDTAGS(outcmd)  ((ULONG)( ( ((OUTCMD)(outcmd)) >> CMDTAGS_STARTBIT ) \
  185.                                       & ((1<<CMDTAGS_NUMBITS)-1) ))
  186. #define GETCMDKIND(outcmd)  ((ULONG)( ( ((OUTCMD)(outcmd)) >> CMDKIND_STARTBIT ) \
  187.                                       & ((1<<CMDKIND_NUMBITS)-1) ))
  188. #define GETCMDCODE(outcmd)  ((ULONG)( ( ((OUTCMD)(outcmd)) >> CMDCODE_STARTBIT ) \
  189.                                       & ((1<<CMDCODE_NUMBITS)-1) ))
  190. #define GETCMDSUBC(outcmd)  ((ULONG)( ( ((OUTCMD)(outcmd)) >> CMDSUBC_STARTBIT ) \
  191.                                       & ((1<<CMDSUBC_NUMBITS)-1) ))
  192.  
  193. #define GO_OUTCMD(par,tag,kind,code,subc) \
  194.         ((OUTCMD)   ( (((ULONG)(par)&((1<<CMDPARS_NUMBITS)-1))<<CMDPARS_STARTBIT) \
  195.                     | (((ULONG)(tag)&((1<<CMDTAGS_NUMBITS)-1))<<CMDTAGS_STARTBIT) \
  196.                     | (((ULONG)(kind)&((1<<CMDKIND_NUMBITS)-1))<<CMDKIND_STARTBIT) \
  197.                     | (((ULONG)(code)&((1<<CMDCODE_NUMBITS)-1))<<CMDCODE_STARTBIT) \
  198.                     | (((ULONG)(subc)&((1<<CMDSUBC_NUMBITS)-1))<<CMDSUBC_STARTBIT) \
  199.         ))
  200.  
  201. // Bits describing major kinds.  The command kind determines what ci_CmdData
  202. // points to and the general meaning of the parameters and tag lists.
  203.  
  204. #define GOK_Illegal     0x0 // Illegal kind
  205. #define GOK_Box         0x1 // This is an actual box on the display.
  206.                             // ci_CmdData points to a BoxAttr structure.
  207.                             // The first two parameters are the same for all
  208.                             // codes; the rest are context sensitive to the
  209.                             // actual kind of object that is being created.
  210.                             // Parameters:
  211.                             //   1: CmdID - ID number; standard ID used in gadget.
  212.                             //   2: BoxWeight - How much extra space box gets.
  213.                             //   3: Text - GadTools text / Boopsi public class
  214.                             //             name / Custom parameter.
  215.                             //   4: Value - GadTools flags / Boopsi private class
  216.                             //              code / Custom parameter.
  217.                             // Tag Lists:
  218.                             //   1: Standard command tags applied to box.
  219.                             //   2: GadTools / Boopsi / Custom / Drawing tags.
  220. #define GOK_Image       0x2 // This is an image drawn on to the display.
  221.                             // ci_CmdData points to a BoxAttr structure.
  222.                             // The first two parameters are the same for all
  223.                             // codes; the rest are context sensitive to the
  224.                             // actual kind of object that is being created.
  225.                             // Parameters:
  226.                             //   1: CmdID - ID number; standard ID used in gadget.
  227.                             //   2: Reserved - Always set to 0.
  228.                             //   3: Text - GadTools text / Boopsi public class
  229.                             //             name / Custom parameter.
  230.                             //   4: Value - GadTools flags / Boopsi private class
  231.                             //              code / Custom parameter.
  232.                             // Tag Lists:
  233.                             //   1: Standard command tags applied to image.
  234.                             //   2: GadTools / Boopsi / Custom / Drawing tags.
  235. #define GOK_Object      0x3 // This is an object that is not a direct part of the
  236.                             // display.  ci_CmdData is currently NULL.
  237.                             // The first two parameters are the same for all
  238.                             // codes; the rest are context sensitive to the
  239.                             // actual kind of object that is being created.
  240.                             // Parameters:
  241.                             //   1: CmdID - ID number; standard ID used in gadget.
  242.                             //   2: Reserved - Always set to 0.
  243.                             //   3: Text - GadTools text / Boopsi public class
  244.                             //             name / Custom parameter.
  245.                             //   4: Value - GadTools flags / Boopsi private class
  246.                             //              code / Custom parameter.
  247.                             // Tag Lists:
  248.                             //   1: Standard command tags applied to image.
  249.                             //   2: GadTools / Boopsi / Custom / Drawing tags.
  250. #define GOK_Group       0x4 // Group control commands.  ci_CmdData points to
  251.                             // a standard BoxAttr structure.
  252.                             // Parameters:
  253.                             //   1: CmdID - ID number.
  254.                             //   2: GrpWeight - How much extra space grp box gets.
  255.                             // Tag Lists:
  256.                             //   1: Standard command tags
  257.                             //   2: (optional) List of drawing commands for group.
  258. #define GOK_Sys         0x5 // System control commands.
  259.                             // Parameters:
  260.                             //   1: CmdID - ID number.  Usually 0.
  261.                             // Tag Lists:
  262.                             //   None.
  263. #define GOK_Global      0x6 // Global settings commands.
  264.                             // Parameters:
  265.                             //   1: CmdID - ID number.
  266.                             // Tag Lists:
  267.                             //   Global tags to change.
  268. #define GOK_User        0x7 // User command.
  269.                             // Parameters:
  270.                             //   1:  CmdID - ID number.
  271.                             //   2-: Anything.
  272.                             // Tag Lists:
  273.                             //   Anything.
  274. #define GOK_LastDef     0x8 // Last outline kind that is defined.
  275.  
  276. // Bits descibing codes for box/image/object kind - GOK_Box/GOK_Image/GOK_Object.
  277. #define GOKB_Resv       0x0 // Reserved - do not use.
  278. #define GOKB_GadTools   0x1 // This is a standard gadtools gadget.
  279.                             // The 3rd parameter points to the gadget's label
  280.                             // text, the 4th contains the standard NewGadget
  281.                             // flags.  The SubCode field in the command is
  282.                             // the actual GadTools gadget kind to create.
  283. #define GOKB_Boopsi     0x2 // This is a BOOPSI object.
  284.                             // The 3rd parameter is a public class name, the
  285.                             // 4th is the ID for a private class.  These
  286.                             // parameters are directly associated with the
  287.                             // NewObject() call; one of them must be NULL.
  288.                             // See subcode definitions - GOSB_* - below.
  289. #define GOKB_Custom     0x3 // This is a custom object.
  290.                             // Everything after the first 2 parameters and
  291.                             // first tag list are available for whatever the
  292.                             // user wants.
  293. #define GOKB_Empty      0x4 // This is a an empty box.
  294. #define GOKB_Drawing    0x5 // This is a GadOutline drawing.  See subcode
  295.                             // definitions - GOSD_* - below.
  296.  
  297. // Bits descibing command codes for the group kind - GOK_Group.
  298. #define GOKG_Resvgrp    0x0 // Reserved - do not use.
  299. #define GOKG_Vertical   0x1 // Start a vertical group
  300. #define GOKG_Horizontal 0x2 // Start a horizontal group
  301.  
  302. // Bits descibing command codes for the system kind - GOK_System.
  303. #define GOKS_Resv       0x0 // Reserved - do not use.
  304. #define GOKS_EndGroup   0x1 // End the current group.
  305. #define GOKS_EndOutline 0x2 // End the entire outline.
  306.  
  307. // Bits descibing command codes for the global kind - GOK_Global.
  308. #define GOKG_Resvglb    0x0 // Reserved - do not use.
  309. #define GOKG_Outline    0x1 // Set global outline tags.  [ie GOA_*]
  310. #define GOKG_Command    0x2 // Set global command tags.  [ie GOCT_*]
  311. #define GOKG_Object     0x3 // Set global object tags.  [object dependant]
  312.                             // NOT IMPLEMENTED ^^
  313. #define GOKG_Screen     0x4 // Set standard screen tags.  [ie SA_*]
  314. #define GOKG_Window     0x5 // Set standard window tags.  [ie WA_*]
  315.  
  316. // Bits describing subcode for drawing code.
  317. #define GOSD_Normal     0x1 // Just a normal drawing.
  318. #define GOSD_Button     0x2 // Drawing with a highlight button.
  319. #define GOSD_BoopsiIm   0x3 // Create a BOOPSI image object.
  320. #define GOSD_BoopsiGad  0x4 // Create a full BOOPSI gadget.
  321.  
  322. // Bits describing subcode for BOOPSI code.
  323. #define GOSB_Object     0x1 // A generic object
  324. #define GOSB_Image      0x2 // A type of image class.
  325. #define GOSB_Gadget     0x3 // A type of gadget class.
  326. #define GOSB_AddGad     0x3 // A type of gadget class, added to go_BoopsiGList.
  327.  
  328. // ---------------------------------
  329. // Standard box creation commands
  330. // ---------------------------------
  331.  
  332. #define GO_GTBOX(gadkind,grpid,stdid,weight,name,flags) \
  333.         GO_OUTCMD(4,2,GOK_Box,GOKB_GadTools,gadkind), \
  334.         GO_CMDID(grpid,stdid),weight,name,flags
  335.         // 4 arguents; 2 tag lists
  336.  
  337. #define GO_DRAWBOX(type,grpid,stdid,weight) \
  338.         GO_OUTCMD(2,2,GOK_Box,GOKB_Drawing,type), \
  339.         GO_CMDID(grpid,stdid),weight
  340.         // 2 arguents; 2 tag lists
  341.  
  342. #define GO_BOOPSIBOX(type,grpid,stdid,weight,classname,classid) \
  343.         GO_OUTCMD(4,2,GOK_Box,GOKB_Boopsi,type), \
  344.         GO_CMDID(grpid,stdid),weight,classname,classid
  345.         // 4 arguents; 2 tag lists
  346.  
  347. #define GO_CUSTBOX(numparam,numtags,subcode,grpid,stdid,weight) \
  348.         GO_OUTCMD(numparam-2,numtags,GOK_Box,GOKB_Custom,subcode), \
  349.         GO_CMDID(grpid,stdid),weight
  350.  
  351. #define GO_EMPTYBOX(grpid,stdid,weight) \
  352.         GO_OUTCMD(2,1,GOK_Box,GOKB_Empty,0),GO_CMDID(grpid,stdid),weight
  353.         // 2 arguents; 1 tag list
  354.  
  355. // ---------------------------------
  356. // Standard image creation commands
  357. // ---------------------------------
  358.  
  359. #define GO_GTIMAGE(gadkind,grpid,stdid,name,flags) \
  360.         GO_OUTCMD(4,2,GOK_Image,GOKB_GadTools,gadkind), \
  361.         GO_CMDID(grpid,stdid),0,name,flags
  362.         // 4 arguents; 2 tag lists
  363.  
  364. #define GO_DRAWIMAGE(type,grpid,stdid) \
  365.         GO_OUTCMD(2,2,GOK_Image,GOKB_Drawing,type), \
  366.         GO_CMDID(grpid,stdid),0
  367.         // 2 arguents; 2 tag lists
  368.  
  369. #define GO_BOOPSIIMAGE(type,grpid,stdid,classname,classid) \
  370.         GO_OUTCMD(4,2,GOK_Image,GOKB_Boopsi,type), \
  371.         GO_CMDID(grpid,stdid),0,classname,classid
  372.         // 4 arguents; 2 tag lists
  373.  
  374. #define GO_CUSTIMAGE(numparam,numtags,subcode,grpid,stdid) \
  375.         GO_OUTCMD(numparam-2,numtags,GOK_Image,GOKB_Custom,subcode), \
  376.         GO_CMDID(grpid,stdid),0
  377.  
  378. #define GO_EMPTYIMAGE(grpid,stdid) \
  379.         GO_OUTCMD(2,1,GOK_Image,GOKB_Empty,0),GO_CMDID(grpid,stdid),0
  380.         // 2 arguents; 1 tag list
  381.  
  382. // ---------------------------------
  383. // Standard object creation commands
  384. // ---------------------------------
  385.  
  386. #define GO_BOOPSIOBJ(type,grpid,stdid,classname,classid) \
  387.         GO_OUTCMD(3,2,GOK_Object,GOKB_Boopsi,type), \
  388.         GO_CMDID(grpid,stdid),classname,classid
  389.         // 3 arguents; 2 tag lists
  390.  
  391. // ---------------------------------
  392. // Standard group creation commands
  393. // ---------------------------------
  394.  
  395. #define GO_HORIZGRP(grpid,stdid,weight) \
  396.         GO_OUTCMD(2,1,GOK_Group,GOKG_Horizontal,0),GO_CMDID(grpid,stdid),weight
  397.         // 2 arguents; 1 tag list
  398.  
  399. #define GO_VERTGRP(grpid,stdid,weight) \
  400.         GO_OUTCMD(2,1,GOK_Group,GOKG_Vertical,0),GO_CMDID(grpid,stdid),weight
  401.         // 2 arguents; 1 tag list
  402.  
  403. #define GO_HDRAWGRP(grpid,stdid,weight) \
  404.         GO_OUTCMD(2,2,GOK_Group,GOKG_Horizontal,GOSD_Normal), \
  405.         GO_CMDID(grpid,stdid),weight
  406.         // 2 arguents; 2 tag lists
  407.  
  408. #define GO_VDRAWGRP(grpid,stdid,weight) \
  409.         GO_OUTCMD(2,2,GOK_Group,GOKG_Vertical,GOSD_Normal), \
  410.         GO_CMDID(grpid,stdid),weight
  411.         // 2 arguents; 2 tag lists
  412.  
  413. // ---------------------------------
  414. // Standard system commands
  415. // ---------------------------------
  416.  
  417. #define GO_ENDGRP() GO_OUTCMD(0,0,GOK_Sys,GOKS_EndGroup,0)
  418.  
  419. #define GO_ENDOUTLINE() GO_OUTCMD(0,0,GOK_Sys,GOKS_EndOutline,0)
  420.  
  421. // ---------------------------------
  422. // Standard global commands
  423. // ---------------------------------
  424.  
  425. #define GO_OUTLINETAGS(grpid,stdid) \
  426.         GO_OUTCMD(1,2,GOK_Global,GOKG_Outline,0),GO_CMDID(grpid,stdid)
  427.         // 1 arguent; 2 tag lists
  428.  
  429. #define GO_COMMANDTAGS(grpid,stdid) \
  430.         GO_OUTCMD(1,2,GOK_Global,GOKG_Command,0),GO_CMDID(grpid,stdid)
  431.         // 1 arguent; 2 tag lists
  432.  
  433. #define GO_OBJECTTAGS(grpid,stdid) \
  434.         GO_OUTCMD(1,2,GOK_Global,GOKG_Object,0),GO_CMDID(grpid,stdid)
  435.         // 1 arguent; 2 tag lists
  436.  
  437. #define GO_SCREENTAGS(grpid,stdid) \
  438.         GO_OUTCMD(1,2,GOK_Global,GOKG_Screen,0),GO_CMDID(grpid,stdid)
  439.         // 1 arguent; 2 tag lists
  440.  
  441. #define GO_WINDOWTAGS(grpid,stdid) \
  442.         GO_OUTCMD(1,2,GOK_Global,GOKG_Window,0),GO_CMDID(grpid,stdid)
  443.         // 1 arguent; 2 tag lists
  444.  
  445. /**
  446.  ** This is the main structure which is created for every command in the
  447.  ** outline.
  448.  **/
  449. struct CmdInfo {
  450.     struct Node ci_Node;        // Private linking.  DO NOT TOUCH.
  451.     UWORD pad0;                 // LONG-align.  DO NOT TOUCH.
  452.     
  453.     // These fields should only be looked at.
  454.     struct GadOutline *ci_GadOutline;   // Link back to global data.
  455.     OUTCMD ci_Command;          // Actual command code; see outline
  456.                                 // command definitions.
  457.     CMDID ci_CmdID;             // Standard and Group ID codes for this command.
  458.                                 // Always the first command parameter.
  459.  
  460.     // These fields should only be looked at by the application and may be
  461.     // looked at and modified by the command's hook.
  462.     void *ci_Object;            // Command's created object.  (ie, a Gadget)
  463.                                 // Set to NULL when the object has not
  464.                                 // been created yet or failed creation.
  465.     ULONG ci_ObjIDCMP;          // The IDCMP messages this object needs.
  466.  
  467.     // All of the following fields should only be looked at.
  468.     
  469.     union {                         // More detailed data for specific commands.
  470.         void *ci_CmdData;           // Generic data.
  471.         struct BoxAttr *ci_BoxAttr; // Created by GOK_Box kind.
  472.     };
  473.  
  474.     union {                     // Parameters copied from outline.
  475.  
  476.         ULONG ci_Params[7];     // Generic view of parameters.
  477.  
  478.         struct {                    // GOK_Box
  479.             ULONG ci_BoxWeight;     // Raw weight for extra space box uses
  480.             UBYTE *ci_BoxText;      // Text label / boopsi class name for the box
  481.             ULONG ci_BoxValue;      // GadTools NewGadget flags / boopsi class id
  482.         } ci_BoxParams;
  483.  
  484.         struct {                    // GOK_Image
  485.             ULONG ci_ImageResv;     // Currently unused.  Always set to 0.
  486.             UBYTE *ci_ImageText;    // Boopsi class name for the image
  487.             ULONG ci_ImageValue;    // Boopsi class id for the image
  488.         } ci_ImageParams;
  489.  
  490.         struct {                    // GOK_Object
  491.             ULONG ci_ObjectResv;    // Currently unused.  Always set to 0.
  492.             UBYTE *ci_ObjectText;   // Boopsi class name for the object
  493.             ULONG ci_ObjectValue;   // Boopsi class id for the object
  494.         } ci_ObjectParams;
  495.  
  496.         struct {                    // GOK_Group
  497.             ULONG ci_GrpWeight;     // Raw weight for extra space group uses
  498.         } ci_GroupParams;
  499.     };
  500.  
  501.     // These tag lists are copied from the outline.  They should only be
  502.     // modified by the command's hook, and only individual elements of
  503.     // the tag array may be modified.
  504.  
  505.     struct TagItem *ci_CmdTags;         // Command tags supplied in the outline.
  506.     union {
  507.         struct TagItem *ci_Tags[3];     // Generic view of tag lists
  508.         struct TagItem *ci_GadToolsTags;// GadTools standard tags
  509.         struct TagItem *ci_BoopsiTags;  // Boopsi class tags
  510.         struct TagItem *ci_DrawingTags; // Drawing class tags
  511.         struct TagItem *ci_GlobalTags;  // Global tags set with GOK_Global
  512.     };
  513.  
  514.     void *ci_UserHookData;              // For any use by user hook.
  515.     ULONG ci_UserHookState;             // Likewise.
  516.  
  517. };  /* There is private data after this structure */
  518.  
  519. struct BoxAttr {
  520.     struct Node ba_Node;                // Private linking.  DO NOT TOUCH.
  521.     UWORD pad0;                         // LONG-align.  DO NOT TOUCH.
  522.  
  523.     // The rest of these fields are 100% read-only.
  524.     
  525.     struct CmdInfo *ba_CmdInfo;         // The command that created this box.
  526.  
  527.     struct BoxPosInfo *ba_BoxPosInfo;   // If requested, the full box dimens.
  528.  
  529.     WORD ba_BoxLeft,ba_BoxTop;          // Absolute LeftEdge and TopEdge of box.
  530.     WORD ba_BoxWidth,ba_BoxHeight;      // Total Width and Height of box.
  531.  
  532.     WORD ba_BodyLeft,ba_BodyTop;        // Absolute LeftEdge and TopEdge of body.
  533.  
  534.     WORD ba_SpaceLeft,ba_TextLeft;      // Final x dimensions of box
  535.     WORD ba_BodyWidth;
  536.     WORD ba_TextRight,ba_SpaceRight;
  537.  
  538.     WORD ba_SpaceAbove,ba_TextAbove;    // Final y dimensions of box
  539.     WORD ba_BodyHeight;
  540.     WORD ba_TextBelow,ba_SpaceBelow;
  541.  
  542. };  /* There is private data after this structure */
  543.  
  544. // The ExecMessage structure within the standard IntuiMessage is
  545. // reserved for use by the library.  Do not touch in any way, shape or form. :)
  546.  
  547. struct GOIMsg {
  548.     struct IntuiMessage StdIMsg;    // Standard Intuition message.
  549.     UBYTE KeyPress[8];              // Translated RAWKEY event.
  550.     ULONG UserData;                 // For any use by user.
  551. };  /* There is private data after this structure */
  552.  
  553. /**
  554.  ** These are the messages that can be sent to the command's call back.  Most
  555.  ** of the gadget operations are implemented in the callback, including
  556.  ** all of the code to create and destroy gadgets, change their attributes,
  557.  ** implement hot keys, and keeping track of their state.  The hook is
  558.  ** passed the CmdInfo structure as its object, and a CmdHookMsg structure
  559.  ** as its parameters.  The function should always return 0 unless otherwise
  560.  ** indicated.
  561.  **/
  562.  
  563. #define CHM_INITIALIZE      TAG_USER+1  // Initalizing object - allocate resources
  564. #define CHM_INITCMDATTR     TAG_USER+2  // Parse initial command attributes
  565.                                         // arg 1 = startup command tag list
  566. #define CHM_INITOBJATTR     TAG_USER+3  // Parse initial object attributes
  567.                                         // arg 1 = startup object tag list
  568. #define CHM_TERMINATE       TAG_USER+4  // Terminating - free resources
  569. #define CHM_GETMINDIMENS    TAG_USER+5  // Ask object its minimum size
  570.                                         // arg 1 = pointer to GODimensInfo
  571.                                         //       which is to be filled in.
  572. #define CHM_CREATEOBJ       TAG_USER+6  // Allocating a new object, restore state
  573.                                         // arg 1 = Initialized NewGadget struct
  574. #define CHM_MADELINK        TAG_USER+7  // A object was just created which
  575.                                         // has a link to this object.
  576.                                         // arg 1 = CmdInfo * to linker.
  577.                                         // arg 2 = tag which points to us.
  578. #define CHM_DESTROYOBJ      TAG_USER+8  // Free current object, save state.  Be
  579.                                         // prepared to recieve this without a
  580.                                         // matching CHM_CREATEOBJ.
  581. #define CHM_HOOKOBJ         TAG_USER+9  // Added object to window.
  582. #define CHM_UNHOOKOBJ       TAG_USER+10 // Removing object from window.  Be
  583.                                         // prepared to recieve this without a
  584.                                         // matching CHM_HOOKOBJ.
  585. #define CHM_PRERESIZE       TAG_USER+11 // Set up to resize object.  For GadTools
  586.                                         // gadgets, this involves setting
  587.                                         // ci_Object to NULL because the library
  588.                                         // will free the gadtools list.  Other
  589.                                         // object may need to deallocate here
  590.                                         // too, if they can't resize.
  591. #define CHM_RESIZEOBJ       TAG_USER+12 // Resizing current object.
  592.                                         // arg 1 = Initialized NewGadget struct
  593. #define CHM_DRAWSELF        TAG_USER+13 // Redraw object imagery.
  594. #define CHM_UPDATESTATE     TAG_USER+14 // Update state from IntuiMessage
  595.                                         // arg 1 = COPY of GOIMsg received
  596. #define CHM_SETCMDATTR      TAG_USER+15 // User changing command attributes
  597.                                         // arg 1 = TagList with new values
  598. #define CHM_GETCMDATTR      TAG_USER+16 // User request for current cmd state
  599.                                         // arg 1 = TagList to fill in
  600. #define CHM_SETOBJATTR      TAG_USER+17 // User changing object attributes
  601.                                         // arg 1 = TagList with new values
  602. #define CHM_GETOBJATTR      TAG_USER+18 // User request for current obj state
  603.                                         // arg 1 = TagList to fill in
  604. #define CHM_HOTKEY          TAG_USER+19 // Perform hotkey operation
  605.                                         // arg 1 = COPY of GOIMsg received
  606.  
  607. // These are the translation commands.  The default is to just return
  608. // the same code that is sent -- ie, the original code was already an
  609. // actual string address.
  610. // The ULONG code to translate is passed as the first message argument 
  611. // for most of these.
  612.  
  613. #define CHM_TRANSCMDHOOK    TAG_USER+50 // Translate a hook pointer supplied
  614.                                         // with GOCT_SetUserHook tag.  Should
  615.                                         // return the address of a hook struct.
  616. #define CHM_TRANSEDITHOOK   TAG_USER+51 // Translate a hook pointer supplied
  617.                                         // as a gadget's edit hook.  Should
  618.                                         // return the address of a hook struct.
  619.  
  620. #define CHM_TRANSTEXTPTR    TAG_USER+52 // Translate a text string code
  621.                                         // supplied in outline.  Should
  622.                                         // return the address of a string.
  623. #define CHM_TRANSTEXTARRAY  TAG_USER+53 // Translate a text array code
  624.                                         // supplied in outline.  Should
  625.                                         // return the address of a NULL
  626.                                         // terminated array of string pointers.
  627. #define CHM_TRANSTEXTFMT    TAG_USER+54 // Translate a text level format code
  628.                                         // supplied in outline.  Should
  629.                                         // return the address of a standard
  630.                                         // C-Style formatting string as used
  631.                                         // in GadTools slides, etc.
  632.  
  633. #define CHM_TRANSPUBCLASS   TAG_USER+55 // Translate a BOOPSI public class
  634.                                         // name.  Should return a pointer
  635.                                         // to a string with the class's name.
  636. #define CHM_TRANSPRIVCLASS  TAG_USER+56 // Translate a BOOPSI private class
  637.                                         // code.  Should return a pointer
  638.                                         // to a private BOOPSI class.
  639.  
  640. #define CHM_TRANSHOTKEY     TAG_USER+57 // Translate a hotkey code into the
  641.                                         // actual key event.  You will be
  642.                                         // given a ULONG hotkey code, which
  643.                                         // the builtin translation hook
  644.                                         // interprets as an ASCII character
  645.                                         // in the lower byte and various flags
  646.                                         // in the high bits.  You should return
  647.                                         // an ASCII character for the hotkey;
  648.                                         // the library will continue querrying
  649.                                         // you for hotkeys until you return 0.
  650.                                         // You are free to use the upper word
  651.                                         // of the result for state information,
  652.                                         // however always make sure the lower
  653.                                         // word is an actual ASCII value.
  654.                                         // [Ie, the upper byte is zero.]
  655.  
  656. // Every number after this is for private use by the caller's custom hook.
  657. #define CHM_USER            (TAG_USER+0x4000)
  658.  
  659. struct CmdHookMsg {
  660.     ULONG chm_Message;                  // Actual message code; one of above
  661.     ULONG chm_NumArgs;                  // For future expansion.  Always set
  662.                                         // to zero.
  663.  
  664.     union {                             // Parameters
  665.     
  666.         struct {                            // CHM_GETMINDIMENS
  667.             struct GODimensInfo*chm_MinDim; // to be filled in by the hook
  668.                                             // all values start at zero
  669.         } chm_GetMinDimens;
  670.  
  671.         struct {                            // CHM_CREATEOBJ
  672.             struct NewGadget*chm_NewGadget; // Filled in NewGadget, ready to go.
  673.         } chm_CreateObj;
  674.  
  675.         struct {                            // CHM_MADELINK
  676.             struct CmdInfo *chm_LinkCmd;    // Command which contains link
  677.             struct TagItem *chm_LinkTag;    // The tag which points to us.
  678.         } chm_MadeLink;
  679.  
  680.         struct {                            // CHM_RESIZEOBJ
  681.             struct NewGadget*chm_ResGadget; // Filled in NewGadget, ready to go.
  682.         } chm_ResizeObj;
  683.  
  684.         struct {                            // CHM_UPDATESTATE
  685.             struct GOIMsg *chm_StateGOIMsg; // message to update from
  686.         } chm_UpdateState;
  687.  
  688.         struct {                            // CHM_SETCMDATTR/CHM_INITCMDATTR
  689.             struct TagItem *chm_SetCmdTags; // New values for ci_CmdTags
  690.         } chm_SetCmdAttr;
  691.  
  692.         struct {                            // CHM_GETCMDATTR
  693.             struct TagItem *chm_GetCmdTags; // Tags to fill in ti_Data of
  694.         } chm_GetCmdAttr;
  695.  
  696.         struct {                            // CHM_SETOBJATTR/CHM_INITOBJATTR
  697.             struct TagItem *chm_SetObjTags; // New values for ci_ObjectTags
  698.         } chm_SetObjAttr;
  699.  
  700.         struct {                            // CHM_GETOBJATTR
  701.             struct TagItem *chm_GetObjTags; // Tags to fill in ti_Data of
  702.         } chm_GetObjAttr;
  703.  
  704.         struct {                            // CHM_HOTKEY
  705.             struct GOIMsg *chm_KeyGOIMsg;   // message that triggered call
  706.         } chm_HotKey;
  707.  
  708.         struct {                            // CHM_TRANS* messages
  709.             ULONG chm_TransCode;            // code to translate
  710.             struct CmdInfo *chm_TransCmd;   // If not NULL, the command
  711.                                             // generating this event.
  712.         } chm_Translate;
  713.  
  714.         struct {                            // CHM_TRANSHOTKEY message
  715.             ULONG chm_HotKeyCode;           // code to translate
  716.             ULONG chm_PrevHotKey;           // previous value you returned, or
  717.                                             // 0 if this is the first time.
  718.         } chm_TransHotKey;
  719.  
  720.     };
  721. };
  722.  
  723. struct GODimensInfo {
  724.     
  725.     // Bare minimum values we can take.
  726.     WORD gdi_StdSpaceLeft;      // Pixels of space on left
  727.     WORD gdi_StdTextLeft;       // Pixels to left of body
  728.     WORD gdi_StdBodyWidth;      // Pixels for width of body
  729.     WORD gdi_StdTextRight;      // Pixels to right of body
  730.     WORD gdi_StdSpaceRight;     // Pixels of space on right
  731.  
  732.     WORD gdi_StdSpaceAbove;     // Pixels of space above
  733.     WORD gdi_StdTextAbove;      // Pixels above body
  734.     WORD gdi_StdBodyHeight;     // Pixels for height of body
  735.     WORD gdi_StdTextBelow;      // Pixels below body
  736.     WORD gdi_StdSpaceBelow;     // Pixels of space below
  737.  
  738.     // Any extra spacing we would prefer to have.
  739.     WORD gdi_PadSpaceLeft;      // Pixels of padding space on left
  740.     WORD gdi_PadTextLeft;       // Pixels to left of body
  741.     WORD gdi_PadBodyWidth;      // Pixels for width of body
  742.     WORD gdi_PadTextRight;      // Pixels to right of body
  743.     WORD gdi_PadSpaceRight;     // Pixels of padding space on left
  744.  
  745.     UWORD gdi_PadSpaceAbove;    // Pixels of padding space above
  746.     UWORD gdi_PadTextAbove;     // Pixels above body
  747.     UWORD gdi_PadBodyHeight;    // Pixels for height of body
  748.     UWORD gdi_PadTextBelow;     // Pixels below body
  749.     UWORD gdi_PadSpaceBelow;    // Pixels of padding space below
  750. };
  751.  
  752. struct GadOutline {
  753.     struct Node go_Node;            // Reserved for future use.  DO NOT TOUCH.
  754.     UWORD pad0;                     // LONG-align.  DO NOT TOUCH.
  755.     void *go_OutlineBase;           // Also reserved.  DO NOT TOUCH.
  756.  
  757.     // The following are read-only.
  758.     
  759.     struct Window *go_Window;       // Window attached to the gadoutline.
  760.     struct Window *go_HookedWin;    // Window objects are attached to; NULL if
  761.                                     // not attached.  Use this and not
  762.                                     // go_Window with SetGadgetAttrs(), etc.
  763.     struct Screen *go_Screen;       // Screen layout is on.
  764.     struct Menu *go_MenuStrip;      // Menu strip to attach to window.
  765.     struct DrawInfo *go_DrI;        // Used to get the screen font, etc.
  766.     struct VisualInfo *go_VI;       // Screen's VisualInfo.
  767.     struct MsgPort *go_MsgPort;     // Our message port, or the current window's
  768.  
  769.     // Handles on gadget lists.  You should never need to look at these.
  770.     struct Gadget *go_GToolsList;   // The GadTools list of gadgets
  771.     struct Gadget *go_BoopsiList;   // The Boopsi list of gadgets
  772.     struct Gadget *go_BorderList;   // Currently unused.
  773.     
  774.     // Associated with current gadget held down by user.  May be set to
  775.     // NULL by the command's user hook if it really needs to.
  776.     struct CmdInfo *go_ActCmdInfo;  // Current CmdInfo accepting events
  777.  
  778.     // These may be modified by a user hook to reflect the addition of
  779.     // a new gadget.  They must always point to a valid gadget.
  780.     struct Gadget *go_LastGTools;   // Last GadTools gadget created
  781.     struct Gadget *go_LastBoopsi;   // Last Boopsi gadget created
  782.     struct Gadget *go_LastBorder;   // Currently unused.
  783.  
  784.     // Layout dimension information.  Read only.
  785.     UWORD go_Width,go_Height;       // Size of window needed
  786.     UWORD go_InnerWidth,            // Size of window inside its frame
  787.           go_InnerHeight;
  788.     UWORD go_MinWidth,              // Minimum window size the outline will fit in
  789.           go_MinHeight;
  790.     UWORD go_MinInnerWidth,         // Minimum size of window inside its frame
  791.           go_MinInnerHeight;
  792.  
  793.     // Last return code from requester.  May be written by application.
  794.     UWORD go_LastReqReturn;         // Return value from last error report
  795.     UWORD reserved0;
  796.  
  797.     // Current font information.  Read only.
  798.     struct TextFont *go_TextFont;   // The opened TTextAttr below.
  799.     struct TTextAttr go_TextAttr;   // The actual font that is used by the
  800.                                     // layout.  All of the gadgets use this as
  801.                                     // their TextAttr.
  802.     struct TTextAttr go_TargetTA;   // The desired font requested by the caller.
  803.  
  804.     // These may be used however you see fit.
  805.     void *go_UserData;              // For any use by user.
  806.     void *go_UserHandler;           // User's IDCMP handler or anything else.
  807.     void *go_TransHookData;         // For any use by user translation hook.
  808.  
  809. };  /* There is private data after this structure */
  810.  
  811. // This structure is not created... yet...
  812. struct OutlineBase {
  813.     struct Node ob_Node;            // Private linking.
  814.     UWORD pad0;                     // LONG-align.
  815.     
  816.     UBYTE *ob_ProgBaseName;         // User program's base name.
  817.     struct GadOutline *ob_Primary;  // Primary outline.
  818.  
  819. };  /* There is private data after this structure */
  820.  
  821. /**
  822.  ** This structure is used to describe the full positioning information of
  823.  ** a box on the screen.  To be filled in, a pointer to this structure is
  824.  ** passed using the GOCT_BoxPosInfo tag in the relevant box definition in the
  825.  ** outline.  The structure will be updated any time that the layout is
  826.  ** recomputed.
  827.  **/
  828.  
  829. struct BoxPosInfo {
  830.     WORD bpi_BoxLeftEdge;       // Left side of box; # pixels from left window edge
  831.     WORD bpi_BoxTopEdge;        // Top side of box; # pixels from top window edge
  832.     WORD bpi_BoxRightEdge;      // Right side of box; # pixels from left window edge
  833.     WORD bpi_BoxBottomEdge;     // Bottom side of box; # pixels from top window edge
  834.  
  835.     WORD bpi_BodyLeftEdge;      // Left side of body; # pixels from left window edge
  836.     WORD bpi_BodyTopEdge;       // Top side of body; # pixels from top window edge
  837.     WORD bpi_BodyRightEdge;     // Right side of body; # pixels from left window edge
  838.     WORD bpi_BodyBottomEdge;    // Bottom side of body; # pixels from top window edge
  839.  
  840.     WORD bpi_SpaceLeft;         // Number of pixels the left space width is
  841.     WORD bpi_TextLeft;          // Number of pixels the left text width is
  842.     WORD bpi_BodyWidth;         // Number of pixels the body width is
  843.     WORD bpi_TextRight;         // Number of pixels the right text width is
  844.     WORD bpi_SpaceRight;        // Number of pixels the right space width is
  845.  
  846.     WORD bpi_SpaceAbove;        // Number of pixels space from TopEdge to text
  847.     WORD bpi_TextAbove;         // Number of pixels high the above text is
  848.     WORD bpi_BodyHeight;        // Number of pixels high body is
  849.     WORD bpi_TextBelow;         // Number of pixels high the below text is
  850.     WORD bpi_SpaceBelow;        // Number of pixels space from text to BottomEdge
  851. };
  852.  
  853. /**
  854.  ** This is the type used by most of the tags that describe some kind of
  855.  ** size (ie line height, body width, etc).  The lower 16 bits tell the
  856.  ** size (as a SIGNED value) and the upper 16 bits tell what this is relative to
  857.  ** (ie, pixels, percent of a character width, etc) and the operation to
  858.  ** perform (ie, add it to previous value).
  859.  **/
  860.  
  861. typedef unsigned long TYPEDSIZE;
  862.  
  863. #define SIZE_STARTBIT (0)
  864. #define SIZE_NUMBITS (16)
  865. #define TYPE_STARTBIT (16)
  866. #define TYPE_NUMBITS (8)
  867. #define MODE_STARTBIT (24)
  868. #define MODE_NUMBITS (7)
  869.  
  870. // Bit allocation:
  871. //
  872. // 3  2    2    2    1    1    0    0    0
  873. // 1  8    4    0    6    2    8    4    0
  874. // 0MMM MMMM TTTT TTTT SSSS SSSS SSSS SSSS
  875. //
  876. // M = Mode bits
  877. // T = Type bits
  878. // S = Size bits
  879. // 0 = must be set to 0
  880. // 1 = must be set to 1
  881. // x = reserved.  always set to 0.
  882.  
  883. #define GETSIZE(tsize)  (( WORD)( ( ((TYPEDSIZE)(tsize)) >> SIZE_STARTBIT ) \
  884.                                   & ((1<<SIZE_NUMBITS)-1) ))
  885. #define GETTYPE(tsize)  ((ULONG)( ( ((TYPEDSIZE)(tsize)) >> TYPE_STARTBIT ) \
  886.                                   & ((1<<TYPE_NUMBITS)-1) ))
  887. #define GETMODE(tsize)  ((ULONG)( ( ((TYPEDSIZE)(tsize)) >> MODE_STARTBIT ) \
  888.                                   & ((1<<MODE_NUMBITS)-1) ))
  889.  
  890. #define GO_TSIZE(mode,size,type) \
  891.         ((TYPEDSIZE)( (((ULONG)(mode)&((1<<MODE_NUMBITS)-1))<<MODE_STARTBIT) \
  892.                     | (((UWORD)(size)&((1<<SIZE_NUMBITS)-1))<<SIZE_STARTBIT) \
  893.                     | (((ULONG)(type)&((1<<TYPE_NUMBITS)-1))<<TYPE_STARTBIT) \
  894.         ))
  895.  
  896. // Bits descibing size modes
  897. #define GOM_Std  0x10   // Bit values describing 'standard' size mode
  898.                         // This is the minimum required size.
  899. #define GOM_Pad  0x20   // Bit values describing 'padding' size mode
  900.                         // This is space to remove if there is not enough room.
  901. #define GOM_Var  0x40   // Bit values describing 'variable' size mode
  902.                         // This is space to add if there is extra room.
  903. #define GOM_Base 0x30   // Bit values describing base size.
  904.                         // This is both the padding and standard sizes.
  905. #define GOM_All  0x70   // Bit values describing all sizes.
  906.                         // This is the combination of all three sizes.
  907. #define GOM_MdMask 0x70 // All bits used to describe size mode
  908.  
  909. // Bits descibing size functions
  910. #define GOM_Set  0x0    // Bit values for 'set' function
  911.                         // Unconditionally sets the current value to this value.
  912. #define GOM_Max  0x1    // Bit values for 'maximum' function
  913.                         // Sets to the maximum of the current value and this value.
  914. #define GOM_Min  0x2    // Bit values for 'minimum' function
  915.                         // Sets to the minimum of the current value and this value.
  916. #define GOM_Add  0x3    // Bit values for 'add' function
  917.                         // Adds this value to the current value.
  918. #define GOM_Mul  0x4    // Bit values for 'mul' function
  919.                         // Multiplies this value with the current value.
  920. #define GOM_Div  0x5    // Bit values for 'div' function
  921.                         // Divides the current value by this value.
  922. #define GOM_FnMask 0xF  // All bits used to describe size   function
  923.  
  924. #define GOM_StdSet (GOM_Set|GOM_Std)    // Make the size this value
  925. #define GOM_StdMax (GOM_Max|GOM_Std)    // Final size can't be less than this
  926. #define GOM_StdMin (GOM_Min|GOM_Std)    // Final size can't be greater than this
  927. #define GOM_StdAdd (GOM_Add|GOM_Std)    // Add this value to total size
  928. #define GOM_StdMul (GOM_Mul|GOM_Std)    // Multiply this value with it
  929. #define GOM_StdDiv (GOM_Div|GOM_Std)    // Divide current value by this
  930.  
  931. #define GOM_PadSet (GOM_Set|GOM_Pad)    // Make the padding size this   value
  932. #define GOM_PadMax (GOM_Max|GOM_Pad)    // Final padding size   can't be < this
  933. #define GOM_PadMin (GOM_Min|GOM_Pad)    // Final size can't be greater than this
  934. #define GOM_PadAdd (GOM_Add|GOM_Pad)    // Add this value to total padding size
  935. #define GOM_PadMul (GOM_Mul|GOM_Pad)    // Multiply this value with it
  936. #define GOM_PadDiv (GOM_Div|GOM_Pad)    // Divide current value by this
  937.  
  938. #define GOM_VarSet (GOM_Set|GOM_Var)    // Make the variable size this value
  939. #define GOM_VarMax (GOM_Max|GOM_Var)    // Final variable size can't be < this
  940. #define GOM_VarMin (GOM_Min|GOM_Var)    // Final size can't be greater than this
  941. #define GOM_VarAdd (GOM_Add|GOM_Var)    // Add this value to total variable size
  942. #define GOM_VarMul (GOM_Mul|GOM_Var)    // Multiply this value with it
  943. #define GOM_VarDiv (GOM_Div|GOM_Var)    // Divide current value by this
  944.  
  945. #define GOM_BaseSet (GOM_Set|GOM_Base)  // Make the padding size this value
  946. #define GOM_BaseMax (GOM_Max|GOM_Base)  // Final padding size   can't be < this
  947. #define GOM_BaseMin (GOM_Min|GOM_Base)  // Final size can't be greater than this
  948. #define GOM_BaseAdd (GOM_Add|GOM_Base)  // Add this value to total padding size
  949. #define GOM_BaseMul (GOM_Mul|GOM_Base)  // Multiply this value with it
  950. #define GOM_BaseDiv (GOM_Div|GOM_Base)  // Divide current value by this
  951.  
  952. #define GOM_AllSet (GOM_Set|GOM_All)    // Make the padding size this value
  953. #define GOM_AllMax (GOM_Max|GOM_All)    // Final padding size can't be < this
  954. #define GOM_AllMin (GOM_Min|GOM_All)    // Final size can't be greater than this
  955. #define GOM_AllAdd (GOM_Add|GOM_All)    // Add this value to total padding size
  956. #define GOM_AllMul (GOM_Mul|GOM_All)    // Multiply this value with it
  957. #define GOM_AllDiv (GOM_Div|GOM_All)    // Divide current value by this
  958.  
  959. // Types of unit the supplied size is in.
  960.  
  961. // BASIC UNITS:  Have same value for GOM_Std, GOM_Pad, GOM_Var.
  962.  
  963. // These are the most basic of the basic units.
  964. #define GOT_Pixels       0  // Absolute # pixels
  965. #define GOT_PercCharW    1  // Percent of 1 character width
  966. #define GOT_PercChar0    2  // Percent of 1 numeric character width
  967. #define GOT_PercCharH    3  // Percent of 1 character height
  968. #define GOT_PercScale    4  // Percent to scale current value
  969.  
  970. // These are basic units based on the limits on the outline size.
  971. #define GOT_PercMinW     5  // Percentage of the minimum layout width
  972. #define GOT_PercMinH     6  // Percentage of the minimum layout height
  973. #define GOT_PercMaxW     7  // Percentage of the maximum layout width
  974. #define GOT_PercMaxH     8  // Percentage of the maximum layout height
  975.  
  976. // NUMBERS 9 TO 19 RESERVED HERE
  977.  
  978. // These are basic units based on the data obtained from a tag that precedes
  979. // this one which contains one or more text strings.
  980. #define GOT_PercTextMinW 20 // Percentage of the smallest computed width
  981.                             // of all the text strings using the current font
  982. #define GOT_PercTextMinH 21 // Percentage of the smallest computed height
  983.                             // of all the text strings using the current font
  984. #define GOT_PercTextMaxW 22 // Percentage of the largest computed width
  985.                             // of all the text strings using the current font
  986. #define GOT_PercTextMaxH 23 // Percentage of the largest computed height
  987.                             // of all the text strings using the current font
  988. #define GOT_PercTextAddW 24 // Percentage of the addition of all the computed
  989.                             // widths of the text strings using the current font
  990. #define GOT_PercTextAddH 25 // Percentage of the addition of all the computed
  991.                             // heights of the text strings using the current font
  992. #define GOT_PercTextMinC 26 // Percentage of smallest number of chars in strs
  993. #define GOT_PercTextMaxC 27 // Percentage of largest number of chars in strs
  994. #define GOT_PercTextAddC 28 // Percentage of addition of number of chars in strs
  995. #define GOT_PercTextAddL 29 // Percentage of total number of lines supplied
  996.  
  997. // NUMBERS 30 TO 39 RESERVED HERE
  998.  
  999. // These are basic units based on pixels available to the box from the
  1000. // group's minimum size.  (Ie, the difference between the box's minimum sizes
  1001. // and the minimum sizes that the box's parent group is using.)
  1002. // These are the values that are used to fill in a box's extra space when
  1003. // in GOCT_AutoDistExtra mode.  If GOCT_FitToGroup is on, these will always
  1004. // be zero.
  1005. #define GOT_PercFlSpaceL    40  // Percentage of fill space left
  1006. #define GOT_PercFlTextL     41  // Percentage of fill text left
  1007. #define GOT_PercFlBodyW     42  // Percentage of fill body width
  1008. #define GOT_PercFlTextR     43  // Percentage of fill text right
  1009. #define GOT_PercFlSpaceR    44  // Percentage of fill space right
  1010. #define GOT_PercFlBoxW      45  // Percentage of total fill width in box
  1011.  
  1012. #define GOT_PercFlSpaceA    46  // Percentage of fill space above
  1013. #define GOT_PercFlTextA     47  // Percentage of fill text above
  1014. #define GOT_PercFlBodyH     48  // Percentage of fill body height
  1015. #define GOT_PercFlTextB     49  // Percentage of fill text below
  1016. #define GOT_PercFlSpaceB    50  // Percentage of fill space below
  1017. #define GOT_PercFlBoxH      51  // Percentage of total fill height in box
  1018.  
  1019. // NUMBERS 52 TO 59 RESERVED HERE
  1020.  
  1021. // These are basic units based how much extra space has been allocated by
  1022. // the layout to the current box.  The individual parts are how the box's
  1023. // parent group wants to distribute the space.
  1024. #define GOT_PercExSpaceL    60  // Percentage of extra space left
  1025. #define GOT_PercExTextL     61  // Percentage of extra text left
  1026. #define GOT_PercExBodyW     62  // Percentage of extra body width
  1027. #define GOT_PercExTextR     63  // Percentage of extra text right
  1028. #define GOT_PercExSpaceR    64  // Percentage of extra space right
  1029. #define GOT_PercExBoxW      65  // Percentage of total extra width in box
  1030.  
  1031. #define GOT_PercExSpaceA    66  // Percentage of extra space above
  1032. #define GOT_PercExTextA     67  // Percentage of extra text above
  1033. #define GOT_PercExBodyH     68  // Percentage of extra body height
  1034. #define GOT_PercExTextB     69  // Percentage of extra text below
  1035. #define GOT_PercExSpaceB    70  // Percentage of extra space below
  1036. #define GOT_PercExBoxH      71  // Percentage of total extra height in box
  1037.  
  1038. // These are basic units which are the total amount of extra space
  1039. // allocated to the box which has not been used yet.
  1040. #define GOT_PercUnusedW     72  // Percentage of unused extra width
  1041. #define GOT_PercUnusedH     73  // Percentage of unused extra height
  1042.  
  1043. // NUMBERS 74 TO 89 RESERVED HERE
  1044.  
  1045. // These are basic units based on the total current values of the box.
  1046. // Each of these is the current sum of the std, pad and var modes.
  1047. #define GOT_PercSpaceL      90  // Percentage of space left width
  1048. #define GOT_PercTextL       91  // Percentage of text left width
  1049. #define GOT_PercBodyW       92  // Percentage of body width
  1050. #define GOT_PercTextR       93  // Percentage of text right width
  1051. #define GOT_PercSpaceR      94  // Percentage of space right width
  1052. #define GOT_PercSpaceA      95  // Percentage of space above height
  1053. #define GOT_PercTextA       96  // Percentage of text above height
  1054. #define GOT_PercBodyH       97  // Percentage of body height
  1055. #define GOT_PercTextB       98  // Percentage of text below height
  1056. #define GOT_PercSpaceB      99  // Percentage of space below height
  1057. #define GOT_PercUser1       100 // Percentage of the value in user variable 1
  1058. #define GOT_PercUser2       101 // Percentage of the value in user variable 2
  1059. // NUMBERS 102 TO 107 RESERVED HERE
  1060. #define GOT_PercBoxW        108 // Percentage of total box width
  1061. #define GOT_PercBoxH        109 // Percentage of total box width
  1062.  
  1063. // These are basic units based on the total current std mode values of the box.
  1064. #define GOT_PercStSpaceL    110 // Percentage of space left width
  1065. #define GOT_PercStTextL     111 // Percentage of text left width
  1066. #define GOT_PercStBodyW     112 // Percentage of body width
  1067. #define GOT_PercStTextR     113 // Percentage of text right width
  1068. #define GOT_PercStSpaceR    114 // Percentage of space right width
  1069. #define GOT_PercStSpaceA    115 // Percentage of space above height
  1070. #define GOT_PercStTextA     116 // Percentage of text above height
  1071. #define GOT_PercStBodyH     117 // Percentage of body height
  1072. #define GOT_PercStTextB     118 // Percentage of text below height
  1073. #define GOT_PercStSpaceB    119 // Percentage of space below height
  1074. #define GOT_PercStUser1     120 // Percentage of the value in user variable 1
  1075. #define GOT_PercStUser2     121 // Percentage of the value in user variable 2
  1076. // NUMBERS 122 TO 127 RESERVED HERE
  1077. #define GOT_PercStBoxW      128 // Percentage of total box width
  1078. #define GOT_PercStBoxH      129 // Percentage of total box width
  1079.  
  1080. // These are basic units based on the total current pad mode values of the box.
  1081. #define GOT_PercPdSpaceL    130 // Percentage of space left width
  1082. #define GOT_PercPdTextL     131 // Percentage of text left width
  1083. #define GOT_PercPdBodyW     132 // Percentage of body width
  1084. #define GOT_PercPdTextR     133 // Percentage of text right width
  1085. #define GOT_PercPdSpaceR    134 // Percentage of space right width
  1086. #define GOT_PercPdSpaceA    135 // Percentage of space above height
  1087. #define GOT_PercPdTextA     136 // Percentage of text above height
  1088. #define GOT_PercPdBodyH     137 // Percentage of body height
  1089. #define GOT_PercPdTextB     138 // Percentage of text below height
  1090. #define GOT_PercPdSpaceB    139 // Percentage of space below height
  1091. #define GOT_PercPdUser1     140 // Percentage of the value in user variable 1
  1092. #define GOT_PercPdUser2     141 // Percentage of the value in user variable 2
  1093. // NUMBERS 142 TO 147 RESERVED HERE
  1094. #define GOT_PercPdBoxW      148 // Percentage of total box width
  1095. #define GOT_PercPdBoxH      149 // Percentage of total box width
  1096.  
  1097. // These are basic units based on the total current var mode values of the box.
  1098. #define GOT_PercVrSpaceL    150 // Percentage of space left width
  1099. #define GOT_PercVrTextL     151 // Percentage of text left width
  1100. #define GOT_PercVrBodyW     152 // Percentage of body width
  1101. #define GOT_PercVrTextR     153 // Percentage of text right width
  1102. #define GOT_PercVrSpaceR    154 // Percentage of space right width
  1103. #define GOT_PercVrSpaceA    155 // Percentage of space above height
  1104. #define GOT_PercVrTextA     156 // Percentage of text above height
  1105. #define GOT_PercVrBodyH     157 // Percentage of body height
  1106. #define GOT_PercVrTextB     158 // Percentage of text below height
  1107. #define GOT_PercVrSpaceB    159 // Percentage of space below height
  1108. #define GOT_PercVrUser1     160 // Percentage of the value in user variable 1
  1109. #define GOT_PercVrUser2     161 // Percentage of the value in user variable 2
  1110. // NUMBERS 162 TO 167 RESERVED HERE
  1111. #define GOT_PercVrBoxW      168 // Percentage of total box width
  1112. #define GOT_PercVrBoxH      169 // Percentage of total box width
  1113.  
  1114. // NUMBERS 170 TO 219 RESERVED HERE
  1115.  
  1116. // COMPLEX UNITS:  Have different values for GOM_Std, GOM_Pad, GOM_Var.
  1117.  
  1118. // These are complex units based on the current values of the box.
  1119. #define GOT_PercMdSpaceL    220 // Percentage of space left width
  1120. #define GOT_PercMdTextL     221 // Percentage of text left width
  1121. #define GOT_PercMdBodyW     222 // Percentage of body width
  1122. #define GOT_PercMdTextR     223 // Percentage of text right width
  1123. #define GOT_PercMdSpaceR    224 // Percentage of space right width
  1124. #define GOT_PercMdSpaceA    225 // Percentage of space above height
  1125. #define GOT_PercMdTextA     226 // Percentage of text above height
  1126. #define GOT_PercMdBodyH     227 // Percentage of body height
  1127. #define GOT_PercMdTextB     228 // Percentage of text below height
  1128. #define GOT_PercMdSpaceB    229 // Percentage of space below height
  1129. #define GOT_PercMdUser1     230 // Percentage of the value in user variable 1
  1130. #define GOT_PercMdUser2     231 // Percentage of the value in user variable 2
  1131. // NUMBERS 232 TO 237 RESERVED HERE
  1132. #define GOT_PercMdBoxW      238 // Percentage of total box width
  1133. #define GOT_PercMdBoxH      239 // Percentage of total box width
  1134.  
  1135. // These are complex units based on the default values for the box.
  1136. #define GOT_PercDfSpaceL    240 // Percentage of space left width
  1137. #define GOT_PercDfTextL     241 // Percentage of text left width
  1138. #define GOT_PercDfBodyW     242 // Percentage of body width
  1139. #define GOT_PercDfTextR     243 // Percentage of text right width
  1140. #define GOT_PercDfSpaceR    244 // Percentage of space right width
  1141.  
  1142. #define GOT_PercDfSpaceA    245 // Percentage of space above height
  1143. #define GOT_PercDfTextA     246 // Percentage of text above height
  1144. #define GOT_PercDfBodyH     247 // Percentage of body height
  1145. #define GOT_PercDfTextB     248 // Percentage of text below height
  1146. #define GOT_PercDfSpaceB    249 // Percentage of space below height
  1147.  
  1148. // This is a special type which is used to find the size of another
  1149. // box.  The 'value' part of the typed size is divided into two parts;
  1150. // the lower 12 bits are the StdID of the box to get the size from,
  1151. // and the upper 4 bits area one of the following sizes.
  1152. // Note that these sizes are not computed until after all of the groups
  1153. // and boxes have been sized, so they are not available when setting
  1154. // the size of a box or group during layout.
  1155. #define GOT_BoxSize 255
  1156.  
  1157. // All of these return the actual number of pixels.
  1158. #define GOTB_BoxLeft    0x0000          // Get the box's absolute left position.
  1159. #define GOTB_BoxTop     0x1000          // Get the box's absolute top position.
  1160. #define GOTB_BoxWidth   0x2000          // Get the box's absolute width.
  1161. #define GOTB_BoxHeight  0x3000          // Get the box's absolute height.
  1162. #define GOTB_BodyLeft   0x4000          // Get the box's absolute body left pos.
  1163. #define GOTB_BodyTop    0x5000          // Get the box's absolute body top pos.
  1164. #define GOTB_SpaceLeft  0x6000          // Get the box's absolute spc left size.
  1165. #define GOTB_TextLeft   0x7000          // Get the box's absolute txt left size.
  1166. #define GOTB_BodyWidth  0x8000          // Get the box's absolute body width.
  1167. #define GOTB_TextRight  0x9000          // Get the box's absolute txt rgt size.
  1168. #define GOTB_SpaceRight 0xA000          // Get the box's absolute spc rgt size.
  1169. #define GOTB_SpaceAbove 0xB000          // Get the box's absolute spc abv size.
  1170. #define GOTB_TextAbove  0xC000          // Get the box's absolute txt abv size.
  1171. #define GOTB_BodyHeight 0xD000          // Get the box's absolute body height.
  1172. #define GOTB_TextBelow  0xE000          // Get the box's absolute txt blw size.
  1173. #define GOTB_SpaceBelow 0xF000          // Get the box's absolute spc blw size.
  1174.  
  1175. #define GO_BSIZE(mode,stdid,which) GO_TSIZE(mode,(which&0xF000)|GETSTDID(stdid),GOT_BoxSize)
  1176.  
  1177. /**
  1178.  ** Special type for defining a tag which links one gadget to another
  1179.  **/
  1180. typedef unsigned long TAGLINK;
  1181.  
  1182. #define LNKCMD_STARTBIT (0)     // ID of command object to create link to.
  1183. #define LNKCMD_NUMBITS (12)
  1184. #define LNKTAG_STARTBIT (12)    // Lower 20 bits of link tag.
  1185. #define LNKTAG_NUMBITS (20)
  1186.  
  1187. // Bit allocation:
  1188. //
  1189. // 3  2    2    2    1    1    0    0    0
  1190. // 1  8    4    0    6    2    8    4    0
  1191. // TTTT TTTT TTTT TTTT TTTT CCCC CCCC CCCC
  1192. //
  1193. // T = Tag ID type bits
  1194. // C = Command ID bits
  1195. // x = reserved.  always set to 0.
  1196.  
  1197. #define GETLNKCMD(tlink) ((ULONG)( ( ((TAGLINK)(tlink)) >> LNKCMD_STARTBIT ) \
  1198.                                  & ((1<<LNKCMD_NUMBITS)-1) ))
  1199. #define GETLNKTAG(tlink) ((ULONG)( ( ( ((TAGLINK)(tlink)) >> LNKTAG_STARTBIT ) \
  1200.                                    & ((1<<LNKTAG_NUMBITS)-1) \
  1201.                                   ) | TAG_USER ))
  1202.  
  1203. #define GO_MAKELINK(tag,cmd) \
  1204.         ((TAGLINK)( (((ULONG)(tag)&((1<<LNKTAG_NUMBITS)-1))<<LNKTAG_STARTBIT) \
  1205.                   | (((ULONG)(cmd)&((1<<LNKCMD_NUMBITS)-1))<<LNKCMD_STARTBIT) \
  1206.         ))
  1207.  
  1208. /***
  1209.  *** Tags after this number are free for use by the user to pass data
  1210.  *** to custom hook code through the main tag list.
  1211.  ***/
  1212.  
  1213. #define GOCT_User (TAG_USER+0xC000)
  1214.  
  1215. /***
  1216.  *** These are the GadgetOutline Command Tags that are used in the
  1217.  *** main (first) tag list of an outline command.
  1218.  ***/
  1219.  
  1220. #define TAG_OUTLINE_CMDBASE (TAG_USER+0x9000)
  1221.  
  1222. #define TAG_OUTLINE_TYPEDSIZE (TAG_OUTLINE_CMDBASE+0x100)
  1223.  
  1224. // These are the position-dependant typed size command tags.  They are
  1225. // sequentially parsed when computing typed sizes.
  1226.  
  1227. #define GOCT_TextArray  (TAG_OUTLINE_TYPEDSIZE+1)
  1228.      /* UBYTE **
  1229.       * Takes the NULL-terminated array of string pointers (as supplied
  1230.       * to GadTools' Cycle and MX kinds), examines their width and height
  1231.       * in the current font, and sets the GOT_PercText* variables for use
  1232.       * in size tags following this one.
  1233.       *
  1234.       * Default: All values 0
  1235.       */
  1236.  
  1237. #define GOCT_TextList   (TAG_OUTLINE_TYPEDSIZE+2)
  1238.      /* struct List *
  1239.       * Takes the list of nodes with ln_Name filled in (as supplied
  1240.       * to GadTools' ListView kind), examines their width and height
  1241.       * in the current font, and sets the GOT_PercText* variables for use
  1242.       * in size tags following this one.
  1243.       *
  1244.       * Default: 0
  1245.       */
  1246.  
  1247. #define GOCT_TextPtr    (TAG_OUTLINE_TYPEDSIZE+3)
  1248.      /* UBYTE *
  1249.       * Takes the text string, examines its width and height in the current
  1250.       * font, and sets the GOT_PercText* variables for use in size tags
  1251.       * following this one.
  1252.       *
  1253.       * Default: 0
  1254.       */
  1255.  
  1256. #define GOCT_MoreTextArray  (TAG_OUTLINE_TYPEDSIZE+4)
  1257.      /* UBYTE **
  1258.       * Same as GOCT_TextArray, but continues with dimensions from
  1259.       * the previous time.
  1260.       */
  1261.  
  1262. #define GOCT_MoreTextList   (TAG_OUTLINE_TYPEDSIZE+5)
  1263.      /* struct List *
  1264.       * Same as GOCT_TextList, but continues with dimensions from
  1265.       * the previous time.
  1266.       */
  1267.  
  1268. #define GOCT_MoreTextPtr    (TAG_OUTLINE_TYPEDSIZE+6)
  1269.      /* UBYTE *
  1270.       * Same as GOCT_TextPtr, but continues with dimensions from
  1271.       * the previous time.
  1272.       */
  1273.  
  1274. #define GOCT_TextArrayTag   (TAG_OUTLINE_TYPEDSIZE+7)
  1275. #define GOCT_TextListTag    (TAG_OUTLINE_TYPEDSIZE+8)
  1276. #define GOCT_TextPtrTag (TAG_OUTLINE_TYPEDSIZE+9)
  1277. #define GOCT_MoreTextArrayTag   (TAG_OUTLINE_TYPEDSIZE+10)
  1278. #define GOCT_MoreTextListTag    (TAG_OUTLINE_TYPEDSIZE+11)
  1279. #define GOCT_MoreTextPtrTag (TAG_OUTLINE_TYPEDSIZE+12)
  1280.      /* Tag
  1281.       * These work identically to the previous tags, except they get their
  1282.       * pointer to the text/array/list from the specified tag in the
  1283.       * object tag list.  Ie, ..., GOCT_TextPtrTag, GTST_String, ...
  1284.       * would get the pointer to a string from the first tag of type
  1285.       * GTST_String in the GadTools tag list.
  1286.       */
  1287.  
  1288.  
  1289. #define GOCT_SizeParse  (TAG_OUTLINE_TYPEDSIZE+13)
  1290.      /* TYPEDSIZE
  1291.       * Special TypedSize tag used in the ParseTypedSizeList() taglist.
  1292.       */
  1293.  
  1294. // TAG NUMBERS 14 TO 29 RESERVED HERE
  1295.  
  1296. #define GOCT_SizeSpaceLeft  (TAG_OUTLINE_TYPEDSIZE+30)
  1297.      /* TYPEDSIZE
  1298.       * Set the amount of space to put between this box and box to the left.
  1299.       *
  1300.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfSpaceL)
  1301.       */
  1302.  
  1303. #define GOCT_SizeTextLeft   (TAG_OUTLINE_TYPEDSIZE+31)
  1304.      /* TYPEDSIZE
  1305.       * Set the width of the left text area.
  1306.       *
  1307.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfTextL)
  1308.       */
  1309.  
  1310. #define GOCT_SizeBodyWidth  (TAG_OUTLINE_TYPEDSIZE+32)
  1311.      /* TYPEDSIZE
  1312.       * Set the width of the box's body.
  1313.       *
  1314.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfBodyW)
  1315.       */
  1316.  
  1317. #define GOCT_SizeTextRight  (TAG_OUTLINE_TYPEDSIZE+33)
  1318.      /* TYPEDSIZE
  1319.       * Set the width of the right text area.
  1320.       *
  1321.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfTextR)
  1322.       */
  1323.  
  1324. #define GOCT_SizeSpaceRight (TAG_OUTLINE_TYPEDSIZE+34)
  1325.      /* TYPEDSIZE
  1326.       * Set the amount of space to put between this box and box to the right.
  1327.       *
  1328.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfSpaceR)
  1329.       */
  1330.  
  1331. #define GOCT_SizeSpaceAbove (TAG_OUTLINE_TYPEDSIZE+35)
  1332.      /* TYPEDSIZE
  1333.       * Set the amount of space to put between this line and the line above it.
  1334.       *
  1335.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfSpaceA)
  1336.       */
  1337.  
  1338. #define GOCT_SizeTextAbove  (TAG_OUTLINE_TYPEDSIZE+36)
  1339.      /* TYPEDSIZE
  1340.       * Set the height of the top text area.
  1341.       *
  1342.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfTextA)
  1343.       */
  1344.  
  1345. #define GOCT_SizeBodyHeight (TAG_OUTLINE_TYPEDSIZE+37)
  1346.      /* TYPEDSIZE
  1347.       * Set the line's body height
  1348.       *
  1349.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfBodyH)
  1350.       */
  1351.  
  1352. #define GOCT_SizeTextBelow  (TAG_OUTLINE_TYPEDSIZE+38)
  1353.      /* TYPEDSIZE
  1354.       * Set the height of the bottom text area.
  1355.       *
  1356.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfTextB)
  1357.       */
  1358.  
  1359. #define GOCT_SizeSpaceBelow (TAG_OUTLINE_TYPEDSIZE+39)
  1360.      /* TYPEDSIZE
  1361.       * Set the amount of space to put between this line and the line below it.
  1362.       *
  1363.       * Default: GO_TSIZE(GOM_AllSet,100,GOT_PercDfSpaceB)
  1364.       */
  1365.  
  1366. #define GOCT_SizeUser1  (TAG_OUTLINE_TYPEDSIZE+40)
  1367. #define GOCT_SizeUser2  (TAG_OUTLINE_TYPEDSIZE+41)
  1368.      /* TYPEDSIZE
  1369.       * Set user size variables for later use.
  1370.       *
  1371.       * These variables are completely unused by the library, except that
  1372.       * the User1 padding is scaled by the amount of total padding width the
  1373.       * box is scaled, and User2 is similarily scaled by the box's padding
  1374.       * height.
  1375.       *
  1376.       * Default: GO_TSIZE(GOM_AllSet,0,GOT_Pixels)
  1377.       */
  1378.  
  1379. // TAG NUMBERS 42 TO 79 RESERVED HERE
  1380.  
  1381. #define GOCT_SetBoxLeft     (TAG_OUTLINE_TYPEDSIZE+80)
  1382. #define GOCT_SetBoxTop      (TAG_OUTLINE_TYPEDSIZE+81)
  1383. #define GOCT_SetBoxWidth    (TAG_OUTLINE_TYPEDSIZE+82)
  1384. #define GOCT_SetBoxHeight   (TAG_OUTLINE_TYPEDSIZE+83)
  1385. #define GOCT_SetBodyLeft    (TAG_OUTLINE_TYPEDSIZE+84)
  1386. #define GOCT_SetBodyTop     (TAG_OUTLINE_TYPEDSIZE+85)
  1387. #define GOCT_SetSpaceLeft   (TAG_OUTLINE_TYPEDSIZE+86)
  1388. #define GOCT_SetTextLeft    (TAG_OUTLINE_TYPEDSIZE+87)
  1389. #define GOCT_SetBodyWidth   (TAG_OUTLINE_TYPEDSIZE+88)
  1390. #define GOCT_SetTextRight   (TAG_OUTLINE_TYPEDSIZE+89)
  1391. #define GOCT_SetSpaceRight  (TAG_OUTLINE_TYPEDSIZE+90)
  1392. #define GOCT_SetSpaceAbove  (TAG_OUTLINE_TYPEDSIZE+91)
  1393. #define GOCT_SetTextAbove   (TAG_OUTLINE_TYPEDSIZE+92)
  1394. #define GOCT_SetBodyHeight  (TAG_OUTLINE_TYPEDSIZE+93)
  1395. #define GOCT_SetTextBelow   (TAG_OUTLINE_TYPEDSIZE+94)
  1396. #define GOCT_SetSpaceBelow  (TAG_OUTLINE_TYPEDSIZE+95)
  1397.      /* TYPEDSIZE
  1398.       * Directly set box's final dimensions.
  1399.       *
  1400.       * These are used to directly set a box's dimensions as shown in
  1401.       * its BoxAttr structure.  They are parsed after the gadgets have
  1402.       * been fully layed out, for every command which has a BoxAttr.
  1403.       *
  1404.       * Note that there is some redundancy in the dimension information
  1405.       * between the total box size, the body position and the individual
  1406.       * size components.  You may enter "-1" into any of the dimensions
  1407.       * that you do not care about; they will then be computed from the
  1408.       * other dimension information or default to 0.
  1409.       *
  1410.       * Default: Boxes and Groups start with everything filled in
  1411.       *          correctly from the layout; Images start with everything
  1412.       *          set to -1.
  1413.       */
  1414.  
  1415. // These are mostly position-independant command tags [at least in the sense
  1416. // that their position relative to the typed size tags doesn't matter. :)]
  1417. // However, all of these tags can be included multiple times and some pairs
  1418. // may been to be grouped together, as described for those specific tags.
  1419.  
  1420. #define TAG_OUTLINE_MULTITAG (TAG_OUTLINE_CMDBASE+0x200)
  1421.  
  1422. #define GOCT_AddTagLink (TAG_OUTLINE_MULTITAG+0)
  1423.      /* TAGLINK
  1424.       * Add a link from this cmd's secondary tag list to another cmd's object.
  1425.       *
  1426.       * For every one of these tags in the cmd's tag list, space is reserved
  1427.       * in the secondary tag list for a single tag.  At the time that the
  1428.       * objects are being created, these links are filled in with the
  1429.       * address of the object that the link points to.  If any of the links
  1430.       * point to a object that hasn't been created yet, the creation of
  1431.       * the current object is delayed.  If it is imposible to resolve
  1432.       * all of the links (ie, two object pointing to each other), then
  1433.       * neither of the objects will be created.
  1434.       *
  1435.       * Multiple instances of this tag may occur.
  1436.       *
  1437.       * Default: No links.
  1438.       */
  1439.  
  1440. #define GOCT_LinkFromTag (TAG_OUTLINE_MULTITAG+1)
  1441.      /* Tag
  1442.       * Specify the secondary tag that will point to a object in the outline.
  1443.       */
  1444. #define GOCT_LinkToStdID (TAG_OUTLINE_MULTITAG+2)
  1445.      /* ULONG
  1446.       * Specify the standard CmdID the previously specified tag will point to.
  1447.       *
  1448.       * This pair of tags operates identically to the GOCT_AddTagLink tag,
  1449.       * except it allows the full tag value to be specified.
  1450.       *
  1451.       * This pair of tags is used to create a link between objects.
  1452.       * They must come in the exact order:
  1453.       *   ..., GOCT_LinkFromTag, TagItem, GOCT_LinkToStdID, StdID, ...
  1454.       *
  1455.       * Multiple instances of this tag pair may occur.
  1456.       *
  1457.       * Default: No links.
  1458.       */
  1459.  
  1460. #define GOCT_CopyFromTSize (TAG_OUTLINE_MULTITAG+3)
  1461.      /* TYPEDSIZE
  1462.       * Specify a TypedSize value to copy from...
  1463.       */
  1464. #define GOCT_CopyTSizeToTag (TAG_OUTLINE_MULTITAG+4)
  1465.      /* TAG
  1466.       * Specify the Tag the previously specified value will be copied to.
  1467.       *
  1468.       * Multiple instances of this tag pair may occur.  These are used
  1469.       * to put a value into a tag in the secondary list before any
  1470.       * processing is done on the command to compute its dimensions.
  1471.       * These tags are processed immediately before sending the
  1472.       * CHM_GETMINDIMENS message to the command's hook.
  1473.       *
  1474.       * These must come in the exact order:
  1475.       *   ..., GOCT_CopyFromTSize, TypedSize, GOCT_CopyTSizeToTag, Tag, ...
  1476.       *
  1477.       * Default: Nothing copied.
  1478.       */
  1479.  
  1480. #define GOCT_CopyUser1ToTag (TAG_OUTLINE_MULTITAG+5)
  1481. #define GOCT_CopyUser2ToTag (TAG_OUTLINE_MULTITAG+6)
  1482.      /* Tag
  1483.       * Copy the current value in the User1 variable to the given
  1484.       * tag in the secondary tag list.
  1485.       *
  1486.       * Multiple instances of these tags may occur.  They are always
  1487.       * processed after all of the variable-spacing typed size tags
  1488.       * have been processed.  [Ie, when the final positions of the
  1489.       * objects are finally being computed.]  The value copied is the
  1490.       * sum of the std, pad and var components of the user variable.
  1491.       *
  1492.       * Default: Nothing copied.
  1493.       */
  1494.  
  1495. // TAG NUMBERS 7 TO 29 RESERVED HERE
  1496.  
  1497. #define GOCT_CopyScreen     (TAG_OUTLINE_MULTITAG+30)
  1498. #define GOCT_CopyWindow     (TAG_OUTLINE_MULTITAG+31)
  1499. #define GOCT_CopyDrawInfo   (TAG_OUTLINE_MULTITAG+32)
  1500. #define GOCT_CopyDrawPens   (TAG_OUTLINE_MULTITAG+33)
  1501. #define GOCT_CopyVisualInfo (TAG_OUTLINE_MULTITAG+34)
  1502. #define GOCT_CopyTextAttr   (TAG_OUTLINE_MULTITAG+35)
  1503. #define GOCT_CopyTextFont   (TAG_OUTLINE_MULTITAG+36)
  1504.      /* Tag
  1505.       * Copy global GadOutline information into a tag.
  1506.       *
  1507.       * Multiple instances of these tags may occur.  These are processed
  1508.       * before the gadgets are first created on a window.  They are
  1509.       * used to supply extra information to BOOPSI gadgets about the
  1510.       * screen and window they will be rendering into.
  1511.       *
  1512.       * Default: Nothing copied.
  1513.       */
  1514.  
  1515. // The rest of the tags can only occur once; if any occur both in the
  1516. // GO_COMMANDTAGS() global list and in the command's actual list, the
  1517. // command's list takes precedence.
  1518.  
  1519. // These are the standard command tags.
  1520.  
  1521. #define TAG_OUTLINE_COMMAND (TAG_OUTLINE_CMDBASE+0x800)
  1522.  
  1523. #define GOCT_SetUserHook (TAG_OUTLINE_COMMAND+0)
  1524.      /* struct Hook *
  1525.       * Set the user hook function for this command.
  1526.       * If NULL, only use system function.
  1527.       *
  1528.       * Default: NULL
  1529.       */
  1530.  
  1531. #define GOCT_SetUserHookData (TAG_OUTLINE_COMMAND+1)
  1532.      /* ULONG
  1533.       * Set initial value for ci_UserHookData.
  1534.       *
  1535.       * Default: NULL
  1536.       */
  1537.  
  1538. #define HOTKEY_NOTRANS  (1<<31)     // Don't translate given character into
  1539.                                     // upper- and lower-case versions.
  1540. #define HOTKEY_UPONLY   (1<<30)     // Assign only the upper-case version of
  1541.                                     // this character to the command.
  1542. #define HOTKEY_LOWONLY  (1<<29)     // Assign only the lower-case version of
  1543.                                     // this character to the command.
  1544. #define HOTKEY_NONE     (HOTKEY_UPONLY | HOTKEY_LOWONLY)
  1545.                                     // Don't assign any hotkey.
  1546. #define HOTKEY_CHARACTER (0xFF)     // Mask for the actual character.
  1547.  
  1548. #define GOCT_SetHotKey (TAG_OUTLINE_COMMAND+2)
  1549.      /* ULONG
  1550.       * Define a hotkey for this command.
  1551.       *
  1552.       * Accepts an ASCII code which is to be assigned as this command's
  1553.       * hotkey.  Whenever this key is pressed [and, if only RAWKEY
  1554.       * events are being reported, when it is released], a CHM_HOTKEY
  1555.       * event will be sent to the command.  An ASCII value of 0 is
  1556.       * interpreted as 'let the command assign a hotkey for me.'
  1557.       * The standard GadTools hook supports this by looking for the
  1558.       * underlined character in a label and using that as the key.
  1559.       *
  1560.       * Default: No hot key.
  1561.       */
  1562.  
  1563. #define GOCT_SetHotKeyCmd (TAG_OUTLINE_COMMAND+3)
  1564.      /* CMDID
  1565.       * Define actual command which recieves hotkeys for this command.
  1566.       *
  1567.       * This tag provides a way for you to 'redirect' hotkeys.  It is
  1568.       * primarily intended for you to use a GadTools gadget to render
  1569.       * the text describing another gadget - the text gadget is created
  1570.       * with an underline for the appropriate hotkey.  This gadget
  1571.       * then has the tag GOCT_SetHotKey, 0 so that the hotkey is
  1572.       * automatically assigned, and GOCT_SetHotKeyCmd with the CmdID
  1573.       * of the actually command which is to recieve these hotkey events.
  1574.       *
  1575.       * Note that only one level of this indirection is supported.
  1576.       *
  1577.       * Default: ID of this command
  1578.       */
  1579.  
  1580. // These are command tags for boxes and groups.  (GOK_Box, GOK_Group)
  1581.  
  1582. #define TAG_OUTLINE_BOX (TAG_OUTLINE_CMDBASE+0x900)
  1583.  
  1584. #define GOCT_BoxPosInfo (TAG_OUTLINE_BOX+0)
  1585.      /* struct BoxPosInfo *
  1586.       * Supplies the address to a valid 'BoxPosInfo' structure, which
  1587.       * will be filled in with the current size of this box during
  1588.       * a Resize.  If the address is ~0, the library will allocate
  1589.       * this structure.
  1590.       *
  1591.       * Default: 0
  1592.       */
  1593.  
  1594. #define GOCT_IgnoreMinDimens (TAG_OUTLINE_BOX+1)
  1595.      /* BOOL
  1596.       * If TRUE, ignore this command's dimensions when computing the
  1597.       * minimum dimensions needed for the layout.
  1598.       *
  1599.       * Default: FALSE
  1600.       */
  1601.  
  1602. #define GOCT_IgnoreFinDimens (TAG_OUTLINE_BOX+2)
  1603.      /* BOOL
  1604.       * If TRUE, ignore this command's dimensions when computing the
  1605.       * final dimensions/spacing of the layout.
  1606.       *
  1607.       * Default: FALSE
  1608.       */
  1609.  
  1610. #define GOCT_IgnoreCreation (TAG_OUTLINE_BOX+3)
  1611.      /* BOOL
  1612.       * If TRUE, do not actually create the object.
  1613.       *
  1614.       * Default: FALSE
  1615.       */
  1616.  
  1617. // These are for groups only.
  1618.  
  1619. #define TAG_OUTLINE_GROUP (TAG_OUTLINE_CMDBASE+0xA00)
  1620.  
  1621. #define GOCT_FrameGroup (TAG_OUTLINE_GROUP+130)
  1622.      /* BOOL
  1623.       * If TRUE, any minimum dimensions in this group's outside space area
  1624.       * (ie, SpaceAbove, SpaceBelow, SpaceLeft and SpaceRight), is reserved
  1625.       * only for the group, and any boxes or groups within it are positioned
  1626.       * inside of this area.  By default this space is zero, so you will have
  1627.       * to use the GOCT_SizeSpaceLeft, etc. tags to make this space show up.
  1628.       *
  1629.       * Default: TRUE
  1630.       */
  1631.  
  1632. #define GOCT_AutoDistExtra (TAG_OUTLINE_GROUP+131)
  1633.      /* BOOL
  1634.       * If TRUE, the extra space created by the difference between the box's
  1635.       * dimensions and its parent group's minimum dimensions are distributed
  1636.       * in the box to make it match the group.
  1637.       *
  1638.       * Default: FALSE
  1639.       */
  1640.  
  1641. #define GOCT_FitToGroup (TAG_OUTLINE_GROUP+132)
  1642.      /* BOOL
  1643.       * If TRUE, this box's minimum dimensions are stretched to match
  1644.       * its parent group's minimum dimensions.
  1645.       *
  1646.       * Default: FALSE
  1647.       */
  1648.  
  1649. #define GOCT_EvenDistGroup (TAG_OUTLINE_GROUP+133)
  1650.      /* BOOL
  1651.       * If TRUE, the boxes within the group will be forced to all have
  1652.       * the same size across the group's weight dimension.  [Ie, the
  1653.       * vertical component within a vertical group.]
  1654.       * In other words, all the boxes within a vertical group will
  1655.       * be given the same height, constrained by the largest box.
  1656.       *
  1657.       * Default: FALSE
  1658.       */
  1659.  
  1660. /**
  1661.  ** ----------------------------------------------------------
  1662.  ** GadOutline drawing definitions.
  1663.  ** ----------------------------------------------------------
  1664.  **/
  1665.  
  1666. /**
  1667.  ** This is the type used by most of the drawing commands that take
  1668.  ** coordinates as arguments.  It contains at most a pen to draw in
  1669.  ** plus two coordinate pairs and a mode which controls how the
  1670.  ** coordinates are interpreted, although how much of this is actually
  1671.  ** used is command-specific.
  1672.  **/
  1673.  
  1674. typedef unsigned long DRAWPNT;
  1675.  
  1676. #define PNTY2_STARTBIT (0)
  1677. #define PNTY2_NUMBITS (6)
  1678. #define PNTX2_STARTBIT (6)
  1679. #define PNTX2_NUMBITS (6)
  1680. #define PNTY1_STARTBIT (12)
  1681. #define PNTY1_NUMBITS (6)
  1682. #define PNTX1_STARTBIT (18)
  1683. #define PNTX1_NUMBITS (6)
  1684. #define PNTPEN_STARTBIT (24)
  1685. #define PNTPEN_NUMBITS (4)
  1686. #define PNTMODE_STARTBIT (28)
  1687. #define PNTMODE_NUMBITS (4)
  1688.  
  1689. // Bit allocation:
  1690. //
  1691. // 3  2    2    2    1    1    0    0    0
  1692. // 1  8    4    0    6    2    8    4    0
  1693. // MMMM PPPP xxxx xxyy yyyy XXXX XXYY YYYY
  1694. //
  1695. // M = Mode bits
  1696. // P = Pen bits
  1697. // x = x1 coord bits
  1698. // y = y1 coord bits
  1699. // X = x2 coord bits
  1700. // Y = y2 coord bits
  1701.  
  1702. #define GETPNTY2(drawpnt)   ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTY2_STARTBIT ) \
  1703.                                   & ((1<<PNTY2_NUMBITS)-1) ))
  1704. #define GETPNTX2(drawpnt)   ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTX2_STARTBIT ) \
  1705.                                   & ((1<<PNTX2_NUMBITS)-1) ))
  1706. #define GETPNTY1(drawpnt)   ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTY1_STARTBIT ) \
  1707.                                   & ((1<<PNTY1_NUMBITS)-1) ))
  1708. #define GETPNTX1(drawpnt)   ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTX1_STARTBIT ) \
  1709.                                   & ((1<<PNTX1_NUMBITS)-1) ))
  1710. #define GETPNTPEN(drawpnt)  ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTPEN_STARTBIT ) \
  1711.                                   & ((1<<PNTPEN_NUMBITS)-1) ))
  1712. #define GETPNTMODE(drawpnt) ((UBYTE)( ( ((DRAWPNT)(drawpnt)) >> PNTMODE_STARTBIT ) \
  1713.                                   & ((1<<PNTMODE_NUMBITS)-1) ))
  1714.  
  1715. #define GO_DRAWPNT(mode,pen,x1,y1,x2,y2) \
  1716.         ((DRAWPNT)( (((ULONG)(mode)&((1<<PNTMODE_NUMBITS)-1))<<PNTMODE_STARTBIT) \
  1717.                   | (((ULONG)(pen)&((1<<PNTPEN_NUMBITS)-1))<<PNTPEN_STARTBIT) \
  1718.                   | (((UWORD)(x1)&((1<<PNTX1_NUMBITS)-1))<<PNTX1_STARTBIT) \
  1719.                   | (((UWORD)(y1)&((1<<PNTY1_NUMBITS)-1))<<PNTY1_STARTBIT) \
  1720.                   | (((UWORD)(x2)&((1<<PNTX2_NUMBITS)-1))<<PNTX2_STARTBIT) \
  1721.                   | (((UWORD)(y2)&((1<<PNTY2_NUMBITS)-1))<<PNTY2_STARTBIT) \
  1722.         ))
  1723.  
  1724. #define SCALE_MODE (0x0)
  1725. #define PIXEL_MODE (0x1)
  1726.  
  1727. #define GO_SCLPNT(pen,x1,y1,x2,y2) \
  1728.         GO_DRAWPNT(SCALE_MODE,pen,x1,y1,x2,y2)
  1729.  
  1730. #define PX1(x) (((UWORD)x)&((1<<(PNTX1_NUMBITS-1))-1))
  1731. #define PX2(x) ( (((UWORD)x)&((1<<(PNTX1_NUMBITS-1))-1)) | (1<<(PNTX1_NUMBITS-1)) )
  1732. #define PY1(y) (((UWORD)y)&((1<<(PNTY1_NUMBITS-1))-1))
  1733. #define PY2(y) ( (((UWORD)y)&((1<<(PNTY1_NUMBITS-1))-1)) | (1<<(PNTY1_NUMBITS-1)) )
  1734.  
  1735. #define GO_PIXPNT(pen,x1,y1,x2,y2) \
  1736.         GO_DRAWPNT(PIXEL_MODE,pen,x1,y1,x2,y2)
  1737.  
  1738. #define TAG_OUTLINE_DRAWBASE (TAG_USER+0xA000)
  1739.  
  1740. // Commands to control drawing pens.
  1741.  
  1742. #define TAG_OUTLINE_PENBASE (TAG_OUTLINE_DRAWBASE+1)
  1743.  
  1744. #define GODT_SetPen0        TAG_OUTLINE_PENBASE+0
  1745. #define GODT_SetPen1        TAG_OUTLINE_PENBASE+1
  1746. #define GODT_SetPen2        TAG_OUTLINE_PENBASE+2
  1747. #define GODT_SetPen3        TAG_OUTLINE_PENBASE+3
  1748. #define GODT_SetPen4        TAG_OUTLINE_PENBASE+4
  1749. #define GODT_SetPen5        TAG_OUTLINE_PENBASE+5
  1750. #define GODT_SetPen6        TAG_OUTLINE_PENBASE+6
  1751. #define GODT_SetPen7        TAG_OUTLINE_PENBASE+7
  1752. #define GODT_SetPen8        TAG_OUTLINE_PENBASE+8
  1753. #define GODT_SetPen9        TAG_OUTLINE_PENBASE+9
  1754. #define GODT_SetPen10       TAG_OUTLINE_PENBASE+10
  1755. #define GODT_SetPen11       TAG_OUTLINE_PENBASE+11
  1756. #define GODT_SetPen12       TAG_OUTLINE_PENBASE+12
  1757. #define GODT_SetPen13       TAG_OUTLINE_PENBASE+13
  1758. #define GODT_SetPen14       TAG_OUTLINE_PENBASE+14
  1759. #define GODT_SetPen15       TAG_OUTLINE_PENBASE+15
  1760. // Synonyms
  1761. #define GODT_SetDetailPen           TAG_OUTLINE_PENBASE+DETAILPEN
  1762. #define GODT_SetBlockPen            TAG_OUTLINE_PENBASE+BLOCKPEN
  1763. #define GODT_SetTextPen             TAG_OUTLINE_PENBASE+TEXTPEN
  1764. #define GODT_SetShinePen            TAG_OUTLINE_PENBASE+SHINEPEN
  1765. #define GODT_SetShadowPen           TAG_OUTLINE_PENBASE+SHADOWPEN
  1766. #define GODT_SetFillPen             TAG_OUTLINE_PENBASE+FILLPEN
  1767. #define GODT_SetFillTextPen         TAG_OUTLINE_PENBASE+FILLTEXTPEN
  1768. #define GODT_SetBackgroundPen       TAG_OUTLINE_PENBASE+BACKGROUNDPEN
  1769. #define GODT_SetHighlightTextPen    TAG_OUTLINE_PENBASE+HIGHLIGHTTEXTPEN
  1770. #define GODT_SetDrI9Pen             TAG_OUTLINE_PENBASE+9
  1771. #define GODT_SetDrI10Pen            TAG_OUTLINE_PENBASE+10
  1772. #define GODT_SetDrI11Pen            TAG_OUTLINE_PENBASE+11
  1773. #define GODT_SetDrI12Pen            TAG_OUTLINE_PENBASE+12
  1774. #define GODT_SetDrI13Pen            TAG_OUTLINE_PENBASE+13
  1775. #define GODT_SetDrI14Pen            TAG_OUTLINE_PENBASE+14
  1776. #define GODT_SetDrI15Pen            TAG_OUTLINE_PENBASE+15
  1777.      /* ULONG
  1778.       * Set the color of a standard system pen.
  1779.       *
  1780.       * These pens correspond to the screen's DrawInfo pens, and are
  1781.       * initialized to the values there before starting the draw.
  1782.       * Pen0 and Pen1 are special in that they coorespond to the RastPort's
  1783.       * A and B pens, in that they are the pens used by drawing commands that
  1784.       * don't take an explicit pen specification.
  1785.       */
  1786.  
  1787. // TAG NUMBERS 16 TO 29 RESERVED HERE
  1788.  
  1789. #define GODT_SetDrawInfo        (TAG_OUTLINE_PENBASE+30)
  1790.      /* struct DrawInfo *
  1791.       * Supply a custom DrawInfo.
  1792.       *
  1793.       * Extracts information from the given DrawInfo to be used in
  1794.       * the drawing.  Currently all this does is extract the dri_Pens,
  1795.       * although more could be done in the future.
  1796.       *
  1797.       * A NULL will reset from the GadOutline's go_DrI.
  1798.       *
  1799.       * Default: Use go_DrI
  1800.       */
  1801.  
  1802. #define GODT_SetDrawPens        (TAG_OUTLINE_PENBASE+31)
  1803.      /* UWORD *
  1804.       * Set pens from the given pen array.
  1805.       *
  1806.       * Takes a ~0 terminated pen array and sets the drawing's pens
  1807.       * based on it.  If the array ends before all of the pens have
  1808.       * been set, the remaining pens will be unchanged.
  1809.       *
  1810.       * Default: Use go_DrI->dri_DrawPens
  1811.       */
  1812.  
  1813. // TAG NUMBERS 32 TO 34 RESERVED HERE
  1814.  
  1815. #define GODT_SetCompPenMap      (TAG_OUTLINE_PENBASE+35)
  1816.      /* UWORD *
  1817.       * Set compliment pen mapping from the given array.
  1818.       *
  1819.       * Takes a ~0 terminated array and sets the drawing's compliment
  1820.       * pen map based on it.  If the array ends before all of the pens
  1821.       * have been set, the remaining pens will be unchanged.
  1822.       *
  1823.       * Default Compliment map:
  1824.       *           DETAILPEN --> BLOCKPEN
  1825.       *            BLOCKPEN --> DETAILPEN
  1826.       *             TEXTPEN --> BACKGROUNDPEN
  1827.       *            SHINEPEN --> SHADOWPEN
  1828.       *           SHADOWPEN --> SHINEPEN
  1829.       *             FILLPEN --> FILLTEXTPEN
  1830.       *         FILLTEXTPEN --> FILLPEN
  1831.       *       BACKGROUNDPEN --> TEXTPEN
  1832.       *    HIGHLIGHTTEXTPEN --> BACKGROUNDPEN
  1833.       */
  1834.  
  1835. #define GODT_SetUserPenMap      (TAG_OUTLINE_PENBASE+36)
  1836.      /* UWORD *
  1837.       * Set user pen mapping from the given array.
  1838.       *
  1839.       * Takes a ~0 terminated array and sets the drawing's user
  1840.       * pen map based on it.  If the array ends before all of the pens
  1841.       * have been set, the remaining pens will be unchanged.
  1842.       *
  1843.       * Default user map:
  1844.       *           DETAILPEN --> DETAILPEN
  1845.       *            BLOCKPEN --> BLOCKPEN
  1846.       *             TEXTPEN --> TEXTPEN
  1847.       *            SHINEPEN --> SHINEPEN
  1848.       *           SHADOWPEN --> SHADOWPEN
  1849.       *             FILLPEN --> FILLPEN
  1850.       *         FILLTEXTPEN --> FILLTEXTPEN
  1851.       *       BACKGROUNDPEN --> BACKGROUNDPEN
  1852.       *    HIGHLIGHTTEXTPEN --> HIGHLIGHTTEXTPEN
  1853.       */
  1854.  
  1855. #define GODT_SetHighPenMap      (TAG_OUTLINE_PENBASE+37)
  1856.      /* UWORD *
  1857.       * Set highlight pen mapping from the given array.
  1858.       *
  1859.       * Takes a ~0 terminated array and sets the drawing's highlight
  1860.       * pen map based on it.  If the array ends before all of the pens
  1861.       * have been set, the remaining pens will be unchanged.
  1862.       *
  1863.       * Default Highlight map:
  1864.       *           DETAILPEN --> BLOCKPEN
  1865.       *            BLOCKPEN --> DETAILPEN
  1866.       *             TEXTPEN --> FILLTEXTPEN
  1867.       *            SHINEPEN --> SHADOWPEN
  1868.       *           SHADOWPEN --> SHINEPEN
  1869.       *             FILLPEN --> BACKGROUNDPEN
  1870.       *         FILLTEXTPEN --> TEXTPEN
  1871.       *       BACKGROUNDPEN --> FILLPEN
  1872.       *    HIGHLIGHTTEXTPEN --> FILLTEXTPEN
  1873.       */
  1874.  
  1875. #define GODT_SetInactPenMap     (TAG_OUTLINE_PENBASE+38)
  1876.      /* UWORD *
  1877.       * Set inactive pen mapping from the given array.
  1878.       *
  1879.       * Takes a ~0 terminated array and sets the drawing's inactive
  1880.       * pen map based on it.  If the array ends before all of the pens
  1881.       * have been set, the remaining pens will be unchanged.
  1882.       *
  1883.       * Default Inactive map:
  1884.       *           DETAILPEN --> DETAILPEN
  1885.       *            BLOCKPEN --> BLOCKPEN
  1886.       *             TEXTPEN --> TEXTPEN
  1887.       *            SHINEPEN --> BACKGROUNDPEN
  1888.       *           SHADOWPEN --> SHADOWPEN
  1889.       *             FILLPEN --> BACKGROUNDPEN
  1890.       *         FILLTEXTPEN --> TEXTPEN
  1891.       *       BACKGROUNDPEN --> BACKGROUNDPEN
  1892.       *    HIGHLIGHTTEXTPEN --> TEXTPEN
  1893.       */
  1894.  
  1895. // TAG NUMBERS 39 TO 42 RESERVED HERE
  1896.  
  1897. #define GO_MAPPEN(from,to) ( ((from)<<16) | ((to)&0xFFFF) )
  1898.  
  1899. #define GODT_MapCompPen     (TAG_OUTLINE_PENBASE+43)
  1900. #define GODT_MapUserPen     (TAG_OUTLINE_PENBASE+44)
  1901. #define GODT_MapHighPen     (TAG_OUTLINE_PENBASE+45)
  1902. #define GODT_MapInactPen    (TAG_OUTLINE_PENBASE+46)
  1903.      /* ULONG
  1904.       * Set a single pen map entry.
  1905.       *
  1906.       * Sets the single pen map entry in the upper 16 bits to the
  1907.       * pen in the lower 16.
  1908.       * Ex:
  1909.       *     ..., GODT_MapUserPen, GO_MAPPEN(DETAILPEN,FILLPEN), ...
  1910.       * Would cause the DETAILPEN to be mapped to the FILLPEN when
  1911.       * the user map is turned on.
  1912.       */
  1913.  
  1914. // TAG NUMBERS 45 TO 49 RESERVED HERE
  1915.  
  1916. // Standard flag control
  1917.  
  1918. #define FLGSET(flg) ( ((ULONG)(flg))<<16 )      // Flag control bit
  1919. #define FLGON(flg)  ( FLGSET(flg) | (flg) )     // Set the given flag
  1920. #define FLGOFF(flg) ( FLGSET(flg) | 0 )         // Clear the given flag
  1921. #define FLGTOG(flg) ( (flg) )                   // Toggle the given flag
  1922. #define FLGALL(msk) ( 0xFFFF0000 | (msk) )      // Directly set all flags
  1923.  
  1924. #define GODT_SetRastMode            (TAG_OUTLINE_PENBASE+50)
  1925.      /* UBYTE
  1926.       * Set the rastport drawing mode for all operations.
  1927.       *
  1928.       * Can be combinations of JAM1, JAM2, COMPLEMENT, INVERSVID
  1929.       * as per SetDrMd().  Use FLGON(x) to set each flag and
  1930.       * FLGOFF(X) to clear them.  You can directly set every flag
  1931.       * using the macro SETALL(x), with x being the desired flag
  1932.       * states.
  1933.       *
  1934.       * Default: JAM1
  1935.       */
  1936.  
  1937. #define DRWMD_INACTIVE   (0x8000)   // Swap pens to create inactive state.
  1938. #define DRWMD_HIGHLIGHT  (0x4000)   // Swap pens to create highlight effect.
  1939. #define DRWMD_USERMAP    (0x2000)   // Do user mapping of pens.
  1940. #define DRWMD_COMPLIMENT (0x1000)   // Swap pens to get compliment.
  1941.  
  1942. #define GODT_SetDrawMode            (TAG_OUTLINE_PENBASE+51)
  1943.      /* UBYTE
  1944.       * Set the GadOutline drawing mode for all operations.
  1945.       *
  1946.       * Can be combinations of:
  1947.       *     DRWMD_INACTIVE, DRWMD_HIGHLIGHT, DRWMD_USER, DRWMD_COMPLIMENT
  1948.       *
  1949.       * GOSD_BoopsiIm and GOSD_BoopsiGad drawing objects will automatically
  1950.       * set the DRWMD_INACTIVE and DRWMD_HIGHLIGHT flags based on the draw
  1951.       * state requested by Intuition.  The pens are mapped in order from
  1952.       * DRWMD_INACTIVE to DRWMD_COMPLEMENT; so, if every map is turned on,
  1953.       * the pen used will be: dripen[inact[high[user[comp[reqpen]]]]].
  1954.       *
  1955.       * Use FLGON(x) to set each flag and FLGOFF(X) to clear them.  You can
  1956.       * directly set every flag using the macro SETALL(x), with x being the
  1957.       * desired flag states.
  1958.       *
  1959.       * Default: 0
  1960.       */
  1961.  
  1962. #define GODT_ChooseBPen         (TAG_OUTLINE_PENBASE+52)
  1963.      /* UWORD
  1964.       * Choose standard pen to be used as 'B Pen' in drawing operations
  1965.       * which refer to this pen.
  1966.       *
  1967.       * Default: BACKGROUNDPEN (7)
  1968.       */
  1969.  
  1970. #define GODT_SetStdDrawPat          (TAG_OUTLINE_PENBASE+53)
  1971.      /* ULONG
  1972.       * Set the line drawing pattern for all operations.
  1973.       *
  1974.       * Accepts an integer which is a standard line pattern.
  1975.       * Currently only understand 0, which resets the pattern
  1976.       * to 0xFFFF, but in the future other defaults may be defined
  1977.       * for real patterns along with pens, draw modes, etc for them.
  1978.       *
  1979.       * Default: 0
  1980.       */
  1981.  
  1982. #define GODT_SetCustDrawPat         (TAG_OUTLINE_PENBASE+54)
  1983.      /* UWORD
  1984.       * Set the line drawing pattern for all operations.
  1985.       *
  1986.       * Accepts a 16-bit value which is the new pattern to use.
  1987.       *
  1988.       * Default: 0xFFFF
  1989.       */
  1990.  
  1991. #define FLPAT_CLEAR     (0) // No pattern.
  1992. #define FLPAT_HASH2     (1) // 2 x 2 hash pattern.
  1993. #define FLPAT_DISABLED  (2) // 4 x 2 standard intuition disabled pattern.
  1994.  
  1995. #define GODT_SetStdFillPat          (TAG_OUTLINE_PENBASE+55)
  1996.      /* ULONG
  1997.       * Set the area filling pattern for all operations.
  1998.       *
  1999.       * Accepts an integer which is a standard fill pattern.
  2000.       * Currently only understands the three fill patterns
  2001.       * defined above.
  2002.       *
  2003.       * Default: 0
  2004.       */
  2005.  
  2006. #define GODT_SetCustFillPat2        (TAG_OUTLINE_PENBASE+56)
  2007.      /* ULONG
  2008.       * Set the area filling pattern for all operations.
  2009.       *
  2010.       * Accepts a 32-bit value which is the two lines of a new
  2011.       * 16 x 2 fill pattern to use.  The upper 16 bits are the
  2012.       * first line and the lower 16 are the second.
  2013.       *
  2014.       * Default: 0xFFFFFFFF
  2015.       */
  2016.  
  2017. #define GODT_SetCustFillPat4A       (TAG_OUTLINE_PENBASE+57)
  2018. #define GODT_SetCustFillPat4B       (TAG_OUTLINE_PENBASE+58)
  2019.      /* ULONG
  2020.       * Set the area filling pattern for all operations.
  2021.       *
  2022.       * Accepts a 32-bit value which is one-half of the 4 lines of
  2023.       * a new 16 x 4 fill pattern to use.  A assigns the upper two
  2024.       * lines, and B assigns the lower two.  The tags MUST be used
  2025.       * as a pair; never make assumptions about what an unspecified
  2026.       * piece will default to.
  2027.       */
  2028.  
  2029. // TAG NUMBERS 59 TO 69 RESERVED HERE
  2030.  
  2031. #define GO_BOXBOUNDS(x1,y1,x2,y2) \
  2032.     ( ((x1&0xF)<<12) | ((y1&0xF)<<8) | ((x2&0xF)<<4) | ((y2&0xF)<<0) )
  2033.  
  2034. #define GO_FRMBOUNDS(x1,y1,x2,y2,x3,y3,x4,y4) \
  2035.     ( (GO_BOXBOUNDS(x3,y3,x4,y4)<<16) | GO_BOXBOUNDS(x1,y1,x2,y2) )
  2036.  
  2037. #define GODT_ResetBounds        (TAG_OUTLINE_PENBASE+70)
  2038.      /* ULONG [See GO_BOXBOUNDS and GO_FRMBOUNDS macros.]
  2039.       * Set current drawing boundaries to box dimensions.
  2040.       *
  2041.       * The ULONG is divided into 8 4 bit values; the lower
  2042.       * 16 bits specify the corners of a standard boundary box
  2043.       * and the upper 16 bits, if not zero, create a frame box.
  2044.       * Valid x and y values are from 1 to 5, corresponding
  2045.       * to the left/above space, left/above text, width/height,
  2046.       * right/below text and right/below space.
  2047.       *
  2048.       * If the upper 16 bits are zero, The boundaries are reset
  2049.       * back to a box based on this environment's BoxAttr.
  2050.       * If the upper 16 bits are non-zero, a frame is created;
  2051.       * the top/left parts of the frame are specified from the
  2052.       * lower 16 bits and the bottom/right is from the upper 16.
  2053.       * NO BOUNDARY CHECKING IS DONE ON THESE VALUES!
  2054.       *
  2055.       * Ex: GO_BOXBOUNDS(3,3,3,3) - set to body area
  2056.       *     GO_BOXBOUNDS(1,1,5,5) - set to box area
  2057.       *     GO_FRMBOUNDS(1,1,1,1, 5,5,5,5) - set to space area frame.
  2058.       *
  2059.       * Note that frame boundary types are only partially supported. In
  2060.       * particular, when drawing text using frame boundaries, if the
  2061.       * cursor is positioned in the right/bottom part of the frame, it
  2062.       * will be reset back to (0,0) before drawing the text and the text
  2063.       * width/height will only be constrained by the top/left part of the
  2064.       * frame.
  2065.       */
  2066.  
  2067. #define GODT_SetLeftBound       (TAG_OUTLINE_PENBASE+71)
  2068. #define GODT_SetTopBound        (TAG_OUTLINE_PENBASE+72)
  2069. #define GODT_SetRightBound      (TAG_OUTLINE_PENBASE+73)
  2070. #define GODT_SetBottomBound     (TAG_OUTLINE_PENBASE+74)
  2071. #define GODT_SetWidthBound      (TAG_OUTLINE_PENBASE+75)
  2072. #define GODT_SetHeightBound     (TAG_OUTLINE_PENBASE+76)
  2073.      /* TYPEDSIZE
  2074.       * Set the specified boundary to an exact amount.
  2075.       *
  2076.       * The boundary is moved by the number of pixels that the
  2077.       * typed size evaluates to.  Note that it is entirely
  2078.       * possible for this to move the boundary outside of the
  2079.       * current BoxAttr.  Use the typed size mode GOM_Add to
  2080.       * move the box boundary relative to its current postion.
  2081.       *
  2082.       * GODT_SetLeftBound and GODT_SetTopBound will always leave
  2083.       * intact the previous Width/Height or Right/Bottom bound that
  2084.       * was set.  For example, if you set the right bound and then
  2085.       * the left, the width will change to keep the same right bound.
  2086.       * However, if you instead set the width and then the left edge,
  2087.       * the right bound will change to keep the same width.
  2088.       *
  2089.       * If the current boundary is a frame, it will be turned
  2090.       * into a standard box by this command.
  2091.       */
  2092.  
  2093. // TAG NUMBERS 77 TO 79 RESERVED HERE
  2094.  
  2095. #define GODT_SetCursorX     (TAG_OUTLINE_PENBASE+80)
  2096. #define GODT_SetCursorY     (TAG_OUTLINE_PENBASE+81)
  2097.      /* TYPEDSIZE
  2098.       * Set the cursor position to an exact amount.
  2099.       *
  2100.       * The cursor is moved by the number of pixels that the
  2101.       * typed size evaluates to.  Its position will be limited
  2102.       * to the current boundary limits.
  2103.       */
  2104.  
  2105. // TAG NUMBERS 82 TO 89 RESERVED HERE
  2106.  
  2107. #define TXTMD_LEFT      (0x0000)    // Justify left.
  2108. #define TXTMD_RIGHT     (0x0001)    // Justify right.
  2109. #define TXTMD_CENTER    (0x0002)    // Center text.
  2110. #define TXTMD_X         (0x0003)
  2111.  
  2112. #define SETMD_X(mode) ( FLGSET(TXTMD_X) | (mode) )
  2113.  
  2114. #define TXTMD_ENDRIGHT  (0x0000)    // Finish with cursor at rightmost point
  2115. #define TXTMD_ENDLEFT   (0x0004)    // Finish with cursor at leftmost point
  2116. #define TXTMD_ENDCENTER (0x0008)    // Finish with cursor at center point
  2117. #define TXTMD_END       (0x000C)
  2118.  
  2119. #define SETMD_END(mode) ( FLGSET(TXTMD_END) | (mode) )
  2120.  
  2121. #define TXTMD_RELCENTER (0x0000)    // Y coordinate is center of text
  2122. #define TXTMD_RELTOP    (0x0010)    // Y coordinate is top of text
  2123. #define TXTMD_RELBOTTOM (0x0020)    // Y coordinate is bottom of text
  2124. #define TXTMD_RELBASE   (0x0030)    // Y coordinate is baseline of text
  2125. #define TXTMD_Y         (0x00F0)
  2126.  
  2127. #define SETMD_Y(mode) ( FLGSET(TXTMD_Y) | (mode) )
  2128.  
  2129. #define TXTMD_CHOPLEFT  (0x0100)    // Chop text on left rather than right
  2130. #define TXTMD_REVCOLOR  (0x0200)    // Reverse text A and B colors
  2131.  
  2132. #define GODT_SetTextMode        (TAG_OUTLINE_PENBASE+90)
  2133.      /* UWORD
  2134.       * Set the positioning mode for drawing text.
  2135.       *
  2136.       * Can be combinations of:
  2137.       *     One of TXTMD_LEFT, TXTMD_RIGHT, TXTMD_CENTER;
  2138.       *     One of TXTMD_ENDLEFT, TXTMD_ENDRIGHT, TXTMD_ENDCENTER;
  2139.       *     One of TXTMD_RELTOP, TXTMD_RELBOTTOM, TXTMD_RELCENTER, TXTMD_RELBASE;
  2140.       *     Plus TXTMD_CHOPLEFT and TXTMD_REVCOLOR.
  2141.       *
  2142.       * Use FLGON(x) to set each flag and FLGOFF(X) to clear them.  You can
  2143.       * directly set every flag using the macro SETALL(x), with x being the
  2144.       * desired flag states.
  2145.       *
  2146.       * Default: 0
  2147.       */
  2148.  
  2149. #define GODT_ChooseTextAPen     (TAG_OUTLINE_PENBASE+91)
  2150.      /* UWORD
  2151.       * Choose standard pen to be used as 'A Pen' in text drawing operations.
  2152.       *
  2153.       * Default: TEXTPEN (2)
  2154.       */
  2155.  
  2156. #define GODT_ChooseTextBPen     (TAG_OUTLINE_PENBASE+92)
  2157.      /* UWORD
  2158.       * Choose standard pen to be used as 'B Pen' in text drawing operations.
  2159.       *
  2160.       * Default: BACKGROUNDPEN (7)
  2161.       */
  2162.  
  2163. // Low-level drawing commands
  2164.  
  2165. #define TAG_OUTLINE_LOWDRAWCMD (TAG_OUTLINE_DRAWBASE+0x100)
  2166.  
  2167. #define GODT_SetOrigin (TAG_OUTLINE_LOWDRAWCMD+1)
  2168.      /* DRAWPNT
  2169.       * Sets the origins for later use by PIXEL_MODE draw points.
  2170.       *
  2171.       * Resets the pixel-mode's origin1 and origin2 to
  2172.       * (x1,y1) and (x2,y2), respectively.  [This is the only
  2173.       * command that modifies the pixel-mode origin.]
  2174.       *
  2175.       * pen is ignored - always set to zero.
  2176.       */
  2177.  
  2178. #define GODT_WritePixel (TAG_OUTLINE_LOWDRAWCMD+2)
  2179.      /* DRAWPNT
  2180.       * Write a pixel at the location (x1,y1) in the given color.
  2181.       * x2 and y2 are ignored - always set to zero.
  2182.       */
  2183.  
  2184. #define GODT_WritePixel2 (TAG_OUTLINE_LOWDRAWCMD+3)
  2185.      /* DRAWPNT
  2186.       * Write a pixel at the location (x1,y1) and another pixel at
  2187.       * location (x2,y2), both in the given color.
  2188.       */
  2189.  
  2190. #define GODT_MoveTo (TAG_OUTLINE_LOWDRAWCMD+4)
  2191.      /* DRAWPNT
  2192.       * Move cursor to location (x1,y1).
  2193.       *
  2194.       * x2, y2 and pen are ignored - always set to zero.
  2195.       */
  2196.  
  2197. #define GODT_DrawTo (TAG_OUTLINE_LOWDRAWCMD+5)
  2198.      /* DRAWPNT
  2199.       * Draw a line from current cursor location to location (x1,y1)
  2200.       * in current pen.  Leaves cursor at location(x1,y1).
  2201.       * x2 and y2 are ignored - always set to zero.
  2202.       */
  2203.  
  2204. #define GODT_DrawTo2 (TAG_OUTLINE_LOWDRAWCMD+6)
  2205.      /* DRAWPNT
  2206.       * Draw a line from current cursor location to location (x1,y1)
  2207.       * and then another from there to (x2,y2), all in current pen.
  2208.       * Leaves cursor at location (x2,y2).
  2209.       */
  2210.  
  2211. #define GODT_DrawLine (TAG_OUTLINE_LOWDRAWCMD+7)
  2212.      /* DRAWPNT
  2213.       * Draw a line from location (x1,y1) to location (x2,y2)
  2214.       * in the current pen.
  2215.       */
  2216.  
  2217. #define GODT_DrawRect (TAG_OUTLINE_LOWDRAWCMD+8)
  2218.      /* DRAWPNT
  2219.       * Draw an unfilled rectangle with top-left corner at
  2220.       * location (x1,y1) and bottom-right corner at (x2,y2),
  2221.       * in given pen.
  2222.       */
  2223.  
  2224. #define GODT_DrawEllipse (TAG_OUTLINE_LOWDRAWCMD+9)
  2225.      /* DRAWPNT
  2226.       * Draw an unfilled ellipse with top-left corner at
  2227.       * location (x1,y1) and bottom-right corner at (x2,y2),
  2228.       * in given pen.
  2229.       */
  2230.  
  2231. // TAG NUMBERS 10 TO 29 RESERVED HERE
  2232.  
  2233. #define GODT_FillRect (TAG_OUTLINE_LOWDRAWCMD+30)
  2234.      /* DRAWPNT
  2235.       * Draw a filled rectangle with top-left corner at
  2236.       * location (x1,y1) and bottom-right corner at (x2,y2),
  2237.       * in given pen.
  2238.       */
  2239.  
  2240. #define GODT_EraseRect (TAG_OUTLINE_LOWDRAWCMD+31)
  2241.      /* DRAWPNT
  2242.       * Clear a rectangle with top-left corner at
  2243.       * location (x1,y1) and bottom-right corner at (x2,y2).
  2244.       * pen is ignored - always set to zero.
  2245.       * You will commonly start your drawing with a:
  2246.       *     GODT_ClearRect, GO_DRAWPNT(0,0,0,127,127), ...
  2247.       */
  2248.  
  2249. #define GODT_FillEllipse (TAG_OUTLINE_LOWDRAWCMD+32)
  2250.      /* DRAWPNT
  2251.       * Draw a filled ellipse with top-left corner at
  2252.       * location (x1,y1) and bottom-right corner at (x2,y2),
  2253.       * in given pen.
  2254.       */
  2255.  
  2256. #define GODT_AreaStart (TAG_OUTLINE_LOWDRAWCMD+33)
  2257.      /* DRAWPNT
  2258.       * Move to location (x1,y1) to start defining an area.
  2259.       * x2 and y2 and pen are ignored - always set to zero.
  2260.       */
  2261.  
  2262. #define GODT_AreaMoveTo (TAG_OUTLINE_LOWDRAWCMD+34)
  2263.      /* DRAWPNT
  2264.       * Move the current area position to location (x1,y1) of
  2265.       * an area definition that was started with above command.
  2266.       * x2 and y2 and pen are ignored - always set to zero.
  2267.       */
  2268.  
  2269. #define GODT_AreaDrawTo (TAG_OUTLINE_LOWDRAWCMD+35)
  2270.      /* DRAWPNT
  2271.       * Add a line from current area position to location (x1,y1)
  2272.       * into an area definition that was started with above command.
  2273.       * x2 and y2 and pen are ignored - always set to zero.
  2274.       */
  2275.  
  2276. #define GODT_AreaDrawTo2 (TAG_OUTLINE_LOWDRAWCMD+36)
  2277.      /* DRAWPNT
  2278.       * Add a line from current area position to location (x1,y1)
  2279.       * and then from there to (x2,y2) into an area definition that
  2280.       * was started with GODT_AreaStart command.
  2281.       * pen is ignored - always set to zero.
  2282.       */
  2283.  
  2284. #define GODT_AreaFill (TAG_OUTLINE_LOWDRAWCMD+37)
  2285.      /* DRAWPNT
  2286.       * Fill in area defined by previous tags with color pen.
  2287.       * x1, y1 and x2, y2 are ignored - always set to zero.
  2288.       */
  2289.  
  2290. // TAG NUMBERS 38 TO 49 RESERVED HERE
  2291.  
  2292. #define GODT_DrawStdFrame (TAG_OUTLINE_LOWDRAWCMD+50)
  2293.      /* DRAWPNT
  2294.       * Draw a standard 2.0-style 3D frame with corners at
  2295.       * (x1,y1) and (x2,y2).  The top-left side is drawn
  2296.       * in the given pen color, and the bottom-right in its
  2297.       * compliment.  So a pen of SHINEPEN will produce a
  2298.       * raised frame and SHADOWPEN a recessed one.
  2299.       */
  2300.  
  2301. #define GODT_DrawStrFrame (TAG_OUTLINE_LOWDRAWCMD+51)
  2302.      /* DRAWPNT
  2303.       * Draw a standard 2.0-style 3D string frame.
  2304.       */
  2305.  
  2306. // TAG NUMBERS 52 TO 59 RESERVED HERE
  2307.  
  2308. #define GODT_AdjustBounds       (TAG_OUTLINE_LOWDRAWCMD+60)
  2309.      /* DRAWPNT
  2310.       * Adjust the current drawing boundaries.
  2311.       *
  2312.       * The new boundary's top-left corner is at (x1,y1)
  2313.       * and bottom-right at (x2,y2) relative to the
  2314.       * CURRENT boundaries.  (You can only shrink the
  2315.       * boundaries using this command.)
  2316.       *
  2317.       * If the current boundary is a frame, it will be turned
  2318.       * into a standard box by this command.
  2319.       */
  2320.  
  2321. // Text drawing commands
  2322. #define TAG_OUTLINE_TEXTDRAWCMD (TAG_OUTLINE_DRAWBASE+0x200)
  2323.  
  2324. #define GODT_DrawText (TAG_OUTLINE_TEXTDRAWCMD+1)
  2325.      /* UBYTE *
  2326.       * Draw the given text onto the screen, centering and clipping
  2327.       * as needed to make it fit within the box's boundaries.
  2328.       * Uses current GODT_SetDrawMode, GODT_ChooseTextAPen and
  2329.       * GODT_ChooseTextBPen settings.
  2330.       */
  2331.  
  2332. #define GODT_DrawOldText (TAG_OUTLINE_TEXTDRAWCMD+2)
  2333.      /* UBYTE *
  2334.       * Same as GODT_DrawText, except pens A and B are the DetailPen
  2335.       * and its compliment, respectively.
  2336.       */
  2337.  
  2338. #define GODT_DrawStdText (TAG_OUTLINE_TEXTDRAWCMD+3)
  2339.      /* UBYTE *
  2340.       * Same as GODT_DrawText, except pens A and B are the TextPen
  2341.       * and its compliment, respectively.
  2342.       */
  2343.  
  2344. #define GODT_DrawHighText (TAG_OUTLINE_TEXTDRAWCMD+4)
  2345.      /* UBYTE *
  2346.       * Same as GODT_DrawText, except pens A and B are the
  2347.       * and its compliment, respectively.
  2348.       */
  2349.  
  2350. #define GODT_DrawFillText (TAG_OUTLINE_TEXTDRAWCMD+5)
  2351.      /* UBYTE *
  2352.       * Same as GODT_DrawText, except pens A and B are the FillTextPen
  2353.       * and its compliment, respectively.
  2354.       */
  2355.  
  2356. #define GODT_DrawTextTag (TAG_OUTLINE_TEXTDRAWCMD+6)
  2357. #define GODT_DrawOldTextTag (TAG_OUTLINE_TEXTDRAWCMD+7)
  2358. #define GODT_DrawStdTextTag (TAG_OUTLINE_TEXTDRAWCMD+8)
  2359. #define GODT_DrawHighTextTag (TAG_OUTLINE_TEXTDRAWCMD+9)
  2360. #define GODT_DrawFillTextTag (TAG_OUTLINE_TEXTDRAWCMD+10)
  2361.      /* Tag
  2362.       * Same as previous tags, except the data is a tag to look for
  2363.       * within the command list which contains a text pointer. Ex:
  2364.       * ..., GOCT_BorderText, "Hi!", GODT_DrawTextTag, GOCT_BorderText, ...
  2365.       * Would print "Hi!" at the current cursor position.
  2366.       */
  2367.  
  2368. // TAG NUMBERS 11 TO 29 RESERVED HERE
  2369.  
  2370. #define GODT_NewLine (TAG_OUTLINE_TEXTDRAWCMD+30)
  2371.      /* ULONG
  2372.       * Perform a carriage return / new line operation on the cursor.
  2373.       *
  2374.       * The x position is reset to zero [left side of bounding box]
  2375.       * and the y position is incremented by the font height times
  2376.       * the given tag's data field.
  2377.       */
  2378.  
  2379. // TAG NUMBERS 31 TO 89 RESERVED HERE
  2380.  
  2381. #define GODT_LeftTextPtr (TAG_OUTLINE_TEXTDRAWCMD+90)
  2382. #define GODT_AboveTextPtr (TAG_OUTLINE_TEXTDRAWCMD+91)
  2383. #define GODT_BodyTextPtr (TAG_OUTLINE_TEXTDRAWCMD+92)
  2384. #define GODT_RightTextPtr (TAG_OUTLINE_TEXTDRAWCMD+93)
  2385. #define GODT_BelowTextPtr (TAG_OUTLINE_TEXTDRAWCMD+94)
  2386.      /* UBYTE *
  2387.       *
  2388.       * These are "fake" tags which can be used with the
  2389.       * GODT_DrawText*Tag tags above; they are otherwise ignored.
  2390.       */
  2391.  
  2392. // Drawing environment commands
  2393. #define TAG_OUTLINE_DRAWENVCMD (TAG_OUTLINE_DRAWBASE+0x300)
  2394.  
  2395. #define GODT_ExecDrawing (TAG_OUTLINE_DRAWENVCMD+1)
  2396.      /* struct TagItem *
  2397.       * Execute the drawing commands pointed to.
  2398.       *
  2399.       * This tag causes the drawing tags to which it points to be
  2400.       * executed exactly as if they are in this list.  Any changes
  2401.       * they make to the current environment will not be restored
  2402.       * when they are finished.
  2403.       *
  2404.       * Note that the commands which take identifiers for tags which
  2405.       * occur in the list [ie GODT_DrawTextTag] still search the
  2406.       * _original_ command tag list and not the child list.
  2407.       */
  2408.  
  2409. #define GODT_SpawnDrawing (TAG_OUTLINE_DRAWENVCMD+2)
  2410.      /* struct TagItem *
  2411.       * Execute the drawing in its own environment.
  2412.       *
  2413.       * This tag is identical to GODT_ExecuteDrawing except
  2414.       * that it creates a new environment before executing the
  2415.       * given tag list and restores the old environment after
  2416.       * it has finished.  This means that any changes [ie, pen
  2417.       * colors, bounds, etc], made by the commands will not
  2418.       * effect the caller's environment.
  2419.       */
  2420.  
  2421. /***
  2422.  *** These are the global GadOutline tags which are passed to the
  2423.  *** functions AllocGadOutline(), DimenGadOutline(), RebuidldGadOutline(),
  2424.  *** ResizeGadOutline(), DestroyGadOutline(), HookGadOutline(),
  2425.  *** UnhookGadOutline(), DrawGadOutline().
  2426.  ***/
  2427.  
  2428. #define TAG_OUTLINE (TAG_USER+0x8000)
  2429.  
  2430. #define GOA_BaseName (TAG_OUTLINE+1)
  2431.      /* UBYTE *
  2432.       * Set program BaseName associated with this GadOutline.
  2433.       *
  2434.       * Default: NULL  (no base name)
  2435.       */
  2436.  
  2437. #define GOA_ErrorCode (TAG_OUTLINE+2)
  2438.      /* GOERR *
  2439.       * Give a memory location to store GadOutline error codes in.
  2440.       *
  2441.       * Default: NULL  (no errors stored)
  2442.       */
  2443.  
  2444. #define GOA_ErrorText (TAG_OUTLINE+3)
  2445.      /* UBYTE **
  2446.       * Give a memory location to store GadOutline error text in.
  2447.       *
  2448.       * Default: NULL  (no errors stored)
  2449.       */
  2450.  
  2451. #define GOA_SetUserData (TAG_OUTLINE+4)
  2452.      /* void *
  2453.       * Set the GadOutline's UserData variable.
  2454.       *
  2455.       * Default: NULL
  2456.       */
  2457.  
  2458. #define GOA_SetUserHandler (TAG_OUTLINE+5)
  2459.      /* void *
  2460.       * Set the GadOutline's UserHandler variable.
  2461.       *
  2462.       * This is intended to be used as a vector to the user's code which
  2463.       * handles IDCMP messages from this window.  However, the library
  2464.       * currently does nothing with it and you are free to use this variable
  2465.       * in whatever way you want.
  2466.       *
  2467.       * Default: NULL
  2468.       */
  2469.  
  2470. #define GOA_SetTransHook (TAG_OUTLINE+6)
  2471.      /* struct Hook *
  2472.       * Set the GadOutline's user Translation hook.
  2473.       *
  2474.       * Default: NULL  (no user translation)
  2475.       */
  2476.  
  2477. #define GOA_SetTransHookData (TAG_OUTLINE+7)
  2478.      /* void *
  2479.       * Set the GadOutline's TransHookData variable.
  2480.       *
  2481.       * Default: NULL
  2482.       */
  2483.  
  2484. // TAG NUMBERS 8 TO 99 RESERVED HERE
  2485.  
  2486. #define GOA_DisplayID (TAG_OUTLINE+100)
  2487.      /* ULONG
  2488.       * Specify a standard graphics.library display ID.
  2489.       */
  2490. #define GOA_Overscan    (TAG_OUTLINE+101)
  2491.      /* ULONG
  2492.       * Specify a standard screen overscan mode.
  2493.       *
  2494.       * If no screen or window set for outline, these tags are used to find
  2495.       * some basic values for doing a layout.  This is most often used to find
  2496.       * a font that the outline will fit in a screen before opening the screen.
  2497.       *
  2498.       * These tags will automatically set the minimum layout dimensions
  2499.       * to zero and the maximum dimensions to the size of the display mode.
  2500.       *
  2501.       * GOA_DisplayID default: 0 (generic lores)
  2502.       * GOA_Overscan default: OSCAN_TEXT
  2503.       */
  2504.  
  2505. #define GOA_ScreenAddr (TAG_OUTLINE+102)
  2506.      /* struct Screen *
  2507.       * Specify the screen to put the outline on.
  2508.       */
  2509. #define GOA_ScreenName (TAG_OUTLINE+103)
  2510.      /* UBYTE *
  2511.       * Specify the name of a public screen to put the outline on.
  2512.       *
  2513.       * If no window is supplied, these tags are used to specify the screen
  2514.       * that the outline will be on.  If the outline is already on a window
  2515.       * or another screen, that window and/or screen is closed before going
  2516.       * onto this screen.  If the screen name is NULL or the named screen
  2517.       * can not be opened and GOA_ScreenFallBack is TRUE, the default screen
  2518.       * will be used.  When opening on a screen, the screen is automatically
  2519.       * locked and will remain locked until the outline is removed from the
  2520.       * screen.
  2521.       *
  2522.       * Note that only one of these tags should be specified.
  2523.       * These tags will automatically set the minimum layout dimensions
  2524.       * to zero and the maximum dimensions to the size of the screen.
  2525.       *
  2526.       * GOA_ScreenAddr default: NULL (none)
  2527.       * GOA_ScreenName default: NULL (default pub screen)
  2528.       */
  2529.  
  2530. #define GOA_WindowAddr (TAG_OUTLINE+104)
  2531.      /* Struct Window *
  2532.       * Specify the window to put the outline on.
  2533.       *
  2534.       * This tag gives the actual window on which to create the layout
  2535.       * and allows the library to create all of its object and link them
  2536.       * to the window.  While the window is linked to the outline, it is
  2537.       * essentially owned by the library -- all IDCMP messages and
  2538.       * refreshing must go through the library routines, and the library
  2539.       * owns the window's UserData variable.
  2540.       *
  2541.       * This tag will automatically set the minimum layout dimensions
  2542.       * AND the maximum dimensions to the size of the window.
  2543.       *
  2544.       * Default: NULL (none)
  2545.       */
  2546.  
  2547. #define GOA_MaxWidth    (TAG_OUTLINE+105)
  2548. #define GOA_MaxHeight (TAG_OUTLINE+106)
  2549.      /* ULONG
  2550.       * Specify maximum size that the gadoutline layout can be.
  2551.       */
  2552. #define GOA_MinWidth    (TAG_OUTLINE+107)
  2553. #define GOA_MinHeight (TAG_OUTLINE+108)
  2554.      /* ULONG
  2555.       * Specify minimum size that the gadoutline layout can be.
  2556.       *
  2557.       * These are used to override the default max/min layout dimensions
  2558.       * set up by the library.  They must be included at every call to
  2559.       * Remake/Resize/Hook/Unhook/etc or else they will revert to the
  2560.       * default dimensions as described above.
  2561.       *
  2562.       * Default: from window/screen/displayid as above.
  2563.       */
  2564.  
  2565. #define GOA_TextAttr    (TAG_OUTLINE+109)
  2566.      /* struct TextAttr *
  2567.       * Specify the prefered font to use for the layout
  2568.       *
  2569.       * This tag specifies a complete font description to attempt to
  2570.       * do the layout in, overriding the default use of the Window or
  2571.       * Screen's font.  If the layout will not fit within its maximum
  2572.       * dimensions using this font, the library will override it.
  2573.       *
  2574.       * Default: from window or screen or just boring 'ol Topaz 8.
  2575.       */
  2576.  
  2577. #define GOA_FontName    (TAG_OUTLINE+110)
  2578.      /* UBYTE *
  2579.       * Specify the prefered font name, with or without .font suffix.
  2580.       */
  2581. #define GOA_FontSize    (TAG_OUTLINE+111)
  2582.      /* UWORD
  2583.       * Specify the prefered font size.
  2584.       */
  2585. #define GOA_FontStyle (TAG_OUTLINE+112)
  2586.      /* UBYTE
  2587.       * Specify the prefered font style.
  2588.       *
  2589.       * These tags can be used instead of GOA_FontAttr, or used to modify
  2590.       * the values supplied within the GOA_FontAttr.
  2591.       *
  2592.       * Default: what GOA_FontAttr specified (or didn't, as the case may be. :)
  2593.       */
  2594.  
  2595. #define GOA_ErrorReportLevel (TAG_OUTLINE+113)
  2596.      /* UWORD
  2597.       * Specify which errors will be reported by displaying a requester.
  2598.       *
  2599.       * This tag specifies which GOTYPE_ error codes will cause GOA_SetError
  2600.       * to fall through to GOA_ShowError.  It is formatted as a bit mask,
  2601.       * one bit for each possible error type, with the least significant
  2602.       * bit being GOTYPE_NONE.
  2603.       *
  2604.       * Default:  (1L<<GOTYPE_FINE)  | (1L<<GOTYPE_NOTE)   | (1L<<GOTYPE_WARN)
  2605.       *         | (1L<<GOTYPE_ALERT) | (1L<<GOTYPE_ALERT2) | (1L<<GOTYPE_ALERT3)
  2606.       *         | (1L<<GOTYPE_FAIL)  | (1L<<GOTYPE_FAIL2)  | (1L<<GOTYPE_FAIL3)
  2607.       *
  2608.       * A good value to use for debugging is:
  2609.       *
  2610.       *           (1L<<GOTYPE_FINE)  | (1L<<GOTYPE_FINE2)
  2611.       *         | (1L<<GOTYPE_NOTE)  | (1L<<GOTYPE_NOTE2)
  2612.       *         | (1L<<GOTYPE_WARN)  | (1L<<GOTYPE_WARN2)
  2613.       *         | (1L<<GOTYPE_ALERT) | (1L<<GOTYPE_ALERT2) | (1L<<GOTYPE_ALERT3)
  2614.       *         | (1L<<GOTYPE_FAIL)  | (1L<<GOTYPE_FAIL2)  | (1L<<GOTYPE_FAIL3)
  2615.       */
  2616.  
  2617. #define GOA_ErrorFailLevel (TAG_OUTLINE+114)
  2618.      /* UWORD
  2619.       * Specify which unreported errors will become failures.
  2620.       *
  2621.       * This tag specifies which GOTYPE_ error codes, which have been set to
  2622.       * be unreported by the previous tag, will result in a failure being
  2623.       * reported.  It is formatted identically to the previous tag.
  2624.       *
  2625.       * Note that this allows you to turn error types that would normally
  2626.       * always be a failure or a continuation into something they are not, 
  2627.       * which is obviously not a good thing to do. :)
  2628.       *
  2629.       * Default:  (1L<<GOTYPE_ALERT) | (1L<<GOTYPE_ALERT2) | (1L<<GOTYPE_ALERT3)
  2630.       *         | (1L<<GOTYPE_FAIL)  | (1L<<GOTYPE_FAIL2)  | (1L<<GOTYPE_FAIL3)
  2631.       */
  2632.  
  2633.  
  2634. #define GOA_UserIDCMP (TAG_OUTLINE+115)
  2635.      /* struct MsgPort *
  2636.       * Specify custom message port for window's IDCMP.
  2637.       *
  2638.       * This allows you to supply a custom IDCMP port for windows opened
  2639.       * using GOA_OpenWindow().  This port will be automatically attached
  2640.       * and removed from the window by the library.  A value of ~0 will
  2641.       * cause the library to allocate the message port itself and manage
  2642.       * it internally.
  2643.       *
  2644.       * Default: let window make its own.
  2645.       */
  2646.  
  2647. #define GOA_OutlineSize (TAG_OUTLINE+116)
  2648.      /* ULONG
  2649.       * Supply bounds checking for parsing the outline array.
  2650.       *
  2651.       * This is the number of BYTES your full outline is.  If the library
  2652.       * goes over this number of bytes while parsing it, a fatal error
  2653.       * will occur telling you so.
  2654.       *
  2655.       * Default: if you messed it up, too bad.
  2656.       */
  2657.  
  2658. #define GOA_FontMinSize (TAG_OUTLINE+117)
  2659.      /* UWORD
  2660.       * Set the minimum point size we will scale font back to.
  2661.       *
  2662.       * Default: 8 points
  2663.       */
  2664.  
  2665.  
  2666. #define GOA_AllocMenus (TAG_OUTLINE+118)
  2667.      /* struct NewMenu *
  2668.       * Supplies a GadTools NewMenu array to be automatically allocated
  2669.       * and layed-out/attached to a window opened with GOA_OpenWindow().
  2670.       *
  2671.       * Default: No menus.
  2672.       */
  2673.  
  2674. #define GOA_GToolsMenus (TAG_OUTLINE+119)
  2675.      /* struct Menu *
  2676.       * Supplies a menu strip that was allocated by GadTools, to be automatically
  2677.       * layed-out and attached to a window opened with GOA_OpenWindow().
  2678.       *
  2679.       * Default: No menus.
  2680.       */
  2681.  
  2682. #define GOA_StandardMenus (TAG_OUTLINE+120)
  2683.      /* struct Menu *
  2684.       * Supplies a menu strip that will be attached to a window opened
  2685.       * with GOA_OpenWindow().  No layout or anything else of the menus
  2686.       * is performed before it is attached.
  2687.       *
  2688.       * Default: No menus.
  2689.       */
  2690.  
  2691. // TAG NUMBERS 121 TO 199 RESERVED HERE
  2692.  
  2693. // Flags
  2694.  
  2695. #define GOA_FontSystemOnly (TAG_OUTLINE+200)
  2696.      /* BOOL
  2697.       * Only allow the library to fall back to the default system fonts.
  2698.       *
  2699.       * If TRUE, the library will not attempt to reduce the point size
  2700.       * of the font requested by the caller in order to make it fit
  2701.       * within the current constraints, and will instead immediately
  2702.       * start trying the system fonts.  The system font order is:
  2703.       *   window -> screen -> gfxdefault -> topaz8
  2704.       *
  2705.       * Default: FALSE
  2706.       */
  2707.  
  2708. #define GOA_FontROMFont     (TAG_OUTLINE+201)
  2709.      /* BOOL
  2710.       * Set the ROMFONT flag in the TextAttr used to open fonts
  2711.       */
  2712. #define GOA_FontDiskFont        (TAG_OUTLINE+202)
  2713.      /* BOOL
  2714.       * Set the DISKFONT flag in the TextAttr used to open fonts
  2715.       */
  2716. #define GOA_FontDesigned        (TAG_OUTLINE+203)
  2717.      /* BOOL
  2718.       * Set the DESIGNED flag in the TextAttr used to open fonts
  2719.       *
  2720.       * These flags are used set information in the TextAttr before
  2721.       * calling the system to open the font.  Their interpretation
  2722.       * depends on the OS, except setting GOA_FontDiskFont to TRUE
  2723.       * will cause the library to try to open diskfont.library and use
  2724.       * OpenDiskFont() instead of OpenFont().
  2725.       *
  2726.       * GOA_FontROMFont Default: FALSE
  2727.       * GOA_FontDiskFont Default: TRUE
  2728.       * GOA_FontDesigned Default: TRUE
  2729.       */
  2730.  
  2731. #define GOA_ScreenFallBack  (TAG_OUTLINE+204)
  2732.      /* BOOL
  2733.       * Try to open default screen if unable to open a named screen.
  2734.       *
  2735.       * If TRUE, the library will attempt to open the default public screen
  2736.       * if it was unable to open the screen name supplied with GOA_ScreenName.
  2737.       *
  2738.       * Default: TRUE
  2739.       */
  2740.  
  2741. #define GOA_AutoSizeVerify  (TAG_OUTLINE+205)
  2742.      /* BOOL
  2743.       * Specify whether to respond to IDCMP_SIZEVERIFY events.
  2744.       *
  2745.       * If TRUE, the library will automatically unhook the gadgets from
  2746.       * the window before allowing it to be resized.  This keeps the window
  2747.       * frame from getting trashed by the old gadgets during a resize and
  2748.       * usually means you won't need to refresh the frame.  However, with
  2749.       * complex layouts there may be a noticable delay between the user
  2750.       * pressing the resize gadget and being allowed to move the window.
  2751.       *
  2752.       * Default: TRUE
  2753.       */
  2754.  
  2755. #define GOA_AutoNewSize     (TAG_OUTLINE+206)
  2756.      /* BOOL
  2757.       * Specify whether to respond to IDCMP_NEWSIZE events.
  2758.       *
  2759.       * If TRUE, the library will automatically call ResizeGadOutline()
  2760.       * whenever the window size changes.
  2761.       *
  2762.       * Default: TRUE
  2763.       */
  2764.  
  2765. #define GOA_AddOutlineIDCMP (TAG_OUTLINE+207)
  2766.      /* BOOL
  2767.       * Automatically add IDCMP events needed by library.
  2768.       *
  2769.       * If TRUE, the window will be set to report all IDCMP events needed
  2770.       * by the library.  This includes IDCMP_NEWSIZE, IDCMP_SIZEVERIFY and
  2771.       * IDCMP_RAWKEY, depending on whether the library has been told to
  2772.       * respond to these.
  2773.       *
  2774.       * Default: TRUE
  2775.       */
  2776.  
  2777. #define GOA_AddObjectIDCMP  (TAG_OUTLINE+208)
  2778.      /* BOOL
  2779.       * Automatically add IDCMP events needed by objects.
  2780.       *
  2781.       * If TRUE, the window will be set to report all IDCMP events needed
  2782.       * by any objects in the layout.  The exact events which will be
  2783.       * set depends on the objects.
  2784.       *
  2785.       * Default: TRUE
  2786.       */
  2787.  
  2788. #define GOA_DoHookCallback  (TAG_OUTLINE+209)
  2789.      /* BOOL
  2790.       * Send objects HOOK/UNHOOK messages.
  2791.       *
  2792.       * If TRUE, the library will send a CHM_HOOKOBJ when the objects are
  2793.       * being hooked to the window and CHM_UNHOOKOBJ when they are being
  2794.       * removed from the window.  Normally, these operations simply involve
  2795.       * removing all of the gadget lists from the window, and so this flag
  2796.       * is set to FALSE.  If your user hook needs to do something special,
  2797.       * set this to TRUE.  Please _never_ set this to false, so that the
  2798.       * library can change the default condition of this to TRUE at a later
  2799.       * time.
  2800.       *
  2801.       * Default: FALSE
  2802.       */
  2803.  
  2804. #define GOA_RedrawWinFrame  (TAG_OUTLINE+210)
  2805.      /* BOOL
  2806.       * Redraw window frame after a window resize.
  2807.       *
  2808.       * If TRUE, the library will automatically refresh the window's frame
  2809.       * after it has been resized.  Normally the library looks for
  2810.       * IDCMP_SIZEVERIFY events and removes the gadgets during a resize
  2811.       * so this does not usually need to happen.
  2812.       *
  2813.       * Default: FALSE
  2814.       */
  2815.  
  2816. #define GOA_SetWindowFont   (TAG_OUTLINE+211)
  2817.      /* BOOL
  2818.       * Set the window's RastPort font to the outline's final font.
  2819.       *
  2820.       * If TRUE, the library will automatically set the window's RastPort
  2821.       * to the font that it uses for the layout (ie, go_TextFont).  This
  2822.       * means that you should not change the window font yourself, or if you
  2823.       * do change it you must change it back before calling any gadoutline
  2824.       * library functions.
  2825.       *
  2826.       * Default: TRUE
  2827.       */
  2828.  
  2829. #define GOA_ClearFullWin        (TAG_OUTLINE+212)
  2830.      /* BOOL
  2831.       * Clear entire window when remaking objects.
  2832.       *
  2833.       * If TRUE, the library will erase the entire window after destroying
  2834.       * all objects and getting ready to remake them.
  2835.       * If FALSE, only the area covered by the layout will be cleared.
  2836.       *
  2837.       * You will usually need to set this flag if you are drawing in the
  2838.       * space area around the root group.  Otherwise, the library leaves
  2839.       * this space alone to allow you to reserve it for yourself.
  2840.       *
  2841.       * Default: FALSE
  2842.       */
  2843.  
  2844. #define GOA_SaveWinDimens       (TAG_OUTLINE+213)
  2845.      /* BOOL
  2846.       * Remember the window dimensions on open/close.
  2847.       *
  2848.       * If TRUE, GOA_CloseWindow() will save the window's dimensions before
  2849.       * closing and a subsequent call to GOA_OpenWindow() will try to match
  2850.       * those dimensions as closely as possible.
  2851.       *
  2852.       * Default: TRUE
  2853.       */
  2854.  
  2855. #define GOA_WindowRelative      (TAG_OUTLINE+214)
  2856.      /* BOOL
  2857.       * Window position is a relative value.
  2858.       *
  2859.       * If TRUE, any value supplied in WA_LeftEdge and WA_TopEdge is
  2860.       * relative to either the screen's title bar or, if the screen is
  2861.       * bigger than the display, the left and top positions of the display
  2862.       * on the screen.  [Ie, so that the window appears on the visible
  2863.       * portion of the screen.]  In addition, the window's size will be
  2864.       * reduced, if possible, to make sure it fits within the display
  2865.       * area and WA_InnerWidth and WA_InnerHeight will be relative to the
  2866.       * current layout's minimum dimensions.
  2867.       *
  2868.       * Default: TRUE
  2869.       */
  2870.  
  2871. #define GOA_WindowResize        (TAG_OUTLINE+215)
  2872.      /* BOOL
  2873.       * Scale window size if layout doesn't fit on it.
  2874.       * NOT IMPLEMENTED.
  2875.       *
  2876.       * If TRUE, the library will attempt to enlarge the window if
  2877.       * its prefered layout dimensions will fit on a bigger window.
  2878.       * The window will not be resized if the layout won't fit within
  2879.       * the largest window on its screen.  [In other words, the window
  2880.       * size will only change when this will guarantee that the layout
  2881.       * will fit on it.]
  2882.       *
  2883.       * Default: TRUE
  2884.       */
  2885.  
  2886. #define GOA_AutoHotKeys     (TAG_OUTLINE+216)
  2887.      /* BOOL
  2888.       * Automatically process object hot keys.
  2889.       *
  2890.       * Default: TRUE
  2891.       */
  2892.  
  2893. /**
  2894.  ** Error code definitions
  2895.  **/
  2896. typedef unsigned long GOERR;
  2897.  
  2898. #define ERRCODE_STARTBIT (0)    // ID describing the error.
  2899. #define ERRCODE_NUMBITS (16)
  2900. #define ERRTYPE_STARTBIT (24)   // Severity of error.
  2901. #define ERRTYPE_NUMBITS (4)
  2902.  
  2903. // Bit allocation:
  2904. //
  2905. // 3  2    2    2    1    1    0    0    0
  2906. // 1  8    4    0    6    2    8    4    0
  2907. // xxxx TTTT xxxx xxxx CCCC CCCC CCCC CCCC
  2908. //
  2909. // T = Error type
  2910. // C = Error code
  2911. // x = reserved.  always set to 0.
  2912.  
  2913. #define GETERRCODE(goerr)   ((ULONG)( ( ((GOERR)(goerr)) >> ERRCODE_STARTBIT ) \
  2914.                                       & ((1<<ERRCODE_NUMBITS)-1) ))
  2915. #define GETERRTYPE(goerr)   ((ULONG)( ( ((GOERR)(goerr)) >> ERRTYPE_STARTBIT ) \
  2916.                                       & ((1<<ERRTYPE_NUMBITS)-1) ))
  2917.  
  2918. #define GO_MAKEERR(type,code) \
  2919.         ((GOERR)( (((ULONG)(type)&((1<<ERRTYPE_NUMBITS)-1))<<ERRTYPE_STARTBIT) \
  2920.                   | (((ULONG)(code)&((1<<ERRCODE_NUMBITS)-1))<<ERRCODE_STARTBIT) \
  2921.         ))
  2922.  
  2923. #define GOCODE_NONE         0   // No problem.  Only use with GOTYPE_NONE.
  2924.                                 // ErrObj = none.
  2925. #define GOCODE_GENERAL      1   // General-purpose error code.
  2926.                                 // ErrObj = none.
  2927. #define GOCODE_MEMORY       2   // Not enough memory.
  2928.                                 // ErrObj = (ULONG) - Memory size requested.
  2929. #define GOCODE_OPENLIB      3   // Unable to open a library.
  2930.                                 // ErrObj = (UBYTE *) - explantion text.
  2931. #define GOCODE_OPENFONT     4   // Unable to open a font.
  2932.                                 // ErrObj - (struct TextAttr *) - font we tried.
  2933. #define GOCODE_INTERR       5   // Internal error occured.
  2934.                                 // ErrObj - ULONG, use ~em and ~el to get file/line.
  2935. #define GOCODE_BADARGS      6   // Function called with bad arguments, but not fatal.
  2936.                                 // ErrObj - ULONG, use ~em and ~el to get file/line.
  2937. #define GOCODE_OUTBOUNDS    7   // Outline parse went out of GOA_OutlineSize bounds.
  2938.                                 // ErrObj - ULONG, size error was found at.
  2939.  
  2940. #define GOCODE_MALFORMED    8   // Error parsing outline structure.
  2941.                                 // ErrObj = (struct CmdInfo *) - CmdInfo of error.
  2942. #define GOCODE_NOBOXGROUP   9   // Box created outside of a group.
  2943.                                 // ErrObj = (struct CmdInfo *) - CmdInfo of error.
  2944. #define GOCODE_UNKNOWNCMD   10  // Encountered an illegal command.
  2945.                                 // ErrObj = (struct CmdInfo *) - CmdInfo of error.
  2946. #define GOCODE_BADENDGRP    11  // Endgroup command found outside of any groups.
  2947.                                 // ErrObj = (struct CmdInfo *) - CmdInfo of error.
  2948. #define GOCODE_NOGROUPS     12  // There are no groups or boxes in the outline.
  2949.                                 // ErrObj = (struct CmdInfo *) - base CmdInfo.
  2950. #define GOCODE_EXTRAROOTGRP 13  // Can only have one root group.
  2951.                                 // ErrObj = (struct CmdInfo *) - base CmdInfo.
  2952. #define GOCODE_BADGROUP     14  // Found a bad command within a group list.
  2953.                                 // ErrObj = (struct CmdInfo *) - CmdInfo of error.
  2954.  
  2955. #define GOCODE_BADHKCMD     15  // Hook doesn't understand this type of CmdInfo.
  2956.                                 // ErrObj = (struct CmdInfo *) - offending CmdInfo.
  2957. #define GOCODE_CREATEOBJ    16  // Object creation error.
  2958.                                 // ErrObj = (struct CmdInfo *) - object's CmdInfo.
  2959.  
  2960. #define GOCODE_BADCMDID     17  // Supplied CmdID out of bounds.
  2961.                                 // ErrObj = (CMDID) - the bad number.
  2962. #define GOCODE_DUPSTDID     18  // Multiple commands have the same StdID number.
  2963.                                 // ErrObj = (CMDID) - the bad number.
  2964. #define GOCODE_NOCMDID      19  // No command associated with the given CmdID.
  2965.                                 // ErrObj = (CMDID) - the bad number.
  2966. #define GOCODE_DUPHOTKEY    20  // Multiple commands have the same hotkey.
  2967.                                 // ErrObj = (UBYTE) - the hot key.
  2968.  
  2969. #define GOCODE_BADTYPEDSIZE 21  // Found an invalid TypedSize.
  2970.                                 // ErrObj = (TYPEDSIZE) - the bad number.
  2971.  
  2972. #define GOCODE_OPENPUBSCRN  22  // Unable to open a named public screen.
  2973.                                 // ErrObj = (UBYTE *) - name of pub screen.
  2974. #define GOCODE_DEFPUBSCRN   23  // Couldn't find the default public screen.
  2975.                                 // ErrObj = none.
  2976. #define GOCODE_VISUALINFO   24  // Unable to allocate screen's VisualInfo.
  2977.                                 // ErrObj = (struct Screen *) - the screen we tried.
  2978. #define GOCODE_DRAWINFO     25  // Unable to find screen's DrawInfo.
  2979.                                 // ErrObj = (struct Screen *) - the screen we tried.
  2980.  
  2981. #define GOCODE_NOFITWINDOW  26  // Unable to fit layout with current font/screen.
  2982.                                 // ErrObj = none.
  2983. #define GOCODE_GTCONTEXT    27  // Unable to create GadTools context.
  2984.                                 // ErrObj = none.
  2985.  
  2986. #define GOCODE_OPENWIN      28  // Unable to open a window.
  2987.                                 // ErrObj = (struct TagItem *) - window's tags.
  2988.  
  2989. #define GOCODE_NUM          29  // Total number of error codes
  2990.  
  2991.                             // C = Continue, R = Retry, A = Abort
  2992. #define GOTYPE_NONE     0   // ONLY use with GOCODE_NONE.
  2993. #define GOTYPE_FINE     1   // Requester with: C
  2994. #define GOTYPE_FINE2    2   // Requester with: C
  2995. #define GOTYPE_FINE3    3   // Requester with: C
  2996. #define GOTYPE_NOTE     4   // Requester with: C/A
  2997. #define GOTYPE_NOTE2    5   // Requester with: C/A
  2998. #define GOTYPE_NOTE3    6   // Requester with: C/A
  2999. #define GOTYPE_WARN     7   // Requester with: C/R/A
  3000. #define GOTYPE_WARN2    8   // Requester with: C/R/A
  3001. #define GOTYPE_WARN3    9   // Requester with: C/R/A
  3002. #define GOTYPE_ALERT    10  // Requester with: R/A
  3003. #define GOTYPE_ALERT2   11  // Requester with: R/A
  3004. #define GOTYPE_ALERT3   12  // Requester with: R/A
  3005. #define GOTYPE_FAIL     13  // Requester with: A
  3006. #define GOTYPE_FAIL2    14  // Requester with: A
  3007. #define GOTYPE_FAIL3    15  // Requester with: A
  3008. #define GOTYPE_NUM      16
  3009.  
  3010. // Possible return values for the error requester
  3011. #define GOREQ_CONT  0
  3012. #define GOREQ_RETRY 1
  3013. #define GOREQ_FAIL  2
  3014.  
  3015. #endif
  3016.