DEFINITION MODULE Workbench; (** ------------------------------------------------------------------ Commodore Amiga Workbench module (c) Copyright 1986 Modula-2 Software Ltd. All Rights Reserved (c) Copyright 1986 TDI Software, Inc. All Rights Reserved ------------------------------------------------------------------ **) (* VERSION FOR COMMODORE AMIGA Original Author : Paul Curtis, Modula-2 Software Ltd. 24-Jan-86 Version : 0.02b 30-Jun-87 Martin Fisher, Modula-2 Software Ltd Corrected WBObjectType; 0.02a 02-Dec-86 Martin Fisher, Modula-2 Software Ltd. Upgraded to V1.2 Intuition. 0.01a 27-May-86 Paul Curtis Modula-2 Software Ltd. Upgraded to V1.1 Intuition. 0.00a 24-Jan-86 Paul Curtis, Modula-2 Software Ltd. Original *) FROM SYSTEM IMPORT ADDRESS; FROM Nodes IMPORT Node; FROM Lists IMPORT List; FROM Ports IMPORT Message, MsgPortPtr; FROM Intuition IMPORT Gadget, NewWindow, Image, PropInfo, WindowPtr; FROM DOSFiles IMPORT FileLock; TYPE WBArgPtr = POINTER TO WBArg; WBArg = RECORD waLock: FileLock; (* a lock descriptor *) waName: POINTER TO ARRAY [0..32767] OF CHAR; (* a string relative to that lock *) END; TYPE WBStartup = RECORD smMessage: Message; (* a standard message structure *) smProcess: MsgPortPtr; (* the process descriptor for us *) smSegment: ADDRESS; (* a descriptor for your code, BPTR *) smNumArgs: LONGINT; (* nr. elements in ArgList *) smToolWindow: POINTER TO ARRAY [0..32767] OF CHAR; (* description of window *) smArgList: WBArgPtr; (* the arguments themselves *) END; TYPE WBObjectType = (WB0, WBDisk, WBDrawer, WBTool, WBProject, WBGarbage, WBDevice, WBKick); TYPE WBObjectPtr = POINTER TO WBObject; TYPE (* only ddNewWindow, ddCurrentX, ddCurrentY written to disk. *) DrawerDataPtr = POINTER TO DrawerData; DrawerData = RECORD ddNewWindow: NewWindow; (* args to open window *) ddCurrentX: LONGINT; (* current x coordinate of origin *) ddCurrentY: LONGINT; (* current y coordinate of origin *) ddMinX: LONGINT; (* smallest x coordinate in window *) ddMinY: LONGINT; (* smallest y coordinate in window *) ddMaxX: LONGINT; (* largest x coordinate in window *) ddMaxY: LONGINT; (* latgest y coordinate in window *) ddHorizScroll: Gadget; ddVertScroll: Gadget; ddUpMove: Gadget; ddDownMove: Gadget; ddLeftMove: Gadget; ddRightMove: Gadget; ddHorizImage: Image; ddVertImage: Image; ddHorizProp: PropInfo; ddVertProp: PropInfo; ddDrawerWin: WindowPtr; (* pointer to drawers window *) ddObject: WBObjectPtr; (* back pointer to drawer object *) ddChildren: List; (* where our children hang out *) ddLock: FileLock; END; TYPE DiskObjectPtr = POINTER TO DiskObject; DiskObject = RECORD doMagic: CARDINAL; (* magic number at start of file *) doVersion: CARDINAL; (* version number *) doGadget: Gadget; (* copy of in-core gadget *) doType: WBObjectType; doDefaultTool: POINTER TO CHAR; doToolTypes: POINTER TO POINTER TO CHAR; doCurrentX: LONGINT; doCurrentY: LONGINT; doDrawerData: DrawerDataPtr; doToolWindow: POINTER TO CHAR; (* only applies to tools *) doStackSize: LONGINT; (** only applies to tools *) END; CONST DiskMagicNr = 0E310H; DiskVersion = 1; (* current version number *) TYPE FreeList = RECORD flNumFree: CARDINAL; flMemList: List; END; TYPE WBObjectFlags = (woIconDisp, (* icon is currently in a window *) woDrawerOpen, (* we're a drawer, and it is open *) woSelected, (* our icon is selected *) woBackground); (* set if icon is in background *) WBObjectFlagSet = SET OF WBObjectFlags; TYPE WBObject = RECORD woMasterNode: Node; (* all objects are on this list *) woSiblings: Node; (* list of drawer members *) woSelectNode: Node; (* list of all selected objects *) woUtilityNode: Node; (* function specific linkages *) woParent: WBObjectPtr; woFlags: WBObjectFlagSet; woType: WBObjectType; (* what flavor object is this? *) woUseCount: CARDINAL; (* number of references to this obj *) woName: ADDRESS; (* this object's textual name *) woNameXOffset: CARDINAL; (* where to put the name *) woNameYOffset: CARDINAL; woDefaultTool: ADDRESS; woDrawerData: DrawerDataPtr; (* if this is a drawer or disk *) woIconWin: WindowPtr; (* each object's icon lives here *) woCurrentX: LONGINT; (* virtual X in drawer *) woCurrentY: LONGINT; (* virtual Y in drawer *) woToolTypes: POINTER TO ADDRESS; (* the types for this tool *) woGadget: Gadget; woFreeList: FreeList; (* this objects free list *) woToolWindow: ADDRESS; (* character string for tool's window *) woStackSize: LONGCARD; (* how much stack to give to this *) woLock: LONGINT; (* if this tool is in the backdrop *) END; TYPE WBPortMsgType = (None, PStd, (* a "standard Potion" message *) ToolExit, (* exit message from tools *) DiskChange, (* DOS telling us of a disk change *) Timer, (* timer tick *) Closedown, (* unimplemented *) IOProc); (* unimplemented> *) TYPE GadgetIDSpecial = (WrkBObject, (* normal workbench object *) HorizScroll, (* the horiz scroll gadget for a drawer *) VertScroll, (* the vert scroll gadget for a drawer *) LeftScroll, (* move one window left *) RightScroll, (* move one window right *) UpScroll, (* move one window up *) DownScroll, (* move one window down *) ObjName); (* the name field for an object *) CONST BackFill = 1; CONST NoIconPosition = 80000000H; END Workbench.