DEFINITION MODULE Intuition;

FROM SYSTEM IMPORT
 ADDRESS,BITSET,BYTE,CAST,LONGSET;
FROM Exec IMPORT
 Byte,Interrupt,IOStdReq,Library,List,MemReqSet,Message,MsgPortPtr,
 SignalSemaphore,UByte;
FROM Graphics IMPORT
 jam2,BitMap,BitMapPtr,ClipRect,DrawModeSet,GfxBasePtr,LayerInfo,LayerPtr,
 RastPort,RastPortPtr,RegionPtr,SimpleSpritePtr,TextAttr,TextAttrPtr,
 TextFontPtr,TmpRas,View,ViewModeSet,ViewPort,ViewPortPtr,ViewPtr;
FROM Timer IMPORT
 TimeRequest,TimeVal;
FROM InputEvent IMPORT
 lButton,rButton,upPrefix,InputEvent,InputEventPtr,Qualifiers,QualifierSet;
FROM KeyMap IMPORT
 KeyMapPtr;

TYPE
 BorderPtr      = POINTER TO Border;
 GadgetPtr      = POINTER TO Gadget;
 ImagePtr       = POINTER TO Image;
 IntuiMessagePtr= POINTER TO IntuiMessage;
 IntuiTextPtr   = POINTER TO IntuiText;
 MenuItemPtr    = POINTER TO MenuItem;
 MenuPtr        = POINTER TO Menu;
 PreferencesPtr = POINTER TO Preferences;
 PropInfoPtr    = POINTER TO PropInfo;
 RememberPtr    = POINTER TO Remember;
 RequesterPtr   = POINTER TO Requester;
 ScreenPtr      = POINTER TO Screen;
 StringInfoPtr  = POINTER TO StringInfo;
 WindowPtr      = POINTER TO Window;

CONST (* Menu.flags *)
 menuEnabled=0;
 miDrawn=8;
TYPE
 Menu=RECORD
  nextMenu: MenuPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  flags: BITSET;
  menuName: ADDRESS;
  firstItem: MenuItemPtr;
  jazzX: INTEGER;
  jazzY: INTEGER;
  beatX: INTEGER;
  beatY: INTEGER;
 END;

 MenuItemFlags=(checkIt,itemText,commSeq,menuToggle,itemEnabled,mif5,highComp,
  highBox,checked,mif9,mif10,mif11,isDrawn,highItem,menuToggled);
 MenuItemFlagSet=SET OF MenuItemFlags;
CONST
 highNone=MenuItemFlagSet{highBox,highComp};
 checkWidth=19;
 commWidth=27;
 lowCheckWidth=13;
 lowCommWidth=16;
TYPE
 MenuItem=RECORD
  nextItem: MenuItemPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  flags: MenuItemFlagSet;
  mutualExclude: LONGSET;
  itemFill: ADDRESS;
  selectFill: ADDRESS;
  command: CHAR;
  subItem: MenuItemPtr;
  nextSelect: CARDINAL;
 END;

 RequesterFlags=(pointRel,preDrawn,noisyReq,rf3,rf4,rf5,rf6,rf7,rf8,rf9,
  rf10,rf11,reqOffWindow,reqActive,sysRequest,deferRefresh);
 RequesterFlagSet=SET OF RequesterFlags;
 Requester=RECORD
  olderRequest: RequesterPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  relLeft: INTEGER;
  relTop: INTEGER;
  reqGadget: GadgetPtr;
  reqBorder: BorderPtr;
  reqText: IntuiTextPtr;
  flags: RequesterFlagSet;
  backFill: UByte;
  reqLayer: LayerPtr;
  reqPad1: ARRAY [0..31] OF BYTE;
  imageBMap: BitMapPtr;
  rWindow: WindowPtr;
  reqPad2: ARRAY [0..35] OF BYTE;
 END;

 GadgetFlags=(gadgHBox,gadgHImage,gadgImage,gRelBottom,gRelRight,gRelWidth,
  gRelHeight,selected,gadgDisabled);
 GadgetFlagSet=SET OF GadgetFlags;
 ActivationFlags=(relVerify,gadgImmediate,endGadget,followMouse,rightBorder,
  leftBorder,topBorder,bottomBorder,toggleSelect,stringCenter,stringRight,
  longint,altKeyMap,boolExtend);
 ActivationFlagSet=SET OF ActivationFlags;
