home *** CD-ROM | disk | FTP | other *** search
-
- {
- Intuition.i for PCQ Pascal
-
- This is some of the information you'll need to work with
- Intuition from PCQ. I included most of the easy stuff having to do with
- windows and screens, but there is a lot more to go.
- While we're at it, I'll mention that you do not need to open the
- Intuition library yourself. The startup code needs the library and
- opens it, so these routines use that pointer.
- }
-
- {$I "Include/Ports.i"}
-
- const
- SIZEVERIFY_f = $0001; { As the tag _f would incdicate, }
- NEWSIZE_f = $0002; { These are some of the Intuition }
- REFRESHWINDOW_f = $0004; { flags. I apologise for having }
- MOUSEBUTTONS_f = $0008; { to include that inconvenient }
- MOUSEMOVE_f = $0010; { little tag, but otherwise these }
- GADGETDOWN_f = $0020; { get confused with Procedure and }
- GADGETUP_f = $0040; { Function names. }
- REQSET_f = $0080;
- MENUPICK_f = $0100;
- CLOSEWINDOW_f = $0200;
- RAWKEY_f = $0400;
- REQVERIFY_f = $0800;
- REQCLEAR_f = $1000;
- MENUVERIFY_f = $2000;
- NEWPREFS_f = $4000;
- DISKINSERTED_f = $8000;
- DISKREMOVED_f = $10000;
- WBENCHMESSAGE_f = $20000;
- ACTIVEWINDOW_f = $40000;
- INACTIVEWINDOW_f = $80000;
- DELTAMOVE_f = $100000;
- VANILLAKEYS_f = $200000;
- INTUITICKS_f = $400000;
- LONELYMESSAGE_f = $80000000;
-
- SCREENTYPE_f = $00FF;
- WBENCHSCREEN_f = $0001;
- CUSTOMSCREEN_f = $000F;
- SHOWTITLE_f = $0010;
- BEEPING_f = $0020;
- CUSTOMBITMAP_f = $0040;
-
- WINDOWSIZING_f = $0001;
- WINDOWDRAG_f = $0002;
- WINDOWDEPTH_f = $0004;
- WINDOWCLOSE_f = $0008;
- SIZEBRIGHT_f = $0010;
- SIZEBBOTTOM_f = $0020;
- SMART_REFRESH_f = 0;
- SIMPLE_REFRESH_f = $0040;
- SUPER_BITMAP_f = $0080;
- OTHER_REFRESH_f = $00c0;
- BACKDROP_f = $0100;
- REPORTMOUSE_f = $0200;
- GIMMEZEROZERO_f = $0400;
- BORDERLESS_f = $0800;
- ACTIVATE_f = $1000;
-
- SELECTUP = $E8;
- SELECTDOWN = $68;
- MENUUP = $E9;
- MENUDOWN = $69;
- ALTLEFT = $10;
- ALTRIGHT = $20;
- AMIGALEFT = $40;
- AMIGARIGHT = $80;
- AMIGAKEYS = $C0;
-
- CURSORUP = $4C;
- CURSORLEFT = $4F;
- CURSORRIGHT = $4E;
- CURSORDOWN = $4D;
- KEYCODE_Q = $10;
- KEYCODE_X = $32;
- KEYCODE_N = $36;
- KEYCODE_M = $37;
-
- type
-
- IntuiMessage = record
- ExecMessage : Message;
- Class : Integer;
- Code : Short;
- Qualifier : Short;
- IAddress : Address;
- MouseX,
- MouseY : Short;
- Seconds,
- Micros : Integer;
- IDCMPWindow : Address;
- SpecialLink : ^IntuiMessage;
- end;
- IntuiMessagePtr = ^IntuiMessage;
-
- IntuiText = record
- FrontPen,
- Backpen,
- DrawMode,
- KludgeFill : Byte; { Kludge is just a reminder here }
- LeftEdge,
- TopEdge : Short;
- ITextFont : Address;
- IText : String;
- NextText : ^IntuiText;
- end;
- IntuiTextPtr = ^IntuiText;
-
- Image = record
- LeftEdge,
- TopEdge,
- Width,
- Height,
- Depth : Short;
- ImageData: Address;
- PlanePick,
- PlaneOnOff : Byte;
- NextImage : ^Image;
- end;
- ImagePtr = ^Image;
-
- Border = record
- LeftEdge,
- TopEdge : Short;
- FrontPen,
- BackPen,
- DrawMode,
- Count : Byte;
- XY : Address;
- NextBorder : ^Border;
- end;
- BorderPtr = ^Border;
-
- { ItemFlags }
- const
- { Flags set by the application }
- CheckIt = $0001;
- ItemText = $0002;
- CommSeq = $0004;
- MenuToggle = $0008;
- ItemEnabled = $0010;
-
- { The special highlight flag state meanings }
-
- HighFlags = $00C0; { see definitions below }
- HighImage = $0000; { use the "select image" }
- HighComp = $0040; { complement the select box }
- HighBox = $0080; { draw a box around select box to highlight }
- HighNone = $00C0; { don't highlight }
-
- { Flag set by both application and Intuition }
-
- Checked = $0100; { if CheckIt is set, then this => selected }
-
- { Flags set by Intuition }
-
- IsDrawn = $1000; { this item's subitems are drawn }
- HighItem = $2000; { this item is highlighted }
- MenuToggled = $4000; { this item was already toggled }
-
- type
- MenuItem = record
- NextItem : ^MenuItem;
- LeftEdge,
- TopEdge,
- Width,
- Height : Short; { select box dimensions }
- Flags : Short; { see constants above }
- MutualExclude : Integer;
- ItemFill : Address; { Image, IntuiText, or Null }
- SelectFill : Address; { Image, IntuiText, or Null }
- Command : Byte; { if CommSeq is set }
- SubItem : ^MenuItem;
- NextSelect : Short; { Menu # of next selected item }
- end;
- MenuItemPtr = ^MenuItem;
-
- Menu = record
- NextMenu : ^Menu; { same level }
- LeftEdge, { position of the select box }
- TopEdge,
- Width,
- Height : Short;
- Flags : Short; { see flags above }
- MenuName : String; { text for menu header }
- FirstItem : MenuItemPtr; { first item in chain }
- JazzX,
- JazzY,
- BeatX,
- BeatY : Short; { for internal use }
- end;
- MenuPtr = ^Menu;
-
- NewScreen = record
- LeftEdge,
- TopEdge,
- Width,
- Height,
- Depth : Short;
- DetailPen,
- BlockPen : Byte;
- ViewModes : Short;
- SType : Short; { Normally this is called 'Type', but }
- Font : Address; { since that's a reserved word I had }
- DefaultTitle : String; { change it }
- Gadgets : Address;
- CustomBitMap : Address;
- end;
- NewScreenPtr = ^NewScreen;
-
- NewWindow = record
- LeftEdge,
- TopEdge,
- Width,
- Height : Short;
- DetailPen,
- BlockPen : Byte;
- IDCMPFlags : Integer;
- Flags : Integer;
- FirstGadget : Address;
- CheckMark : Address;
- Title : String;
- Screen : Address;
- BitMap : Address;
- MinWidth,
- MinHeight,
- MaxWidth,
- MaxHeight : Short;
- WType : Short; { This also had to be changed }
- end;
- NewWindowPtr = ^NewWindow;
-
- Window = record
- NextWindow : ^Window;
- LeftEdge,
- TopEdge,
- Width,
- Height : Short;
- MouseY,
- MouseX : Short;
- MinWidth,
- MinHeight,
- MaxWidth,
- MaxHeight : Short;
- Flags : Integer;
- MenuStrip : MenuPtr;
- Title : String;
- FirstRequest : Address;
- DMRequest : Address;
- ReqCount : Short;
- WScreen : Address;
- RPort : Address;
- BorderLeft,
- BorderTop,
- BorderRight,
- BorderBottom : Byte;
- BorderRPort : Address;
- FirstGadget : Address;
- Parent,
- Descendant : ^Window;
- Pointer : Address;
- PtrHeight,
- PtrWidth : Byte;
- XOffset,
- YOffset : Byte;
- IDCMPFlags : Integer;
- UserPort,
- WindowPort : MsgPortPtr;
- MessageKey : Address;
- DetailPen,
- BlockPen : Byte;
- CheckMark : Address;
- ScreenTitle : String;
- GZZMouseX,
- GZZMouseY,
- GZZWidth,
- GZZHeight : Short;
- ExtData : Address;
- UserData : Integer;
- WLayer : Address;
- IFont : Address;
- end;
- WindowPtr = ^Window;
-
-
- Function AddGadget(w : WindowPtr; g : Address; p : Integer) : Integer;
- External;
- Function AllocRemember(r : Address; s, f : Integer) : Address;
- External;
- Function AutoRequest(w : WindowPtr; b, p, n : IntuiTextPtr;
- pf, nf, x, y : Integer) : Boolean;
- External;
- Procedure BeginRefresh(w : WindowPtr);
- External;
- Function BuildSysRequest(w : WindowPtr; b, p, n : IntuiTextPtr;
- f, x, y : Integer) : Address;
- External;
- Function ClearDMRequest(w : WindowPtr) : Boolean;
- External;
- Procedure ClearMenuStrip(w : WindowPtr);
- External;
- Procedure ClearPointer(w : WindowPtr);
- External;
- Procedure CloseScreen(s : Address);
- External;
- Procedure CloseWindow(w : WindowPtr);
- External;
- Function CloseWorkBench() : Boolean;
- External;
- Procedure CurrentTime(var s, m : Integer);
- External;
- { Note the use of VAR above to do the same work as the & (address)
- prefix in C. }
- Function DisplayAlert(n : Integer; s: String; h: Integer): Boolean;
- External;
- Procedure DisplayBeep(s : Address);
- External;
- Function DoubleClick(ss, sm, cs, cm : Integer) : Boolean;
- External;
- Procedure DrawBorder(r : Address; b : BorderPtr; x, y : Integer);
- External;
- Procedure DrawImage(r : Address; i : ImagePtr; x, y : Integer);
- External;
- Procedure EndRefresh(w : WindowPtr; c : Boolean);
- External;
- Procedure EndRequest(r : Address; w : WindowPtr);
- External;
- Procedure FreeRemember(k : Address; r : Boolean);
- External;
- Procedure FreeSysRequest(w : WindowPtr);
- External;
- Function GetDefPrefs(p : Address; s : Integer) : Address;
- External;
- Function GetPrefs(p : Address; s : Integer) : Address;
- External;
- Procedure InitRequester(r : Address);
- External;
- Function IntuiTextLength(i : IntuiTextPtr) : Integer;
- External;
- Function ItemAddress(m : MenuPtr; n : Integer) : MenuItemPtr;
- External;
- Procedure MakeScreen(s : Address);
- External;
- Procedure ModifyIDCMP(w : WindowPtr; i : Integer);
- External;
- Procedure ModifyProp(p : Address; w : WindowPtr; r : Address;
- f, hp, vp, hb, vb : Integer);
- External;
- Procedure MoveScreen(s : Address; x, y : Integer);
- External;
- Procedure MoveWindow(w : WindowPtr; x, y : Integer);
- External;
- Procedure OffGadget(g : Address; w : WindowPtr; r : Address);
- External;
- Procedure OffMenu(w : WindowPtr; n : Integer);
- External;
- Procedure OnGadget(g : Address; w : WindowPtr; r : Address);
- External;
- Procedure OnMenu(w : WindowPtr; n : Integer);
- External;
- Function OpenScreen(ns : NewScreenPtr) : Address;
- External;
- Function OpenWindow(nw : NewWindowPtr): WindowPtr;
- External;
- Function OpenWorkBench() : Boolean;
- External;
- Procedure PrintIText(r : Address; i : IntuiTextPtr; x, y : Integer);
- External;
- Procedure RefreshGadgets(g : Address; w : WindowPtr; r : Address);
- External;
- Procedure RemakeDisplay;
- External;
- Function RemoveGadget(w : WindowPtr; g : Address) : Integer;
- External;
- Procedure ReportMouse(w : WindowPtr; b : Boolean);
- External;
- Function Request(r : Address; w : WindowPtr) : Boolean;
- External;
- Procedure RethinkDisplay;
- External;
- Procedure ScreenToBack(s : Address);
- External;
- Procedure ScreenToFront(s : Address);
- External;
- Function SetDMRequest(w : WindowPtr; r : Address) : Boolean;
- External;
- Procedure SetMenuStrip(w : WindowPtr; m : MenuPtr);
- External;
- Procedure SetPointer(w : WindowPtr; p : Address; ys, xs, xo, yo : Integer);
- External;
- Procedure SetWindowTitles(w : WindowPtr; t, s : String);
- External;
- Procedure ShowTitle(s : Address; b : Boolean);
- External;
- Procedure SizeWindow(w : WindowPtr; x, y : Integer);
- External;
- Function ViewAddress() : Address;
- External;
- Function ViewPortAddress(w : WindowPtr): Address;
- External;
- Procedure WBenchToBack;
- External;
- Procedure WBenchToFront;
- External;
- Function WindowLimits(w : WindowPtr; mx, my, nx, ny : Integer): Boolean;
- External;
- Procedure WindowToBack(w : WindowPtr);
- External;
- Procedure WindowToFront(w : WindowPtr);
- External;
-