DEFINITION MODULE WorkbenchD; (*$Implementation:=FALSE*)
(* 17-May-1992/cn *)

FROM SYSTEM IMPORT ADDRESS,BPTR,LONGSET;

FROM DosD IMPORT
 FileLockPtr;

FROM ExecD IMPORT
 Message,MsgPortPtr,List;

FROM IntuitionD IMPORT
 Gadget,GadgetFlags,GadgetFlagSet,NewWindow;

FROM GraphicsD IMPORT
 ViewModeSet;

CONST
 workbenchName="workbench.library";

 diskMagic=0E310H;
 diskVersion=1;
 diskRevision=1;

 gadgetBackFill=GadgetFlagSet{gadgHBox};

 noIconPosition=MIN(LONGINT);

TYPE
 WBArg=RECORD
  lock:FileLockPtr;
  name:ADDRESS
 END;
 WBArgPtr=POINTER TO WBArg;

 WBArgumentsPtr=POINTER TO ARRAY [0..255] OF WBArg;

 WBStartup=RECORD
  message:Message;
  process:MsgPortPtr;
  segment:BPTR;
  numArgs:LONGINT;
  toolWindow:ADDRESS;
  argList:WBArgumentsPtr;
 END;
 WBStartupPtr=POINTER TO WBStartup;

 FreeList=RECORD
  numFree:INTEGER;
  memList:List
 END;
 FreeListPtr=POINTER TO FreeList;

 OldDrawerData=RECORD
  newWindow:NewWindow;
  currentX:LONGINT;
  currentY:LONGINT;
 END;
 OldDrawerDataPtr=POINTER TO OldDrawerData;

 (*36*)DrawerData=RECORD
        newWindow:NewWindow;
        currentX:LONGINT;
        currentY:LONGINT;
        flags:LONGSET;
        viewModes:ViewModeSet
       END;
 (*36*)DrawerDataPtr=POINTER TO DrawerData;

CONST
 oldDrawerDataFileSize=SIZE(OldDrawerData);
 drawerDataFileSize=SIZE(DrawerData);

TYPE
 WBObjectType=(
  wb0,disk,drawer,tool,project,garbage,device,kick,appicon
 );

 DiskObject=RECORD
  magic:CARDINAL;
  version:CARDINAL;
  gadget:Gadget;
  type:WBObjectType;
  defaultTool:ADDRESS;
  toolTypes:ADDRESS;
  currentX:LONGINT;
  currentY:LONGINT;
  drawerData:DrawerDataPtr;
  toolWindow:ADDRESS;
  stackSize:LONGINT
 END;
 DiskObjectPtr=POINTER TO DiskObject;

CONST
 amVersion=1;

TYPE
 AppIconPtr;

 AppMenuItemPtr;

 MType=(
  mt0,pstd,toolExit,diskChange,timer,closeDown,ioProc
  ,appWindow,appIcon,appMenuItem,copyExit,iconPut
 );

 AppMessage=RECORD
  message:Message;
  pad0:SHORTINT; (* Muss auf 0 gesetzt werden! *)
  type:MType;
  userData:LONGINT;
  id:LONGCARD;
  numArgs:LONGINT;
  argList:WBArgumentsPtr;
  version:CARDINAL;
  class:CARDINAL;
  mouseX:INTEGER;
  mouseY:INTEGER;
  seconds:LONGCARD;
  micros:LONGCARD;
  reserved:ARRAY[0..7] OF LONGINT;
 END;
 AppMessagePtr=POINTER TO AppMessage;

 AppWindowPtr;

END WorkbenchD.noimp