CONST
 gadgHighbits=CAST(GadgetFlagSet,03H);
 gadgHNone=GadgetFlagSet{gadgHBox,gadgHImage};
 boolGadget = 0001H;
 gadget0002 = 0002H;
 propGadget = 0003H;
 strGadget  = 0004H;
 sizing     = 0010H;
 wDragging  = 0020H;
 sDragging  = 0030H;
 wUpFront   = 0040H;
 sUpFront   = 0050H;
 wDownBack  = 0060H;
 sDownBack  = 0070H;
 close      = 0080H;
 reqGadget  = 1000H;
 gzzGadget  = 2000H;
 scrGadget  = 4000H;
 sysGadget  = 8000H;
 gadgetType=CAST(BITSET,0FC00H);
TYPE
 Gadget=RECORD
  nextGadget: GadgetPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  flags: GadgetFlagSet;
  activation: ActivationFlagSet;
  gadgetType: CARDINAL;
  gadgetRender: ADDRESS;
  selectRender: ADDRESS;
  gadgetText: IntuiTextPtr;
  mutualExclude: LONGSET;
  specialInfo: ADDRESS;
  gadgetID: INTEGER;
  userData: ADDRESS;
 END;

CONST (* BoolInfo.flags *)
 boolMask=1;
TYPE
 BoolInfo=RECORD
  flags: BITSET;
  mask: ADDRESS;
  reserved: LONGCARD;
 END;

 PropInfoFlags=(autoKnob,freeHoriz,freeVert,propBorderless,pf4,pf5,pf6,pf7,
  knobHit);
 PropInfoFlagSet=SET OF PropInfoFlags;
CONST
 knobVmin=4;
 knobHmin=6;
 maxBody=0FFFFH;
 maxPot=0FFFFH;
TYPE
 PropInfo=RECORD
  flags: PropInfoFlagSet;
  horizPot: CARDINAL;
  vertPot: CARDINAL;
  horizBody: CARDINAL;
  vertBody: CARDINAL;
  cWidth: CARDINAL;
  cHeight: CARDINAL;
  hPotRes: CARDINAL;
  vPotRes: CARDINAL;
  leftBorder: CARDINAL;
  topBorder: CARDINAL;
 END;

 StringInfo=RECORD
  buffer: ADDRESS;
  undoBuffer: ADDRESS;
  bufferPos: INTEGER;
  maxChars: INTEGER;
  dispPos: INTEGER;
  undoPos: INTEGER;
  numChars: INTEGER;
  dispCount: INTEGER;
  cLeft: INTEGER;
  cTop: INTEGER;
  layerPtr: LayerPtr;
  longInt: LONGINT;
  altKeyMap: KeyMapPtr;
 END;

CONST
 autoFrontPen=0;
 autoBackPen=1;
 autoDrawMode=jam2;
 autoLeftEdge=6;
 autoTopEdge=3;
 autoITextFont=NIL;
 autoNextText=NIL;
TYPE
 IntuiText=RECORD
  frontPen: UByte;
  backPen: UByte;
  drawMode: DrawModeSet;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  iTextFont: TextAttrPtr;
  iText: ADDRESS;
  nextText: IntuiTextPtr;
 END;

 Border=RECORD
  leftEdge: INTEGER;
  topEdge: INTEGER;
  frontPen: UByte;
  backPen: UByte;
  drawMode: DrawModeSet;
  count: UByte;
  xy: ADDRESS;
  nextBorder: BorderPtr;
 END;

 Image=RECORD
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  depth: INTEGER;
  imageData: ADDRESS;
  planePick: UByte;
  planeOnOff: UByte;
  nextImage: ImagePtr;
 END;

 IDCMPFlags=(sizeVerify,newSize,refreshWindow,mouseButtons,mouseMove,gadgetDown,
  gadgetUp,reqSet,menuPick,closeWindow,rawKey,reqVerify,reqClear,menuVerify,
  newPrefs,diskInserted,diskRemoved,wbenchMessage,activeWindow,inactiveWindow,
  deltaMove,vanillaKey,intuiTicks,c23,c24,c25,c26,c27,c28,c29,c30,
  lonelyMessage);
 IDCMPFlagSet=SET OF IDCMPFlags;
