1 {
2     This file is part of the Free Pascal run time library.
3     Copyright (c) 2016 by Free Pascal development team
4 
5     intuition.library functions for Amiga OS 4.x
6 
7     See the file COPYING.FPC, included in this distribution,
8     for details about the copyright.
9 
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 
14  **********************************************************************}
15 {$PACKRECORDS 2}
16 
17 unit intuition;
18 
19 interface
20 
21 uses
22   exec, agraphics, utility, inputevent, timer, layers;
23 
24 //***** User visible handles on objects, classes, messages
25 type
26   Object_ = LongWord;
27   PObject_ = ^Object_;
28   PPObject_ = ^PObject_;
29   ClassID = STRPTR;
30 
31 // you can use this type to point to a 'generic' message, in the object-oriented programming parlance.
32 // Based on the value of 'MethodID', you dispatch to processing for the various message types.
33 // The meaningful parameter packet structure definitions are defined below.
34 
35   PMsg = ^TMsg;
36   TMsg = record
37     MethodID: LongWord;
38     // method-specific data follows, some examples below
39   end;
40 
41 //**** IntuiText
42 // IntuiText is a series of strings that start with a screen location
43 // (always relative to the upper-left corner of something) and then the text of the string.  The text is null-terminated.
44 type
45   PIntuiText = ^TIntuiText;
46   TIntuiText = record
47     FrontPen: Byte;
48     BackPen: Byte;         // the pen numbers for the rendering
49     DrawMode: Byte;        // the mode for rendering the text
50     LeftEdge: SmallInt;    // relative start location for the text
51     TopEdge: SmallInt;     // relative start location for the text
52     ITextFont: PTextAttr;  // if NULL, you accept the default
53     IText: STRPTR;         // pointer to null-terminated text
54     NextText: PIntuiText;  // continuation to TxWrite another text
55   end;
56 
57 //**** Border
58 // Data type Border, used for drawing a series of lines which is intended for use as a border drawing, but which may, in fact, be used to render any
59 //  arbitrary vector shape. The routine DrawBorder sets up the RastPort with the appropriate variables, then does a Move to the first coordinate, then does Draws
60 // to the subsequent coordinates. After all the Draws are done, if NextBorder is non-zero we call DrawBorder recursively
61 type
62   PBorder = ^TBorder;
63   TBorder = record
64     LeftEdge: SmallInt;
65     TopEdge: SmallInt;     // initial offsets from the origin
66     FrontPen: Byte;
67     BackPen: Byte;       // pens numbers for rendering
68     DrawMode: Byte;      // mode for rendering
69     Count: Shortint;     // number of XY pairs
70     XY: Pointer;         // vector coordinate pairs rel to LeftTop
71     NextBorder: PBorder; // pointer to any other Border too
72   end;
73 
74 //**** MenuItem
75 type
76   PMenuItem = ^TMenuItem;
77   TMenuItem = record
78     NextItem: PMenuItem;    // pointer to next in chained list
79     LeftEdge: SmallInt;
80     TopEdge: SmallInt;      // position of the select box
81     Width: SmallInt;
82     Height: SmallInt;       // dimensions of the select box
83     Flags: Word;            // see the defines below
84     MutualExclude: LongInt; // set bits mean this item excludes that
85     ItemFill: APTR;         // points to Image, IntuiText, or nil
86     // when this item is pointed to by the cursor and the items highlight mode HIGHIMAGE is selected, this alternate image will be displayed
87     SelectFill: APTR;       // points to Image, IntuiText, or nil
88     Command: Char;          // only if appliprog sets the COMMSEQ flag
89     SubItem: PMenuItem;     // if non-zero, DrawMenu shows "->"
90     // The NextSelect field represents the menu number of next selected item (when user has drag-selected several items)
91     NextSelect: Word;
92   end;
93 
94 const
95 // FLAGS SET BY THE APPLIPROG
96   CHECKIT     = $0001; // whether to check this item if selected
97   ITEMTEXT    = $0002; // set if textual, clear if graphical item
98   COMMSEQ     = $0004; // set if there's an command sequence
99   MENUTOGGLE  = $0008; // set to toggle the check of a menu item
100   ITEMENABLED = $0010; // set if this item is enabled
101   SUBMENU     = $0200; // set to get standard submenu indicator (V50)
102 
103 // these are the SPECIAL HIGHLIGHT FLAG state meanings
104   HIGHFLAGS   = $00C0; // see definitions below for these bits
105   HIGHIMAGE   = $0000; // use the user's "select image"
106   HIGHCOMP    = $0040; // highlight by complementing the selectbox
107   HIGHBOX     = $0080; // highlight by "boxing" the selectbox
108   HIGHNONE    = $00C0; // don't highlight
109 
110 // FLAGS SET BY BOTH APPLIPROG AND INTUITION
111   CHECKED     = $0100; // if CHECKIT, then set this when selected
112 
113 // FLAGS SET BY INTUITION
114   BOOPSIMENU  = $0400; // item is a BOOPSI object, hence a black box
115   ISDRAWN     = $1000; // this item's subs are currently drawn
116   HIGHITEM    = $2000; // this item is currently highlighted
117   MENUTOGGLED = $4000; // this item was already toggled
118 
119 //**** Menu
120 type
121   PMenu = ^TMenu;
122   TMenu = record
123     NextMenu: PMenu;      // same level
124     LeftEdge: SmallInt;
125     TopEdge: SmallInt;    // position of the select box
126     Width: SmallInt;
127     Height: SmallInt;     // dimensions of the select box
128     Flags: Word;          // see flag definitions below
129     MenuName: STRPTR;     // text for this Menu Header
130     FirstItem: PMenuItem; // pointer to first in chain
131     // these mysteriously-named variables are for internal use only
132     JazzX, JazzY, BeatX, BeatY: SmallInt;
133   end;
134 
135 const
136 // FLAGS SET BY BOTH THE APPLIPROG AND INTUITION }
137   MENUENABLED = $0001; // whether or not this menu is enabled
138 
139 // Menu class attributes
140   MA_Dummy     = TAG_USER + $440000;
141   MA_Type      = MA_Dummy + 1;  // (LongWord) Type of a menuclass object. Defaults to T_ROOT.
142   MA_Label     = MA_Dummy + 2;  // (STRPTR) Label of the object, which can be either a menu title or a menu (sub-)item text, depending on the object's type.
143   MA_Level     = MA_Dummy + 3;  // (LongInt) How deep the object is in the menu tree.
144   MA_Separator = MA_Dummy + 4;  // (BOOL) If TRUE, declares the object as a separator bar between two items.
145   MA_ID        = MA_Dummy + 5;  // (LongWord) Menu item ID assigned by the application.
146   MA_Key       = MA_Dummy + 6;  // (STRPTR) Single-character keyboard shortcut or full command string for the menu item object.
147   MA_Image     = MA_Dummy + 7;  // (PImage) An Intuition image, either traditional or BOOPSI, to be displayed at the left side of (or in place of) the menu item label.
148   MA_Disabled  = MA_Dummy + 8;  // (BOOL) If TRUE, the menu title or item will appear in a disabled look and won't be selectable.
149   MA_Toggle    = MA_Dummy + 9;  // (BOOL) If TRUE, the item represents an option which can be switched on or off.
150   MA_MX        = MA_Dummy + 10; // (LongWord) If non-zero, the item represents an option which is mutually exclusive with certain other options
151   MA_Selected  = MA_Dummy + 11; // (BOOL) The state of a toggle or mutual exclude item; if TRUE, the item is checked (on), otherwise it is unchecked (off).
152   MA_UserData  = MA_Dummy + 12; // (LongWord) Application-specific user data which can be associated to a menu or menu item object and read back at any time. Defaults to zero.
153   MA_Parent    = MA_Dummy + 13; // (PObject_) The parent of an object in the menu tree; this will be the menu root for a menu title,
154   MA_EvenSize  = MA_Dummy + 14; // (BOOL) If TRUE, all children (items or sub-items) of the object will have the same height
155   MA_Hidden    = MA_Dummy + 15; // (BOOL) If TRUE, this object will not appear at menu display time.
156   MA_MenuHelpID= MA_Dummy + 16; // (LongWord) ID number of the menu item or menu title for which the user requested help during the last menu session.
157   MA_LastSelected = MA_Dummy + 17; // (LongWord) Index of the most recently selected child (item or sub-item) of the object.
158   MA_MenuPosX  = MA_Dummy + 18; // (LongInt) Left edge of the main panel of a context menu. Ignored if the menu tree is not used as a context menu.
159   MA_MenuPosY  = MA_Dummy + 19; // (LongInt) Top edge of the main panel of a context menu. Ignored if the menu tree is not used as a context menu.
160   MA_AddChild  = MA_Dummy + 50; // (PObject_) An object which is to become a child of the current object.
161   MA_RemoveChild = MA_Dummy + 51; // (PObject_) An object which is to be removed from the list of children of the current object.
162   MA_StringHook= MA_Dummy + 80; // (PHook) A hook used for dynamic localization of menu strings.
163   MA_Catalog   = MA_Dummy + 81; // (PCatalog) A catalog used for dynamic localization of menu strings. This is ignored if you don't also set MA_StringHook.
164   MA_MinStringID = MA_Dummy + 82; // (LongWord) The lower bound of the range within which a value passed via MA_Label or MA_Key must lie to be considered a string ID (used for dynamic localization) rather than an actual string.
165   MA_MaxStringID = MA_Dummy + 83; // (LongWord) The upper bound of the range within which a value passed via MA_Label or MA_Key must lie to be considered a string ID (used for dynamic localization) rather than an actual string.
166   MA_CharSet   = MA_Dummy + 84; // (LongWord) The charset (character set) for the label and the keyboard shortcut, if any, of the current menu or menu item object.
167   MA_TextAttr  = MA_Dummy + 85; // (PTextAttr) The font for the item's label (and shortcut).
168   MA_EmbeddedKey = MA_Dummy + 86; // (BOOL) If TRUE, menu item labels can have a single letter prepended to them, separated with a #0 character, which will be used as the item's keyboard shortcut.
169   MA_FreeImage = MA_Dummy + 87; // (BOOL) If TRUE, a BOOPSI image passed via MA_Image is automatically disposed of when the object itself is.
170   MA_PickHook  = MA_Dummy + 88; // (PHook) A custom hook which is invoked during the processing of menu pick events to handle the selection of this menu item object.
171   MA_HelpHook  = MA_Dummy + 89; // (PHook) A custom hook which is invoked during the processing of menu help events to handle a help request on this menu object.
172   MA_ErrorCode = MA_Dummy + 98; // (PLongInt) Pointer to a longword variable to store error codes in.
173   MA_ErrorTagItem = MA_Dummy + 99; // (PPTagItem) When an error occurs whilst processing the tag list passed to OM_NEW, OM_SET or MM_NEWMENU, you can have a pointer to the item that caused the error passed back via the MA_ErrorTagItem tag.
174 // Possible values for MA_Type.
175    T_ROOT  = -1; // The menu tree root
176    T_MENU  = 0;  // A menu
177    T_ITEM  = 1;  // A menu item (or sub-item)
178   // MA_Label should be a text string, or the special constant ML_SEPARATOR, to get a separator bar.
179   // The latter is equivalent to omitting MA_Label and passing MA_Separator, TRUE instead.
180   ML_SEPARATOR = STRPTR(not 0);
181   // This means "no menu selection" and must never be passed as a value for the MA_ID attribute.
182   NO_MENU_ID = 0;
183   // You can OR these to the value of MA_MenuPosX or MA_MenuPosY (if it is non-negative) to alter the way it gets interpreted by Intuition.
184   CMENU_RIGHT  = $10000000; // Value is right edge, not left edge
185   CMENU_BOTTOM = $10000000; // Value is bottom edge, not top edge
186   CMENU_CENTER = $20000000; // Value is center, not left/top edge
187   // Special value for the MA_MenuPosX and MA_MenuPosY attributes, meaning "centered relative to mouse pointer".
188   CMENU_CENTER_MOUSE = $2FFFFFFF;
189 // Menu method identifiers
190   MM_FINDID     = 4001; // Return address of menu object in tree with given ID
191   MM_SCAN       = 4002; // Do a recursive scan of menu tree with custom hook
192   MM_NEWMENU    = 4003; // Build a whole menu (sub-)tree from a tag list
193   MM_DELETEMENU = 4004; // Free menu (sub-)tree built by MM_NEWMENU
194   MM_NEXTCHILD  = 4005; // Get address of next child of a menu object
195   MM_SETSTATE   = 4006; // Change checked/disabled attributes of item with given ID
196   MM_GETSTATE   = 4007; // Read checked/disabled attributes of item with given ID
197   MM_NEXTSELECT = 4009; // Get next ID in menu item selection chain
198   MM_HANDLEPICK = 4011; // Browse through menu selections, invoking pick hooks
199   MM_HANDLEHELP = 4012; // Return menu help ID or invoke help hook if non-nil
200   MM_SETUP      = 4013; // Prepare a menu (sub-)tree for display; normally not needed
201   MM_CLEANUP    = 4014; // Release all resources allocated during menu setup
202 
203 type
204 // Parameter "messages" passed to menu class methods
205 // MM_FINDID - Return the address of the menuclass object having the specified ID, if it exists in the menu tree, otherwise nil.
206   PmpFindID = ^TmpFindID;
207   TmpFindID = record
208     MethodID: LongWord;
209     mpfi_Reserved: LongWord;
210     mpfi_ID: LongWord;
211   end;
212 // MM_SCAN - Do a recursive scan of the menu tree. For each object in the tree, the specified hook is
213 // invoked on it and is passed a MenuScanMessage structure (see below) as message.
214   PmpScan = ^TmpScan;
215   TmpScan = record
216     MethodID: LongWord;
217     mps_Reserved: LongWord;
218     mps_Hook: PHook;
219     mps_Args: array[0..3] of LongWord
220   end;
221 // MM_NEWMENU - Build a whole menu (sub-)tree from a compact tag-based description, with less typing,
222 // more readability, greater efficiency and better error checking than doing so through a series of nested NewObject() calls.
223   PmpNewMenu = ^TmpNewMenu;
224   TmpNewMenu = record
225     MethodID: LongWord;
226     mpnm_Reserved: LongWord;
227     mpnm_AttrList: PTagItem;
228   end;
229 // MM_DELETEMENU - Free a whole menu (sub-)tree that was built via MM_NEWMENU.
230   PmpDeleteMenu = ^TmpDeleteMenu;
231   TmpDeleteMenu = record
232     MethodID: LongWord;
233     mpdm_Reserved: LongWord;
234   end;
235 // MM_NEXTCHILD - Return the object which comes next after the passed one in the children list of the menuclass object it's invoked on.
236 // If nil is passed for mpnc_Current, the first child in the list is returned; if mpnc_Current is the last child in the list, NULL is returned.
237 // This method can be used in a loop to browse through all children of a given object.
238   PmpNextChild = ^TmpNextChild;
239   TmpNextChild = record
240     MethodID: LongWord;
241     mpnc_Reserved: LongWord;
242     mpnc_Current: PObject_;
243   end;
244 // MM_SETSTATE - Change the state of the "checked" and/or "disabled" attribute of the menuclass object having the specified ID. The apply mask
245 // defines which attributes are to be changed, and the state mask what they should be changed to; they can be a combination of the MS_CHECKED and MS_DISABLED bits.
246   PmpSetState = ^TmpSetState;
247   TmpSetState = record
248     MethodID: LongWord;
249     mpss_Reserved: LongWord;
250     mpss_ID: LongWord;
251     mpss_ApplyMask: LongWord;
252     mpss_StateMask: LongWord;
253   end;
254 // MM_GETSTATE - Examine the state of the "checked" and "disabled" attributes of the menuclass object
255 // having the specified ID. The result is a bit mask with a combination of MS_CHECKED and MS_DISABLED.
256   PmpGetState = ^TmpGetState;
257   TmpGetState = record
258     MethodID: LongWord;
259     mpgs_Reserved: LongWord;
260     mpgs_ID: LongWord;
261   end;
262 // MM_NEXTSELECT - Get the ID of the next menu item picked by the user during the most recent menu selection operation.
263   PmpNextSelect = ^TmpNextSelect;
264   TmpNextSelect = record
265     MethodID: LongWord;
266     mpns_Reserved: LongWord;
267     mpns_CurrentID: LongWord;
268   end;
269 // MM_HANDLEPICK - Browse through the menu selection list and invoke the pick hook of each selected item that has one.
270 // Every time an item with a nil pick hook is encountered in the list, stop and return its ID.
271   PmpHandleEvent = ^TmpHandleEvent;
272   TmpHandleEvent = record
273     MethodID: LongWord;
274     mphe_Reserved: LongWord;
275     mphe_CurrentID: LongWord;
276     mphe_Window: Pointer;
277     mphe_UserData: APTR;
278   end;
279 // MM_SETUP - Prepare a menu (sub-)tree for display by allocating any needed resources and computing geometric properties.
280   PmpSetup = ^TmpSetup;
281   TmpSetup = record
282     MethodID: LongWord;
283     mps_Reserved: LongWord;
284     mps_Initial: LongWord;
285   end;
286 
287 const
288 // Special control tags for MM_NEWMENU
289   NM_Dummy    = TAG_USER + $450000;
290   NM_Menu     = NM_Dummy + 1; // (STRPTR) Used to add a new menu object to the menu root.
291   NM_Item     = NM_Dummy + 2; // (STRPTR) Used to add a new menu item object to the current menu.
292   NM_SubItems = NM_Dummy + 3; // (LongWord) Used to begin and end a list of sub-items of the current menu item.
293 // Values for NM_SubItems
294   SI_BEGIN = 1; // This begins a sub-item list
295   SI_END   = 0; // This ends a sub-item list
296 // Possible state flags for MM_SETSTATE/MM_GETSTATE
297   MS_CHECKED  = 1;
298   MS_DISABLED = 2;
299 type
300 // The string hook specified via MA_StringHook receives this message.
301   PMenuStringMessage = ^TMenuStringMessage;
302   TMenuStringMessage = record
303     StructSize: LongWord; // For future expansion
304     StringID: LongWord;   // The string ID number
305     Catalog: Pointer;     // (PCatalog) Catalog pointer, may be nil
306     CharSet: LongWord;    // Charset number, may be zero
307   end;
308 // The menu scan hook passed to MM_SCAN receives this message. The four Args variables hold the same values which
309 // were passed upon method invocation; they can be used to feed your custom arguments to the hook.
310   PMenuScanMessage = ^TMenuScanMessage;
311   TMenuScanMessage = record
312     StructSize: LongWord;          // For future expansion
313     Level: LongInt;                // How deep we are in the menu tree
314     Args: array[0..3] of LongWord; // Custom arguments
315   end;
316 
317 // Pick hooks and help hooks specified via MA_PickHook and MA_HelpHook receive this message. The UserData field contains any
318 // context information that was passed by the application upon MM_HANDLEPICK or MM_HANDLEHELP method invocation.
319   PMenuEventMessage = ^TMenuEventMessage;
320   TMenuEventMessage = record
321     StructSize: LongWord; // For future expansion
322     EventType: LongWord;  // ET_MENUPICK or ET_MENUHELP
323     Window: Pointer;      // (PWindow) Event window pointer
324     UserData: APTR;       // Custom data pointer
325   end;
326 const
327 // Values for MenuEventMessage.EventType
328   ET_MENUPICK = 0;
329   ET_MENUHELP = 1;
330 // Menu-specific error codes MM_NEWMENU can return (via MA_ErrorCode) in addition to standard DOS error codes.
331   ERROR_TITLE_OUT_OF_PLACE       = 4001; // A menu title was found at the wrong position in the tree.
332   ERROR_SUBITEMS_WITHOUT_PARENT  = 4002; // A sub-item list was started without having a parent item first.
333   ERROR_ITEM_WITHOUT_ID          = 4003; // No ID was set for a menu item or sub-item which needs one.
334   ERROR_SEPARATOR_AT_TITLE_LEVEL = 4004; // A separator was inserted before the first menu title.
335   ERROR_BAD_ACTION_ON_ROOT       = 4005; // An unsupported attribute was specified for a menu root object.
336   ERROR_BAD_ACTION_ON_MENU       = 4006; // An unsupported attribute was specified for a menu object.
337   ERROR_BAD_ACTION_ON_ITEM       = 4007; // An unsupported attribute was specified for a menu item object.
338   ERROR_BAD_ACTION_ON_SEPARATOR  = 4008; // An unsupported attribute was specified for a separator.
339   ERROR_ITEM_ID_IS_ZERO          = 4009; // An ID of zero was specified for a menu item or sub-item.
340   ERROR_COMM_KEY_AT_TITLE_LEVEL  = 4010; // A command key was specified for a menu title.
341 
342   SNA_PubName  = TAG_USER + $01; // public screen to watch, nil for all screens
343   SNA_Notify   = TAG_USER + $02; // see below
344   SNA_UserData = TAG_USER + $03; // for your use
345   SNA_SigTask  = TAG_USER + $04; // task to signal
346   SNA_SigBit   = TAG_USER + $05; // signal bit
347   SNA_MsgPort  = TAG_USER + $06; // send message to this port
348   SNA_Priority = TAG_USER + $07; // priority of your request
349   SNA_Hook     = TAG_USER + $08;
350 // SNA_Notify (all unassigned bits are reserved for system use)
351   SNOTIFY_AFTER_OPENSCREEN   = 1 shl 0;  // screen has been opened
352   SNOTIFY_BEFORE_CLOSESCREEN = 1 shl 1;  // going to close screen
353   SNOTIFY_AFTER_OPENWB       = 1 shl 2;  // Workbench is open
354   SNOTIFY_BEFORE_CLOSEWB     = 1 shl 3;  // Workbench is going to be closed
355   SNOTIFY_AFTER_OPENWINDOW   = 1 shl 4;  // new window
356   SNOTIFY_BEFORE_CLOSEWINDOW = 1 shl 5;  // window is going to be closed
357   SNOTIFY_PUBSCREENSTATE     = 1 shl 6;  // PubScreenState()
358   SNOTIFY_LOCKPUBSCREEN      = 1 shl 7;  // LockPubScreen()
359   SNOTIFY_SCREENDEPTH        = 1 shl 8;  // ScreenDepth()
360   SNOTIFY_AFTER_CLOSESCREEN  = 1 shl 9;  // notify after CloseScreen()
361   SNOTIFY_AFTER_CLOSEWINDOW  = 1 shl 10; // dto. CloseWindow()
362   SNOTIFY_BEFORE_OPENSCREEN  = 1 shl 11; // notify before OpenScreen()
363   SNOTIFY_BEFORE_OPENWINDOW  = 1 shl 12; // dto. OpenWindow()
364   SNOTIFY_BEFORE_OPENWB      = 1 shl 13; // like OPENSCREEN
365   SNOTIFY_AFTER_CLOSEWB      = 1 shl 14; // like CLOSESCREEN
366   SNOTIFY_WAIT_REPLY         = 1 shl 15; // wait for reply before  taking action
367   SNOTIFY_UNLOCKPUBSCREEN    = 1 shl 16; // UnlockPubScreen()
368 type
369   PScreenNotifyMessage = ^TScreenNotifyMessage;
370   TScreenNotifyMessage = record
371     snm_Message: TMessage; // embedded message
372     snm_Class: LongWord;   // see above
373     snm_Code: LongWord;
374     snm_Object: APTR;      // either a pointer to struct Window or struct Screen (READ-ONLY). For SNRF_#?PUBSCREEN this the name of the public screen
375     snm_UserData: APTR;    // SNA_UserData
376     snm_Request: APTR;     // pointer returned by StartScreenNotify()
377     snm_Reserved: array[0..4] of LongWord; // don't touch!
378   end;
379 
380 // *** The Intuition plugin interface
381   PGUIPlugin = ^TGUIPlugin;
382   TGUIPlugin = record
383     Node: TNode;        // Reserved, don't use
384     Version: LongWord;  // Version of the plugin
385     Type_: LongWord;    // Type of plugin
386     Attrs: LongWord;    // Type-specific attributes
387     Flags: LongWord;    // Additional information
388     AttrList: PTagItem; // Optional list of GUI attributes
389     Reserved: array[0..3] of LongWord; // For future expansion
390     // Plugin-specific fields follow here
391   end;
392 
393 const
394 // Plugin attributes (flags)
395   PA_INTERNAL = $10000000; // Plugin is implemented internally by Intuition
396 
397 // *** Rendering hooks: common structure and definitions
398 // Possible return values from a rendering hook
399   RCB_OK      = 0; // Hook understands this message type
400   RCB_UNKNOWN = 1; // Hook does not understand this message
401 type
402 // Structure of messages for rendering hooks: the object is context-specific.
403   PRenderMsg = ^TRenderMsg;
404   TRenderMsg = record
405     rm_MethodID: LongWord;  // Type of rendering to perform
406     rm_RastPort: PRastPort; // Where to render to
407     rm_DrawInfo: Pointer;   // (PDrawInfo) Context information
408     rm_Bounds: TRectangle;  // Limits of where to render
409     rm_State: LongWord;     // How to render
410     rm_IAddress: APTR;      // Subsystem-specific data
411     rm_Flags: LongWord;     // Subsystem-specific flags
412     rm_TagList: PTagItem;   // Additional information
413   end;
414 
415 //**** Gadget
416   PGadget = ^TGadget;
417   TGadget = record
418     NextGadget: PGadget;         // next gadget in the list
419     LeftEdge, TopEdge: SmallInt; // "hit box" of gadget
420     Width, Height: SmallInt;     // "hit box" of gadget
421     Flags: Word;      // see below for list of defines
422     Activation: Word; // see below for list of defines
423     GadgetType: Word; // see below for defines
424     // appliprog can specify that the Gadget be rendered as either as Border or an Image.
425     // This variable points to which (or equals nil if there's nothing to be rendered about this Gadget)
426     GadgetRender: APTR;
427     // appliprog can specify "highlighted" imagery rather than algorithmic this can point to either Border or Image data
428     SelectRender: APTR;
429     GadgetText: PIntuiText;   // text for this gadget
430 
431     // by using the MutualExclude word, the appliprog can describe which gadgets mutually-exclude which other ones.  The bits
432     // in MutualExclude correspond to the gadgets in object containing the gadget list.  If this gadget is selected and a bit is set
433     // in this gadget's MutualExclude and the gadget corresponding to that bit is currently selected (e.g. bit 2 set and gadget 2
434     // is currently selected) that gadget must be unselected. Intuition does the visual unselecting (with checkmarks) and
435     // leaves it up to the program to unselect internally
436     MutualExclude: LongInt;   // Obsolete
437 
438     // pointer to a structure of special data required by Proportional, String and LongInt Gadgets
439     SpecialInfo: APTR;
440     GadgetID: Word;           // user-definable ID field
441     UserData: APTR;           // ptr to general purpose User data (ignored by In)
442   end;
443 
444   PExtGadget = ^TExtGadget;
445   TExtGadget = record
446     // The first fields match struct Gadget exactly
447     NextGadget: PExtGadget;  // Matches struct Gadget
448     LeftEdge, TopEdge,       // Matches struct Gadget
449     Width, Height: SmallInt; // Matches struct Gadget
450     Flags,                   // Matches struct Gadget
451     Activation,              // Matches struct Gadget
452     GadgetType: Word;        // Matches struct Gadget
453     GadgetRender,            // Matches struct Gadget
454     SelectRender: APTR;      // Matches struct Gadget
455     GadgetText: PIntuiText;  // Matches struct Gadget
456     MutualExclude: LongInt;  // Matches struct Gadget
457     SpecialInfo: APTR;       // Matches struct Gadget
458     GadgetID: Word;          // Matches struct Gadget
459     UserData: APTR;          // Matches struct Gadget
460 
461     // These fields only exist under V39 and only if GFLG_EXTENDED is set
462     MoreFlags: LongWord;     // see GMORE_ flags below
463     BoundsLeftEdge,          // Bounding extent for gadget, valid
464     BoundsTopEdge,           // only if GMORE_BOUNDS is set.  The
465     BoundsWidth,             // GFLG_RELxxx flags affect these
466     BoundsHeight: SmallInt;  // coordinates as well.
467  end;
468 
469 const
470 // --- Gadget.Flags values
471 // combinations in these bits describe the highlight technique to be used
472   GFLG_GADGHIGHBITS = $0003;
473   GFLG_GADGHCOMP    = $0000; // Complement the select box
474   GFLG_GADGHBOX     = $0001; // Draw a box around the image
475   GFLG_GADGHIMAGE   = $0002; // Blast in this alternate image
476   GFLG_GADGHNONE    = $0003; // don't highlight
477 
478   GFLG_GADGIMAGE    = $0004; // set IF GadgetRender AND SelectRender point to an Image structure, clear if they point to Border structures
479 
480 // combinations in these next two bits specify to which corner the gadget's Left & Top coordinates are relative.  If relative to Top/Left,
481 // these are "normal" coordinates (everything is relative to something in this universe).
482 //
483 // Gadget positions and dimensions are relative to the window or requester which contains the gadget
484   GFLG_RELBOTTOM = $0008; // vert. pos. is relative to bottom edge
485   GFLG_RELRIGHT  = $0010; // horiz. pos. is relative to right edge
486   GFLG_RELWIDTH  = $0020; // width is relative to req/window
487   GFLG_RELHEIGHT = $0040; // height is relative to req/window
488 
489 // New for V39: GFLG_RELSPECIAL allows custom gadget implementors to make gadgets whose position and size depend in an arbitrary way
490 // on their window's dimensions.  The GM_LAYOUT method will be invoked for such a gadget (or any other GREL_xxx gadget) at suitable times,
491 // such as when the window opens or the window's size changes.
492   GFLG_RELSPECIAL = $4000; // custom gadget has special relativity. Gadget box values are absolutes, but can be changed via the GM_LAYOUT method.
493   GFLG_SELECTED   = $0080; // you may initialize AND look at this
494 
495 // the GFLG_DISABLED flag is initialized by you and later set by Intuition according to your calls to On/OffGadget().  It specifies whether or not
496 // this Gadget is currently disabled from being selected
497   GFLG_DISABLED    = $0100;
498 
499 // These flags specify the type of text field that Gadget.GadgetText points to.  In all normal (pre-V36) gadgets which you initialize
500 // this field should always be zero.  Some types of gadget objects created from classes will use these fields to keep track of
501 // types of labels/contents that different from IntuiText, but are stashed in GadgetText.
502   GFLG_LABELMASK   = $3000;
503   GFLG_LABELITEXT  = $0000; // GadgetText points to IntuiText
504   GFLG_LABELSTRING = $1000; // GadgetText points to (PByte)
505   GFLG_LABELIMAGE  = $2000; // GadgetText points to Image (object)
506 
507 // New for V37: GFLG_TABCYCLE
508   GFLG_TABCYCLE    = $0200; //(string OR custom) gadget participates in cycling activation with Tab or Shift-Tab
509 
510 // New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly ignore the value we had chosen for the Gadget->Activation flag
511 // GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34. The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
512 // safe under V34, and equivalent to GACT_STRINGEXTEND under V37. (Note that the two flags are not numerically equal)
513   GFLG_STRINGEXTEND = $0400; // this String Gadget has StringExtend
514 
515 // New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if the custom image of this gadget knows how to do disabled rendering
516 // (more specifically, if its IA_SupportsDisable attribute is TRUE). Intuition uses this to defer the ghosting to the image-class,
517 // instead of doing it itself (the old compatible way). Do not set this flag yourself - Intuition will do it for you.
518  GFLG_IMAGEDISABLE = $0800; // Gadget's image knows how to do disabled rendering
519 
520 // New for V39:  If set, this bit means that the Gadget is actually a struct ExtGadget, with new fields and flags.  All V39 boopsi
521 // gadgets are ExtGadgets.  Never ever attempt to read the extended fields of a gadget if this flag is not set.
522   GFLG_EXTENDED    = $8000; // Gadget is extended
523 
524 // ---  Gadget.Activation flag values
525 // Set GACT_RELVERIFY if you want to verify that the pointer was still over the gadget when the select button was released.  Will cause
526 // an IDCMP_GADGETUP message to be sent if so.
527   GACT_RELVERIFY    = $0001;
528 
529 // the flag GACT_IMMEDIATE, when set, informs the caller that the gadget was activated when it was activated.  This flag works in conjunction with
530 //   the GACT_RELVERIFY flag
531   GACT_IMMEDIATE    = $0002;
532 
533 // the flag GACT_ENDGADGET, when set, tells the system that this gadget, when selected, causes the Requester to be ended.  Requesters
534 // that are ended are erased and unlinked from the system.
535   GACT_ENDGADGET    = $0004;
536 
537 // the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive reports on mouse movements while this gadget is active.
538 // You probably want to set the GACT_IMMEDIATE flag when using GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
539 // learning why Intuition is suddenly sending you a stream of mouse movement events.  If you don't set GACT_RELVERIFY, you'll get at
540 // least one Mouse Position event.
541   GACT_FOLLOWMOUSE = $0008;
542 
543 // if any of the BORDER flags are set in a Gadget that's included in the Gadget list when a Window is opened, the corresponding Border will
544 // be adjusted to make room for the Gadget
545   GACT_RIGHTBORDER = $0010;
546   GACT_LEFTBORDER  = $0020;
547   GACT_TOPBORDER   = $0040;
548   GACT_BOTTOMBORDER= $0080;
549   GACT_BORDERSNIFF = $8000; // neither set nor rely on this bit
550 
551   GACT_TOGGLESELECT= $0100; // this bit for toggle-select mode
552   GACT_BOOLEXTEND  = $2000; // this Boolean Gadget has a BoolInfo
553 
554 // should properly be in StringInfo, but aren't
555   GACT_STRINGLEFT  = $0000; // NOTE WELL: that this has value zero
556   GACT_STRINGCENTER= $0200;
557   GACT_STRINGRIGHT = $0400;
558   GACT_LONGINT     = $0800; // this String Gadget is for Long Ints
559   GACT_ALTKEYMAP   = $1000; // this String has an alternate keymap
560   GACT_STRINGEXTEND= $2000; // this String Gadget has StringExtend
561   // NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
562   //  ARE RUNNING ON LESS THAN V36!  SEE GFLG_STRINGEXTEND (ABOVE) INSTEAD
563 
564   GACT_ACTIVEGADGET = $4000; // this gadget is "active".  This flag is maintained by Intuition, and you
565                              // cannot count on its value persisting while you do something on your program's
566                              // task.  It can only be trusted by people implementing custom gadgets
567 
568 // note $8000 is used above (GACT_BORDERSNIFF); all Activation flags defined
569 
570 // --- GADGET TYPES
571 // These are the Gadget Type definitions for the variable GadgetType gadget number type MUST start from one.
572 // NO TYPES OF ZERO ALLOWED. first comes the mask for Gadget flags reserved for Gadget typing
573   GTYP_GADGETTYPE = $FC00; // all Gadget Global Type flags (padded)
574   GTYP_SYSGADGET  = $8000; // 1 = Allocated by the system, 0 = by app.
575   GTYP_SCRGADGET  = $4000; // 1 = ScreenGadget, 0 = WindowGadget
576   GTYP_GZZGADGET  = $2000; // 1 = for WFLG_GIMMEZEROZERO borders
577   GTYP_REQGADGET  = $1000; // 1 = this is a Requester Gadget
578 // GTYP_SYSGADGET means that Intuition ALLOCATED the gadget.
579 // GTYP_SYSTYPEMASK is the mask you can apply to tell what type of system-gadget it is.  The possible types follow.
580   GTYP_SYSTYPEMASK = $00F0;
581 // These definitions describe system gadgets in V36 and higher:
582   GTYP_SIZING    = $0010; // Window sizing gadget
583   GTYP_WDRAGGING = $0020; // Window drag bar
584   GTYP_SDRAGGING = $0030; // Screen drag bar
585   GTYP_WDEPTH    = $0040; // Window depth gadget
586   GTYP_SDEPTH    = $0050; // Screen depth gadget
587   GTYP_WZOOM     = $0060; // Window zoom gadget
588   GTYP_SUNUSED   = $0070; // Unused screen gadget
589   GTYP_CLOSE     = $0080; // Window close gadget
590   GTYP_WUPFRONT  = GTYP_WDEPTH;  // Window to-front gadget
591   GTYP_SUPFRONT  = GTYP_SDEPTH;  // Screen to-front gadget
592   GTYP_WDOWNBACK = GTYP_WZOOM;   // Window to-back gadget
593   GTYP_SDOWNBACK = GTYP_SUNUSED; // Screen to-back gadget
594 // GTYP_GTYPEMASK is a mask you can apply to tell what class of gadget this is.  The possible classes follow.
595   GTYP_GTYPEMASK    = $0007;
596   GTYP_BOOLGADGET   = $0001;
597   GTYP_GADGET0002   = $0002;
598   GTYP_PROPGadget   = $0003;
599   GTYP_STRGADGET    = $0004;
600   GTYP_CUSTOMGADGET = $0005;
601 
602   GTYP_TBARGADGET   = $0200;
603 
604 // New for V39.  Gadgets which have the GFLG_EXTENDED flag set are actually ExtGadgets, which have more flags.  The GMORE_xxx
605 // identifiers describe those flags.  For GMORE_SCROLLRASTER, see important information in the ScrollWindowRaster() autodoc.
606 // NB: GMORE_SCROLLRASTER must be set before the gadget is added to a window.
607   GMORE_BOUNDS           = $00000001; // ExtGadget has valid Bounds
608   GMORE_GADGETHELP       = $00000002; // This gadget responds to gadget help
609   GMORE_SCROLLRASTER     = $00000004; // This (custom) gadget uses ScrollRaster
610   GMORE_NOFILTERMENUKEYS = $00000008; // Set this flag to make menu shortcuts work even when the gadget is active. V50.
611   GMORE_HIDDEN           = $00000010; // This gadgets is hidden/can't be drawn. V50.
612   GMORE_PRIVATE          = $00000020; // Reserved for system use. V50.
613   GMORE_PRIVATE2         = $00000040; // Reserved for system use. V51.
614   GMORE_NOFILTERWHEEL    = $00000080; // Your window will receive mouse wheel events even when the gadget is active. V51.
615   GMORE_NOCMENUOFFLOAD   = $00000100; // Reserved for system use. V54.
616 
617 // Domain types recognized by GadgetBox()
618   GBD_WINDOW    = 0; // Domain is a Window
619   GBD_BOX       = 1; // Domain is an IBox
620   GBD_RECTANGLE = 2; // Domain is a Rectangle
621   GBD_GINFO     = 3; // Domain is a GadgetInfo (V51)
622 
623 // Flags for GadgetBox()
624   GBF_BOUNDS   = $00000001; // Return bounding box, not hit box
625   GBF_MAKERECT = $00000002; // Return a Rectangle, not an IBox
626 
627 //**** BoolInfo
628 
629 // This is the special data needed by an Extended Boolean Gadget Typically this structure will be pointed to by the Gadget field SpecialInfo
630 type
631   PBoolInfo = ^TBoolInfo;
632   TBoolInfo = record
633     Flags: Word; // defined below
634     Mask: PWord; // bit mask for highlighting and selecting mask must follow the same rules as an Image
635                  // plane.  It's width and height are determined by the width and height of the gadget's
636                  // select box. (i.e. Gadget.Width and .Height).
637     Reserved: LongWord; // set to 0
638   end;
639 
640 const
641 // set BoolInfo.Flags to this flag bit. in the future, additional bits might mean more stuff hanging off of BoolInfo.Reserved.
642   BOOLMASK    = $0001; // extension is for masked gadget
643 
644 //**** PropInfo
645 // this is the special data required by the proportional Gadget typically, this data will be pointed to by the Gadget variable SpecialInfo
646 type
647   PPropInfo = ^TPropInfo;
648   TPropInfo = record
649     Flags: Word; // general purpose flag bits (see defines below)
650       // You initialize the Pot variables before the Gadget is added to the system.  Then you can look here for the current settings
651       // any time, even while User is playing with this Gadget.  To adjust these after the Gadget is added to the System, use
652       // ModifyProp();  The Pots are the actual proportional settings, where a value of zero means zero and a value of MAXPOT means
653       // that the Gadget is set to its maximum setting.
654     HorizPot: Word; // 16-bit FixedPoint horizontal quantity percentage
655     VertPot: Word;  // 16-bit FixedPoint vertical quantity percentage
656       // the 16-bit FixedPoint Body variables describe what percentage of the entire body of stuff referred to by this Gadget is actually
657       // shown at one time.  This is used with the AUTOKNOB routines, to adjust the size of the AUTOKNOB according to how much of
658       // the data can be seen.  This is also used to decide how far to advance the Pots when User hits the Container of the Gadget.
659       // For instance, if you were controlling the display of a 5-line Window of text with this Gadget, and there was a total of 15
660       // lines that could be displayed, you would set the VertBody value to (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
661       // Therefore, the AUTOKNOB would fill 1/3 of the container, and if User hits the Cotainer outside of the knob, the pot would
662       // advance 1/3 (plus or minus) If there's no body to show, or the total amount of displayable info is less than the display area,
663       // set the Body variables to the MAX.  To adjust these after the Gadget is added to the System, use ModifyProp();
664     HorizBody: Word;  // horizontal Body
665     VertBody: Word;   // vertical Body
666       // these are the variables that Intuition sets and maintains
667     CWidth: Word;     // Container width (with any relativity absoluted)
668     CHeight: Word;    // Container height (with any relativity absoluted)
669     HPotRes: Word;
670     VPotRes: Word;    // pot increments
671     LeftBorder: Word; // Container borders
672     TopBorder: Word;  // Container borders
673   end;
674 
675 const
676 // --- FLAG BITS
677   AUTOKNOB     =   $0001;  // this flag sez:  gimme that old auto-knob
678 // NOTE: if you do not use an AUTOKNOB for a proportional gadget, you are currently limited to using a single Image of your own
679 // design: Intuition won't handle a linked list of images as a proportional gadget knob.
680   FREEHORIZ      =  $0002; // IF set, the knob can move horizontally
681   FREEVERT       =  $0004; // IF set, the knob can move vertically
682   PROPBORDERLESS =  $0008; // IF set, no border will be rendered
683   KNOBHIT        =  $0100; // set when this Knob is hit
684   PROPNEWLOOK    =  $0010; // set this IF you want to get the new V36 look
685 
686   KNOBHMIN      =  6;     // minimum horizontal size of the Knob
687   KNOBVMIN      =  4;     // minimum vertical size of the Knob
688   MAXBODY       =  $FFFF; // maximum body value
689   MAXPOT        =  $FFFF; // maximum pot value
690 
691 //**** StringInfo
692 // this is the special data required by the string Gadget typically, this data will be pointed to by the Gadget variable SpecialInfo
693 type
694   PStringInfo = ^TStringInfo;
695   TStringInfo = record
696       // you initialize these variables, and then Intuition maintains them
697     Buffer: STRPTR;      // the buffer containing the start and final string
698     UndoBuffer: STRPTR;  // optional buffer for undoing current entry
699     BufferPos: SmallInt; // character position in Buffer
700     MaxChars: SmallInt;  // max number of chars in Buffer (including nil)
701     DispPos: SmallInt;   // Buffer position of first displayed character
702       // Intuition initializes and maintains these variables for you
703     UndoPos: SmallInt;   // character position in the undo buffer
704     NumChars: SmallInt;  // number of characters currently in Buffer
705     DispCount: SmallInt; // number of whole characters visible in Container
706     CLeft: SmallInt;     //
707     CTop: SmallInt;      // topleft offset of the container
708       // you can initialize this variable before the gadget is submitted to Intuition, and then examine it later to discover what LongInt
709       // the user has entered (if the user never plays with the gadget, the value will be unchanged from your initial setting)
710     Extension: Pointer;
711     _LongInt: LongInt;
712       // If you want this Gadget to use your own Console keymapping, you set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
713       // set this variable to point to your keymap.  If you don't set the ALTKEYMAP, you'll get the standard ASCII keymapping.
714     AltKeyMap: Pointer;
715   end;
716 
717 //**** Requester
718 type
719   PRequester = ^TRequester;
720   TRequester = record
721     OlderRequest: PRequester;
722     LeftEdge, TopEdge: SmallInt; // dimensions of the entire box
723     Width, Height: SmallInt;     // dimensions of the entire box
724     RelLeft, RelTop: SmallInt;   // for Pointer relativity offsets
725 
726     ReqGadget: PGadget;  // pointer to a list of Gadgets
727     ReqBorder: PBorder;  // the box's border
728     ReqText: PIntuiText; // the box's text
729     Flags: Word;         // see definitions below
730 
731     // pen number for back-plane fill before draws
732     BackFill: Byte;
733     // Layer in place of clip rect
734     ReqLayer: PLayer;
735     ReqPad1: array[0..31] of Byte;
736 
737    { If the BitMap plane pointers are non-zero, this tells the system that the image comes pre-drawn (if the appliprog wants to define
738      it's own box, in any shape or size it wants!);  this is OK by Intuition as long as there's a good correspondence between the image and the specified Gadgets}
739     ImageBMap: PBitMap; // points to the BitMap of PREDRAWN imagery
740     RWindow: Pointer;   // PWindow added.  points back to Window
741     ReqImage: Pointer;  // PImage new for V36: drawn if USEREQIMAGE set
742     ReqPad2: array[0..31] of Byte;
743   end;
744 
745 const
746 // FLAGS SET BY THE APPLIPROG
747   POINTREL      = $0001; // if POINTREL set, TopLeft is relative to pointer for DMRequester, relative to window center for Request().
748   PREDRAWN      = $0002; // set if Requester.ImageBMap points to predrawn Requester imagery
749   NOISYREQ      = $0004; // if you don't want requester to filter input
750   SIMPLEREQ     = $0010; // to use SIMPLEREFRESH layer (recommended)
751   // New for V36
752   USEREQIMAGE   = $0020; // render linked list ReqImage after BackFill but before gadgets and text
753   NOREQBACKFILL = $0040; // don't bother filling requester with Requester.BackFill pen
754 
755 { FLAGS SET BY INTUITION }
756   REQOFFWINDOW  = $1000; // part of one of the Gadgets was offwindow
757   REQACTIVE     = $2000; // this requester is active
758   SYSREQUEST    = $4000; // this requester caused by system
759   DEFERREFRESH  = $8000; // this Requester stops a Refresh broadcast
760 
761 // **** Image
762 // This is a brief image structure for very simple transfers of image data to a RastPort
763 type
764   PImage = ^TImage;
765   TImage = record
766     LeftEdge: SmallInt; // starting offset relative to some origin
767     TopEdge: SmallInt;  // starting offsets relative to some origin
768     Width: SmallInt;    // pixel size (though data is word-aligned)
769     Height: SmallInt;
770     Depth: SmallInt;    // pixel sizes
771     ImageData: Pointer; // pointer to the actual word-aligned bits
772 
773     // the PlanePick and PlaneOnOff variables work much the same way as the equivalent GELS Bob variables.  It's a space-saving
774     // mechanism for image data.  Rather than defining the image data for every plane of the RastPort, you need define data only
775     // for the planes that are not entirely zero or one.  As you define your Imagery, you will often find that most of the planes
776     // ARE just as color selectors.  For instance, if you're designing a two-color Gadget to use colors two and three, and the Gadget
777     // will reside in a five-plane display, bit plane zero of your imagery would be all ones, bit plane one would have data that
778     // describes the imagery, and bit planes two through four would be all zeroes.  Using these flags allows you to avoid wasting all
779     // that memory in this way:  first, you specify which planes you want your data to appear in using the PlanePick variable.  For
780     // each bit set in the variable, the next "plane" of your image data is blitted to the display.  For each bit clear in this
781     // variable, the corresponding bit in PlaneOnOff is examined. If that bit is clear, a "plane" of zeroes will be used.
782     // If the bit is set, ones will go out instead.  So, for our example:
783     //   Gadget.PlanePick = $02;
784     //   Gadget.PlaneOnOff = $01;
785     // Note that this also allows for generic Gadgets, like the System Gadgets, which will work in any number of bit planes.
786     // Note also that if you want an Image that is only a filled rectangle, you can get this by setting PlanePick to zero
787     // (pick no planes of data) and set PlaneOnOff to describe the pen color of the rectangle.
788     PlanePick: Byte;
789     PlaneOnOff: Byte;
790     // if the NextImage variable is not NULL, Intuition presumes that it points to another Image structure with another Image to be rendered
791     NextImage: PImage;
792   end;
793 
794 //**** IntuiMessage
795 type
796   PIntuiMessage = ^TIntuiMessage;
797   TIntuiMessage = record
798     ExecMessage: TMessage;
799     IClass: LongWord;      // the Class bits correspond directly with the IDCMP Flags, except for the special bit LONELYMESSAGE (defined below)
800     Code: Word;            // the Code field is for special values like MENU number
801     Qualifier: Word;       // the Qualifier field is a copy of the current InputEvent's Qualifier
802     IAddress: APTR;        // IAddress contains particular addresses for Intuition functions, like the pointer to the Gadget or the Screen
803 
804     MouseX,                // when getting mouse movement reports, any event you get will have the the mouse coordinates in these variables.  the coordinates are relative
805     MouseY: SmallInt;      // to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
806     Seconds,               // the time values are copies of the current system clock time.
807     Micros: LongWord;      // Micros are in units of microseconds, Seconds in seconds.
808     IDCMPWindow: Pointer;  // the IDCMPWindow variable will always have the Pointer of the Window of this IDCMP
809     // system-use variable
810     SpecialLink: PIntuiMessage;
811   end;
812 
813 const
814 // IntuiMessage tags start here.
815   IMTAG_Dummy = TAG_USER + $414000;
816 
817 // New for V51:
818 // The IAddress field of IDCMP_EXTENDEDMOUSE messages points to the following structure. Always check the Code field of the IntuiMessage
819 // against IMSGCODE_INTUIWHEELDATA, future versions of Intuition may introduce additional structures!
820 type
821   PIntuiWheelData = ^TIntuiWheelData;
822   TIntuiWheelData = record
823     Version: Word;    // version of this structure (see below)
824     Reserved: Word;   // always 0, reserved for future use
825     WheelX: SmallInt; // horizontal wheel movement delta
826     WheelY: SmallInt; // vertical wheel movement delta
827   end;
828 const
829   INTUIWHEELDATA_VERSION = 1; // current version of the structure above
830 type
831 // New for V51:
832 // The IAddress field of IDCMP_EXTENDEDKEYBOARD messages points to the following structure. Always check the Code field of the IntuiMessage
833 // against IMSGCODE_RAWKEYDATA, future versions of Intuition may introduce additional structures!
834   PIntuiRawKeyData = ^TIntuiRawKeyData;
835   TIntuiRawKeyData = record
836     Version: Word;  // version of this structure (see below)
837     Reserved: Word; // always 0, reserved for future use
838     Class: Word;    // copy of ie_SubClass (see IECLASS_EXTENDED_RAWKEY)
839     Code: Word;     // rawkey code
840     DeadKeys: TExtendedDeadKey; // deadkey information
841   end;
842 const
843   INTUIRAWKEYDATA_VERSION  = 1; // current version of the structure above
844 
845   IMSGCODE_INTUIWHEELDATA  = 1 shl 15;
846   IMSGCODE_INTUIRAWKEYDATA = 1 shl 14;
847 
848   IMTAG_MenuType    = IMTAG_Dummy + 1;
849   IMTAG_MenuContext = IMTAG_Dummy + 2;
850   // Values for IMTAG_MenuType
851   IMT_DEFAULT            = 0;
852   IMT_CONTEXT_WINDOW     = 1;
853   IMT_CONTEXT_GADGET_APP = 2;
854   IMT_CONTEXT_GADGET_OBJ = 3;
855 
856 
857 // **** IDCMP Classes
858 // Please refer to the Autodoc for OpenWindow() and to the Rom Kernel Manual for full details on the IDCMP classes.
859   IDCMP_SIZEVERIFY      =  $00000001;
860   IDCMP_NEWSIZE         =  $00000002;
861   IDCMP_REFRESHWINDOW   =  $00000004;
862   IDCMP_MOUSEBUTTONS    =  $00000008;
863   IDCMP_MOUSEMOVE       =  $00000010;
864   IDCMP_GADGETDOWN      =  $00000020;
865   IDCMP_GADGETUP        =  $00000040;
866   IDCMP_REQSET          =  $00000080;
867   IDCMP_MENUPICK        =  $00000100;
868   IDCMP_CLOSEWINDOW     =  $00000200;
869   IDCMP_RAWKEY          =  $00000400;
870   IDCMP_REQVERIFY       =  $00000800;
871   IDCMP_REQCLEAR        =  $00001000;
872   IDCMP_MENUVERIFY      =  $00002000;
873   IDCMP_NEWPREFS        =  $00004000;
874   IDCMP_DISKINSERTED    =  $00008000;
875   IDCMP_DISKREMOVED     =  $00010000;
876   IDCMP_WBENCHMESSAGE   =  $00020000; // System use only
877   IDCMP_ACTIVEWINDOW    =  $00040000;
878   IDCMP_INACTIVEWINDOW  =  $00080000;
879   IDCMP_DELTAMOVE       =  $00100000;
880   IDCMP_VANILLAKEY      =  $00200000;
881   IDCMP_INTUITICKS      =  $00400000;
882   //  for notifications from "boopsi" gadgets
883   IDCMP_IDCMPUPDATE     =  $00800000; // new for V36
884   // for getting help key report during menu session
885   IDCMP_MENUHELP        =  $01000000; // new for V36
886   // for notification of any move/size/zoom/change window
887   IDCMP_CHANGEWINDOW     = $02000000; // new for V36
888   IDCMP_GADGETHELP       = $04000000; // new for V39
889   IDCMP_EXTENDEDMOUSE    = $08000000; // new for V51
890   IDCMP_EXTENDEDKEYBOARD = $10000000; // new for V51
891   IDCMP_RESERVED1        = $20000000; // reserved for IDCMP extension scheme
892   IDCMP_RESERVED2        = $40000000; //* reserved for IDCMP extension scheme
893 // NOTEZ-BIEN:            $80000000 is reserved for internal use
894 
895 // the IDCMP Flags do not use this special bit, which is cleared when Intuition sends its special message to the Task, and set when Intuition
896 // gets its Message back from the Task.  Therefore, I can check here to find out fast whether or not this Message is available for me to send
897   IDCMP_LONELYMESSAGE   =  $80000000;
898 
899 //--- IDCMP Codes
900 // This group of codes is for the IDCMP_CHANGEWINDOW message
901   CWCODE_MOVESIZE = $0000; // Window was moved and/or sized
902   CWCODE_DEPTH    = $0001; // Window was depth-arranged (new for V39)
903   // New for V51: these codes are for the IDCMP_(IN)ACTIVEWINDOW messages
904   AWCODE_NORMAL   = $0000; // Window did actually change its activation
905   AWCODE_INTERIM  = $0001; // Window state changed due to toolbox usage
906   // These codes are for IDCMP_NEWSIZE messages (V53.43)
907   NSCODE_FINAL    = $0000; // Final window size change
908   NSCODE_INTERIM  = $0001; // Interim window size change
909 
910 // This group of codes is for the IDCMP_MENUVERIFY function
MENUHOTnull911   MENUHOT       =  $0001; // IntuiWants verification OR MENUCANCEL
912   MENUCANCEL    =  $0002; // HOT Reply of this cancels Menu operation
913   MENUWAITING   =  $0003; // Intuition simply wants a ReplyMsg() ASAP
914 
915 // These are internal tokens to represent state of verification attempts shown here as a clue.
916   OKOK          =  MENUHOT;    // guy didn't care
917   OKABORT       =  $0004;      // window rendered question moot
918   OKCANCEL      =  MENUCANCEL; // window sent cancel reply
919 
920 // This group of codes is for the IDCMP_WBENCHMESSAGE messages
921   WBENCHOPEN    =  $0001;
922   WBENCHCLOSE   =  $0002;
923 
924 // A data structure common in V36 Intuition processing
925 type
926   PIBox = ^TIBox;
927   TIBox = record
928     Left: SmallInt;
929     Top: SmallInt;
930     Width: SmallInt;
931     Height: SmallInt;
932   end;
933 
934 //**** Window
935   PScreen = ^TScreen;
936   PWindow = ^TWindow;
937   TWindow = record
938     NextWindow: PWindow;    // for the linked list in a screen
939     LeftEdge,
940     TopEdge: SmallInt;      // screen dimensions of window
941     Width,
942     Height: SmallInt;       // screen dimensions of window
943     MouseY,
944     MouseX: SmallInt;       // relative to upper-left of window
945     MinWidth,
946     MinHeight: SmallInt;    // minimum sizes
947     MaxWidth,
948     MaxHeight: Word;          // maximum sizes
949     Flags: LongWord;          // see below for defines
950     MenuStrip: PMenu;         // the strip of Menu headers
951     Title: STRPTR;            // the title text for this window
952     FirstRequest: PRequester; // all active Requesters
953     DMRequest: PRequester;    // double-click Requester
954     ReqCount: SmallInt;       // count of reqs blocking Window
955     WScreen: PScreen;         // this Window's Screen
956     RPort: PRastPort;         // this Window's very own RastPort
957 
958     // the border variables describe the window border.   If you specify GIMMEZEROZERO when you open the window, then the upper-left of the
959     // ClipRect for this window will be upper-left of the BitMap (with correct offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
960     // using SuperBitMap).  If you don't specify ZeroZero, then you save memory (no allocation of RastPort, Layer, ClipRect and associated
961     // Bitmaps), but you also must offset all your writes by BorderTop, BorderLeft and do your own mini-clipping to prevent writing over the system gadgets
962     BorderLeft,
963     BorderTop,
964     BorderRight,
965     BorderBottom: Shortint;
966     BorderRPort: PRastPort;
967     // You supply a linked-list of Gadgets for your Window. This list DOES NOT include system gadgets.  You get the standard
968     // window system gadgets by setting flag-bits in the variable Flags (see the bit definitions below)
969     FirstGadget : PGadget;
970     // these are for opening/closing the windows
971     Parent,
972     Descendant: PWindow;
973     // sprite data information for your own Pointer set these AFTER you Open the Window by calling SetPointer()
974     _Pointer: PWord;           // sprite data
975     PtrHeight: Shortint;       // sprite height (not including sprite padding)
976     PtrWidth: Shortint;        // sprite width (must be less than or equal to 16)
977     XOffset,
978     YOffset: Shortint;         // sprite offsets
979     // the IDCMP Flags and User's and Intuition's Message Ports
980     IDCMPFlags: LongWord;      // User-selected flags
981     UserPort,
982     WindowPort: PMsgPort;
983     MessageKey: PIntuiMessage;
984 
985     DetailPen,
986     BlockPen: Byte;  // for bar/border/gadget rendering
987     // the CheckMark is a pointer to the imagery that will be used when rendering MenuItems of this
988     // Window that want to be checkmarked if this is equal to NULL, you'll get the default imagery
989     CheckMark: PImage;
990     ScreenTitle: STRPTR;  // if non-nil, Screen title when Window is active
991     // These variables have the mouse coordinates relative to the inner-Window of GIMMEZEROZERO Windows.  This is compared with the
992     // MouseX and MouseY variables, which contain the mouse coordinates relative to the upper-left corner of the Window, GIMMEZEROZERO notwithstanding
993     GZZMouseX: SmallInt;
994     GZZMouseY: SmallInt;
995     // these variables contain the width and height of the inner-Window of GIMMEZEROZERO Windows
996     GZZWidth: SmallInt;
997     GZZHeight: SmallInt;
998     ExtData: PByte;
999     UserData: PSmallInt;  // general-purpose pointer to User data extension
1000     // 11/18/85: this pointer keeps a duplicate of what Window.RPort->Layer is _supposed_ to be pointing at
1001     WLayer: PLayer;
1002     // NEW 1.2: need to keep track of the font that OpenWindow opened, in case user SetFont's into RastPort
1003     IFont: PTextFont;
1004     // (V36) another flag word (the Flags field is used up). At present, all flag values are system private. Until further notice, you may not change nor use this field.
1005     MoreFlags: LongWord;
1006     //**** Data beyond this point are Intuition Private.  DO NOT USE ****
1007   end;
1008 
1009 // === Screen
1010   TScreen = record
1011     NextScreen: PScreen;         // linked list of screens
1012     FirstWindow: PWindow;        // linked list Screen's Windows
1013 
1014     LeftEdge, TopEdge: SmallInt; // parameters of the screen
1015     Width, Height: SmallInt;     // parameters of the screen
1016 
1017     MouseY, MouseX: SmallInt;    // position relative to upper-left
1018 
1019     Flags: Word;                 // see definitions below
1020 
1021     Title: STRPTR;               // null-terminated Title text
1022     DefaultTitle: STRPTR;        // for Windows without ScreenTitle
1023 
1024     // Bar sizes for this Screen and all Window's in this Screen Note that BarHeight is one less than the actual menu bar
1025     // height.  We're going to keep this in V36 for compatibility, although V36 artwork might use that extra pixel
1026     // Also, the title bar height of a window is calculated from the screen's WBorTop field, plus the font height, plus one.
1027     BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder: Shortint;
1028     WBorTop, WBorLeft, WBorRight, WBorBottom: Shortint;
1029 
1030     Font: PTextAttr; // this screen's default font
1031     // the display data structures for this Screen (note the prefix S)
1032     ViewPort: TViewPort;    // describing the Screen's display
1033     RastPort: TRastPort;    // describing Screen rendering
1034     BitMap: TBitMap;        // extra copy of RastPort BitMap
1035     LayerInfo: TLayer_Info; // each screen gets a LayerInfo
1036     // You supply a linked-list of Gadgets for your Screen. This list DOES NOT include system Gadgets. You get the standard system Screen Gadgets by default
1037     FirstGadget: PGadget;
1038 
1039     DetailPen, BlockPen: Byte; // for bar/border/gadget rendering
1040     // the following variable(s) are maintained by Intuition to support the DisplayBeep() color flashing technique
1041     SaveColor0: Word;
1042     // This layer is for the Screen and Menu bars
1043     BarLayer: PLayer;
1044     ExtData: PByte;
1045     UserData: PByte; // general-purpose pointer to User data extension
1046     //*** Data below this point are SYSTEM PRIVATE
1047   end;
1048 
1049 const
1050 // --- Flags requested at OpenWindow() time by the application ---------
1051   WFLG_SIZEGADGET  = $00000001; // include sizing system-gadget?
1052   WFLG_DRAGBAR     = $00000002; // include dragging system-gadget?
1053   WFLG_DEPTHGADGET = $00000004; // include depth arrangement gadget?
1054   WFLG_CLOSEGADGET = $00000008; // include close-box system-gadget?
1055   WFLG_SIZEBRIGHT  = $00000010; // size gadget uses right border
1056   WFLG_SIZEBBOTTOM = $00000020; // size gadget uses bottom border
1057 // --- refresh modes ---------------------------------------------------
1058 // combinations of the WFLG_REFRESHBITS select the refresh type
1059   WFLG_REFRESHBITS    = $000000C0;
1060   WFLG_SMART_REFRESH  = $00000000;
1061   WFLG_SIMPLE_REFRESH = $00000040;
1062   WFLG_SUPER_BITMAP   = $00000080;
1063   WFLG_OTHER_REFRESH  = $000000C0;
1064   WFLG_BACKDROP       = $00000100; // this is a backdrop window
1065   WFLG_REPORTMOUSE    = $00000200; // to hear about every mouse move
1066   WFLG_GIMMEZEROZERO  = $00000400; // a GimmeZeroZero window
1067   WFLG_BORDERLESS     = $00000800; // to get a Window sans border
1068   WFLG_ACTIVATE       = $00001000; // when Window opens, it's Active
1069 // --- Other User Flags ------------------------------------------------
1070   WFLG_RMBTRAP       = $00010000; // Catch RMB events for your own
1071   WFLG_NOCAREREFRESH = $00020000; // not to be bothered with REFRESH
1072 // - V36 new Flags which the programmer may specify in TNewWindow.Flags
1073   WFLG_NW_EXTENDED   = $00040000; // extension data provided  see TExtNewWindow
1074 // - V39 new Flags which the programmer may specify in TNewWindow.Flags
1075   WFLG_NEWLOOKMENUS  = $00200000; // window has NewLook menus
1076 // These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF!
1077   WFLG_WINDOWACTIVE  = $00002000; // this window is the active one
1078   WFLG_INREQUEST     = $00004000; // this window is in request mode
1079   WFLG_MENUSTATE     = $00008000; // Window is active with Menus on
1080   WFLG_WINDOWREFRESH = $01000000; // Window is currently refreshing
1081   WFLG_WBENCHWINDOW  = $02000000; // WorkBench tool ONLY Window
1082   WFLG_WINDOWTICKED  = $04000000; // only one timer tick at a time
1083   WFLG_VISITOR       = $08000000; // visitor window
1084   WFLG_ZOOMED        = $10000000; // identifies "zoom state"
1085   WFLG_HASZOOM       = $20000000; // windowhas a zoom gadget
1086 // --- Other Window Values ---------------------------------------------
1087   DEFAULTMOUSEQUEUE  = 5; // no more mouse messages
1088 // --- see TIntuiMessage for the IDCMP Flag definitions -------------
1089 
1090 
1091 // === NewWindow
1092 type
1093 
1094   PNewWindow = ^TNewWindow;
1095   TNewWindow = record
1096     LeftEdge, TopEdge: SmallInt; // screen dimensions of window
1097     Width, Height: SmallInt;     // screen dimensions of window
1098     DetailPen, BlockPen: Byte;   // for bar/border/gadget rendering
1099     IDCMPFlags: LongWord;        // User-selected IDCMP flags
1100     Flags: LongWord;             // see Window struct for defines
1101     // You supply a linked-list of Gadgets for your Window.
1102     //    This list DOES NOT include system Gadgets.  You get the standard
1103     //    system Window Gadgets by setting flag-bits in the variable Flags
1104     //    (see the bit definitions under the Window structure definition)
1105     FirstGadget: PGadget;
1106     // the CheckMark is a pointer to the imagery that will be used when rendering MenuItems of this Window
1107     // that want to be checkmarked if this is equal to nil, you'll get the default imagery
1108     CheckMark: PImage;
1109     Title: STRPTR;                // the title text for this window
1110     // the Screen pointer is used only if you've defined a CUSTOMSCREEN and want this Window to open in it. If so, you pass
1111     // the Pointer of the Custom Screen structure in this variable.  Otherwise, this variable is ignored and doesn't have to be initialized.
1112     Screen: PScreen;
1113     // WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap structure in this variable.
1114     // If not, this variable is ignored and doesn't have to be initialized
1115     BitMap: PBitMap;
1116     { the values describe the minimum and maximum sizes of your Windows. these matter only if you've chosen the WINDOWSIZING Gadget option,
1117       which means that you want to let the User to change the size of this Window.  You describe the minimum and maximum sizes that the
1118       Window can grow by setting these variables.  You can initialize any one these to zero, which will mean that you want to duplicate
1119       the setting for that dimension (if MinWidth == 0, MinWidth will be set to the opening Width of the Window).
1120       You can change these settings later using SetWindowLimits(). If you haven't asked for a SIZING Gadget, you don't have to initialize any of these variables.}
1121     MinWidth, MinHeight: SmallInt; // minimums
1122     MaxWidth, MaxHeight: Word;     // maximums
1123     // the type variable describes the Screen in which you want this Window to open.  The type value can either be CUSTOMSCREEN or one of the
1124     // system standard Screen Types such as WBENCHSCREEN.  See the type definitions under the Screen structure
1125     WType: Word;
1126   end;
1127 
1128 // The following structure is the future NewWindow.  Compatibility issues require that the size of NewWindow not change.
1129 //  Data in the common part (NewWindow) indicates the the extension fields are being used.
1130 //  NOTE WELL: This structure may be subject to future extension. Writing code depending on its size is not allowed.
1131   PExtNewWindow = ^TExtNewWindow;
1132   TExtNewWindow = record
1133     LeftEdge, TopEdge: SmallInt;
1134     Width, Height: SmallInt;
1135     DetailPen, BlockPen: Byte;
1136     IDCMPFlags: LongWord;
1137     Flags: LongWord;
1138     FirstGadget: PGadget;
1139     CheckMark: PImage;
1140     Title: STRPTR;
1141     Screen: PScreen;
1142     BitMap: PBitMap;
1143     MinWidth, MinHeight: SmallInt;
1144     MaxWidth, MaxHeight: Word;
1145     // the type variable describes the Screen in which you want this Window to open.  The type value can either be CUSTOMSCREEN or one of the
1146     // system standard Screen Types such as WBENCHSCREEN.  See the type definitions under the Screen structure.
1147     // A new possible value for this field is PUBLICSCREEN, which defines the window as a 'visitor' window.  See below for additional information provided.
1148     Type_: Word;
1149     // extensions for V36 if the NewWindow Flag value WFLG_NW_EXTENDED is set, then this field is assumed to point to an array ( or chain of arrays)
1150     // of TagItem structures.  See also ExtNewScreen for another use of TagItems to pass optional data. see below for tag values and the corresponding data.
1151     Extension: PTagItem;
1152   end;
1153 
1154 // The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow. They are values in a TagItem array passed as extension/replacement
1155 // values for the data in NewWindow.  OpenWindowTagList() can actually work well with a NULL NewWindow pointer.
1156 const
1157   WA_Dummy     =   (TAG_USER + 99); // $80000063
1158 // these tags simply override TNewWindow parameters
1159   WA_Left      = WA_Dummy + $01;
1160   WA_Top       = WA_Dummy + $02;
1161   WA_Width     = WA_Dummy + $03;
1162   WA_Height    = WA_Dummy + $04;
1163   WA_DetailPen = WA_Dummy + $05;
1164   WA_BlockPen  = WA_Dummy + $06;
1165   WA_IDCMP     = WA_Dummy + $07;
1166   // "bulk" initialization of TNewWindow.Flags
1167   WA_Flags     = WA_Dummy + $08;
1168   WA_Gadgets   = WA_Dummy + $09;
1169   WA_Checkmark = WA_Dummy + $0A;
1170   WA_Title     = WA_Dummy + $0B;
1171   // means you don't have to call SetWindowTitles after you open your window
1172   WA_ScreenTitle  = WA_Dummy + $0C;
1173   WA_CustomScreen = WA_Dummy + $0D;
1174   WA_SuperBitMap  = WA_Dummy + $0E;
1175   // also implies WFLG_SUPER_BITMAP property
1176   WA_MinWidth  = WA_Dummy + $0F;
1177   WA_MinHeight = WA_Dummy + $10;
1178   WA_MaxWidth  = WA_Dummy + $11;
1179   WA_MaxHeight = WA_Dummy + $12;
1180   // The following are specifications for new features
1181   WA_InnerWidth    = WA_Dummy + $13; // You can specify the dimensions of the interior region of your window, independent of what the border widths will be.  You probably want
1182   WA_InnerHeight   = WA_Dummy + $14; // to also specify WA_AutoAdjust to allow Intuition to move your window or even shrink it so that it is completely on screen.
1183   WA_PubScreenName = WA_Dummy + $15; // declares that you want the window to open as a visitor on the public screen whose name is pointed to by PByte ti_Data
1184   WA_PubScreen     = WA_Dummy + $16; // open as a visitor window on the public screen whose Pointer is in PScreen ti_Data.
1185                                      // To ensure that this screen remains open, you should either be the screen's owner, have a window open on the screen, or use LockPubScreen().
1186   WA_PubScreenFallBack = WA_Dummy + $17; // A Boolean, specifies whether a visitor window should "fall back" to the default public screen
1187                                            // (or Workbench) if the named public screen isn't available
1188   WA_WindowName = WA_Dummy + $18; // optional name for your window, useful for input helpers and diagnostic tools to identify the window
1189                                   // when it doesn't have a proper title. (V51)
1190   WA_Colors     = WA_Dummy + $19; // a ColorSpec array for colors to be set when this window is active.  This is not
1191                                   // implemented, and may not be, since the default values to restore would be hard to track.
1192                                   // We'd like to at least support per-window colors for the mouse pointer sprite.
1193   WA_Zoom       = WA_Dummy + $1A; // ti_Data points to an array of four SmallInt's, the initial Left/Top/Width/Height values of
1194                                   // the "alternate" zoom position/dimensions. It also specifies that you want a Zoom gadget
1195                                   // for your window, whether or not you have a sizing gadget.
1196   WA_MouseQueue = WA_Dummy + $1B; // ti_Data contains initial value for the mouse message backlog limit for this window.
1197   WA_BackFill   = WA_Dummy + $1C; // provides a "backfill hook" for your window's Layer. See layers.library/CreateUpfrontHookLayer().
1198   WA_RptQueue   = WA_Dummy + $1D; // initial value of repeat key backlog limit
1199   // These Boolean tag items are alternatives to the TNewWindow.Flags boolean flags with similar names.
1200   WA_SizeGadget    = WA_Dummy + $1E;
1201   WA_DragBar       = WA_Dummy + $1F;
1202   WA_DepthGadget   = WA_Dummy + $20;
1203   WA_CloseGadget   = WA_Dummy + $21;
1204   WA_Backdrop      = WA_Dummy + $22;
1205   WA_ReportMouse   = WA_Dummy + $23;
1206   WA_NoCareRefresh = WA_Dummy + $24;
1207   WA_Borderless    = WA_Dummy + $25;
1208   WA_Activate      = WA_Dummy + $26;
1209   WA_RMBTrap       = WA_Dummy + $27;
1210   WA_WBenchWindow  = WA_Dummy + $28; // PRIVATE!!
1211   WA_SimpleRefresh = WA_Dummy + $29; // only specify if TRUE
1212   WA_SmartRefresh  = WA_Dummy + $2A; // only specify if TRUE
1213   WA_SizeBRight    = WA_Dummy + $2B;
1214   WA_SizeBBottom   = WA_Dummy + $2C;
1215   // New Boolean properties
1216   WA_AutoAdjust    = WA_Dummy + $2D; // shift or squeeze the window's position and dimensions to fit it on screen.
1217   WA_GimmeZeroZero = WA_Dummy + $2E; // equiv. to TNewWindow.Flags WFLG_GIMMEZEROZERO
1218   // New for V37: WA_MenuHelp (ignored by V36)
1219   WA_MenuHelp      = WA_Dummy + $2F; // Enables IDCMP_MENUHELP:  Pressing HELP during menus will return IDCMP_MENUHELP message.
1220   // New for V39: (ignored by V37 and earlier)
1221   WA_NewLookMenus  = WA_Dummy + $30; // Set to TRUE if you want NewLook menus
1222   WA_AmigaKey      = WA_Dummy + $31; // Pointer to image for Amiga-key equiv in menus
1223   WA_NotifyDepth   = WA_Dummy + $32; // Requests IDCMP_CHANGEWINDOW message when window is depth arranged (imsg^.Code = CWCODE_DEPTH)
1224   // WA_Dummy + $33 is obsolete
1225   WA_Pointer       = WA_Dummy + $34; // Allows you to specify a custom pointer for your window.  ti_Data points to a
1226                                      // pointer object you obtained via "pointerclass". nil signifies the default pointer.
1227                                      // This tag may be passed to OpenWindowTags() or SetWindowPointer().
1228   WA_BusyPointer   = WA_Dummy + $35; // ti_Data is boolean.  Set to TRUE to request the standard busy pointer.
1229                                      // This tag may be passed to OpenWindowTags() or SetWindowPointer().
1230   WA_PointerDelay  = WA_Dummy + $36; // ti_Data is boolean.  Set to TRUE to request that the changing of the pointer be slightly delayed.  The change
1231                                      // will be called off if you call NewSetPointer() before the delay expires.  This allows
1232                                      // you to post a busy-pointer even if you think the busy-time may be very Word, without fear of a flashing pointer.
1233                                      // This tag may be passed to OpenWindowTags() or SetWindowPointer().
1234   WA_TabletMessages= WA_Dummy + $37; // ti_Data is a boolean.  Set to TRUE to request that tablet information be included in IntuiMessages sent to your window.
1235                                      // Requires that something (i.e. a tablet driver) feed IESUBCLASS_NEWTABLET InputEvents into
1236                                      // the system.  For a pointer to the TabletData, examine the ExtIntuiMessage->eim_TabletData
1237                                      // field.  It is UNSAFE to check this field when running on pre-V39 systems.  It's always
1238                                      // safe to check this field under V39 and up, though it may be nil.
1239   WA_HelpGroup     = WA_Dummy + $38; // When the active window has gadget help enabled, other windows of the same HelpGroup number
1240                                      // will also get GadgetHelp.  This allows GadgetHelp to work for multi-windowed applications.
1241                                      // Use GetGroupID() to get an ID number.  Pass this number as ti_Data to all your windows. See also the HelpControl() function.
1242   WA_HelpGroupWindow=WA_Dummy + $39; // When the active window has gadget help enabled, other windows of the same HelpGroup will also get
1243                                      // GadgetHelp.  This allows GadgetHelp to work for multi-windowed applications.  As an alternative
1244                                      // to WA_HelpGroup, you can pass a pointer to any other window of the same group to join its help
1245                                      // group.  Defaults to NULL, which has no effect. See also the HelpControl() function.
1246 // New for V50:  (ignored by V40 and earlier)
1247   WA_UserPort   = WA_Dummy + $3a; // (PMsgPort) A shared idcmp port, Intuition will not attempt to delete this port in ModifyIDCMP() or
1248                                   // CloseWindow(). The CloseWindow() routine also takes care of stripping off all intuimessages that belong to the given window. V50.
1249   WA_WindowBox  = WA_Dummy + $3b; // (PIBox) An alternative way of specifying the window position and size. V50.
1250   WA_Hidden     = WA_Dummy + $3c; // (BOOL) if TRUE, the window will open in hidden state. V50.
1251   WA_ToolBox    = WA_Dummy + $3d; // (BOOL) if TRUE, the window can't be activated. ToolBox windows send gadget messages. V50.
1252   WA_Reserved1  = WA_Dummy + $3e; // Reserved for system use. V50.
1253   WA_MenuHook   = WA_Dummy + $3f; // (PHook) Hook to call when user requests the menu of the window. V50.
1254   WA_AutoAdjustDClip = WA_Dummy + $40; // (BOOL) Like WA_AutoAdjust but moves the window onto the DClip. V50.
1255   WA_ShapeRegion= WA_Dummy + $41; // (PRegion) Region describing the shape of the window. See layers.library. V50.
1256   WA_ShapeHook  = WA_Dummy + $42; // (PHook) Hook providing the shape of the window on the fly. V50.
1257   WA_InFrontOf  = WA_Dummy + $43; // (PWindow) Open the window in front of the given window. V50.
1258   WA_GrabFocus  = WA_Dummy + $44; // (LongWord) When the window is active, limit mousepointer movements to the window area. The number given is the
1259                                   // time (in intuiticks) this restriction will apply. This is so to give back full control to the user even when
1260                                   // your application has crashed. The SetWindowAttrs() function allows you to set this feature at any time.
1261                                   // A value of 0 disables it. The maximum value is 100.
1262   WA_StayTop    = WA_Dummy + $45; // (BOOL) Make this window to always stay in front of all others. V50.
1263   WA_MouseLimits= WA_Dummy + $46; // (PIBox) This tag works together with WA_GrabFocus and allows you to specify the working area of the mouse
1264                                   // pointer. The coordinates are relative to the upper left corner of the window.
1265   WA_NoMenuKeyVerify=WA_Dummy+$47;// (BOOL) Restrict usage of menu verification for this window to mouse menu events only, letting keyboard shortcuts pass
1266                                   // through. Ignored if IDCMP_MENUVERIFY is not set. V51.
1267   WA_Reserved2  = WA_Dummy + $48; // Reserved for system use. V51.
1268   WA_AlphaClips = WA_Dummy + $49; // (PClipRect) ClipRect list describing the alpha map of the window. See layers.library. V53.
1269   WA_AlphaHook  = WA_Dummy + $4A; // (PHook) Hook providing the alpha map of the window on the fly. V53.
1270   WA_Opaqueness = WA_Dummy + $4B; // (LongWord) Overall opaqueness of the window. V53.
1271   WA_FadeTime   = WA_Dummy + $4C; // (LongWord) Duration of an opaqueness transition for the window, expressed in microseconds; 0 means "immediate". V53.
1272   WA_OverrideOpaqueness = WA_Dummy + $4D; // (BOOL) If TRUE, the window opaqueness set via WA_Opaqueness
1273                                           //  will never get affected by any global opaqueness level from user preferences. V53.
1274   WA_NoHitThreshold = WA_Dummy + $4E; // (LongInt) Any pixel of the window whose opaqueness is less than or equal to the specified amount will be treated as if it
1275   // were intangible, i.e. it will let mouse clicks pass through to windows behind it. Possible values range from zero (only
1276   // fully transparent pixels are intangible) to 255 (no pixel in the window can ever be hit). Additionally, -1 will make the
1277   // whole window tangible, even where it is fully transparent. Use with care, as making opaque areas not hittable (or vice  versa) may easily confuse the user. Defaults to 16. V53.
1278   WA_DropShadows = WA_Dummy + $4F; // (LongInt) Allow drop shadows on window sides, if requested. Set to FALSE to prevent shadows from ever being drawn for
1279   // this window, to TRUE to always allow shadows, and to -1 to only allow them if this window has a visible border.
1280   // This tag defaults to -1, and is ignored if compositing is not enabled for this window's screen. V53.
1281   WA_PointerType = WA_Dummy + $50; // Allows you to set one of Intuition's built-in pointers for your window. Zero signifies the default pointer.
1282                                    // This tag may be passed to OpenWindowTags() or SetWindowPointer(). V53.
1283   WA_MenuStrip   = WA_Dummy + $51; // (PMenu) A menu strip for the window. This can be either a linked chain of traditional Menu structures, or a BOOPSI menu object tree from "menuclass". V54.
1284   WA_ContextMenuHook = WA_Dummy + $52; // (struct Hook *) This hook will be invoked when Intuition is about to bring up the menus of a window
1285 
1286 type
1287 // Definitions for WA_ContextMenuHook (window context menu hook feature).
1288   PContextMenuMsg = ^TContextMenuMsg;
1289   TContextMenuMsg = record
1290     State: LongWord; // CM_QUERY
1291     // Set the following fields on CM_QUERY
1292     Menu: APTR;     // A context menu, or nil for the window menu
1293     Context: APTR;  // The application-specific element the menu is tied to
1294   end;
1295 const
1296   CM_QUERY = 0;  // Menus are about to open, please return a context menu
1297 // Special codes for ShowWindow() and WA_InFrontOf: Give this as target window where to move your window to.
1298   WINDOW_BACKMOST  = PWindow(nil);
1299   WINDOW_FRONTMOST = PWindow(1);
1300 // HelpControl() flags: HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more windows.
1301   HC_GADGETHELP  = 1;
1302 
1303 // IntuitionControlA() tags:
1304   ICTRL_Dummy = TAG_USER + $1C000;
1305   // No public tags defined so far
1306 
1307 { New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass of the IECLASS_NEWPOINTERPOS event.
1308   The ie_EventAddress of such an event points to a TabletData structure (see below).
1309 
1310   The TabletData structure contains certain elements including a taglist. The taglist can be used for special tablet parameters.  A tablet driver
1311   should include only those tag-items the tablet supports.  An application can listen for any tag-items that interest it.  Note: an application
1312   must set the WA_TabletMessages attribute to TRUE to receive this extended information in its IntuiMessages.
1313 
1314   The definitions given here MUST be followed.  Pay careful attention to normalization and the interpretation of signs.
1315 
1316   Note: a stylus that supports tilt should use the TABLETA_AngleX and TABLETA_AngleY attributes.  Tilting the stylus so the tip
1317   points towards increasing or decreasing X is actually a rotation around the Y-axis.  Thus, if the stylus tip points towards
1318   positive X, then that tilt is represented as a negative TABLETA_AngleY.  Likewise, if the stylus tip points towards positive Y, that tilt is represented by positive TABLETA_AngleX.}
1319 const
1320  TABLETA_Dummy       = TAG_USER + $3A000;
1321  TABLETA_TabletZ     = TABLETA_Dummy + $01; // the current value of the tablet in the Z direction. This unsigned value should typically be in the natural units of the tablet. You should also provide TABLETA_RangeZ.
1322  TABLETA_RangeZ      = TABLETA_Dummy + $02; // the maximum value of the tablet in the Z direction. Normally specified along with TABLETA_TabletZ, this allows the application to scale the actual Z value across its range.
1323  TABLETA_AngleX      = TABLETA_Dummy + $03; // the angle of rotation or tilt about the X-axis.  This number should be normalized to fill a signed long LongInt.  Positive values imply a clockwise rotation about the X-axis when viewing from +X towards the origin.
1324  TABLETA_AngleY      = TABLETA_Dummy + $04; // the angle of rotation or tilt about the Y-axis.  This number should be normalized to fill a signed long LongInt.  Positive values imply a clockwise rotation about the Y-axis when viewing from +Y towards the origin.
1325  TABLETA_AngleZ      = TABLETA_Dummy + $05; // the angle of rotation or tilt about the Z axis.  This number should be normalized to fill a signed long LongInt.  Positive values imply a clockwise rotation about the Z-axis when viewing from +Z towards the origin.
1326  TABLETA_Pressure    = TABLETA_Dummy + $06; // the pressure reading of the stylus.  The pressure should be normalized to fill a signed long LongInt.  Typical devices
1327                                             // won't generate negative pressure, but the possibility is not precluded. The pressure threshold which is considered to cause a button-click is
1328                                             // expected to be set in a Preferences program supplied by the tablet vendor.  The tablet driver would send IECODE_LBUTTON-type events as the pressure crossed that threshold.
1329  TABLETA_ButtonBits  = TABLETA_Dummy + $07; // ti_Data is a long LongInt whose bits are to be interpreted at the state of the first 32 buttons of the tablet.
1330  TABLETA_InProximity = TABLETA_Dummy + $08; // ti_Data is a boolean.  For tablets that support proximity, they should send the (TABLETA_InProximity,FALSE) tag item
1331                                             // when the stylus is out of proximity.  One possible use we can forsee is a mouse-blanking commodity which keys off this to blank the
1332                                             // mouse.  When this tag is absent, the stylus is assumed to be in proximity.
1333  TABLETA_ResolutionX = TABLETA_Dummy + $09; // ti_Data is an unsigned long LongInt which is the x-axis resolution in dots per inch.
1334  TABLETA_ResolutionY = TABLETA_Dummy + $0A; // ti_Data is an unsigned long LongInt which is the y-axis resolution in dots per inch.
1335 
1336 // If your window sets WA_TabletMessages to TRUE, then it will receive extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
1337 // field points at a TabletData structure.  This structure contains additional information about the input event.
1338 type
1339   PTabletData = ^TTabletData;
1340   TTabletData = record
1341     td_XFraction, td_YFraction: Word; // Sub-pixel position of tablet, in screen coordinates, scaled to fill a word fraction
1342     td_TabletX, td_TabletY: LongWord; // Current tablet coordinates along each axis
1343     td_RangeX, td_RangeY: LongWord;   // Tablet range along each axis.  For example, if td_TabletX can take values 0-999, td_RangeX should be 1000.
1344     td_TagList: PTagItem;             // Pointer to tag-list of additional tablet attributes.
1345  end;
1346 
1347 // If a tablet driver supplies a hook for ient_CallBack, it will be invoked in the standard hook manner.  A0 will point to the Hook
1348 // itself, A2 will point to the InputEvent that was sent, and A1 will point to a TabletHookData structure.  The InputEvent's
1349 // ie_EventAddress field points at the IENewTablet structure that the driver supplied.
1350 // Based on the thd_Screen, thd_Width, and thd_Height fields, the driver should scale the ient_TabletX and ient_TabletY fields and store the
1351 // result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and ient_ScaledYFraction. The tablet hook must currently return nil.
1352 // This is the only acceptable return-value under V39.
1353   PTabletHookData = ^TTabletHookData;
1354   TTabletHookData = record
1355     thd_Screen: PScreen; // Pointer to the active screen: Note: if there are no open screens, thd_Screen will be NULL. thd_Width and thd_Height will then describe an NTSC 640x400 screen.  Please scale accordingly.
1356     thd_Width, thd_Height: LongWord; // The width and height (measured in pixels of the active screen) that your are to scale to:
1357     thd_ScreenChanged  : LongInt; // Non-zero if the screen or something about the screen changed since the last time you were invoked:
1358  end;
1359 // New for V39:
1360 // All IntuiMessages are now slightly extended.  The ExtIntuiMessage structure has an additional field for tablet data, which is usually
1361 // nil.  If a tablet driver which is sending IESUBCLASS_NEWTABLET events is installed in the system, windows with the WA_TabletMessages
1362 // property set will find that eim_TabletData points to the TabletData structure.  Applications must first check that this field is non-NULL;
1363 // it will be NULL for certain kinds of message, including mouse activity generated from other than the tablet (i.e. the keyboard equivalents or the mouse itself).
1364 // NEVER EVER examine any extended fields when running under pre-V39!
1365 // NOTE: This structure is subject to grow in the future. Making assumptions about its size is A BAD IDEA.
1366   PExtIntuiMessage = ^TExtIntuiMessage;
1367   TExtIntuiMessage = record
1368     eim_IntuiMessage: TIntuiMessage;
1369     eim_TabletData: PTabletData;
1370   end;
1371 
1372 // === DoScrollHook() specifications (V50)
1373 // Hook function with extra data; invoked when one of the scrolling operations are to be performed.
1374   PScrollHook = ^TScrollHook;
1375   TScrollHook = record
1376     sh_Hook: PHook;
1377     sh_Top: LongInt;     // This is the number of the first visible item.
1378     sh_Total: LongInt;   // This is the total number of items available for display.
1379     sh_Visible: LongInt; // This is how many entries can be visible at a time.
1380     sh_Size: LongInt;    // This is how many pixels high/wide each item is.
1381   end;
1382 // The message passed to your scrolling function. The action to perform is in the sm_Action field.
1383   PScrollMsg = ^TScrollMsg;
1384   TScrollMsg = record
1385     sm_Action: LongWord;   // The action to perform
1386     sm_NumItems: LongInt;  // Number of items to render
1387     sm_NumPixels: LongInt; // Number of pixels to scroll
1388     sm_TopItem: LongInt;   // The first visible item
1389     sm_TopPixel: LongInt;  // The first visible pixel
1390   end;
1391 const
1392 // Scrolling actions to perform.
1393   SMA_GetScrollerTop = 0; // Return the number of the first visible line.
1394   SMA_RedrawAll      = 1; // Redraw the entire display.
1395   SMA_Scroll         = 2; // Scroll the display; the number of pixels to scroll is stored in the sm_NumPixels field. Return whether
1396                           // the scrolling operation produced layer damage which needs to be repaired.
1397   SMA_Draw           = 3; // Draw a portion of the display. The number of lines to print is in the sm_NumItems field. The pixel position
1398                           // to start drawing at is in the sm_TopPixel field. The first line to print is in the sm_TopItem field.
1399   SMA_RepairDamage   = 4; // Same as SMA_Draw except that the drawing operations must be performed between BeginRefresh() and EndRefresh().
1400 // How to perform the scrolling operation (this is the scroll mode parameter of the DoScrollHook() function.
1401   DSHM_Smooth = 0; // Scroll smoothly
1402   DSHM_Jump   = 1; // Jump straight to the requested display position.
1403 
1404 // GUI element base types
1405   BT_BACKGROUND  = $00000000; // Generic background
1406   BT_DRIPEN      = $00100000; // A base DrawInfo pen
1407   BT_WINBORDER   = $00200000; // Window border
1408   BT_GADGET      = $00300000; // Generic gadget
1409   BT_PROPKNOB    = $00400000; // Proportional gadget knob
1410   BT_PROPBG      = $00500000; // Proportional gadget background
1411   BT_WINPROPKNOB = $00600000; // Prop. gadget knob in window border
1412   BT_WINPROPBG   = $00700000; // Prop. gadget backgr. in window border
1413   BT_MENU        = $00800000; // Menu panel background
1414   BT_SCREENBAR   = $00900000; // Screen titlebar
1415   BT_WINDOWBAR   = $00A00000; // Window titlebar
1416   BT_WINDOWBG    = $00B00000; // Window background
1417   BT_REQUESTERBG = $00C00000; // Requester background
1418   BT_TABPAGE     = $00D00000; // Tab page background
1419 
1420   BT_FLAGSMASK   = $000F0000; // Flags valid for ALL base types
1421   BT_OFFSETRECT  = $00010000; // Left, top contain backfill offsets
1422   BT_DIRECTSHADE = $00020000; // Flag for ShadeRectA(), see autodoc
1423 // Shading levels
1424   LEVEL_BRIGHT     = 0; // Full-intensity bright details
1425   LEVEL_HALFBRIGHT = 1; // Half-intensity bright details
1426   LEVEL_NORMAL     = 2; // Normal imagery
1427   LEVEL_HALFDARK   = 3; // Half-intensity dark details
1428   LEVEL_DARK       = 4; // Full-intensity dark details
1429 // Contrast levels and flags
1430   STD_DISABLE_CONTRAST = $1000; // For disabled imagery
1431   CNTR_CORRECT         = $0100; // Correct contrast of bright details
1432   CNTR_ABSOLUTE        = $0200; // Absolute (non-percentage) shading
1433 // ShadeRectA() tags
1434   SRA_Dummy = $03800000;
1435   SRA_OffsetX     = SRA_Dummy + 1; // (Word) Logical rendering offset on the X axis.
1436   SRA_OffsetY     = SRA_Dummy + 2; // (Word) Logical rendering offset on the Y axis.
1437   SRA_DeltaX      = SRA_Dummy + 3; // (Word) Delta increment for SRA_OffsetX.
1438   SRA_DeltaY      = SRA_Dummy + 4; // (Word) Delta increment for SRA_OffsetY.
1439   SRA_Domain      = SRA_Dummy + 5; // (PRectangle) Logical rendering container.
1440   SRA_DirectShade = SRA_Dummy + 6; // (BOOL) Force on-the-fly shading
1441   SRA_RefreshBG   = SRA_Dummy + 7; // (BOOL) Redraw background first to avoid overshading
1442 // DisableTemplate() data types (V51)
1443   TT_BITPLANE = 0; // Template is a 16-bit-aligned bitplane
1444   TT_ALPHA8   = 1; // Template is an alpha map (modulo = 1)
1445   TT_ALPHA16  = 2; // Template is an alpha map (modulo = 2)
1446   TT_ALPHA24  = 3; // Template is an alpha map (modulo = 3)
1447   TT_ALPHA32  = 4; // Template is an alpha map (modulo = 4)
1448 // GUI attributes
1449   GUIA_Dummy  = TAG_USER + $4400000;
1450   //******* Window-, screen- and global-level GUI attributes
1451   GUIA_DefaultStyle        = GUIA_Dummy + 1;  // (APTR) Default style plugin, may be overridden (G/IG/SG).
1452   GUIA_WindowBorderStyle   = GUIA_Dummy + 2;  // (APTR) Style plugin to be used to render window borders (G/G/G).
1453   GUIA_WindowGadgetStyle   = GUIA_Dummy + 3;  // (APTR) Style plugin to be used to render border gadgets (G/G/G).
1454   GUIA_SizeGadgetWidth     = GUIA_Dummy + 4;  // (ShortInt) Width of window sizing gadget; -1 = automatic (G/IG/SG).
1455   GUIA_SizeGadgetHeight    = GUIA_Dummy + 5;  // (ShortInt) Height of window sizing gadget; -1 = automatic (G/IG/SG).
1456   GUIA_ArrowGadgetWidth    = GUIA_Dummy + 6;  // (ShortInt) Width of border arrow gadgets; -1 = automatic (G/IG/SG).
1457   GUIA_ArrowGadgetHeight   = GUIA_Dummy + 7;  // (ShortInt) Height of border arrow gadgets; -1 = automatic (G/IG/SG).
1458   GUIA_WindowBorderLeft    = GUIA_Dummy + 8;  // (ShortInt) Thickness of left window border, without gadgets (G/IG/SG).
1459   GUIA_WindowBorderTop     = GUIA_Dummy + 9;  // (ShortInt) Thickness of top window border, without gadgets (G/IG/SG).
1460   GUIA_WindowBorderRight   = GUIA_Dummy + 10; // (ShortInt) Thickness of right window border, without gadgets (G/IG/SG).
1461   GUIA_WindowBorderBottom  = GUIA_Dummy + 11; // (ShortInt) Thickness of bottom window border, without gadgets (G/IG/SG).
1462   GUIA_WindowTitlePosition = GUIA_Dummy + 12; // (Byte) Position of titles in window titlebars (G/IG/SG).
1463   GUIA_WindowBarPadding    = GUIA_Dummy + 13; // (Byte) Added to the font height to set titlebar height (G/IG/SG).
1464   GUIA_WindowReserved      = GUIA_Dummy + 14; // (BOOL) Reserved for now, don't use.
1465   GUIA_WindowPropKnobHandle= GUIA_Dummy + 15; // (Word) Type of handle for window border scroller knobs (G/ISG/SG).
1466   GUIA_WindowPropKnobColor = GUIA_Dummy + 16; // (BOOL) Do border scroller knobs use window border color? (G/ISG/SG).
1467   GUIA_WindowPropBackground= GUIA_Dummy + 17; // (Word) Type of background for window border scrollers (G/ISG/SG).
1468   GUIA_PropBackground      = GUIA_Dummy + 18; // (Word) Type of background for proportional gadgets (G/ISG/SG).
1469   GUIA_WindowPropKnobBackfill      = GUIA_Dummy + 19; // (PHook) Backfill hook for border scroller knobs (G/ISG/SG).
1470   GUIA_PropKnobBackfill            = GUIA_Dummy + 20; // (PHook) Backfill hook for prop gadget knobs (G/ISG/SG).
1471   GUIA_WindowPropSelKnobBackfill   = GUIA_Dummy + 21; // (PHook) Backfill hook for selected border knobs (G/ISG/SG).
1472   GUIA_PropSelKnobBackfill         = GUIA_Dummy + 22; // (PHook) Backfill hook for selected prop knobs (G/ISG/SG).
1473   GUIA_WindowPropInactKnobBackfill = GUIA_Dummy + 23; // (PHook) Backfill hook for inactive border knobs (G/ISG/SG).
1474   GUIA_WindowPropBackfill          = GUIA_Dummy + 24; // (PHook) Backfill hook for border scrollers (G/ISG/SG).
1475   GUIA_WindowPropInactBackfill     = GUIA_Dummy + 25; // (PHook) Backfill hook for inactive border scrollers (G/ISG/SG).
1476   GUIA_PropBackfill                = GUIA_Dummy + 26; // (PHook) Backfill hook for proportional gadgets (G/ISG/SG).
1477   GUIA_SysImageFrameType   = GUIA_Dummy + 27; // (Word) Type of frame for screen and window system gadgets (G/IG/SG).
1478   GUIA_WindowPropBorder    = GUIA_Dummy + 28; // (BOOL) Do window border scrollers have a double border? (G/ISG/SG).
1479   GUIA_PropBorder          = GUIA_Dummy + 29; // (BOOL) Do GT/RA scrollers have a double border? (G/ISG/SG).
1480   GUIA_WindowPropSpacing   = GUIA_Dummy + 30; // (Byte) Thickness of window scrollers borders (G/ISG/SG).
1481   GUIA_PropSpacing         = GUIA_Dummy + 31; // (Byte) Thickness of GT/RA scrollers borders (G/ISG/SG).
1482   GUIA_PropKnobHandle      = GUIA_Dummy + 32; // (Word) Type of handle for scroller knobs (G/ISG/SG).
1483   GUIA_PropKnobColor       = GUIA_Dummy + 33; // (BOOL) Do scroller knobs use FILLPEN as their color? (G/ISG/SG).
1484   GUIA_WindowSizeBorder    = GUIA_Dummy + 34; // (Word) Preferred border(s) to place the sizing gadget in (G/IG/SG).
1485   GUIA_WindowGadgetFrameStyle = GUIA_Dummy + 35; // (APTR) Style plugin to be used to render border gadget frames (G/G/G).
1486   GUIA_GadgetStyle         = GUIA_Dummy + 36; // (APTR) Style plugin to be used to render GT/RA gadgets (G/G/G).
1487   GUIA_DefaultGeometry     = GUIA_Dummy + 37; // (APTR) Style plugin defining geometry of GUI elements (G/IG/SG).
1488   GUIA_WindowGadgetGeometry= GUIA_Dummy + 38; // (APTR) Style plugin defining geometry of border gadgets (G/G/G).
1489   GUIA_GadgetGeometry      = GUIA_Dummy + 39; // (APTR) Style plugin defining geometry of GT/RA gadgets (G/G/G).
1490   GUIA_ScreenBarGadgetSize = GUIA_Dummy + 40; // (APTR) Size of gadgets in the screen titlebar (G/IG/SG).
1491   GUIA_WindowBarGadgetSize = GUIA_Dummy + 41; // (APTR) Size of gadgets in the window titlebar (G/ISG/SG).
1492   GUIA_GadgetArrowType     = GUIA_Dummy + 42; // (LongWord) Type of arrow symbols to be used in arrow buttons (G/IG/SG).
1493   GUIA_GadgetCycleType     = GUIA_Dummy + 43; // (LongWord) Type of cycle symbol to be used in cycle gadgets (G/IG/SG).
1494   GUIA_GadgetArrowStyle    = GUIA_Dummy + 44; // (APTR) Style plugin to be used to render GT/RA arrow buttons (G/G/G).
1495   GUIA_GadgetCycleStyle    = GUIA_Dummy + 45; // (APTR) Style plugin to be used to render GT/RA cycle gadgets (G/G/G).
1496   GUIA_SysImageSymbolType  = GUIA_Dummy + 46; // (Word) Type of symbols for screen and window system gadgets (G/IG/SG).
1497   GUIA_SysIGeometryType    = GUIA_Dummy + 47; // (Word) Type of geometry for screen and window system gadgets (G/IG/SG).
1498   GUIA_WindowBarBackfill   = GUIA_Dummy + 48; // (PHook) Backfill hook for active window titlebars (G/ISG/SG).
1499   GUIA_WindowBarInactBackfill = GUIA_Dummy + 49; // (PHook) Backfill hook for inactive window titlebars (G/ISG/SG).
1500   GUIA_WindowBorderBackfill= GUIA_Dummy + 50; // (PHook) Backfill hook for active window borders (G/ISG/SG).
1501   GUIA_WindowBorderInactBackfill = GUIA_Dummy + 51; // (PHook) Backfill hook for inactive window borders (G/ISG/SG).
1502   GUIA_WindowPropLook      = GUIA_Dummy + 52; // (BOOL) Use the GUIA_FramePropLook also for border scrollers? (G/ISG/SG).
1503   GUIA_EvenRequesterButtons= GUIA_Dummy + 53; // (BOOL) Make all buttons of system requesters equally wide? (G/ISG/SG).
1504   GUIA_RequestersPosition  = GUIA_Dummy + 54; // (Word) Opening position of system requesters (G/ISG/SG).
1505   GUIA_WindowBorderLook    = GUIA_Dummy + 55; // (Word) Type of window border (3D, framed, flat...) (G/ISG/SG).
1506   GUIA_Reserved1           = GUIA_Dummy + 56;
1507   GUIA_Reserved2           = GUIA_Dummy + 57;
1508   GUIA_Reserved3           = GUIA_Dummy + 58; // (APTR) System reserved attributes, don't use.
1509   GUIA_WindowBarFrameThickness= GUIA_Dummy + 59; // (Word) Thickness of 3D edges of window titlebar frames (1 or 2) (G/ISG/SG).
1510   GUIA_WindowFrameThickness= GUIA_Dummy + 60; // (Word) Thickness of 3D edges of window frames (1 or 2) (G/ISG/SG).
1511   GUIA_PropOuterSpacing    = GUIA_Dummy + 61; // (Word) Make scrollers detached from lists and/or buttons? (G/ISG/SG).
1512   GUIA_SliderDisplayMode   = GUIA_Dummy + 62; // (Word) Preferred position of slider level display (G/ISG/SG).
1513   GUIA_CycleLabelJustify   = GUIA_Dummy + 63; // (Word) Justification of cycle/chooser labels (G/ISG/SG).
1514   GUIA_ClickTabLook        = GUIA_Dummy + 64; // (LongWord) Various flags affecting the look of clicktabs (G/ISG/SG).
1515   GUIA_GadgetHorizPadding  = GUIA_Dummy + 65;
1516   GUIA_GadgetVertPadding   = GUIA_Dummy + 66; // (Word) Horizontal and vertical padding for ReAction gadgets (G/ISG/SG).
1517   GUIA_WindowBackfill      = GUIA_Dummy + 67; // (PHook) Backfill hook for window background (G/ISG/SG).
1518   GUIA_RequesterBackfill   = GUIA_Dummy + 68; // (PHook) Backfill hook for requester background (G/ISG/SG).
1519   GUIA_TabTitleBackfill    = GUIA_Dummy + 69; // (PHook) Backfill hook for active tab header (G/ISG/SG).
1520   GUIA_TabActiveBackfill   = GUIA_Dummy + 70; // (PHook) Backfill hook for active tab page (G/ISG/SG).
1521   GUIA_TabInactiveBackfill = GUIA_Dummy + 71; // (PHook) Backfill hook for inactive tabs (G/ISG/SG).
1522   GUIA_LayoutHorizSpacing  = GUIA_Dummy + 72;
1523   GUIA_LayoutVertSpacing   = GUIA_Dummy + 73; // (Word) Horizontal and vertical spacing in ReAction layouts (G/ISG/SG).
1524   GUIA_GroupLabelPlace     = GUIA_Dummy + 74; // (LongWord) Position of group labels (left/center/right) (G/ISG/SG).
1525   GUIA_GroupLabelLook      = GUIA_Dummy + 75; // (LongWord) Appearance of group labels (plain, 3D, bold...) (G/ISG/SG).
1526   GUIA_GroupLabelTextAttr  = GUIA_Dummy + 76; // (PTextAttr) Font specification for group labels (G/ISG/SG).
1527   GUIA_FallbackTextAttr    = GUIA_Dummy + 77; // (PTextAttr) Font specification for fallback layout (G/ISG/SG).
1528   GUIA_GadgetTextAttr      = GUIA_Dummy + 78; // (PTextAttr) Font specification for RA gadgets (G/ISG/SG).
1529   GUIA_LabelTextAttr       = GUIA_Dummy + 79; // (PTextAttr) Font specification for RA labels (G/ISG/SG).
1530   GUIA_WindowRefresh       = GUIA_Dummy + 80; // (LongWord) Preferred window refresh type (1 = simple, 0 = smart) (G/ISG/SG).
1531   GUIA_GroupLabelVertAlign = GUIA_Dummy + 81; // (LongWord) Vertical alignment of group labels (center, baseline...) (G/ISG/SG).
1532   GUIA_ListHierNodeStyle   = GUIA_Dummy + 82; // (Word) Style of hierarchical list nodes (+/- boxes, arrows) (G/ISG/SG).
1533   GUIA_ListHierConnectType = GUIA_Dummy + 83; // (Word) How to connect hierarchical list nodes (lines, nothing) (G/ISG/SG).
1534   GUIA_Reserved4           = GUIA_Dummy + 84; // (APTR) System reserved attribute, don't use.
1535   GUIA_WindowOuterFlatThickness = GUIA_Dummy + 85; // (Word) Thickness of outer flat borders for framed/flat window look (1 or 2) (G/ISG/SG).
1536   GUIA_WindowInnerFlatThickness = GUIA_Dummy + 86;  // (Word) Thickness of inner flat borders for framed/flat window look (1 or 2) (G/ISG/SG).
1537   GUIA_CycleLook           = GUIA_Dummy + 87; // (LongWord) Various flags affecting the look of cycle/chooser gadgets (G/ISG/SG).
1538   GUIA_WindowGaugeLook     = GUIA_Dummy + 88; // (LongWord) Various flags affecting the look of window fill gauge gadgets (G/ISG/SG).
1539   GUIA_GaugeLook           = GUIA_Dummy + 89; // (LongWord) Various flags affecting the look of fill gauge gadgets (G/ISG/SG).
1540   GUIA_ClearBackground     = GUIA_Dummy + 90; // (BOOL) Always erase background before redrawing GUI elements? (G/ISG/SG).
1541   GUIA_Reserved5           = GUIA_Dummy + 91; // (APTR) System reserved attribute, don't use.
1542   GUIA_WindowAlpha         = GUIA_Dummy + 92; // (Byte) Opaqueness of a normal window (G/ISG/SG).
1543   GUIA_WindowInactAlpha    = GUIA_Dummy + 93; // (Byte) Opaqueness of an inactive window (G/ISG/SG).
1544   GUIA_WindowDragAlpha     = GUIA_Dummy + 94; // (Byte) Opaqueness of a dragged window (G/ISG/SG).
1545   GUIA_WindowOpenFadeTime  = GUIA_Dummy + 95; // (LongWord) Duration of window fade-in at open time (G/ISG/SG).
1546   GUIA_WindowCloseFadeTime = GUIA_Dummy + 96; // (LongWord) Duration of window fade-out at close time (G/ISG/SG).
1547   GUIA_WindowGoActiveFadeTime   = GUIA_Dummy + 97; // (LongWord) Duration of window fade when going active (G/ISG/SG).
1548   GUIA_WindowGoInactiveFadeTime = GUIA_Dummy + 98; // (LongWord) Duration of window fade when going inactive (G/ISG/SG).
1549   GUIA_FrameAlphaStatus    = GUIA_Dummy + 99; // (LongWord) Potential transparency of various frame types (G/G/G).
1550   GUIA_WindowShadowSizes   = GUIA_Dummy + 100; // (LongWord) Sizes of drop shadows on the four window sides; this is four signed bytes packed as a single longword (G/G/G).
1551   GUIA_WindowShadowStrength= GUIA_Dummy + 101; // (LongWord) Intensity of drop shadows for various window types (0..255); this is four unsigned bytes packed as a single longword (G/ISG/SG).
1552   GUIA_WindowShadowType    = GUIA_Dummy + 102; // (LongWord) Type of built-in window drop shadow (G/ISG/SG).
1553   GUIA_WindowShadowColor   = GUIA_Dummy + 103; // (LongWord) Color of window drop shadows in 00R8G8B8 form (G/ISG/SG).
1554   GUIA_WindowShadowDisplacement = GUIA_Dummy + 104; // (LongWord) X/Y displacement of drop shadows relative to the window; this is four signed bytes packed as a single longword, two bytes for the active window and two for inactive windows (G/ISG/SG).
1555   GUIA_WindowShadowSmoothness   = GUIA_Dummy + 105; // (Word) Smoothness level of window drop shadows (0..20) (G/ISG/SG).
1556   //************ Screen- and global-level GUI attributes
1557   GUIA_ScreenTitlePosition = GUIA_Dummy + 1001; // (Byte) Position of titles in screen titlebars (G/IG/SG).
1558   GUIA_ScreenBarPadding    = GUIA_Dummy + 1002; // (Byte) Added to the font height to set titlebar height (G/IG/SG).
1559   GUIA_MenuType            = GUIA_Dummy + 1003; // (Word) Type of menu: MT_PULLDOWN, MT_POPUP or MT_RELATIVE (G/ISG/SG).
1560   GUIA_MenuFlags           = GUIA_Dummy + 1004; // (LongWord) Menu flags (see definitions below) (G/ISG/SG).
1561   GUIA_MenuDropShadows     = GUIA_Dummy + 1005; // (BOOL) Do menus cast drop shadows? (G/ISG/SG).
1562   GUIA_MenuTransparency    = GUIA_Dummy + 1006; // (BOOL) Do menus have transparency? (G/ISG/SG).
1563   GUIA_MenuRenderHook      = GUIA_Dummy + 1007; // (PHook) Rendering hook for menus (G/ISG/SG).
1564   GUIA_MenuBackfill        = GUIA_Dummy + 1008; // (PHook) Backfill hook for menus (G/ISG/SG).
1565   GUIA_MenuStyle           = GUIA_Dummy + 1009; // (APTR) Style plugin to import menu rendering hook from (G/ISG/SG).
1566   GUIA_BrightContrast      = GUIA_Dummy + 1010;
1567   GUIA_DarkContrast        = GUIA_Dummy + 1011; // (Byte) Default contrast for edges brightening/darkening (G/IG/SG).
1568   GUIA_FillBrightContrast  = GUIA_Dummy + 1012;
1569   GUIA_FillDarkContrast    = GUIA_Dummy + 1013; // (Byte) Contrast of FILLSHINEPEN/FILLSHADOWPEN (G/IG/SG).
1570   GUIA_InactiveFillBrightContrast = GUIA_Dummy + 1014;
1571   GUIA_InactiveFillDarkContrast   = GUIA_Dummy + 1015; // (Byte) Contrast of INACTIVEFILLSHINEPEN/INACTIVEFILLSHADOWPEN (G/IG/SG).
1572   GUIA_MenuBrightContrast  = GUIA_Dummy + 1016;
1573   GUIA_MenuDarkContrast    = GUIA_Dummy + 1017; // (Byte) Contrast of MENUSHINEPEN/MENUSHADOWPEN (G/IG/SG).
1574   GUIA_SelectBrightContrast= GUIA_Dummy + 1018;
1575   GUIA_SelectDarkContrast  = GUIA_Dummy + 1019; // (Byte) Contrast of SELECTSHINEPEN/SELECTSHADOWPEN (G/IG/SG).
1576   GUIA_BarBlockBrightContrast = GUIA_Dummy + 1020;
1577   GUIA_BarBlockDarkContrast   = GUIA_Dummy + 1021; // (Byte) Contrast of BARCONTOURPEN/BARTRIMPEN (G/IG/SG).
1578   GUIA_DisabledBrightContrast = GUIA_Dummy + 1022;
1579   GUIA_DisabledDarkContrast   = GUIA_Dummy + 1023; // (Byte) Contrast of DISABLEDSHINEPEN/DISABLEDSHADOWPEN (G/IG/SG).
1580   GUIA_ForeBrightContrast    = GUIA_Dummy + 1024;
1581   GUIA_ForeDarkContrast      = GUIA_Dummy + 1025; // (Byte) Contrast of FORESHINEPEN/FORESHADOWPEN (G/IG/SG).
1582   GUIA_AutomaticEdgesContrast= GUIA_Dummy + 1026; // (BOOL) Enable/disable automatic computation of shine/shadow pens (G/IG/SG).
1583   GUIA_BrightCurve         = GUIA_Dummy + 1028;
1584   GUIA_DarkCurve           = GUIA_Dummy + 1029; // (Byte) Default curve for shine/shadow colors gradients (G/IG/SG).
1585   GUIA_FillBrightCurve     = GUIA_Dummy + 1030;
1586   GUIA_FillDarkCurve       = GUIA_Dummy + 1031; // (Byte) Curve for FILLSHINEPEN/FILLSHADOWPEN gradients (G/IG/SG).
1587   GUIA_InactiveFillBrightCurve = GUIA_Dummy + 1032;
1588   GUIA_InactiveFillDarkCurve   = GUIA_Dummy + 1033; // (Byte) Curve for INACTIVEFILLSHINEPEN/INACTIVEFILLSHADOWPEN gradients (G/IG/SG).
1589   GUIA_MenuBrightCurve     = GUIA_Dummy + 1034;
1590   GUIA_MenuDarkCurve       = GUIA_Dummy + 1035; // (Byte) Curve for MENUSHINEPEN/MENUSHADOWPEN gradients (G/IG/SG).
1591   GUIA_SelectBrightCurve   = GUIA_Dummy + 1036;
1592   GUIA_SelectDarkCurve     = GUIA_Dummy + 1037; // (Byte) Curve for SELECTSHINEPEN/SELECTSHADOWPEN gradients (G/IG/SG).
1593   GUIA_BarBlockBrightCurve = GUIA_Dummy + 1038;
1594   GUIA_BarBlockDarkCurve   = GUIA_Dummy + 1039; // (Byte) Curve for BARCONTOURPEN/BARTRIMPEN gradients (G/IG/SG).
1595   GUIA_DisabledBrightCurve = GUIA_Dummy + 1040;
1596   GUIA_DisabledDarkCurve   = GUIA_Dummy + 1041; // (Byte) Curve for DISABLEDSHINEPEN/DISABLEDSHADOWPEN gradients (G/IG/SG).
1597   GUIA_ForeBrightCurve     = GUIA_Dummy + 1042;
1598   GUIA_ForeDarkCurve       = GUIA_Dummy + 1043; // (Byte) Curve for FORESHINEPEN/FORESHADOWPEN gradients (G/IG/SG).
1599   GUIA_PropKnobHighlight   = GUIA_Dummy + 1044; // (Byte) Selected knob look: 0 = raised, 1 = recessed (G/ISG/SG).
1600   GUIA_PaletteRGBTable     = GUIA_Dummy + 1045; // (PByte) Initial 256-color palette for the screens (G/IG/SG).
1601   GUIA_PaletteLockTable    = GUIA_Dummy + 1046; // (PByte) Array of locking information for each palette entry (G/IG/SG).
1602   GUIA_DRIPens             = GUIA_Dummy + 1047; // (PWord) Array of DrawInfo pens for the screen (G/IG/SG).
1603   GUIA_FrameForceThinEdges = GUIA_Dummy + 1048; // (Byte) Flag mask, see definitions below (G/ISG/SG).
1604   GUIA_FrameSelectedColor  = GUIA_Dummy + 1049; // (Byte) Fill pen for selected buttons, see values below (G/ISG/SG).
1605   GUIA_FrameDisabledColors = GUIA_Dummy + 1050; // (Byte) Pens for disabled frame edges, see values below (G/ISG/SG).
1606   GUIA_FrameButtonLook     = GUIA_Dummy + 1051; // (Byte) Look of button frames, see values below (G/ISG/SG).
1607   GUIA_FramePressedLook    = GUIA_Dummy + 1052; // (Byte) Look of pressed (selected) buttons, see values below (G/ISG/SG).
1608   GUIA_FrameCornersType    = GUIA_Dummy + 1053; // (Byte) Type of frame corners (0 = square, 1 = rounded) (G/ISG/SG).
1609   GUIA_FrameBackfill       = GUIA_Dummy + 1054; // (PHook) Backfill hook for unselected frames (G/ISG/SG).
1610   GUIA_FrameSelBackfill    = GUIA_Dummy + 1055; // (PHook) Backfill hook for selected frames (G/ISG/SG).
1611   GUIA_FrameStringLook     = GUIA_Dummy + 1056; // (Byte) Look of string gadget frames, see values below (G/ISG/SG).
1612   GUIA_FramePropLook       = GUIA_Dummy + 1057; // (Byte) Look of prop gadget frames, see values below (G/ISG/SG).
1613   GUIA_FrameDisplayLook    = GUIA_Dummy + 1058; // (Byte) Look of display gadget frames, see values below (G/ISG/SG).
1614   GUIA_WindowPropKnobHighlight = GUIA_Dummy + 1059; // (Byte) Selected window knob look: 0 = raised, 1 = recessed (G/ISG/SG).
1615   GUIA_OffScreenDragging   = GUIA_Dummy + 1060; // (BOOL) Is off-screen window dragging allowed on this screen? (G/ISG/SG).
1616   GUIA_FrameDisBackfill    = GUIA_Dummy + 1061; // (PHook) Backfill hook for disabled frames (G/ISG/SG).
1617   GUIA_RealShading         = GUIA_Dummy + 1062; // (BOOL) Realistic bitmap shading on hicolor/truecolor screens?(G/ISG/SG).
1618   GUIA_ScreenBarBackfill   = GUIA_Dummy + 1063; // (PHook) Backfill hook for screen titlebars (G/ISG/SG).
1619   GUIA_MenuSelItemFrame    = GUIA_Dummy + 1064; // (Byte) Type of frame for selected menu items (G/ISG/SG).
1620   GUIA_OffScreenSizing     = GUIA_Dummy + 1065; // (BOOL) Is off-screen window sizing allowed on this screen? (G/ISG/SG).
1621   GUIA_OffScreenResistance = GUIA_Dummy + 1066; // (Word) Amount of resistance screen edges offer to window crossing them (G/ISG/SG).
1622   GUIA_MenuTransparencyLevel = GUIA_Dummy + 1067; // (Byte) Level of menu transparency (if transparency is turned on) (G/ISG/SG).
1623   GUIA_SpecialEffects      = GUIA_Dummy + 1068; // (BOOL) Enable fancy compositing-based special effects? (G/ISG/SG).
1624   GUIA_ShareComposeBitMap  = GUIA_Dummy + 1069; // (BOOL) Try to save video memory by sharing temporary off-screen bitmap for layer composition among different screens? (G/ISG/SG).
1625   GUIA_ScreenBarShadowStrength = GUIA_Dummy + 1070; // (Word) Intensity of screen titlebar drop shadow (0..255) (G/ISG/SG).
1626   GUIA_ScreenBarShadowColor    = GUIA_Dummy + 1071; // (ULONG) Color of screen titlebar drop shadow in 00R8G8B8 form (G/ISG/SG).
1627   GUIA_ScreenBarShadowDisplacement = GUIA_Dummy + 1072; // (Word) Vertical displacement of drop shadow relative to the screen titlebar (G/ISG/SG).
1628   GUIA_ScreenBarShadowSmoothness   = GUIA_Dummy + 1073; // (Word) Smoothness level of screen titlebar drop shadow (0..20) (G/ISG/SG).
1629   GUIA_MenuOpenDelay       = GUIA_Dummy + 1074; // (Word) Duration of panel open delay for menus and items (0..8).
1630                                                 // Packed as two bytes in a word, low byte for menus and high byte for items (G/ISG/SG).
1631   GUIA_MenuCloseDelay      = GUIA_Dummy + 1075; // (Word) Duration of panel close delay for menus and items (0..8).
1632                                                 //  Packed as two bytes in a word, low byte for menus and high byte for items (G/ISG/SG).
1633   GUIA_VSyncCompose        = GUIA_Dummy + 1076; // (BOOL) Synchronize display updates of layer composition with vertical refresh rate of monitor when possible? (G/ISG/SG).
1634   //**** Global GUI attributes
1635   GUIA_GlobalFlags         = GUIA_Dummy + 5001; // (LongWord) Global GUI flags (see definitions below) (G/G/SG).
1636   GUIA_ScreenDragging      = GUIA_Dummy + 5002; // (BOOL) Enable/disable screen dragging (defaults to TRUE) (G/G/SG).
1637   GUIA_DefaultDRIPens      = GUIA_Dummy + 5003; // (PWord) Default four-color DrawInfo pen array (G/G/G).
1638 
1639 // Global GUI flags
1640   GGPF_SCREENDRAGGING = $00000001; // Enable screen dragging
1641 
1642   // Values for GUIA_WindowBorderLook
1643   FRAMEWINDOW_3D     = 0; // Standard 3D bevelled frame
1644   FRAMEWINDOW_FRAMED = 1; // Dark frame with 3D inner frame
1645   FRAMEWINDOW_FLAT   = 2; // Thin or thick dark frame
1646 
1647 // Flags for GUIA_FrameForceThinEdges
1648   FRAMETHIN_FILLEDRAISED      = $01;
1649   FRAMETHIN_FILLEDRECESSED    = $02;
1650   FRAMETHIN_EDGESONLYRAISED   = $04;
1651   FRAMETHIN_EDGESONLYRECESSED = $08;
1652 
1653 // Values for GUIA_FrameSelectedColor
1654   FRAMESELCOL_FILL   = 0; // Fill pen
1655   FRAMESELCOL_SELECT = 1; // Select pen
1656   FRAMESELCOL_FOREG  = 2; // Foreground pen
1657   FRAMESELCOL_BACKG  = 3; // Background pen
1658 
1659 // Values for GUIA_FrameDisabledColors
1660   FRAMEDISCOL_FOREG = 0; // Foreground shine/shadow pens
1661   FRAMEDISCOL_BACKG = 1; // Background shine/shadow pens
1662   FRAMEDISCOL_DISAB = 2; // Disabled shine/shadow pens
1663 
1664 // Values for GUIA_FrameButtonLook
1665   FRAMEBUTTON_3D     = 0;  // Standard 3D bevelled frame
1666   FRAMEBUTTON_FRAMED = 1;  // Dark frame with 3D inner frame
1667   FRAMEBUTTON_FLAT   = 2;  // Thin or thick dark frame
1668 
1669 // Values for GUIA_FrameStringLook
1670   FRAMESTRING_3D      = 0;  // Standard 3D ridge
1671   FRAMESTRING_FRAMED  = 1;  // Dark frame with inner recessed frame
1672   FRAMESTRING_FLAT    = 2;  // Thin or thick dark frame
1673   FRAMESTRING_FRAMED2 = 3;  // Recessed frame with inner dark frame
1674 
1675 // Values for GUIA_FramePropLook
1676   FRAMEPROP_3D     = 0;  // Standard 3D bevelled frame
1677   FRAMEPROP_FRAMED = 1;  // Dark frame
1678   FRAMEPROP_FLAT   = 2;  // Thin or thick dark frame
1679   FRAMEPROP_NONE   = 3;  // No frame (only applies to container)
1680 
1681 // Values for GUIA_FrameDisplayLook
1682   FRAMEDISPLAY_3D      = 0;  // Standard 3D recessed frame
1683   FRAMEDISPLAY_FRAMED  = 1;  // Dark frame with inner recessed frame
1684   FRAMEDISPLAY_FLAT    = 2;  // Thin or thick dark frame
1685   FRAMEDISPLAY_FRAMED2 = 3;  // Recessed frame with inner dark frame
1686 
1687 // Values for GUIA_FramePressedLook
1688   FRAMEPRESSED_PUSHED   = 0;  // Pushed in
1689   FRAMEPRESSED_INVERTED = 1;  // Inverted edges colors
1690 
1691 // Values for GUIA_ClickTabLook
1692   CLICKTAB_ACTIVEBOLD       = $00000001;
1693   CLICKTAB_EVENWIDTH        = $00000002;
1694   CLICKTAB_INACTIVEDARK     = $00000004;
1695   CLICKTAB_ACTIVEFILLGRAD   = $00000008;
1696   CLICKTAB_ACTIVEPENMASK    = $000000F0;
1697   CLICKTAB_ACTIVEPENTEXT    = $00000000;
1698   CLICKTAB_ACTIVEPENHLTEXT  = $00000010;
1699   CLICKTAB_ACTIVEPENTITLE   = $00000020;
1700   CLICKTAB_ACTIVEFILLMASK   = $00000F00;
1701   CLICKTAB_ACTIVEFILLFILL   = $00000000;
1702   CLICKTAB_ACTIVEFILLSHINE  = $00000100;
1703   CLICKTAB_ACTIVEFILLSELECT = $00000200;
1704   CLICKTAB_ACTIVEFILLNONE   = $00000F00;
1705   CLICKTAB_ACTIVEBRIGHT     = $00001000;
1706 
1707 // Values for GUIA_GaugeLook and GUIA_WindowGaugeLook
1708   GAUGE_FILL_STYLEMASK  = $00000007;
1709   GAUGE_FILL_BORDERLESS = $00000000;
1710   GAUGE_FILL_3D         = $00000001;
1711   GAUGE_FILL_FRAMED     = $00000002;
1712   GAUGE_FILL_FLAT       = $00000003;
1713   GAUGE_FILL_AUTOSTYLE  = $00000007;
1714   GAUGE_FILL_GRADIENT   = $00000010;
1715   GAUGE_CONT_STYLEMASK  = $00000700;
1716   GAUGE_CONT_BORDERLESS = $00000000;
1717   GAUGE_CONT_3D         = $00000100;
1718   GAUGE_CONT_FRAMED     = $00000200;
1719   GAUGE_CONT_FLAT       = $00000300;
1720   GAUGE_CONT_FRAMED2    = $00000400;
1721   GAUGE_CONT_AUTOSTYLE  = $00000700;
1722   GAUGE_CONT_GRADIENT   = $00001000;
1723   GAUGE_SPACINGMASK     = $00030000;
1724   GAUGE_INNERTICKS      = $00040000;
1725   GAUGE_UNUSED          = $00080000;
1726   GAUGE_BORDERPENS      = $00100000;
1727   GAUGE_RESERVED        = $80000000;
1728 
1729 // Special value for GUIA_PaletteRGBTable
1730   PALETTERGB_IGNORE = not 0;
1731 
1732 // Special value for GUIA_PaletteLockTable
1733   PALETTELOCK_IGNORE = not 0;
1734 
1735 // Special value for GUIA_DRIPens
1736   DRIPENS_IGNORE = not 0;
1737 
1738 // Window title positions
1739   WTPOS_LEFT      = 0;  // Left side (default)
1740   WTPOS_CENTERREL = 1;  // Centered in dragbar
1741   WTPOS_CENTERABS = 2;  // Centered in whole titlebar
1742 
1743 // Menu types
1744   MT_PULLDOWN = 0;  // Always pulldown (default)
1745   MT_POPUP    = 1;  // Always pop-up
1746   MT_RELATIVE = 2;  // Pulldown or pop-up depending on position
1747 
1748 /// Menu flags
1749   MENUTRANSP   = $00000001;  // Menus have transparency
1750   MENUSHADOW   = $00000002;  // Menus have drop shadows
1751   MENUALTERN   = $00000010;  // Alternative look (rounded corners)
1752   MENUFRAMED   = $00000020;  // Framed style for menu edges
1753   MENUFLAT     = $00000040;  // Never use embossed effects
1754   MENUTRACK    = $00000100;  // Remember last selections
1755   MENUSTICKYPD = $00000200;  // Use sticky pulldown menu panels
1756   MENUSTICKYPU = $00000400;  // Use sticky pop-up menu panels
1757   MENUCMCORNER = $00000800;  // Alt. position for context menu panels
1758   MENUNBPD     = $00001000;  // Use non-blocking pulldown menu panels
1759   MENUNBPU     = $00002000;  // Use non-blocking pop-up menu panels
1760   MENUPDTOPDEL = $00010000;  // Use open delay with pulldown titles
1761   MENUPDTCLDEL = $00020000;  // Use close delay with pulldown titles
1762 
1763 // === Remember
1764 // this structure is used for remembering what memory has been allocated to date by a given routine,
1765 // so that a premature abort or systematic exit can deallocate memory cleanly, easily, and completely
1766 type
1767   PRemember = ^TRemember;
1768   TRemember = record
1769     NextRemember: PRemember;
1770     RememberSize: LongWord;
1771     Memory: PByte;
1772   end;
1773 
1774 // === Color Spec
1775 // How to tell Intuition about RGB values for a color table entry.
1776   PColorSpec = ^TColorSpec;
1777   TColorSpec = record
1778     ColorIndex: SmallInt; // -1 terminates an array of ColorSpec
1779     Red: Word;            // only the _bottom_ 4 bits recognized
1780     Green: Word;          // only the _bottom_ 4 bits recognized
1781     Blue: Word;           // only the _bottom_ 4 bits recognized
1782   end;
1783 
1784 // === Easy Requester Specification
1785 // see also autodocs for EasyRequest and BuildEasyRequest
1786 // NOTE: This structure may grow in size in the future
1787 // NOTE: This structure actually grew in size for V50
1788   PEasyStruct = ^TEasyStruct;
1789   TEasyStruct = record
1790     es_StructSize: LongWord; // should be SizeOf(TEasyStruct)
1791     es_Flags: LongWord;      // should be 0 for now
1792     es_Title: STRPTR;        // title of requester window
1793     es_TextFormat: STRPTR;   // 'printf' style formatting string
1794     es_GadgetFormat: STRPTR; // 'printf' style formatting string
1795     es_Screen: PScreen;      // screen to open on (new for V50)
1796     es_TagList: PTagItem;    // additional information (new for V50)
1797   end;
1798 const
1799 // EasyRequester flags
1800   ESF_SCREEN   = $00000001; // Open on the screen specified in es_Screen
1801   ESF_TAGGED   = $00000002; // Apply attributes specified in es_TagList
1802   ESF_EVENSIZE = $00000004; // Make all requester buttons equally wide
1803   ESF_INACTIVE = $00000008; // Open requester window in inactive state
1804 // EasyRequester tags
1805   ESA_Dummy      = $00340000;
1806   ESA_Position   = ESA_Dummy + 1; // Where the requester will open
1807   ESA_Underscore = ESA_Dummy + 2; // Underscore character
1808 // Values for ESA_Position
1809   REQPOS_DEFAULT      = 0; // Place according to user's GUI preferences
1810   REQPOS_CORNER       = 1; // Place at top left corner
1811   REQPOS_BELOWBAR     = 2; // Place at top left corner, below screen bar
1812   REQPOS_CENTERMOUSE  = 3; // Center under mouse pointer
1813   REQPOS_CENTERSCREEN = 4; // Center in visible screen clip
1814   REQPOS_CENTERWINDOW = 5; // Center in reference window
1815 
1816 type
1817 // === Gradient Specification
1818 // This is the structure you pass to DrawGradient(). The Direction field tells Intuition the orientation of the gradient; the Mode field is a
1819 // combination of gradient type and flags (see definitions below). Depending on the type, either the Rel or Abs specifications are used;
1820 // Rel is used for the SIMPLE and SHADE types, Abs for the COLOR type. In the case of Rel, the Contrast values indicate the dark and bright
1821 // shading percentages for the opposite ends of the gradient, to be applied to the BasePen color (SIMPLE) or to the background (SHADE).
1822 // Contrast values of 0, 0 produce no gradient at all, whereas contrast values of 255, 255 produce a black-to-white gradient.
1823   PGradientSpec = ^TGradientSpec;
1824   TGradientSpec = record
1825     Direction: LongWord; // X:Y ratio as returned by DirectionVector(angle)
1826     Mode: Word;          // See definitions below
1827     case longint of
1828       0:(
1829         Rel: record
1830           BasePen: Word;                 // Base DrawInfo pen to be shaded
1831           Contrast: array[0..1] of Byte; // Shade levels for gradient ends
1832         end;
1833         );
1834       1:(
1835          Abs: record
1836           RGBStart: array[0..2] of Byte; // Starting color of gradient
1837           RGBEnd: array[0..2] of Byte;   // Ending color of gradient
1838           Reserved: array[0..3] of Byte; // For future use, leave to zero
1839         end;
1840         );
1841   end;
1842 const
1843 // Gradient modes (type and flags packed in a single word)
1844   GRADMODE_TYPEMASK  = $000F; // Mask for type extraction
1845   GRADMODE_NONE      = $0000; // Don't draw any gradient
1846   GRADMODE_SIMPLE    = $0001; // Shades of BasePen, from Contrast[0] to Contrast[1]
1847   GRADMODE_COLOR     = $0002; // Shades of color, from RGBStart to RGBEnd
1848   GRADMODE_SHADE     = $0003; // Shades of background, from Contrast[0] to Contrast[1]
1849   GRADMODE_IMPOSE    = $0100; // Superimpose gradient to existing background
1850   GRADMODE_KEEPRATIO = $0200; // Don't scale gradient to domain aspect ratio
1851   GRADMODE_PALETTE   = $0400; // Rel.BasePen is a palette index, not a DrawInfo pen index
1852   GRADMODE_INVERT1   = $1000; // Invert the meaning of Contrast[0] (brighten rather than darken)
1853   GRADMODE_INVERT2   = $2000; // Invert the meaning of Contrast[1] (darken rather than brighten)
1854 
1855 // === Miscellaneous
1856 const
1857 // = MENU STUFF
1858   NOMENU   = $001F;
1859   NOITEM   = $003F;
1860   NOSUB    = $001F;
1861   MENUNULL = -1;
1862 
1863 // these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT, I'll use a generic
1864 // Width (for all resolutions) for the CheckMark. If COMMSEQ, likewise I'll use this generic stuff
1865   CHECKWIDTH    = 19;
1866   COMMWIDTH     = 27;
1867   LOWCHECKWIDTH = 13;
1868   LOWCOMMWIDTH  = 16;
1869 // these are the AlertNumber defines.  if you are calling DisplayAlert() the AlertNumber you supply
1870 // must have the ALERT_TYPE bits set to one of these patterns
1871   ALERT_TYPE     = $80000000;
1872   RECOVERY_ALERT = $00000000; // the system can recover from this
1873   DEADEND_ALERT  = $80000000; // no recovery possible, this is it
1874 // When you're defining IntuiText for the Positive and Negative Gadgets created by a call to AutoRequest(), these defines will get you
1875 // reasonable-looking text.  The only field without a define is the IText field; you decide what text goes with the Gadget
1876   AUTOFRONTPEN  = 0;
1877   AUTOBACKPEN   = 1;
1878   AUTODRAWMODE  = JAM2;
1879   AUTOLEFTEDGE  = 6;
1880   AUTOTOPEDGE   = 3;
1881   AUTOITEXTFONT = nil;
1882   AUTONEXTTEXT  = nil;
1883 // --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP)
1884   SELECTUP   = IECODE_LBUTTON + IECODE_UP_PREFIX;
1885   SELECTDOWN = IECODE_LBUTTON;
1886   MENUUP     = IECODE_RBUTTON + IECODE_UP_PREFIX;
1887   MENUDOWN   = IECODE_RBUTTON;
1888   MIDDLEUP   = IECODE_MBUTTON + IECODE_UP_PREFIX;
1889   MIDDLEDOWN = IECODE_MBUTTON;
1890   ALTLEFT    = IEQUALIFIER_LALT;
1891   ALTRIGHT   = IEQUALIFIER_RALT;
1892   AMIGALEFT  = IEQUALIFIER_LCOMMAND;
1893   AMIGARIGHT = IEQUALIFIER_RCOMMAND;
1894   AMIGAKEYS  = AMIGALEFT + AMIGARIGHT;
1895 
1896   CURSORUP        = $4C; // Same as RAWKEY_CRSRUP
1897   CURSORLEFT      = $4F; // Same as RAWKEY_CRSRLEFT
1898   CURSORRIGHT     = $4E; // Same as RAWKEY_CRSRRIGHT
1899   CURSORDOWN      = $4D; // Same as RAWKEY_CRSRDOWN
1900   // WARNING: The following codes are for the US keyboard only
1901   KEYCODE_Q       = $10;
1902   KEYCODE_X       = $32;
1903   KEYCODE_N       = $36;
1904   KEYCODE_M       = $37;
1905   KEYCODE_V       = $34;
1906   KEYCODE_B       = $35;
1907   KEYCODE_LESS    = $38;
1908   KEYCODE_GREATER = $39;
1909 
1910 // === DrawInfo
1911 const
1912   // DRI_VERSION =
1913   //   1 corresponds to V37 release.
1914   //   2 corresponds to V39, and includes three new pens and the dri_CheckMark and dri_AmigaKey fields.
1915   //   3 corresponds to V50, and includes 33 new pens and the dri_Screen and the dri_Prefs fields.
1916   DRI_VERSION = 3;
1917 type
1918   PDrawInfo = ^TDrawInfo;
1919   TDrawInfo = record
1920     dri_Version: Word;     // will be  DRI_VERSION
1921     dri_NumPens: Word;     // guaranteed to be >= numDrIPens
1922     dri_Pens: PWord;       // pointer to pen array
1923     dri_Font: PTextFont;   // screen default font
1924     dri_Depth: Word;       // (initial) depth of screen bitmap
1925     dri_Resolution: record // from DisplayInfo database for initial display mode
1926       x: word;
1927       y: word;
1928     end;
1929     dri_Flags: LongWord;   // defined below
1930     // New for V39: dri_CheckMark, dri_AmigaKey.
1931     dri_CheckMark: PImage; // pointer to scaled checkmark image Will be nil if DRI_VERSION < 2
1932     dri_AmigaKey: PImage;  // pointer to scaled Amiga-key image Will be nil if DRI_VERSION < 2
1933     // New for V50: dri_Screen, dri_Prefs.
1934     dri_Screen: PScreen;   // pointer to associated screen Will be nil if DRI_VERSION < 3
1935     dri_Prefs: APTR;       // opaque handle to GUI settings Will be NULL if DRI_VERSION < 3
1936     dri_Reserved: array[0..2] of LongWord; // avoid recompilation ;^)
1937   end;
1938 
1939 const
1940   DRIF_NEWLOOK    = $00000001; // specified SA_Pens, full treatment
1941   DRIF_NEWDISABLE = $00000002; // fancy look for disabled items (V50)
1942   DRIF_REALSHADE  = $00000004; // realistic bitmap shading (V50)
1943 
1944 // rendering pen number indexes into DrawInfo.dri_Pens[]
1945   DETAILPEN = $0000;        // compatible Intuition rendering pens
1946   BLOCKPEN = $0001;         // compatible Intuition rendering pens
1947   TEXTPEN = $0002;          // text on background
1948   SHINEPEN = $0003;         // bright edge on 3D objects
1949   SHADOWPEN = $0004;        // dark edge on 3D objects
1950   FILLPEN = $0005;          // active-window/selected-gadget fill
1951   FILLTEXTPEN = $0006;      // text over FILLPEN
1952   BACKGROUNDPEN = $0007;    // always color 0
1953   HIGHLIGHTTEXTPEN = $0008; // special color text, on background
1954   // New for V39, only present if DRI_VERSION >= 2:
1955   BARDETAILPEN = $0009;     // text/detail in screen-bar/menus
1956   BARBLOCKPEN = $000A;      // screen-bar/menus fill
1957   BARTRIMPEN = $000B;       // trim under screen-bar
1958 // New for V50, only present if DRI_VERSION >= 3:
1959   BARCONTOURPEN         = $000C; // contour above screen-bar
1960   FOREGROUNDPEN         = $000D; // inside of unselected gadgets
1961   FORESHINEPEN          = $000E; // bright edges of unselected gadgets
1962   FORESHADOWPEN         = $000F; // dark edges of unselected gadgets
1963   FILLSHINEPEN          = $0010; // bright edges for FILLPEN
1964   FILLSHADOWPEN         = $0011; // dark edges for FILLPEN
1965   INACTIVEFILLPEN       = $0012; // inactive window borders fill
1966   INACTIVEFILLTEXTPEN   = $0013; // text over INACTIVEFILLPEN
1967   INACTIVEFILLSHINEPEN  = $0014; // bright edges for INACTIVEFILLPEN
1968   INACTIVEFILLSHADOWPEN = $0015; // dark edges for INACTIVEFILLPEN
1969   DISABLEDPEN           = $0016; // background of disabled elements
1970   DISABLEDTEXTPEN       = $0017; // text of disabled string gadgets
1971   DISABLEDSHINEPEN      = $0018; // bright edges of disabled elements
1972   DISABLEDSHADOWPEN     = $0019; // dark edges of disabled elements
1973   MENUBACKGROUNDPEN     = $001A; // background of menus
1974   MENUTEXTPEN           = $001B; // normal text in menus
1975   MENUSHINEPEN          = $001C; // bright edges of menus
1976   MENUSHADOWPEN         = $001D; // dark edges of menus
1977   SELECTPEN             = $001E; // background of selected items
1978   SELECTTEXTPEN         = $001F; // text of selected items
1979   SELECTSHINEPEN        = $0020; // bright edges of selected items
1980   SELECTSHADOWPEN       = $0021; // dark edges of selected items
1981   GLYPHPEN              = $0022; // system gadget glyphs, outlines
1982   GLYPHFILLPEN          = $0023; // system gadget glyphs, colored areas
1983   INACTIVEGLYPHPEN      = $0024; // system gadget glyphs, inact. windows
1984   RESERVEDPEN           = $0025; // reserved - don't use
1985   GADGETPEN             = $0026; // gadget symbols (arrows, cycle, etc.)
1986   TITLEPEN              = $0027; // title of gadget groups
1987   HALFSHINEPEN          = $0028; // half-bright edge on 3D objects
1988   HALFSHADOWPEN         = $0029; // half-dark edge on 3D objects
1989   FLATBORDERPEN         = $002A; // flat (non-3D) borders and frames
1990   FILLFLATPEN           = $002B; // flat outlines of active windows
1991   INACTIVEFILLFLATPEN   = $002C; // flat outlines of inactive windows
1992 
1993   NUMDRIPENS = $002D;
1994 
1995 // New for V39:  It is sometimes useful to specify that a pen value is to be the complement of color zero to three.  The "magic" numbers serve that purpose:
1996   PEN_C3 =  $FEFC; // Complement of color 3
1997   PEN_C2 =  $FEFD; // Complement of color 2
1998   PEN_C1 =  $FEFE; // Complement of color 1
1999   PEN_C0 =  $FEFF; // Complement of color 0
2000 
2001 const
2002 // --- FLAGS SET BY INTUITION
2003 // The SCREENTYPE bits are reserved for describing various Screen types available under Intuition.
2004   SCREENTYPE_F   = $000F; // all the screens types available
2005 // --- the definitions for the Screen Type
2006   WBENCHSCREEN_F = $0001; // Ta Da!  The Workbench
2007   PUBLICSCREEN_F = $0002; // Public shared (custom) screen
2008   CUSTOMSCREEN_F = $000F; // for that special look
2009   SHOWTITLE_F    = $0010; // this gets set by a call to ShowTitle()
2010   BEEPING_F      = $0020; // set when Screen is beeping
2011   CUSTOMBITMAP_F = $0040; // if you are supplying your own BitMap
2012   SCREENBEHIND_F = $0080; // if you want your screen to open behind already open screens
2013   SCREENQUIET_F  = $0100; // if you do not want Intuition to render into your screen (gadgets, title)
2014   SCREENHIRES    = $0200; // do no use lowres gadgets (private)
2015   NS_EXTENDED    = $1000; // TExtNewScreen.Extension is valid
2016   // V36 applications can use OpenScreenTagList() instead of NS_EXTENDED
2017   AUTOSCROLL     = $4000; // screen is to autoscoll
2018   // New for V39:
2019   PENSHARED      = $0400; // Screen opener set (SA_SharePens,TRUE)
2020 
2021   STDSCREENHEIGHT = -1; // supply in NewScreen.Height
2022   STDSCREENWIDTH  = -1; // supply in NewScreen.Width
2023 
2024 // Screen attribute tag ID's.  These are used in the ti_Tag field of TagItem arrays passed to OpenScreenTagList() (or in the ExtNewScreen.Extension field).
2025   SA_Dummy    =    TAG_USER + 32;
2026 // these items specify items equivalent to fields in TNewScreen
2027   SA_Left     = SA_Dummy + $0001;
2028   SA_Top      = SA_Dummy + $0002;
2029   SA_Width    = SA_Dummy + $0003;
2030   SA_Height   = SA_Dummy + $0004; // traditional screen positions and dimensions
2031   SA_Depth    = SA_Dummy + $0005; // screen bitmap depth
2032   SA_DetailPen= SA_Dummy + $0006; // serves as default for windows, too
2033   SA_BlockPen = SA_Dummy + $0007;
2034   SA_Title    = SA_Dummy + $0008; // default screen title
2035   SA_Colors   = SA_Dummy + $0009; // ti_Data is an array of struct ColorSpec, terminated by ColorIndex = -1.  Specifies initial screen palette colors.
2036   SA_ErrorCode= SA_Dummy + $000A; // ti_Data points to LONG error code (values below)
2037   SA_Font     = SA_Dummy + $000B; // equiv. to NewScreen.Font
2038   SA_SysFont  = SA_Dummy + $000C; // Selects one of the preferences system fonts: 0 - old DefaultFont, fixed-width 1 - WB Screen preferred font
2039   SA_Type     = SA_Dummy + $000D; // equiv. to NewScreen.Type
2040   SA_BitMap   = SA_Dummy + $000E; // ti_Data is pointer to custom BitMap.  This implies type of CUSTOMBITMAP
2041   SA_PubName  = SA_Dummy + $000F; // presence of this tag means that the screen is to be a public screen.  Please specify BEFORE the two tags below
2042   SA_PubSig   = SA_Dummy + $0010;
2043   SA_PubTask  = SA_Dummy + $0011; // Task ID and signal for being notified that the last window has closed on a public screen.
2044   SA_DisplayID= SA_Dummy + $0012; // ti_Data is new extended display ID
2045   SA_DClip    = SA_Dummy + $0013; // ti_Data points to a rectangle which defines screen display clip region
2046   SA_Overscan = SA_Dummy + $0014; // was S_STDDCLIP.  Set to one of the OSCAN_ specifiers below to get a system standard
2047                                  // overscan region for your display clip, screen dimensions (unless otherwise specified),
2048                                  // and automatically centered position (partial support only so far). If you use this, you shouldn't specify
2049                                  // SA_DClip.  SA_Overscan is for "standard" overscan dimensions, SA_DClip is for your custom numeric specifications.
2050   SA_Obsolete1  = SA_Dummy + $0015; // obsolete S_MONITORNAME
2051   // booleans
2052   SA_ShowTitle  = SA_Dummy + $0016; // boolean equivalent to flag SHOWTITLE
2053   SA_Behind     = SA_Dummy + $0017; // boolean equivalent to flag SCREENBEHIND
2054   SA_Quiet      = SA_Dummy + $0018; // boolean equivalent to flag SCREENQUIET
2055   SA_AutoScroll = SA_Dummy + $0019; // boolean equivalent to flag AUTOSCROLL
2056   SA_Pens       = SA_Dummy + $001A; //  pointer to ~0 terminated UWORD array, as found in struct DrawInfo
2057   SA_FullPalette= SA_Dummy + $001B; // boolean: initialize color table to entire preferences palette (32 for V36), rather
2058                                     //   than compatible pens 0-3, 17-19, with remaining palette as returned by GetColorMap()
2059   SA_ColorMapEntries = SA_Dummy + $001C; // New for V39: Allows you to override the number of entries in the ColorMap for your screen.  Intuition
2060                                          // normally allocates (1<<depth) or 32, whichever is more, but you may require even more if you
2061                                          // use certain V39 graphics.library features (eg. palette-banking).
2062   SA_Parent      = SA_Dummy + $001D; // New for V39: ti_Data is a pointer to a "parent" screen to
2063                                      // attach this one to.  Attached screens slide and depth-arrange together.
2064   SA_Draggable   = SA_Dummy + $001E; // New for V39: Boolean tag allowing non-draggable screens.
2065                                      // Do not use without good reason! (Defaults to TRUE).
2066   SA_Exclusive   = SA_Dummy + $001F; // New for V39: Boolean tag allowing screens that won't share the display.
2067                                      // Use sparingly!  Starting with 3.01, attached screens may be SA_Exclusive.
2068                                      // Setting SA_Exclusive for each screen will produce an exclusive family. (Defaults to FALSE).
2069   SA_SharePens   = SA_Dummy + $0020; // New for V39: For those pens in the screen's PDrawInfo^.dri_Pens, Intuition obtains them in shared mode (see
2070                                      // graphics.library/ObtainPen()). For compatibility, Intuition obtains the other pens of a public
2071                                      // screen as PEN_EXCLUSIVE.  Screens that wish to manage the pens themselves should generally set
2072                                      // this tag to TRUE.  This instructs Intuition to leave the other pens unallocated.
2073   SA_BackFill    = SA_Dummy + $0021; // New for V39: provides a "backfill hook" for your screen's
2074                                      // Layer_Info. See layers.library/InstallLayerInfoHook()
2075   SA_Interleaved = SA_Dummy + $0022; // New for V39: Boolean tag requesting that the bitmap allocated for you be interleaved. (Defaults to FALSE).
2076   SA_Colors32    = SA_Dummy + $0023; // New for V39: Tag to set the screen's initial palette colors at 32 bits-per-gun.  ti_Data is a pointer
2077                                      // to a table to be passed to the graphics.library/LoadRGB32() function. This format supports both runs of color
fornull2078                                      // registers and sparse registers.  See the autodoc for that function for full details.
2079                                      // Any color set here has precedence over the same register set by SA_Colors.
2080   SA_VideoControl = SA_Dummy + $0024;// New for V39: ti_Data is a pointer to a taglist that Intuition
2081                                      // will pass to graphics.library/VideoControl(), upon opening the screen.
2082   SA_FrontChild  = SA_Dummy + $0025; // New for V39: ti_Data is a pointer to an already open screen that is to be the child of the screen being
2083                                      // opened.  The child screen will be moved to the front of its family.
2084   SA_BackChild   = SA_Dummy + $0026; // New for V39: ti_Data is a pointer to an already open screen that is to be the child of the screen being
2085                                      // opened.  The child screen will be moved to the back of its family.
2086   SA_LikeWorkbench = SA_Dummy + $0027; // New for V39: Set ti_Data to 1 to request a screen which is just like the Workbench.  This gives
2087                                        // you the same screen mode, depth, size, colors, etc., as the Workbench screen.
2088   SA_Reserved    = SA_Dummy + $0028; // Reserved for private Intuition use
2089   SA_MinimizeISG = SA_Dummy + $0029; // New for V40: For compatibility, Intuition always ensures that the inter-screen gap is at least three
2090                                      // non-interlaced lines.  If your application would look best with the smallest possible
2091                                      // inter-screen gap, set ti_Data to TRUE. If you use the new graphics VideoControl()
2092                                      // VC_NoColorPaletteLoad tag for your screen's ViewPort, you should also set this tag.
2093   SA_OffScreenDragging = SA_Dummy + $002a; // New for V50: When TRUE, windows can be dragged off the screen.
2094   SA_Reserved2         = SA_Dummy + $002b; // Reserved for private Intuition use. V50.
2095   SA_ActiveWindow      = SA_Dummy + $002c; // the active window of the screen. V50.
2096   SA_MaxWindowBox      = SA_Dummy + $002d; // (PIBox). V50. PRIVATE
2097   SA_Reserved3         = SA_Dummy + $002e; // Reserved for private Intuition use. V51.
2098   SA_Compositing       = SA_Dummy + $002f; // When TRUE, compositing mode is enabled for layers of this screen. Set to FALSE to force
2099                                            // traditional layer handling. Set to (not 0) (or don't pass this tag at all) to respect user
2100                                            // preferences for this attribute. V53.
2101   SA_WindowDropShadows = SA_Dummy + $0030; // Allow drop shadows on window sides, if requested. Set to FALSE to prevent shadows from ever being
2102                                            // drawn. This tag is ignored if compositing is not enabled for the screen. Defaults to TRUE. V53. */
2103 
2104 // this is an obsolete tag included only for compatibility with V35 interim release for the A2024 and Viking monitors
2105   NSTAG_EXT_VPMODE = TAG_USER + 1;
2106 
2107 
2108 // OpenScreen error codes, which are returned in the (optional) LongInt pointed to by ti_Data for the SA_ErrorCode tag item
2109   OSERR_NOMONITOR    = 1;  // named monitor spec not available
2110   OSERR_NOCHIPS      = 2;  // you need newer custom chips
2111   OSERR_NOMEM        = 3;  // couldn't get normal memory
2112   OSERR_NOCHIPMEM    = 4;  // couldn't get chipmem
2113   OSERR_PUBNOTUNIQUE = 5;  // public screen name already used
2114   OSERR_UNKNOWNMODE  = 6;  // don't recognize mode asked for
2115   OSERR_TOODEEP      = 7;  // Screen deeper than HW supports
2116   OSERR_ATTACHFAIL   = 8;  // Failed to attach screens
2117   OSERR_NOTAVAILABLE = 9;  // Mode not available for other reason
2118   OSERR_BADBITMAP    = 10; // Custom bitmap not displayable (V51)
2119 
2120 // === NewScreen
2121 type
2122   PNewScreen = ^TNewScreen;
2123   TNewScreen = record
2124     LeftEdge, TopEdge, Width, Height, Depth: SmallInt; // screen dimensions
2125     DetailPen, BlockPen: Byte; // for bar/border/gadget rendering
2126     ViewModes: Word;           // the Modes for the ViewPort (and View)
2127     Type_: Word;               // the Screen type (see defines above)
2128     Font: PTextAttr;           // this Screen's default text attributes
2129     DefaultTitle: STRPTR;      // the default title for this Screen
2130     Gadgets: PGadget;          // your own Gadgets for this Screen
2131     // if you are opening a CUSTOMSCREEN and already have a BitMap that you want used for your Screen, you set the flags CUSTOMBITMAP in
2132     // the Type field and you set this variable to point to your BitMap structure.  The structure will be copied into your Screen structure,
2133     // after which you may discard your own BitMap if you want
2134     CustomBitMap: PBitMap;
2135   end;
2136 
2137 // For compatibility reasons, we need a new structure for extending NewScreen.  Use this structure is you need to use the new Extension field.
2138 // NOTE: V36-specific applications should use the OpenScreenTagList( newscreen, tags ) version of OpenScreen().
2139 // Applications that want to be V34-compatible as well may safely use the ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
2140   PExtNewScreen = ^TExtNewScreen;
2141   TExtNewScreen = record
2142     LeftEdge, TopEdge, Width, Height, Depth: SmallInt;
2143     DetailPen, BlockPen: Byte;
2144     ViewModes: Word;
2145     Type_: Word;
2146     Font: PTextAttr;
2147     DefaultTitle: STRPTR;
2148     Gadgets: PGadget;
2149     CustomBitMap: PBitMap;
2150     Extension: PTagItem;
2151   end;
2152 
2153 const
2154 // === Overscan Types
2155   OSCAN_TEXT     = 1; // entirely visible
2156   OSCAN_STANDARD = 2; // just past edges
2157   OSCAN_MAX      = 3; // as much as possible
2158   OSCAN_VIDEO    = 4; // even more than is possible
2159 
2160 // === Public Shared Screen Node
2161 // This is the representative of a public shared screen. This is an internal data structure, but some functions may
2162 // present a copy of it to the calling application.  In that case, be aware that the screen pointer of the structure can NOT be
2163 // used safely, since there is no guarantee that the referenced screen will remain open and a valid data structure. Never change one of these.
2164 type
2165   PPubScreenNode = ^TPubScreenNode;
2166   TPubScreenNode = record
2167     psn_Node: TNode;            // ln_Name is screen name
2168     psn_Screen: PScreen;
2169     psn_Flags: Word;            // below
2170     psn_Size: SmallInt;         // includes name buffer
2171     psn_VisitorCount: SmallInt; // how many visitor windows
2172     psn_SigTask: PTask;         // who to signal when visitors gone
2173     psn_SigBit: Byte;           // which signal
2174   end;
2175 
2176 const
2177   PSNF_PRIVATE  = $0001;
2178 // NOTE: Due to a bug in NextPubScreen(), make sure your buffer actually has MAXPUBSCREENNAME+1 characters in it!
2179   MAXPUBSCREENNAME = 139; // names no longer, please
2180 // pub screen modes
2181   SHANGHAI     = $0001; // put workbench windows on pub screen
2182   POPPUBSCREEN = $0002; // pop pub screen to front when visitor opens
2183 
2184 // New for V39:  Intuition has new screen depth-arrangement and movement functions called ScreenDepth() and ScreenPosition() respectively.
2185 // These functions permit the old behavior of ScreenToFront(), ScreenToBack(), and MoveScreen().  ScreenDepth() also allows
2186 // independent depth control of attached screens.  ScreenPosition() optionally allows positioning screens even though they were opened (SA_Draggable,FALSE).
2187 
2188 // For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK, and optionally also SDEPTH_INFAMILY.
2189 // NOTE: ONLY THE OWNER OF THE SCREEN should ever specify SDEPTH_INFAMILY.  Commodities, "input helper" programs, or any other program that did not open a screen should never
2190 // use that flag.  (Note that this is a style-behavior requirement;  there is no technical requirement that the
neednull2191 // task calling this function need be the task which opened the screen).
2192   SDEPTH_TOFRONT  = 0; // Bring screen to front
2193   SDEPTH_TOBACK   = 1; // Send screen to back
2194   SDEPTH_INFAMILY = 2; // Move an attached screen with respect to other screens of its family
2195 
2196   // Here's an obsolete name equivalent to SDEPTH_INFAMILY:
2197   SDEPTH_CHILDONLY      =  SDEPTH_INFAMILY;
2198 
2199 // For ScreenPosition() the kind of screen positioning you wish to perform
2200   SPOS_RELATIVE    = 0; // The x1 and y1 parameters to ScreenPosition() describe the offset in coordinates you wish to move the screen by.
2201   SPOS_ABSOLUTE    = 1; // The x1 and y1 parameters to ScreenPosition() describe the absolute coordinates you wish to move the screen to.
2202   SPOS_MAKEVISIBLE = 2; // (x1,y1)-(x2,y2) describes a rectangle on the screen which you would like autoscrolled into view.
2203   SPOS_FORCEDRAG   = 4; // Move non-draggable screen
2204 
2205 // New for V39: Intuition supports double-buffering in screens, with friendly interaction with menus and certain gadgets.
2206 // For each buffer, you need to get one of these structures from the AllocScreenBuffer() call.  Never allocate your  own ScreenBuffer structures!
2207 // The sb_DBufInfo field is for your use.  See the graphics.library AllocDBufInfo() autodoc for details.
2208 
2209 type
2210   PScreenBuffer = ^TScreenBuffer;
2211   TScreenBuffer = record
2212     sb_BitMap: PBitMap;     // BitMap of this buffer
2213     sb_DBufInfo: PDBufInfo; // DBufInfo for this buffer
2214   end;
2215 
2216 const
2217 // These are the flags that may be passed to AllocScreenBuffer().
2218   SB_SCREEN_BITMAP      =  1;
2219   SB_COPY_BITMAP        =  2;
2220 
2221 // === Preferences
2222 const
2223 // these are the definitions for the printer configurations
2224   FILENAME_SIZE = 30; // Filename size
2225   DEVNAME_SIZE  = 16; // Device-name size
2226 
2227   POINTERSIZE   = (1 + 16 + 1) * 2; // Size of Pointer data buffer
2228 
2229 // These defines are for the default font size.   These actually describe the height of the defaults fonts.  The default font type is the topaz
2230 // font, which is a fixed width font that can be used in either eighty-column or sixty-column mode.  The Preferences structure reflects
2231 // which is currently selected by the value found in the variable FontSize, which may have either of the values defined below.  These values actually
2232 // are used to select the height of the default font.  By changing the height, the resolution of the font changes as well.
2233   TOPAZ_EIGHTY = 8;
2234   TOPAZ_SIXTY  = 9;
2235 
2236 type
2237   PPreferences = ^TPreferences;
2238   TPreferences = record
2239     // the default font height
2240     FontHeight: ShortInt;  // height for system default font
2241     // constant describing what's hooked up to the port
2242     PrinterPort: Byte;     // printer port connection
2243     // the baud rate of the port
2244     BaudRate: Word;        // baud rate for the serial port
2245     // various timing rates
2246     KeyRptSpeed: TTimeVal; // repeat speed for keyboard
2247     KeyRptDelay: TTimeVal; // Delay before keys repeat
2248     DoubleClick: TTimeVal; // Interval allowed between clicks
2249     // Intuition Pointer data
2250     PointerMatrix: array[0..POINTERSIZE - 1] of Word; // Definition of pointer sprite
2251     XOffset: Shortint;  // X-Offset for active 'bit'
2252     YOffset: Shortint;  // Y-Offset for active 'bit'
2253     color17: Word;      //*********************************
2254     color18: Word;      // Colours for sprite pointer
2255     color19: Word;      //*********************************
2256     PointerTicks: Word; // Sensitivity of the pointer
2257     // Workbench Screen colors
2258     color0: Word;       //*********************************
2259     color1: Word;       //   Standard default colours
2260     color2: Word;       //   Used in the Workbench
2261     color3: Word;       //*********************************
2262     // positioning data for the Intuition View
2263     ViewXOffset: Shortint; // Offset for top lefthand corner
2264     ViewYOffset: Shortint; // X and Y dimensions
2265     ViewInitX: SmallInt;
2266     ViewInitY: SmallInt;   // View initial offset values
2267     EnableCLI: WordBool;   // CLI availability switch
2268     // printer configurations
2269     PrinterType: Word;     // printer type
2270     PrinterFilename: array[0..FILENAME_SIZE-1] of Char; // file for printer
2271     // print format and quality configurations
2272     PrintPitch: Word;         // print pitch
2273     PrintQuality: Word;       // print quality
2274     PrintSpacing: Word;       // number of lines per inch
2275     PrintLeftMargin: Word;    // left margin in characters
2276     PrintRightMargin: Word;   // right margin in characters
2277     PrintImage: Word;         // positive or negative
2278     PrintAspect: Word;        // horizontal or vertical
2279     PrintShade: Word;         // b&w, half-tone, or color
2280     PrintThreshold: SmallInt; // darkness ctrl for b/w dumps
2281     // print paper descriptors
2282     PaperSize: Word;   // paper size
2283     PaperLength: Word; // paper length in number of lines
2284     PaperType: Word;   // continuous or single sheet
2285     // Serial device settings: These are six nibble-fields in three bytes
2286     // (these look a little strange so the defaults will map out to zero)
2287     SerRWBits: Byte;  // upper nibble = (8-number of read bits)
2288                       // lower nibble = (8-number of write bits)
2289     SerStopBuf: Byte; // upper nibble = (number of stop bits - 1)
2290                       // lower nibble = (table value for BufSize)
2291     SerParShk: Byte;  // upper nibble = (value for Parity setting)
2292                       // lower nibble = (value for Handshake mode)
2293     LaceWB: Byte;     // if workbench is to be interlaced
2294     Pad: array[0..FILENAME_SIZE - 1] of Char; // This was UBYTE WorkName[FILENAME_SIZE]; (temp file for printer) in old versions.
2295     PrinterDevPrivateFlags: Byte;    // system private (V51)
2296     PrtDevOpenDeviceFlags: LongWord; // flags for device below (V51)
2297     PrtDevName: array[0..DEVNAME_SIZE - 1] of Char; // device used by printer.device (omit the ".device")
2298     DefaultPrtUnit: Byte;      // default unit opened by printer.device
2299     DefaultSerUnit: Byte;      // default serial unit
2300     RowSizeChange: SmallInt;   // affect NormalDisplayRows/Columns
2301     ColumnSizeChange: SmallInt;
2302 
2303     PrintFlags: Word;     // user preference flags
2304     PrintMaxWidth: Word;  // max width of printed picture in 10ths/inch
2305     PrintMaxHeight: Word; // max height of printed picture in 10ths/inch
2306     PrintDensity: Byte;   // print density
2307     PrintXOffset: Byte;   // offset of printed picture in 10ths/inch
2308 
2309     wb_Width: Word;  // override default workbench width
2310     wb_Height: Word; // override default workbench height
2311     wb_Depth: Byte;  // override default workbench depth
2312 
2313     ext_size: Byte;  // extension information -- do not touch! extension size in blocks of 64 bytes
2314   end;
2315 
2316 const
2317 // Workbench Interlace (use one bit)
2318   LACEWB      = 1 shl 0;
2319   LW_RESERVED = 1;       // internal use only
2320 // Enable_CLI
2321   SCREEN_DRAG  = 1 shl 14;
2322   MOUSE_ACCEL  = 1 shl 15;
2323 // PrinterPort
2324   PARALLEL_PRINTER = $00;
2325   SERIAL_PRINTER   = $01;
2326 // BaudRate
2327   BAUD_110   = $00;
2328   BAUD_300   = $01;
2329   BAUD_1200  = $02;
2330   BAUD_2400  = $03;
2331   BAUD_4800  = $04;
2332   BAUD_9600  = $05;
2333   BAUD_19200 = $06;
2334   BAUD_MIDI  = $07;
2335 // PaperType
2336   FANFOLD_PT = $00;
2337   SINGLE_PT  = $80;
2338 // PrintPitch
2339   PICA  = $000;
2340   ELITE = $400;
2341   FINE  = $800;
2342 // PrintQuality
2343   DRAFT  = $000;
2344   LETTER = $100;
2345 // PrintSpacing
2346   SIX_LPI   = $000;
2347   EIGHT_LPI = $200;
2348 // Print Image
2349   IMAGE_POSITIVE = $00;
2350   IMAGE_NEGATIVE = $01;
2351 // PrintAspect
2352   ASPECT_HORIZ = $00;
2353   ASPECT_VERT  = $01;
2354 // PrintShade
2355   SHADE_BW        = $00;
2356   SHADE_GREYSCALE = $01;
2357   SHADE_COLOR     = $02;
2358 // PaperSize (all paper sizes have a zero in the lowest nybble)
2359   US_LETTER    = $00;
2360   US_LEGAL     = $10;
2361   N_TRACTOR    = $20;
2362   W_TRACTOR    = $30;
2363   CUSTOM_PAPER = $40;
2364 // New PaperSizes for V36:
2365   EURO_A0 = $50; // European size A0: 841 x 1189
2366   EURO_A1 = $60; // European size A1: 594 x 841
2367   EURO_A2 = $70; // European size A2: 420 x 594
2368   EURO_A3 = $80; // European size A3: 297 x 420
2369   EURO_A4 = $90; // European size A4: 210 x 297
2370   EURO_A5 = $A0; // European size A5: 148 x 210
2371   EURO_A6 = $B0; // European size A6: 105 x 148
2372   EURO_A7 = $C0; // European size A7: 74 x 105
2373   EURO_A8 = $D0; // European size A8: 52 x 74
2374 // PrinterType
2375   CUSTOM_NAME         = $00;
2376   ALPHA_P_101         = $01;
2377   BROTHER_15XL        = $02;
2378   CBM_MPS1000         = $03;
2379   DIAB_630            = $04;
2380   DIAB_ADV_D25        = $05;
2381   DIAB_C_150          = $06;
2382   EPSON               = $07;
2383   EPSON_JX_80         = $08;
2384   OKIMATE_20          = $09;
2385   QUME_LP_20          = $0A;
2386 // new printer entries, 3 October 1985
2387   HP_LASERJET         = $0B;
2388   HP_LASERJET_PLUS    = $0C;
2389 // Serial Input Buffer Sizes
2390   SBUF_512            = $00;
2391   SBUF_1024           = $01;
2392   SBUF_2048           = $02;
2393   SBUF_4096           = $03;
2394   SBUF_8000           = $04;
2395   SBUF_16000          = $05;
2396 // Serial Bit Masks
2397   SREAD_BITS          = $F0; // for SerRWBits
2398   SWRITE_BITS         = $0F;
2399   SSTOP_BITS          = $F0; // for SerStopBuf
2400   SBUFSIZE_BITS       = $0F;
2401   SPARITY_BITS        = $F0; // for SerParShk
2402   SHSHAKE_BITS        = $0F;
2403 // Serial Parity (upper nibble, after being shifted by macro SPARNUM() )
2404   SPARITY_NONE        = 0;
2405   SPARITY_EVEN        = 1;
2406   SPARITY_ODD         = 2;
2407 // Serial Handshake Mode (lower nibble, after masking using macro SHANKNUM() )
2408   SHSHAKE_XON         = 0;
2409   SHSHAKE_RTS         = 1;
2410   SHSHAKE_NONE        = 2;
2411 // new defines for PrintFlags
2412   CORRECT_RED         = $0001; // color correct red shades
2413   CORRECT_GREEN       = $0002; // color correct green shades
2414   CORRECT_BLUE        = $0004; // color correct blue shades
2415                                //
2416   CENTER_IMAGE        = $0008; // center image on paper
2417                                //
2418   IGNORE_DIMENSIONS   = $0000; // ignore max width/height settings
2419   BOUNDED_DIMENSIONS  = $0010; // use max width/height as boundaries
2420   ABSOLUTE_DIMENSIONS = $0020; // use max width/height as absolutes
2421   PIXEL_DIMENSIONS    = $0040; // use max width/height as prt pixels
2422   MULTIPLY_DIMENSIONS = $0080; // use max width/height as multipliers
2423                                //
2424   INTEGER_SCALING     = $0100; // force integer scaling
2425                                //
2426   ORDERED_DITHERING   = $0000; // ordered dithering
2427   HALFTONE_DITHERING  = $0200; // halftone dithering
2428   FLOYD_DITHERING     = $0400; // Floyd-Steinberg dithering
2429                                //
2430   ANTI_ALIAS          = $0800; // anti-alias image
2431   GREY_SCALE2         = $1000; // for use with hi-res monitor
2432 // masks used for checking bits
2433   CORRECT_RGB_MASK = CORRECT_RED + CORRECT_GREEN + CORRECT_BLUE;
2434   DIMENSIONS_MASK  = BOUNDED_DIMENSIONS + ABSOLUTE_DIMENSIONS + PIXEL_DIMENSIONS + MULTIPLY_DIMENSIONS;
2435   DITHERING_MASK   = HALFTONE_DITHERING + FLOYD_DITHERING;
2436 
2437 // these are the display modes for which we have corresponding parameter settings in the config arrays
2438 const
2439   DMODECOUNT = $0002; // how many modes there are
2440   HIRESPICK  = $0000;
2441   LOWRESPICK = $0001;
2442 
2443   EVENTMAX = 10; // size of event array
2444 // these are the system Gadget defines
2445   RESCOUNT       = 2;
2446   HIRESGADGET    = 0;
2447   LOWRESGADGET   = 1;
2448 
2449   GADGETCOUNT    = 8;
2450   UPFRONTGADGET  = 0;
2451   DOWNBACKGADGET = 1;
2452   SIZEGADGET     = 2;
2453   CLOSEGADGET    = 3;
2454   DRAGGADGET     = 4;
2455   SUPFRONTGADGET = 5;
2456   SDOWNBACKGADGET= 6;
2457   SDRAGGADGET    = 7;
2458 
2459 // === IntuitionBase
2460 // Be sure to protect yourself against someone modifying these data as you look at them.  This is done by calling:
2461 // lock := LockIBase(0), which returns an Integer.  When done call UnlockIBase(lock) where lock is what LockIBase() returned.
2462 type
2463   PIntuitionBase = ^TIntuitionBase;
2464   TIntuitionBase = record
2465     LibNode: TLibrary;
2466     ViewLord: TView;
2467 
2468     ActiveWindow: PWindow;
2469     ActiveScreen: PScreen;
2470     // the FirstScreen variable points to the frontmost Screen.   Screens are
2471     // then maintained in a front to back order using Screen.NextScreen
2472     FirstScreen: PScreen;   // for linked list of all screens
2473     Flags: LongWord;        // see definitions below
2474     MouseY: SmallInt;
2475     MouseX: SmallInt;       // mouse position relative to View
2476 
2477     Seconds: LongWord;      // timestamp of most current input event
2478     Micros: LongWord;       // timestamp of most current input event
2479     // I told you this was private. The data beyond this point has changed, is changing, and will continue to change.
2480   end;
2481 
2482 // Package of information passed to custom and 'boopsi' gadget 'hook' functions.  This structure is READ ONLY.
2483 type
2484   PGadgetInfo = ^TGadgetInfo;
2485   TGadgetInfo = record
2486     gi_Screen: PScreen;
2487     gi_Window: PWindow;       // nil for screen gadgets
2488     gi_Requester: PRequester; // nil IF not GTYP_REQGADGET
2489     gi_RastPort: PRastPort;   // rendering information: don't use these without cloning/locking. Official way is to call ObtainRPort()
2490     gi_Layer: PLayer;
2491     gi_Domain: TIBox;         { copy of dimensions of screen/window/g00/req(/group)
2492                                 that gadget resides in.  Left/Top of this box is
2493                                 offset from window mouse coordinates to gadget coordinates
2494                                          screen gadgets:         0,0 (from screen coords)
2495                                  window gadgets (no g00):        0,0
2496                                  GTYP_GZZGADGETs (borderlayer):  0,0
2497                                  GZZ innerlayer gadget:          borderleft, bordertop
2498                                  Requester gadgets:              reqleft, reqtop }
2499     gi_Pens: record           // these are the pens for the window or screen
2500       DetailPen: Byte;
2501       BlockPen : Byte;
2502     end;
2503     gi_DrInfo: pDrawInfo;     // the Detail and Block pens in gi_DrInfo->dri_Pens[] are for the screen.  Use the above for window-sensitive colors.
2504     gi_Gadget: PGadget;       // gadget backpointer. New for V50.
2505     gi_Reserved: array[0..4] of LongWord; // reserved space: this structure is extensible anyway, but using these saves some recompilation
2506   end;
2507 
2508 //** system private data structure for now **
2509 // prop gadget extra info
2510   PPGX = ^TPGX;
2511   TPGX = record
2512     pgx_Container: TIBox;
2513     pgx_NewKnob: TIBox;
2514   end;
2515 
2516 {
2517  * Class id strings for Intuition classes.
2518  * There's no real reason to use the uppercase constants
2519  * over the lowercase strings, but this makes a good place
2520  * to list the names of the built-in classes.
2521  }
2522 const
2523   ROOTCLASS      : PChar = 'rootclass';
2524   IMAGECLASS     : PChar = 'imageclass';
2525   FRAMEICLASS    : PChar = 'frameiclass';
2526   SYSICLASS      : PChar = 'sysiclass';
2527   FILLRECTCLASS  : PChar = 'fillrectclass';
2528   GADGETCLASS    : PChar = 'gadgetclass';
2529   PROPGCLASS     : PChar = 'propgclass';
2530   STRGCLASS      : PChar = 'strgclass';
2531   BUTTONGCLASS   : PChar = 'buttongclass';
2532   FRBUTTONCLASS  : PChar = 'frbuttonclass';
2533   GROUPGCLASS    : PChar = 'groupgclass';
2534   SCROLLERGCLASS : PChar = 'scrollergclass'; // V50
2535   ICCLASS        : PChar = 'icclass';
2536   MODELCLASS     : PChar = 'modelclass';
2537   ITEXTICLASS    : PChar = 'itexticlass';
2538   POINTERCLASS   : PChar = 'pointerclass';
2539 
2540 
2541 // Dispatched method ID's
2542 // NOTE: Applications should use Intuition entry points, not direct DoMethod() calls, for NewObject, DisposeObject, SetAttrs,  SetGadgetAttrs, and GetAttr.
2543 
2544   OM_Dummy       = $100;
2545   OM_NEW         = $101; // 'object' parameter is 'true class'
2546   OM_DISPOSE     = $102; // delete self (no parameters)
2547   OM_SET         = $103; // set attributes (in tag list)
2548   OM_GET         = $104; // return single attribute value
2549   OM_ADDTAIL     = $105; // add self to a List (let root do it)
2550   OM_REMOVE      = $106; // remove self from list
2551   OM_NOTIFY      = $107; // send to self: notify dependents
2552   OM_UPDATE      = $108; // notification message from somebody
2553   OM_ADDMEMBER   = $109; // used by various classes with lists
2554   OM_REMMEMBER   = $10A; // used by various classes with lists
2555 
2556 // Parameter 'Messages' passed to methods
2557 // OM_NEW and OM_SET
2558 type
2559   PopSet = ^TopSet;
2560   TopSet = record
2561     MethodID: LongWord;
2562     ops_AttrList: PTagItem;  // new attributes
2563     ops_GInfo: PGadgetInfo;  //  always there for gadgets, when SetGadgetAttrs() is used, but will be nil for OM_NEW                                         }
2564   end;
2565 
2566 // OM_NOTIFY, and OM_UPDATE
2567   PopUpdate = ^TopUpdate;
2568   TopUpdate = record
2569     MethodID: LongWord;
2570     opu_AttrList: PTagItem; // new attributes
2571     opu_GInfo: PGadgetInfo; // non-NULL when SetGadgetAttrs OR notification resulting from gadget input occurs.
2572     opu_Flags: LongWord;    // defined below
2573   end;
2574 
2575 { this flag means that the update message is being issued from
2576   something like an active gadget, a la GACT_FOLLOWMOUSE.  When
2577   the gadget goes inactive, it will issue a final update
2578   message with this bit cleared.  Examples of use are for
2579   GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
2580   for buttons. }
2581 const
2582   OPUF_INTERIM = 1 shl 1;
2583 
2584 // OM_GET
2585 type
2586   PopGet = ^TopGet;
2587   TopGet = record
2588     MethodID: LongWord;
2589     opg_AttrID: LongWord;
2590     opg_Storage: PLongWord; // may be other types, but 'integer' types are all LongWord
2591   end;
2592 
2593 // OM_ADDTAIL
2594   PopAddTail = ^TopAddTail;
2595   TopAddTail = record
2596     MethodID: LongWord;
2597     opat_List: PList;
2598   end;
2599 
2600 // OM_ADDMEMBER, OM_REMMEMBER
2601 type
2602   PopMember = ^TopMember;
2603   TopMember = record
2604     MethodID: LongWord;
2605     opam_Object: PObject_;
2606   end;
2607 
2608 //***** 'White box' access to struct IClass
2609 // This structure is READ-ONLY, and allocated only by Intuition
2610 type
2611   PIClass = ^TIClass;
2612   TIClass = record
2613     cl_Dispatcher: THook;       // Class dispatcher
2614     cl_Reserved: LongWord;      // must be 0
2615     cl_Super: PIClass;          // Pointer to superclass
2616     cl_ID: ClassID;             // Class ID
2617 
2618     cl_InstOffset: Word;        // Offset of instance data
2619     cl_InstSize: Word;          // Size of instance data
2620 
2621     cl_UserData: LongWord;      // Class global data
2622     cl_SubclassCount: LongWord; // Number of subclasses
2623     cl_ObjectCount: LongWord;   // Number of objects
2624     cl_Flags: LongWord;
2625   end;
2626 
2627 const
2628   CLF_INLIST =  $00000001; // class is in public class list
2629 
2630 
2631 
2632 
2633 //**** 'White box' access to struct _Object
2634 
2635 { We have this, the instance data of the root class, PRECEDING  the 'object'.  This is so that Gadget objects are Gadget pointers,
2636   and so on.  If this structure grows, it will always have o_Class at the end, so the macro OCLASS(o) will always have the same
2637   offset back from the pointer returned from NewObject(). This data structure is subject to change.  Do not use the o_Node
2638   embedded structure.
2639  }
2640 type
2641   P_Object = ^T_Object;
2642   T_Object = record
2643     o_Node: TMinNode;
2644     o_Class: PIClass;
2645   end;
2646 
2647 // BOOPSI class libraries should use this structure as the base for their library data.
2648 // This allows developers to obtain the class pointer for performing object-less inquiries.
2649 
2650   PClassLibrary = ^TClassLibrary;
2651   TClassLibrary = record
2652     cl_Lib: TLibrary;  // Embedded library
2653     cl_Pad: Word;      // Align the structure
2654     cl_Class: PIClass; // Class pointer
2655   end;
2656 
2657 // Gadget Class attributes
2658 CONST
2659   GA_Dummy           = TAG_USER + $30000;
2660   GA_Left            = GA_Dummy + 1;  // (LongInt) Left edge of the gadget relative to the left edge of the window
2661   GA_RelRight        = GA_Dummy + 2;  // (LongInt) Left edge of the gadget relative to the right edge of the window
2662   GA_Top             = GA_Dummy + 3;  // (LongInt) Top edge of the gadget relative to the top edge of the window
2663   GA_RelBottom       = GA_Dummy + 4;  // (LongInt) Top edge of the gadget relative to the bottom edge of the window
2664   GA_Width           = GA_Dummy + 5;  // (LongInt) Width of the gadget
2665   GA_RelWidth        = GA_Dummy + 6;  // (LongInt) Width of the gadget relative to the width of the window
2666   GA_Height          = GA_Dummy + 7;  // (LongInt) Height of the gadget
2667   GA_RelHeight       = GA_Dummy + 8;  // (LongInt) Height of the gadget relative to the height of the window
2668   GA_Text            = GA_Dummy + 9;  // (STRPTR) Gadget imagry is #0 terminated string
2669   GA_Image           = GA_Dummy + 10; // (PImage) Gadget imagry is an image
2670   GA_Border          = GA_Dummy + 11; // (PBorder) Gadget imagry is a border
2671   GA_SelectRender    = GA_Dummy + 12; // (PImage) Selected gadget imagry
2672   GA_Highlight       = GA_Dummy + 13; // (Word) One of GFLG_GADGHNONE, GFLG_GADGHBOX, GFLG_GADGHCOMP, or GFLG_GADGHIMAGE
2673   GA_Disabled        = GA_Dummy + 14; // (Boolean) Indicate whether gadget is disabled or not. Defaults to FALSE.
2674   GA_GZZGadget       = GA_Dummy + 15; // (BOOL) Indicate whether the gadget is for WFLG_GIMMEZEROZERO window borders or not. Defaults to FALSE.
2675   GA_ID              = GA_Dummy + 16; // (Word) Gadget ID assigned by the application
2676   GA_UserData        = GA_Dummy + 17; // (APTR) Application specific data
2677   GA_SpecialInfo     = GA_Dummy + 18; // (APTR) Gadget specific data
2678   GA_Selected        = GA_Dummy + 19; // (BOOL) Indicate whether the gadget is selected or not. Defaults to FALSE
2679   GA_EndGadget       = GA_Dummy + 20; // (BOOL) When set tells the system that when this gadget is selected causes the requester that it is in to be ended.  Defaults to FALSE.
2680   GA_Immediate       = GA_Dummy + 21; // (BOOL) When set indicates that the gadget is to notify the application when it becomes active.  Defaults to FALSE.
2681   GA_RelVerify       = GA_Dummy + 22; // (BOOL) When set indicates that the application wants toverify that the pointer was still over the gadget when
2682                                        //    the select button is released.  Defaults to FALSE. }
2683   GA_FollowMouse     = GA_Dummy + 23; // (BOOL) When set indicates that the application wants to be notified of mouse movements while the gadget is active.
2684                                        //   It is recommmended that GA_Immediate and GA_RelVerify are also used so that the active gadget can be tracked by the
2685                                        //   application. Defaults to FALSE.
2686   GA_RightBorder     = GA_Dummy + 24; // (BOOL) Indicate whether the gadget is in the right border or not. Defaults to FALSE.
2687   GA_LeftBorder      = GA_Dummy + 25; // (BOOL) Indicate whether the gadget is in the left border or not. Defaults to FALSE.
2688   GA_TopBorder       = GA_Dummy + 26; // (BOOL) Indicate whether the gadget is in the top border or not. Defaults to FALSE.
2689   GA_BottomBorder    = GA_Dummy + 27; // (BOOL) Indicate whether the gadget is in the bottom border or not. Defaults to FALSE.
2690   GA_ToggleSelect    = GA_Dummy + 28; // (BOOL) Indicate whether the gadget is toggle-selected or not. Defaults to FALSE.
2691   GA_SysGadget       = GA_Dummy + 29; // (BOOL) Reserved for system use to indicate that the gadget belongs to the system. Defaults to FALSE.
2692   GA_SysGType        = GA_Dummy + 30; // (Word) Reserved for system use to indicate the gadget type.
2693   GA_Previous        = GA_Dummy + 31; // (PGadget) Previous gadget in the linked list.
2694                                       //   NOTE: This attribute CANNOT be used to link new gadgets into the gadget list of an open window or requester.  You must use AddGList().
2695   GA_Next            = GA_Dummy + 32; // (PGadget) Next gadget in the linked list.
2696   GA_DrawInfo        = GA_Dummy + 33; // (PDrawInfo) Some gadgets need a DrawInfo at creation time
2697   // You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage
2698   GA_IntuiText       = GA_Dummy + 34; // (PIntuiText) Label is an IntuiText.
2699   GA_LabelImage      = GA_Dummy + 35; // (PObject_) Label is an image object.
2700   // New for V37:
2701   GA_TabCycle        = GA_Dummy + 36; // (BOOL) Indicate whether gadget is part of TAB/SHIFT-TAB cycle activation. Defaults to FALSE
2702   // New for V39:
2703   GA_GadgetHelp      = GA_Dummy + 37; // (BOOL) Indicate whether gadget is to send IDCMP_GADGETHELP. Defaults to FALSE
2704   GA_Bounds          = GA_Dummy + 38; // (PIBox) Copied into the extended gadget's bounds.
2705   GA_RelSpecial      = GA_Dummy + 39; // (BOOL) Indicate whether gadget has special relativity. Defaults to FALSE
2706   // New for V42:
2707   GA_TextAttr       = GA_Dummy + 40; // (PTextAttr) Indicate the font to use for the gadget.
2708   GA_ReadOnly       = GA_Dummy + 41; // (BOOL) Indicate that the gadget is read-only (non-selectable). Defaults to FALSE
2709   // New for V44:
2710   GA_Underscore     = GA_Dummy + 42; // (UBYTE) Underscore/escape character for keyboard shortcuts. Defaults to '_'
2711   GA_ActivateKey    = GA_Dummy + 43; // (STRPTR) Set/Get the gadgets shortcut/activation key(s) Defaults to nil
2712   GA_BackFill       = GA_Dummy + 44; // (PHook) Backfill pattern hook. Defaults to nil
2713   GA_GadgetHelpText = GA_Dummy + 45; // (STRPTR)   RESERVERD/PRIVATE DO NOT USE Defaults to nil
2714   GA_UserInput      = GA_Dummy + 46; // (BOOL) Notification tag indicates this notification is from the activite
2715                                      //   gadget receiving user input - an attempt to make IDCMPUPDATE more efficient. Defaults to FALSE
2716   // New for V50:
2717   GA_DoLayout       = GA_Dummy + 51; // (BOOL) Set this to TRUE if the gadget should recompute its  position and size when it receives a GM_LAYOUT message. For
2718                                      //   gadgets which are part of a layout group this attribute should be FALSE; the layout takes care of placing and sizing
2719                                      //   its members and the resulting geometry must not be changed. The default is usually FALSE for ReAction gadgets, while for
2720                                      //   others it is defined on a class-by-class basis
2721   GA_NoFilterMenuKeys = GA_Dummy+52; // (BOOL) Corresponds to GMORE_NOFILTERMENUKEYS
2722   GA_Titlebar       = GA_Dummy + 53; // (BOOL) Set this to TRUE if you want the gadget to be automatically positioned by Intuition in the window titlebar (at the left or at
2723                                      // the right side, depending on the state of GFLG_RELRIGHT). The layout is done according to the current style and geometry settings for
2724                                      // window border gadgets. Please use an appropriate sysiclass instance as imagery for a titlebar gadget, such as ICONIFYIMAGE or TBFRAMEIMAGE. Note: This property implies [GA_TopBorder, TRUE].
2725   GA_Hidden         = GA_Dummy + 54; // (BOOL) Corresponds to GMORE_HIDDEN
2726   GA_NoFilterWheel  = GA_Dummy + 55; // (BOOL) Corresponds to GMORE_NOFILTERWHEEL
2727   GA_HintInfo       = GA_Dummy + 56; // (STRPTR) The default HintInfo string for this gadget. See window.class documentation for more information
2728   GA_ContextMenu    = GA_Dummy + 57; // (APTR) The default context menu for this gadget. It can be either a traditional menu or a BOOPSI menu tree from menuclass
2729 
2730 // PROPGCLASS attributes
2731   PGA_Dummy      = TAG_USER + $31000;
2732   PGA_Freedom    = PGA_Dummy + $0001;
2733   // only one of PGA_FREEVERT or PGA_FREEHORIZ
2734   PGA_Borderless = PGA_Dummy + $0002;
2735   PGA_HorizPot   = PGA_Dummy + $0003;
2736   PGA_HorizBody  = PGA_Dummy + $0004;
2737   PGA_VertPot    = PGA_Dummy + $0005;
2738   PGA_VertBody   = PGA_Dummy + $0006;
2739   PGA_Total      = PGA_Dummy + $0007;
2740   PGA_Visible    = PGA_Dummy + $0008;
2741   PGA_Top        = PGA_Dummy + $0009;
2742   // New for V37:
2743   PGA_NewLook    = PGA_Dummy + $000A;
2744   // New for V50: scrollergclass attributes
2745   PGA_ArrowDelta = PGA_Dummy + $000B;
2746   PGA_ArrowDown  = PGA_Dummy + $000C;
2747 
2748 // STRGCLASS attributes
2749   STRINGA_Dummy      = TAG_USER + $32000;
2750   STRINGA_MaxChars   = STRINGA_Dummy + $0001;
2751   // Note:  There is a minor problem with Intuition when using boopsi integer gadgets (which are requested by using STRINGA_LongVal).  Such gadgets
2752   // must not have a STRINGA_MaxChars to be bigger than 15. Setting STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched  FreeMem() to occur.
2753   STRINGA_Buffer     = STRINGA_Dummy + $0002;
2754   STRINGA_UndoBuffer = STRINGA_Dummy + $0003;
2755   STRINGA_WorkBuffer = STRINGA_Dummy + $0004;
2756   STRINGA_BufferPos  = STRINGA_Dummy + $0005;
2757   STRINGA_DispPos    = STRINGA_Dummy + $0006;
2758   STRINGA_AltKeyMap  = STRINGA_Dummy + $0007;
2759   STRINGA_Font       = STRINGA_Dummy + $0008;
2760   STRINGA_Pens       = STRINGA_Dummy + $0009;
2761   STRINGA_ActivePens = STRINGA_Dummy + $000A;
2762   STRINGA_EditHook   = STRINGA_Dummy + $000B;
2763   STRINGA_EditModes  = STRINGA_Dummy + $000C;
2764 
2765 // booleans
2766   STRINGA_ReplaceMode    = STRINGA_Dummy + $000D;
2767   STRINGA_FixedFieldMode = STRINGA_Dummy + $000E;
2768   STRINGA_NoFilterMode   = STRINGA_Dummy + $000F;
2769 
2770   STRINGA_Justification  = STRINGA_Dummy + $0010;
2771   // GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT
2772   STRINGA_LongVal        = STRINGA_Dummy + $0011;
2773   STRINGA_TextVal        = STRINGA_Dummy + $0012;
2774 
2775   STRINGA_ExitHelp       = STRINGA_Dummy + $0013; // STRINGA_ExitHelp is new for V37, and ignored by V36. Set this if you want the gadget to exit when Help is
2776                                                   // pressed.  Look for a code of $5F, the rawkey code for Help
2777   // New in V50:
2778   STRINGA_MarkedBlock    = STRINGA_Dummy + $0014; // Sets/gets the marked block of a string.gadget. The hi-word contains the start position (first marked char) and the
2779                                                   // lo-word the end position (last marked char).  If both are -1 nothing is marked.
2780   SG_DEFAULTMAXCHARS = 128;
2781 
2782 // Gadget Layout related attributes
2783   LAYOUTA_Dummy       = TAG_USER  + $38000;
2784   LAYOUTA_LayoutObj   = LAYOUTA_Dummy + $0001;
2785   LAYOUTA_Spacing     = LAYOUTA_Dummy + $0002;
2786   LAYOUTA_Orientation = LAYOUTA_Dummy + $0003;
2787   // New For V42:
2788   LAYOUTA_ChildMaxWidth  = LAYOUTA_Dummy + $0004; // (BOOL) Child objects are of equal width.  Should default to TRUE for gadgets with a horizontal orientation.
2789   LAYOUTA_ChildMaxHeight = LAYOUTA_Dummy + $0005; // (BOOL) Child objects are of equal height.  Should default to TRUE for gadgets with a vertical orientation.
2790   // orientation values
2791   LORIENT_NONE  = 0;
2792   LORIENT_HORIZ = 1;
2793   LORIENT_VERT  = 2;
2794 // Gadget Method ID's
2795   GM_Dummy         = -1; // not used for anything
2796   GM_HITTEST       = 0;  // return GMR_GADGETHIT IF you are clicked on (whether or not you are disabled).
2797   GM_RENDER        = 1;  // draw yourself, in the appropriate state
2798   GM_GOACTIVE      = 2;  // you are now going to be fed input
2799   GM_HANDLEINPUT   = 3;  // handle that input
2800   GM_GOINACTIVE    = 4;  // whether or not by choice, you are done
2801   GM_HELPTEST      = 5;  // Will you send gadget help if the mouse is at the specified coordinates?  See below for possible GMR_ values.
2802   GM_LAYOUT        = 6;  // re-evaluate your size based on the GadgetInfo Domain.  Do NOT re-render yourself yet, you will be called when it is time...
2803   GM_DOMAIN        = 7;  // Used to obtain the sizing requirements of an object.  Does not require an object.
2804   GM_KEYTEST       = 8;  // Return GMR_GADGETHIT if your activation key matches (whether or not you are disabled).
2805   GM_KEYGOACTIVE   = 9;  // You are now going to be fed raw key events (V53)
2806   GM_KEYGOINACTIVE = 10; // You are done receiving raw key events (V53)
2807   GM_PRERENDER     = 11; // Private (V50)
2808   GM_POSTRENDER    = 12; // Private (V50)
2809   GM_EXTENT        = 13; // Let Intuition know what pixels your GM_RENDER method will fill (V51)
2810   GM_HANDLESCROLL  = 14; // Handle a mouse wheel event. (V52)
2811   GM_QUERY         = 15; // You're being queried about some special information. (V53)
2812   GM_MENUPICK      = 16; //  The user selected an item from your context menu. (V54)
2813   GM_MENUHELP      = 17; // The user asked for help on an item from your context menu. (V54)
2814 
2815 type
2816 // Parameter "Messages" passed to gadget class methods  }
2817 // GM_HITTEST and GM_HELPTEST send this message. For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
2818 // select box.  For GM_HELPTEST, the coordinates are relative to the gadget bounding box (which defaults to the select box).
2819   PgpHitTest = ^TgpHitTest;
2820   TgpHitTest = record
2821     MethodID: LongWord;
2822     gpht_GInfo: PGadgetInfo;
2823     gpht_Mouse: record
2824       x: SmallInt;
2825       y: SmallInt;
2826     end;
2827   end;
2828 
2829 const
2830 // For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit, otherwise return zero.
2831 //
2832 // For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit. Typically, return GMR_HELPHIT if you were hit.
2833 // It is possible to pass a UWORD to the application via the Code field of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
2834 // the UWORD-sized result you wish to return.
2835 //
2836 // GMR_HELPHIT yields a Code value of (LongWord(not 0)), which should mean "nothing particular" to the application.
2837 
2838   GMR_GADGETHIT = $00000004; // GM_HITTEST hit
2839   GMR_NOHELPHIT = $00000000; // GM_HELPTEST didn't hit
2840   GMR_HELPHIT   = $FFFFFFFF; // GM_HELPTEST hit, return code = not 0
2841   GMR_HELPCODE  = $00010000; // GM_HELPTEST hit, return low word as code
2842 
2843 
2844 // GM_RENDER    }
2845 type
2846   PgpRender = ^TgpRender;
2847   TgpRender = record
2848     MethodID: LongWord;
2849     gpr_GInfo: PGadgetInfo; // gadget context
2850     gpr_RPort: PRastPort;   // all ready for use
2851     gpr_Redraw: LongInt;    // might be a "highlight pass"
2852   end;
2853 
2854 // values of gpr_Redraw
2855 const
2856   GREDRAW_UPDATE = 2; // incremental update, e.g. prop slider
2857   GREDRAW_REDRAW = 1; // redraw gadget
2858   GREDRAW_TOGGLE = 0; // toggle highlight, IF applicable
2859 
2860 // GM_GOACTIVE, GM_HANDLEINPUT
2861 type
2862   PgpInput = ^TgpInput;
2863   TgpInput = record
2864     MethodID: LongWord;
2865     gpi_GInfo: PGadgetInfo;
2866     gpi_IEvent: PInputEvent;
2867     gpi_Termination: PLongInt;
2868     gpi_Mouse: record
2869       x: SmallInt;
2870       y: SmallInt;
2871     end;
2872     { (V39) Pointer to TabletData structure, if this event originated from a tablet which sends IESUBCLASS_NEWTABLET events, or nil if      not.
2873       DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39! IT WILL BE INVALID!}
2874     gpi_TabletData : pTabletData;
2875   end;
2876 
2877 // GM_HANDLEINPUT and GM_GOACTIVE  return code flags
2878 // return GMR_MEACTIVE (0) alone if you want more input. Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally GMR_VERIFY.
2879 const
2880   GMR_MEACTIVE = 0;
2881   GMR_NOREUSE  = 1 shl 1;
2882   GMR_REUSE    = 1 shl 2;
2883   GMR_VERIFY   = 1 shl 3; // you MUST set cgp_Termination
2884 
2885 // New for V37:
2886 // You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE, which instructs
2887 // Intuition to activate the next or previous gadget that has GFLG_TABCYCLE set.
2888   GMR_NEXTACTIVE = 1 shl 5;
2889   GMR_PREVACTIVE = 1 shl 6;
2890 
2891 // GM_GOINACTIVE }
2892 type
2893   PgpGoInactive = ^TgpGoInactive;
2894   TgpGoInactive = record
2895     MethodID: LongWord;
2896     gpgi_GInfo: PGadgetInfo;
2897     // V37 field only!  DO NOT attempt to read under V36! }
2898     gpgi_Abort: LongWord; // gpgi_Abort=1 IF gadget was aborted by Intuition and 0 if gadget went inactive at its own request
2899   end;
2900 
2901 { New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when the gadget is added to the window (or when the window opens, if
2902   the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets list), or when the window is resized.  Your gadget can set the
2903   GA_RelSpecial property to get GM_LAYOUT events without Intuition changing the interpretation of your gadget select box.  This
2904   allows for completely arbitrary resizing/repositioning based on window size.}
2905 // GM_LAYOUT
2906   PgpLayout = ^TgpLayout;
2907   TgpLayout = record
2908     MethodID: LongWord;
2909     gpl_GInfo: PGadgetInfo;
2910     gpl_Initial: LongWord; // non-zero if this method was invoked during AddGList() or OpenWindow()
2911   end;                     // time.  zero if this method was invoked during window resizing.
2912 
2913 
2914 // The GM_DOMAIN method is used to obtain the sizing requirements of an object for a class before ever creating an object.
2915 // GM_DOMAIN
2916   PgpDomain = ^TgpDomain;
2917   TgpDomain = record
2918       MethodID: LongWord;
2919       gpd_GInfo: PGadgetInfo;
2920       gpd_RPort: PRastPort;   // RastPort to layout for
2921       gpd_Which: LongInt;
2922       gpd_Domain: TIBox;      // Resulting domain
2923       gpd_Attrs: PTagItem;    // Additional attributes
2924    end;
2925 
2926 const
2927   GDOMAIN_MINIMUM = 0; // Minimum size
2928   GDOMAIN_NOMINAL = 1; // Nominal size
2929   GDOMAIN_MAXIMUM = 2; // Maximum size
2930 
2931 // The GM_KEYTEST method is used to determin if a key press matches an object's activation key(s).
2932 // GM_KEYTEST send this message.
2933 type
2934   PgpKeyTest = ^TgpKeyTest;
2935   TgpKeyTest = record
2936     MethodID: LongWord;
2937     gpkt_GInfo: PGadgetInfo;
2938     gpkt_IMsg: PIntuiMessage;
2939     gpkt_VanillaKey: LongWord;
2940   end;
2941 
2942 
2943 // The GM_KEYGOACTIVE method is called to "simulate" a gadget going down. A gadget should render itself in a selected state when receiving
2944 //  this message. If the class supports this method, it must return GMR_KEYACTIVE.
2945 
2946 // If a gadget returns zero for this method, it will subsequently be activated via ActivateGadget() with a NULL IEvent.
2947 // GM_KEYGOACTIVE
2948   PgpKeyInput = ^TgpKeyInput;
2949   TgpKeyInput = record
2950     MethodID: LongWord;
2951     gpk_GInfo: PGadgetInfo;
2952     gpk_IEvent: PInputEvent;
2953     gpk_Termination: PLongInt;  // Used with GMR_KEYVERIFY
2954   end;
2955 
2956 const
2957   GMR_KEYACTIVATE = $00000000; // Throw away event and call ActivateGadget() (default)
2958   GMR_KEYACTIVE   = $00000010; // Method supported and send more key events
2959   GMR_KEYVERIFY   = $00000020; // Stop sending key events. You MUST set gpk_Termination.
2960 
2961 // The GM_KEYGOINACTIVE method is called to simulate the gadget release.
2962 // Upon receiving this message, the gadget should do everything a normal gadget release would do.
2963 type
2964   PgpKeyGoInactive = ^tgpKeyGoInactive;
2965   tgpKeyGoInactive = record
2966     MethodID: LongWord;       // GM_KEYGOINACTIVE
2967     gpki_GInfo: PGadgetInfo;
2968     gpki_Abort: LongWord;     // TRUE if input was aborted
2969   end;
2970 
2971 // New for V51: Intuition may send GM_EXTENT to a gadget to ask it what
2972 // pixels (at least) it will fully redraw when its GM_RENDER method is invoked in the same context.
2973 // GM_EXTENT
2974   PgpExtent = ^TgpExtent;
2975   TgpExtent = record
2976     MethodID: LongWord;
2977     gpe_GInfo: PGadgetInfo;
2978     gpe_RPort: PRastPort;   // nil if masking not supported
2979     gpe_Region: PRegion;    // nil if clipping not supported
2980     gpe_Action: LongWord;   // Requested operation
2981     gpe_Flags: LongWord;    // Control flags, see below
2982     gpe_Attrs: PTagItem;    // Additional attributes
2983   end;
2984 const
2985   // Possible operations requested by GM_EXTENT
2986   GEXTENT_REMOVE = 0; // You should CLEAR shapes from region/mask
2987   GEXTENT_ADD    = 1; // You should OR shapes into region/mask
2988   GEXTENT_INVERT = 2; // You should XOR shapes into region/mask
2989   GEXTENT_SECT   = 3; // You should AND shapes into region/mask
2990   // Control flags defined for GM_EXTENT
2991   GPEF_ALLOWSUPER = $00000001; // Allow superclass to handle the method
2992   // Possible return codes for GM_EXTENT
2993   GMR_INVALID  = $00000000; // Couldn't provide any information
2994   GMR_FULLHBOX = $00000010; // I fill every pixel within my hit box
2995   GMR_FULLBBOX = $00000020; // I fill every pixel within my bounding box
2996   GMR_CLIPDONE = $00000040; // Added to the region all areas I fully redraw
2997   GMR_MASKDONE = $00000080; // Wrote into the mask all pixels I fully redraw
2998 
2999 // The GM_QUERY method is new for V53, and is currently invoked by Intuition and window.class.
3000 // GM_QUERY
3001 type
3002   PgpQuery = ^TgpQuery;
3003   TgpQuery = record
3004    MethodID: LongWord;      // always GM_QUERY
3005    gpq_GInfo: PGadgetInfo;  // filled in by Intuition
3006    gpq_IEvent: PInputEvent; // positional data is here
3007    gpq_Type: LongWord;      // see below
3008    gpq_Data: LongInt;       // the data being returned
3009   end;
3010 const
3011 // values for gpq_Type
3012   GMQ_HINTINFO    = 1;
3013   GMQ_WHICHMEMBER = 2;
3014   GMQ_CONTEXTMENU = 3;
3015 
3016 type
3017 // New for V54: the GM_MENUPICK and GM_MENUHELP methods are used to let a  custom gadget hear context menu selections or help requests by the user.
3018 // GM_MENUPICK, GM_MENUHELP
3019   PgpMenuEvent = ^TgpMenuEvent;
3020   TgpMenuEvent = record
3021     MethodID: LongWord;
3022     gpme_GInfo: PGadgetInfo;   // Always nil
3023     gpme_MenuAddress: APTR;    // Originating context menu
3024     gpme_MenuNumber: LongWord; // First item selected
3025     gpme_Window: PWindow;      // The gadget's window
3026   end;
3027 
3028 const
3029 // Gadget/object interconnection classes
3030   ICM_Dummy      = $0401; // used for nothing
3031   ICM_SETLOOP    = $0402; // set/increment loop counter
3032   ICM_CLEARLOOP  = $0403; // clear/decrement loop counter
3033   ICM_CHECKLOOP  = $0404; // set/increment loop
3034 // no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP
3035 
3036 // interconnection attributes used by icclass, modelclass, and gadgetclass
3037   ICA_Dummy      = TAG_USER + $40000;
3038   ICA_TARGET     = ICA_Dummy + 1; // interconnection target
3039   ICA_MAP        = ICA_Dummy + 2; // interconnection map tagitem list
3040   ICSPECIAL_CODE = ICA_Dummy + 3; // a "pseudo-attribute", see below.
3041 
3042 { Normally, the value for ICA_TARGET is some object pointer, but if you specify the special value ICTARGET_IDCMP, notification
3043   will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's IDCMP port.  See the definition of IDCMP_IDCMPUPDATE.
3044 
3045   When you specify ICTARGET_IDCMP for ICA_TARGET, the map you specify will be applied to derive the attribute list that is
3046   sent with the IDCMP_IDCMPUPDATE message.  If you specify a map list which results in the attribute tag id ICSPECIAL_CODE, the
3047   lower sixteen bits of the corresponding ti_Data value will be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.}
3048   ICTARGET_IDCMP = not 0;
3049 
3050  // system image classes
3051   CUSTOMIMAGEDEPTH = -1; // if image.Depth is this, it's a new Image class object
3052 
3053   IA_Dummy      = TAG_USER + $20000;
3054   IA_Left       = IA_Dummy + $01;
3055   IA_Top        = IA_Dummy + $02;
3056   IA_Width      = IA_Dummy + $03;
3057   IA_Height     = IA_Dummy + $04;
3058   IA_FGPen      = IA_Dummy + $05; // IA_FGPen also means "PlanePick"
3059   IA_BGPen      = IA_Dummy + $06; // IA_BGPen also means "PlaneOnOff" }
3060   IA_Data       = IA_Dummy + $07; // bitplanes, for classic image, other image classes may use it for other things
3061   IA_LineWidth  = IA_Dummy + $08;
3062   IA_Pens       = IA_Dummy + $0E; // pointer to word pens[], ala DrawInfo.Pens, MUST be terminated by ~0.  Some classes can
3063                                  // choose to have this, or SYSIA_DrawInfo, or both.
3064   IA_Resolution = IA_Dummy + $0F; // packed uwords for x/y resolution into a longword ala DrawInfo.Resolution
3065 
3066 // see class documentation to learn which classes recognize these
3067   IA_APattern     = IA_Dummy + $10;
3068   IA_APatSize     = IA_Dummy + $11;
3069   IA_Mode         = IA_Dummy + $12;
3070   IA_Font         = IA_Dummy + $13;
3071   IA_Outline      = IA_Dummy + $14;
3072   IA_Recessed     = IA_Dummy + $15;
3073   IA_DoubleEmboss = IA_Dummy + $16;
3074   IA_EdgesOnly    = IA_Dummy + $17;
3075 
3076  // "sysiclass" attributes
3077   SYSIA_Size          = IA_Dummy + $0B; // const's below
3078   SYSIA_Depth         = IA_Dummy + $0C; // this is unused by Intuition.  SYSIA_DrawInfo is used instead for V36
3079   SYSIA_Which         = IA_Dummy + $0D; // see 's below
3080   SYSIA_DrawInfo      = IA_Dummy + $18; // pass to sysiclass, please
3081   // obsolete: don't use these, use IA_Pens
3082   SYSIA_Pens          = IA_Pens;
3083   IA_ShadowPen        = IA_Dummy + $09;
3084   IA_HighlightPen     = IA_Dummy + $0A;
3085   // New for V39:
3086   SYSIA_ReferenceFont = IA_Dummy + $19; // Font to use as reference for scaling certain sysiclass images
3087   IA_SupportsDisable  = IA_Dummy + $1a; //  By default, Intuition ghosts gadgets itself, instead of relying on IDS_DISABLED or
3088                                         // IDS_SELECTEDDISABLED.  An imageclass that supports these states should return this attribute
3089                                         // as TRUE.  You cannot set or clear this attribute, however.
3090   IA_FrameType   = IA_Dummy + $1b; // Starting with V39, FrameIClass recognizes  several standard types of frame.  Use one
3091                                         // of the FRAME_ specifiers below.  Defaults to FRAME_DEFAULT.
3092   IA_Underscore  = IA_Dummy + $1c; // V44, Indicate underscore keyboard shortcut for image labels. (Char) Defaults to '_'
3093   IA_Scalable    = IA_Dummy + $1d; // V44, Attribute indicates this image is allowed to/can scale its rendering. (BOOL) Defaults to FALSE.
3094   IA_ActivateKey = IA_Dummy + $1e; // V44, Used to get an underscored label shortcut. Useful for labels attached to string gadgets. (Char) Defaults to #0.
3095   IA_Screen      = IA_Dummy + $1f; // V44 Screen pointer, may be useful/required by certain classes. (PScreen)
3096   IA_Precision   = IA_Dummy + $20; // V44 Precision value, typically pen precision but may be used for similar custom purposes. (LongWord)
3097   // New For V50:
3098   SYSIA_FullFrame   = IA_Dummy + $21; // Specifies whether the sysiclass image must have an inner frame, if the current style normally has one.
3099   SYSIA_ContentsBox = IA_Dummy + $22; // position and size of the inner area of a TBFRAMEIMAGE image (PIBox)
3100   IA_Orientation    = IA_Dummy + $23; // Defines orientation, for images needing this kind of information
3101   IA_Simple         = IA_Dummy + $24; // image should be drawn with the most plain graphic appearance it supports
3102   SYSIA_VectorInfo  = IA_Dummy + $25; // Custom vector definition for a sysiclass image.
3103   SYSIA_RenderHook  = IA_Dummy + $26; // Custom rendering hook for a sysiclass image.
3104   SYSIA_BitMapCache = IA_Dummy + $27; // Level of bitmap caching for sysiclass images (0 = none, 1 = deferred, 2 = immediate). Defaults to 2.
3105   IA_Label          = IA_Dummy + $28; // Pointer to a string to be used as the image's text label, if it supports one.
3106   SYSIA_Label       = IA_Label;
3107 
3108   IA_BackFill         = IA_Dummy + $29; // Pointer to a backfill hook the image can use to fill
3109   IA_SelectedBackFill = IA_Dummy + $2A; // its background, if it supports this attribute.
3110   IA_DisabledBackFill = IA_Dummy + $2B;
3111   IA_InactiveBackFill = IA_Dummy + $2C;
3112   // New For V51:
3113   IA_EraseBackground = IA_Dummy + $2D; // Erase the background before rendering the image?
3114   IA_InBorder        = IA_Dummy + $2E; // Is this image to be drawn inside a window border? Defaults to FALSE.
3115 
3116 //**** "gaugeiclass" attributes
3117   GAUGEIA_Min        = IA_Dummy + $2F; // Minimum level of a gaugeiclass image. (V51)
3118   GAUGEIA_Max        = IA_Dummy + $30; // Maximum level of a gaugeiclass image. (V51)
3119   GAUGEIA_Level      = IA_Dummy + $31; // Current level of a gaugeiclass image. (V51)
3120   GAUGEIA_Ticks      = IA_Dummy + $32; // Number of tick marks to be drawn for a gaugeiclass image. Defaults to 0 (no tick marks). (V51)
3121   GAUGEIA_TickSize   = IA_Dummy + $33; // Length of tick marks for a gaugeiclass image, if they are present. Defaults to 4. (V51)
3122   GAUGEIA_ShortTicks = IA_Dummy + $34; // Should half-length tick marks be drawn in-between the normal tick marks of a gaugeiclass image? Defaults to False. (V51)
3123   GAUGEIA_InnerTicks = IA_Dummy + $35; // Should tick marks be drawn inside the gauge, rather than alongside it? Defaults to FALSE. (V51)
3124   GAUGEIA_ScaleHook  = IA_Dummy + $36; // Custom hook for calculating the size of the filled part of the gauge, relative to the container's size;
3125                                        // object is the image, message is a pointer to an array of 3 uint32s. The scale hook must calculate
3126                                        // (number[0] * number[1]) / number[2] and return the result, or zero if it can't perform the calculation.
3127                                        // Passing NULL means an internal scaling routine will be used. Defaults to nil. (V51)
3128   IA_Justification   = IA_Dummy + $37; // Justification of the image's text label, if it supports one. Use one of the IJ_ constants below.
3129                                        // Defaults to IJ_LEFT, unless otherwise specified in the documentation for the image class. (V51)
3130   IA_LabelPen        = IA_Dummy + $38; // Color of the image's text label, if it supports one. Defaults to the TEXTPEN color. (V51)
3131 
3132 // data values for SYSIA_Size
3133   SYSISIZE_MEDRES = 0;
3134   SYSISIZE_LOWRES = 1;
3135   SYSISIZE_HIRES  = 2;
3136 
3137 // SYSIA_Which tag data values: Specifies which system gadget you want an image for. Some numbers correspond to internal Intuition
3138   DEPTHIMAGE     = $00; // Window depth gadget image
3139   ZOOMIMAGE      = $01; // Window zoom gadget image
3140   SIZEIMAGE      = $02; // Window sizing gadget image
3141   CLOSEIMAGE     = $03; // Window close gadget image
3142   SDEPTHIMAGE    = $05; // screen depth gadget
3143   LEFTIMAGE      = $0A; // Window left-arrow gadget image
3144   UPIMAGE        = $0B; // Window up-arrow gadget image
3145   RIGHTIMAGE     = $0C; // Window right-arrow gadget image
3146   DOWNIMAGE      = $0D; // Window down-arrow gadget image
3147   CHECKIMAGE     = $0E; // GT/RA checkbox image
3148   MXIMAGE        = $0F; // GT/RA mutual exclude "button" image
3149   // New for V39:
3150   MENUCHECK      = $10; // Menu checkmark image
3151   AMIGAKEY       = $11; // Menu Amiga-key image
3152   // New for V50:
3153   SBARLOGO       = $12; // Screen titlebar logo
3154   POPUPIMAGE     = $13; // Window pop-up gadget image
3155   SETTINGSIMAGE  = $14; // Window settings gadget image
3156   SNAPSHOTIMAGE  = $15; // Window snapshot gadget image
3157   ICONIFYIMAGE   = $16; // Window iconify gadget image
3158   PADLOCKIMAGE   = $17; // Window padlock gadget image
3159   TBFRAMEIMAGE   = $18; // Window titlebar frame image
3160   HKHANDLEIMAGE  = $19; // Window horizontal knob handle symbol
3161   VKHANDLEIMAGE  = $1A; // Window vertical knob handle symbol
3162   MENUMX         = $1B; // Menu mutualexclude image
3163   MENUSUB        = $1C; // Menu sub-panel indicator
3164   CYCLEIMAGE     = $1D; // GT/RA cycle symbol
3165   CHECKMARKIMAGE = $1E; // GT/RA checkmark symbol
3166   GLEFTIMAGE     = $1F; // GT/RA left-arrow symbol
3167   GUPIMAGE       = $20; // GT/RA up-arrow symbol
3168   GRIGHTIMAGE    = $21; // GT/RA right-arrow symbol
3169   GDOWNIMAGE     = $22; // GT/RA down-arrow symbol
3170   GHKHANDLEIMAGE = $23; // GT/RA horizontal knob handle symbol
3171   GVKHANDLEIMAGE = $24; // GT/RA vertical knob handle symbol
3172   // New for V51:
3173   SCLOSEIMAGE    = $25; // Screen close gadget image
3174   SCREENSIMAGE   = $26; // Window screen-jump gadget image
3175   // New for V53.25:
3176   SORTASCIMAGE   = $27; // Sort ascending image
3177   SORTDESIMAGE   = $28; // Sort descending image
3178 // Additional system image types recognized by DrawSysImageA() (V50)
3179   SI_HPROPBACKGROUND = $1001; // Background of horizontal scroller
3180   SI_VPROPBACKGROUND = $1002; // Background of vertical scroller
3181 
3182 // Data values for IA_FrameType (recognized by FrameIClass)
3183   FRAME_DEFAULT     = 0; //The standard V37-type frame, which has thin edges.
3184   FRAME_BUTTON      = 1; // Standard button gadget frames, having thicker sides and nicely edged corners.
3185   FRAME_RIDGE       = 2; // A ridge such as used by standard string gadgets. You can recess the ridge to get a groove image.
3186   FRAME_ICONDROPBOX = 3; // A broad ridge which is the standard imagery for areas in AppWindows where icons may be dropped.
3187   // New for V50:
3188   FRAME_PROPBORDER  = 4; // A frame suitable for use as border of a proportional gadget container.
3189   FRAME_PROPKNOB    = 5; // A frame suitable for use as knob of a proportional gadget.
3190   FRAME_DISPLAY     = 6; // A recessed frame for display elements, such as read-only text or number gadgets.
3191 
3192 // IA_Justification tag data values
3193   IJ_LEFT   = 0;
3194   IJ_CENTER = 1;
3195   IJ_RIGHT  = 2;
3196 
3197 // image message id's
3198   IM_DRAW     = $202; // draw yourself, with "state"
3199   IM_HITTEST  = $203; // return TRUE IF click hits image
3200   IM_ERASE    = $204; // erase yourself
3201   IM_MOVE     = $205; // draw new AND erase old, smoothly
3202 
3203   IM_DRAWFRAME   = $206; // draw with specified dimensions
3204   IM_FRAMEBOX    = $207; // get recommended frame around some box
3205   IM_HITFRAME    = $208; // hittest with dimensions
3206   IM_ERASEFRAME  = $209; // hittest with dimensions
3207 
3208   IM_DOMAINFRAME = $20A; // query image for its domain info (V44)
3209 
3210   IM_EXTENT      = $20B; // inquire about rendering extent (V51)
3211   IM_EXTENTFRAME = $20C; // as IM_EXTENT, with dimensions (V51)
3212 
3213 // image draw states or styles, for IM_DRAW
3214 // Note that they have no bitwise meanings (unfortunately)
3215   IDS_NORMAL           = 0;
3216   IDS_SELECTED         = 1; // for selected gadgets
3217   IDS_DISABLED         = 2; // for disabled gadgets
3218   IDS_BUSY             = 3; // for future functionality
3219   IDS_INDETERMINATE    = 4; // for future functionality
3220   IDS_INACTIVENORMAL   = 5; // normal, in inactive window border
3221   IDS_INACTIVESELECTED = 6; // selected, in inactive border
3222   IDS_INACTIVEDISABLED = 7; // disabled, in inactive border
3223   IDS_SELECTEDDISABLED = 8; // disabled and selected
3224 
3225 // oops, please forgive spelling error by jimm
3226   IDS_INDETERMINANT = IDS_INDETERMINATE;
3227 
3228 // IM_FRAMEBOX
3229 type
3230   PimpFrameBox = ^TimpFrameBox;
3231   TimpFrameBox = record
3232     MethodID: LongWord;
3233     imp_ContentsBox: PIBox;   // input: relative box of contents
3234     imp_FrameBox: PIBox;      // output: rel. box of encl frame
3235     imp_DrInfo: PDrawInfo;    // NB: May be nil
3236     imp_FrameFlags: LongWord;
3237   end;
3238 
3239 const
3240   FRAMEF_SPECIFY = 1 shl 0; // Make do with the dimensions of FrameBox provided.
3241 
3242 // IM_DRAW, IM_DRAWFRAME
3243 type
3244   PimpDraw = ^TimpDraw;
3245   TimpDraw = record
3246     MethodID: LongWord;
3247     imp_RPort: PRastPort;
3248     imp_Offset: record
3249       x: SmallInt;
3250       y: SmallInt;
3251     end;
3252     imp_State: LongWord;
3253     imp_DrInfo: PDrawInfo; // NB: May be nil
3254     // these parameters only valid for IM_DRAWFRAME
3255     imp_Dimensions: record
3256       Width: SmallInt;
3257       Height: SmallInt;
3258     end;
3259   end;
3260 
3261 // IM_ERASE, IM_ERASEFRAME
3262 // NOTE: This is a subset of impDraw
3263   PimpErase = ^TimpErase;
3264   TimpErase = record
3265     MethodID: LongWord;
3266     imp_RPort: PRastPort;
3267     imp_Offset: record
3268       x: SmallInt;
3269       y: SmallInt;
3270     end;
3271     // these parameters only valid for IM_ERASEFRAME
3272     imp_Dimensions: record
3273       Width: SmallInt;
3274       Height: SmallInt;
3275     end;
3276   end;
3277 
3278 // IM_HITTEST, IM_HITFRAME
3279   PimpHitTest = ^TimpHitTest;
3280   TimpHitTest = record
3281     MethodID: LongWord;
3282     imp_Point: record
3283       x: SmallInt;
3284       y: SmallInt;
3285     end;
3286     // these parameters only valid for IM_HITFRAME
3287     imp_Dimensions: record
3288       Width: SmallInt;
3289       Height: SmallInt;
3290     end;
3291   end;
3292 
3293 // The IM_DOMAINFRAME method is used to obtain the sizing requirements of an image object within a layout group.
3294 // IM_DOMAINFRAME
3295   PimpDomainFrame = ^TimpDomainFrame;
3296   TimpDomainFrame = record
3297     MethodID: LongWord;
3298     imp_DrInfo: PDrawInfo; // DrawInfo
3299     imp_RPort: PRastPort;  // RastPort to layout for
3300     imp_Which: LongInt;    // what size - min/nominal/max
3301     imp_Domain: TIBox;     // Resulting domain
3302     imp_Attrs: PTagItem;   // Additional attributes
3303   end;
3304 
3305 // Accepted vales for imp_Which.
3306 const
3307   IDOMAIN_MINIMUM = 0;
3308   IDOMAIN_NOMINAL = 1;
3309   IDOMAIN_MAXIMUM = 2;
3310 
3311 // The IM_EXTENT/IM_EXTENTFRAME method is used to ask the image what pixels or areas (at least) it will fully
3312 // overwrite in its IM_DRAW/IM_DRAWFRAME method.
3313 // See the description of gadgetclass/GM_EXTENT for more detailed information about this topic.
3314 // IM_EXTENT, IM_EXTENTFRAME
3315 type
3316   PimpExtent = ^TimpExtent;
3317   TimpExtent = record
3318     MethodID: LongWord;
3319     imp_DrInfo: PDrawInfo; // May be nil
3320     imp_RPort: PRastPort;  // NULL if masking not supported
3321     imp_Region: PRegion;   // NULL if clipping not supported
3322     imp_Action: LongWord;  // Requested operation
3323     imp_Flags: LongWord;   // Control flags, see below
3324     imp_Attrs: PTagItem;   // Additional attributes
3325     imp_State: LongWord;   // Rendering state
3326     imp_Frame: TIBox;      // Sizes only valid for IM_EXTENTFRAME
3327   end;
3328 
3329 const
3330 // Possible operations requested by IM_EXTENT/IM_EXTENTFRAME
3331   IEXTENT_REMOVE = 0; // You should CLEAR shapes from region/mask
3332   IEXTENT_ADD    = 1; // You should OR shapes into region/mask
3333   IEXTENT_INVERT = 2; // You should XOR shapes into region/mask
3334   IEXTENT_SECT   = 3; // You should AND shapes into region/mask
3335 // Control flags defined for IM_EXTENT/IM_EXTENTFRAME
3336   IMPF_ALLOWSUPER = $01; // Allow superclass to handle the method
3337 // Possible return codes for IM_EXTENT/IM_EXTENTFRAME
3338   IMR_INVALID  = $00; // Couldn't provide any information
3339   IMR_CLIPDONE = $40; // Added to the region all areas I fully cover
3340   IMR_MASKDONE = $80; // Wrote into the mask all pixels I fully cover
3341 
3342  { **  'boopsi' pointer class interface }
3343 
3344 const
3345   // The following tags are recognized at NewObject() time by pointerclass:
3346   POINTERA_Dummy = TAG_USER + $39000;
3347   POINTERA_BitMap      = POINTERA_Dummy + $01; // (PBitMap) - Pointer to bitmap to get pointer imagery from.  Bitplane data need not be in chip RAM.
3348   POINTERA_XOffset     = POINTERA_Dummy + $02; // (LongInt) - X-offset of the pointer hotspot.
3349   POINTERA_YOffset     = POINTERA_Dummy + $03; // (LongInt) - X-offset of the pointer hotspot.
3350   POINTERA_WordWidth   = POINTERA_Dummy + $04; // (LongWord) - designed width of the pointer in words
3351   POINTERA_XResolution = POINTERA_Dummy + $05; // (LongWord) - one of the POINTERXRESN_ flags below
3352   POINTERA_YResolution = POINTERA_Dummy + $06; // (LongWord) - one of the POINTERYRESN_ flags below
3353   POINTERA_ImageData   = POINTERA_Dummy + $07; // V52
3354   POINTERA_Width       = POINTERA_Dummy + $08; // V52
3355   POINTERA_Height      = POINTERA_Dummy + $09; // V52
3356 
3357 // These are the choices for the POINTERA_XResolution attribute which will determine what
3358 // resolution pixels are used for this pointer.
3359   POINTERXRESN_DEFAULT   = 0; // (ECS-compatible pointer width) = 70 ns if SUPERHIRES-type mode, 140 ns if not
3360   POINTERXRESN_140NS     = 1; // (pointer always in 140 ns pixels) = 140 ns always
3361   POINTERXRESN_70NS      = 2; // (pointer always in 70 ns pixels) = 70 ns always
3362   POINTERXRESN_35NS      = 3; // (pointer always in 35 ns pixels) = 35 ns always
3363 
3364   POINTERXRESN_SCREENRES = 4; // Same as pixel speed of screen
3365   POINTERXRESN_LORES     = 5; // (pointer always in lores-like pixels) = 140 ns in 15kHz modes, 70 ns in 31kHz modes
3366   POINTERXRESN_HIRES     = 6; // (pointer always in hires-like pixels) = 70 ns in 15kHz modes, 35 ns in 31kHz modes
3367 
3368 // These are the choices for the POINTERA_YResolution attribute which
3369 //  will determine what vertical resolution is used for this pointer.
3370   POINTERYRESN_DEFAULT          =  0; // In 15 kHz modes, the pointer resolution will be the same as a non-interlaced screen.  In 31 kHz modes, the pointer
3371                                      // will be doubled vertically.  This means there will be about 200-256 pointer lines per screen.
3372   POINTERYRESN_HIGH             =  2; // Where the hardware/software supports it, the pointer resolution will be high.  This means there will be about 400-480 pointer lines per screen.  POINTERYRESN_HIGHASPECT also means that
3373   POINTERYRESN_HIGHASPECT       =  3; //   when the pointer comes out double-height due to hardware/software restrictions, its width would be doubled as well, if possible(to preserve aspect).
3374   POINTERYRESN_SCREENRES        =  4; // Will attempt to match the vertical resolution of the pointer to the screen's vertical resolution.  POINTERYRESN_SCREENASPECT also means that when the pointer comes out double-height due to
3375   POINTERYRESN_SCREENRESASPECT  =  5; // hardware/software restrictions, its width would be doubled as well, if possible (to preserve aspect).
3376 
3377 // Pointer type definitions for WA_PointerType (OpenWindowTags() and SetWindowPointer()) (V53.37)
3378   POINTERTYPE_NORMAL                   = 0;  // the well known normal pointer
3379   POINTERTYPE_BUSY                     = 1;  // the well known busy pointer
3380   POINTERTYPE_ALIAS                    = 2;  // use when dragging an item with the intent of creating a reference to or virtual copy of it
3381   POINTERTYPE_CELL                     = 3;  // use to indicate that the pointer is hovering on top of a table cell
3382   POINTERTYPE_COLUMNRESIZE             = 4;  // use to indicate that a column can be resized or is being resized
3383   POINTERTYPE_CONTEXTMENU              = 5;  // use to indicate that a menu or context menu can be opened at the current location
3384   POINTERTYPE_COPY                     = 6;  // use to indicate that something is in a copy buffer or that a drag&drop operation will result in a copy the the dragged item
3385   POINTERTYPE_CROSS                    = 7;  // use to indicate a precise selection, i.e. a precise area is being selected or while drawing pixels in a paint program
3386   POINTERTYPE_DRAGANDDROP              = 8;  // use to indicate that an item is currently being dragged around
3387   POINTERTYPE_EASTRESIZE               = 9;  // use to indicate that the item can be resized on its left border, i.e. a resize indication at the left border of a window
3388   POINTERTYPE_EASTWESTRESIZE           = 10; // use to indicate that the selected item is currently being resized either from its left or right border, i.e. the current window is being resized in its left border
3389   POINTERTYPE_HAND                     = 11; // use to indicate that the current item is drag&droppable or moveable
3390   POINTERTYPE_HELP                     = 12; // use to indicate that there is help available for the item the pointer is hovering over
3391   POINTERTYPE_LINK                     = 13; // use to indicate that the current context will be replaced, i.e. the pointer is hovering over a hyperlink or a window tab
3392   POINTERTYPE_MENU                     = 14; // use to indicate that a menu or context menu is active
3393   POINTERTYPE_NODROP                   = 15; // use to indicate that a dragged item cannot be dropped at the current location
3394   POINTERTYPE_NONE                     = 16; // use to indicate that the pointer is deactivated
3395   POINTERTYPE_NORTHEASTRESIZE          = 17; // use to indicate that the item can be resized on its top left corner, i.e. a resize indication at the top left corner of a window
3396   POINTERTYPE_NORTHEASTSOUTHWESTRESIZE = 18; // use to indicate that the selected item is currently being resized either from its top left or bottom right corner, i.e. the current window is being resized in its top left corner
3397   POINTERTYPE_NORTHRESIZE              = 19; // use to indicate that the item can be resized on its top border, i.e. a resize indication at the top border of a window
3398   POINTERTYPE_NORTHSOUTHRESIZE         = 20; // use to indicate that the selected item is currently being resized from either its top or bottom border, i.e. the current window is being resized in its bottom border
3399   POINTERTYPE_NORTHWESTRESIZE          = 21; // use to indicate that the selected item is currently being resized from its top left corner, i.e. the current window is being resized in its top left corner
3400   POINTERTYPE_NORTHWESTSOUTHEASTRESIZE = 22; // use to indicate that the selected item is currently being resized either from its top right or bottom left corner, i.e. the current window is being resized in its top right corner
3401   POINTERTYPE_NOTALLOWED               = 23; // use to indicate that the current operation is not allowed, i.e. the pointer is hovering over a disabled button
3402   POINTERTYPE_PROGRESS                 = 24; // use to indicate that the application is doing some background work but still accepts user input, i.e. a web page is currently loading in a browser application
3403   POINTERTYPE_ROWRESIZE                = 25; // use to indicate that a row can be resized or is being resized
3404   POINTERTYPE_SCROLLALL                = 26; // use to indicate that the item can be or is being moved, i.e. a window is being moved while a hotkey for window move is pressed
3405   POINTERTYPE_SOUTHEASTRESIZE          = 27; // use to indicate that the selected item is currently being resized from its bottom right corner, i.e. the current window is being resized in its bottom right corner
3406   POINTERTYPE_SOUTHRESIZE              = 28; // use to indicate that the item can be resized on its bottom border, i.e. a resize indication at the bottom border of a window
3407   POINTERTYPE_SOUTHWESTRESIZE          = 29; // use to indicate that the selected item is currently being resized from its bottom left corner, i.e. the current window is being resized in its bottom left corner
3408   POINTERTYPE_TEXT                     = 30; // use to indicate that horizontal text can be selected at the current position
3409   POINTERTYPE_VERTICALTEXT             = 31; // use to indicate that vertical text can be selected at the current position
3410   POINTERTYPE_WESTRESIZE               = 32; // use to indicate that the item can be resized on its right border, i.e. a resize indication at the right border of a window
3411   POINTERTYPE_ZOOMIN                   = 33; // use to indicate that a left click on the current item will result in a zoom in
3412   POINTERTYPE_ZOOMOUT                  = 34; // use to indicate that a left click on the current item will result in a zoom out
3413   POINTERTYPE_PEN                      = 35; // use to indicate a drawing action
3414   POINTERTYPE_ROTATE                   = 36; // use to indicate something can be rotated at the current position
3415   POINTERTYPE_RUBBER                   = 37; // use to indicate an erasing action
3416   POINTERTYPE_SELECT                   = 38; // use to indicate that something can be marked for selection at the current position
3417   POINTERTYPE_SMUDGE                   = 39; // use to indicate that something can be smudged/smeared at the current position
3418   POINTERTYPE_COUNT                    = 40; // just a counter for the number of available standard pointers
3419 
3420 type
3421   PStringExtend = ^TStringExtend;
3422   TStringExtend = record
3423       // display specifications
3424     Font: PTextFont;                 // must be an open Font (not TextAttr)
3425     Pens: array[0..1] of Byte;       // color of text/backgroun
3426     ActivePens: array[0..1] of Byte; // colors when gadget is active
3427       // edit specifications
3428     InitialModes: LongWord; // initial mode flags, below
3429     EditHook: PHook;        // IF non-NULL, must supply WorkBuffer
3430     WorkBuffer: STRPTR;     // must be as large as StringInfo.Buffer
3431     Reserved: array[0..3] of LongWord; // set to 0
3432   end;
3433 
3434   PSGWork = ^TSGWork;
3435   TSGWork = record
3436      // set up when gadget is first activated
3437     Gadget: PGadget;         // the contestant itself
3438     StringInfo: pStringInfo; // easy access to sinfo
3439     WorkBuffer: STRPTR;      // intuition's planned result
3440     PrevBuffer: STRPTR;      // what was there before
3441     Modes: LongWord;         // current mode
3442       // modified for each input event
3443     IEvent: PInputEvent;     // actual event: do not change
3444     Code: Word;              // character code, IF one byte
3445     BufferPos: SmallInt;     // cursor position
3446     NumChars: SmallInt;
3447     Actions: LongWord;       // what Intuition will do
3448     LongInt_: LongInt;       // temp storage for LongInt
3449     GadgetInfo: PGadgetInfo;
3450     EditOp: Word;            // from constants below
3451   end;
3452 
3453 // SGWork.EditOp - These values indicate what basic type of operation the global editing hook has performed on the string before your gadget's custom
3454 // editing hook gets called.  You do not have to be concerned with the value your custom hook leaves in the EditOp field, only if you write a global editing hook.
3455 // For most of these general edit operations, you'll want to compare the BufferPos and NumChars of the StringInfo (before global editing) and SGWork (after global editing).
3456 const
3457   EO_NOOP       =  $0001; // did nothing
3458   EO_DELBACKWARD=  $0002; // deleted some chars maybe 0.
3459   EO_DELFORWARD =  $0003; // deleted some characters under and in front of the cursor
3460   EO_MOVECURSOR =  $0004; // moved the cursor
3461   EO_ENTER      =  $0005; // "enter" or "return" key, terminate
3462   EO_RESET      =  $0006; // current Intuition-style undo
3463   EO_REPLACECHAR=  $0007; // replaced one character and maybe advanced cursor
3464   EO_INSERTCHAR =  $0008; // inserted one char into string or added one at end
3465   EO_BADFORMAT  =  $0009; // didn't like the text data, e.g., Bad LongInt
3466   EO_BIGCHANGE  =  $000A; // unused by Intuition   // complete or major change to the text, e.g. new string
3467   EO_UNDO       =  $000B; // unused by Intuition   // some other style of undo
3468   EO_CLEAR      =  $000C; // clear the string
3469   EO_SPECIAL    =  $000D; // unused by Intuition   // some operation that doesn't fit into the categories here
3470 
3471   // Mode Flags definitions ONLY first group allowed as InitialModes
3472   SGM_REPLACE   =  1 shl 0; // replace mode // please initialize StringInfo with in-range value of BufferPos if you are using SGM_REPLACE mode.
3473   SGM_FIXEDFIELD = 1 shl 1; // fixed length buffer          // always set SGM_REPLACE, too
3474   SGM_NOFILTER   = 1 shl 2; // don't filter control chars
3475   // SGM_EXITHELP is new for V37, and ignored by V36:
3476   SGM_EXITHELP   = 1 shl 7; // exit with code = $5F IF HELP hit
3477   // These Mode Flags are for internal use only
3478   SGM_NOCHANGE   = 1 shl 3; // no edit changes yet
3479   SGM_NOWORKB    = 1 shl 4; // Buffer == PrevBuffer
3480   SGM_CONTROL    = 1 shl 5; // control char escape mode
3481   SGM_LONGINT    = 1 shl 6; // an intuition LongInt gadget
3482   // String Gadget Action Flags put in SGWork.Actions by EditHook
3483   SGA_USE        = $1;  // use contents of SGWork
3484   SGA_END        = $2;  // terminate gadget, code in Code field
3485   SGA_BEEP       = $4;  // flash the screen for the user
3486   SGA_REUSE      = $8;  // reuse input event
3487   SGA_REDISPLAY  = $10; // gadget visuals changed
3488   // New for V37:
3489   SGA_NEXTACTIVE = $20; // Make next possible gadget active.
3490   SGA_PREVACTIVE = $40; // Make previous possible gadget active.
idnull3491   // function id for only existing custom string gadget edit hook
3492   SGH_KEY        = 1;    // process editing keystroke
3493   SGH_CLICK      = 2;    // process mouse click cursor position
3494 
3495 const
3496  // Tags for ObtainBitMapSourceA()
3497   BMS_Dummy     = TAG_USER + $01547300;
3498   BMS_NoDiskIO  = BMS_Dummy + 1;      // Only open if already in memory
3499   BMS_DoMask    = BMS_Dummy + 2;      // Generate a mask, if possible
3500   BMS_DoOutline = BMS_Dummy + 3;      // Load outline mask, if present
3501   BMS_DoShade   = BMS_Dummy + 4;      // Load shading maps, if present
3502 
3503 // Tags for ObtainBitMapInstanceA()
3504   BMI_Dummy         = TAG_USER + $01547400;
3505   BMI_Exclusive     = BMI_Dummy + 1;  // Is this bitmap exclusive?
3506   BMI_DoLevels      = BMI_Dummy + 2;  // Generate brighter/darker variants?
3507   BMI_Offsets       = BMI_Dummy + 3;  // Packed backfill offsets
3508   BMI_LayerInfo     = BMI_Dummy + 4;  // Is this a LayerInfo backfill?
3509   BMI_ReferencePen  = BMI_Dummy + 5;  // Base pen this bitmap is associated to
3510   BMI_GradientSpec  = BMI_Dummy + 6;  // Gradient specification for backfill
3511   BMI_CacheGradient = BMI_Dummy + 7;  // Packed W:H to rasterize gradient
3512   BMI_GradientAxis  = BMI_Dummy + 8;  // Tile rasterized gradient on this axis
3513   BMI_IgnoreDomain  = BMI_Dummy + 9;  // Always use whole RastPort as domain
3514   BMI_TileLeft      = BMI_Dummy + 10; // Left offset for backfill tile (V51)
3515   BMI_TileTop       = BMI_Dummy + 11; // Top offset for backfill tile (V51)
3516   BMI_TileWidth     = BMI_Dummy + 12; // Width of backfill tile (V51)
3517   BMI_TileHeight    = BMI_Dummy + 13; // Height of backfill tile (V51)
3518 
3519 // Tags for BitMapInstanceControlA()
3520   BMICTRL_Dummy = TAG_USER + $01547600;
3521 
3522   BMICTRL_GetBitMap           = BMICTRL_Dummy + 1;  // (struct BitMap **) Get actual BitMap address.
3523   BMICTRL_GetHook             = BMICTRL_Dummy + 2;  // (struct Hook **) Get backfill hook address.
3524   BMICTRL_GetOffsets          = BMICTRL_Dummy + 3;  // (ULONG *) Get backfill offsets, packed in a single longword.
3525   BMICTRL_SetOffsets          = BMICTRL_Dummy + 4;  // (ULONG) Set backfill offsets, packed in a single longword;
3526                                                     //    this ONLY applies to instances allocated in exclusive mode.
3527   BMICTRL_GetWidth            = BMICTRL_Dummy + 5;  // (ULONG *) Get width of BitMap.
3528   BMICTRL_GetHeight           = BMICTRL_Dummy + 6;  // (ULONG *) Get height of BitMap.
3529   BMICTRL_GetBrightBitMap     = BMICTRL_Dummy + 7;  // (struct BitMap **) Get address of bright-level BitMap (if any).
3530   BMICTRL_GetHalfBrightBitMap = BMICTRL_Dummy + 8;  // (struct BitMap **) Get address of half-bright-level BitMap (if any).
3531   BMICTRL_GetHalfDarkBitMap   = BMICTRL_Dummy + 9;  // (struct BitMap **) Get address of half-dark-level BitMap (if any).
3532   BMICTRL_GetDarkBitMap       = BMICTRL_Dummy + 10; // (struct BitMap **) Get address of dark-level BitMap (if any).
3533   BMICTRL_GetMaskBitMap       = BMICTRL_Dummy + 11; // (struct BitMap **) Get address of single-plane mask bitmap (if any).
3534   BMICTRL_GetOutlineBitMap    = BMICTRL_Dummy + 12; // (struct BitMap **) Get address of single-plane outline bitmap (if any)
3535   BMICTRL_GetShineMap         = BMICTRL_Dummy + 13; // (UBYTE **) Get address of bright shading alpha map array (if any).
3536   BMICTRL_GetShadowMap        = BMICTRL_Dummy + 14; // (UBYTE **) Get address of dark shading alpha map array (if any).
3537   BMICTRL_GetAlphaMap         = BMICTRL_Dummy + 15; // (UBYTE **) Get address of alpha blending map array (if any).
3538   BMICTRL_GetShadeMaskBitMap  = BMICTRL_Dummy + 16; // (struct BitMap **) Get address of single-plane shade mask bitmap (if any).
3539   BMICTRL_GetScreen           = BMICTRL_Dummy + 17; // (struct Screen **) Get address of the reference screen (may be NULL).
3540   BMICTRL_GetBitMapSource     = BMICTRL_Dummy + 18; // (APTR *) Get address of the BitMapSource this instance was obtained from.
3541   BMICTRL_GetGradientSpec     = BMICTRL_Dummy + 19; // (GRADSPEC **) Get address of gradient specification (if any).
3542   BMICTRL_SetGradientSpec     = BMICTRL_Dummy + 20; // (GRADSPEC *) Set gradient specification; this ONLY applies to
3543                                                     //   instances allocated in exclusive mode.
3544   BMICTRL_GetReferencePen     = BMICTRL_Dummy + 21; // (ULONG *) Get reference pen index.
3545   BMICTRL_GetOutlineMap       = BMICTRL_Dummy + 22; // (UBYTE **) Get address of outline alpha map array (if any).
3546   BMICTRL_GetTileLeft         = BMICTRL_Dummy + 23; // (ULONG *) Get left offset of backfill tile. (V51)
3547   BMICTRL_GetTileTop          = BMICTRL_Dummy + 24; // (ULONG *) Get top offset of backfill tile. (V51)
3548   BMICTRL_GetTileWidth        = BMICTRL_Dummy + 25; // (ULONG *) Get width of backfill tile. (V51)
3549   BMICTRL_GetTileHeight       = BMICTRL_Dummy + 26; // (ULONG *) Get height of backfill tile. (V51)
3550   BMICTRL_GetTileBox          = BMICTRL_Dummy + 27; // (struct IBox *) Get backfill tile box in one go. (V51)
3551   BMICTRL_SetTileLeft         = BMICTRL_Dummy + 28; // (UWORD) Set left offset of backfill tile; this ONLY applies to
3552                                                     //   instances allocated in exclusive mode. (V51)
3553   BMICTRL_SetTileTop          = BMICTRL_Dummy + 29; // (UWORD) Set top offset of backfill tile; this ONLY applies to
3554                                                     //   instances allocated in exclusive mode. (V51)
3555   BMICTRL_SetTileWidth        = BMICTRL_Dummy + 30; // (UWORD) Set width of backfill tile; this ONLY applies to
3556                                                     // instances allocated in exclusive mode. (V51)
3557   BMICTRL_SetTileHeight       = BMICTRL_Dummy + 31; // (UWORD) Set height of backfill tile; this ONLY applies to
3558                                                     //   instances allocated in exclusive mode. (V51)
3559   BMICTRL_SetReferencePen     = BMICTRL_Dummy + 32; // (ULONG) Set reference pen index; this ONLY applies to
3560                                                     //   instances allocated in exclusive mode. (V51)
3561 
3562 // Useful type definitions
3563 type
3564   TBitMapSource = APTR;
3565   TBitMapInstance = APTR;
3566 
3567 // *** Common structures for simple vector drawing
3568   PVector = ^TVector;
3569   TVector = record
3570     Operation: Byte;  // Type of rendering operation
3571     Type_: Byte;      // Type of environment (monochrome/color)
3572     DRIPen: Word;     // DrawInfo pen for this rendering
3573     States: LongWord; // States this rendering applies to
3574     X, Y: SmallInt;   // Offsets for rendering
3575     Data: PWord;      // Rendering specifications
3576   end;
3577 
3578   PVectorInfo = ^TVectorInfo;
3579   TVectorInfo = record
3580    VectorID: LongWord; // To identify the image, if needed
3581    Vectors: PVector;   // VO_END-terminated array of vectors
3582    DesignWidth: Word;  // Reference width for scaling
3583    DesignHeight: Word; // Reference height for scaling
3584    Flags: LongWord;    // Additional information
3585    States: LongWord;   // Supported states
3586   end;
3587 const
3588 // Values for Vector.Operation
3589   VO_LINE = $00; // Outline only
3590   VO_FILL = $01; // Filled, not outline
3591   VO_RECT = $00; // Rectangle
3592   VO_POLY = $02; // Polygon
3593   VO_ELPS = $04; // Ellipse
3594 
3595   VO_LINERECT = VO_LINE or VO_RECT;
3596   VO_FILLRECT = VO_FILL or VO_RECT;
3597   VO_LINEPOLY = VO_LINE or VO_POLY;
3598   VO_FILLPOLY = VO_FILL or VO_POLY;
3599   VO_LINEELPS = VO_LINE or VO_ELPS;
3600   VO_FILLELPS = VO_FILL or VO_ELPS;
3601 
3602   VO_END      = $FF;  // End marker for Vector array
3603 
3604 // Values for TVector.Type
3605   VT_MONO  = $01; // Vector is used for monochrome rendering
3606   VT_COLOR = $02; // Vector is used for color rendering
3607   VT_BOTH  = $03; // Vector is used for both types of rendering
3608 
3609 // Special values for TVector.DRIPen
3610   PEN_BRIGHT      = $1000; // Bright shade of the background
3611   PEN_HALFBRIGHT  = $1001; // Half-bright shade of the background
3612   PEN_HALFDARK    = $1003; // Half-dark shade of the background
3613   PEN_DARK        = $1004; // Dark shade of the background
3614   PEN_ALPHASHINE  = $2000; // OR with 0..255 for bright alpha shading
3615   PEN_ALPHASHADOW = $3000; // OR with 0..255 for dark alpha shading
3616   PEN_ALPHA       = $4000; // OR with 0..255 for alpha blending
3617 
3618 // State flags. Sysiclass doesn't support INACTIVEDISABLED for now.
3619   IDSF_NORMAL           = 1 shl IDS_NORMAL;
3620   IDSF_SELECTED         = 1 shl IDS_SELECTED;
3621   IDSF_DISABLED         = 1 shl IDS_DISABLED;
3622   IDSF_INACTIVENORMAL   = 1 shl IDS_INACTIVENORMAL;
3623   IDSF_INACTIVESELECTED = 1 shl IDS_INACTIVESELECTED;
3624   IDSF_SELECTEDDISABLED = 1 shl IDS_SELECTEDDISABLED;
3625 
3626   IDSF_MASK             = $10000000; // Use for image mask
3627   IDSF_DISABLEDMASK     = $20000000; // Use for normal disabled mask
3628   IDSF_SELDISABLEDMASK  = $40000000; // Use for selected disabled mask
3629   IDSF_ERASEMASK        = $80000000; // Draw mask with color zero
3630 
3631 // Values for TVectorInfo.Flags
3632   VIF_WMULTIPLY      = $0000000F; // Multiplier for width = VIF_REFFONT;
3633   VIF_REFFONT        = $00000010; // Allows reference font to be specified
3634   VIF_IGNOREWIDTH    = $00000020; // Ignore IA_Width
3635   VIF_IGNOREHEIGHT   = $00000040; // Ignore IA_Height
3636   VIF_ROUNDEDSCALING = $00000100; // Needs rounded scaling
3637   VIF_KEEPASPECT     = $00000200; // Preserve aspect ratio of reference size
3638   VIF_3DDISABLE      = $00000400; // Uses 3D = embossed; disable effects
3639   VIF_NOBUFFER       = $00000800; // Render without using off-screen bitmaps
3640   VIF_PENSHADE       = $00001000; // Uses pen shading, needs a map
3641   VIF_ALPHASHINE     = $00002000; // Uses bright alpha shading, needs a map
3642   VIF_ALPHASHADOW    = $00004000; // Uses dark alpha shading, needs a map
3643   VIF_ALPHASHADE     = $00006000; // Uses both bright and dark alpha shading
3644   VIF_ALPHABLEND     = $00008000; // Uses alpha blending, needs a map
3645   VIF_BORDERMASK     = $00FF0000; // Specifications for image borders
3646   VIF_TBLEFT         = $00010000; // Image is for left side of titlebar
3647   VIF_TBRIGHT        = $00020000; // Image is for right side of titlebar
3648   VIF_VERTARROW      = $00040000; // Image is for right window border
3649   VIF_HORIZARROW     = $00080000; // Image is for bottom window border
3650   VIF_BRCORN         = $00100000; // Image is for bottom-right  window corner
3651   VIF_SCREENBAR      = $00200000; // Image is for screen titlebar
3652   VIF_MENU           = $00400000; // Image is for menu panel
3653   VIF_BUTTON         = $00800000; // Image must have a button-like  border
3654 
3655 // *** The sysiclass rendering hook interface
3656   SR_DRAW           = 801; // Render symbol imagery for this state
3657   SR_DRAWMASK       = 802; // Render symbol shape mask for this state
3658   SR_DRAWDISMASK    = 803; // Render outline mask for disabling, normal
3659   SR_DRAWSELDISMASK = 804; // Render outline mask for disabling, selected
3660   SR_DRAWLEVELMAP   = 805; // Render pen shade level map (if any)
3661   SR_DRAWSHINEMAP   = 806; // Render bright alpha shading map (if any)
3662   SR_DRAWSHADOWMAP  = 807; // Render dark alpha shading map (if any)
3663   SR_DRAWALPHAMAP   = 808; // Render alpha blending map (if any)
3664   SR_DRAWIMAGEFRAME = 809; // Render frame for this image, if any
3665 
3666 // These are the sysiclass-specific values for RenderMsg.rm_Flags
3667 
3668   SRF_MONOCHROME     = $00000001; // Render as monochrome
3669   SRF_ISBITMAP       = $00000002; // A bitmap will later be applied
3670   SRF_HSCROLLERFRAME = $00000004; // Render frame for horizontal scroller
3671   SRF_VSCROLLERFRAME = $00000008; // Render frame for vertical scroller
3672 
3673 ///** The sysiclass plugin interface
3674 // Warning: for style plugin implementors only!
3675   SC_GLOBALSTYLE      = 0;  // Default (fallback) graphic style
3676   SC_GLOBALGEOMETRY   = 1;  // Default (fallback) geometry
3677   SC_WINBORDERSTYLE   = 2;  // Style for window borders
3678   SC_WINBFRAMESTYLE   = 3;  // Style for border gadget frames
3679   SC_WINBGADSTYLE     = 4;  // Style for border gadget symbols
3680   SC_GADGETSTYLE      = 5;  // Style for generic gadget symbols
3681   SC_ARROWGSTYLE      = 6;  // Style for arrow gadget symbols
3682   SC_CYCLEGSTYLE      = 7;  // Style for cycle gadget symbols
3683   SC_KHANDLESTYLE     = 8;  // Style for knob handle symbols
3684   SC_MENUSTYLE        = 9;  // Style for menu images
3685   SC_WINBGADGEOMETRY  = 10; // Geometry for border gadgets
3686   SC_GADGETGEOMETRY   = 11; // Geometry for inner gadgets
3687 
3688 type
3689   PSubStyle = ^TSubStyle;
3690   TSubStyle = record
3691    Name: STRPTR;   // Name of the sub-style
3692    Category: Word; // Category it belongs to
3693    ID: Word;       // Unique style ID for this plugin
3694   end;
3695   PSysIPlugin = ^TSysIPlugin;
3696   TSysIPlugin = record
3697    Node: TNode;          // Reserved, don't use
3698    Version: LongWord;    // Version of the plugin
3699    Type_:LongWord;       // PLUGIN_SYSI
3700    Attrs: LongWord;      // Type-specific attributes (see below)
3701    Flags: LongWord;      // Additional information
3702    AttrList: PTagItem;   // Optional list of GUI attributes
3703    Reserved: array[0..3] of LongWord; // For future expansion
3704    RenderHook: PHook;    // Optional rendering hook
3705    VIArray: PVectorInfo; // Optional array of struct VectorInfo
3706    Reserved1: Word;      // For future expansion
3707    GeometryHook: PHook;  // Optional geometry hook (see below)
3708    SubStyles: PSubStyle; // Table of available sub-styles
3709    Reserved2: array[0..3] of LongWord; // For future expansion
3710   end;
3711 const
3712 // Plugin type
3713   PLUGIN_SYSI = 1; // Identifies a system imagery plugin
3714 // Plugin attributes (flags)
3715   SPA_WINBORDERSTYLE  = $00000004; // NOT SUPPORTED YET
3716   SPA_WINBFRAMESTYLE  = $00000008; // Plugin exports style for border gadget frames
3717   SPA_WINBGADSTYLE    = $00000010; // Plugin exports style for border gadget symbols
3718   SPA_GADGETSTYLE     = $00000020; // Plugin exports style for normal gadget symbols
3719   SPA_MENUSTYLE       = $00000200; // Plugin exports style for menu symbols
3720   SPA_WINBGADGEOMETRY = $00000400; // Plugin exports geometry for border gadgets
3721   SPA_GADGETGEOMETRY  = $00000800; // Plugin exports geometry for normal gadgets
3722 
3723 // *** The geometry hook interface
3724   SG_IMAGEBOX  = 901; // Compute box for this (sysiclass) image
3725   SG_GADGETBOX = 902; // Compute box for this gadget
3726 
3727 // Possible return values from a geometry hook
3728 
3729   GCB_OK      = 0; // Hook understands this message type
3730   GCB_UNKNOWN = 1; // Hook does not understand this message
3731 
3732 type
3733   PImageGeometryMsg = ^TImageGeometryMsg;
3734   TImageGeometryMsg = record
3735     igm_MethodID: LongWord;  // One of the SG_ definitions above
3736     igm_RastPort: PRastPort; // Reference RastPort (for the font)
3737     igm_DrawInfo: PDrawInfo; // Context information
3738     igm_ImageBox: TIBox;     // (Output) Box computed by the hook
3739     igm_RenderBox: TIBox;    // (Output) Box computed by the hook
3740     igm_Reserved: LongWord;  // Reserved for future use
3741     igm_Flags: LongWord;     // More information
3742   end;
3743 
3744 // Values for igm_Flags
3745 const
3746   IGF_WBARLEFT   = $00000001; // Image for left side of window titlebar
3747   IGF_WBARRIGHT  = $00000002; // Image for right side of window titlebar
3748   IGF_SBARLEFT   = $00000004; // Image for left side of screen titlebar
3749   IGF_SBARRIGHT  = $00000008; // Image for right side of screen titlebar
3750   IGF_VERTARROW  = $00000010; // Image for right window border
3751   IGF_HORIZARROW = $00000020; // Image for bottom window border
3752   IGF_BRCORN     = $00000040; // Image for bottom-right window corner
3753   IGF_KEEPLEFT   = $00001000; // Use the supplied igm_ImageBox.Left
3754   IGF_KEEPTOP    = $00002000; // Use the supplied igm_ImageBox.Top
3755   IGF_KEEPWIDTH  = $00004000; // Use the supplied igm_ImageBox.Width
3756   IGF_KEEPHEIGHT = $00008000; // Use the supplied igm_ImageBox.Height
3757 
3758 type
3759   PGadgetGeometryMsg = ^TGadgetGeometryMsg;
3760   TGadgetGeometryMsg = record
3761     ggm_MethodID: LongWord;  // One of the SG_ definitions above
3762     ggm_Window: PWindow;     // Reference window (may be nil)
3763     ggm_DrawInfo: PDrawInfo; // Context information
3764     ggm_BoundingBox: TIBox;  // (Output) Box computed by the hook
3765     ggm_HitBox: TIBox;       // (Output) Box computed by the hook
3766     ggm_IAddress: APTR;      // Gadget-specific data (see below)
3767     ggm_Flags: LongWord;     // More information
3768   end;
3769 
3770 // Values for ggm_Flags
3771 const
3772   GGF_INITIAL       = $00000001; // We are at OpenWindow() time
3773   GGF_CALCHSCROLLER = $00000002; // Compute scroller hit box from bounding box
3774   GGF_CALCVSCROLLER = $00000004; // Compute scroller hit box from bounding box
3775   GGF_CALCHSOVERLAP = $00000008; // Compute scroller/button overlap (in borders)
3776   GGF_CALCVSOVERLAP = $00000010; // Compute scroller/button overlap (in borders)
3777   GGF_BOUNDED       = $00000020; // Container size is passed in ggm_BoundingBox
3778 
3779 // Specific data for GTYP_TBARGADGET gadgets (pointed to by ggm_IAddress)
3780 //
3781 // The geometry hook will use this information to determine the correct position of the gadget passed as object. Both the gadgets already in
3782 // the window (or screen) and those in the separate list (which always contains at least the object itself) contribute to the calculation.
3783 // For this kind of gadgets the geometry hook shouldn't depend on the ggm_Window address, since it could be invoked in situations where no
3784 // window information is available and therefore the address is nil.
3785 // New for V51: if GGF_BOUNDED is set in ggm_Flags, your hook can read a "nominal" window size (or screen titlebar size, for GTYP_SCRGADGET
3786 // gadgets) from ggm_BoundingBox. Note that the hook is still expected to initialize ggm_BoundingBox after having read that initial information!
3787 type
3788   PTBGadgetData = ^TTBGadgetData;
3789   TTBGadgetData = record
3790    DomainGadgetList: PGadget; // Gadgets already attached to window/screen Note: this may be nil
3791    GadgetGadgetList: PGadget; // The gadget list containing the gadget we receive as object (this cannot be nil)
3792   end;
3793 
3794 
3795 const
3796   INTUITIONNAME: PChar = 'intuition.library';
3797 
3798 var
3799   IntuitionBase: PIntuitionBase;
3800   IIntuition: PInterface = nil;
3801 
3802 function IntuitionObtain(): LongWord; syscall IIntuition 60;
3803 function IntuitionRelease(): LongWord; syscall IIntuition 64;
3804 procedure IntuitionExpunge(); syscall IIntuition 68;
3805 function IntuitionClone(): PInterface; syscall IIntuition 72;
3806 procedure OpenIntuition(); syscall IIntuition 76;
3807 procedure Intuition_(iEvent: PInputEvent); syscall IIntuition 80;
3808 function AddGadget(Window: PWindow; Gadget: PGadget; Position: LongWord): LongWord; syscall IIntuition 84;
3809 function ClearDMRequest(Eindow: PWindow): LongBool; syscall IIntuition 88;
3810 procedure ClearMenuStrip(Window: PWindow); syscall IIntuition 92;
3811 procedure ClearPointer(Window:PWindow); syscall IIntuition 96;
3812 function CloseScreen(Screen: PScreen): LongBool; syscall IIntuition 100;
3813 procedure CloseWindow(Window: PWindow); syscall IIntuition 104;
3814 function CloseWorkBench: LongBool; syscall IIntuition 108;
3815 procedure CurrentTime(var Seconds: LongWord; var Micros: LongWord); syscall IIntuition 112;
3816 function DisplayAlert(AlertNumber: LongWord; const String_: STRPTR; Height: LongWord): LongBool; syscall IIntuition 116;
3817 procedure DisplayBeep(Screen: PScreen); syscall IIntuition 116;
3818 function DoubleClick(SSeconds, SMicros, CSeconds, CMicros: LongWord): LongBool; syscall IIntuition 124;
3819 procedure DrawBorder(Rp: PRastPort ;const Border: PBorder; LeftOffset, TopOffset: LongInt); syscall IIntuition 128;
3820 procedure DrawImage(Rp: PRastPort; Image: PImage; LeftOffset, TopOffset: LongInt); syscall IIntuition 132;
3821 procedure EndRequest(Requester: PRequester; Window: PWindow); syscall IIntuition 136;
3822 function GetDefPrefs(Preferences: PPreferences; Size: LongInt): PPreferences; syscall IIntuition 140;
3823 function GetPrefs(Preferences: PPreferences; Size: LongInt): PPreferences; syscall IIntuition 144;
3824 procedure InitRequester(Requester: PRequester); syscall IIntuition 148;
3825 function ItemAddress(const MenuStrip: PMenu; MenuNumber: LongWord): PMenuItem; syscall IIntuition 152;
3826 function ModifyIDCMP(Window: PWindow; Flags: LongWord): LongBool; syscall IIntuition 156;
3827 procedure ModifyProp(Gadget: PGadget; Window: PWindow; Requester: PRequester; Flags, HorizPot, VertPot, HorizBody, VertBody: LongWord); syscall IIntuition 160;
3828 procedure MoveScreen(Screen: PScreen; Dx, Dy: LongInt); syscall IIntuition 164;
3829 procedure MoveWindow(Window: PWindow; Dx, Dy: LongInt); syscall IIntuition 168;
3830 procedure OffGadget(Gadget: PGadget; Window: PWindow; Requester: PRequester); syscall IIntuition 172;
3831 procedure OffMenu(Window: PWindow; MenuNumber: LongWord); syscall IIntuition 176;
3832 procedure OnGadget(Gadget: PGadget; Window: PWindow; Requester: PRequester); syscall IIntuition 180;
3833 procedure OnMenu(Window: PWindow; MenuNumber: LongWord); syscall IIntuition 184;
3834 function OpenScreen(const NewScreen: PNewScreen): PScreen; syscall IIntuition 188;
3835 function OpenWindow(const NewWindow: PNewWindow): PWindow; syscall IIntuition 192;
3836 function OpenWorkBench: LongWord; syscall IIntuition 196;
3837 procedure PrintIText(Rp: PRastPort; const IText: PIntuiText; Left, Top: LongInt); syscall IIntuition 200;
3838 procedure RefreshGadgets(Gadgets: PGadget; Window: PWindow; Requester: PRequester); syscall IIntuition 204;
3839 function RemoveGadget(Window: PWindow; Gadget: PGadget): LongWord; syscall IIntuition 208;
3840 procedure ReportMouse(Flag: LongInt; Window: PWindow); syscall IIntuition 212;
3841 procedure ReportMouse1(Window: PWindow; Flag: LongInt); syscall IIntuition 216;
3842 function Request(Requester: PRequester; Window: PWindow): LongBool; syscall IIntuition 220;
3843 procedure ScreenToBack(Screen: PScreen); syscall IIntuition 224;
3844 procedure ScreenToFront(Screen: PScreen); syscall IIntuition 228;
3845 function SetDMRequest(Window: PWindow; Requester: PRequester): LongBool; syscall IIntuition 232;
3846 function SetMenuStrip(Window: PWindow; Menu: PMenu): LongBool; syscall IIntuition 236;
3847 procedure SetPointer(Window: PWindow; Pointer_: PWord; Height, Width, XOffset, yOffset: LongInt); syscall IIntuition 240;
3848 procedure SetWindowTitles(Window: PWindow; const WindowTitle: STRPTR; const ScreenTitle: STRPTR); syscall IIntuition 244;
3849 procedure ShowTitle(Screen: PScreen; ShowIt: LongInt); syscall IIntuition 248;
3850 procedure SizeWindow(Window: PWindow; Dx, Dy: LongInt); syscall IIntuition 252;
3851 function ViewAddress: PView; syscall IIntuition 256;
3852 function ViewPortAddress(const Window: PWindow): PViewPort; syscall IIntuition 260;
3853 procedure WindowToBack(Window: PWindow); syscall IIntuition 264;
3854 procedure WindowToFront(Window: PWindow); syscall IIntuition 268;
3855 function WindowLimits(Window: PWindow; WidthMin, HeightMin: LongInt; WidthMax, HeightMax: LongWord): LongBool; syscall IIntuition 272;
3856 function SetPrefs(const Preferences: PPreferences; Size: LongInt; Inform: LongInt): PPreferences; syscall IIntuition 276;
3857 function IntuiTextLength(const IText: PIntuiText): LongInt; syscall IIntuition 280;
3858 function WBenchToBack: LongBool; syscall IIntuition 284;
3859 function WBenchToFront: LongBool; syscall IIntuition 288;
3860 function AutoRequest(Window: PWindow; const Body: PIntuiText; const PosText: PIntuiText; const NegText: PIntuiText; PFlag, nFlag: LongWord; Width, Height: LongWord): LongBool; syscall IIntuition 292;
3861 procedure BeginRefresh(Window: PWindow); syscall IIntuition 296;
3862 function BuildSysRequest(Window: PWindow; const Body: PIntuiText; const PosText: PIntuiText; const NegText: PIntuiText; Flags: LongWord; Width, Height: LongWord): PWindow; syscall IIntuition 300;
3863 procedure EndRefresh(Window: PWindow; Complete: LongBool); syscall IIntuition 304;
3864 procedure FreeSysRequest(Window: PWindow); syscall IIntuition 308;
3865 function MakeScreen(Screen: PScreen): LongInt; syscall IIntuition 312;
3866 function RemakeDisplay: LongInt; syscall IIntuition 316;
3867 function RethinkDisplay: LongInt; syscall IIntuition 320;
3868 function AllocRemember(var RememberKey: PRemember; Size: LongWord; Flags: LongWord): APTR syscall IIntuition 324;
3869 procedure AlohaWorkbench(WBPort: LongInt); syscall IIntuition 328;
3870 procedure FreeRemember(var RememberKey: PRemember; ReallyForget: LongInt); syscall IIntuition 332;
3871 function LockIBase(DontKnow: LongWord): LongWord; syscall IIntuition 336;
3872 procedure UnlockIBase(IBLock: LongWord); syscall IIntuition 340;
3873 function GetScreenData(Buffer: APTR; Size, Type_: LongWord; const Screen: PScreen): LongBool; syscall IIntuition 344;
3874 procedure RefreshGList(Gadgets: PGadget; Window: PWindow; Requester: PRequester; NumGad: LongWord); syscall IIntuition 348;
3875 function AddGList(Window: PWindow; Gadget: PGadget; Position: LongWord; NumGad: LongInt; Requester: PRequester): LongWord; syscall IIntuition 352;
3876 function RemoveGList(RemPtr: PWindow; Gadget: PGadget; NumGad: LongInt): LongWord; syscall IIntuition 356;
3877 procedure ActivateWindow(Window: PWindow); syscall IIntuition 360;
3878 procedure RefreshWindowFrame(Window: PWindow); syscall IIntuition 364;
3879 function ActivateGadget(Gadgets: PGadget; Window: PWindow; Requester: PRequester): LongBool syscall IIntuition 368;
3880 procedure NewModifyProp(Gadget: PGadget; Window: PWindow; Requester: PRequester; Flags, HorizPot, VertPot, HorizBody, VertBody: LongWord; NumGad: LongInt); syscall IIntuition 372;
3881 function QueryOverscan(DisplayID: LongWord; Rect: PRectangle; OScanType: LongInt): LongInt; syscall IIntuition 376;
3882 procedure MoveWindowInFrontOf(Window: PWindow; BehindWindow: PWindow); syscall IIntuition 380;
3883 procedure ChangeWindowBox(Window: PWindow; Left, Top, Width, Height: LongInt); syscall IIntuition 384;
3884 function SetEditHook(Hook: PHook): PHook; syscall IIntuition 388;
3885 function SetMouseQueue(Window: PWindow; QueueLength: LongWord): LongInt; syscall IIntuition 392;
3886 procedure ZipWindow(Window: PWindow); syscall IIntuition 396;
3887 function LockPubScreen(const Name: STRPTR): PScreen; syscall IIntuition 400;
3888 procedure UnlockPubScreen(const Name: STRPTR; Screen: PScreen); syscall IIntuition 404;
3889 function LockPubScreenList: PList; syscall IIntuition 408;
3890 procedure UnlockPubScreenList; syscall IIntuition 412;
3891 function NextPubScreen(const Screen: PScreen; NameBuf: STRPTR): STRPTR; syscall IIntuition 416;
3892 procedure SetDefaultPubScreen(const Name: STRPTR); syscall IIntuition 420;
3893 function SetPubScreenModes(Modes: LongWord): LongWord; syscall IIntuition 424;
3894 function PubScreenStatus(Screen: PScreen; StatusFlags: LongWord): LongWord; syscall IIntuition 428;
3895 function ObtainGIRPort(GInfo: PGadgetInfo): PRastPort; syscall IIntuition 432;
3896 procedure ReleaseGIRPort(Rp: PRastPort); syscall IIntuition 436;
3897 procedure GadgetMouse(Gadget: PGadget; GInfo: PGadgetInfo; MousePoint: PSmallInt); syscall IIntuition 440;
3898 function SetIPrefs(Ptr: APTR; Size, Type_: LongInt): APTR; syscall IIntuition 444;
3899 procedure GetDefaultPubScreen(NameBuffer: STRPTR); syscall IIntuition 448;
3900 function EasyRequestArgs(Window: PWindow; const EasyStruct: PEasyStruct; IDCMPPtr: PLongWord; const Args: APTR): LongInt; syscall IIntuition 452;
3901 // 456 EasyRequest
3902 function BuildEasyRequestArgs(Window: PWindow; const EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: APTR): PWindow; syscall IIntuition 460;
3903 // 464 BuildEasyRequest
3904 function SysReqHandler(Window: PWindow; IDCMPPtr: PLongWord; WaitInput: LongInt): LongInt; syscall IIntuition 468;
3905 function OpenWindowTagList(const NewWindow: PNewWindow; const TagList: PTagItem): PWindow; syscall IIntuition 472;
3906 // 476 OpenWindowTags
3907 function OpenScreenTagList(const NewScreen: PNewScreen; const TagList: PTagItem): PScreen; syscall IIntuition 480;
3908 // 484 OpenScreenTags
3909 procedure DrawImageState(Rp: PRastPort; Image: PImage; LeftOffset, TopOffset: LongInt; State: LongWord; const DrawInfo: PDrawInfo); syscall IIntuition 488;
3910 function PointInImage(Point: LongWord; Image: PImage): LongBool; syscall IIntuition 492;
3911 procedure EraseImage(Rp: PRastPort; Image: PImage; LeftOffset, TopOffset: LongInt); syscall IIntuition 496;
3912 function NewObjectA(ClassPtr: PIClass; const ClassID: ClassID; const TagList: PTagItem): PObject_; syscall IIntuition 500;
3913 // 504 NewObject
3914 procedure DisposeObject(Obj: PObject_); syscall IIntuition 508;
3915 function SetAttrsA(obj: PObject_; const TagList: PTagItem): LongWord; syscall IIntuition 512;
3916 // 516 SetAttrs
3917 function GetAttr(AttrID: LongWord; obj: PObject_; StoragePtr: PLongWord): LongWord; overload; syscall IIntuition 520;
3918 function GetAttr(AttrID: LongWord; obj: PObject_; var Storage: LongWord): LongWord; overload; syscall IIntuition 520;
3919 function SetGadgetAttrsA(Gadget: PGadget; Window: PWindow; Requester: PRequester; const TagList: PTagItem): LongWord; syscall IIntuition 524;
3920 // 528 SetGadgetAttrs
3921 function NextObject(ObjectPtrPtr: PPObject_): PObject_; syscall IIntuition 532;
3922 function FindClass(ClassID: ClassID): PIClass; syscall IIntuition 536;
3923 function MakeClass(const ClassID: ClassID; const SuperClassID: ClassID; const SuperClassPtr: PIClass; InstanceSize: LongWord; Flags: LongWord): PIClass; syscall IIntuition 540;
3924 procedure AddClass(ClassPtr: PIClass); syscall IIntuition 544;
3925 function GetScreenDrawInfo(Screen: PScreen): PDrawInfo; syscall IIntuition 548;
3926 procedure FreeScreenDrawInfo(Screen: PScreen; DrawInfo: PDrawInfo); syscall IIntuition 552;
3927 function ResetMenuStrip(Window: PWindow; Menu: PMenu): LongBool; syscall IIntuition 556;
3928 procedure RemoveClass(ClassPtr: PIClass); syscall IIntuition 560;
3929 function FreeClass(ClassPtr: PIClass): LongBool; syscall IIntuition 564;
3930 function LockClassList(): PList; syscall IIntuition 568;
3931 procedure UnlockClassList(); syscall IIntuition 572;
3932 // 576-596 reserved
3933 function AllocScreenBuffer(Sc: PScreen; Bm: PBitMap; Flags: LongWord): PScreenBuffer; syscall IIntuition 600;
3934 procedure FreeScreenBuffer(Sc: PScreen; Sb: PScreenBuffer); syscall IIntuition 604;
3935 function ChangeScreenBuffer(Sc: PScreen; Sb: PScreenBuffer): LongWord; syscall IIntuition 608;
3936 procedure ScreenDepth(Screen: PScreen; Flags: LongWord; Reserved: APTR); syscall IIntuition 612;
3937 procedure ScreenPosition(Screen: PScreen; Flags: LongWord; X1, Y1, X2, Y2: LongInt); syscall IIntuition 616;
3938 procedure ScrollWindowRaster(Win: PWindow; Dx, Dy, XMin, YMin, XMax, YMax: LongInt); syscall IIntuition 620;
3939 procedure LendMenus(FromWindow: PWindow; ToWindow: PWindow); syscall IIntuition 624;
3940 function DoGadgetMethodA(Gad: PGadget; Win: PWindow; Req: PRequester; Message_: TMsg): LongWord; syscall IIntuition 628;
3941 // 632 DoGadgetMethod
3942 procedure SetWindowPointerA(Win: PWindow; const Taglist: PTagItem); syscall IIntuition 636;
3943 // 640 SetWindowPointer
3944 function TimedDisplayAlert(AlertNumber: LongWord; const String_: STRPTR; Height: LongWord; Time: LongWord): LongBool; syscall IIntuition 644;
3945 procedure HelpControl(Win: PWindow; Flags: LongWord); syscall IIntuition 648;
3946 function ShowWindow(Window: PWindow; Other: PWindow): LongBool; syscall IIntuition 652;
3947 function HideWindow(Window: PWindow): LongBool; syscall IIntuition 656;
3948 function GetAttrsA(Object_: PObject_; TagList: PTagItem): LongWord; syscall IIntuition 660;
3949 // 664 GetAttrs
3950 function LockGUIPrefs(Reserved: LongWord): APTR; syscall IIntuition 668;
3951 procedure UnlockGUIPrefs(Lock: APTR); syscall IIntuition 672;
3952 function SetGUIAttrsA(Reserved: APTR; DrawInfo: PDrawInfo; TagList: PTagItem): LongWord; syscall IIntuition 676;
3953 // 680 SetGUIAttrs
3954 function GetGUIAttrsA(Reserved: APTR; DrawInfo: PDrawInfo; TagList: PTagItem): LongWord; syscall IIntuition 684;
3955 // 684 GetGUIAttrs
3956 function GetHalfPens(DrawInfo: PDrawInfo; BasePen: LongWord; HalfShinePtr: PWord; HalfShadowPtr: PWord): LongWord; syscall IIntuition 692;
3957 function GadgetBox(Gadget: PGadget; Domain: APTR; DomainType, Flags: LongWord; Box: APTR): LongWord; syscall IIntuition 696;
3958 procedure RefreshSetGadgetAttrsA(Gadget: PGadget; Window: PWindow; Requester: PRequester; TagList: PTagItem); syscall IIntuition 700;
3959 // 704 RefreshSetGadgetAttrs
3960 function IDoSuperMethodA(Cl: PIClass; Object_: PObject_; Msg: TMsg): LongWord; syscall IIntuition 708;
3961 // 712 IDoSuperMethod
3962 function ISetSuperAttrsA(Cl: PIClass; Object_: PObject_; TagList: PTagItem): LongWord; syscall IIntuition 716;
3963 // 720 ISetSuperAttrs
3964 function ICoerceMethodA(Cl: PIClass; Object_: PObject_; Msg: TMsg): LongWord; syscall IIntuition 724;
3965 // 728 ICoerceMethod
3966 function IDoMethodA(Object_: PObject_; Msg: TMsg): LongWord; syscall IIntuition 732;
3967 // 736 IDoMethod
3968 function OpenClass(const Name: STRPTR; Version: LongWord; var ClassPtr: PIClass): LongWord; syscall IIntuition 740;
3969 procedure CloseClass(Cl: PIClass); syscall IIntuition 744;
3970 function SetDisplayBeepHook(Hook: PHook): PHook; syscall IIntuition 748;
3971 function LockScreen(Screen: PScreen; Micros: LongWord): LongBool; syscall IIntuition 752;
3972 procedure UnlockScreen(Screen: PScreen); syscall IIntuition 756;
3973 function GetWindowAttrsA(Win: PWindow; TagList: PTagItem): LongInt; syscall IIntuition 760;
3974 // 764 GetWindowAttrs
3975 function SetWindowAttrsA(Win: PWindow; TagList: PTagItem): LongInt; syscall IIntuition 768;
3976 // 772 SetWindowAttrs
3977 function GetWindowAttr(Win: PWindow; Attr: LongWord; Data: APTR; Size: LongWord): LongInt; syscall IIntuition 776;
3978 function SetWindowAttr(Win: PWindow; Attr: LongWord; Data: APTR; Size: LongWord): LongInt; syscall IIntuition 780;
3979 procedure StripIntuiMessages(Port: PMsgPort; Win: PWindow); syscall IIntuition 784;
3980 // 788 Reserved
3981 // 792 Reserved
3982 function GetScreenAttrsA(Screen: PScreen; TagList: PTagItem): LongInt; syscall IIntuition 796;
3983 // 800 GetScreenAttrs
3984 function SetScreenAttrsA(Screen: PScreen; TagList: PTagItem): LongInt; syscall IIntuition 804;
3985 // 808 SetScreenAttrs
3986 function GetScreenAttr(Screen: PScreen; Attr: LongWord; Data: APTR; Size: LongWord): LongInt; syscall IIntuition 812;
3987 function SetScreenAttr(Screen: PScreen; Attr: LongWord; Data: APTR; Size: LongWord): LongInt; syscall IIntuition 816;
3988 function LockScreenList(): PScreen; syscall IIntuition 820;
3989 procedure UnlockScreenList(); syscall IIntuition 824;
3990 function LockScreenGI(gi: PGadgetInfo; Micros: LongWord): PScreen; syscall IIntuition 828;
3991 procedure UnlockScreenGI(gi: PGadgetInfo; Rp: PRastPort); syscall IIntuition 832;
3992 function GetMarkedBlock(Sgw: PSGWork): LongWord; syscall IIntuition 836;
3993 procedure SetMarkedBlock(Sgw: PSGWork; Block: LongWord); syscall IIntuition 840;
3994 function ObtainBitMapSourceA(const Name: STRPTR; TagList: PTagItem): APTR; syscall IIntuition 844;
3995 // 848 ObtainBitMapSource
3996 procedure ReleaseBitMapSource(BitmapSource: APTR); syscall IIntuition 852;
3997 function ObtainBitMapInstanceA(BitmapSource: APTR; Screen: PScreen; TagList: PTagItem): APTR; syscall IIntuition 856;
3998 // 860 ObtainBitMapInstance
3999 procedure ReleaseBitMapInstance(BitmapInstance: APTR); syscall IIntuition 864;
4000 procedure EmbossDisableRect(Rp: PRastPort; MinX, MinY, MaxX, MaxY: LongInt; BackType, Contrast: LongWord; Dri: PDrawInfo); syscall IIntuition 868;
4001 procedure EmbossDisableText(Rp: PRastPort; const Text: STRPTR; Len, BackType, Contrast: LongWord; Dri: PDrawInfo); syscall IIntuition 872;
4002 procedure PrintEmbossedDisabledIText(Rp: PRastPort; IText: PIntuiText; Left, Top: LongInt; BackType, Contrast: LongWord; Dri: PDrawInfo); syscall IIntuition 876;
4003 function IntuiTextExtent(Rp: PRastPort; IText: PIntuiText; TextExtent: PTextExtent): LongWord; syscall IIntuition 880;
4004 function ShadeRectOld(Rp: PRastPort; MinX, MinY, MaxX, MaxY: LongInt; ShadeLevel, BackType, State: LongWord; Dri: PDrawInfo): LongWord; syscall IIntuition 884;
4005 procedure DisableTemplateRGB(Rp: PRastPort; Left, Top, Width, Height: LongInt; TemplatePtr: TPlanePtr; BrightLevel, DarkLevel: LongWord); syscall IIntuition 888;
4006 function SetScreenBitMapInstance(Scr: PScreen; ID: LongWord; Source: APTR): LongWord; syscall IIntuition 892;
4007 function FindMenuKey(Menu: PMenu; Code: LongInt): LongWord; syscall IIntuition 896;
4008 function BitMapInstanceControlA(BitmapInstance: APTR; TagList: PTagItem): LongWord; syscall IIntuition 900;
4009 // 904 BitMapInstanceControl
4010 function ObtainIPluginList(Type_, AttrMask, ApplyMask: LongWord): PList; syscall IIntuition 908;
4011 procedure ReleaseIPluginList(List: PList); syscall IIntuition 912;
4012 function OpenGUIPlugin(Name: STRPTR; Version, Type_, AttrMask, ApplyMask: LongWord): PGUIPlugin; syscall IIntuition 916;
4013 procedure CloseGUIPlugin(Plugin: PGUIPlugin); syscall IIntuition 920;
4014 function DrawSysImageA(Rp: PRastPort; Left, Top, Width, Height: LongInt; Which, BackType, State: LongWord; Dri: PDrawInfo; TagList: PTagItem): LongWord; syscall IIntuition 924;
4015 // 928 DrawSysImage
4016 function DoRender(O: PObject_; Gi: PGadgetInfo; Flags: LongWord): LongWord; syscall IIntuition 932;
4017 function SetRenderDomain(Rp: PRastPort; Domain: PRectangle): LongWord; syscall IIntuition 936;
4018 function GetRenderDomain(Rp: PRastPort; Domain: PRectangle): LongWord; syscall IIntuition 940;
4019 function DrawGradient(Rp: PRastPort; Left, Top, Width, Height: LongInt; Domain: PIBox; Reserved: LongWord; GradientSpec: PGradientSpec; Dri: PDrawInfo): LongWord; syscall IIntuition 944;
4020 function DirectionVector(Degrees: LongWord): LongWord; syscall IIntuition 948;
4021 function ShadeRectA(Rp: PRastPort; MinX, MinY, MaxX, MaxY: LongInt; ShadeLevel, BackType, State: LongWord; Dri: PDrawInfo; TagList: PTagItem): LongWord; syscall IIntuition 952;
4022 // 956 ShadeRect
4023 procedure DoScrollHook(ScrollHook: PScrollHook; ScrollMode: LongInt); syscall IIntuition 960;
4024 function ObtainIBackFill(Dri: PDrawInfo; Element, State, Flags: LongWord): PHook; syscall IIntuition 964;
4025 procedure ReleaseIBackFill(Hook: PHook); syscall IIntuition 968;
4026 function IntuitionControlA(Object_: APTR; TagList: PTagItem): LongWord; syscall IIntuition 972;
4027 // 976 IntuitionControl
4028 function StartScreenNotifyTagList(TagList: PTagItem): APTR; syscall IIntuition 980;
4029 // 984 StartScreenNotifyTags
4030 function EndScreenNotify(Request: APTR): LongBool; syscall IIntuition 988;
4031 procedure DisableTemplate(Rp: PRastPort; Left, Top, Width, Height: LongInt; TemplatePtr: APTR; OffX, OffY: LongInt; TemplateType, BytesPerRow, BackType: LongWord; Dri: PDrawInfo); syscall IIntuition 992;
4032 
4033 function OpenScreenTags(newScreen: PNewScreen; const TagList: array of PtrUInt): PScreen;
4034 function OpenWindowTags(newWindow: PNewWindow; const TagList: array of PtrUInt): PWindow;
4035 function NewObject(ClassPtr: PIClass; ClassID: PChar; const argv: array of PtrUInt): Pointer;
4036 function SetAttrs(obj: Pointer; const Tags: array of PtrUInt): LongWord;
4037 function SetGadgetAttrs(gadget: PGadget; Window: PWindow; Requester: PRequester; const argv: array of PtrUInt): LongWord;
4038 function EasyRequest(Window: PWindow; const EasyStruct: PEasyStruct; IDCMPPtr: PLongWord; const args: array of PtrUInt): LongInt;
4039 procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt);
4040 function DoMethodA(Obj: PObject_; Message: APTR): LongWord;
4041 function DoMethod(Obj: PObject_; const Args: array of PtrUInt): LongWord;
4042 function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): LongWord;
4043 function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): LongWord;
4044 function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): LongWord;
4045 function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): LongWord;
4046 
4047 
4048 { Intuition macros }
4049 function INST_DATA (cl: PIClass; o: P_Object): Pointer;
4050 function SIZEOF_INSTANCE (cl: PIClass): LongInt;
4051 function BASEOBJECT (o: P_Object): Pointer;
4052 function _OBJ(o: P_Object): P_Object; inline;
4053 function __OBJECT(o: Pointer): P_Object; inline;
4054 function OCLASS(o: Pointer): PIClass; inline;
4055 function SHIFTITEM(n: SmallInt): Word;
4056 function SHIFTMENU(n: SmallInt): Word;
4057 function SHIFTSUB(n: SmallInt): Word;
4058 function FULLMENUNUM (menu, item, sub: SmallInt): Word;
4059 function IM_BGPEN(im: PImage): Byte;
4060 function IM_BOX(im: PImage): PIBox;
4061 function IM_FGPEN(im: PImage): Byte;
4062 function GADGET_BOX(g: PGadget): PIBox;
4063 function CUSTOM_HOOK(gadget: PGadget): PHook;
4064 function ITEMNUM(n: Word): Word;
4065 function MENUNUM(n: Word): Word;
4066 function SUBNUM(n: Word): Word;
4067 
4068 IMPLEMENTATION
4069 
4070 function OpenScreenTags(NewScreen: PNewScreen; const TagList: array of PtrUInt): PScreen;
4071 begin
4072   OpenScreenTags := OpenScreenTagList(NewScreen, @TagList);
4073 end;
4074 
4075 function OpenWindowTags(NewWindow: PNewWindow; const TagList: array of PtrUInt): PWindow;
4076 begin
4077   OpenWindowTags := OpenWindowTagList(NewWindow, @TagList);
4078 end;
4079 
4080 function NewObject(ClassPtr: PIClass; ClassID: PChar; const argv: array of PtrUInt): Pointer;
4081 begin
4082   NewObject := NewObjectA(ClassPtr, ClassID, @argv);
4083 end;
4084 
4085 function SetAttrs(Obj: Pointer; const Tags: array of PtrUInt): LongWord;
4086 begin
4087   SetAttrs := SetAttrsA(Obj, @Tags);
4088 end;
4089 
4090 function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const argv: array of PtrUInt): LongWord;
4091 begin
4092   SetGadgetAttrs := SetGadgetAttrsA(Gadget, Window, Requester, @argv);
4093 end;
4094 
4095 function EasyRequest(Window: PWindow; const EasyStruct: PEasyStruct; IDCMPPtr: PLongWord; const args: array of PtrUInt): LongInt;
4096 begin
4097   EasyRequest := EasyRequestArgs(Window, Easystruct, IDCMPPtr, @args);
4098 end;
4099 
4100 procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt);
4101 begin
4102   SetWindowPointerA(Win, @Tags);
4103 end;
4104 
4105 // Functions wrapper
4106 
4107 function DoMethodA(Obj: PObject_; Message: APTR): LongWord; inline;
4108 begin
4109   DoMethodA := 0;
4110   if Obj = nil then
4111     Exit;
4112   DoMethodA := CallHookPkt(PHook(OCLASS(Obj)), Obj, Message);
4113 end;
4114 
4115 function DoMethod(Obj: PObject_; const Args: array of PtrUInt): LongWord; inline;
4116 begin
4117   DoMethod := 0;
4118   if obj = nil then
4119     Exit;
4120   DoMethod := CallHookPkt(PHook(OCLASS(Obj)), Obj, @Args);
4121 end;
4122 
4123 function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): LongWord; inline;
4124 begin
4125   DoSuperMethodA := 0;
4126   if (cl = nil) or (obj = nil) then
4127     Exit;
4128   DoSuperMethodA := CallHookPkt(PHook(cl^.cl_Super), Obj, Message);
4129 end;
4130 
4131 function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): LongWord; inline;
4132 begin
4133   DoSuperMethod := 0;
4134   if (cl = nil) or (obj = nil) then
4135     Exit;
4136   DoSuperMethod := CallHookPkt(PHook(cl^.cl_Super), Obj, @Args);
4137 end;
4138 
4139 function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): LongWord; inline;
4140 begin
4141   CoerceMethodA := 0;
4142   if (cl = nil) or (obj = nil) then
4143     Exit;
4144   CoerceMethodA := CallHookPkt(PHook(cl), Obj, Message);
4145 end;
4146 
4147 function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): LongWord; inline;
4148 begin
4149   CoerceMethod := CoerceMethodA(cl, Obj, @Args);
4150 end;
4151 
4152 function INST_DATA(cl: PIClass; o: P_Object): Pointer; inline;
4153 begin
4154   INST_DATA := Pointer(PtrUInt(o) + cl^.cl_InstOffset);
4155 end;
4156 
4157 function SIZEOF_INSTANCE(cl: PIClass): LongInt; inline;
4158 begin
4159   SIZEOF_INSTANCE := cl^.cl_InstOffset + cl^.cl_InstSize + SizeOf(T_Object);
4160 end;
4161 
4162 function BASEOBJECT(o: P_Object): Pointer; inline;
4163 begin
4164   BASEOBJECT := Pointer(PtrUInt(o) + SizeOf(T_Object));
4165 end;
4166 
4167 function _OBJ(o: P_Object): P_Object; inline;
4168 begin
4169    _OBJ := P_Object(o);
4170 end;
4171 
4172 function __OBJECT(o: Pointer): P_Object; inline;
4173 begin
4174   __OBJECT := P_Object(PtrUInt(PtrUInt(o) - SizeOf(T_Object)));
4175 end;
4176 
4177 function OCLASS (o: Pointer): PIClass; inline;
4178 begin
4179   OCLASS := P_Object(o - SizeOf(T_Object))^.o_Class;
4180 end;
4181 
4182 function SHIFTITEM (n: SmallInt): word; inline;
4183 begin
4184   SHIFTITEM := (n and $3f) shl 5
4185 end;
4186 
4187 function SHIFTMENU (n: SmallInt): word; inline;
4188 begin
4189   SHIFTMENU := n and $1f
4190 end;
4191 
4192 function SHIFTSUB (n: SmallInt): word; inline;
4193 begin
4194   SHIFTSUB := (n and $1f) shl 11
4195 end;
4196 
4197 function FULLMENUNUM (menu, item, sub: smallint): word; inline;
4198 begin
4199   FULLMENUNUM := ((sub and $1f) shl 11) or ((item and $3f) shl 5) or (menu and $1f)
4200 end;
4201 
4202 
4203 
4204 { The next functons _BGPEN AND _FGPEN aren't a full replacement of the
4205   C macros because the C preprocessor makes it possible to set the
4206   A/BPen values of the image class objects as well. This can't work
4207   in pascal, of course! }
4208 
4209 function IM_BGPEN (im: PImage): byte; inline;
4210 begin
4211   IM_BGPEN := im^.PlaneOnOff;
4212 end;
4213 
4214 function IM_BOX (im: PImage): pIBox; inline;
4215 begin
4216   IM_BOX := pIBox(@im^.LeftEdge);
4217 end;
4218 
4219 function IM_FGPEN(im: PImage): byte; inline;
4220 begin
4221   IM_FGPEN := im^.PlanePick;
4222 end;
4223 
4224 function GADGET_BOX(g: PGadget): pIBox; inline;
4225 begin
4226   GADGET_BOX := pIBox(@g^.LeftEdge);
4227 end;
4228 
4229 function CUSTOM_HOOK(gadget: PGadget): pHook; inline;
4230 begin
4231   CUSTOM_HOOK := pHook(gadget^.MutualExclude);
4232 end;
4233 
4234 function ITEMNUM(n: Word): Word; inline;
4235 begin
4236   ITEMNUM := (n shr 5) and $3F
4237 end;
4238 
4239 function MENUNUM(n: Word): Word; inline;
4240 begin
4241   MENUNUM := n and $1f
4242 end;
4243 
4244 function SUBNUM(n: Word): Word; inline;
4245 begin
4246   SUBNUM := (n shr 11) and $1f
4247 end;
4248 
4249 
4250 const
4251   // Change VERSION to proper values
4252   LIBVERSION: LongWord = 0;
4253 
4254 initialization
4255   IntuitionBase := PIntuitionBase(OpenLibrary(INTUITIONNAME, LIBVERSION));
4256   if Assigned(IntuitionBase) then
4257     IIntuition := GetInterface(PLibrary(IntuitionBase), 'main', 1, nil);
4258 finalization
4259   if Assigned(IIntuition) then
4260     DropInterface(IIntuition);
4261   if Assigned(IntuitionBase) then
4262     CloseLibrary(PLibrary(IntuitionBase));
4263 end.
4264 
4265 
4266 
4267 
4268 
4269 
4270 
4271 
4272 
4273 
4274 
4275 
4276 
4277 
4278 
4279 
4280 
4281 
4282