home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / programming / triton / developer / amigaoberon / triton.mod < prev    next >
Encoding:
Text File  |  1995-08-25  |  23.4 KB  |  494 lines

  1. (* ==================================================================== *)
  2. (*
  3.  
  4.   :Program.     Triton.MOD
  5.   :Contents.    interface to Stefan Zeiger's triton.library
  6.  
  7.   :Copyright.   This module is C 1994 by Peter Fröhlich & Volker Stolz.
  8.   :Copyright.   It may be distributed freely as long as it remains unchanged.
  9.  
  10.   :Author.      Peter Fröhlich [phf]
  11.   :Address.     Peter Fröhlich, Ebenböckstraße 19, D-81241 München
  12.   :Address.     Z-NETZ: p.froehlich@amc.insider.sub.de 
  13.  
  14.   :Author.      Volker Stolz [vs]
  15.   :Address.     Volker Stolz, Kückstraße 54, D-52499 Baesweiler
  16.   :Address.     Vok@TinDrum.tng.oche.de
  17.  
  18.   :Language.    Oberon (revised)
  19.   :Translator.  Amiga Oberon V3.11d
  20.  
  21.   :History.     V0.1 [phf] 01-May-1994 first release to S. Zeiger
  22.  
  23.   :History.     V0.2 [vs]  April 1995
  24.                 - changed the Window-Flags prefixes from "wi" to "wf"
  25.                 - new features implemented from C-source
  26.                 - changed the Menu-Flags prefixes from "mn" to "mf"
  27.   :History.     V0.3 [vs] 06-May-1995
  28.                 - updated for Triton-Release V1.3
  29.  
  30.   :Remark.      The interface currently supports only direct use
  31.   :Remark.      of the library, ie. the infamous C macros have not
  32.   :Remark.      been ported yet.
  33.   :Remark.         Note that the interface does not AmigaOberon's
  34.   :Remark.      LONGSET since this would result in cumbersome casts
  35.   :Remark.      in the taglists.
  36.   :Remark.         Remember to ensure "Triton.base # NIL" before
  37.   :Remark.      calling procedures of the module.
  38.  
  39. *)
  40. (* ==================================================================== *)
  41.  
  42. MODULE Triton;
  43.  
  44. IMPORT
  45.   E* := Exec, S* := SYSTEM, U* := Utility, W* := Workbench,
  46.   I* := Intuition, GT* := GadTools, G* := Graphics, IE* := InputEvent;
  47.  
  48. CONST
  49.   tritonName* = "triton.library";
  50.   triton10Version* = 1;
  51.   triton11Version* = 2;
  52.   triton12Version* = 3;
  53.   triton13Version* = 4;
  54.  
  55. TYPE
  56.   MessagePtr*    = UNTRACED POINTER TO Message;
  57.   AppPtr*        = UNTRACED POINTER TO App;
  58.   DimensionsPtr* = UNTRACED POINTER TO Dimensions;
  59.   ProjectPtr*    = UNTRACED POINTER TO Project;
  60.  
  61.   DisplayObjectPtr* = UNTRACED POINTER TO STRUCT END;
  62.  
  63. (* --- The Triton message --- *)
  64.  
  65.   Message* = STRUCT
  66.     project-   : ProjectPtr; (* The project which triggered the message       *)
  67.     id-        : E.ULONG;    (* The object's ID (where appropriate)           *)
  68.     class-     : E.ULONG;    (* The Triton message class                      *)
  69.     data-      : E.ULONG;    (* The class-specific data                       *)
  70.     code-      : E.ULONG;    (* \ Currently only used                         *)
  71.     qualifier- : E.ULONG;    (* / by TRMS_KEYPRESSED                          *)
  72.     seconds-   : E.ULONG;    (* \ Copy of system clock time (Only where       *)
  73.     micros-    : E.ULONG;    (* / available! If not set, trm_Seconds is NULL) *)
  74.     app-       : AppPtr;     (* The project's application                     *)
  75.   END;
  76.  
  77. (* --- The Application Structure --- *)
  78.  
  79.   App* = STRUCT (* This structure is mostly PRIVATE! *)
  80.     memPool     : E.ADDRESS;       (* The memory pool             *)
  81.     bitMask-    : E.LONGBITS;      (* Bits to Wait() for PUBLIC ! *)
  82.     name-       : E.STRPTR;        (* Unique name           "     *)
  83.     longName-   : E.STRPTR;        (* User-readable name    "     *)
  84.     info-       : E.STRPTR;        (* Info string           "     *)
  85.     version-    : E.STRPTR;        (* Version               "     *)
  86.     release-    : E.STRPTR;        (* Release               "     *)
  87.     date-       : E.STRPTR;        (* Compilation date      "     *)
  88.     appPort     : E.MsgPortPtr;    (* AppMessage port             *)
  89.     idcmpPort   : E.MsgPortPtr;    (* IDCMP message port          *)
  90.     prefs       : E.ADDRESS;       (* Pointer to Triton app prefs *)
  91.     lastProject : ProjectPtr;      (* Used for menu item linking  *)
  92.     inputEvent  : IE.InputEventPtr (* Used for RAWKEY conversion  *)
  93.   END;
  94.  
  95. (* --- The Dimensions Structure --- *)
  96.  
  97.   Dimensions* = STRUCT
  98.     left*     : E.UWORD;            (* Left                  *)
  99.     top*      : E.UWORD;            (* Top                   *)
  100.     width*    : E.UWORD;            (* Width                 *)
  101.     height*   : E.UWORD;            (* Height                *)
  102.     left2*    : E.UWORD;            (* Left                  *)
  103.     top2*     : E.UWORD;            (* Top                   *)
  104.     width2*   : E.UWORD;            (* Width                 *)
  105.     height2*  : E.UWORD;            (* Height                *)
  106.     zoomed*   : E.BOOL;             (* Window zoomed?        *)
  107.     reserved* : ARRAY 3 OF E.UWORD; (* For future expansions *)
  108.   END;
  109.  
  110. (* --- The Project Structure --- *)
  111.  
  112.   Project* = STRUCT (* This structure is PRIVATE! *)
  113.     app                  : AppPtr;            (* Our application *)
  114.     screen               : I.ScreenPtr;       (* Our screen, always valid *)
  115.     lockedPubScreen      : I.ScreenPtr;       (* Only valid if we're using a PubScreen *)
  116.     window               : I.WindowPtr;       (* The window *)
  117.     id                   : E.ULONG;           (* The window ID *)
  118.     appWindow            : W.AppWindowPtr;    (* AppWindow for icon dropping *)
  119.     idcmpFlags           : E.ULONG;           (* The IDCMP flags *)
  120.     flags                : E.ULONG;           (* Triton window flags *)
  121.     newMenu              : GT.NewMenuPtr;     (* The newmenu stucture built by Triton *)
  122.     newMenuSize          : E.ULONG;           (* The number of menu items in the list *)
  123.     menu                 : I.MenuPtr;         (* The menu structure *)
  124.     nextSelect           : E.UWORD;           (* The next selected menu item    *)
  125.     visualInfo           : E.ADDRESS;         (* The VisualInfo of our window *)
  126.     drawInfo             : I.DrawInfoPtr;     (* The DrawInfo of the screen *)
  127.     dimensions           : DimensionsPtr;     (* User-supplied dimensions *)
  128.     windowStdHeight      : E.ULONG;           (* The standard height of the window *)
  129.     leftBorder           : E.ULONG;           (* The width of the left window border *)
  130.     rightBorder          : E.ULONG;           (* The width of the right window border *)
  131.     topBorder            : E.ULONG;           (* The height of the top window border *)
  132.     bottomBorder         : E.ULONG;           (* The height of the bottom window border *)
  133.     innerWidth           : E.ULONG;           (* The inner width of the window *)
  134.     innerHeight          : E.ULONG;           (* The inner height of the window *)
  135.     zipDimensions        : ARRAY 4 OF E.WORD; (* The dimensions for the zipped window *)
  136.     aspectFixing         : E.UWORD;           (* Pixel aspect correction factor *)
  137.     objectList           : E.MinList;         (* The list of display objects *)
  138.     menuList             : E.MinList;         (* The list of menus *)
  139.     idList               : E.MinList;         (* The ID linking list (menus & objects) *)
  140.     memPool              : E.ADDRESS;         (* The memory pool for the lists *)
  141.     hasObjects           : E.BOOL;            (* Do we have display objects ? *)
  142.     propAttr             : G.TextAttrPtr;     (* The proportional font attributes *)
  143.     fixedWidthAttr       : G.TextAttrPtr;     (* The fixed-width font attributes *)
  144.     propFont             : G.TextFontPtr;     (* The proportional font *)
  145.     fixedWidthFont       : G.TextFontPtr;     (* The fixed-width font *)
  146.     openedPropFont       : E.BOOL;            (* \ Have we opened the fonts ? *)
  147.     openedFixedWidthFont : E.BOOL;            (* / *)
  148.     totalPropFontHeight  : E.UWORD;           (* Height of prop font incl. underscore *)
  149.     backfillType         : E.ULONG;           (* The backfill type *)
  150.     backfillHook         : U.HookPtr;         (* The backfill hook *)
  151.     gadToolsGadgetList   : I.GadgetPtr;       (* List of GadTools gadgets *)
  152.     prevGadget           : I.GadgetPtr;       (* Previous GadTools gadget *)
  153.     newGadget            : GT.NewGadgetPtr;   (* GadTools NewGadget *)
  154.     invisibleRequest     : I.RequesterPtr;    (* The invisible blocking requester *)
  155.     isUserLocked         : E.BOOL;            (* Project locked by the user? *)
  156.     currentID            : E.ULONG;           (* The currently keyboard-selected ID *)
  157.     isCancelDown         : E.BOOL;            (* Cancellation key pressed? *)
  158.     isShortcutDown       : E.BOOL;            (* Shortcut key pressed? *)
  159.     underscore           : E.UBYTE;           (* The underscore character *)
  160.     escClose             : E.BOOL;            (* Close window on Esc ? *)
  161.     delZip               : E.BOOL;            (* Zip window on Del ? *)
  162.     pubScreenFallBack    : E.BOOL;            (* Fall back onto default public screen ? *)
  163.     fontFallBack         : E.BOOL;            (* Fall back to topaz.8 ? *)
  164.     oldWidth             : E.UWORD;           (* Old window width *)
  165.     oldHeight            : E.UWORD;           (* Old window height *)
  166.     quickHelpWindow      : I.WindowPtr;       (* The QuickHelp window *)
  167.     quickHelpObject      : DisplayObjectPtr;  (* Object for which help is popped up *)
  168.     ticksPassed          : E.ULONG;           (* IntuiTicks passed since last MouseMove *)
  169.   END;
  170.  
  171. CONST
  172.  
  173. (* --- Message classes --- *)
  174.  
  175.   msCloseWindow* = 1; (* The window should be closed *)
  176.   msError*       = 2; (* An error occured. Error code in trm_Data *)
  177.   msNewValue*    = 3; (* Object's value has changed. New value in trm_Data *)
  178.   msAction*      = 4; (* Object has triggered an action *)
  179.   msIconDropped* = 5; (* Icon dropped over window (ID=0) or DropBox. AppMessage* in trm_Data *)
  180.   msKeyPressed*  = 6; (* Key pressed. trm_Data contains ASCII code, trm_Code raw code and *)
  181.                                    (* trm_Qualifier contains qualifiers *)
  182.   msHelp*        = 7; (* The user requested help for specified ID *)
  183.   msDiskInserted*= 8; (* A disk has been inserted into a drive *)
  184.   msDiskRemoved* = 9; (* A disk has been removed from a drive *)
  185.  
  186. (* --- Triton error codes --- *)
  187.  
  188.   erOk*              = 0;  (* No error *)
  189.   erAllocMem*        = 1;  (* Not enough memory *)
  190.   erOpenWindow*      = 2;  (* Can't open window *)
  191.   erWindowTooBig*    = 3;  (* Window would be too big for screen *)
  192.   erDrawInfo*        = 4;  (* Can't get screen's DrawInfo *)
  193.   erOpenFont*        = 5;  (* Can't open font *)
  194.   erCreateMsgPort*   = 6;  (* Can't create message port *)
  195.   erInstallObject*   = 7;  (* Can't create an object *)
  196.   erCreateClass*     = 8;  (* Can't create a class *)
  197.   erNoLockPubScreen* = 9;  (* Can't lock public screen *)
  198.   erInvalid*         = 10; (* Invalid NewMenu structure -> probably a bug in Triton *)
  199.   erNoMem*           = 11; (* Not enough memory for menu creation *)
  200.   erOtherCreate*     = 12; (* Other error while creating the menus *)
  201.   erLayout*          = 13; (* GadTools can't layout the menus *)
  202.   erCreateContext*   = 14; (* Can't create gadget context *)
  203.   erMaxErrorNum      = 15; (* PRIVATE! *)
  204.  
  205. (* Object messages *)
  206.   omActivate* = 23;
  207.  
  208. (* --- Tags for OpenProject() --- *)
  209.  
  210. (* Window *)
  211.   wiTitle*              = (U.user+1);  (* STRPTR: The window title *)
  212.   wiFlags*              = (U.user+2);  (* See below for window flags *)
  213.   wiUnderscore*         = (U.user+3);  (* POINTER TO CHAR: The underscore for menu and gadget shortcuts *)
  214.   wiPosition*           = (U.user+4);  (* Window position, see below *)
  215.   wiCustomScreen*       = (U.user+5);  (* ScreenPtr *)
  216.   wiPubScreen*          = (U.user+6);  (* ScreenPtr, must have been locked! *)
  217.   wiPubScreenName*      = (U.user+7);  (* STRPTR, Triton is doing the locking *)
  218.   wiPropFontAttr*       = (U.user+8);  (* TextAttrPtr: The proportional font *)
  219.   wiFixedWidthFontAttr* = (U.user+9);  (* TextAttrPtr: The fixed-width font *)
  220.   wiBackfill*           = (U.user+10); (* The backfill type, see below *)
  221.   wiID*                 = (U.user+11); (* ULONG: The window ID *)
  222.   wiDimensions*         = (U.user+12); (* DimensionsPtr *)
  223.   wiScreenTitle*        = (U.user+13); (* STRPTR : The screen title *)
  224.   wiQuickHelp*          = (U.user+14); (* BOOL: Quick help active? *)
  225.  
  226. (* Menus *)
  227.   mnTitle* = (U.user+101); (* STRPTR: Menu *)
  228.   mnItem*  = (U.user+102); (* STRPTR: Menu item *)
  229.   mnSub*   = (U.user+103); (* STRPTR: Menu subitem *)
  230.   mnFlags* = (U.user+104); (* See below for flags *)
  231.  
  232. (* General object attributes *)
  233.   atID*        = (U.user+150); (* The object's/menu's ID *)
  234.   atFlags*     = (U.user+151); (* The object's flags *)
  235.   atValue*     = (U.user+152); (* The object's value *)
  236.   atText*      = (U.user+153); (* The object's text *)
  237.   atDisabled*  = (U.user+154); (* Disabled object? *)
  238.   atBackfill*  = (U.user+155); (* Backfill pattern *)
  239.   atMinWidth*  = (U.user+156); (* Minimum width *)
  240.   atMinHeight* = (U.user+157); (* Minimum height *)
  241.  
  242.   user* = (U.user+800); (* Add something to get your own IDs *)
  243.  
  244. (* --- Window flags --- *)
  245.  
  246.   wfBackDrop*        = 000000001H; (* Create a backdrop borderless window *)
  247.   wfNoDragBar*       = 000000002H; (* Don't use a dragbar *)
  248.   wfNoDepthGadget*   = 000000004H; (* Don't use a depth-gadget *)
  249.   wfNoCloseGadget*   = 000000008H; (* Don't use a close-gadget *)
  250.   wfNoActivate*      = 000000010H; (* Don't activate window *)
  251.   wfNoEscClose*      = 000000020H; (* Don't send closeWindow when Esc is pressed *)
  252.   wfNoPScrFallback*  = 000000040H; (* Don't fall back onto default PubScreen *)
  253.   wfNoZipGadget*     = 000000080H; (* Don't use a zip-gadget *)
  254.   wfZipCenterTop*    = 000000100H; (* Center the zipped window on the title bar *)
  255.   wfNoMinTextWidth*  = 000000200H; (* Minimum window width not according to title text *)
  256.   wfNoSizeGadget*    = 000000400H; (* Don't use a sizing-gadget *)
  257.   wfNoFontFallback*  = 000000800H; (* Don't fall back to topaz.8 *)
  258.   wfNoDelZip*        = 000001000H; (* Don't zip the window when Del is pressed *)
  259.   wfSimpleRefresh*   = 000002000H; (* *** OBSOLETE *** (V3+) *)
  260.   wfZipToCurrentPos* = 000004000H; (* Will zip the window at the current position (OS3.0+) *)
  261.   wfAppWindow*       = 000008000H; (* Create an AppWindow without using class_dropbox *)
  262.   wfActivateStrGad*  = 000010000H; (* Activate the first string gadget after opening the window *)
  263.   wfHelp*            = 000020000H; (* Pressing <Help> will create a msHelp message *)
  264.   wfSystemAction*    = 000040000H; (* System status messages will be sent (V4) *)
  265.  
  266. (* --- Menu flags --- *)
  267.  
  268.   mfCheckIt*  = 000000001H; (* Leave space for a checkmark *)
  269.   mfChecked*  = 000000002H; (* Check the item (includes TRMF_CHECKIT) *)
  270.   mfDisabled* = 000000004H; (* Ghost the menu/item *)
  271.  
  272. (* --- Window positions --- *)
  273.  
  274.   wpDefault*       = 0;    (* Let Triton choose a good position *)
  275.   wpBelowTitlebar* = 1;    (* Left side of screen, below title bar *)
  276.   wpCenterTop*     = 1025; (* Top of screen, centered on the title bar *)
  277.   wpTopLeftScreen* = 1026; (* Top left corner of screen *)
  278.   wpCenterScreen*  = 1027; (* Centered on the screen *)
  279.   wpCenterDisplay* = 1028; (* Centered on the currently displayed clip *)
  280.   wpMousePointer*  = 1029; (* Under the mouse pointer *)
  281.   wpAboveCoords*   = 2049; (* Above coordinates from the dimensions struct *)
  282.   wpBelowCoords*   = 2050; (* Below coordinates from the dimensions struct *)
  283.  
  284. (* --- Backfill types --- *)
  285.  
  286.   bfWindowBack*       = 0;  (* Window backfill colors *)
  287.   bfRequesterBack*    = 1;  (* Requester backfill colors *)
  288.   bfNone*             = 2;  (* No backfill (= Fill with BACKGROUNDPEN) *)
  289.   bfShine*            = 3;  (* Fill with SHINEPEN *)
  290.   bfShineShadow*      = 4;  (* Fill with SHINEPEN + SHADOWPEN *)
  291.   bfShineFill*        = 5;  (* Fill with SHINEPEN + FILLPEN *)
  292.   bfShineBackground*  = 6;  (* Fill with SHINEPEN + BACKGROUNDPEN *)
  293.   bfShadow*           = 7;  (* Fill with SHADOWPEN *)
  294.   bfShadowFill*       = 8;  (* Fill with SHADOWPEN + FILLPEN *)
  295.   bfShadowBackground* = 9;  (* Fill with SHADOWPEN + BACKGROUNDPEN *)
  296.   bfFill*             = 10; (* Fill with FILLPEN *)
  297.   bfFillBackground*   = 11; (* Fill with FILLPEN + BACKGROUNDPEN *)
  298.  
  299. (* --- System images --- *)
  300.  
  301.   siUSButtonBack* = 10002; (* Unselected button backfill *)
  302.   siSButtonBack*  = 10003; (* Selected button backfill   *)
  303.  
  304. (* --- Display Object flags --- *)
  305.  
  306. (* General flags *)
  307.   ofRaised*     = 000000001H; (* Raised object *)
  308.   ofHoriz*      = 000000002H; (* Horizontal object \ Works automatically *)
  309.   ofVert*       = 000000004H; (* Vertical object   / in groups *)
  310.   ofRightAlign* = 000000008H; (* Align object to the right border if available *)
  311.  
  312. (* Text flags *)
  313.   txNoUnderscore* = 000000100H; (* Don't interpret underscores *)
  314.   txHighlight*    = 000000200H; (* Highlight text *)
  315.   tx3D*           = 000000400H; (* 3D design *)
  316.   txBold*         = 000000800H; (* Softstyle 'bold' *)
  317.   txTitle*        = 000001000H; (* A title (e.g. of a group) *)
  318.   txSelected      = 000002000H; (* PRIVATE! *)
  319.  
  320. (* --- Menu entries --- *)
  321.  
  322.   menuBarLabel* = -1; (* A barlabel instead of text *)
  323.  
  324. (* --- Tags for CreateApp() --- *)
  325.  
  326.   caName*     = (U.user+1);
  327.   caLongName* = (U.user+2);
  328.   caInfo*     = (U.user+3);
  329.   caVersion*  = (U.user+4);
  330.   caRelease*  = (U.user+5);
  331.   caDate*     = (U.user+6);
  332.  
  333. (* --- Tags for EasyRequest() --- *)
  334.  
  335.   ezReqPos*      = (U.user+1);
  336.   ezLockProject* = (U.user+2);
  337.   ezReturn*      = (U.user+3);
  338.   ezTitle*       = (U.user+4);
  339.   ezActivate*    = (U.user+5);
  340.  
  341. (* --- Default classes, attributes and flags --- *)
  342.  
  343. (* Tag bases *)
  344.   tgOAT = (U.user+400H);
  345.   tgOBJ = (U.user+100H);
  346.   tgPAT = U.user;
  347.  
  348. (* Display object *)
  349.   obDisplayObject*   = (tgOBJ+3CH);  (* A basic display object *)
  350.   doQuickHelpString* = (tgOAT+1E3H);
  351.  
  352. (* Classes *)
  353.   obButton*   = (U.user+305); (* A BOOPSI button gadget *)
  354.   obCheckBox* = (U.user+303); (* A checkbox gadget *)
  355.   obCycle*    = (U.user+310); (* A cycle gadget *)
  356.   obDropBox*  = (U.user+312); (* An icon drop box *)
  357.   obScroller* = (U.user+309); (* A scroller gadget *)
  358.   obFrameBox* = (U.user+306); (* A framing box *)
  359.   grHoriz*    = (U.user+201); (* Horizontal group, see below for types *)
  360.   grVert*     = (U.user+202); (* Vertical group, see below for types *)
  361.   grEnd*      = (U.user+203); (* End of a group *)
  362.   obLine*     = (U.user+301); (* A simple line *)
  363.   obPalette*  = (U.user+307); (* A palette gadget *)
  364.   obSlider*   = (U.user+308); (* A slider gadget *)
  365.   obSpace*    = (U.user+901); (* The spaces class *)
  366.   obString*   = (U.user+311); (* A string gadget *)
  367.   obText*     = (U.user+304); (* A line of text *)
  368.   obListview* = (U.user+313); (* A listview gadget *)
  369.   obProgress* = (U.user+314); (* A progress indicator *)
  370.   obImage*    = (tgOBJ+3BH);  (* An image *)
  371.  
  372. (* Button *)
  373.   buReturnOk*  = 000010000H; (* <Return> answers the button *)
  374.   buEscOk*     = 000020000H; (* <Esc> answers the button *)
  375.   buShifted*   = 000040000H; (* Shifted shortcut only *)
  376.   buUnshifted* = 000080000H; (* Unshifted shortcut only *)
  377.   buYResize*   = 000100000H; (* Button resizable in Y direction *)
  378.  
  379.   btText*      = 0;          (* Text button *)
  380.   btGetFile*   = 1;          (* GetFile button *)
  381.   btGetDrawer* = 2;          (* GetDrawer button *)
  382.   btGetEntry*  = 3;          (* GetEntry button *)
  383.  
  384. (* Group *)
  385.   grPropShare*  = 000000000H; (* Divide objects proportionally *)
  386.   grEqualShare* = 000000001H; (* Divide objects equally *)
  387.   grPropSpaces* = 000000002H; (* Divide spaces proportionally *)
  388.   grArray*      = 000000004H; (* Top-level array group *)
  389.   grAlign*      = 000000008H; (* Align resizeable objects in secondary dimension *)
  390.   grCenter*     = 000000010H; (* Center unresizeable objects in secondary dimension *)
  391.   grFixHoriz*   = 000000020H; (* Don't allow horizontal resizing *)
  392.   grFixVert*    = 000000040H; (* Don't allow vertical resizing *)
  393.   grIndep*      = 000000080H; (* Group is independant of surrounding array *)
  394.  
  395. (* Scroller *)
  396.   scTotal*   = (U.user+1504);
  397.   scVisible* = (U.user+1505);
  398.  
  399. (* Slider *)
  400.   slMin* = (U.user+1502);
  401.   slMax* = (U.user+1503);
  402.  
  403. (* Space *)
  404.   stNone*   = 1; (* No space *)
  405.   stSmall*  = 2; (* Small space *)
  406.   stNormal* = 3; (* Normal space (default) *)
  407.   stBig*    = 4; (* Big space *)
  408.  
  409. (* Listview *)
  410.   lvTop*          = (U.user+1506);
  411.   lvReadOnly*     = 000010000H;    (* A read-only list *)
  412.   lvSelect*       = 000020000H;    (* You may select an entry *)
  413.   lvShowSelected* = 000040000H;    (* Selected entry will be shown *)
  414.   lvNoCursorKeys* = 000080000H;    (* Don't use arrow keys *)
  415.   lvNoNumPadKeys* = 000100000H;    (* Don't use numeric keypad keys *)
  416.   lvFWFont*       = 000200000H;    (* Use the fixed-width font *)
  417.   lvNoGap*        = 000400000H;    (* Don`t leave a gap below the list *)
  418.  
  419. (* Cycle *)
  420.   cyMX*          = 00010000H; (* Unfold the cylce gadget to a MX gadget     *)
  421.   cyRightLabels* = 00020000H; (* Put the labels to the right of a MX gadget *)
  422.  
  423. (* Frame box *)
  424.   fbGrouping* = 00000001H; (* A grouping box   *)
  425.   fbFraming*  = 00000002H; (* A framing box    *)
  426.   fbText*     = 00000004H; (* A text container *)
  427.  
  428. (* Image *)
  429.   imBOOPSI* = 00010000H; (* Use a BOOPSI IClass image *)
  430.  
  431. (* String gadget *)
  432.   stInvisible*         = 10000H; (* A password gadget -> invisible typing *)
  433.   stNoReturnBroadCast* = 20000H; (* <Return> keys will not be broadcast to the window *)
  434.  
  435. VAR
  436.   base- : E.LibraryPtr;
  437.   supportApp : AppPtr;
  438.  
  439. (* --- Main system --- *)
  440.  
  441. PROCEDURE OpenProject*       {base,-30}  (app{9}: AppPtr; taglist{8}: ARRAY OF U.TagItem): ProjectPtr;
  442. PROCEDURE CloseProject*      {base,-36}  (project{8}: ProjectPtr);
  443. PROCEDURE FirstOccurance*    {base,-42}  (ch{0}: E.UBYTE; str{8}: E.STRPTR): E.LONG;
  444. PROCEDURE NumOccurances*     {base,-48}  (ch{0}: E.UBYTE; str{8}: E.STRPTR): E.LONG;
  445. PROCEDURE GetErrorString*    {base,-54}  (num{0}: E.UWORD): E.STRPTR;
  446. PROCEDURE CloseWindowSafely* {base,-126} (win{8}: I.WindowPtr);
  447. PROCEDURE GetMsg*            {base,-108} (app{9}: AppPtr): MessagePtr;
  448. PROCEDURE ReplyMsg*          {base,-114} (msg{9}: MessagePtr);
  449. PROCEDURE Wait*              {base,-120} (app{9}: AppPtr; otherbits{0}: E.ULONG): E.ULONG;
  450. PROCEDURE SetAttribute*      {base,-60}  (prj{8}: ProjectPtr; id{0}: E.ULONG; attribute{1}: E.ULONG; value{2}: E.ULONG);
  451. PROCEDURE GetAttribute*      {base,-66}  (prj{8}: ProjectPtr; id{0}: E.ULONG; attribute{1}: E.ULONG): E.ULONG;
  452. PROCEDURE LockProject*       {base,-72}  (prj{8}: ProjectPtr);
  453. PROCEDURE UnlockProject*     {base,-78}  (prj{8}: ProjectPtr);
  454. PROCEDURE AutoRequest*       {base,-84}  (app{9}: AppPtr; lockproject{8}: ProjectPtr; requestTRWindowTags{10}: ARRAY OF U.TagItem): E.ULONG;
  455. PROCEDURE EasyRequest*       {base,-90}  (app{9}: AppPtr; bodyfmt{10}: E.STRPTR; gadfmt{11}: E.STRPTR; taglist{8}: ARRAY OF U.TagItem): E.ULONG;
  456. PROCEDURE CreateApp*         {base,-96}  (apptags{9}: ARRAY OF U.TagItem): AppPtr;
  457. PROCEDURE DeleteApp*         {base,-102} (app{9}: AppPtr);
  458.  
  459. PROCEDURE GetLastError*      {base,-132} (app{9} : AppPtr) : E.UWORD;
  460. PROCEDURE LockScreen*        {base,-138} (prj{8} : ProjectPtr) : I.ScreenPtr;
  461. PROCEDURE UnlockScreen*      {base,-144} (scr{8} : I.ScreenPtr);
  462. PROCEDURE ObtainWindow*      {base,-150} (prj{8} : ProjectPtr) : I.WindowPtr;
  463. PROCEDURE ReleaseWindow*     {base,-156} (win{8} : I.WindowPtr);
  464.  
  465. PROCEDURE SendMessage*       {base,-162} (prj{8} : ProjectPtr; id{0} : E.ULONG; msgID{1} : MessagePtr) : E.ULONG;
  466.  
  467. (* --- Support library --- *)
  468.  
  469. (* OpenTriton() and CloseTriton() are obsolete under Oberon *)
  470.  
  471. PROCEDURE OpenProjectTags* {base,-30} (app{9}: AppPtr; tag{8}..: U.Tag): ProjectPtr;
  472. PROCEDURE AutoRequestTags* {base,-84} (app{9}: AppPtr; lockproject{8}: ProjectPtr; tag{10}..: U.Tag): E.ULONG;
  473. PROCEDURE EasyRequestTags* {base,-90} (app{9}: AppPtr; bodyfmt{10}: E.STRPTR; gadfmt{11}: E.STRPTR; tag{8}..: U.Tag): E.ULONG;
  474.  
  475. (* --- extensions by [phf] --- *)
  476.  
  477. PROCEDURE CreateAppTags* {base,-96}  (apptags{9}..: U.Tag): AppPtr;
  478.  
  479. (* --- get everything rolling --- *)
  480.  
  481. BEGIN
  482.  
  483.   (* supportApp is not used currently *)
  484.   supportApp := NIL;
  485.  
  486.   (* I'm not sure about the version. [phf] *)
  487.   base := E.OpenLibrary (tritonName, 0);
  488.  
  489. CLOSE
  490.  
  491.   IF (base # NIL) THEN E.CloseLibrary (base) END;
  492.  
  493. END Triton.
  494.