CONST
 selectUp   = lButton+upPrefix;    (* mouseButtons *)
 selectDown = lButton;
 menuUp     = rButton+upPrefix;
 menuDown   = rButton;
 menuNull   = 0FFFFH;              (* menuPick *)
 noMenu=1FH; noItem=3FH; noSub=1FH;
 keyCodeQ   = 10H;                 (* rawKey *)
 keyCodeX   = 32H;
 keyCodeV   = 34H;
 keyCodeB   = 35H;
 keyCodeN   = 36H;
 keyCodeM   = 37H;
 cursorUp   = 4CH;
 cursorDown = 4DH;
 cursorRight= 4EH;
 cursorLeft = 4FH;
 menuHot    = 1;                   (* menuVerify *)
 menuCancel = 2;
 menuWaiting= 3;
 okOk       = menuHot;
 okAbort    = 4;
 okCancel   = menuCancel;
 wbenchOpen = 1;                   (* wbenchMessage *)
 wbenchClose= 2;
(* IntuiMessage.qualifier *)
 altLeft    = QualifierSet{lAlt};
 altRight   = QualifierSet{rAlt};
 amigaLeft  = QualifierSet{lCommand};
 amigaRight = QualifierSet{rCommand};
 amigaKeys  = amigaLeft+amigaRight;
TYPE
 IntuiMessage=RECORD
  execMessage: Message;
  class: IDCMPFlagSet;
  code: CARDINAL;
  qualifier: QualifierSet;
  iAddress: ADDRESS;
  mouseX: INTEGER;
  mouseY: INTEGER;
  seconds: LONGCARD;
  micros: LONGCARD;
  idcmpWindow: WindowPtr;
  specialLink: IntuiMessagePtr;
 END;

TYPE
 WindowFlags=(windowSizing,windowDrag,windowDepth,windowClose,sizeBRight,
  sizeBBottom,simpleRefresh,superBitMap,backDrop,reportMouse,gimmeZeroZero,
  borderless,activate,windowActive,inRequest,menuState,rmbTrap,noCareRefresh,
  wf18,wf19,wf20,wf21,wf22,wf23,windowRefresh,wbenchWindow,windowTicked,
  wf27,wf28,wf29,wf30,wf31);
 WindowFlagSet=SET OF WindowFlags;
 ScreenFlags=(wbenchScreen,sf1,sf2,sf3,showTitle,beeping,customBitMap,
  screenBehind,screenQuiet);
 ScreenFlagSet=SET OF ScreenFlags;
CONST
 otherRefresh=WindowFlagSet{simpleRefresh,superBitMap};
 superUnused=WindowFlagSet{wf18..wf23,wf27..wf31};
 stdScreenHeight=-1;
 customScreen=ScreenFlagSet{wbenchScreen..sf3};
