home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / develop / gadtoolsbox / gtxlib / hspascal / source / gtx.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1995-02-27  |  27.8 KB  |  903 lines

  1. unit GTX;
  2.  
  3. INTERFACE
  4. uses Exec, Graphics, Intuition, Gadtools, Utility;
  5.  
  6.  
  7. { ------------------------------------------------------------------------
  8.   :Program.       GadToolsBox
  9.   :Contents.      Interface to Jan van den Baard's Library
  10.   :Author.        Richard Waspe
  11.   :Address.       FIDO     :   2:255/72.2
  12.   :Address.       INTERNET :   waspy@cix.compulink.co.uk
  13.   :Address.       UUCP     :   rwaspe@hamlet.adsp.sub.org
  14.   :History.       v1.0 24-Feb-93 (translated from C and Oberon)
  15.   :History.       Library version bump to 39
  16.   :Copyright.     Freely Distributable
  17.   :Language.      PASCAL
  18.   :Translator.    Hisoft HSPascal V1.1
  19.   :Warning.                     First translation, compiles OK, but untested
  20. ------------------------------------------------------------------------ }
  21.  
  22. { From Forms.h}
  23.  
  24. CONST
  25.   { GadToolsBox FORM identifiers }
  26.   ID_GXMN       :       ARRAY [0..3] OF CHAR = ('G', 'X', 'M', 'N');
  27.   ID_GXTX       :       ARRAY [0..3] OF CHAR = ('G', 'X', 'T', 'X');
  28.   ID_GXBX       :       ARRAY [0..3] OF CHAR = ('G', 'X', 'B', 'X');
  29.   ID_GXGA       :       ARRAY [0..3] OF CHAR = ('G', 'X', 'G', 'A');
  30.   ID_GXWD       :       ARRAY [0..3] OF CHAR = ('G', 'X', 'W', 'D');
  31.  
  32.   { GadToolsBox chunk identifiers. }
  33.     ID_MEDA     :       ARRAY [0..3] OF CHAR = ('M', 'E', 'D', 'A');
  34.   ID_ITXT       :       ARRAY [0..3] OF CHAR = ('I', 'T', 'X', 'A');
  35.   ID_BBOX       :       ARRAY [0..3] OF CHAR = ('B', 'B', 'O', 'X');
  36.   ID_GADA       :       ARRAY [0..3] OF CHAR = ('G', 'A', 'D', 'A');
  37.   ID_WDDA       :       ARRAY [0..3] OF CHAR = ('W', 'D', 'D', 'A');
  38.   ID_GGUI       :       ARRAY [0..3] OF CHAR = ('G', 'G', 'U', 'I');
  39.  
  40.   { Version (ID_VERS) chunk... }
  41.   ID_VERS       :       ARRAY [0..3] OF CHAR = ('V', 'E', 'R', 'S');
  42.  
  43.  
  44. TYPE
  45.         pVERSION = ^tVERSION;
  46.         tVERSION = RECORD
  47.                 vr_Version      :       WORD;
  48.                 vr_Flags                :       WORD;
  49.                 vr_Reserved     :       ARRAY [0..3] OF LONGINT;
  50.         END;
  51.  
  52.   { NewMenu (ID_MEDA) chunk... }
  53. CONST
  54.         MAXMENUTITLE    =       80;     MMT     =       79;
  55.         MAXMENULABEL    =       34;     MML     =       33;
  56.         MAXSHORTCUT             =       2;              MSC     =       1;
  57.         MAXMENUVERSION  =       0;
  58.  
  59. TYPE
  60.         pMENUDATA       =       ^tMENUDATA;
  61.         tMENUDATA       =       RECORD
  62.                 mda_NewMenu     :       tNewMenu;
  63.                 mda_Title       :       ARRAY [0..MMT] OF BYTE;
  64.                 mda_Label       :       ARRAY [0..MML] OF BYTE;
  65.                 mda_ShortCut    :       ARRAY [0..MSC] OF BYTE;
  66.                 mda_Flags       :       WORD;
  67.   END;
  68.  
  69.   { IntuiText (ID_ITXT) chunk... }
  70. CONST
  71.         MAXTEXTLENGTH   =       80;     MTL     =       79;
  72.         ITXTVERSION             =       0;
  73.  
  74. TYPE
  75.         pITEXTDATA      =       ^tITEXTDATA;
  76.         tITEXTDATA      =       RECORD
  77.                 it_IText        :       tIntuiText;
  78.                 it_Text :       ARRAY [0..MTL] OF BYTE;
  79.         END;
  80.  
  81.   { BevelBox (ID_BBOX) chunk... }
  82. CONST
  83.         BBOXVERSION     =       0;
  84.  
  85. TYPE
  86.         pBBOXDATA       =       ^tBBOXDATA;
  87.         tBBOXDATA       =       RECORD
  88.                 bbx_Left                :       WORD;
  89.                 bbx_Top         :       WORD;
  90.                 bbx_Width       :       WORD;
  91.                 bbx_Height      :       WORD;
  92.                 bbx_Flags       :       WORD;
  93.         END;
  94.  
  95. CONST
  96.   { BevelBox flag bits }
  97.         BBF_RECESSED    =       1;
  98.         BBF_DROPBOX             =       1;
  99.  
  100.   { NewGadget (ID_GADA) chunk... }
  101. CONST
  102.         MAXGADGETTEXT   =       80;     MGT     =       79;
  103.         MAXGADGETLABEL  =       34;     MGL     =       33;
  104.         GADGETVERSION   =       0;
  105.  
  106. TYPE
  107.         pGADGETDATA     =       ^tGADGETDATA;
  108.         tGADGETDATA     =       RECORD
  109.                 gd_NewGadget    :       tNewGadget;
  110.                 gd_GadgetText   :       ARRAY [0..MGT] OF CHAR;
  111.                 gd_GadgetLabel  :       ARRAY [0..MGL] OF CHAR;
  112.                 gd_Flags                        :       LONGINT;
  113.                 gd_Kind                 :       WORD;
  114.                 gd_NumTags              :       WORD;
  115.                 gd_Reserved             : ARRAY [0..3] OF LONGINT;
  116.         END;
  117.  
  118.   { NewGadget flag bits }
  119. CONST
  120.         GDF_ISLOCKED    =       32;
  121.         GDF_NEEDLOCK    =       64;
  122.  
  123.   { Window (ID_WDDA) chunk... }
  124. CONST
  125.         MAXWINDOWNAME           =       34;     MWN     =       33;
  126.         MAXWINDOWTITLE          =       80;     MWT     =       79;
  127.         MAXWDSCREENTITLE        =       80;     MWST    =       79;
  128.         WINDOWVERSION           =       0;
  129.  
  130. TYPE
  131.         pWINDOWDATA     =       ^tWINDOWDATA;
  132.         tWINDOWDATA     =       RECORD
  133.                 wda_Name                                :       ARRAY [0..MWN] OF CHAR;
  134.                 wda_Title                       :       ARRAY [0..MWT] OF CHAR;
  135.                 wda_ScreenTitl          :       ARRAY [0..MWST] OF CHAR;
  136.                 wda_NumTags                     :       WORD;
  137.                 wda_IDCountFrom :       WORD;
  138.                 wda_IDCMP                       :       LONGINT;
  139.                 wda_WindowFlags :       LONGINT;
  140.                 wda_TagFlags            :       LONGINT;
  141.                 wda_InnerWidth          :       WORD;
  142.                 wda_InnerHeight :       WORD;
  143.                 wda_ShowTitle           :       BOOLEAN;
  144.                 wda_MouseQueue          :       WORD;
  145.                 wda_RptQueue            :       WORD;
  146.                 wda_Flags                       :       WORD;
  147.                 wda_LeftBorder          :       WORD;
  148.                 wda_TopBorder           :       WORD;
  149.                 wda_Reserved            :       ARRAY [0..9] OF BYTE;
  150.         END;
  151.  
  152. CONST
  153.   { Window tag flag bits }
  154.         WDF_INNERWIDTH      = 0;
  155.         WDF_INNERHEIGHT     = 1;
  156.         WDF_ZOOM            = 2;
  157.         WDF_MOUSEQUEUE      = 3;
  158.         WDF_RPTQUEUE        = 4;
  159.         WDF_AUTOADJUST      = 5;
  160.         WDF_DEFAULTZOOM     = 6;
  161.         WDF_FALLBACK        = 7;
  162.  
  163.   { GUI (ID_GGUI) chunk... }
  164. CONST
  165.         MAXSCREENTITLE  =       80;     MSTI    =       79;
  166.         FONTNAMELENGTH  =       128;    FNL     =       127;
  167.         MAXCOLORSPEC    =       33;     MCS     =       32;
  168.         MAXDRIPENS              =       10;     MDP     =       9;
  169.         MAXMOREDRIPENS  =       10;     MMDP    =       9;
  170.         GUIVERSION              =       0;
  171.  
  172. TYPE
  173.         pGUIDATA        =       ^tGUIDATA;
  174.         tGUIDATA        =       RECORD
  175.                 gui_Flags0                      :       LONGINT;
  176.                 gui_ScreenTitle :       ARRAY [0..MSTI] OF CHAR;
  177.                 gui_Left                                :       WORD;
  178.                 gui_Top                         :       WORD;
  179.                 gui_Width                       :       WORD;
  180.                 gui_Height                      :       WORD;
  181.                 gui_Depth                       :       WORD;
  182.                 gui_DisplayID           :       LONGINT;
  183.                 gui_Overscan            :       WORD;
  184.                 gui_DriPens                     :       ARRAY [0..MDP] OF WORD;
  185.                 gui_Colors                      :       ARRAY [0..MCS] OF tColorSpec;
  186.                 gui_FontName            :       ARRAY [0..FNL] OF CHAR;
  187.                 gui_Font                                :       tTextAttr;
  188.                 gui_MoreDriPens :       ARRAY [0..MMDP] OF WORD;
  189.                 gui_Reserved            :       ARRAY [0..4] OF LONGINT;
  190.         {Following fields are PRIVATE }
  191.                 gui_Flags1                      :       LONGINT;
  192.                 gui_StdScreenWidth      :       WORD;
  193.                 gui_StdScreenHeight     :       WORD;
  194.                 gui_ActiveKind                  :       WORD;
  195.                 gui_LastProject         :       WORD;
  196.                 gui_GridX                               :       WORD;
  197.                 gui_GridY                               :       WORD;
  198.                 gui_OffX                                        :       WORD;
  199.                 gui_OffY                                        :       WORD;
  200.                 gui_Reserved1                   :       ARRAY [0..6] OF WORD;
  201.         END;
  202.  
  203. CONST
  204.   { GUI gui_Flags0 flag bits }
  205.   GU0_AUTOSCROLL = 0;
  206.   GU0_WORKBENCH  = 1;
  207.   GU0_PUBLIC     = 2;
  208.   GU0_CUSTOM     = 3;
  209.  
  210.  
  211. {               ***             From Prefs.h            ***              }
  212.  
  213.  
  214. CONST
  215.         GTBCONFIGSAVE   =       'ENVARC:GadToolsBox/GadToolsBox.prefs';
  216.         GTBCONFIGUSE    =       'ENV:GadToolsBox/GadToolsBox.prefs';
  217.  
  218.         GTBCONFIGVERSION        =       0;
  219.         MAXUSERNAME                     =       64;     MUN     =       63;
  220.         MAXICONPATH                     =       128;    MICP    =       127;
  221.  
  222.         ID_GTCO :       ARRAY [0..3] OF CHAR = ('G', 'T', 'C', 'O');
  223.  
  224. TYPE
  225.         pGadToolsConfig =       ^tGadToolsConfig;
  226.         tGadToolsConfig =       RECORD
  227.                 gtc_ConfigFlags0        :       LONGINT;
  228.                 gtc_ConfigFlags1        :       LONGINT;
  229.                 gtc_CrunchBuffer        :       WORD;
  230.                 gtc_CrunchType          :       WORD;
  231.                 gtc_UserName            :       ARRAY [0..MUN] OF CHAR;
  232.                 gtc_IconPath            :       ARRAY [0..MICP] OF CHAR;
  233.                 gtc_Reserved            :       ARRAY [0..3] OF LONGINT;
  234.         END;
  235.  
  236.   { flag definitions for gtc_ConfigFlags0 }
  237. CONST
  238.         GC0_COORDINATES =       1;
  239.         GC0_WRITEICON           =       2;
  240.         GC0_GZZADJUST           =       4;
  241.         GC0_CRUNCH                      =       8;
  242.         GC0_CLOSEWBENCH =       16;
  243.         GC0_PASSWORD            =       32;
  244.         GC0_OVERWRITE           =       64;
  245.         GC0_ASLFREQ                     =       128;
  246.         GC0_FONTADAPT           =       256;
  247.         GC0_USEPUBSCREEN        =       512;
  248.  
  249.  
  250. {       GadToolsBox Library generation prefs file format }
  251. {       NOTE : This is not yet supported }
  252.  
  253.  
  254. CONST
  255.         GTLIBGENSAVE            =       'ENVARC:GadToolsBox/LibGen.Prefs';
  256.         GTBLIBGENUSE            =       'ENV:GadToolsBox/Libgen.Prefs';
  257.         GTBLIBGENVERSION        =       0;
  258.         MAXLIBNAME                      =       32;     MLN     =       31;
  259.         MAXBASENAME                     =       32;     MBN     =       31;
  260.         ID_LIBG :       ARRAY [0..3] OF CHAR = ('L', 'I', 'B', 'G');
  261.  
  262.  
  263. TYPE
  264.         tLibraryGen     =       RECORD
  265.                 lg_LibraryName          :       ARRAY [0..MLN] OF CHAR;
  266.                 lg_LibraryBase          :       ARRAY [0..MBN] OF CHAR;
  267.                 lg_Flags                                :       WORD;
  268.                 lg_MinVersion           :       WORD;
  269.                 lg_Reserved                     :       ARRAY [0..3] OF LONGINT;
  270.         END;
  271.  
  272. { Flags for the Library generation preferences }
  273.  
  274. CONST
  275.         LGF_GENERATE            =       1;
  276.         LGF_MODULE                      =       2;
  277.         LGF_FAILREQ                     =       4;
  278.         LGF_DISKLIB                     =       8;
  279.         LGF_INTERNAL            =       16;
  280.  
  281.  
  282.  
  283. {               ***             From  GTXbase.h         ***             }
  284.  
  285.  
  286.  
  287. CONST
  288.   GTXNAME               =       'gadtoolsbox.library';
  289.   GTXVERSION    =       39;
  290.  
  291. TYPE
  292.         pGTXBASE                =       ^tGTXBase;
  293.         tGTXBase                =       RECORD
  294.                 LibNode :       tLibrary;
  295.  
  296. {    These library bases may be extracted from this structure}
  297. {    for your own usage as long as the GTXBase pointer remains}
  298. {    valid.}
  299.  
  300.                 DosBase                 :               pLibrary;
  301.                 IntuitionBase   :               pLibrary;
  302.                 GFXBase                 :               pLibrary;
  303.                 GadToolsBase    :               pLibrary;
  304.                 UtilityBase             :               pLibrary;
  305.                 IFFParseBase    :               pLibrary;
  306.                 ConsoleDevice   :               pLibrary;
  307.                 NoFragBase              :               pLibrary;
  308.     {
  309.     The next library pointer is not guaranteed to
  310.     be valid! Please check this pointer *before* using
  311.     it.
  312.     }
  313.                 PPBase                  :               pLibrary;
  314.   END;
  315.  
  316.  
  317.  
  318. {               ***             From  Gui.h             ***             }
  319.  
  320. TYPE
  321.         pExtNewGadget   =       ^tExtNewGadget;
  322.  
  323.         pExtGadgetList  =       ^tExtGadgetList;
  324.         tExtGadgetList  =       RECORD
  325.                 gl_First                :       pExtNewGadget;
  326.                 gl_EndMark      :       pExtNewGadget;
  327.                 gl_Last         :       pExtNewGadget;
  328.         END;
  329.  
  330.         tExtNewGadget   =       RECORD
  331.                 en_Next                 :       pExtNewGadget;
  332.                 en_Prev                 :       pExtNewGadget;
  333.                 en_Tags                 :       pTagItem;
  334.                 en_Reserved0    :       ARRAY [0..3] OF BYTE;
  335.                 en_NewGadget    :       tNewGadget;
  336.                 en_GadgetLabel  :       ARRAY [0..MGL] OF CHAR;
  337.                 en_GadgetText   :       ARRAY [0..MGT] OF CHAR;
  338.                 en_Flags                        :       LONGINT;
  339.                 en_Kind                 :       WORD;
  340.                 en_Reserved1    :       ARRAY [0..137] OF BYTE;
  341.         END;
  342.  
  343.  
  344.         pExtNewMenu             =       ^tExtNewMenu;
  345.  
  346.         pExtMenuList    =       ^tExtMenuList;
  347.         tExtMenuList    =       RECORD
  348.                 ml_First                :       pExtNewMenu;
  349.                 ml_EndMark      :       pExtNewMenu;
  350.                 ml_Last         :       pExtNewMenu;
  351.         END;
  352.  
  353.         tExtNewMenu             =       RECORD
  354.                 em_Next                 :       pExtNewMenu;
  355.                 em_Prev                 :       pExtNewMenu;
  356.                 em_Reserved0    :       ARRAY [0..5] OF BYTE;
  357.                 em_NewMenu              :       tNewMenu;
  358.                 em_MenuTitle    :       ARRAY [0..MMT] OF CHAR;
  359.                 em_MenuLabel    :       ARRAY [0..MML] OF CHAR;
  360.                 em_Reserved1    :       ARRAY [0..3] OF BYTE;
  361.                 em_Items                        :       pExtMenuList;
  362.                 em_Reserved2    :       ARRAY [0..1] OF BYTE;
  363.                 em_CommKey              :       ARRAY [0..MSC] OF CHAR;
  364.                 em_Reserved3    :       ARRAY [0..1] OF BYTE;
  365.         END;
  366.  
  367.  
  368.         pBevelBox       =       ^tBevelBox;
  369.         pBevelList      =       ^tBevelList;
  370.         tBevelList      =       RECORD
  371.                 bl_First                :       pBevelBox;
  372.                 bl_EndMark      :       pBevelBox;
  373.                 bl_Last         :       pBevelBox;
  374.         END;
  375.  
  376.  
  377.         tBevelBox       =       RECORD
  378.                 bb_Next                 :       pBevelBox;
  379.                 bb_Prev                 :       pBevelBox;
  380.                 bb_Reserved0    :       ARRAY [0..3] OF BYTE;
  381.                 bb_Left                 :       WORD;
  382.                 bb_Top                  :       WORD;
  383.                 bb_Width                        :       WORD;
  384.                 bb_Height               :       WORD;
  385.                 bb_Reserved1    :       ARRAY [0..31] OF BYTE;
  386.                 bb_Flags                        :       WORD;
  387.         END;
  388.  
  389.  
  390.         pProjectWindow          =       ^tProjectWindow;
  391.         pWindowList                     =       ^tWindowList;
  392.         tWindowList             =       RECORD
  393.                 wl_First                :       pProjectWindow;
  394.                 wl_EndMark      :       pProjectWindow;
  395.                 wl_Last         :       pProjectWindow;
  396.         END;
  397.  
  398.  
  399.         tProjectWindow          =       RECORD
  400.                 pw_Next                 :       pProjectWindow;
  401.                 pw_Prev                 :       pProjectWindow;
  402.                 pw_Reserved0    :       ARRAY [0..5] OF BYTE;
  403.                 pw_Name                 :       ARRAY [0..MWN] OF CHAR;
  404.                 pw_CountIDFrom  :       WORD;
  405.                 pw_Tags                 :       pTagItem;
  406.                 pw_LeftBorder   :       WORD;
  407.                 pw_TopBorder    :       WORD;
  408.                 pw_WindowTitle  :       ARRAY [0..MWT] OF CHAR;
  409.                 pw_ScreenTitle  :       ARRAY [0..MWST] OF CHAR;
  410.                 pw_Reserved2            :       ARRAY [0..191] OF BYTE;
  411.                 pw_IDCMP                        :       LONGINT;
  412.                 pw_WindowFlags  :       LONGINT;
  413.                 pw_WindowText   :       pIntuiText;
  414.                 pw_Gadgets              :       tExtGadgetList;
  415.                 pw_Menus                        :       tExtMenuList;
  416.                 pw_Boxes                        :       tBevelList;
  417.                 pw_TagFlags             :       LONGINT;
  418.                 pw_InnerWidth   :       WORD;
  419.                 pw_InnerHeight  :       WORD;
  420.                 pw_ShowTitle    :       BOOLEAN;
  421.                 pw_Reserved3    :       ARRAY [0..5] OF BYTE;
  422.                 pw_MouseQueue   :       WORD;
  423.                 pw_RptQueue             :       WORD;
  424.                 pw_Flags                        :       WORD;
  425.         END;
  426.  
  427.  
  428.   { tags for the GTX_LoadGUI() routine }
  429.  
  430. CONST
  431.  
  432.         RG_TagBase              =       $80000200;
  433.  
  434.         RG_GUI                  =       $80000201;
  435.         RG_Config               =       $80000202;
  436.         RG_CConfig              =       $80000203;
  437.         RG_AsmConfig    =       $80000204;
  438.         RG_LibGen               =       $80000205;
  439.         RG_WindowList   =       $80000206;
  440.         RG_Valid                        =       $80000207;
  441.         RG_PasswordEntry        =       $80000208;
  442.  
  443.         VLF_GUI                 =       1;
  444.         VLF_CONFIG              =       2;
  445.         VLF_CCONFIG             =       4;
  446.         VLF_ASMCONFIG   =       8;
  447.         VLF_LIBGEN              =       16;
  448.         VLF_WINDOWLIST  =       32;
  449.  
  450.         ERROR_NOMEM      = 1;
  451.         ERROR_OPEN       = 2;
  452.         ERROR_READ       = 3;
  453.         ERROR_WRITE      = 4;
  454.         ERROR_PARSE      = 5;
  455.         ERROR_PACKER     = 6;
  456.         ERROR_PPLIB      = 7;
  457.         ERROR_NOTGUIFILE = 8;
  458.  
  459.  
  460.  
  461. {               ***             From Hotkey.h           ***             }
  462.  
  463.  
  464. { A _very_ important handle }
  465.  
  466. TYPE
  467.  
  468.         HOTKEYHANDLE    =       LONGINT;
  469.  
  470. CONST
  471.  
  472.   { Flags for the HKH_SetRepeat tag }
  473.   SRB_MX                                =       0;
  474.   SRF_MX                                =       1;
  475.   SRB_CYCLE                     =       1;
  476.   SRF_CYCLE                     =       2;
  477.   SRB_SLIDER            =       2;
  478.   SRF_SLIDER            =       4;
  479.   SRB_SCROLLER          =       3;
  480.   SRF_SCROLLER          =       8;
  481.   SRB_LISTVIEW          =       4;
  482.   SRF_LISTVIEW          =       16;
  483.   SRB_PALETTE           =       5;
  484.   SRF_PALETTE           =       32;
  485.  
  486.  
  487.   { tags for the hotkey system }
  488.  
  489.   HKH_TagBase                   =       $80000100;
  490.   HKH_KeyMap                    =       $80000101;
  491.   HKH_UseNewButton      =       $80000102;
  492.   HKH_NewText                   =       $80000103;
  493.   HKH_SetRepeat         =       $80000104;
  494.  
  495.  
  496.  
  497.  
  498. {               ***             From Textclass.h                ***             }
  499.  
  500.   TX_TagBase                    =       $80000001;
  501.  
  502.   TX_TX_tAttr                   =       $80000002;
  503.   TX_Style                              =       $80000003;
  504.   TX_ForceTextPen               =       $80000004;
  505.   TX_Underscore         =       $80000005;
  506.   TX_Flags                              =       $80000006;
  507.   TX_Text                               =       $80000007;
  508.   TX_NoBox                              =       $80000008;
  509.  
  510.  
  511.  
  512.  
  513. { LIBRARY FUNCTION DESCRIPTIONS }
  514.  
  515. function GTX_TagInArray
  516.                 (tag: longint;
  517.                 taglist: pointer): longint;
  518.  
  519. function GTX_SetTagData
  520.                 (tag,
  521.                 data: longint;
  522.                 taglist: pointer): longint;
  523.  
  524. function GTX_GetNode
  525.                 (list: pointer;
  526.                 nodenum: longint): longint;
  527.  
  528. function GTX_GetNodeNumber
  529.                 (list,
  530.                 node: pointer): longint;
  531.  
  532. function GTX_CountNodes (list: pointer): longint;
  533. function GTX_MoveNode
  534.                 (list,
  535.                 node: pointer;
  536.                 direction: longint): longint;
  537.  
  538. function GTX_IFFErrToStr
  539.                 (error,
  540.                 skipendof: longint): longint;
  541.  
  542. function GTX_GetHandleA (tags: pointer): longint;
  543. function GTX_FreeHandle (handle: pointer): longint;
  544. function GTX_RefreshWindow
  545.                 (handle,
  546.                 window,
  547.                 requester: pointer): longint;
  548.  
  549. function GTX_CreateGadgetA
  550.                 (handle: pointer;
  551.                 kind: longint;
  552.                 pred,
  553.                 newgadget,
  554.                 tags: pointer): longint;
  555.  
  556. function GTX_RawToVanilla
  557.                 (handle: pointer;
  558.                 code,
  559.                 qualifier: longint): longint;
  560.  
  561. function GTX_GetIMsg
  562.                 (handle,
  563.                 port: pointer): longint;
  564.  
  565. function GTX_ReplyIMsg
  566.                 (handle,
  567.                 imsg: pointer): longint;
  568.  
  569. function GTX_SetGadgetAttrsA
  570.                 (handle,
  571.                 gadget,
  572.                 tags: pointer): longint;
  573.  
  574. function GTX_DetachLabels
  575.                 (handle,
  576.                 gadget: pointer): longint;
  577.  
  578. function GTX_DrawBox
  579.                 (rport: pointer;
  580.                 left,
  581.                 top,
  582.                 width,
  583.                 height: longint;
  584.                 dri: pointer;
  585.                 state: longint): longint;
  586.  
  587. function GTX_InitTextClass: longint;
  588. function GTX_InitGetFileClass: longint;
  589. function GTX_SetHandleAttrsA
  590.                 (handle,
  591.                 taglist: pointer): longint;
  592.  
  593. function GTX_BeginRefresh (handle: pointer): longint;
  594. function GTX_EndRefresh
  595.                 (handle: pointer;
  596.                 all: longint): longint;
  597.  
  598. function GTX_FreeWindows
  599.                 (chain,
  600.                 windows: pointer): longint;
  601.  
  602. function GTX_LoadGUIA
  603.                 (chain,
  604.                 name,
  605.                 tags: pointer): longint;
  606.  
  607.  
  608.  
  609. var
  610.   GTXBase: pLibrary;
  611.  
  612.  
  613.  
  614.  
  615.  
  616. IMPLEMENTATION
  617.  
  618. function GTX_TagInArray; xassembler;
  619. asm
  620.         move.l  a6,-(sp)
  621.         lea             8(sp),a6
  622.         move.l  (a6)+,a0
  623.         move.l  (a6)+,d0
  624.         move.l  GTXBase,a6
  625.         jsr             -$1E(a6)
  626.         move.l  d0,$10(sp)
  627.         move.l  (sp)+,a6
  628. end;
  629.  
  630. function GTX_SetTagData; xassembler;
  631. asm
  632.         move.l  a6,-(sp)
  633.         lea             8(sp),a6
  634.         move.l  (a6)+,a0
  635.         move.l  (a6)+,d1
  636.         move.l  (a6)+,d0
  637.         move.l  GTXBase,a6
  638.         jsr             -$24(a6)
  639.         move.l  d0,$14(sp)
  640.         move.l  (sp)+,a6
  641. end;
  642.  
  643. function GTX_GetNode; xassembler;
  644. asm
  645.         move.l  a6,-(sp)
  646.         movem.l 8(sp),d0/a0
  647.         move.l  GTXBase,a6
  648.         jsr             -$2A(a6)
  649.         move.l  d0,$10(sp)
  650.         move.l  (sp)+,a6
  651. end;
  652.  
  653. function GTX_GetNodeNumber; xassembler;
  654. asm
  655.         move.l  a6,-(sp)
  656.         lea             8(sp),a6
  657.         move.l  (a6)+,a1
  658.         move.l  (a6)+,a0
  659.         move.l  GTXBase,a6
  660.         jsr             -$30(a6)
  661.         move.l  d0,$10(sp)
  662.         move.l  (sp)+,a6
  663. end;
  664.  
  665. function GTX_CountNodes; xassembler;
  666. asm
  667.         move.l  a6,-(sp)
  668.         move.l  8(sp),a0
  669.         move.l  GTXBase,a6
  670.         jsr             -$36(a6)
  671.         move.l  d0,$C(sp)
  672.         move.l  (sp)+,a6
  673. end;
  674.  
  675. function GTX_MoveNode; xassembler;
  676. asm
  677.         move.l  a6,-(sp)
  678.         lea             8(sp),a6
  679.         move.l  (a6)+,d0
  680.         move.l  (a6)+,a1
  681.         move.l  (a6)+,a0
  682.         move.l  GTXBase,a6
  683.         jsr             -$3C(a6)
  684.         move.l  d0,$14(sp)
  685.         move.l  (sp)+,a6
  686. end;
  687.  
  688. function GTX_IFFErrToStr; xassembler;
  689. asm
  690.         move.l  a6,-(sp)
  691.         lea             8(sp),a6
  692.         move.l  (a6)+,d1
  693.         move.l  (a6)+,d0
  694.         move.l  GTXBase,a6
  695.         jsr             -$42(a6)
  696.         move.l  d0,$10(sp)
  697.         move.l  (sp)+,a6
  698. end;
  699.  
  700. function GTX_GetHandleA; xassembler;
  701. asm
  702.         move.l  a6,-(sp)
  703.         move.l  8(sp),a0
  704.         move.l  GTXBase,a6
  705.         jsr             -$48(a6)
  706.         move.l  d0,$C(sp)
  707.         move.l  (sp)+,a6
  708. end;
  709.  
  710. function GTX_FreeHandle; xassembler;
  711. asm
  712.         move.l  a6,-(sp)
  713.         move.l  8(sp),a0
  714.         move.l  GTXBase,a6
  715.         jsr             -$4E(a6)
  716.         move.l  d0,$C(sp)
  717.         move.l  (sp)+,a6
  718. end;
  719.  
  720. function GTX_RefreshWindow; xassembler;
  721. asm
  722.         movem.l a2/a6,-(sp)
  723.         lea             $C(sp),a6
  724.         move.l  (a6)+,a2
  725.         move.l  (a6)+,a1
  726.         move.l  (a6)+,a0
  727.         move.l  GTXBase,a6
  728.         jsr             -$54(a6)
  729.         move.l  d0,$18(sp)
  730.         movem.l (sp)+,a2/a6
  731. end;
  732.  
  733. function GTX_CreateGadgetA; xassembler;
  734. asm
  735.         movem.l a2-a3/a6,-(sp)
  736.         lea             $10(sp),a6
  737.         move.l  (a6)+,a3
  738.         move.l  (a6)+,a2
  739.         move.l  (a6)+,a1
  740.         move.l  (a6)+,d0
  741.         move.l  (a6)+,a0
  742.         move.l  GTXBase,a6
  743.         jsr             -$5A(a6)
  744.         move.l  d0,$24(sp)
  745.         movem.l (sp)+,a2-a3/a6
  746. end;
  747.  
  748. function GTX_RawToVanilla; xassembler;
  749. asm
  750.         move.l  a6,-(sp)
  751.         lea             8(sp),a6
  752.         move.l  (a6)+,d1
  753.         move.l  (a6)+,d0
  754.         move.l  (a6)+,a0
  755.         move.l  GTXBase,a6
  756.         jsr             -$60(a6)
  757.         move.l  d0,$14(sp)
  758.         move.l  (sp)+,a6
  759. end;
  760.  
  761. function GTX_GetIMsg; xassembler;
  762. asm
  763.         move.l  a6,-(sp)
  764.         lea             8(sp),a6
  765.         move.l  (a6)+,a1
  766.         move.l  (a6)+,a0
  767.         move.l  GTXBase,a6
  768.         jsr             -$66(a6)
  769.         move.l  d0,$10(sp)
  770.         move.l  (sp)+,a6
  771. end;
  772.  
  773. function GTX_ReplyIMsg; xassembler;
  774. asm
  775.         move.l  a6,-(sp)
  776.         lea             8(sp),a6
  777.         move.l  (a6)+,a1
  778.         move.l  (a6)+,a0
  779.         move.l  GTXBase,a6
  780.         jsr             -$6C(a6)
  781.         move.l  d0,$10(sp)
  782.         move.l  (sp)+,a6
  783. end;
  784.  
  785. function GTX_SetGadgetAttrsA; xassembler;
  786. asm
  787.         movem.l a2/a6,-(sp)
  788.         lea             $C(sp),a6
  789.         move.l  (a6)+,a2
  790.         move.l  (a6)+,a1
  791.         move.l  (a6)+,a0
  792.         move.l  GTXBase,a6
  793.         jsr             -$72(a6)
  794.         move.l  d0,$18(sp)
  795.         movem.l (sp)+,a2/a6
  796. end;
  797.  
  798. function GTX_DetachLabels; xassembler;
  799. asm
  800.         move.l  a6,-(sp)
  801.         lea             8(sp),a6
  802.         move.l  (a6)+,a1
  803.         move.l  (a6)+,a0
  804.         move.l  GTXBase,a6
  805.         jsr             -$78(a6)
  806.         move.l  d0,$10(sp)
  807.         move.l  (sp)+,a6
  808. end;
  809.  
  810. function GTX_DrawBox; xassembler;
  811. asm
  812.         movem.l d3-d4/a6,-(sp)
  813.         lea             $10(sp),a6
  814.         move.l  (a6)+,d4
  815.         move.l  (a6)+,a1
  816.         move.l  (a6)+,d3
  817.         move.l  (a6)+,d2
  818.         move.l  (a6)+,d1
  819.         move.l  (a6)+,d0
  820.         move.l  (a6)+,a0
  821.         move.l  GTXBase,a6
  822.         jsr             -$7E(a6)
  823.         move.l  d0,$2C(sp)
  824.         movem.l (sp)+,d3-d4/a6
  825. end;
  826.  
  827. function GTX_InitTextClass; xassembler;
  828. asm
  829.         movem.l d3-d4/a6,-(sp)
  830.         move.l  GTXBase,a6
  831.         jsr             -$84(a6)
  832.         move.l  d0,$10(sp)
  833.         movem.l (sp)+,d3-d4/a6
  834. end;
  835.  
  836. function GTX_InitGetFileClass; xassembler;
  837. asm
  838.         movem.l d3-d4/a6,-(sp)
  839.         move.l  GTXBase,a6
  840.         jsr             -$8A(a6)
  841.         move.l  d0,$10(sp)
  842.         movem.l (sp)+,d3-d4/a6
  843. end;
  844.  
  845. function GTX_SetHandleAttrsA; xassembler;
  846. asm
  847.         move.l  a6,-(sp)
  848.         lea             8(sp),a6
  849.         move.l  (a6)+,a1
  850.         move.l  (a6)+,a0
  851.         move.l  GTXBase,a6
  852.         jsr             -$90(a6)
  853.         move.l  d0,$10(sp)
  854.         move.l  (sp)+,a6
  855. end;
  856.  
  857. function GTX_BeginRefresh; xassembler;
  858. asm
  859.         move.l  a6,-(sp)
  860.         move.l  8(sp),a0
  861.         move.l  GTXBase,a6
  862.         jsr             -$96(a6)
  863.         move.l  d0,$C(sp)
  864.         move.l  (sp)+,a6
  865. end;
  866.  
  867. function GTX_EndRefresh; xassembler;
  868. asm
  869.         move.l  a6,-(sp)
  870.         movem.l 8(sp),d0/a0
  871.         move.l  GTXBase,a6
  872.         jsr             -$9C(a6)
  873.         move.l  d0,$10(sp)
  874.         move.l  (sp)+,a6
  875. end;
  876.  
  877. function GTX_FreeWindows; xassembler;
  878. asm
  879.         move.l  a6,-(sp)
  880.         lea             8(sp),a6
  881.         move.l  (a6)+,a1
  882.         move.l  (a6)+,a0
  883.         move.l  GTXBase,a6
  884.         jsr             -$E4(a6)
  885.         move.l  d0,$10(sp)
  886.         move.l  (sp)+,a6
  887. end;
  888.  
  889. function GTX_LoadGUIA; xassembler;
  890. asm
  891.         movem.l a2/a6,-(sp)
  892.         lea             $C(sp),a6
  893.         move.l  (a6)+,a2
  894.         move.l  (a6)+,a1
  895.         move.l  (a6)+,a0
  896.         move.l  GTXBase,a6
  897.         jsr             -$EA(a6)
  898.         move.l  d0,$18(sp)
  899.         movem.l (sp)+,a2/a6
  900. end;
  901.  
  902. end.
  903.