home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Pascal / Snippets / OffscreenToys 1.4 / InterfacesUI.p next >
Encoding:
Text File  |  1995-11-22  |  9.5 KB  |  312 lines  |  [TEXT/PJMM]

  1. unit InterfacesUI;
  2.  
  3. {For Think Pascal users only.}
  4.  
  5. {Unit for making Think Pascal work with Universal Interfaces}
  6. {All units that are not in Interfaces.lib are not reflected here.}
  7. {This implements changes to the core Toolbox, excluding most System7-}
  8. {specific units. You have to inlude them in your project anyway, so}
  9. {you can just as well make the changes in the interface files as}
  10. {necessary.}
  11.  
  12. {Even with the UPI files for Think Pascal around, I find this handy. If I use the real UPI for}
  13. {Think Pascal, I have to include lots of files in my projects, due to all dependencies.}
  14.  
  15. interface
  16.  
  17. {Controls}
  18.     type
  19.         ControlRef = ControlHandle;
  20.         ConstStr255Param = Str255;
  21.         WindowRef = WindowPtr;
  22.         ControlActionUPP = ProcPtr;
  23.     procedure SetControlTitle (theControl: ControlRef; title: ConstStr255Param);
  24.     inline
  25.         $A95F;
  26.     procedure GetControlTitle (theControl: ControlRef; var title: Str255);
  27.     inline
  28.         $A95E;
  29.     procedure UpdateControls (theWindow: WindowRef; updateRgn: RgnHandle);
  30.     inline
  31.         $A953;
  32.     procedure SetControlValue (theControl: ControlRef; theValue: INTEGER);
  33.     inline
  34.         $A963;
  35.     function GetControlValue (theControl: ControlRef): INTEGER;
  36.     inline
  37.         $A960;
  38.     procedure SetControlMinimum (theControl: ControlRef; minValue: INTEGER);
  39.     inline
  40.         $A964;
  41.     function GetControlMinimum (theControl: ControlRef): INTEGER;
  42.     inline
  43.         $A961;
  44.     procedure SetControlMaximum (theControl: ControlRef; maxValue: INTEGER);
  45.     inline
  46.         $A965;
  47.     function GetControlMaximum (theControl: ControlRef): INTEGER;
  48.     inline
  49.         $A962;
  50.     function GetAuxiliaryControlRecord (theControl: ControlRef; var acHndl: AuxCtlHandle): BOOLEAN;
  51.     inline
  52.         $AA44;
  53.     procedure SetControlReference (theControl: ControlRef; data: LONGINT);
  54.     inline
  55.         $A95B;
  56.     function GetControlReference (theControl: ControlRef): LONGINT;
  57.     inline
  58.         $A95A;
  59.     procedure SetControlAction (theControl: ControlRef; actionProc: ControlActionUPP);
  60.     inline
  61.         $A96B;
  62.     function GetControlAction (theControl: ControlRef): ControlActionUPP;
  63.     inline
  64.         $A96A;
  65.     procedure SetControlColor (theControl: ControlRef; newColorTable: CCTabHandle);
  66.     inline
  67.         $AA43;
  68.     function GetControlVariant (theControl: ControlRef): INTEGER;
  69.     inline
  70.         $A809;
  71.  {Dialogs}
  72.     type
  73.         DialogRef = DialogPtr;
  74.     procedure DisposeDialog (theDialog: DialogRef);
  75.     inline
  76.         $A983;
  77.     procedure UpdateDialog (theDialog: DialogRef; updateRgn: RgnHandle);
  78.     inline
  79.         $A978;
  80.     procedure GetDialogItem (theDialog: DialogRef; itemNo: INTEGER; var itemType: INTEGER; var item: Handle; var box: Rect);
  81.     inline
  82.         $A98D;
  83.     procedure SetDialogItem (theDialog: DialogRef; itemNo: INTEGER; itemType: INTEGER; item: Handle; {CONST}
  84.                                     var box: Rect);
  85.     inline
  86.         $A98E;
  87.     procedure HideDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  88.     inline
  89.         $A827;
  90.     procedure ShowDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  91.     inline
  92.         $A828;
  93.     procedure SelectDialogItemText (theDialog: DialogRef; itemNo: INTEGER; strtSel: INTEGER; endSel: INTEGER);
  94.     inline
  95.         $A97E;
  96.     procedure GetDialogItemText (item: Handle; var text: Str255);
  97.     inline
  98.         $A990;
  99.     procedure SetDialogItemText (item: Handle; text: ConstStr255Param);
  100.     inline
  101.         $A98F;
  102.     function FindDialogItem (theDialog: DialogRef; thePt: Point): INTEGER;
  103.     inline
  104.         $A984;
  105.     function NewColorDialog (dStorage: univ Ptr; {CONST}
  106.                                     var boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: INTEGER; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: LONGINT; items: Handle): DialogRef;
  107.     inline
  108.         $AA4B;
  109.     function GetAlertStage: INTEGER;
  110.     inline
  111.         $3EB8, $0A9A;            { MOVE.W $0A9A,(SP) }
  112.  
  113.     procedure ResetAlertStage;
  114.     inline
  115.         $4278, $0A9A;
  116.     procedure DialogCut (theDialog: DialogRef);
  117.     procedure DialogPaste (theDialog: DialogRef);
  118.     procedure DialogCopy (theDialog: DialogRef);
  119.     procedure DialogDelete (theDialog: DialogRef);
  120.     procedure SetDialogFont (value: INTEGER);
  121.     inline
  122.         $31DF, $0AFA;            { MOVE.W (SP)+,$0AFA }
  123.  
  124. {Events}
  125.     function KeyTranslate (transData: univ Ptr; keycode: INTEGER; var state: LONGINT): LONGINT;
  126.     inline
  127.         $A9C3;
  128.  
  129. {Lists}
  130.     procedure LSetDrawingMode (drawIt: BOOLEAN; lHandle: ListHandle);
  131.     inline
  132.         $3F3C, $002C, $A9E7;
  133.     procedure LGetCellDataLocation (var offset: INTEGER; var len: INTEGER; theCell: Cell; lHandle: ListHandle);
  134.     inline
  135.         $3F3C, $0034, $A9E7;
  136.  
  137. {Memory}
  138.     function ApplicationZone: THz;
  139.     inline
  140.         $2EB8, $02AA;            { MOVE.L $02AA,(SP) }
  141.     function TempNewHandle (logicalSize: Size; var resultCode: OSErr): Handle;
  142.     inline
  143.         $3F3C, $001D, $A88F;
  144.     function TempMaxMem (var grow: Size): Size;
  145.     inline
  146.         $3F3C, $0015, $A88F;
  147.     function TempFreeMem: LONGINT;
  148.     inline
  149.         $3F3C, $0018, $A88F;
  150.  {  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  }
  151.     procedure TempHLock (h: Handle; var resultCode: OSErr);
  152.     inline
  153.         $3F3C, $001E, $A88F;
  154.     procedure TempHUnlock (h: Handle; var resultCode: OSErr);
  155.     inline
  156.         $3F3C, $001F, $A88F;
  157.     procedure TempDisposeHandle (h: Handle; var resultCode: OSErr);
  158.     inline
  159.         $3F3C, $0020, $A88F;
  160.     function TempTopMem: Ptr;
  161.     inline
  162.         $3F3C, $0016, $A88F;
  163.     procedure ReserveMem (cbNeeded: Size);
  164.     inline
  165.         $201F, $A040;
  166.     procedure ReserveMemSys (cbNeeded: Size);
  167.     inline
  168.         $201F, $A440;
  169.     procedure DisposePtr (p: Ptr);        {Unnecessary?}
  170.     inline
  171.         $205F, $A01F;
  172.     procedure DisposeHandle (h: Handle);    {Unnecessary?}
  173.     inline
  174.         $205F, $A023;
  175.     procedure ReallocateHandle (h: Handle; byteCount: Size);
  176.     inline
  177.         $201F, $205F, $A027;
  178.  {Menus}
  179.     type
  180.         MenuRef = MenuHandle;
  181.     procedure AppendResMenu (theMenu: MenuRef; theType: ResType);
  182.     inline
  183.         $A94D;
  184.     procedure InsertMenuItem (theMenu: MenuRef; itemString: ConstStr255Param; afterItem: INTEGER);
  185.     inline
  186.         $A826;
  187.     procedure DeleteMenuItem (theMenu: MenuRef; item: INTEGER);
  188.     inline
  189.         $A952;
  190.     procedure SetMenuItemText (theMenu: MenuRef; item: INTEGER; itemString: ConstStr255Param);
  191.     inline
  192.         $A947;
  193.     procedure GetMenuItemText (theMenu: MenuRef; item: INTEGER; var itemString: Str255);
  194.     inline
  195.         $A946;
  196.     function GetMenuHandle (menuID: INTEGER): MenuRef;
  197.     inline
  198.         $A949;
  199.     procedure DeleteMCEntries (menuID: INTEGER; menuItem: INTEGER);
  200.     inline
  201.         $AA60;
  202.     procedure DisposeMCInfo (menuCTbl: MCTableHandle);
  203.     inline
  204.         $AA63;
  205.  {OSUtils}
  206.     type
  207.         LongDateRec = DateTimeRec;
  208.         LongDateTime = Longint;
  209.     procedure LongDateToSeconds ({CONST}
  210.                                     var lDate: LongDateRec; var lSecs: LongDateTime);
  211.     inline
  212.         $2F3C, $8008, $FFF2, $A8B5;
  213.     procedure LongSecondsToDate (var lSecs: LongDateTime; var lDate: LongDateRec);
  214.     inline
  215.         $2F3C, $8008, $FFF0, $A8B5;
  216.     function IsMetric: BOOLEAN;
  217.     inline
  218.         $3F3C, $0004, $A9ED;
  219.     procedure DateToSeconds ({CONST}
  220.                                     var d: DateTimeRec; var secs: LONGINT);
  221.     procedure SecondsToDate (secs: LONGINT; var d: DateTimeRec);
  222.     inline
  223.         $205F, $201F, $A9C6;
  224. {PictUtils - unnecessary?}
  225. {function DisposePictInfo (thePictInfoID: PictInfoID): OSErr;}
  226. {inline}
  227. {$303C, $0206, $A831;}
  228.  {QuickDraw - unnecessary?}
  229.     procedure DisposePixMap (pm: PixMapHandle);
  230.     inline
  231.         $AA04;
  232.     procedure DisposePixPat (pp: PixPatHandle);
  233.     inline
  234.         $AA08;
  235.     procedure DisposeCTable (cTable: CTabHandle);
  236.     inline
  237.         $AA24;
  238.     procedure DisposeCCursor (cCrsr: CCrsrHandle);
  239.     inline
  240.         $AA26;
  241.     procedure DisposeCIcon (theIcon: CIconHandle);    {Rather Icons.p today?}
  242.     inline
  243.         $AA25;
  244.     procedure DisposeGDevice (gdh: GDHandle);
  245.     inline
  246.         $AA30;
  247.  {QuickdrawText}
  248. {function PixelToChar (textBuf: Ptr; textLength: LONGINT; slop: Fixed; pixelWidth: Fixed; var leadingEdge: BOOLEAN; var widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  249. {inline}
  250. {$2F3C, $8222, $002E, $A8B5;}
  251. {function CharToPixel (textBuf: Ptr; textLength: LONGINT; slop: Fixed; offset: LONGINT; direction: INTEGER; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  252. {inline}
  253. {$2F3C, $821C, $0030, $A8B5;}
  254. {procedure DrawJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  255. {inline}
  256. {$2F3C, $8016, $0032, $A8B5;}
  257. {procedure MeasureJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  258. {inline}
  259. {$2F3C, $801A, $0034, $A8B5;}
  260. {function PortionLine (textPtr: Ptr; textLen: LONGINT; styleRunPosition: JustStyleCode; numer: Point; denom: Point): Fixed;}
  261. {inline}
  262. {$2F3C, $8412, $0036, $A8B5;}
  263.  {Resources}
  264.     function GetResourceSizeOnDisk (theResource: Handle): LONGINT;
  265.     inline
  266.         $A9A5;
  267.     function GetMaxResourceSize (theResource: Handle): LONGINT;
  268.     inline
  269.         $A821;
  270.     procedure RemoveResource (theResource: Handle);
  271.     inline
  272.         $A9AD;
  273.  {TextEdit}
  274.     type
  275.         TEClickLoopUPP = ProcPtr;
  276.         WordBreakUPP = ProcPtr;
  277.     procedure TESetAlignment (just: INTEGER; hTE: TEHandle);
  278.     inline
  279.         $A9DF;
  280.     procedure TETextBox (text: univ Ptr; length: LONGINT; {CONST}
  281.                                     var box: Rect; just: INTEGER);
  282.     inline
  283.         $A9CE;
  284.     function TEStyleNew ({CONST}
  285.                                     var destRect: Rect; {CONST}
  286.                                     var viewRect: Rect): TEHandle;
  287.     inline
  288.         $A83E;
  289.     procedure TESetStyleHandle (theHandle: TEStyleHandle; hTE: TEHandle);
  290.     inline
  291.         $3F3C, $0005, $A83D;
  292.     function TEGetStyleHandle (hTE: TEHandle): TEStyleHandle;
  293.     inline
  294.         $3F3C, $0004, $A83D;
  295.     procedure TEStylePaste (hTE: TEHandle);
  296.     inline
  297.         $3F3C, $0000, $A83D;
  298.     function TEGetStyleScrapHandle (hTE: TEHandle): StScrpHandle;
  299.     inline
  300.         $3F3C, $0006, $A83D;
  301.     procedure TEUseStyleScrap (rangeStart: LONGINT; rangeEnd: LONGINT; newStyles: StScrpHandle; fRedraw: BOOLEAN; hTE: TEHandle);
  302.     inline
  303.         $3F3C, $000B, $A83D;
  304.     procedure TESetClickLoop (clikProc: TEClickLoopUPP; hTE: TEHandle);
  305.     function TEGetScrapLength: LONGINT;
  306.     procedure TESetWordBreak (wBrkProc: WordBreakUPP; hTE: TEHandle);
  307.     procedure TEStyleInsert (text: univ Ptr; length: LONGINT; hST: StScrpHandle; hTE: TEHandle);
  308.     inline
  309.         $3F3C, $0007, $A83D;
  310.  
  311. implementation
  312. end.