TYPE
 NewWindow=RECORD
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  detailPen: UByte;
  blockPen: UByte;
  idcmpFlags: IDCMPFlagSet;
  flags: WindowFlagSet;
  firstGadget: GadgetPtr;
  checkMark: ImagePtr;
  title: ADDRESS;
  screen: ScreenPtr;
  bitMap: BitMapPtr;
  minWidth: INTEGER;
  minHeight: INTEGER;
  maxWidth: INTEGER;
  maxHeight: INTEGER;
  type: ScreenFlagSet;
 END;
 NewScreen=RECORD
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  depth: INTEGER;
  detailPen: UByte;
  blockPen: UByte;
  viewModes: ViewModeSet;
  type: ScreenFlagSet;
  font: TextAttrPtr;
  defaultTitle: ADDRESS;
  gadgets: GadgetPtr;
  customBitMap: BitMapPtr;
 END;

 Window=RECORD
  nextWindow: WindowPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  mouseY: INTEGER;
  mouseX: INTEGER;
  minWidth: INTEGER;
  minHeight: INTEGER;
  maxWidth: INTEGER;
  maxHeight: INTEGER;
  flags: WindowFlagSet;
  menuStrip: MenuPtr;
  title: ADDRESS;
  firstRequest: RequesterPtr;
  dmRequest: RequesterPtr;
  reqCount: INTEGER;
  wScreen: ScreenPtr;
  rPort: RastPortPtr;
  borderLeft: Byte;
  borderTop: Byte;
  borderRight: Byte;
  borderBottom: Byte;
  borderRPort: RastPortPtr;
  firstGadget: GadgetPtr;
  parent: WindowPtr;
  descendant: WindowPtr;
  pointer: ADDRESS;
  ptrHeight: Byte;
  ptrWidth: [0..16];
  xOffset: Byte;
  yOffset: Byte;
  idcmpFlags: IDCMPFlagSet;
  userPort: MsgPortPtr;
  windowPort: MsgPortPtr;
  messageKey: IntuiMessagePtr;
  detailPen: UByte;
  blockPen: UByte;
  checkMark: ImagePtr;
  screenTitle: ADDRESS;
  gzzMouseX: INTEGER;
  gzzMouseY: INTEGER;
  gzzWidth: INTEGER;
  gzzHeight: INTEGER;
  extData: ADDRESS;
  userData: ADDRESS;
  wLayer: LayerPtr;
  iFont: TextFontPtr;
 END;
 Screen=RECORD
  nextScreen: ScreenPtr;
  firstWindow: WindowPtr;
  leftEdge: INTEGER;
  topEdge: INTEGER;
  width: INTEGER;
  height: INTEGER;
  mouseY: INTEGER;
  mouseX: INTEGER;
  flags: ScreenFlagSet;
  title: ADDRESS;
  defaultTitle: ADDRESS;
  barHeight: Byte;
  barVBorder: Byte;
  barHBorder: Byte;
  menuVBorder: Byte;
  menuHBorder: Byte;
  wBorTop: Byte;
  wBorLeft: Byte;
  wBorRight: Byte;
  wBorBottom: Byte;
  font: TextAttrPtr;
  viewPort: ViewPort;
  rastPort: RastPort;
  bitMap: BitMap;
  layerInfo: LayerInfo;
  firstGadget: GadgetPtr;
  detailPen: UByte;
  blockPen: UByte;
  saveColor0: CARDINAL;
  barLayer: LayerPtr;
  extData: ADDRESS;
  userData: ADDRESS;
 END;

CONST
 filenameSize=30;
 pointerSize=(1+16+1)*2;
 topazEighty=8;
 topazSixty=9;
TYPE
 PrinterPort=(parallelPrinter,serialPrinter);
 PrinterType=(customName,alphaP101,brother15XL,cbmMps1000,diab630,diabAdvD25,
  diabC150,epson,epsonJX80,okimate20,QumeLP20,hpLaserjet,hpLaserjetPlus);
 SerParShk=(shakeXon,shakeRts,shakeNone,sps3,parityNone,parityEven,parityOdd);
 SerParShkSet=SET OF SerParShk;
 Preferences=RECORD
  fontHeight: UByte;
  printerPort: PrinterPort;
  baudRate: CARDINAL;
  keyRptSpeed: TimeVal;
  keyRptDelay: TimeVal;
  doubleClick: TimeVal;
  pointerMatrix: ARRAY [0..pointerSize-1] OF CARDINAL;
  xOffset: Byte;
  yOffset: Byte;
  color17: CARDINAL;
  color18: CARDINAL;
  color19: CARDINAL;
  pointerTicks: CARDINAL;
  color0: CARDINAL;
  color1: CARDINAL;
  color2: CARDINAL;
  color3: CARDINAL;
  viewXOffset: Byte;
  viewYOffset: Byte;
  viewInitX: INTEGER;
  viewInitY: INTEGER;
  enableCLI: BOOLEAN;
  printerType: PrinterType;
  printerFilename: ARRAY [0..filenameSize-1] OF CHAR;
  printPitch: CARDINAL;
  printQuality: CARDINAL;
  printSpacing: CARDINAL;
  printLeftMargin: CARDINAL;
  printRightMargin: CARDINAL;
  printImage: CARDINAL;
  printAspect: CARDINAL;
  printShade: CARDINAL;
  printThreshold: INTEGER;
  paperSize: CARDINAL;
  paperLength: CARDINAL;
  paperType: CARDINAL;
  serRWBits: UByte;
  serStopBuf: UByte;
  serParShk: SerParShkSet;
  laceWB: BOOLEAN;
  workName: ARRAY [0..filenameSize-1] OF CHAR;
  padding: ARRAY [0..15] OF BYTE;
 END;
CONST
(* Preferences.baudRate *)
 baud110=0;
 baud300=1;
 baud1200=2;
 baud2400=3;
 baud4800=4;
 baud9600=5;
 baud19200=6;
 baudMidi=7;
(* Preferences.printPitch *)
 pica=0H;
 elite=0400H;
 fine=0800H;
(* Preferences.printQuality *)
 draft=0H;
 letter=0100H;
(* Preferences.printSpacing *)
 sixLPI=0H;
 eightLPI=0200H;
(* Preferences.printImage *)
 imagePositive=0;
 imageNegative=1;
(* Preferences.printAspect *)
 aspectHoriz=0;
 aspectVert=1;
(* Preferences.printShade *)
 shadeBW=0;
 shadeGreyscale=1;
 shadeColor=2;
(* Preferences.paperSize *)
 usLetter=0H;
 usLegal=010H;
 nTractor=020H;
 wTractor=030H;
 custom=040H;
(* Preferences.paperType *)
 fanfold=0H;
 single=080H;
(* Preferences.serRWBits *)
 readBits=0F0H;
 writeBits=0FH;
(* Preferences.serStopBuf *)
 stopBits=0F0H;
 bufSizeBits=0FH;
 buf512=0;
 buf1024=1;
 buf2048=2;
 buf4096=3;
 buf8000=4;
 buf16000=5;

TYPE
 Remember=RECORD
  nextRemember: RememberPtr;
  rememberSize: LONGCARD;
  memory: ADDRESS;
 END;

CONST
 deadendAlert=80000000H; recoveryAlert=0;

TYPE
 DisplayMode=(hiresPick,lowresPick);
CONST
 dModeCount=ORD(MAX(DisplayMode))+1;

 eventMax=10;

TYPE
 Res=(hiresGadget,lowresGadget);
CONST
 resCount=ORD(MAX(Res))+1;

TYPE
 Gadgets=(upFrontGadget,downBackGadget,sizeGadget,closeGadget,dragGadget,
  sUpFrontGadget,sDownBackGadget,sDragGadget);
CONST
 gadgetCount=ORD(MAX(Gadgets))+1;

TYPE
 ILocks=(iStateLock,layerInfoLock,gadgetsLock,layerRomLock,viewLock,
  iBaseLock,rpLock);
CONST
 numILocks=ORD(MAX(ILocks))+1;

TYPE
 FatIntuiMessage=RECORD
  intuiMessage: IntuiMessage;
  prevKeys: LONGCARD;
 END;
 IBox=RECORD
  left: INTEGER;
  top: INTEGER;
  width: INTEGER;
  height: INTEGER;
 END;
 Point=RECORD
  x: INTEGER;
  y: INTEGER;
 END;
 PenPair=RECORD
  detailPen: UByte;
  blockPen: UByte;
 END;

 GListEnv=RECORD
  screen: ScreenPtr;
  window: WindowPtr;
  requester: RequesterPtr;
  rastPort: RastPortPtr;
  layer: LayerPtr;
  gzzLayer: LayerPtr;
  pens: PenPair;
  domain: IBox;
  gzzDims: IBox;
 END;
 GListEnvPtr=POINTER TO GListEnv;
 GadgetInfo=RECORD
  environ: GListEnvPtr;
  gadget: GadgetPtr;
  box: IBox;
  container: IBox;
  layer: LayerPtr;
  newKnob: IBox;
 END;
 
CONST
 numIEvents=4;
TYPE
 IntuitionBase=RECORD
  libNode: Library;
  viewLord: View;
  activeWindow: WindowPtr;
  activeScreen: ScreenPtr;
  firstScreen: ScreenPtr;
  flags: LONGSET;
  mouseY: INTEGER;
  mouseX: INTEGER;
  seconds: LONGCARD;
  micros: LONGCARD;
  minXMouse: INTEGER;
  maxXMouse: INTEGER;
  minYMouse: INTEGER;
  maxYMouse: INTEGER;
  startSecs: LONGCARD;
  startMicros: LONGCARD;
  sysBase: ADDRESS;
  gfxBase: GfxBasePtr;
  layersBase: ADDRESS;
  consoleDevice: ADDRESS;
  aPointer: ADDRESS;
  aPtrHeight: UByte;
  aPtrWidth: [0..16];
  aXOffset: UByte;
  aYOffset: UByte;
  menuDrawn: CARDINAL;
  menuSelected: CARDINAL;
  optionList: CARDINAL;
  menuRPort: RastPort;
  menuTmpRas: TmpRas;
  itemCRect: ClipRect;
  subCRect: ClipRect;
  iBitMap: BitMap;
  sBitMap: BitMap;
  inputRequest: IOStdReq;
  inputInterrupt: Interrupt;
  eventKey: RememberPtr;
  iEvents: ADDRESS;
  eventCount: INTEGER;
  ieBuffer: ARRAY [0..numIEvents-1] OF InputEvent;
  activeGadget: GadgetPtr;
  activePInfo: PropInfoPtr;
  activeImage: ImagePtr;
  gadgetEnv: GListEnv;
  gadgetInfo: GadgetInfo;
  knobOffset: Point;
  getOKWindow: WindowPtr;
  getOKMessage: IntuiMessagePtr;
  setWExcept: CARDINAL;
  gadgetReturn: CARDINAL;
  stateReturn: CARDINAL;
  rp: RastPortPtr;
  iTmpRas: TmpRas;
  oldClipRegion: RegionPtr;
  oldScroll: Point;
  iFrame: IBox;
  hthick: INTEGER;
  vthick: INTEGER;
  frameChange: PROC;
  sizeDrag: PROC;
  firstPt: Point;
  oldPt: Point;
  sysGadgets: ARRAY Res,Gadgets OF GadgetPtr;
  checkImage: ARRAY Res OF ImagePtr;
  amigaIcon: ARRAY Res OF ImagePtr;
  aPattern: ARRAY [0..7] OF CARDINAL; (* only 'Newpattern' supported *)
  bPattern: ARRAY [0..3] OF CARDINAL;
  iPointer: ADDRESS;
  iPtrHeight: UByte;
  iPtrWidth: [0..16];
  iXOffset: UByte;
  iYOffset: UByte;
  doubleSeconds: LONGINT;
  doubleMicros: LONGINT;
  wBorLeft,
  wBorTop,
  wBorRight,
  wBorBottom,
  barVBorder,
  barHBorder,
  menuVBorder,
  menuHBorder: ARRAY DisplayMode OF Byte;
  color0: CARDINAL;
  color1: CARDINAL;
  color2: CARDINAL;
  color3: CARDINAL;
  color17: CARDINAL;
  color18: CARDINAL;
  color19: CARDINAL;
  sysFont: TextAttr;
  preferences: PreferencesPtr;
  echoes: ADDRESS;
  viewInitX: INTEGER;
  viewInitY: INTEGER;
  cursorDX: INTEGER;
  cursorDY: INTEGER;
  keyMap: KeyMapPtr;
  mouseYMinimum: INTEGER;
  errorX: INTEGER;
  errorY: INTEGER;
  ioExcess: TimeRequest;
  holdMinYMouse: INTEGER;
  wbPort: MsgPortPtr;
  fnkuhdPort: MsgPortPtr;
  wbMessage: IntuiMessage;
  hitScreen: ScreenPtr;
  simpleSprite: SimpleSpritePtr;
  attachedSSprite: SimpleSpritePtr;
  gotSpritel: BOOLEAN;
  semaphoreList: List;
  iSemaphore: ARRAY ILocks OF SignalSemaphore;
  maxDisplayHeight: INTEGER;
  maxDisplayRow: INTEGER;
  reserved: ARRAY [0..7] OF LONGCARD;
 END;


PROCEDURE ActivateGadget(gadget: GadgetPtr;
                         window: WindowPtr;
                         requester: RequesterPtr): BOOLEAN;
PROCEDURE ActivateWindow(window: WindowPtr);
PROCEDURE AddGadget(window: WindowPtr;
                    gadget: GadgetPtr;
                    position: INTEGER): INTEGER;
PROCEDURE AddGList(window: WindowPtr;
                   gadget: GadgetPtr;
                   position: INTEGER;
                   numGad: INTEGER;
                   requester: RequesterPtr): INTEGER;
PROCEDURE AllocRemember(rememberKey: ADDRESS;
                        size: LONGCARD;
                        flags: MemReqSet): ADDRESS;
PROCEDURE AlohaWorkbench(wbPort: MsgPortPtr);
PROCEDURE AutoRequest(window: WindowPtr;
                      bodyText: IntuiTextPtr;
                      positiveText: IntuiTextPtr;
                      negativeText: IntuiTextPtr;
                      positiveFlags: IDCMPFlagSet;
                      negativeFlags: IDCMPFlagSet;
                      width: INTEGER;
                      height: INTEGER): BOOLEAN;
PROCEDURE BeginRefresh(window: WindowPtr);
PROCEDURE BuildSysRequest(window: WindowPtr;
                          bodyText: IntuiTextPtr;
                          positiveText: IntuiTextPtr;
                          negativeText: IntuiTextPtr;
                          idcmpFlags: IDCMPFlagSet;
                          width: INTEGER;
                          height: INTEGER): WindowPtr;
PROCEDURE ClearDMRequest(window: WindowPtr): BOOLEAN;
PROCEDURE ClearMenuStrip(window: WindowPtr);
PROCEDURE ClearPointer(window: WindowPtr);
PROCEDURE CloseScreen(screen: ScreenPtr);
PROCEDURE CloseWindow(window: WindowPtr);
PROCEDURE CloseWorkBench(): BOOLEAN;
PROCEDURE CurrentTime(seconds: ADDRESS;
                      micros: ADDRESS);
PROCEDURE DisplayAlert(alertNumber: LONGCARD;
                       string: ADDRESS;
                       height: LONGCARD): BOOLEAN;
PROCEDURE DisplayBeep(screen: ScreenPtr);
PROCEDURE DoubleClick(startSecs: LONGINT;
                      startMicros: LONGINT;
                      currentSecs: LONGINT;
                      currentMicros: LONGINT): BOOLEAN;
PROCEDURE DrawBorder(rastPort: RastPortPtr;
                     border: BorderPtr;
                     leftOffset: INTEGER;
                     topOffset: INTEGER);
PROCEDURE DrawImage(rastPort: RastPortPtr;
                    image: ImagePtr;
                    leftOffset: INTEGER;
                    topOffset: INTEGER);
PROCEDURE EndRefresh(window: WindowPtr;
                     complete: BOOLEAN);
PROCEDURE EndRequest(requester: RequesterPtr;
                     window: WindowPtr);
PROCEDURE FreeRemember(rememberKey: ADDRESS;
                       reallyForget: BOOLEAN);
PROCEDURE FreeSysRequest(window: WindowPtr);
PROCEDURE GetDefPrefs(prefBuffer: PreferencesPtr;
                      size: INTEGER);
PROCEDURE GetPrefs(prefBuffer: PreferencesPtr;
                   size: INTEGER);
PROCEDURE GetScreenData(buffer: ADDRESS;
                        size: CARDINAL;
                        type: CARDINAL;
                        screen: ScreenPtr): BOOLEAN;
PROCEDURE InitRequester(requester: RequesterPtr);
PROCEDURE IntuiTextLength(iText: IntuiTextPtr): INTEGER;
PROCEDURE Intuition(inputEvent: InputEventPtr);
PROCEDURE ItemAddress(menuStrip: MenuPtr;
                      menuNumber: CARDINAL): MenuItemPtr;
PROCEDURE LockIBase(lockNumber: LONGCARD): LONGCARD;
PROCEDURE MakeScreen(screen: ScreenPtr);
PROCEDURE ModifyIDCMP(window: WindowPtr;
                      idcmpFlags: IDCMPFlagSet);
PROCEDURE ModifyProp(gadget: GadgetPtr;
                     window: WindowPtr;
                     requester: RequesterPtr;
                     flags: PropInfoFlagSet;
                     horizPot: CARDINAL;
                     vertPot: CARDINAL;
                     horizBody: CARDINAL;
                     vertBody: CARDINAL);
PROCEDURE MoveScreen(screen: ScreenPtr;
                     deltaX: INTEGER;
                     deltaY: INTEGER);
PROCEDURE MoveWindow(window: WindowPtr;
                     deltaX: INTEGER;
                     deltaY: INTEGER);
PROCEDURE NewModifyProp(gadget: GadgetPtr;
                        window: WindowPtr;
                        requester: RequesterPtr;
                        horizPot: CARDINAL;
                        vertPot: CARDINAL;
                        horizBody: CARDINAL;
                        vertBody: CARDINAL;
                        numGad: INTEGER);
PROCEDURE OffGadget(gadget: GadgetPtr;
                    window: WindowPtr;
                    requester: RequesterPtr);
PROCEDURE OffMenu(window: WindowPtr;
                  menuNumber: CARDINAL);
PROCEDURE OnGadget(gadget: GadgetPtr;
                   window: WindowPtr;
                   requester: RequesterPtr);
PROCEDURE OnMenu(window: WindowPtr;
                 menuNumber: CARDINAL);
PROCEDURE OpenIntuition(): ADDRESS;
PROCEDURE OpenScreen(VAR newScreen: NewScreen): ScreenPtr;
PROCEDURE OpenWindow(VAR newWindow: NewWindow): WindowPtr;
PROCEDURE OpenWorkBench(): ScreenPtr;
PROCEDURE PrintIText(rastPort: RastPortPtr;
                     iText: IntuiTextPtr;
                     leftOffset: INTEGER;
                     topOffset: INTEGER);
PROCEDURE RefreshGadgets(gadgets: GadgetPtr;
                         window: WindowPtr;
                         requester: RequesterPtr);
PROCEDURE RefreshGList(gadgets: GadgetPtr;
                       window: WindowPtr;
                       requester: RequesterPtr;
                       numGad: INTEGER);
PROCEDURE RefreshWindowFrame(window: WindowPtr);
PROCEDURE RemakeDisplay();
PROCEDURE RemoveGadget(window: WindowPtr;
                       gadget: GadgetPtr): INTEGER;
PROCEDURE RemoveGList(window: WindowPtr;
                      gadget: GadgetPtr;
                      numgad: INTEGER): INTEGER;
PROCEDURE ReportMouse(window: WindowPtr;
                      boolean: BOOLEAN);
PROCEDURE Request(requester: RequesterPtr;
                  window: WindowPtr): BOOLEAN;
PROCEDURE RethinkDisplay();
PROCEDURE ScreenToBack(screen: ScreenPtr);
PROCEDURE ScreenToFront(screen: ScreenPtr);
PROCEDURE SetDMRequest(window: WindowPtr;
                       dmRequester: RequesterPtr): BOOLEAN;
PROCEDURE SetMenuStrip(window: WindowPtr;
                       menu: MenuPtr): BOOLEAN;
PROCEDURE SetPointer(window: WindowPtr;
                     pointer: ADDRESS;
                     height: INTEGER;
                     width: INTEGER;
                     xOffset: INTEGER;
                     yOffset: INTEGER);
PROCEDURE SetPrefs(prefBuffer: PreferencesPtr;
                   Size: INTEGER;
                   Inform: BOOLEAN);
PROCEDURE SetWindowTitles(window: WindowPtr;
                          windowTitle: ADDRESS;
                          screenTitle: ADDRESS);
PROCEDURE ShowTitle(screen: ScreenPtr;
                    showIt: BOOLEAN);
PROCEDURE SizeWindow(window: WindowPtr;
                     deltaX: INTEGER;
                     deltaY: INTEGER);
PROCEDURE UnlockIBase(lock: LONGCARD);
PROCEDURE ViewAddress(): ViewPtr;
PROCEDURE ViewPortAddress(window: WindowPtr): ViewPortPtr;
PROCEDURE WBenchToBack(): BOOLEAN;
PROCEDURE WBenchToFront(): BOOLEAN;
PROCEDURE WindowLimits(window: WindowPtr;
                       minWidth: INTEGER;
                       minHeight: INTEGER;
                       maxWidth: INTEGER;
                       maxHeight: INTEGER): BOOLEAN;
PROCEDURE WindowToBack(window: WindowPtr);
PROCEDURE WindowToFront(window: WindowPtr);

END Intuition.
