home *** CD-ROM | disk | FTP | other *** search
/ 73.234.73.94.ip.orionnet.ru / 73.234.73.94.ip.orionnet.ru.tar / 73.234.73.94.ip.orionnet.ru / Far30b3000.x86.20121208.msi / PluginW.pas < prev    next >
Pascal/Delphi Source File  |  2012-12-08  |  105KB  |  4,348 lines

  1. {
  2.   PluginW.pas
  3.  
  4.   Plugin API for FAR Manager 3.0 build 3000
  5.  
  6.   ╤≥α≥≤± πε≥εΓφε±≥Φ: ~95%
  7.   ═σΣεΣσδαφφ√σ ±≥≡≤Ω≥≤≡√ (~15 °≥) ∩ε∞σ≈σφ√ !!!
  8. }
  9.  
  10. {
  11. Copyright (c) 1996 Eugene Roshal
  12. Copyright (c) 2000 Far Group
  13. All rights reserved.
  14.  
  15. Redistribution and use in source and binary forms, with or without
  16. modification, are permitted provided that the following conditions
  17. are met:
  18. 1. Redistributions of source code must retain the above copyright
  19.    notice, this list of conditions and the following disclaimer.
  20. 2. Redistributions in binary form must reproduce the above copyright
  21.    notice, this list of conditions and the following disclaimer in the
  22.    documentation and/or other materials provided with the distribution.
  23. 3. The name of the authors may not be used to endorse or promote products
  24.    derived from this software without specific prior written permission.
  25.  
  26. THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR
  27. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  28. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  29. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  30. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  31. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  32. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  33. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  34. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  35. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36.  
  37. EXCEPTION:
  38. Far Manager plugins that use this header file can be distributed under any
  39. other possible license with no implications from the above license on them.
  40. }
  41.  
  42. {$ifndef FarAPI}
  43.  
  44. {$Align On}
  45. {$RangeChecks Off}
  46.  
  47. {$ifdef FPC}
  48.  {$PACKRECORDS C}
  49. {$endif FPC}
  50.  
  51. Unit PluginW;
  52.  
  53. interface
  54.  
  55. uses Windows;
  56. {$endif FarAPI}
  57.  
  58. {$ifndef ApiImpl}
  59. const
  60.   FARMANAGERVERSION_MAJOR = 3;
  61.   FARMANAGERVERSION_MINOR = 0;
  62.   FARMANAGERVERSION_REVISION = 0;
  63.   FARMANAGERVERSION_BUILD = 2903;
  64.  
  65. type
  66. //TFarChar = AnsiChar;
  67. //PFarChar = PAnsiChar;
  68.  
  69.   TFarChar = WideChar;
  70.   PFarChar = PWideChar;
  71.  
  72.  {$ifdef CPUX86_64}
  73.   INT_PTR = PtrInt;
  74.   LONG_PTR = PtrInt;
  75.   DWORD_PTR = PtrUInt;
  76.   SIZE_T = PtrUInt;
  77.  {$else}
  78.  {$ifdef Win64}
  79.   INT_PTR = IntPtr;
  80.   LONG_PTR = IntPtr;
  81.   DWORD_PTR = UIntPtr;
  82.   SIZE_T = UIntPtr;
  83.  {$else}
  84.   INT_PTR = Integer;
  85.   LONG_PTR = Integer;
  86.   DWORD_PTR = Cardinal;
  87.   SIZE_T = Cardinal;
  88.  {$endif CPUX86_64}
  89.  {$endif Win64}
  90.  
  91.   TIntPtr = INT_PTR;
  92.   TUIntPtr = DWORD_PTR;
  93.  
  94.   PPCharArray = ^TPCharArray;
  95.   TPCharArray = packed array[0..MaxInt div SizeOf(PFarChar) - 1] of PFarChar;
  96.  
  97. //PIntegerArray = ^TIntegerArray;
  98. //TIntegerArray = packed array[0..Pred(MaxLongint div SizeOf(Integer))] of Integer;
  99.  
  100.   PIntPtrArray = ^TIntPtrArray;
  101.   TIntPtrArray = packed array[0..Pred(MaxLongint div SizeOf(TIntPtr))] of TIntPtr;
  102.  
  103.   PGuidsArray = ^TGuidsArray;
  104.   TGuidsArray = packed array[0..Pred(MaxLongint div SizeOf(TGUID))] of TGUID;
  105.  
  106. const
  107.   FARMACRO_KEY_EVENT = KEY_EVENT or $8000;
  108.  
  109.   CP_UNICODE    = 1200;
  110.   CP_REVERSEBOM = 1201;
  111.   CP_DEFAULT    = TUIntPtr(-1);
  112.   CP_REDETECT   = TUIntPtr(-2);
  113.  
  114.  
  115. {FARCOLORFLAGS}
  116.  
  117. type
  118.   TFARCOLORFLAGS = Int64;
  119.  
  120. const
  121.   FCF_NONE          = 0;
  122.   FCF_FG_4BIT       = $0000000000000001;
  123.   FCF_BG_4BIT       = $0000000000000002;
  124.  
  125.   FCF_4BITMASK      = $0000000000000003; // FCF_FG_4BIT|FCF_BG_4BIT
  126.  
  127.   FCF_EXTENDEDFLAGS = $FFFFFFFFFFFFFFFC; // ~FCF_4BITMASK
  128.  
  129.   FCF_FG_BOLD       = $1000000000000000;
  130.   FCF_FG_ITALIC     = $2000000000000000;
  131.   FCF_FG_UNDERLINE  = $4000000000000000;
  132.   FCF_STYLEMASK     = $7000000000000000; // FCF_FG_BOLD|FCF_FG_ITALIC|FCF_FG_UNDERLINE
  133.  
  134. (*
  135. struct FarColor
  136. {
  137.   FARCOLORFLAGS Flags;
  138.   COLORREF ForegroundColor;
  139.   COLORREF BackgroundColor;
  140.   void* Reserved;
  141. };
  142. *)
  143. type
  144.   PFarColor = ^TFarColor;
  145.   TFarColor = record
  146.     Flags :TFARCOLORFLAGS;
  147.     ForegroundColor :COLORREF;
  148.     BackgroundColor :COLORREF;
  149.     Reserved :Pointer;
  150.   end;
  151.  
  152.   PFarColorArray = ^TFarColorArray;
  153.   TFarColorArray = packed array[0..MaxInt div SizeOf(TFarColor) - 1] of TFarColor;
  154.  
  155. (*
  156. #define INDEXMASK 0x0000000f
  157. #define COLORMASK 0x00ffffff
  158. #define ALPHAMASK 0xff000000
  159.  
  160. #define INDEXVALUE(x) ((x)&INDEXMASK)
  161. #define COLORVALUE(x) ((x)&COLORMASK)
  162. #define ALPHAVALUE(x) ((x)&ALPHAMASK)
  163.  
  164. #define IS_OPAQUE(x) (ALPHAVALUE(x)==ALPHAMASK)
  165. #define IS_TRANSPARENT(x) (!ALPHAVALUE(x))
  166. #define MAKE_OPAQUE(x) (x|=ALPHAMASK)
  167. #define MAKE_TRANSPARENT(x) (x&=COLORMASK)
  168. *)
  169. {!!!}
  170.  
  171. {COLORDIALOGFLAGS}
  172.  
  173. type
  174.   TColorDialogFlags = Int64;
  175.  
  176. const
  177.   CDF_NONE = 0;
  178.  
  179. (*
  180. typedef BOOL (WINAPI *FARAPICOLORDIALOG)(
  181.   const GUID* PluginId,
  182.   COLORDIALOGFLAGS Flags,
  183.   struct FarColor *Color
  184. );
  185. *)
  186. type
  187.   TFarApiColorDialog = function(
  188.     const PluginId :TGUID;
  189.     Flags :TColorDialogFlags;
  190.     var Color :TFarColor
  191.   ) :BOOL; stdcall;
  192.  
  193.  
  194. { FARMESSAGEFLAGS }
  195.  
  196. type
  197.   TFarMessageFlags = Int64;
  198.  
  199. const
  200.   FMSG_NONE                = 0;
  201.   FMSG_WARNING             = $00000001;
  202.   FMSG_ERRORTYPE           = $00000002;
  203.   FMSG_KEEPBACKGROUND      = $00000004;
  204.   FMSG_LEFTALIGN           = $00000008;
  205.   FMSG_ALLINONE            = $00000010;
  206.  
  207.   FMSG_MB_OK               = $00010000;
  208.   FMSG_MB_OKCANCEL         = $00020000;
  209.   FMSG_MB_ABORTRETRYIGNORE = $00030000;
  210.   FMSG_MB_YESNO            = $00040000;
  211.   FMSG_MB_YESNOCANCEL      = $00050000;
  212.   FMSG_MB_RETRYCANCEL      = $00060000;
  213.  
  214. (*
  215. typedef intptr_t (WINAPI *FARAPIMESSAGE)(
  216.     const GUID* PluginId,
  217.     const GUID* Id,
  218.     FARMESSAGEFLAGS Flags,
  219.     const wchar_t *HelpTopic,
  220.     const wchar_t * const *Items,
  221.     size_t ItemsNumber,
  222.     intptr_t ButtonsNumber
  223. );
  224. *)
  225. type
  226.   TFarApiMessage = function (
  227.     const PluginId :TGUID;
  228.     const Id :TGUID;
  229.     Flags :TFarMessageFlags;
  230.     HelpTopic :PFarChar;
  231.     Items :PPCharArray;
  232.     ItemsNumber :size_t;
  233.     ButtonsNumber :TIntPtr
  234.   ) :TIntPtr; stdcall;
  235.  
  236.  
  237. { FARDIALOGITEMTYPES }
  238.  
  239. const
  240.   DI_TEXT         = 0;
  241.   DI_VTEXT        = 1;
  242.   DI_SINGLEBOX    = 2;
  243.   DI_DOUBLEBOX    = 3;
  244.   DI_EDIT         = 4;
  245.   DI_PSWEDIT      = 5;
  246.   DI_FIXEDIT      = 6;
  247.   DI_BUTTON       = 7;
  248.   DI_CHECKBOX     = 8;
  249.   DI_RADIOBUTTON  = 9;
  250.   DI_COMBOBOX     = 10;
  251.   DI_LISTBOX      = 11;
  252.   DI_USERCONTROL  = 255;
  253.  
  254.  
  255. { FARDIALOGITEMFLAGS }
  256.  
  257. type
  258.   TFarDialogItemFlags = int64;
  259.  
  260. const
  261.   DIF_NONE                  = 0;
  262.   DIF_BOXCOLOR              =  $00000200;
  263.   DIF_GROUP                 =  $00000400;
  264.   DIF_LEFTTEXT              =  $00000800;
  265.   DIF_MOVESELECT            =  $00001000;
  266.   DIF_SHOWAMPERSAND         =  $00002000;
  267.   DIF_CENTERGROUP           =  $00004000;
  268.   DIF_NOBRACKETS            =  $00008000;
  269.   DIF_MANUALADDHISTORY      =  $00008000;
  270.   DIF_SEPARATOR             =  $00010000;
  271.   DIF_SEPARATOR2            =  $00020000;
  272.   DIF_EDITOR                =  $00020000;
  273.   DIF_LISTNOAMPERSAND       =  $00020000;
  274.   DIF_LISTNOBOX             =  $00040000;
  275.   DIF_HISTORY               =  $00040000;
  276.   DIF_BTNNOCLOSE            =  $00040000;
  277.   DIF_CENTERTEXT            =  $00040000;
  278.   DIF_SETSHIELD             =  $00080000;
  279.   DIF_EDITEXPAND            =  $00080000;
  280.   DIF_DROPDOWNLIST          =  $00100000;
  281.   DIF_USELASTHISTORY        =  $00200000;
  282.   DIF_MASKEDIT              =  $00400000;
  283.   DIF_LISTTRACKMOUSE        =  $00400000;
  284.   DIF_LISTTRACKMOUSEINFOCUS =  $00800000;
  285.   DIF_SELECTONENTRY         =  $00800000;
  286.   DIF_3STATE                =  $00800000;
  287.   DIF_EDITPATH              =  $01000000;
  288.   DIF_LISTWRAPMODE          =  $01000000;
  289.   DIF_NOAUTOCOMPLETE        =  $02000000;
  290.   DIF_LISTAUTOHIGHLIGHT     =  $02000000;
  291.   DIF_LISTNOCLOSE           =  $04000000;
  292.   DIF_EDITPATHEXEC          =  $04000000;
  293.   DIF_HIDDEN                =  $10000000;
  294.   DIF_READONLY              =  $20000000;
  295.   DIF_NOFOCUS               =  $40000000;
  296.   DIF_DISABLE               =  $80000000;
  297.   DIF_DEFAULTBUTTON         = $100000000;
  298.   DIF_FOCUS                 = $200000000;
  299.  
  300.  
  301. { FARMESSAGE }
  302.  
  303. const
  304.   DM_FIRST                = 0;
  305.   DM_CLOSE                = 1;
  306.   DM_ENABLE               = 2;
  307.   DM_ENABLEREDRAW         = 3;
  308.   DM_GETDLGDATA           = 4;
  309.   DM_GETDLGITEM           = 5;
  310.   DM_GETDLGRECT           = 6;
  311.   DM_GETTEXT              = 7;
  312. //DM_GETTEXTLENGTH        = 8;
  313.   DM_KEY                  = 9;
  314.   DM_MOVEDIALOG           = 10;
  315.   DM_SETDLGDATA           = 11;
  316.   DM_SETDLGITEM           = 12;
  317.   DM_SETFOCUS             = 13;
  318.   DM_REDRAW               = 14;
  319.   DM_SETTEXT              = 15;
  320.   DM_SETMAXTEXTLENGTH     = 16;
  321.   DM_SHOWDIALOG           = 17;
  322.   DM_GETFOCUS             = 18;
  323.   DM_GETCURSORPOS         = 19;
  324.   DM_SETCURSORPOS         = 20;
  325. //DM_GETTEXTPTR           = 21;
  326.   DM_SETTEXTPTR           = 22;
  327.   DM_SHOWITEM             = 23;
  328.   DM_ADDHISTORY           = 24;
  329.   DM_GETCHECK             = 25;
  330.   DM_SETCHECK             = 26;
  331.   DM_SET3STATE            = 27;
  332.   DM_LISTSORT             = 28;
  333.   DM_LISTGETITEM          = 29;
  334.   DM_LISTGETCURPOS        = 30;
  335.   DM_LISTSETCURPOS        = 31;
  336.   DM_LISTDELETE           = 32;
  337.   DM_LISTADD              = 33;
  338.   DM_LISTADDSTR           = 34;
  339.   DM_LISTUPDATE           = 35;
  340.   DM_LISTINSERT           = 36;
  341.   DM_LISTFINDSTRING       = 37;
  342.   DM_LISTINFO             = 38;
  343.   DM_LISTGETDATA          = 39;
  344.   DM_LISTSETDATA          = 40;
  345.   DM_LISTSETTITLES        = 41;
  346.   DM_LISTGETTITLES        = 42;
  347.   DM_RESIZEDIALOG         = 43;
  348.   DM_SETITEMPOSITION      = 44;
  349.   DM_GETDROPDOWNOPENED    = 45;
  350.   DM_SETDROPDOWNOPENED    = 46;
  351.   DM_SETHISTORY           = 47;
  352.   DM_GETITEMPOSITION      = 48;
  353.   DM_SETMOUSEEVENTNOTIFY  = 49;
  354.   DM_EDITUNCHANGEDFLAG    = 50;
  355.   DM_GETITEMDATA          = 51;
  356.   DM_SETITEMDATA          = 52;
  357.   DM_LISTSET              = 53;
  358.   DM_GETCURSORSIZE        = 54;
  359.   DM_SETCURSORSIZE        = 55;
  360.   DM_LISTGETDATASIZE      = 56;
  361.   DM_GETSELECTION         = 57;
  362.   DM_SETSELECTION         = 58;
  363.   DM_GETEDITPOSITION      = 59;
  364.   DM_SETEDITPOSITION      = 60;
  365.   DM_SETCOMBOBOXEVENT     = 61;
  366.   DM_GETCOMBOBOXEVENT     = 62;
  367.   DM_GETCONSTTEXTPTR      = 63;
  368.   DM_GETDLGITEMSHORT      = 64;
  369.   DM_SETDLGITEMSHORT      = 65;
  370.   DM_GETDIALOGINFO        = 66;
  371.  
  372.   DN_FIRST                = 4096;
  373.   DN_BTNCLICK             = 4097;
  374.   DN_CTLCOLORDIALOG       = 4098;
  375.   DN_CTLCOLORDLGITEM      = 4099;
  376.   DN_CTLCOLORDLGLIST      = 4100;
  377.   DN_DRAWDIALOG           = 4101;
  378.   DN_DRAWDLGITEM          = 4102;
  379.   DN_EDITCHANGE           = 4103;
  380.   DN_ENTERIDLE            = 4104;
  381.   DN_GOTFOCUS             = 4105;
  382.   DN_HELP                 = 4106;
  383.   DN_HOTKEY               = 4107;
  384.   DN_INITDIALOG           = 4108;
  385.   DN_KILLFOCUS            = 4109;
  386.   DN_LISTCHANGE           = 4110;
  387.   DN_DRAGGED              = 4111;
  388.   DN_RESIZECONSOLE        = 4112;
  389.   DN_DRAWDIALOGDONE       = 4113;
  390.   DN_LISTHOTKEY           = 4114;
  391.   DN_INPUT                = 4115;
  392.   DN_CONTROLINPUT         = 4116;
  393.   DN_CLOSE                = 4117;
  394.   DN_GETVALUE             = 4118;
  395.  
  396.   DM_USER                 = $4000;
  397.  
  398.  
  399. { FARCHECKEDSTATE }
  400.  
  401. const
  402.   BSTATE_UNCHECKED = 0;
  403.   BSTATE_CHECKED   = 1;
  404.   BSTATE_3STATE    = 2;
  405.   BSTATE_TOGGLE    = 3;
  406.  
  407.  
  408. {FARCOMBOBOXEVENTTYPE}
  409.  
  410. const
  411.   CBET_KEY         = 1;
  412.   CBET_MOUSE       = 2;
  413.  
  414.  
  415. {------------------------------------------------------------------------------}
  416. { List                                                                         }
  417. {------------------------------------------------------------------------------}
  418.  
  419. { LISTITEMFLAGS }
  420.  
  421. type
  422.   TListItemsFlags = int64;
  423.  
  424. const
  425.   LIF_NONE           = 0;
  426.   LIF_SELECTED       = $00010000;
  427.   LIF_CHECKED        = $00020000;
  428.   LIF_SEPARATOR      = $00040000;
  429.   LIF_DISABLE        = $00080000;
  430.   LIF_GRAYED         = $00100000;
  431.   LIF_HIDDEN         = $00200000;
  432.   LIF_DELETEUSERDATA = $80000000;
  433.  
  434. (*
  435. struct FarListItem
  436. {
  437.   LISTITEMFLAGS Flags;
  438.   const wchar_t *Text;
  439.   intptr_t Reserved[2];
  440. };
  441. *)
  442. type
  443.   PFarListItem = ^TFarListItem;
  444.   TFarListItem = record
  445.     Flags    :TListItemsFlags;
  446.     TextPtr  :PFarChar;
  447.     Reserved :array [0..1] of TIntPtr;
  448.   end;
  449.  
  450. type
  451.   PFarListItemArray = ^TFarListItemArray;
  452.   TFarListItemArray = packed array[0..MaxInt div SizeOf(TFarListItem) - 1] of TFarListItem;
  453.  
  454.  
  455. (*
  456. struct FarListUpdate
  457. {
  458.   size_t StructSize;
  459.   intptr_t Index;
  460.   struct FarListItem Item;
  461. };
  462. *)
  463. type
  464.   PFarListUpdate = ^TFarListUpdate;
  465.   TFarListUpdate = record
  466.     StructSize :size_t;
  467.     Index :TIntPtr;
  468.     Item :TFarListItem;
  469.   end;
  470.  
  471. (*
  472. struct FarListInsert
  473. {
  474.   size_t StructSize;
  475.   intptr_t Index;
  476.   struct FarListItem Item;
  477. };
  478. *)
  479. type
  480.   PFarListInsert = ^TFarListInsert;
  481.   TFarListInsert = record
  482.     StructSize :size_t;
  483.     Index :TIntPtr;
  484.     Item :TFarListItem;
  485.   end;
  486.  
  487. (*
  488. struct FarListGetItem
  489. {
  490.   size_t StructSize;
  491.   intptr_t ItemIndex;
  492.   struct FarListItem Item;
  493. };
  494. *)
  495. type
  496.   PFarListGetItem = ^TFarListGetItem;
  497.   TFarListGetItem = record
  498.     StructSize :size_t;
  499.     ItemIndex :TIntPtr;
  500.     Item :TFarListItem;
  501.   end;
  502.  
  503. (*
  504. struct FarListPos
  505. {
  506.   size_t StructSize;
  507.   intptr_t SelectPos;
  508.   intptr_t TopPos;
  509. };
  510. *)
  511. type
  512.   PFarListPos = ^TFarListPos;
  513.   TFarListPos = record
  514.     StructSize :size_t;
  515.     SelectPos :TIntPtr;
  516.     TopPos :TIntPtr;
  517.   end;
  518.  
  519. { FARLISTFINDFLAGS }
  520.  
  521. type
  522.   TFarListFindFlags = int64;
  523.  
  524. const
  525.   LIFIND_NONE       = 0;
  526.   LIFIND_EXACTMATCH = $00000001;
  527.  
  528. (*
  529. struct FarListFind
  530. {
  531.   size_t StructSize;
  532.   intptr_t StartIndex;
  533.   const wchar_t *Pattern;
  534.   FARLISTFINDFLAGS Flags;
  535. };
  536. *)
  537. type
  538.   PFarListFind = ^TFarListFind;
  539.   TFarListFind = record
  540.     StructSize :size_t;
  541.     StartIndex :TIntPtr;
  542.     Pattern :PFarChar;
  543.     Flags : TFarListFindFlags;
  544.   end;
  545.  
  546. (*
  547. struct FarListDelete
  548. {
  549.   size_t StructSize;
  550.   intptr_t StartIndex;
  551.   intptr_t Count;
  552. };
  553. *)
  554. type
  555.   PFarListDelete = ^TFarListDelete;
  556.   TFarListDelete = record
  557.     StructSize :size_t;
  558.     StartIndex :TIntPtr;
  559.     Count :TIntPtr;
  560.   end;
  561.  
  562. { FARLISTINFOFLAGS }
  563.  
  564. type
  565.   TFarListInfoFlags = int64;
  566.  
  567. const
  568.   LINFO_NONE              = 0;
  569.   LINFO_SHOWNOBOX         = $00000400;
  570.   LINFO_AUTOHIGHLIGHT     = $00000800;
  571.   LINFO_REVERSEHIGHLIGHT  = $00001000;
  572.   LINFO_WRAPMODE          = $00008000;
  573.   LINFO_SHOWAMPERSAND     = $00010000;
  574.  
  575. (*
  576. struct FarListInfo
  577. {
  578.   size_t StructSize;
  579.   FARLISTINFOFLAGS Flags;
  580.   size_t ItemsNumber;
  581.   intptr_t SelectPos;
  582.   intptr_t TopPos;
  583.   intptr_t MaxHeight;
  584.   intptr_t MaxLength;
  585. };
  586. *)
  587. type
  588.   PFarListInfo = ^TFarListInfo;
  589.   TFarListInfo = record
  590.     StructSize :size_t;
  591.     Flags :TFarListInfoFlags;
  592.     ItemsNumber :size_t;
  593.     SelectPos :TIntPtr;
  594.     TopPos :TIntPtr;
  595.     MaxHeight :TIntPtr;
  596.     MaxLength :TIntPtr;
  597.  end;
  598.  
  599. (*
  600. struct FarListItemData
  601. {
  602.   size_t StructSize;
  603.   intptr_t Index;
  604.   size_t DataSize;
  605.   void *Data;
  606. };
  607. *)
  608. type
  609.   PFarListItemData = ^TFarListItemData;
  610.   TFarListItemData = record
  611.     StructSize :size_t;
  612.     Index :TIntPtr;
  613.     DataSize :size_t;
  614.     Data :Pointer;
  615.   end;
  616.  
  617. (*
  618. struct FarList
  619. {
  620.   size_t StructSize;
  621.   size_t ItemsNumber;
  622.   struct FarListItem *Items;
  623. };
  624. *)
  625. type
  626.   PFarList = ^TFarList;
  627.   TFarList = record
  628.     StructSize :size_t;
  629.     ItemsNumber :size_t;
  630.     Items :PFarListItemArray;
  631.   end;
  632.  
  633. (*
  634. struct FarListTitles
  635. {
  636.   size_t StructSize;
  637.   size_t TitleSize;
  638.   const wchar_t *Title;
  639.   size_t BottomSize;
  640.   const wchar_t *Bottom;
  641. };
  642. *)
  643. type
  644.   PFarListTitles = ^TFarListTitles;
  645.   TFarListTitles = record
  646.     StructSize :size_t;
  647.     TitleLen :size_t;
  648.     Title :PFarChar;
  649.     BottomLen :size_t;
  650.     Bottom :PFarChar;
  651.   end;
  652.  
  653. (*
  654. struct FarDialogItemColors
  655. {
  656.   size_t StructSize;
  657.   unsigned __int64 Flags;
  658.   size_t ColorsCount;
  659.   struct FarColor* Colors;
  660. };
  661. *)
  662. type
  663.   PFarDialogItemColors = ^TFarDialogItemColors;
  664.   TFarDialogItemColors = record
  665.     StructSize :size_t;
  666.     Flags :Int64;
  667.     ColorsCount :size_t;
  668.     Colors :PFarColorArray;
  669.   end;
  670.  
  671. {------------------------------------------------------------------------------}
  672. { Dialogs                                                                      }
  673. {------------------------------------------------------------------------------}
  674.  
  675. (*
  676. struct FarDialogItem
  677. {
  678.   enum FARDIALOGITEMTYPES Type;
  679.   intptr_t X1,Y1,X2,Y2;
  680.   union
  681.   {
  682.     intptr_t Selected;
  683.     struct FarList *ListItems;
  684.     struct FAR_CHAR_INFO *VBuf;
  685.     intptr_t Reserved0;
  686.   }  Param;
  687.   const wchar_t *History;
  688.   const wchar_t *Mask;
  689.   FARDIALOGITEMFLAGS Flags;
  690.   const wchar_t *Data;
  691.   size_t MaxLength; // terminate 0 not included (if == 0 string size is unlimited)
  692.   intptr_t UserData;
  693.   intptr_t Reserved[2];
  694. };
  695. *)
  696.  
  697. type
  698.   PFarDialogItem = ^TFarDialogItem;
  699.   TFarDialogItem = record
  700.     ItemType :DWORD; {FARDIALOGITEMTYPES}
  701.     X1, Y1, X2, Y2 :TIntPtr;
  702.  
  703.     Param : record case byte of
  704.       0 : (Selected :TIntPtr);
  705.       1 : (ListItems :PFarList);
  706.       2 : (VBuf :PCharInfo);
  707.       3 : (Reserved0 :TIntPtr);
  708.     end;
  709.  
  710.     History :PFarChar;
  711.     Mask :PFarChar;
  712.     Flags :TFarDialogItemFlags;
  713.     Data :PFarChar;
  714.     MaxLength :size_t;
  715.     UserData :TIntPtr;
  716.     Reserved :array[0..1] of TIntPtr;
  717.   end;
  718.  
  719. type
  720.   PFarDialogItemArray = ^TFarDialogItemArray;
  721.   TFarDialogItemArray = packed array[0..MaxInt div SizeOf(TFarDialogItem) - 1] of TFarDialogItem;
  722.  
  723.  
  724. (*
  725. struct FarDialogItemData
  726. {
  727.   size_t StructSize;
  728.   size_t  PtrLength;
  729.   wchar_t *PtrData;
  730. };
  731. *)
  732. type
  733.   PFarDialogItemData = ^TFarDialogItemData;
  734.   TFarDialogItemData = record
  735.     StructSize :size_t;
  736.     PtrLength :size_t;
  737.     PtrData :PFarChar;
  738.   end;
  739.  
  740. (*
  741. struct FarDialogEvent
  742. {
  743.   size_t StructSize;
  744.   HANDLE hDlg;
  745.   intptr_t Msg;
  746.   intptr_t Param1;
  747.   void* Param2;
  748.   intptr_t Result;
  749. };
  750. *)
  751. type
  752.   PFarDialogEvent = ^TFarDialogEvent;
  753.   TFarDialogEvent = record
  754.     StructSize :size_t;
  755.     hDlg :THandle;
  756.     Msg :TIntPtr;
  757.     Param1 :TIntPtr;
  758.     Param2 :Pointer;
  759.     Result :TIntPtr;
  760.   end;
  761.  
  762. (*
  763. struct OpenDlgPluginData
  764. {
  765.   size_t StructSize;
  766.   HANDLE hDlg;
  767. };
  768. *)
  769. type
  770.   POpenDlgPluginData_ = ^TOpenDlgPluginData_;
  771.   TOpenDlgPluginData_ = record
  772.     StructSize :size_t;
  773.     hDlg :THandle;
  774.   end;
  775.  
  776.  
  777. (*
  778. struct DialogInfo
  779. {
  780.   size_t StructSize;
  781.   GUID Id;
  782.   GUID Owner;
  783. };
  784. *)
  785. type
  786.   PDialogInfo = ^TDialogInfo;
  787.   TDialogInfo = record
  788.     StructSize :size_t;
  789.     Id :TGUID;
  790.     Owner :TGUID;
  791.   end;
  792.  
  793. (*
  794. struct FarGetDialogItem
  795. {
  796.   size_t StructSize;
  797.   size_t Size;
  798.   struct FarDialogItem* Item;
  799. };
  800. *)
  801. type
  802.   PFarGetDialogItem_ = ^TFarGetDialogItem_;
  803.   TFarGetDialogItem_ = record
  804.     StructSize :size_t;
  805.     Size :size_t;
  806.     Item :PFarDialogItem;
  807.   end;
  808.  
  809.  
  810. { FARDIALOGFLAGS }
  811.  
  812. type
  813.   TFarDialogFlags = int64;
  814.  
  815. const
  816.   FDLG_NONE             = 0;
  817.   FDLG_WARNING          = $00000001;
  818.   FDLG_SMALLDIALOG      = $00000002;
  819.   FDLG_NODRAWSHADOW     = $00000004;
  820.   FDLG_NODRAWPANEL      = $00000008;
  821.   FDLG_KEEPCONSOLETITLE = $00000010;
  822.  
  823.  
  824. type
  825. (*
  826. typedef intptr_t(WINAPI *FARWINDOWPROC)(
  827.     HANDLE   hDlg,
  828.     intptr_t Msg,
  829.     intptr_t Param1,
  830.     void* Param2
  831. );
  832. *)
  833.   TFarApiWindowProc = function (
  834.     hDlg :THandle;
  835.     Msg :TIntPtr;
  836.     Param1 :TIntPtr;
  837.     Param2 :TIntPtr{Pointer}
  838.   ) :TIntPtr; stdcall;
  839.  
  840. (*
  841. typedef intptr_t(WINAPI *FARAPISENDDLGMESSAGE)(
  842.     HANDLE   hDlg,
  843.     intptr_t Msg,
  844.     intptr_t Param1,
  845.     void* Param2
  846. );
  847. *)
  848.   TFarApiSendDlgMessage = function (
  849.     hDlg :THandle;
  850.     Msg :TIntPtr;
  851.     Param1 :TIntPtr;
  852.     Param2 :Pointer
  853.   ) :TIntPtr; stdcall;
  854.  
  855. (*
  856. typedef intptr_t(WINAPI *FARAPIDEFDLGPROC)(
  857.     HANDLE   hDlg,
  858.     intptr_t Msg,
  859.     intptr_t Param1,
  860.     void* Param2
  861. );
  862. *)
  863.   TFarApiDefDlgProc = function (
  864.     hDlg :THandle;
  865.     Msg :TIntPtr;
  866.     Param1 :TIntPtr;
  867.     Param2 :TIntPtr{Pointer}
  868.   ) :TIntPtr; stdcall;
  869.  
  870.  
  871. (*
  872. typedef HANDLE(WINAPI *FARAPIDIALOGINIT)(
  873.     const GUID*           PluginId,
  874.     const GUID*           Id,
  875.     intptr_t              X1,
  876.     intptr_t              Y1,
  877.     intptr_t              X2,
  878.     intptr_t              Y2,
  879.     const wchar_t        *HelpTopic,
  880.     const struct FarDialogItem *Item,
  881.     size_t                ItemsNumber,
  882.     intptr_t              Reserved,
  883.     FARDIALOGFLAGS        Flags,
  884.     FARWINDOWPROC         DlgProc,
  885.     void*                 Param
  886. );
  887. *)
  888.   TFarApiDialogInit = function (
  889.     const PluginID :TGUID;
  890.     const ID :TGUID;
  891.     X1, Y1, X2, Y2 :TIntPtr;
  892.     HelpTopic :PFarChar;
  893.     Item :PFarDialogItemArray;
  894.     ItemsNumber :size_t;
  895.     Reserved :TIntPtr;
  896.     Flags :TFarDialogFlags;
  897.     DlgProc :TFarApiWindowProc;
  898.     Param :LONG_PTR
  899.   ) :THandle; stdcall;
  900.  
  901. (*
  902. typedef intptr_t (WINAPI *FARAPIDIALOGRUN)(
  903.   HANDLE hDlg
  904. );
  905. *)
  906.   TFarApiDialogRun = function(
  907.     hDlg :THandle
  908.   ) :TIntPtr;  stdcall;
  909.  
  910. (*
  911. typedef void (WINAPI *FARAPIDIALOGFREE)(
  912.   HANDLE hDlg
  913. );
  914. *)
  915.   TFarApiDialogFree = procedure(
  916.     hDlg :THandle
  917.   ); stdcall;
  918.  
  919.  
  920. {------------------------------------------------------------------------------}
  921. { Menu                                                                         }
  922. {------------------------------------------------------------------------------}
  923.  
  924. (*
  925. struct FarKey
  926. {
  927.   WORD VirtualKeyCode;
  928.    DWORD ControlKeyState;
  929. };
  930. *)
  931. type
  932.   PFarKey = ^TFarKey;
  933.   TFarKey = record
  934.     VirtualKeyCode :WORD;
  935.     ControlKeyState :DWORD;
  936.   end;
  937.  
  938. { MENUITEMFLAGS }
  939.  
  940. type
  941.   TMenuItemFlags = Int64;
  942.  
  943. const
  944.   MIF_NONE       = 0;
  945.   MIF_SELECTED   = $00010000;
  946.   MIF_CHECKED    = $00020000;
  947.   MIF_SEPARATOR  = $00040000;
  948.   MIF_DISABLE    = $00080000;
  949.   MIF_GRAYED     = $00100000;
  950.   MIF_HIDDEN     = $00200000;
  951.  
  952. (*
  953. struct FarMenuItem
  954. {
  955.   MENUITEMFLAGS Flags;
  956.   const wchar_t *Text;
  957.   struct FarKey AccelKey;
  958.   intptr_t UserData;
  959.   intptr_t Reserved[2];
  960. };
  961. *)
  962. type
  963.   PFarMenuItem = ^TFarMenuItem;
  964.   TFarMenuItem = record
  965.     Flags :TMenuItemFlags;
  966.     TextPtr :PFarChar;
  967.     AccelKey :TFarKey;
  968.     UserData :TIntPtr;
  969.     Reserved :array[0..1] of TIntPtr;
  970.   end;
  971.  
  972. { FARMENUFLAGS }
  973.  
  974. type
  975.   TFarMenuFlags = Int64;
  976.  
  977. const
  978.   FMENU_NONE                 = 0;
  979.   FMENU_SHOWAMPERSAND        = $00000001;
  980.   FMENU_WRAPMODE             = $00000002;
  981.   FMENU_AUTOHIGHLIGHT        = $00000004;
  982.   FMENU_REVERSEAUTOHIGHLIGHT = $00000008;
  983.   FMENU_CHANGECONSOLETITLE   = $00000010;
  984.  
  985. type
  986.   PFarMenuItemArray = ^TFarMenuItemArray;
  987.   TFarMenuItemArray = packed array[0..MaxInt div SizeOf(TFarMenuItem) - 1] of TFarMenuItem;
  988.  
  989.   PFarKeyArray = ^TFarKeyArray;
  990.   TFarKeyArray = packed array[0..MaxInt div SizeOf(TFarKey) - 1] of TFarKey;
  991.  
  992. (*
  993. typedef intptr_t (WINAPI *FARAPIMENU)(
  994.     const GUID*         PluginId,
  995.     const GUID*         Id,
  996.     intptr_t            X,
  997.     intptr_t            Y,
  998.     intptr_t            MaxHeight,
  999.     FARMENUFLAGS        Flags,
  1000.     const wchar_t      *Title,
  1001.     const wchar_t      *Bottom,
  1002.     const wchar_t      *HelpTopic,
  1003.     const struct FarKey *BreakKeys,
  1004.     intptr_t           *BreakCode,
  1005.     const struct FarMenuItem *Item,
  1006.     size_t              ItemsNumber
  1007. );
  1008. *)
  1009. type
  1010.   TFarApiMenu = function (
  1011.     const PluginId :TGUID;
  1012.     const ID :TGUID;
  1013.     X, Y : TIntPtr;
  1014.     MaxHeight : TIntPtr;
  1015.     Flags :TFARMENUFLAGS;
  1016.     Title :PFarChar;
  1017.     Bottom :PFarChar;
  1018.     HelpTopic :PFarChar;
  1019.     BreakKeys :PFarKeyArray;
  1020.     BreakCode :PIntPtrArray;
  1021.     Item :PFarMenuItemArray;
  1022.     ItemsNumber :size_t
  1023.   ) :TIntPtr; stdcall;
  1024.  
  1025.  
  1026. {------------------------------------------------------------------------------}
  1027. { Panel                                                                        }
  1028. {------------------------------------------------------------------------------}
  1029.  
  1030. { PLUGINPANELITEMFLAGS }
  1031.  
  1032. type
  1033.   TPluginPanelItemFlags = Int64;
  1034.  
  1035. const
  1036.   PPIF_NONE         = 0;
  1037.   PPIF_SELECTED     = $40000000;
  1038.   PPIF_PROCESSDESCR = $80000000;
  1039.  
  1040. (*
  1041. struct FarPanelItemFreeInfo
  1042. {
  1043.   size_t StructSize;
  1044.   HANDLE hPlugin;
  1045. };
  1046.  
  1047. typedef void (WINAPI *FARPANELITEMFREECALLBACK)(void* UserData, const struct FarPanelItemFreeInfo* Info);
  1048. *)
  1049. type
  1050.   PFarPanelItemFreeInfo = ^TFarPanelItemFreeInfo;
  1051.   TFarPanelItemFreeInfo = record
  1052.     StructSize :size_t;
  1053.     hPlugin :THandle;
  1054.   end;
  1055.  
  1056.   TFarPanelItemFreeCallback = procedure(UderData :Pointer; Info :PFarPanelItemFreeInfo); stdcall;
  1057.  
  1058. (*
  1059. struct PluginPanelItem
  1060. {
  1061.   FILETIME CreationTime;
  1062.   FILETIME LastAccessTime;
  1063.   FILETIME LastWriteTime;
  1064.   FILETIME ChangeTime;
  1065.   unsigned __int64 FileSize;
  1066.   unsigned __int64 AllocationSize;
  1067.   const wchar_t *FileName;
  1068.   const wchar_t *AlternateFileName;
  1069.   const wchar_t *Description;
  1070.   const wchar_t *Owner;
  1071.   const wchar_t * const *CustomColumnData;
  1072.   size_t CustomColumnNumber;
  1073.   PLUGINPANELITEMFLAGS Flags;
  1074.   struct
  1075.   {
  1076.     void* Data;
  1077.     FARPANELITEMFREECALLBACK FreeData;
  1078.   } UserData;
  1079.   uintptr_t FileAttributes;
  1080.   uintptr_t NumberOfLinks;
  1081.   uintptr_t CRC32;
  1082.   intptr_t Reserved[2];
  1083. };
  1084. *)
  1085. type
  1086.   PPluginPanelItem = ^TPluginPanelItem;
  1087.   TPluginPanelItem = record
  1088.     CreationTime :FILETIME;
  1089.     LastAccessTime :FILETIME;
  1090.     LastWriteTime :FILETIME;
  1091.     ChangeTime :FILETIME;
  1092.     FileSize :Int64;
  1093.     AllocationSize :Int64;
  1094.     FileName :PFarChar;
  1095.     AlternateFileName :PFarChar;
  1096.     Description :PFarChar;
  1097.     Owner :PFarChar;
  1098.     CustomColumnData :PPCharArray;
  1099.     CustomColumnNumber :size_t;
  1100.     Flags :TPluginPanelItemFlags;
  1101.     UserData :Pointer;
  1102.     FreeData :TFarPanelItemFreeCallback;
  1103.     FileAttributes :TUIntPtr;
  1104.     NumberOfLinks :TUIntPtr;
  1105.     CRC32 :TUIntPtr;
  1106.     Reserved :array[0..1] of TIntPtr;
  1107.   end;
  1108.  
  1109.   PPluginPanelItemArray = ^TPluginPanelItemArray;
  1110.   TPluginPanelItemArray = packed array[0..MaxInt div sizeof(TPluginPanelItem) - 1] of TPluginPanelItem;
  1111.  
  1112. (*
  1113. struct FarGetPluginPanelItem
  1114. {
  1115.   size_t StructSize;
  1116.   size_t Size;
  1117.   struct PluginPanelItem* Item;
  1118. };
  1119. *)
  1120. type
  1121.   PFarGetPluginPanelItem = ^TFarGetPluginPanelItem;
  1122.   TFarGetPluginPanelItem = record
  1123.     StructSize :size_t;
  1124.     Size :size_t;
  1125.     Item :PPluginPanelItem;
  1126.   end;
  1127.  
  1128. { PANELINFOFLAGS }
  1129.  
  1130. type
  1131.   TPANELINFOFLAGS = Int64;
  1132.  
  1133. const
  1134.   PFLAGS_NONE               = 0;
  1135.   PFLAGS_SHOWHIDDEN         = $00000001;
  1136.   PFLAGS_HIGHLIGHT          = $00000002;
  1137.   PFLAGS_REVERSESORTORDER   = $00000004;
  1138.   PFLAGS_USESORTGROUPS      = $00000008;
  1139.   PFLAGS_SELECTEDFIRST      = $00000010;
  1140.   PFLAGS_REALNAMES          = $00000020;
  1141.   PFLAGS_NUMERICSORT        = $00000040;
  1142.   PFLAGS_PANELLEFT          = $00000080;
  1143.   PFLAGS_DIRECTORIESFIRST   = $00000100;
  1144.   PFLAGS_USECRC32           = $00000200;
  1145.   PFLAGS_CASESENSITIVESORT  = $00000400;
  1146.   PFLAGS_PLUGIN             = $00000800;
  1147.   PFLAGS_VISIBLE            = $00001000;
  1148.   PFLAGS_FOCUS              = $00002000;
  1149.   PFLAGS_ALTERNATIVENAMES   = $00004000;
  1150.   PFLAGS_SHORTCUT           = $00008000;
  1151.  
  1152.   
  1153. { PANELINFOTYPE }
  1154.  
  1155. const
  1156.   PTYPE_FILEPANEL   = 0;
  1157.   PTYPE_TREEPANEL   = 1;
  1158.   PTYPE_QVIEWPANEL  = 2;
  1159.   PTYPE_INFOPANEL   = 3;
  1160.  
  1161.  
  1162. { OPENPANELINFO_SORTMODES }
  1163.  
  1164. const
  1165.   SM_DEFAULT        =  0;
  1166.   SM_UNSORTED       =  1;
  1167.   SM_NAME           =  2;
  1168.   SM_EXT            =  3;
  1169.   SM_MTIME          =  4;
  1170.   SM_CTIME          =  5;
  1171.   SM_ATIME          =  6;
  1172.   SM_SIZE           =  7;
  1173.   SM_DESCR          =  8;
  1174.   SM_OWNER          =  9;
  1175.   SM_COMPRESSEDSIZE = 10;
  1176.   SM_NUMLINKS       = 11;
  1177.   SM_NUMSTREAMS     = 12;
  1178.   SM_STREAMSSIZE    = 13;
  1179.   SM_FULLNAME       = 14;
  1180.   SM_CHTIME         = 15;
  1181.  
  1182. (*
  1183. struct PanelInfo
  1184. {
  1185.   size_t StructSize;
  1186.   HANDLE PluginHandle;
  1187.   GUID OwnerGuid;
  1188.   PANELINFOFLAGS Flags;
  1189.   size_t ItemsNumber;
  1190.   size_t SelectedItemsNumber;
  1191.   RECT PanelRect;
  1192.   size_t CurrentItem;
  1193.   size_t TopPanelItem;
  1194.   intptr_t ViewMode;
  1195.   enum PANELINFOTYPE PanelType;
  1196.   enum OPENPANELINFO_SORTMODES SortMode;
  1197. };
  1198. *)
  1199. type
  1200.   PPanelInfo = ^TPanelInfo;
  1201.   TPanelInfo = record
  1202.     StructSize :size_t;
  1203.     PluginHandle :THandle;
  1204.     OwnerGuid :TGUID;
  1205.     Flags :TPANELINFOFLAGS;
  1206.     ItemsNumber :INT_PTR{size_t};
  1207.     SelectedItemsNumber :INT_PTR{size_t};
  1208.     PanelRect : TRect;
  1209.     CurrentItem :INT_PTR{size_t};
  1210.     TopPanelItem :INT_PTR{size_t};
  1211.     ViewMode :TIntPtr;
  1212.     PanelType :DWORD; { PANELINFOTYPE }
  1213.     SortMode :DWORD; { OPENPANELINFO_SORTMODES }
  1214.   end;
  1215.  
  1216. (*
  1217. struct PanelRedrawInfo
  1218. {
  1219.   size_t StructSize;
  1220.   size_t CurrentItem;
  1221.   size_t TopPanelItem;
  1222. };
  1223. *)
  1224. type
  1225.   PPanelRedrawInfo = ^TPanelRedrawInfo;
  1226.   TPanelRedrawInfo = record
  1227.     StructSize :size_t;
  1228.     CurrentItem :size_t;
  1229.     TopPanelItem :size_t;
  1230.   end;
  1231.  
  1232.  
  1233. (*
  1234. struct CmdLineSelect
  1235. {
  1236.   size_t StructSize;
  1237.   intptr_t SelStart;
  1238.   intptr_t SelEnd;
  1239. };
  1240. *)
  1241. type
  1242.   PCmdLineSelect = ^TCmdLineSelect;
  1243.   TCmdLineSelect = record
  1244.     StructSize :size_t;
  1245.     SelStart :TIntPtr;
  1246.     SelEnd :TIntPtr;
  1247.   end;
  1248.  
  1249. (*
  1250. struct FarPanelDirectory
  1251. {
  1252.   size_t StructSize;
  1253.   const wchar_t* Name;
  1254.   const wchar_t* Param;
  1255.   GUID PluginId;
  1256.   const wchar_t* File;
  1257. };
  1258. *)
  1259.  
  1260. type
  1261.   PFarPanelDirectory = ^TFarPanelDirectory;
  1262.   TFarPanelDirectory = record
  1263.     StructSize :size_t;
  1264.     Name :PFarChar;
  1265.     Param :PFarChar;
  1266.     PluginId :TGUID;
  1267.     fFile :PFarChar;
  1268.   end;
  1269.  
  1270.  
  1271. {------------------------------------------------------------------------------}
  1272. {                                                                              }
  1273. {------------------------------------------------------------------------------}
  1274.  
  1275. { FILE_CONTROL_COMMANDS }
  1276.  
  1277. const
  1278.   PANEL_NONE                  = THandle(-1);
  1279.   PANEL_ACTIVE                  = THandle(-1);
  1280.   PANEL_PASSIVE                  = THandle(-2);
  1281.   PANEL_STOP                  = THandle(-1);
  1282.  
  1283. const
  1284.   FCTL_CLOSEPANEL             = 0;
  1285.   FCTL_GETPANELINFO           = 1;
  1286.   FCTL_UPDATEPANEL            = 2;
  1287.   FCTL_REDRAWPANEL            = 3;
  1288.   FCTL_GETCMDLINE             = 4;
  1289.   FCTL_SETCMDLINE             = 5;
  1290.   FCTL_SETSELECTION           = 6;
  1291.   FCTL_SETVIEWMODE            = 7;
  1292.   FCTL_INSERTCMDLINE          = 8;
  1293.   FCTL_SETUSERSCREEN          = 9;
  1294.   FCTL_SETPANELDIRECTORY      = 10;
  1295.   FCTL_SETCMDLINEPOS          = 11;
  1296.   FCTL_GETCMDLINEPOS          = 12;
  1297.   FCTL_SETSORTMODE            = 13;
  1298.   FCTL_SETSORTORDER           = 14;
  1299.   FCTL_SETCMDLINESELECTION    = 15;
  1300.   FCTL_GETCMDLINESELECTION    = 16;
  1301.   FCTL_CHECKPANELSEXIST       = 17;
  1302.   FCTL_SETNUMERICSORT         = 18;
  1303.   FCTL_GETUSERSCREEN          = 19;
  1304.   FCTL_ISACTIVEPANEL          = 20;
  1305.   FCTL_GETPANELITEM           = 21;
  1306.   FCTL_GETSELECTEDPANELITEM   = 22;
  1307.   FCTL_GETCURRENTPANELITEM    = 23;
  1308.   FCTL_GETPANELDIRECTORY      = 24;
  1309.   FCTL_GETCOLUMNTYPES         = 25;
  1310.   FCTL_GETCOLUMNWIDTHS        = 26;
  1311.   FCTL_BEGINSELECTION         = 27;
  1312.   FCTL_ENDSELECTION           = 28;
  1313.   FCTL_CLEARSELECTION         = 29;
  1314.   FCTL_SETDIRECTORIESFIRST    = 30;
  1315.   FCTL_GETPANELFORMAT         = 31;
  1316.   FCTL_GETPANELHOSTFILE       = 32;
  1317.   FCTL_SETCASESENSITIVESORT   = 33;
  1318.   FCTL_GETPANELPREFIX         = 34;
  1319.  
  1320. type
  1321. (*
  1322. typedef void (WINAPI *FARAPITEXT)(
  1323.   intptr_t X,
  1324.   intptr_t Y,
  1325.   const struct FarColor* Color,
  1326.   const wchar_t *Str
  1327. );
  1328. *)
  1329.   TFarApiText = procedure (
  1330.     X, Y :TIntPtr;
  1331.     const Color :TFarColor;
  1332.     Str :PFarChar
  1333.    ); stdcall;
  1334.  
  1335.  
  1336. (*
  1337. typedef HANDLE(WINAPI *FARAPISAVESCREEN)(intptr_t X1, intptr_t Y1, intptr_t X2, intptr_t Y2);
  1338. *)
  1339.   TFarApiSaveScreen = function (
  1340.     X1, Y1, X2, Y2 :TIntPtr
  1341.   ) :THandle; stdcall;
  1342.  
  1343. (*
  1344. typedef void (WINAPI *FARAPIRESTORESCREEN)(HANDLE hScreen);
  1345. *)
  1346.   TFarApiRestoreScreen = procedure (
  1347.      hScreen : THandle
  1348.   ); stdcall;
  1349.  
  1350.  
  1351. (*
  1352. typedef intptr_t (WINAPI *FARAPIGETDIRLIST)(
  1353.   const wchar_t *Dir,
  1354.   struct PluginPanelItem **pPanelItem,
  1355.   size_t *pItemsNumber
  1356. );
  1357. *)
  1358.   TFarApiGetDirList = function (
  1359.     Dir : PFarChar;
  1360.     var Items :PPluginPanelItemArray;
  1361.     var ItemsNumber :size_t
  1362.   ) :TIntPtr; stdcall;
  1363.  
  1364. (*
  1365. typedef intptr_t (WINAPI *FARAPIGETPLUGINDIRLIST)(
  1366.     const GUID* PluginId,
  1367.     HANDLE hPanel,
  1368.     const wchar_t *Dir,
  1369.     struct PluginPanelItem **pPanelItem,
  1370.     size_t *pItemsNumber
  1371. );
  1372. *)
  1373.   TFarApiGetPluginDirList = function (
  1374.     PluginID :TGUID;
  1375.     hPlugin :THandle;
  1376.     Dir :PFarChar;
  1377.     var Items :PPluginPanelItemArray;
  1378.     var ItemsNumber :size_t
  1379.   ) :TIntPtr; stdcall;
  1380.  
  1381.  
  1382. (*
  1383. typedef void (WINAPI *FARAPIFREEDIRLIST)(struct PluginPanelItem *PanelItem, size_t nItemsNumber);
  1384. typedef void (WINAPI *FARAPIFREEPLUGINDIRLIST)(HANDLE hPanel, struct PluginPanelItem *PanelItem, size_t nItemsNumber);
  1385. *)
  1386.   TFarApiFreeDirList = procedure (
  1387.     Items :PPluginPanelItemArray;
  1388.     ItemsNumber :size_t
  1389.   ); stdcall;
  1390.  
  1391.   TFarApiFreePluginDirList = procedure (
  1392.     Panel :THandle;
  1393.     Items :PPluginPanelItemArray;
  1394.     ItemsNumber :size_t
  1395.   ); stdcall;
  1396.  
  1397.  
  1398. {------------------------------------------------------------------------------}
  1399. { Viewer / Editor                                                              }
  1400. {------------------------------------------------------------------------------}
  1401.  
  1402. { VIEWER_FLAGS }
  1403.  
  1404. type
  1405.   TViewerFlags = Int64;
  1406.  
  1407. const
  1408.   VF_NONMODAL              = $00000001;
  1409.   VF_DELETEONCLOSE         = $00000002;
  1410.   VF_ENABLE_F6             = $00000004;
  1411.   VF_DISABLEHISTORY        = $00000008;
  1412.   VF_IMMEDIATERETURN       = $00000100;
  1413.   VF_DELETEONLYFILEONCLOSE = $00000200;
  1414.  
  1415. (*
  1416. typedef intptr_t (WINAPI *FARAPIVIEWER)(
  1417.   const wchar_t *FileName,
  1418.   const wchar_t *Title,
  1419.   intptr_t X1,
  1420.   intptr_t Y1,
  1421.   intptr_t X2,
  1422.   intptr_t Y2,
  1423.   VIEWER_FLAGS Flags,
  1424.   uintptr_t CodePage
  1425. );
  1426. *)
  1427. type
  1428.   TFarApiViewer = function (
  1429.     FileName :PFarChar;
  1430.     Title :PFarChar;
  1431.     X1, Y1, X2, Y2 :TIntPtr;
  1432.     Flags :TViewerFlags;
  1433.     CodePage :TUIntPtr
  1434.   ) :TIntPtr; stdcall;
  1435.  
  1436.  
  1437. { EDITOR_FLAGS }
  1438.  
  1439. type
  1440.   TEditorFlags = Int64;
  1441.  
  1442. const
  1443.   EN_NONE                  = 0;
  1444.   EF_NONMODAL              = $00000001;
  1445.   EF_CREATENEW             = $00000002;
  1446.   EF_ENABLE_F6             = $00000004;
  1447.   EF_DISABLEHISTORY        = $00000008;
  1448.   EF_DELETEONCLOSE         = $00000010;
  1449.   EF_IMMEDIATERETURN       = $00000100;
  1450.   EF_DELETEONLYFILEONCLOSE = $00000200;
  1451.   EF_LOCKED                = $00000400;
  1452.   EF_DISABLESAVEPOS        = $00000800;
  1453.  
  1454. { EDITOR_EXITCODE }
  1455.  
  1456. const
  1457.   EEC_OPEN_ERROR          = 0;
  1458.   EEC_MODIFIED            = 1;
  1459.   EEC_NOT_MODIFIED        = 2;
  1460.   EEC_LOADING_INTERRUPTED = 3;
  1461.  
  1462. (*
  1463. typedef intptr_t (WINAPI *FARAPIEDITOR)(
  1464.   const wchar_t *FileName,
  1465.   const wchar_t *Title,
  1466.   intptr_t X1,
  1467.   intptr_t Y1,
  1468.   intptr_t X2,
  1469.   intptr_t Y2,
  1470.   EDITOR_FLAGS Flags,
  1471.   intptr_t StartLine,
  1472.   intptr_t StartChar,
  1473.   uintptr_t CodePage
  1474. );
  1475. *)
  1476. type
  1477.   TFarApiEditor = function (
  1478.     FileName :PFarChar;
  1479.     Title :PFarChar;
  1480.     X1, Y1, X2, Y2 : TIntPtr;
  1481.     Flags :TEditorFlags;
  1482.     StartLine :TIntPtr;
  1483.     StartChar :TIntPtr;
  1484.     CodePage :TUIntPtr
  1485.   ) :TIntPtr; stdcall;
  1486.  
  1487.  
  1488. {------------------------------------------------------------------------------}
  1489.  
  1490. (*
  1491. typedef const wchar_t*(WINAPI *FARAPIGETMSG)(
  1492.   const GUID* PluginId,
  1493.   intptr_t MsgId
  1494. );
  1495. *)
  1496. type
  1497.   TFarApiGetMsg = function (
  1498.     const PluginId :TGUID;
  1499.     MsgId :TIntPtr
  1500.   ) :PFarChar; stdcall;
  1501.  
  1502.  
  1503. { FARHELPFLAGS }
  1504.  
  1505. type
  1506.   TFarHelpFlags = Int64;
  1507.  
  1508. const
  1509.   FHELP_NOSHOWERROR = $80000000;
  1510.   FHELP_SELFHELP    = $00000000;
  1511.   FHELP_FARHELP     = $00000001;
  1512.   FHELP_CUSTOMFILE  = $00000002;
  1513.   FHELP_CUSTOMPATH  = $00000004;
  1514.   FHELP_USECONTENTS = $40000000;
  1515.  
  1516.  
  1517. (*
  1518. typedef BOOL (WINAPI *FARAPISHOWHELP)(
  1519.   const wchar_t *ModuleName,
  1520.   const wchar_t *Topic,
  1521.   FARHELPFLAGS Flags
  1522. );
  1523. *)
  1524. type
  1525.   TFarApiShowHelp = function (
  1526.     ModuleName :PFarChar;
  1527.     Topic :PFarChar;
  1528.     Flags :TFarHelpFlags
  1529.   ) :BOOL; stdcall;
  1530.  
  1531.  
  1532. { ADVANCED_CONTROL_COMMANDS }
  1533.  
  1534. type
  1535.   TADVANCED_CONTROL_COMMANDS = DWORD;
  1536.  
  1537. const
  1538.   ACTL_GETFARMANAGERVERSION  = 0;
  1539. //ACTL_GETSYSWORDDIV         = 1;
  1540.   ACTL_WAITKEY               = 2;
  1541.   ACTL_GETCOLOR              = 3;
  1542.   ACTL_GETARRAYCOLOR         = 4;
  1543. //ACTL_EJECTMEDIA            = 5;
  1544.   ACTL_GETWINDOWINFO         = 6;
  1545.   ACTL_GETWINDOWCOUNT        = 7;
  1546.   ACTL_SETCURRENTWINDOW_     = 8;
  1547.   ACTL_COMMIT                = 9;
  1548.   ACTL_GETFARHWND            = 10;
  1549. //ACTL_GETSYSTEMSETTINGS     = 11;
  1550. //ACTL_GETPANELSETTINGS      = 12;
  1551. //ACTL_GETINTERFACESETTINGS  = 13;
  1552. //ACTL_GETCONFIRMATIONS      = 14;
  1553. //ACTL_GETDESCSETTINGS       = 15;
  1554.   ACTL_SETARRAYCOLOR         = 16;
  1555. //ACTL_GETPLUGINMAXREADDATA  = 17;
  1556. //ACTL_GETDIALOGSETTINGS     = 18;
  1557.   ACTL_REDRAWALL             = 19;
  1558.   ACTL_SYNCHRO               = 20;
  1559.   ACTL_SETPROGRESSSTATE      = 21;
  1560.   ACTL_SETPROGRESSVALUE      = 22;
  1561.   ACTL_QUIT                  = 23;
  1562.   ACTL_GETFARRECT            = 24;
  1563.   ACTL_GETCURSORPOS          = 25;
  1564.   ACTL_SETCURSORPOS          = 26;
  1565.   ACTL_PROGRESSNOTIFY        = 27;
  1566.   ACTL_GETWINDOWTYPE         = 28;
  1567.  
  1568.  
  1569. {------------------------------------------------------------------------------}
  1570. { Macro                                                                        }
  1571.  
  1572. { FAR_MACRO_CONTROL_COMMANDS }
  1573.  
  1574. type
  1575.   TFAR_MACRO_CONTROL_COMMANDS = DWORD;
  1576.  
  1577. const
  1578.   MCTL_LOADALL      = 0;
  1579.   MCTL_SAVEALL      = 1;
  1580.   MCTL_SENDSTRING   = 2;
  1581.   MCTL_GETSTATE     = 5;
  1582.   MCTL_GETAREA      = 6;
  1583.   MCTL_ADDMACRO     = 7;
  1584.   MCTL_DELMACRO     = 8;
  1585.   MCTL_GETLASTERROR = 9;
  1586.  
  1587. { FARKEYMACROFLAGS }
  1588.  
  1589. type
  1590.   TFarKeyMacroFlags = Int64;
  1591.  
  1592. const
  1593.   KMFLAGS_NONE                = 0;
  1594.   KMFLAGS_DISABLEOUTPUT       = $00000001;
  1595.   KMFLAGS_NOSENDKEYSTOPLUGINS = $00000002;
  1596.   KMFLAGS_SILENTCHECK         = $00000001;
  1597. //KMFLAGS_SAVEMACRO           = $00000004;  
  1598.  
  1599.  
  1600. { FARMACROSENDSTRINGCOMMAND }
  1601.  
  1602. const
  1603.   MSSC_POST  = 0;
  1604.   MSSC_CHECK = 2;
  1605.  
  1606.  
  1607. { FARMACROAREA }
  1608.  
  1609. const
  1610.   MACROAREA_OTHER                =  0;
  1611.   MACROAREA_SHELL                =  1;
  1612.   MACROAREA_VIEWER               =  2;
  1613.   MACROAREA_EDITOR               =  3;
  1614.   MACROAREA_DIALOG               =  4;
  1615.   MACROAREA_SEARCH               =  5;
  1616.   MACROAREA_DISKS                =  6;
  1617.   MACROAREA_MAINMENU             =  7;
  1618.   MACROAREA_MENU                 =  8;
  1619.   MACROAREA_HELP                 =  9;
  1620.   MACROAREA_INFOPANEL            = 10;
  1621.   MACROAREA_QVIEWPANEL           = 11;
  1622.   MACROAREA_TREEPANEL            = 12;
  1623.   MACROAREA_FINDFOLDER           = 13;
  1624.   MACROAREA_USERMENU             = 14;
  1625.   MACROAREA_SHELLAUTOCOMPLETION  = 15;
  1626.   MACROAREA_DIALOGAUTOCOMPLETION = 16;
  1627.   MACROAREA_COMMON               = 255;
  1628.  
  1629.  
  1630. { FARMACROSTATE }
  1631.  
  1632. const
  1633.   MACROSTATE_NOMACRO          = 0;
  1634.   MACROSTATE_EXECUTING        = 1;
  1635.   MACROSTATE_EXECUTING_COMMON = 2;
  1636.   MACROSTATE_RECORDING        = 3;
  1637.   MACROSTATE_RECORDING_COMMON = 4;
  1638.  
  1639.  
  1640. {FARMACROPARSEERRORCODE}
  1641.  
  1642. const
  1643.   MPEC_SUCCESS                =  0;
  1644.   MPEC_ERROR                  =  1;
  1645.  
  1646. (*
  1647. struct MacroParseResult
  1648. {
  1649.   size_t StructSize;
  1650.   DWORD ErrCode;
  1651.   COORD ErrPos;
  1652.   const wchar_t *ErrSrc;
  1653. };
  1654. *)
  1655. type
  1656.   PMacroParseResult = ^TMacroParseResult;
  1657.   TMacroParseResult = record
  1658.     StructSize :size_t;
  1659.     ErrCode :DWORD;
  1660.     ErrPos :COORD;
  1661.     ErrSrc :PFarChar;
  1662.   end;
  1663.  
  1664. (*
  1665. struct MacroSendMacroText
  1666. {
  1667.   size_t StructSize;
  1668.   FARKEYMACROFLAGS Flags;
  1669.   INPUT_RECORD AKey;
  1670.   const wchar_t *SequenceText;
  1671. };
  1672. *)
  1673. type
  1674.   PMacroSendMacroText = ^TMacroSendMacroText;
  1675.   TMacroSendMacroText = record
  1676.     StructSize :size_t;
  1677.     Flags :TFarKeyMacroFlags;
  1678.     AKey :TInputRecord;
  1679.     SequenceText :PFarChar;
  1680.   end;
  1681.  
  1682.  
  1683. { FARADDKEYMACROFLAGS }
  1684.  
  1685. type
  1686.   TFarAddKeyMacroFlags = Int64;
  1687.  
  1688. const
  1689.   AKMFLAGS_NONE  = 0;
  1690.  
  1691. (*
  1692. typedef intptr_t (WINAPI *FARMACROCALLBACK)(void* Id,FARADDKEYMACROFLAGS Flags);
  1693. *)
  1694. type
  1695.   TFarMacroCallback = function(
  1696.     Id :Pointer;
  1697.     Flags :TFarAddKeyMacroFlags
  1698.   ) :TIntPtr; stdcall;
  1699.  
  1700. (*
  1701. struct MacroAddMacro
  1702. {
  1703.   size_t StructSize;
  1704.   void* Id;
  1705.   const wchar_t *SequenceText;
  1706.   const wchar_t *Description;
  1707.   FARKEYMACROFLAGS Flags;
  1708.   INPUT_RECORD AKey;
  1709.   enum FARMACROAREA Area;
  1710.   FARMACROCALLBACK Callback;
  1711. };
  1712. *)
  1713. type
  1714.   PMacroAddMacro = ^TMacroAddMacro;
  1715.   TMacroAddMacro = record
  1716.     StructSize :size_t;
  1717.     Id :Pointer;
  1718.     SequenceText :PFarChar;
  1719.     Description :PFarChar;
  1720.     Flags :TFarKeyMacroFlags;
  1721.     AKey :TInputRecord;
  1722.     Area :DWORD{FARMACROAREA};
  1723.     Callback :TFarMacroCallback;
  1724.   end;
  1725.  
  1726.  
  1727. { FARMACROVARTYPE }
  1728.  
  1729. const
  1730.   FMVT_UNKNOWN  = 0;
  1731.   FMVT_INTEGER  = 1;
  1732.   FMVT_STRING   = 2;
  1733.   FMVT_DOUBLE   = 3;
  1734.   FMVT_BOOLEAN  = 4;
  1735.   FMVT_BINARY   = 5;
  1736.  
  1737. (*
  1738. struct FarMacroValue
  1739. {
  1740.   enum FARMACROVARTYPE Type;
  1741.   union
  1742.   {
  1743.     __int64        Integer;
  1744.     __int64        Boolean;
  1745.     double         Double;
  1746.     const wchar_t *String;
  1747.     struct
  1748.     {
  1749.       void *Data;
  1750.       size_t Length;
  1751.     } Binary;
  1752.   } Value;
  1753. };
  1754. *)
  1755. type
  1756.   PFarBinaryValue = ^TFarBinaryValue;
  1757.   TFarBinaryValue = record
  1758.     Data :Pointer;
  1759.     Length :SIZE_T;
  1760.   end;
  1761.  
  1762.   PFarMacroValue = ^TFarMacroValue;
  1763.   TFarMacroValue = record
  1764.     fType :DWORD; {FARMACROVARTYPE}
  1765.     Value : record case byte of
  1766.       0 : (fInteger :Int64);
  1767.       1 : (fDouble :Double);
  1768.       2 : (fString :PFarChar);
  1769.       3 : (fBinary :TFarBinaryValue);
  1770.     end;
  1771.   end;
  1772.  
  1773.   PFarMacroValueArray = ^TFarMacroValueArray;
  1774.   TFarMacroValueArray = packed array[0..MaxInt div SizeOf(TFarMacroValue) - 1] of TFarMacroValue;
  1775.  
  1776.  
  1777. { MACROPLUGINRETURNTYPE }
  1778.  
  1779. const
  1780.   MPRT_NORMALFINISH  = 0;
  1781.   MPRT_ERRORFINISH   = 1;
  1782.   MPRT_ERRORPARSE    = 2;
  1783.   MPRT_KEYS          = 3;
  1784.   MPRT_PRINT         = 4;
  1785.   MPRT_PLUGINCALL    = 5;
  1786.   MPRT_PLUGINMENU    = 6;
  1787.   MPRT_PLUGINCONFIG  = 7;
  1788.   MPRT_PLUGINCOMMAND = 8;
  1789.  
  1790. (*
  1791. struct MacroPluginReturn
  1792. {
  1793.   size_t Count;
  1794.   struct FarMacroValue *Values;
  1795.   enum MACROPLUGINRETURNTYPE ReturnType;
  1796. };
  1797. *)
  1798. type
  1799.   PMacroPluginReturn = ^TMacroPluginReturn;
  1800.   TMacroPluginReturn = record
  1801.     Count :size_t;
  1802.     Values :PFarMacroValueArray;
  1803.     ReturnType :Integer; {MACROPLUGINRETURNTYPE}
  1804.   end;
  1805.  
  1806. (*
  1807. struct FarMacroCall
  1808. {
  1809.   size_t StructSize;
  1810.   size_t Count;
  1811.   struct FarMacroValue *Values;
  1812.   void (WINAPI *Callback)(void *CallbackData, struct FarMacroValue *Values);
  1813.   void *CallbackData;
  1814. };
  1815. *)
  1816. type
  1817.   PFarMacroCall = ^TFarMacroCall;
  1818.   TFarMacroCall = record
  1819.     StructSize :size_t;
  1820.     Count :size_t;
  1821.     Values :PFarMacroValueArray;
  1822.     Callback :Pointer;
  1823.     CallbackData :Pointer;
  1824.   end;
  1825.  
  1826. (*
  1827. struct FarGetValue
  1828. {
  1829.   size_t StructSize;
  1830.   intptr_t Type;
  1831.   struct FarMacroValue Value;
  1832. };
  1833. *)
  1834. type
  1835.   PFarGetValue = ^TFarGetValue;
  1836.   TFarGetValue = record
  1837.     StructSize :size_t;
  1838.     fType :TIntPtr;
  1839.     Value :TFarMacroValue;
  1840.   end;
  1841.  
  1842. {------------------------------------------------------------------------------}
  1843.  
  1844. { FARSETCOLORFLAGS }
  1845.  
  1846. type
  1847.   TFarSetColorFlags = Int64;
  1848.  
  1849. const
  1850.   FSETCLR_NONE    = 0;
  1851.   FSETCLR_REDRAW  = $00000001;
  1852.  
  1853. (*
  1854. struct FarSetColors
  1855. {
  1856.   size_t StructSize;
  1857.   FARSETCOLORFLAGS Flags;
  1858.   size_t StartIndex;
  1859.   size_t ColorsCount;
  1860.   struct FarColor* Colors;
  1861. };
  1862. *)
  1863. type
  1864.   PFarSetColors = ^TFarSetColors;
  1865.   TFarSetColors = record
  1866.     StructSize :size_t;
  1867.     Flags :TFarSetColorFlags;
  1868.     StartIndex :size_t;
  1869.     ColorCount :size_t;
  1870.     Colors :PFarColorArray;
  1871.   end;
  1872.  
  1873.  
  1874. { WINDOWINFO_TYPE }
  1875.  
  1876. const
  1877.   WTYPE_PANELS     = 1;
  1878.   WTYPE_VIEWER     = 2;
  1879.   WTYPE_EDITOR     = 3;
  1880.   WTYPE_DIALOG     = 4;
  1881.   WTYPE_VMENU      = 5;
  1882.   WTYPE_HELP       = 6;
  1883.  
  1884.  
  1885. { WINDOWINFO_FLAGS }
  1886.  
  1887. type
  1888.   TWindowInfoFlags = Int64;
  1889.  
  1890. const
  1891.   WIF_MODIFIED = $00000001;
  1892.   WIF_CURRENT  = $00000002;
  1893.   WIF_MODAL    = $00000004;  
  1894.  
  1895.  
  1896. (*
  1897. struct WindowInfo
  1898. {
  1899.   size_t StructSize;
  1900.   intptr_t Id;
  1901.   wchar_t *TypeName;
  1902.   wchar_t *Name;
  1903.   intptr_t TypeNameSize;
  1904.   intptr_t NameSize;
  1905.   intptr_t Pos;
  1906.   enum WINDOWINFO_TYPE Type;
  1907.   WINDOWINFO_FLAGS Flags;
  1908. };
  1909. *)
  1910. type
  1911.   PWindowInfo = ^TWindowInfo;
  1912.   TWindowInfo = record
  1913.     StructSize :size_t;
  1914.     ID :TIntPtr;
  1915.     TypeName :PFarChar;
  1916.     Name :PFarChar;
  1917.     TypeNameSize :TIntPtr;
  1918.     NameSize :TIntPtr;
  1919.     Pos :TIntPtr;
  1920.     WindowType :DWORD; {WINDOWINFO_TYPE}
  1921.     Flags :TWindowInfoFlags;
  1922.   end;
  1923.  
  1924. (*
  1925. struct WindowType
  1926. {
  1927.   size_t StructSize;
  1928.   enum WINDOWINFO_TYPE Type;
  1929. };
  1930. *)
  1931. type
  1932.   PWindowType = ^TWindowType;
  1933.   TWindowType = record
  1934.     StructSize :size_t;
  1935.     fType :DWORD {WINDOWINFO_TYPE};
  1936.   end;
  1937.  
  1938.  
  1939. { TASKBARPROGRESSTATE }
  1940.  
  1941. const
  1942.   TBPS_NOPROGRESS    = 0;
  1943.   TBPS_INDETERMINATE = 1;
  1944.   TBPS_NORMAL        = 2;
  1945.   TBPS_ERROR         = 4;
  1946.   TBPS_PAUSED        = 8;
  1947.  
  1948. (*
  1949. struct PROGRESSVALUE
  1950. {
  1951.   size_t StructSize;
  1952.   unsigned __int64 Completed;
  1953.   unsigned __int64 Total;
  1954. };
  1955. *)
  1956. type
  1957.   PProgressValue = ^TProgressValue;
  1958.   TProgressValue = record
  1959.     StructSize :size_t;
  1960.     Completed :Int64;
  1961.     Total :Int64;
  1962.   end;
  1963.  
  1964.  
  1965. {------------------------------------------------------------------------------}
  1966.  
  1967. { VIEWER_CONTROL_COMMANDS }
  1968.  
  1969. const
  1970.   VCTL_GETINFO     = 0;
  1971.   VCTL_QUIT        = 1;
  1972.   VCTL_REDRAW      = 2;
  1973.   VCTL_SETKEYBAR   = 3;
  1974.   VCTL_SETPOSITION = 4;
  1975.   VCTL_SELECT      = 5;
  1976.   VCTL_SETMODE     = 6;
  1977.   VCTL_GETFILENAME = 7;
  1978.  
  1979.  
  1980. { VIEWER_OPTIONS }
  1981.  
  1982. type
  1983.   TViewerOptions = Int64;
  1984.  
  1985. const
  1986.   VOPT_NONE             = 0;
  1987.   VOPT_SAVEFILEPOSITION = 1;
  1988.   VOPT_AUTODETECTTABLE  = 2;
  1989.  
  1990. {VIEWER_SETMODE_TYPES}
  1991.  
  1992. const
  1993.   VSMT_HEX       = 0;
  1994.   VSMT_WRAP      = 1;
  1995.   VSMT_WORDWRAP  = 2;
  1996.  
  1997.  
  1998. {VIEWER_SETMODEFLAGS_TYPES}
  1999.  
  2000. type
  2001.   TViewerSetModeFlagsTypes = Int64;
  2002.  
  2003. const
  2004.   VSMFL_REDRAW   = $00000001;
  2005.  
  2006. (*
  2007. struct ViewerSetMode
  2008. {
  2009.   size_t StructSize;
  2010.   enum VIEWER_SETMODE_TYPES Type;
  2011.   union
  2012.   {
  2013.     intptr_t iParam;
  2014.     wchar_t *wszParam;
  2015.   }
  2016.   Param;
  2017.   VIEWER_SETMODEFLAGS_TYPES Flags;
  2018. };
  2019. *)
  2020. type
  2021.   PViewerSetMode = ^TViewerSetMode;
  2022.   TViewerSetMode = record
  2023.     StructSize :size_t;
  2024.     ParamType :DWORD; {VIEWER_SETMODE_TYPES}
  2025.     Param : record case byte of
  2026.       0 : (iParam : TIntPtr);
  2027.       1 : (wszParam : PFarChar);
  2028.     end;
  2029.     Flags :TViewerSetModeFlagsTypes;
  2030.   end;
  2031.  
  2032. (*
  2033. struct ViewerSelect
  2034. {
  2035.   size_t StructSize;
  2036.   __int64 BlockStartPos;
  2037.   __int64 BlockLen;
  2038. };
  2039. *)
  2040. type
  2041.   PViewerSelect = ^TViewerSelect;
  2042.   TViewerSelect = record
  2043.     StructSize :size_t;
  2044.     BlockStartPos :Int64;
  2045.     BlockLen :Int64;
  2046.   end;
  2047.  
  2048.  
  2049. { VIEWER_SETPOS_FLAGS }
  2050.  
  2051. type
  2052.   TViewerSetPosFlags = Int64;
  2053.  
  2054. const
  2055.   VSP_NOREDRAW    = $0001;
  2056.   VSP_PERCENT     = $0002;
  2057.   VSP_RELATIVE    = $0004;
  2058.   VSP_NORETNEWPOS = $0008;
  2059.  
  2060. (*
  2061. struct ViewerSetPosition
  2062. {
  2063.   size_t StructSize;
  2064.   VIEWER_SETPOS_FLAGS Flags;
  2065.   __int64 StartPos;
  2066.   __int64 LeftPos;
  2067. };
  2068. *)
  2069. type
  2070.   PViewerSetPosition = ^TViewerSetPosition;
  2071.   TViewerSetPosition = record
  2072.     StructSize :size_t;
  2073.     Flags :TViewerSetPosFlags;
  2074.     StartPos :Int64;
  2075.     LeftPos :Int64;
  2076.   end;
  2077.  
  2078.   
  2079. {VIEWER_MODE_FLAGS}
  2080.  
  2081. type
  2082.   TViewerModeFlags = Int64;
  2083.  
  2084. const
  2085.   VMF_WRAP     = $0000000000000001;
  2086.   VMF_WORDWRAP = $0000000000000002;
  2087.  
  2088.  
  2089. {VIEWER_MODE_TYPE}
  2090.  
  2091. const
  2092.   VMT_TEXT  = 0;
  2093.   VMT_HEX   = 1;
  2094.   VMT_DUMP  = 2;
  2095.  
  2096. (*
  2097. struct ViewerMode
  2098. {
  2099.   uintptr_t CodePage;
  2100.   VIEWER_MODE_FLAGS Flags;
  2101.   enum VIEWER_MODE_TYPE Type;
  2102. };
  2103. *)
  2104. type
  2105.   PViewerMode = ^TViewerMode;
  2106.   TViewerMode = record
  2107.     CodePage :TUIntPtr;
  2108.     Flags :TViewerModeFlags;
  2109.     _Type :DWORD {VIEWER_MODE_TYPE};
  2110.   end;
  2111.  
  2112. (*
  2113. struct ViewerInfo
  2114. {
  2115.   size_t StructSize;
  2116.   intptr_t ViewerID;
  2117.   intptr_t TabSize;
  2118.   struct ViewerMode CurMode;
  2119.   __int64 FileSize;
  2120.   __int64 FilePos;
  2121.   __int64 LeftPos;
  2122.   VIEWER_OPTIONS Options;
  2123.   intptr_t WindowSizeX;
  2124.   intptr_t WindowSizeY;
  2125. };
  2126. *)
  2127. type
  2128.   PViewerInfo = ^TViewerInfo;
  2129.   TViewerInfo = record
  2130.     StructSize :size_t;
  2131.     ViewerID :TIntPtr;
  2132.     TabSize :TIntPtr;
  2133.     CurMode :TViewerMode;
  2134.     FileSize :Int64;
  2135.     FilePos :Int64;
  2136.     LeftPos :Int64;
  2137.     Options :TViewerOptions;
  2138.     WindowSizeX :TIntPtr;
  2139.     WindowSizeY :TIntPtr;
  2140.   end;
  2141.  
  2142.  
  2143. { VIEWER_EVENTS }
  2144.  
  2145. const
  2146.   VE_READ      = 0;
  2147.   VE_CLOSE     = 1;
  2148.   VE_GOTFOCUS  = 6;
  2149.   VE_KILLFOCUS = 7;
  2150.  
  2151.  
  2152. { EDITOR_EVENTS }
  2153.  
  2154. const
  2155.   EE_READ       = 0;
  2156.   EE_SAVE       = 1;
  2157.   EE_REDRAW     = 2;
  2158.   EE_CLOSE      = 3;
  2159.   EE_GOTFOCUS   = 6;
  2160.   EE_KILLFOCUS  = 7;
  2161.   EE_CHANGE     = 8;
  2162.  
  2163.  
  2164. { DIALOG_EVENTS }
  2165.  
  2166. const
  2167.   DE_DLGPROCINIT    = 0;
  2168.   DE_DEFDLGPROCINIT = 1;
  2169.   DE_DLGPROCEND     = 2;
  2170.  
  2171.  
  2172. { SYNCHRO_EVENTS }
  2173.  
  2174. const
  2175.   SE_COMMONSYNCHRO  = 0;
  2176.  
  2177.  
  2178. const
  2179.   EEREDRAW_ALL    = Pointer(0);
  2180. //EEREDRAW_CHANGE = Pointer(1);
  2181. //EEREDRAW_LINE   = Pointer(2);
  2182.   CURRENT_EDITOR  = -1;
  2183.  
  2184.  
  2185. {------------------------------------------------------------------------------}
  2186. { Editor                                                                       }
  2187.  
  2188. { EDITOR_CONTROL_COMMANDS }
  2189.  
  2190. const
  2191.   ECTL_GETSTRING             = 0;
  2192.   ECTL_SETSTRING             = 1;
  2193.   ECTL_INSERTSTRING          = 2;
  2194.   ECTL_DELETESTRING          = 3;
  2195.   ECTL_DELETECHAR            = 4;
  2196.   ECTL_INSERTTEXT            = 5;
  2197.   ECTL_GETINFO               = 6;
  2198.   ECTL_SETPOSITION           = 7;
  2199.   ECTL_SELECT                = 8;
  2200.   ECTL_REDRAW                = 9;
  2201.   ECTL_TABTOREAL             = 10;
  2202.   ECTL_REALTOTAB             = 11;
  2203.   ECTL_EXPANDTABS            = 12;
  2204.   ECTL_SETTITLE              = 13;
  2205.   ECTL_READINPUT             = 14;
  2206.   ECTL_PROCESSINPUT          = 15;
  2207.   ECTL_ADDCOLOR              = 16;
  2208.   ECTL_GETCOLOR              = 17;
  2209.   ECTL_SAVEFILE              = 18;
  2210.   ECTL_QUIT                  = 19;
  2211.   ECTL_SETKEYBAR             = 20;
  2212.  
  2213.   ECTL_SETPARAM              = 22;
  2214.   ECTL_GETBOOKMARKS          = 23;
  2215.   ECTL_DELETEBLOCK           = 25;
  2216.   ECTL_ADDSESSIONBOOKMARK    = 26;
  2217.   ECTL_PREVSESSIONBOOKMARK   = 27;
  2218.   ECTL_NEXTSESSIONBOOKMARK   = 28;
  2219.   ECTL_CLEARSESSIONBOOKMARKS = 29;
  2220.   ECTL_DELETESESSIONBOOKMARK = 30;
  2221.   ECTL_GETSESSIONBOOKMARKS   = 31;
  2222.   ECTL_UNDOREDO              = 32;
  2223.   ECTL_GETFILENAME           = 33;
  2224.   ECTL_DELCOLOR              = 34;
  2225.  
  2226.  
  2227. { EDITOR_SETPARAMETER_TYPES }
  2228.  
  2229. const
  2230.   ESPT_TABSIZE          = 0;
  2231.   ESPT_EXPANDTABS       = 1;
  2232.   ESPT_AUTOINDENT       = 2;
  2233.   ESPT_CURSORBEYONDEOL  = 3;
  2234.   ESPT_CHARCODEBASE     = 4;
  2235.   ESPT_CODEPAGE         = 5;
  2236.   ESPT_SAVEFILEPOSITION = 6;
  2237.   ESPT_LOCKMODE         = 7;
  2238.   ESPT_SETWORDDIV       = 8;
  2239.   ESPT_GETWORDDIV       = 9;
  2240.   ESPT_SHOWWHITESPACE   = 10;
  2241.   ESPT_SETBOM           = 11;
  2242.  
  2243. (*
  2244. struct EditorSetParameter
  2245. {
  2246.   size_t StructSize;
  2247.   enum EDITOR_SETPARAMETER_TYPES Type;
  2248.   union
  2249.   {
  2250.     intptr_t iParam;
  2251.     wchar_t *wszParam;
  2252.     intptr_t Reserved;
  2253.   } Param;
  2254.   unsigned __int64 Flags;
  2255.   size_t Size;
  2256. };
  2257. *)
  2258. type
  2259.   PEditorSetParameter = ^TEditorSetParameter;
  2260.   TEditorSetParameter = record
  2261.     StructSize :size_t;
  2262.     ParamType :DWORD; {EDITOR_SETPARAMETER_TYPES}
  2263.     Param : record case byte of
  2264.       0 : (iParam :TIntPtr);
  2265.       1 : (wszParam :PFarChar);
  2266.       2 : (Reserved :TIntPtr);
  2267.     end;
  2268.     Flags :Int64;
  2269.     Size :size_t;
  2270.   end;
  2271.  
  2272.  
  2273. {EDITOR_UNDOREDO_COMMANDS}
  2274.  
  2275. const
  2276.   EUR_BEGIN = 0;
  2277.   EUR_END   = 1;
  2278.   EUR_UNDO  = 2;
  2279.   EUR_REDO  = 3;
  2280.  
  2281. (*
  2282. struct EditorUndoRedo
  2283. {
  2284.   size_t StructSize;
  2285.   enum EDITOR_UNDOREDO_COMMANDS Command;
  2286. };
  2287. *)
  2288. type
  2289.   PEditorUndoRedo = ^TEditorUndoRedo;
  2290.   TEditorUndoRedo = record
  2291.     StructSize :size_t;
  2292.     Command :DWORD; {EDITOR_UNDOREDO_COMMANDS}
  2293.   end;
  2294.  
  2295.  
  2296. (*
  2297. struct EditorGetString
  2298. {
  2299.   size_t StructSize;
  2300.   intptr_t StringNumber;
  2301.   intptr_t StringLength;
  2302.   const wchar_t *StringText;
  2303.   const wchar_t *StringEOL;
  2304.   intptr_t SelStart;
  2305.   intptr_t SelEnd;
  2306. };
  2307. *)
  2308. type
  2309.   PEditorGetString = ^TEditorGetString;
  2310.   TEditorGetString = record
  2311.     StructSize :size_t;
  2312.     StringNumber :TIntPtr;
  2313.     StringLength :TIntPtr;
  2314.     StringText :PFarChar;
  2315.     StringEOL :PFarChar;
  2316.     SelStart :TIntPtr;
  2317.     SelEnd :TIntPtr;
  2318.   end;
  2319.  
  2320. (*
  2321. struct EditorSetString
  2322. {
  2323.   size_t StructSize;
  2324.   intptr_t StringNumber;
  2325.   intptr_t StringLength;
  2326.   const wchar_t *StringText;
  2327.   const wchar_t *StringEOL;
  2328. };
  2329. *)
  2330. type
  2331.   PEditorSetString = ^TEditorSetString;
  2332.   TEditorSetString = record
  2333.     StructSize :size_t;
  2334.     StringNumber :TIntPtr;
  2335.     StringLength :TIntPtr;
  2336.     StringText :PFarChar;
  2337.     StringEOL :PFarChar;
  2338.   end;
  2339.  
  2340.  
  2341. { EXPAND_TABS }
  2342.  
  2343. const
  2344.   EXPAND_NOTABS  = 0;
  2345.   EXPAND_ALLTABS = 1;
  2346.   EXPAND_NEWTABS = 2;
  2347.  
  2348.  
  2349. { EDITOR_OPTIONS }
  2350.  
  2351. const
  2352.   EOPT_EXPANDALLTABS      = $00000001;
  2353.   EOPT_PERSISTENTBLOCKS   = $00000002;
  2354.   EOPT_DELREMOVESBLOCKS   = $00000004;
  2355.   EOPT_AUTOINDENT         = $00000008;
  2356.   EOPT_SAVEFILEPOSITION   = $00000010;
  2357.   EOPT_AUTODETECTCODEPAGE = $00000020;
  2358.   EOPT_CURSORBEYONDEOL    = $00000040;
  2359.   EOPT_EXPANDONLYNEWTABS  = $00000080;
  2360.   EOPT_SHOWWHITESPACE     = $00000100;
  2361.   EOPT_BOM                = $00000200;
  2362.   EOPT_SHOWLINEBREAK      = $00000400;
  2363.  
  2364.  
  2365. { EDITOR_BLOCK_TYPES }
  2366.  
  2367. const
  2368.   BTYPE_NONE   = 0;
  2369.   BTYPE_STREAM = 1;
  2370.   BTYPE_COLUMN = 2;
  2371.  
  2372.  
  2373. { EDITOR_CURRENTSTATE }
  2374.  
  2375. const
  2376.   ECSTATE_MODIFIED = $00000001;
  2377.   ECSTATE_SAVED    = $00000002;
  2378.   ECSTATE_LOCKED   = $00000004;
  2379.  
  2380. (*
  2381. struct EditorInfo
  2382. {
  2383.   size_t StructSize;
  2384.   intptr_t EditorID;
  2385.   intptr_t WindowSizeX;
  2386.   intptr_t WindowSizeY;
  2387.   intptr_t TotalLines;
  2388.   intptr_t CurLine;
  2389.   intptr_t CurPos;
  2390.   intptr_t CurTabPos;
  2391.   intptr_t TopScreenLine;
  2392.   intptr_t LeftPos;
  2393.   intptr_t Overtype;
  2394.   intptr_t BlockType;
  2395.   intptr_t BlockStartLine;
  2396.   uintptr_t Options;
  2397.   intptr_t TabSize;
  2398.   size_t BookmarkCount;
  2399.   size_t SessionBookmarkCount;
  2400.   uintptr_t CurState;
  2401.   uintptr_t CodePage;
  2402. };
  2403. *)
  2404. type
  2405.   PEditorInfo = ^TEditorInfo;
  2406.   TEditorInfo = record
  2407.     StructSize :size_t;
  2408.     EditorID :TIntPtr;
  2409.     WindowSizeX :TIntPtr;
  2410.     WindowSizeY :TIntPtr;
  2411.     TotalLines :TIntPtr;
  2412.     CurLine :TIntPtr;
  2413.     CurPos :TIntPtr;
  2414.     CurTabPos :TIntPtr;
  2415.     TopScreenLine :TIntPtr;
  2416.     LeftPos :TIntPtr;
  2417.     Overtype :TIntPtr;
  2418.     BlockType :TIntPtr;
  2419.     BlockStartLine :TIntPtr;
  2420.     Options :TUIntPtr;
  2421.     TabSize :TIntPtr;
  2422.     BookmarkCount :size_t;
  2423.     SessionBookmarkCount :size_t;
  2424.     CurState :TUIntPtr;
  2425.     CodePage :TUIntPtr;
  2426.   end;
  2427.  
  2428. (*
  2429. struct EditorBookmarks
  2430. {
  2431.   size_t StructSize;
  2432.   size_t Size;
  2433.   size_t Count;
  2434.   intptr_t *Line;
  2435.   intptr_t *Cursor;
  2436.   intptr_t *ScreenLine;
  2437.   intptr_t *LeftPos;
  2438. };
  2439. *)
  2440. type
  2441.   PEditorBookMarks = ^TEditorBookMarks;
  2442.   TEditorBookMarks = record
  2443.     StructSize :size_t;
  2444.     Size :size_t;
  2445.     Count :size_t;
  2446.     Line :PIntPtrArray;
  2447.     Cursor :PIntPtrArray;
  2448.     ScreenLine :PIntPtrArray;
  2449.     LeftPos :PIntPtrArray;
  2450.   end;
  2451.  
  2452. (*
  2453. struct EditorSetPosition
  2454. {
  2455.   size_t StructSize;
  2456.   intptr_t CurLine;
  2457.   intptr_t CurPos;
  2458.   intptr_t CurTabPos;
  2459.   intptr_t TopScreenLine;
  2460.   intptr_t LeftPos;
  2461.   intptr_t Overtype;
  2462. };
  2463. *)
  2464. type
  2465.   PEditorSetPosition = ^TEditorSetPosition;
  2466.   TEditorSetPosition = record
  2467.     StructSize :size_t;
  2468.     CurLine :TIntPtr;
  2469.     CurPos :TIntPtr;
  2470.     CurTabPos :TIntPtr;
  2471.     TopScreenLine :TIntPtr;
  2472.     LeftPos :TIntPtr;
  2473.     Overtype :TIntPtr;
  2474.   end;
  2475.  
  2476. (*
  2477. struct EditorSelect
  2478. {
  2479.   size_t StructSize;
  2480.   intptr_t BlockType;
  2481.   intptr_t BlockStartLine;
  2482.   intptr_t BlockStartPos;
  2483.   intptr_t BlockWidth;
  2484.   intptr_t BlockHeight;
  2485. };
  2486. *)
  2487. type
  2488.   PEditorSelect = ^TEditorSelect;
  2489.   TEditorSelect = record
  2490.     StructSize :size_t;
  2491.     BlockType :TIntPtr;
  2492.     BlockStartLine :TIntPtr;
  2493.     BlockStartPos :TIntPtr;
  2494.     BlockWidth :TIntPtr;
  2495.     BlockHeight :TIntPtr;
  2496.   end;
  2497.  
  2498. (*
  2499. struct EditorConvertPos
  2500. {
  2501.   size_t StructSize;
  2502.   intptr_t StringNumber;
  2503.   intptr_t SrcPos;
  2504.   intptr_t DestPos;
  2505. };
  2506. *)
  2507. type
  2508.   PEditorConvertPos = ^TEditorConvertPos;
  2509.   TEditorConvertPos = record
  2510.     StructSize :size_t;
  2511.     StringNumber :TIntPtr;
  2512.     SrcPos :TIntPtr;
  2513.     DestPos :TIntPtr;
  2514.   end;
  2515.  
  2516.  
  2517. { EDITORCOLORFLAGS }
  2518.  
  2519. type
  2520.   TEditorColorFlags = Int64;
  2521.  
  2522. const
  2523.   ECF_TABMARKFIRST   = $00000001;
  2524.   ECF_TABMARKCURRENT = $00000002;
  2525.  
  2526. (*
  2527. struct EditorColor
  2528. {
  2529.   size_t StructSize;
  2530.   intptr_t StringNumber;
  2531.   intptr_t ColorItem;
  2532.   intptr_t StartPos;
  2533.   intptr_t EndPos;
  2534.   uintptr_t Priority;
  2535.   EDITORCOLORFLAGS Flags;
  2536.   struct FarColor Color;
  2537.   GUID Owner;
  2538. };
  2539. *)
  2540. type
  2541.   PEditorColor = ^TEditorColor;
  2542.   TEditorColor = record
  2543.     StructSize :size_t;
  2544.     StringNumber :TIntPtr;
  2545.     ColorItem :TIntPtr;
  2546.     StartPos :TIntPtr;
  2547.     EndPos :TIntPtr;
  2548.     Priority :TUIntPtr;
  2549.     Flags :TEditorColorFlags;
  2550.     Color :TFarColor;
  2551.     Owner :TGUID;
  2552.   end;
  2553.  
  2554. (*
  2555. struct EditorDeleteColor
  2556. {
  2557.   size_t StructSize;
  2558.   GUID Owner;
  2559.   intptr_t StringNumber;
  2560.   intptr_t StartPos;
  2561. };
  2562. *)
  2563. type
  2564.   PEditorDeleteColor = ^TEditorDeleteColor;
  2565.   TEditorDeleteColor = record
  2566.     StructSize :size_t;
  2567.     Owner :TGUID;
  2568.     StringNumber :TIntPtr;
  2569.     StartPos :TIntPtr;
  2570.   end;
  2571.  
  2572. const
  2573.   EDITOR_COLOR_NORMAL_PRIORITY = $80000000;
  2574.  
  2575.  
  2576. (*
  2577. struct EditorSaveFile
  2578. {
  2579.   size_t StructSize;
  2580.   const wchar_t *FileName;
  2581.   const wchar_t *FileEOL;
  2582.   uintptr_t CodePage;
  2583. };
  2584. *)
  2585. type
  2586.   PEditorSaveFile = ^TEditorSaveFile;
  2587.   TEditorSaveFile = record
  2588.     StructSize :size_t;
  2589.     FileName :PFarChar;
  2590.     FileEOL :PFarChar;
  2591.     CodePage :TUIntPtr;
  2592.   end;
  2593.  
  2594.  
  2595. { EDITOR_CHANGETYPE }
  2596.  
  2597. const
  2598.   ECTYPE_CHANGED = 0;
  2599.   ECTYPE_ADDED   = 1;
  2600.   ECTYPE_DELETED = 2;
  2601.  
  2602. (*
  2603. struct EditorChange
  2604. {
  2605.   size_t StructSize;
  2606.   enum EDITOR_CHANGETYPE Type;
  2607.   intptr_t StringNumber;
  2608. };
  2609. *)
  2610. type
  2611.   PEditorChange = ^TEditorChange;
  2612.   TEditorChange = record
  2613.     StructSize :size_t;
  2614.     _Type :DWORD; {EDITOR_CHANGETYPE}
  2615.     StringNumber :TIntPtr;
  2616.   end;
  2617.  
  2618.  
  2619. {------------------------------------------------------------------------------}
  2620.  
  2621. { INPUTBOXFLAGS }
  2622.  
  2623. type
  2624.   TInputBoxFlags = Int64;
  2625.  
  2626. const
  2627.   FIB_NONE             = 0;
  2628.   FIB_ENABLEEMPTY      = $00000001;
  2629.   FIB_PASSWORD         = $00000002;
  2630.   FIB_EXPANDENV        = $00000004;
  2631.   FIB_NOUSELASTHISTORY = $00000008;
  2632.   FIB_BUTTONS          = $00000010;
  2633.   FIB_NOAMPERSAND      = $00000020;
  2634.   FIB_EDITPATH         = $00000040;
  2635.   FIB_EDITPATHEXEC     = $00000080;
  2636.  
  2637. (*
  2638. typedef intptr_t (WINAPI *FARAPIINPUTBOX)(
  2639.     const GUID* PluginId,
  2640.     const GUID* Id,
  2641.     const wchar_t *Title,
  2642.     const wchar_t *SubTitle,
  2643.     const wchar_t *HistoryName,
  2644.     const wchar_t *SrcText,
  2645.     wchar_t *DestText,
  2646.     size_t DestSize,
  2647.     const wchar_t *HelpTopic,
  2648.     INPUTBOXFLAGS Flags
  2649. );
  2650. *)
  2651. type
  2652.   TFarApiInputBox = function (
  2653.     const PluginID :TGUID;
  2654.     const ID :TGUID;
  2655.     Title : PFarChar;
  2656.     SubTitle : PFarChar;
  2657.     HistoryName : PFarChar;
  2658.     SrcText : PFarChar;
  2659.     DestText : PFarChar;
  2660.     DestSize : size_t;
  2661.     HelpTopic : PFarChar;
  2662.     Flags :TInputBoxFlags
  2663.   ) :TIntPtr; stdcall;
  2664.  
  2665. {------------------------------------------------------------------------------}
  2666.  
  2667. { FAR_PLUGINS_CONTROL_COMMANDS }
  2668.  
  2669. const
  2670.   PCTL_LOADPLUGIN           = 0;
  2671.   PCTL_UNLOADPLUGIN         = 1;
  2672.   PCTL_FORCEDLOADPLUGIN     = 2;
  2673.   PCTL_FINDPLUGIN           = 3;
  2674.   PCTL_GETPLUGININFORMATION = 4;
  2675.   PCTL_GETPLUGINS           = 5;
  2676.  
  2677.  
  2678. { FAR_PLUGIN_LOAD_TYPE }
  2679.  
  2680. const
  2681.   PLT_PATH = 0;
  2682.  
  2683.  
  2684. { FAR_PLUGIN_FIND_TYPE }
  2685.  
  2686. const
  2687.   PFM_GUID        = 0;
  2688.   PFM_MODULENAME  = 1;
  2689.  
  2690.   
  2691. { FAR_PLUGIN_FLAGS }
  2692.  
  2693. type
  2694.   TFarPluginFlags = Int64;
  2695.  
  2696. const
  2697.   FPF_NONE         = 0;
  2698.   FPF_LOADED       = $0000000000000001;
  2699.   FPF_ANSI         = $1000000000000000;
  2700.  
  2701.  
  2702. {FAR_FILE_FILTER_CONTROL_COMMANDS}
  2703.  
  2704. const
  2705.   FFCTL_CREATEFILEFILTER = 0;
  2706.   FFCTL_FREEFILEFILTER   = 1;
  2707.   FFCTL_OPENFILTERSMENU  = 2;
  2708.   FFCTL_STARTINGTOFILTER = 3;
  2709.   FFCTL_ISFILEINFILTER   = 4;
  2710.  
  2711. {FAR_FILE_FILTER_TYPE}
  2712.  
  2713. const
  2714.   FFT_PANEL     = 0;
  2715.   FFT_FINDFILE  = 1;
  2716.   FFT_COPY      = 2;
  2717.   FFT_SELECT    = 3;
  2718.   FFT_CUSTOM    = 4;
  2719.  
  2720.  
  2721. {FAR_REGEXP_CONTROL_COMMANDS}
  2722.  
  2723. const
  2724.   RECTL_CREATE        = 0;
  2725.   RECTL_FREE          = 1;
  2726.   RECTL_COMPILE       = 2;
  2727.   RECTL_OPTIMIZE      = 3;
  2728.   RECTL_MATCHEX       = 4;
  2729.   RECTL_SEARCHEX      = 5;
  2730.   RECTL_BRACKETSCOUNT = 6;
  2731.  
  2732.  
  2733. (*
  2734. struct RegExpMatch
  2735. {
  2736.   intptr_t start,end;
  2737. };
  2738. *)
  2739. type
  2740.   PRegExpMatch = ^TRegExpMatch;
  2741.   TRegExpMatch = record
  2742.     Start :TIntPtr;
  2743.     EndPos :TIntPtr;
  2744.   end;
  2745.  
  2746. (*
  2747. struct RegExpSearch
  2748. {
  2749.   const wchar_t* Text;
  2750.   intptr_t Position;
  2751.   intptr_t Length;
  2752.   struct RegExpMatch* Match;
  2753.   intptr_t Count;
  2754.   void* Reserved;
  2755. };
  2756. *)
  2757. type
  2758.   PRegExpSearch = ^TRegExpSearch;
  2759.   TRegExpSearch = record
  2760.     Text :PFarChar;
  2761.     Position :TIntPtr;
  2762.     Length :TIntPtr;
  2763.     Match :PRegExpMatch;
  2764.     Count :TIntPtr;
  2765.     Reserved :Pointer;
  2766.   end;
  2767.  
  2768. {------------------------------------------------------------------------------}
  2769.  
  2770. { FAR_SETTINGS_CONTROL_COMMANDS }
  2771.  
  2772. const
  2773.   SCTL_CREATE       = 0;
  2774.   SCTL_FREE         = 1;
  2775.   SCTL_SET          = 2;
  2776.   SCTL_GET          = 3;
  2777.   SCTL_ENUM         = 4;
  2778.   SCTL_DELETE       = 5;
  2779.   SCTL_CREATESUBKEY = 6;
  2780.   SCTL_OPENSUBKEY   = 7;
  2781.  
  2782.  
  2783. { FARSETTINGSTYPES }
  2784.  
  2785. const
  2786.   FST_UNKNOWN  = 0;
  2787.   FST_SUBKEY   = 1;
  2788.   FST_QWORD    = 2;
  2789.   FST_STRING   = 3;
  2790.   FST_DATA     = 4;
  2791.  
  2792.  
  2793. { FARSETTINGS_SUBFOLDERS }
  2794.  
  2795. const
  2796.   FSSF_ROOT              =  0;
  2797.   FSSF_HISTORY_CMD       =  1;
  2798.   FSSF_HISTORY_FOLDER    =  2;
  2799.   FSSF_HISTORY_VIEW      =  3;
  2800.   FSSF_HISTORY_EDIT      =  4;
  2801.   FSSF_HISTORY_EXTERNAL  =  5;
  2802.   FSSF_FOLDERSHORTCUT_0  =  6;
  2803.   FSSF_FOLDERSHORTCUT_1  =  7;
  2804.   FSSF_FOLDERSHORTCUT_2  =  8;
  2805.   FSSF_FOLDERSHORTCUT_3  =  9;
  2806.   FSSF_FOLDERSHORTCUT_4  = 10;
  2807.   FSSF_FOLDERSHORTCUT_5  = 11;
  2808.   FSSF_FOLDERSHORTCUT_6  = 12;
  2809.   FSSF_FOLDERSHORTCUT_7  = 13;
  2810.   FSSF_FOLDERSHORTCUT_8  = 14;
  2811.   FSSF_FOLDERSHORTCUT_9  = 15;
  2812.   FSSF_CONFIRMATIONS     = 16;
  2813.   FSSF_SYSTEM            = 17;
  2814.   FSSF_PANEL             = 18;
  2815.   FSSF_EDITOR            = 19;
  2816.   FSSF_SCREEN            = 20;
  2817.   FSSF_DIALOG            = 21;
  2818.   FSSF_INTERFACE         = 22;
  2819.   FSSF_PANELLAYOUT       = 23;
  2820.  
  2821.  
  2822. { FAR_PLUGIN_SETTINGS_LOCATION }
  2823.  
  2824. const
  2825.   PSL_ROAMING = 0;
  2826.   PSL_LOCAL   = 1;
  2827.  
  2828.  
  2829. (*
  2830. struct FarSettingsCreate
  2831. {
  2832.   size_t StructSize;
  2833.   GUID Guid;
  2834.   HANDLE Handle;
  2835. };
  2836. *)
  2837. type
  2838.   PFarSettingsCreate = ^TFarSettingsCreate;
  2839.   TFarSettingsCreate = record
  2840.     StructSize :size_t;
  2841.     Guid :TGUID;
  2842.     Handle :THandle;
  2843.   end;
  2844.  
  2845. (*
  2846. struct FarSettingsItem
  2847. {
  2848.   size_t StructSize;
  2849.   size_t Root;
  2850.   const wchar_t* Name;
  2851.   enum FARSETTINGSTYPES Type;
  2852.   union
  2853.   {
  2854.     unsigned __int64 Number;
  2855.     const wchar_t* String;
  2856.     struct
  2857.     {
  2858.       size_t Size;
  2859.       const void* Data;
  2860.     } Data;
  2861.   } Value;
  2862. };
  2863. *)
  2864. type
  2865.   PFarSettingsData = ^TFarSettingsData;
  2866.   TFarSettingsData = record
  2867.     Size :size_t;
  2868.     Data :Pointer;
  2869.   end;
  2870.  
  2871.   PFarSettingsItem = ^TFarSettingsItem;
  2872.   TFarSettingsItem = record
  2873.     StructSize :size_t;
  2874.     Root :size_t;
  2875.     Name :PFarChar;
  2876.     FType :DWORD {FARSETTINGSTYPES};
  2877.     Value :record case byte of
  2878.       0 : (Number :Int64);
  2879.       1 : (Str :PFarChar);
  2880.       2 : (Data :TFarSettingsData);
  2881.     end;
  2882.   end;
  2883.  
  2884. (*
  2885. struct FarSettingsName
  2886. {
  2887.   const wchar_t* Name;
  2888.   enum FARSETTINGSTYPES Type;
  2889. };
  2890. *)
  2891. type
  2892.   PFarSettingsName = ^TFarSettingsName;
  2893.   TFarSettingsName = record
  2894.     Name :PFarChar;
  2895.     FType :DWORD {FARSETTINGSTYPES};
  2896.   end;
  2897.  
  2898. (*
  2899. struct FarSettingsHistory
  2900. {
  2901.   const wchar_t* Name;
  2902.   const wchar_t* Param;
  2903.   GUID PluginId;
  2904.   const wchar_t* File;
  2905.   FILETIME Time;
  2906.   BOOL Lock;
  2907. };
  2908. *)
  2909. type
  2910.   PFarSettingsHistory = ^TFarSettingsHistory;
  2911.   TFarSettingsHistory = record
  2912.     Name :PFarChar;
  2913.     Param :PFarChar;
  2914.     PluginId :TGUID;
  2915.     fFile :PFarChar;
  2916.     Time :FILETIME;
  2917.     Lock :BOOL;
  2918.   end;
  2919.  
  2920.   PFarSettingsHistoryArray = ^TFarSettingsHistoryArray;
  2921.   TFarSettingsHistoryArray = packed array[0..MaxInt div SizeOf(TFarSettingsHistory) - 1] of TFarSettingsHistory;
  2922.  
  2923.  
  2924. (*
  2925. struct FarSettingsEnum
  2926. {
  2927.   size_t StructSize;
  2928.   size_t Root;
  2929.   size_t Count;
  2930.   union
  2931.   {
  2932.     const struct FarSettingsName* Items;
  2933.     const struct FarSettingsHistory* Histories;
  2934.   }
  2935.   Value;
  2936. };
  2937. *)
  2938. type
  2939.   PFarSettingsEnum = ^TFarSettingsEnum;
  2940.   TFarSettingsEnum = record
  2941.     StructSize :size_t;
  2942.     Root :size_t;
  2943.     Count :size_t;
  2944.     Value : record case byte of
  2945.       0 : (Items :PFarSettingsName);
  2946.       1 : (Histories :PFarSettingsHistoryArray);
  2947.     end;
  2948.   end;
  2949.  
  2950. (*
  2951. struct FarSettingsValue
  2952. {
  2953.   size_t StructSize;
  2954.   size_t Root;
  2955.   const wchar_t* Value;
  2956. };
  2957. *)
  2958. type
  2959.   PFarSettingsValue = ^TFarSettingsValue;
  2960.   TFarSettingsValue = record
  2961.     StructSize :size_t;
  2962.     Root :size_t;
  2963.     Value :PFarChar;
  2964.   end;
  2965.  
  2966. {------------------------------------------------------------------------------}
  2967.  
  2968. type
  2969. (*
  2970. typedef intptr_t (WINAPI *FARAPIPANELCONTROL)(
  2971.     HANDLE hPanel,
  2972.     enum FILE_CONTROL_COMMANDS Command,
  2973.     intptr_t Param1,
  2974.     void* Param2
  2975. );
  2976. *)
  2977.   TFarApiPanelControl = function (
  2978.     hPlugin :THandle;
  2979.     Command :DWORD; {FILE_CONTROL_COMMANDS}
  2980.     Param1 :TIntPtr;
  2981.     Param2 :Pointer
  2982.   ) :TIntPtr; stdcall;
  2983.  
  2984.  
  2985. (*
  2986. typedef intptr_t(WINAPI *FARAPIADVCONTROL)(
  2987.     const GUID* PluginId,
  2988.     enum ADVANCED_CONTROL_COMMANDS Command,
  2989.     intptr_t Param1,
  2990.     void* Param2
  2991. );
  2992. *)
  2993.   TFarApiAdvControl = function (
  2994.     const PluginID :TGUID;
  2995.     Command :TADVANCED_CONTROL_COMMANDS;
  2996.     Param1 :TIntPtr;
  2997.     Param2 :Pointer
  2998.   ) :TIntPtr; stdcall;
  2999.  
  3000.  
  3001. (*
  3002. typedef intptr_t (WINAPI *FARAPIVIEWERCONTROL)(
  3003.     intptr_t ViewerID,
  3004.     enum VIEWER_CONTROL_COMMANDS Command,
  3005.     intptr_t Param1,
  3006.     void* Param2
  3007. );
  3008. *)
  3009. type
  3010.   TFarApiViewerControl = function (
  3011.     ViewerID :TIntPtr;
  3012.     Command :DWORD; {VIEWER_CONTROL_COMMANDS}
  3013.     Param1 :TIntPtr;
  3014.     Param2 :Pointer
  3015.   ) :TIntPtr; stdcall;
  3016.  
  3017. (*
  3018. typedef intptr_t (WINAPI *FARAPIEDITORCONTROL)(
  3019.     intptr_t EditorID,
  3020.     enum EDITOR_CONTROL_COMMANDS Command,
  3021.     intptr_t Param1,
  3022.     void* Param2
  3023. );
  3024. *)
  3025. type
  3026.   TFarApiEditorControl = function (
  3027.     EditorID :TIntPtr;
  3028.     Command :DWORD; {EDITOR_CONTROL_COMMANDS}
  3029.     Param1 :TIntPtr;
  3030.     Param2 :Pointer
  3031.   ) :TIntPtr; stdcall;
  3032.  
  3033. (*
  3034. typedef intptr_t (WINAPI *FARAPIMACROCONTROL)(
  3035.     const GUID* PluginId,
  3036.     enum FAR_MACRO_CONTROL_COMMANDS Command,
  3037.     intptr_t Param1,
  3038.     void* Param2
  3039. );
  3040. *)
  3041.   TFarApiMacroControl = function(
  3042.     const PluginId :TGUID;
  3043.     Command :TFAR_MACRO_CONTROL_COMMANDS;
  3044.     Param1 :TIntPtr;
  3045.     Param2 :Pointer
  3046.   ) :TIntPtr; stdcall;
  3047.  
  3048.  
  3049. (*
  3050. typedef intptr_t (WINAPI *FARAPIPLUGINSCONTROL)(
  3051.     HANDLE hHandle,
  3052.     enum FAR_PLUGINS_CONTROL_COMMANDS Command,
  3053.     intptr_t Param1,
  3054.     void* Param2
  3055. );
  3056. *)
  3057.   TFarApiPluginsControl = function(
  3058.     hHandle :THandle;
  3059.     Command :DWORD; {FAR_PLUGINS_CONTROL_COMMANDS}
  3060.     Param1 :TIntPtr;
  3061.     Param2 :Pointer
  3062.   ) :TIntPtr; stdcall;
  3063.  
  3064. (*
  3065. typedef intptr_t (WINAPI *FARAPIFILEFILTERCONTROL)(
  3066.     HANDLE hHandle,
  3067.     enum FAR_FILE_FILTER_CONTROL_COMMANDS Command,
  3068.     intptr_t Param1,
  3069.     void* Param2
  3070. );
  3071. *)
  3072.   TFarApiFilterControl = function(
  3073.     hHandle :THandle;
  3074.     Command :DWORD; {FAR_FILE_FILTER_CONTROL_COMMANDS}
  3075.     Param1 :TIntPtr;
  3076.     Param2 :Pointer //LONG_PTR
  3077.   ) :TIntPtr; stdcall;
  3078.  
  3079. (*
  3080. typedef intptr_t (WINAPI *FARAPIREGEXPCONTROL)(
  3081.     HANDLE hHandle,
  3082.     enum FAR_REGEXP_CONTROL_COMMANDS Command,
  3083.     intptr_t Param1,
  3084.     void* Param2
  3085. );
  3086. *)
  3087.   TFarApiRegexpControl = function(
  3088.     hHandle :THandle;
  3089.     Command :DWORD; {FAR_REGEXP_CONTROL_COMMANDS}
  3090.     Param1 :TIntPtr;
  3091.     Param2 :Pointer
  3092.   ) :TIntPtr; stdcall;
  3093.  
  3094. (*
  3095. typedef intptr_t (WINAPI *FARAPISETTINGSCONTROL)(
  3096.     HANDLE hHandle,
  3097.     enum FAR_SETTINGS_CONTROL_COMMANDS Command,
  3098.     intptr_t Param1,
  3099.     void* Param2
  3100. );
  3101. *)
  3102.   TFarApiSettingsControl = function(
  3103.     hHandle :THandle;
  3104.     Command :DWORD; {FAR_SETTINGS_CONTROL_COMMANDS}
  3105.     Param1 :TIntPtr;
  3106.     Param2 :Pointer
  3107.   ) :TIntPtr; stdcall;
  3108.  
  3109.  
  3110. {FARCLIPBOARD_TYPE}
  3111.  
  3112. const
  3113.   FCT_ANY    = 0;
  3114.   FCT_STREAM = 1;
  3115.   FCT_COLUMN = 2;
  3116.  
  3117. (*
  3118. // <C&C++>
  3119. typedef int (WINAPIV *FARSTDSPRINTF)(wchar_t *Buffer,const wchar_t *Format,...);
  3120. typedef int (WINAPIV *FARSTDSNPRINTF)(wchar_t *Buffer,size_t Sizebuf,const wchar_t *Format,...);
  3121. typedef int (WINAPIV *FARSTDSSCANF)(const wchar_t *Buffer, const wchar_t *Format,...);
  3122. // </C&C++>
  3123. *)
  3124.  
  3125. type
  3126. //typedef void (WINAPI *FARSTDQSORT)(void *base, size_t nelem, size_t width, int (WINAPI *fcmp)(const void *, const void *,void *userparam),void *userparam);
  3127.   TFarStdQSortFunc = function (Param1 :Pointer; Param2 :Pointer; UserParam :Pointer) :Integer; stdcall;
  3128.   TFarStdQSort = procedure(Base :Pointer; NElem :size_t; Width :size_t; FCmp :TFarStdQSortFunc; UserParam :Pointer); stdcall;
  3129.  
  3130. //typedef void *(WINAPI *FARSTDBSEARCH)(const void *key, const void *base, size_t nelem, size_t width, int (WINAPI *fcmp)(const void *, const void *,void *userparam),void *userparam);
  3131.   TFarStdBSearch = procedure (Key :Pointer; Base :Pointer; NElem :size_t; Width :size_t; FCmp :TFarStdQSortFunc; UserParam :Pointer); stdcall;
  3132.  
  3133. //typedef size_t (WINAPI *FARSTDGETFILEOWNER)(const wchar_t *Computer,const wchar_t *Name,wchar_t *Owner,size_t Size);
  3134.   TFarStdGetFileOwner = function(Computer :PFarChar; Name :PFarChar; Owner :PFarChar; Size :size_t) :size_t; stdcall;
  3135.  
  3136. //typedef size_t (WINAPI *FARSTDGETNUMBEROFLINKS)(const wchar_t *Name);
  3137.   TFarStdGetNumberOfLinks = function(Name :PFarChar) :size_t; stdcall;
  3138.  
  3139. //typedef int (WINAPI *FARSTDATOI)(const wchar_t *s);
  3140.   TFarStdAtoi = function(S :PFarChar) :Integer; stdcall;
  3141.  
  3142. //typedef __int64(WINAPI *FARSTDATOI64)(const wchar_t *s);
  3143.   TFarStdAtoi64 =function(S :PFarChar) :Int64; stdcall;
  3144.  
  3145. //typedef wchar_t *(WINAPI *FARSTDITOA64)(__int64 value, wchar_t *string, int radix);
  3146.   TFarStdItoa64 = function(Value :Int64; Str :PFarChar; Radix :Integer) :PFarChar; stdcall;
  3147.  
  3148. //typedef wchar_t *(WINAPI *FARSTDITOA)(int value, wchar_t *string, int radix);
  3149.   TFarStdItoa = function(Value :TIntPtr; Str :PFarChar; Radix :Integer) :PFarChar; stdcall;
  3150.  
  3151. //typedef wchar_t *(WINAPI *FARSTDLTRIM)(wchar_t *Str);
  3152.   TFarStdLTrim = function(Str :PFarChar) :PFarChar; stdcall;
  3153.  
  3154. //typedef wchar_t *(WINAPI *FARSTDRTRIM)(wchar_t *Str);
  3155.   TFarStdRTrim = function(Str :PFarChar) :PFarChar; stdcall;
  3156. (*
  3157.             typedef wchar_t   *(WINAPI *FARSTDTRIM)(wchar_t *Str);
  3158.             typedef wchar_t   *(WINAPI *FARSTDTRUNCSTR)(wchar_t *Str,intptr_t MaxLength);
  3159.             typedef wchar_t   *(WINAPI *FARSTDTRUNCPATHSTR)(wchar_t *Str,intptr_t MaxLength);
  3160.             typedef wchar_t   *(WINAPI *FARSTDQUOTESPACEONLY)(wchar_t *Str);
  3161.             typedef const wchar_t*(WINAPI *FARSTDPOINTTONAME)(const wchar_t *Path);
  3162.             typedef BOOL (WINAPI *FARSTDADDENDSLASH)(wchar_t *Path);
  3163.             typedef BOOL (WINAPI *FARSTDCOPYTOCLIPBOARD)(enum FARCLIPBOARD_TYPE Type, const wchar_t *Data);
  3164.             typedef size_t (WINAPI *FARSTDPASTEFROMCLIPBOARD)(enum FARCLIPBOARD_TYPE Type, wchar_t *Data, size_t Size);
  3165.  
  3166.             typedef int (WINAPI *FARSTDLOCALISLOWER)(wchar_t Ch);
  3167.             typedef int (WINAPI *FARSTDLOCALISUPPER)(wchar_t Ch);
  3168.             typedef int (WINAPI *FARSTDLOCALISALPHA)(wchar_t Ch);
  3169.             typedef int (WINAPI *FARSTDLOCALISALPHANUM)(wchar_t Ch);
  3170.             typedef wchar_t (WINAPI *FARSTDLOCALUPPER)(wchar_t LowerChar);
  3171.             typedef wchar_t (WINAPI *FARSTDLOCALLOWER)(wchar_t UpperChar);
  3172.  
  3173.             typedef void (WINAPI *FARSTDLOCALUPPERBUF)(wchar_t *Buf,intptr_t Length);
  3174.             typedef void (WINAPI *FARSTDLOCALLOWERBUF)(wchar_t *Buf,intptr_t Length);
  3175.             typedef void (WINAPI *FARSTDLOCALSTRUPR)(wchar_t *s1);
  3176.             typedef void (WINAPI *FARSTDLOCALSTRLWR)(wchar_t *s1);
  3177.             typedef int (WINAPI *FARSTDLOCALSTRICMP)(const wchar_t *s1,const wchar_t *s2);
  3178.             typedef int (WINAPI *FARSTDLOCALSTRNICMP)(const wchar_t *s1,const wchar_t *s2,intptr_t n);
  3179. *)
  3180.  
  3181.             TFarStdTrim = function (Str : PFarChar) : PFarChar; stdcall;
  3182.             TFarStdTruncStr = function (Str : PFarChar; MaxLength : TIntPtr) : PFarChar; stdcall;
  3183.             TFarStdTruncPathStr = function (Str : PFarChar; MaxLength : TIntPtr) : PFarChar; stdcall;
  3184.             TFarStdQuoteSpaceOnly = function (Str : PFarChar) : PFarChar; stdcall;
  3185.             TFarStdPointToName = function (Path : PFarChar) : PFarChar; stdcall;
  3186.             TFarStdAddEndSlash = function (Path : PFarChar) : LongBool; stdcall;
  3187.             TFarStdCopyToClipBoard = function (AType :Integer{FARCLIPBOARD_TYPE}; AData :PFarChar) :Boolean; stdcall;
  3188.             TFarStdPasteFromClipboard = function(AType :Integer{FARCLIPBOARD_TYPE}; AData :PFarChar; ASize :size_t) :size_t; stdcall;
  3189.  
  3190.             TFarStdLocalIsLower = function (Ch : TFarChar) :Integer; stdcall;
  3191.             TFarStdLocalIsUpper = function (Ch : TFarChar) :Integer; stdcall;
  3192.             TFarStdLocalIsAlpha = function (Ch : TFarChar) :Integer; stdcall;
  3193.             TFarStdLocalIsAlphaNum = function (Ch : TFarChar) :Integer; stdcall;
  3194.             TFarStdLocalUpper = function (LowerChar : TFarChar) :TFarChar; stdcall;
  3195.             TFarStdLocalLower = function (UpperChar : TFarChar) :TFarChar; stdcall;
  3196.             TFarStdLocalUpperBuf = procedure (Buf : PFarChar; Length :TIntPtr); stdcall;
  3197.             TFarStdLocalLowerBuf = procedure (Buf : PFarChar; Length :TIntPtr); stdcall;
  3198.             
  3199.             TFarStdLocalStrUpr = procedure (S1 :PFarChar); stdcall;
  3200.             TFarStdLocalStrLwr = procedure (S1 :PFarChar); stdcall;
  3201.             TFarStdLocalStrICmp = function (S1 :PFarChar; S2 :PFarChar) :Integer; stdcall;
  3202.             TFarStdLocalStrNICmp = function (S1 :PFarChar; S2 :PFarChar; N :TIntPtr) :Integer; stdcall;
  3203.  
  3204. {!!!}
  3205.  
  3206.  
  3207. { PROCESSNAME_FLAGS }
  3208.  
  3209. type
  3210.   TProcessNameFlags = Int64;
  3211.  
  3212. const
  3213.   //                       0xFFFF - length
  3214.   //                     0xFF0000 - mode
  3215.   //           0xFFFFFFFFFF000000 - flags
  3216.   PN_CMPNAME          = $00000000;
  3217.   PN_CMPNAMELIST      = $00010000;
  3218.   PN_GENERATENAME     = $00020000;
  3219.   PN_CHECKMASK        = $00030000;
  3220.   PN_SKIPPATH         = $01000000;
  3221.   PN_SHOWERRORMESSAGE = $02000000;
  3222.  
  3223. type
  3224. //typedef size_t (WINAPI *FARSTDPROCESSNAME)(const wchar_t *param1, wchar_t *param2, size_t size, PROCESSNAME_FLAGS flags);
  3225.   TFarStdProcessName = function(Param1, Param2 :PFarChar; Size :size_t; Flags :TProcessNameFlags) :size_t; stdcall;
  3226.  
  3227. //typedef void (WINAPI *FARSTDUNQUOTE)(wchar_t *Str);
  3228.   TFarStdUnquote = procedure(Str :PFarChar); stdcall;
  3229.  
  3230.  
  3231. { XLAT_FLAGS }
  3232.  
  3233. type
  3234.   TXLAT_Flags = Int64;
  3235.  
  3236. const
  3237.   XLAT_NONE              = 0;
  3238.   XLAT_SWITCHKEYBLAYOUT  = $00000001;
  3239.   XLAT_SWITCHKEYBBEEP    = $00000002;
  3240.   XLAT_USEKEYBLAYOUTNAME = $00000004;
  3241.   XLAT_CONVERTALLCMDLINE = $00010000;
  3242.  
  3243.  
  3244. type
  3245. //typedef size_t (WINAPI *FARSTDINPUTRECORDTOKEYNAME)(const INPUT_RECORD* Key, wchar_t *KeyText, size_t Size);
  3246.   TFarStdInputRecordToKeyName = function(const Key :TInputRecord; KeyText :PFarChar; Size :size_t) :size_t; stdcall;
  3247.  
  3248. //typedef BOOL (WINAPI *FARSTDKEYNAMETOINPUTRECORD)(const wchar_t *Name,INPUT_RECORD* Key);
  3249.   TFarStdKeyNameToInputRecord = function(Name :PFarChar; var Key :TInputRecord) :Boolean; stdcall;
  3250.  
  3251. //typedef wchar_t*(WINAPI *FARSTDXLAT)(wchar_t *Line,intptr_t StartPos,intptr_t EndPos,XLAT_FLAGS Flags);
  3252.   TFarStdXLat = function(Line :PFarChar; StartPos, EndPos :TIntPtr; Flags :TXLAT_Flags) :PFarChar; stdcall;
  3253.  
  3254.  
  3255. { FRSMODE }
  3256.  
  3257. type
  3258.   TFRSMODE = Int64;
  3259.  
  3260. const
  3261.   FRS_RETUPDIR    = $01;
  3262.   FRS_RECUR       = $02;
  3263.   FRS_SCANSYMLINK = $04;
  3264.  
  3265. type
  3266. (*
  3267. typedef int (WINAPI *FRSUSERFUNC)(
  3268.   const struct PluginPanelItem *FData,
  3269.   const wchar_t *FullName,
  3270.   void *Param
  3271. );
  3272. *)
  3273.   TFRSUserFunc = function(const FData :TPluginPanelItem; FullName :PFarChar; Param :Pointer) :Integer; stdcall;
  3274.  
  3275. //typedef void (WINAPI *FARSTDRECURSIVESEARCH)(const wchar_t *InitDir,const wchar_t *Mask,FRSUSERFUNC Func,FRSMODE Flags,void *Param);
  3276.   TFarStdRecursiveSearch = procedure(InitDir, Mask :PFarChar; Func :TFRSUserFunc; Flags :TFRSMODE; Param :Pointer); stdcall;
  3277.  
  3278. //typedef size_t (WINAPI *FARSTDMKTEMP)(wchar_t *Dest, size_t DestSize, const wchar_t *Prefix);
  3279.   TFarStdMkTemp = function(Dest :PFarChar; DestSize :size_t; Prefix :PFarChar) :size_t; stdcall;
  3280.  
  3281. //typedef size_t (WINAPI *FARSTDGETPATHROOT)(const wchar_t *Path,wchar_t *Root, size_t DestSize);
  3282.   TFarStdGetPathRoot = function(Path :TFarChar; Root :PFarChar; DestSize :size_t) :size_t; stdcall;
  3283.  
  3284. { LINK_TYPE }
  3285.  
  3286. const
  3287.   LINK_HARDLINK         = 1;
  3288.   LINK_JUNCTION         = 2;
  3289.   LINK_VOLMOUNT         = 3;
  3290.   LINK_SYMLINKFILE      = 4;
  3291.   LINK_SYMLINKDIR       = 5;
  3292.   LINK_SYMLINK          = 6;
  3293.  
  3294. { MKLINK_FLAGS }
  3295.  
  3296. type
  3297.   MKLINK_FLAGS = Int64;
  3298.  
  3299. const
  3300.   MLF_NONE             = 0;
  3301.   MLF_SHOWERRMSG       = $0000000000010000;
  3302.   MLF_DONOTUPDATEPANEL = $0000000000020000;
  3303.  
  3304. type
  3305. //typedef BOOL (WINAPI *FARSTDMKLINK)(const wchar_t *Src,const wchar_t *Dest,enum LINK_TYPE Type, MKLINK_FLAGS Flags);
  3306.   TFarStdMkLink = function(Src, Dest :PFarChar; AType :DWORD{LINK_TYPE}; Flags :MKLINK_FLAGS) :Boolean; stdcall;
  3307.  
  3308. //typedef size_t (WINAPI *FARGETREPARSEPOINTINFO)(const wchar_t *Src, wchar_t *Dest, size_t DestSize);
  3309.   TFarGetReparsePointInfo = function (Src, Dest :PFarChar; DestSize :size_t) :size_t; stdcall;
  3310.  
  3311.  
  3312. { CONVERTPATHMODES }
  3313.  
  3314. const
  3315.   CPM_FULL   = 0;
  3316.   CPM_REAL   = 1;
  3317.   CPM_NATIVE = 2;
  3318.  
  3319. type
  3320. //typedef size_t (WINAPI *FARCONVERTPATH)(enum CONVERTPATHMODES Mode, const wchar_t *Src, wchar_t *Dest, size_t DestSize);
  3321.   TFarConvertPath = function(Mode :DWORD{CONVERTPATHMODES}; Src :PFarChar; Dest :PFarChar; DestSize :size_t) :size_t; stdcall;
  3322.  
  3323. //typedef size_t (WINAPI *FARGETCURRENTDIRECTORY)(size_t Size, wchar_t* Buffer);
  3324.   TFarGetCurrentDirectory = function(Size :size_t; Buffer :PFarChar) :size_t; stdcall;
  3325.  
  3326.  
  3327. { FARFORMATFILESIZEFLAGS }
  3328.  
  3329. type
  3330.   TFarFormatFileSizeFlags = int64;
  3331.  
  3332. const
  3333.   FFFS_COMMAS             = $0100000000000000;
  3334.   FFFS_FLOATSIZE          = $0200000000000000;
  3335.   FFFS_SHOWBYTESINDEX     = $0400000000000000;
  3336.   FFFS_ECONOMIC           = $0800000000000000;
  3337.   FFFS_THOUSAND           = $1000000000000000;
  3338.   FFFS_MINSIZEINDEX       = $2000000000000000;
  3339.   FFFS_MINSIZEINDEX_MASK  = $0000000000000003;
  3340.  
  3341. type
  3342. //typedef size_t (WINAPI *FARFORMATFILESIZE)(unsigned __int64 Size, intptr_t Width, FARFORMATFILESIZEFLAGS Flags, wchar_t *Dest, size_t DestSize);
  3343.   TFarFormatFileSize = function(Size :Int64; Width :TIntPtr; Flags :TFarFormatFileSizeFlags; Dest :PFarChar; DestSize :size_t) :size_t;
  3344.  
  3345.  
  3346. { FarStandardFunctions }
  3347.  
  3348. type
  3349.   PFarStandardFunctions = ^TFarStandardFunctions;
  3350.   TFarStandardFunctions = record
  3351.     StructSize            :size_t;
  3352.  
  3353.     atoi                  :TFarStdAtoi;
  3354.     atoi64                :TFarStdAtoi64;
  3355.     itoa                  :TFarStdItoa;
  3356.     itoa64                :TFarStdItoa64;
  3357.  
  3358.     sprintf               :Pointer;
  3359.     sscanf                :Pointer;
  3360.  
  3361.     qsort                 :TFarStdQSort;
  3362.     bsearch               :TFarStdBSearch;
  3363.  
  3364.     snprintf              :Pointer {TFarStdSNPRINTF};
  3365.  
  3366.     LIsLower              :TFarStdLocalIsLower;
  3367.     LIsUpper              :TFarStdLocalIsUpper;
  3368.     LIsAlpha              :TFarStdLocalIsAlpha;
  3369.     LIsAlphaNum           :TFarStdLocalIsAlphaNum;
  3370.     LUpper                :TFarStdLocalUpper;
  3371.     LLower                :TFarStdLocalLower;
  3372.     LUpperBuf             :TFarStdLocalUpperBuf;
  3373.     LLowerBuf             :TFarStdLocalLowerBuf;
  3374.     LStrupr               :TFarStdLocalStrUpr;
  3375.     LStrlwr               :TFarStdLocalStrLwr;
  3376.     LStricmp              :TFarStdLocalStrICmp;
  3377.     LStrnicmp             :TFarStdLocalStrNICmp;
  3378.  
  3379.     Unquote               :TFarStdUnquote;
  3380.     LTrim                 :TFarStdLTrim;
  3381.     RTrim                 :TFarStdRTrim;
  3382.     Trim                  :TFarStdTrim;
  3383.     TruncStr              :TFarStdTruncStr;
  3384.     TruncPathStr          :TFarStdTruncPathStr;
  3385.     QuoteSpaceOnly        :TFarStdQuoteSpaceOnly;
  3386.     PointToName           :TFarStdPointToName;
  3387.     GetPathRoot           :TFarStdGetPathRoot;
  3388.     AddEndSlash           :TFarStdAddEndSlash;
  3389.     CopyToClipboard       :TFarStdCopyToClipboard;
  3390.     PasteFromClipboard    :TFarStdPasteFromClipboard;
  3391.     FarInputRecordToName  :TFarStdInputRecordToKeyName;
  3392.     FarNameToInputRecord  :TFarStdKeyNameToInputRecord;
  3393.     XLat                  :TFarStdXLat;
  3394.     GetFileOwner          :TFarStdGetFileOwner;
  3395.     GetNumberOfLinks      :TFarStdGetNumberOfLinks;
  3396.     FarRecursiveSearch    :TFarStdRecursiveSearch;
  3397.     MkTemp                :TFarStdMkTemp;
  3398.     ProcessName           :TFarStdProcessName;
  3399.     MkLink                :TFarStdMkLink;
  3400.     ConvertPath           :TFarConvertPath;
  3401.     GetReparsePointInfo   :TFarGetReparsePointInfo;
  3402.     GetCurrentDirectory   :TFarGetCurrentDirectory;
  3403.     FormatFileSize        :TFarFormatFileSize;
  3404.   end; {TFarStandardFunctions}
  3405.  
  3406.  
  3407. { PluginStartupInfo }
  3408.  
  3409. type
  3410.   PPluginStartupInfo = ^TPluginStartupInfo;
  3411.   TPluginStartupInfo = record
  3412.     StructSize          : size_t;
  3413.     ModuleName          : PFarChar;
  3414.  
  3415.     Menu                : TFarApiMenu;
  3416.     Message             : TFarApiMessage;
  3417.     GetMsg              : TFarApiGetMsg;
  3418.     Control             : TFarApiPanelControl;
  3419.     SaveScreen          : TFarApiSaveScreen;
  3420.     RestoreScreen       : TFarApiRestoreScreen;
  3421.     GetDirList          : TFarApiGetDirList;
  3422.     GetPluginDirList    : TFarApiGetPluginDirList;
  3423.     FreeDirList         : TFarApiFreeDirList;
  3424.     FreePluginDirList   : TFarApiFreePluginDirList;
  3425.     Viewer              : TFarApiViewer;
  3426.     Editor              : TFarApiEditor;
  3427.     Text                : TFarApiText;
  3428.     EditorControl       : TFarApiEditorControl;
  3429.  
  3430.     FSF                 : PFarStandardFunctions;
  3431.  
  3432.     ShowHelp            : TFarApiShowHelp;
  3433.     AdvControl          : TFarApiAdvControl;
  3434.     InputBox            : TFarApiInputBox;
  3435.     ColorDialog         : TFarApiColorDialog;
  3436.     DialogInit          : TFarApiDialogInit;
  3437.     DialogRun           : TFarApiDialogRun;
  3438.     DialogFree          : TFarApiDialogFree;
  3439.  
  3440.     SendDlgMessage      : TFarApiSendDlgMessage;
  3441.     DefDlgProc          : TFarApiDefDlgProc;
  3442.     ViewerControl       : TFarApiViewerControl;
  3443.     PluginsControl      : TFarApiPluginsControl;
  3444.     FileFilterControl   : TFarApiFilterControl;
  3445.     RegExpControl       : TFarApiRegexpControl;
  3446.     MacroControl        : TFarApiMacroControl;
  3447.     SettingsControl     : TFarApiSettingsControl;
  3448.  
  3449.     _Private            : Pointer;
  3450.   end; {TPluginStartupInfo}
  3451.  
  3452.  
  3453. (*
  3454. typedef HANDLE (WINAPI *FARAPICREATEFILE)(const wchar_t *Object,DWORD DesiredAccess,DWORD ShareMode,LPSECURITY_ATTRIBUTES SecurityAttributes,DWORD CreationDistribution,DWORD FlagsAndAttributes,HANDLE TemplateFile);
  3455. typedef DWORD (WINAPI *FARAPIGETFILEATTRIBUTES)(const wchar_t *FileName);
  3456. typedef BOOL (WINAPI *FARAPISETFILEATTRIBUTES)(const wchar_t *FileName,DWORD dwFileAttributes);
  3457. typedef BOOL (WINAPI *FARAPIMOVEFILEEX)(const wchar_t *ExistingFileName,const wchar_t *NewFileName,DWORD dwFlags);
  3458. typedef BOOL (WINAPI *FARAPIDELETEFILE)(const wchar_t *FileName);
  3459. typedef BOOL (WINAPI *FARAPIREMOVEDIRECTORY)(const wchar_t *DirName);
  3460. typedef BOOL (WINAPI *FARAPICREATEDIRECTORY)(const wchar_t *PathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  3461.  
  3462. struct ArclitePrivateInfo
  3463. {
  3464.     size_t StructSize;
  3465.     FARAPICREATEFILE CreateFile;
  3466.     FARAPIGETFILEATTRIBUTES GetFileAttributes;
  3467.     FARAPISETFILEATTRIBUTES SetFileAttributes;
  3468.     FARAPIMOVEFILEEX MoveFileEx;
  3469.     FARAPIDELETEFILE DeleteFile;
  3470.     FARAPIREMOVEDIRECTORY RemoveDirectory;
  3471.     FARAPICREATEDIRECTORY CreateDirectory;
  3472. };
  3473. *)
  3474. {!!!}
  3475.  
  3476. (*
  3477. typedef intptr_t (WINAPI *FARAPICALLFAR)(intptr_t CheckCode, struct FarMacroCall* Data);
  3478.  
  3479. struct MacroPrivateInfo
  3480. {
  3481.     size_t StructSize;
  3482.     FARAPICALLFAR CallFar;
  3483. };
  3484. *)
  3485. {!!!}
  3486.  
  3487.  
  3488. { PLUGIN_FLAGS }
  3489.  
  3490. type
  3491.   TPluginFlags = Int64;
  3492.  
  3493. const
  3494.   PF_NONE          = 0;
  3495.   PF_PRELOAD       = $0001;
  3496.   PF_DISABLEPANELS = $0002;
  3497.   PF_EDITOR        = $0004;
  3498.   PF_VIEWER        = $0008;
  3499.   PF_FULLCMDLINE   = $0010;
  3500.   PF_DIALOG        = $0020;
  3501.  
  3502. (*
  3503. struct PluginMenuItem
  3504. {
  3505.   const GUID *Guids;
  3506.   const wchar_t * const *Strings;
  3507.   size_t Count;
  3508. };
  3509. *)
  3510. type
  3511.   PPluginMenuItem = ^TPluginMenuItem;
  3512.   TPluginMenuItem = record
  3513.     Guids :PGuidsArray;
  3514.     Strings :PPCharArray; {PFarChar;}
  3515.     Count :INT_PTR {size_t};
  3516.   end;
  3517.  
  3518.  
  3519. { VERSION_STAGE }
  3520.  
  3521. const
  3522.   VS_RELEASE = 0;
  3523.   VS_ALPHA   = 1;
  3524.   VS_BETA    = 2;
  3525.   VS_RC      = 3;
  3526.  
  3527. (*
  3528. struct VersionInfo
  3529. {
  3530.   DWORD Major;
  3531.   DWORD Minor;
  3532.   DWORD Revision;
  3533.   DWORD Build;
  3534.   enum VERSION_STAGE Stage;
  3535. };
  3536. *)
  3537. type
  3538.   PVersionInfo = ^TVersionInfo;
  3539.   TVersionInfo = record
  3540.     Major :DWORD;
  3541.     Minor :DWORD;
  3542.     Revision :DWORD;
  3543.     Build :DWORD;
  3544.     Stage :DWORD{VERSION_STAGE};
  3545.   end;
  3546.  
  3547. (*
  3548. struct GlobalInfo
  3549. {
  3550.   size_t StructSize;
  3551.   struct VersionInfo MinFarVersion;
  3552.   struct VersionInfo Version;
  3553.   GUID Guid;
  3554.   const wchar_t *Title;
  3555.   const wchar_t *Description;
  3556.   const wchar_t *Author;
  3557. };
  3558. *)
  3559. type
  3560.   PGlobalInfo = ^TGlobalInfo;
  3561.   TGlobalInfo = record
  3562.     StructSize :size_t;
  3563.     MinFarVersion :TVersionInfo;
  3564.     Version :TVersionInfo;
  3565.     Guid :TGUID;
  3566.     Title :PFarChar;
  3567.     Description :PFarChar;
  3568.     Author :PFarChar;
  3569.   end;
  3570.  
  3571. (*
  3572. struct PluginInfo
  3573. {
  3574.   size_t StructSize;
  3575.   PLUGIN_FLAGS Flags;
  3576.   struct PluginMenuItem DiskMenu;
  3577.   struct PluginMenuItem PluginMenu;
  3578.   struct PluginMenuItem PluginConfig;
  3579.   const wchar_t *CommandPrefix;
  3580. };
  3581. *)
  3582. type
  3583.   PPluginInfo = ^TPluginInfo;
  3584.   TPluginInfo = record
  3585.     StructSize :size_t;
  3586.     Flags :TPluginFlags;
  3587.     DiskMenu :TPluginMenuItem;
  3588.     PluginMenu :TPluginMenuItem;
  3589.     PluginConfig :TPluginMenuItem;
  3590.     CommandPrefix :PFarChar;
  3591.   end;
  3592.  
  3593.  
  3594. (*
  3595. struct FarGetPluginInformation
  3596. {
  3597.   size_t StructSize;
  3598.   const wchar_t *ModuleName;
  3599.   FAR_PLUGIN_FLAGS Flags;
  3600.   struct PluginInfo *PInfo;
  3601.   struct GlobalInfo *GInfo;
  3602. };
  3603. *)
  3604. type
  3605.   PFarGetPluginInformation = ^TFarGetPluginInformation;
  3606.   TFarGetPluginInformation = record
  3607.     StructSize :size_t;
  3608.     ModuleName :PFarChar;
  3609.     Flags :TFarPluginFlags;
  3610.     PInfo :PPluginInfo;
  3611.     GInfo :PGlobalInfo;
  3612.   end;
  3613.  
  3614.  
  3615. {INFOPANELLINE_FLAGS}
  3616.  
  3617. type
  3618.   TInfoPanelLineFlags = Int64;
  3619.  
  3620. const
  3621.   IPLFLAGS_SEPARATOR  = $000000000000000;
  3622.  
  3623. (*
  3624. struct InfoPanelLine
  3625. {
  3626.   const wchar_t *Text;
  3627.   const wchar_t *Data;
  3628.   INFOPANELLINE_FLAGS Flags;
  3629. };
  3630. *)
  3631. type
  3632.   PInfoPanelLine = ^TInfoPanelLine;
  3633.   TInfoPanelLine = record
  3634.     Text :PFarChar;
  3635.     Data :PFarChar;
  3636.     Flags :TInfoPanelLineFlags;
  3637.   end;
  3638.  
  3639.   PInfoPanelLineArray = ^TInfoPanelLineArray;
  3640.   TInfoPanelLineArray = packed array [0..MaxInt div SizeOf(TInfoPanelLine) - 1] of TInfoPanelLine;
  3641.  
  3642.  
  3643. { PANELMODE_FLAGS }
  3644.  
  3645. type
  3646.   TPanelModeFlags = Int64;
  3647.  
  3648. const
  3649.   PMFLAGS_FULLSCREEN       = $0000000000000001;
  3650.   PMFLAGS_DETAILEDSTATUS   = $0000000000000002;
  3651.   PMFLAGS_ALIGNEXTENSIONS  = $0000000000000004;
  3652.   PMFLAGS_CASECONVERSION   = $0000000000000008;
  3653.  
  3654. (*
  3655. struct PanelMode
  3656. {
  3657.   const wchar_t *ColumnTypes;
  3658.   const wchar_t *ColumnWidths;
  3659.   const wchar_t * const *ColumnTitles;
  3660.   const wchar_t *StatusColumnTypes;
  3661.   const wchar_t *StatusColumnWidths;
  3662.   PANELMODE_FLAGS Flags;
  3663. };
  3664. *)
  3665. type
  3666.   PPanelMode = ^TPanelMode;
  3667.   TPanelMode = record
  3668.     ColumnTypes : PFarChar;
  3669.     ColumnWidths : PFarChar;
  3670.     ColumnTitles : PPCharArray;
  3671.     StatusColumnTypes :PFarChar;
  3672.     StatusColumnWidths :PFarChar;
  3673.     Flags :TPanelModeFlags;
  3674.   end;
  3675.  
  3676.   PPanelModeArray = ^TPanelModeArray;
  3677.   TPanelModeArray = packed array [0..MaxInt div SizeOf(TPanelMode) - 1] of TPanelMode;
  3678.  
  3679.  
  3680. { OPENPANELINFO_FLAGS }
  3681.  
  3682. type
  3683.   TOpenPanelInfoFlags = int64;
  3684.  
  3685. const
  3686.   OPIF_NONE                    = 0;
  3687.   OPIF_DISABLEFILTER           = $00000001;
  3688.   OPIF_DISABLESORTGROUPS       = $00000002;
  3689.   OPIF_DISABLEHIGHLIGHTING     = $00000004;
  3690.   OPIF_ADDDOTS                 = $00000008;
  3691.   OPIF_RAWSELECTION            = $00000010;
  3692.   OPIF_REALNAMES               = $00000020;
  3693.   OPIF_SHOWNAMESONLY           = $00000040;
  3694.   OPIF_SHOWRIGHTALIGNNAMES     = $00000080;
  3695.   OPIF_SHOWPRESERVECASE        = $00000100;
  3696.   OPIF_COMPAREFATTIME          = $00000400;
  3697.   OPIF_EXTERNALGET             = $00000800;
  3698.   OPIF_EXTERNALPUT             = $00001000;
  3699.   OPIF_EXTERNALDELETE          = $00002000;
  3700.   OPIF_EXTERNALMKDIR           = $00004000;
  3701.   OPIF_USEATTRHIGHLIGHTING     = $00008000;
  3702.   OPIF_USECRC32                = $00010000;
  3703.   OPIF_USEFREESIZE             = $00020000;
  3704.   OPIF_SHORTCUT                = $00040000;
  3705.  
  3706.  
  3707. (*
  3708. struct KeyBarLabel
  3709. {
  3710.   struct FarKey Key;
  3711.   const wchar_t *Text;
  3712.   const wchar_t *LongText;
  3713. };
  3714. *)
  3715. type
  3716.   PKeyBarLabel = ^TKeyBarLabel;
  3717.   TKeyBarLabel = record
  3718.     Key :TFarKey;
  3719.     Text :PFarChar;
  3720.     LongText :PFarChar;
  3721.   end;
  3722.  
  3723. (*
  3724. struct KeyBarTitles
  3725. {
  3726.   size_t CountLabels;
  3727.   struct KeyBarLabel *Labels;
  3728. };
  3729. *)
  3730. type
  3731.   PKeyBarTitles = ^TKeyBarTitles;
  3732.   TKeyBarTitles = record
  3733.     CountLabels :size_t;
  3734.     Labels :PKeyBarLabel;
  3735.   end;
  3736.  
  3737. (*
  3738. struct FarSetKeyBarTitles
  3739. {
  3740.   size_t StructSize;
  3741.   struct KeyBarTitles *Titles;
  3742. };
  3743. *)
  3744. type
  3745.   PFarSetKeyBarTitles = ^TFarSetKeyBarTitles;
  3746.   TFarSetKeyBarTitles = record
  3747.     StructSize :size_t;
  3748.     Titles :PKeyBarTitles;
  3749.   end;
  3750.  
  3751.  
  3752. { OPERATION_MODES }
  3753.  
  3754. type
  3755.   TOperationModes = Int64;
  3756.  
  3757. const
  3758.   OPM_NONE      = 0;
  3759.   OPM_SILENT    = $0001;
  3760.   OPM_FIND      = $0002;
  3761.   OPM_VIEW      = $0004;
  3762.   OPM_EDIT      = $0008;
  3763.   OPM_TOPLEVEL  = $0010;
  3764.   OPM_DESCR     = $0020;
  3765.   OPM_QUICKVIEW = $0040;
  3766.   OPM_PGDN      = $0080;
  3767.   OPM_COMMANDS  = $0100;
  3768.  
  3769. (*
  3770. struct OpenPanelInfo
  3771. {
  3772.   size_t                       StructSize;
  3773.   HANDLE                       hPanel;
  3774.   OPENPANELINFO_FLAGS          Flags;
  3775.   const wchar_t               *HostFile;
  3776.   const wchar_t               *CurDir;
  3777.   const wchar_t               *Format;
  3778.   const wchar_t               *PanelTitle;
  3779.   const struct InfoPanelLine  *InfoLines;
  3780.   size_t                       InfoLinesNumber;
  3781.   const wchar_t * const       *DescrFiles;
  3782.   size_t                       DescrFilesNumber;
  3783.   const struct PanelMode      *PanelModesArray;
  3784.   size_t                       PanelModesNumber;
  3785.   intptr_t                     StartPanelMode;
  3786.   enum OPENPANELINFO_SORTMODES StartSortMode;
  3787.   intptr_t                     StartSortOrder;
  3788.   const struct KeyBarTitles   *KeyBar;
  3789.   const wchar_t               *ShortcutData;
  3790.   unsigned __int64             FreeSize;
  3791. };
  3792. *)
  3793. type
  3794.   POpenPanelInfo = ^TOpenPanelInfo;
  3795.   TOpenPanelInfo = record
  3796.     StructSize :size_t;
  3797.     hPanel :THandle;
  3798.     Flags :TOpenPanelInfoFlags;
  3799.     HostFile :PFarChar;
  3800.     CurDir :PFarChar;
  3801.     Format :PFarChar;
  3802.     PanelTitle :PFarChar;
  3803.     InfoLines :PInfoPanelLineArray;
  3804.     InfoLinesNumber :size_t;
  3805.     DescrFiles :PPCharArray;
  3806.     DescrFilesNumber :size_t;
  3807.     PanelModesArray :PPanelModeArray;
  3808.     PanelModesNumber :size_t;
  3809.     StartPanelMode :TIntPtr;
  3810.     StartSortMode :DWORD { OPENPANELINFO_SORTMODES };
  3811.     StartSortOrder :TIntPtr;
  3812.     KeyBar :PKeyBarTitles;
  3813.     ShortcutData :PFarChar;
  3814.     FreeSize :Int64;
  3815.   end;
  3816.  
  3817. (*
  3818. struct AnalyseInfo
  3819. {
  3820.   size_t          StructSize;
  3821.   const wchar_t  *FileName;
  3822.   void           *Buffer;
  3823.   size_t          BufferSize;
  3824.   OPERATION_MODES OpMode;
  3825. };
  3826. *)
  3827. type
  3828.   PAnalyseInfo = ^TAnalyseInfo;
  3829.   TAnalyseInfo = record
  3830.     StructSize :size_t;
  3831.     FileName :PFarChar;
  3832.     Buffer :Pointer;
  3833.     BufferSize :size_t;
  3834.     OpMode :TOperationModes;
  3835.   end;
  3836.  
  3837. (*
  3838. struct OpenAnalyseInfo
  3839. {
  3840.   size_t StructSize;
  3841.   struct AnalyseInfo* Info;
  3842.   HANDLE Handle;
  3843. };
  3844. *)
  3845. type
  3846.   POpenAnalyseInfo = ^TOpenAnalyseInfo;
  3847.   TOpenAnalyseInfo = record
  3848.     StructSize :size_t;
  3849.     Info :PAnalyseInfo;
  3850.     Handle :THandle;
  3851.   end;
  3852.  
  3853. (*
  3854. struct OpenMacroInfo
  3855. {
  3856.   size_t StructSize;
  3857.   size_t Count;
  3858.   struct FarMacroValue *Values;
  3859. };
  3860. *)
  3861. type
  3862.   POpenMacroInfo = ^TOpenMacroInfo;
  3863.   TOpenMacroInfo = record
  3864.     StructSize :size_t;
  3865.     Count :size_t;
  3866.     Values :PFarMacroValueArray;
  3867.   end;
  3868.  
  3869. (*
  3870. struct OpenShortcutInfo
  3871. {
  3872.   size_t StructSize;
  3873.   const wchar_t *HostFile;
  3874.   const wchar_t *ShortcutData;
  3875. };
  3876. *)
  3877. type
  3878.   POpenShortcutInfo = ^TOpenShortcutInfo;
  3879.   TOpenShortcutInfo = record
  3880.     StructSize :size_t;
  3881.     HostFile :PFarChar;
  3882.     ShortcutData :PFarChar;
  3883.   end;
  3884.  
  3885. (*
  3886. struct OpenCommandLineInfo
  3887. {
  3888.   size_t StructSize;
  3889.   const wchar_t *CommandLine;
  3890. };
  3891. *)
  3892. type
  3893.   POpenCommandLineInfo = ^TOpenCommandLineInfo;
  3894.   TOpenCommandLineInfo = record
  3895.     StructSize :size_t;
  3896.     CommandLine :PFarChar;
  3897.   end;
  3898.  
  3899. { OPENFROM }
  3900.  
  3901. const
  3902.   OPEN_FROM_MASK       = $FF;
  3903.  
  3904.   OPEN_DISKMENU        = 0;
  3905.   OPEN_PLUGINSMENU     = 1;
  3906.   OPEN_FINDLIST        = 2;
  3907.   OPEN_SHORTCUT        = 3;
  3908.   OPEN_COMMANDLINE     = 4;
  3909.   OPEN_EDITOR          = 5;
  3910.   OPEN_VIEWER          = 6;
  3911.   OPEN_FILEPANEL       = 7;
  3912.   OPEN_DIALOG          = 8;
  3913.   OPEN_ANALYSE         = 9;
  3914.   OPEN_RIGHTDISKMENU   = 10;
  3915.   OPEN_FROMMACRO_      = 11;
  3916.   OPEN_LUAMACRO        = 100;
  3917.  
  3918.  
  3919. { MACROCALLTYPE }
  3920.  
  3921. const
  3922.   MCT_MACROINIT     = 0;
  3923.   MCT_MACROSTEP     = 1;
  3924.   MCT_MACROFINAL    = 2;
  3925.   MCT_MACROPARSE    = 3;
  3926.  
  3927. (*
  3928. struct OpenMacroPluginInfo
  3929. {
  3930.   size_t StructSize;
  3931.   enum MACROCALLTYPE CallType;
  3932.   HANDLE Handle;
  3933.   struct FarMacroCall *Data;
  3934. };
  3935. *)
  3936. {!!!}
  3937.  
  3938. { FAR_EVENTS }
  3939.  
  3940. const
  3941.   FE_CHANGEVIEWMODE = 0;
  3942.   FE_REDRAW         = 1;
  3943.   FE_IDLE           = 2;
  3944.   FE_CLOSE          = 3;
  3945.   FE_BREAK          = 4;
  3946.   FE_COMMAND        = 5;
  3947.   
  3948.   FE_GOTFOCUS       = 6;
  3949.   FE_KILLFOCUS      = 7;
  3950.  
  3951.  
  3952. (*
  3953. struct OpenInfo
  3954. {
  3955.   size_t StructSize;
  3956.   enum OPENFROM OpenFrom;
  3957.   const GUID* Guid;
  3958.   intptr_t Data;
  3959. };
  3960. *)
  3961. type
  3962.   POpenInfo = ^TOpenInfo;
  3963.   TOpenInfo = record
  3964.     StructSize :size_t;
  3965.     OpenFrom :DWORD{enum OPENFROM};
  3966.     GUID :PGUID;
  3967.     Data :TIntPtr;
  3968.   end;
  3969.  
  3970.           (*
  3971.             struct SetDirectoryInfo
  3972.             {
  3973.                     size_t StructSize;
  3974.                     HANDLE hPanel;
  3975.                     const wchar_t *Dir;
  3976.                     intptr_t UserData;
  3977.                     OPERATION_MODES OpMode;
  3978.             };
  3979.  
  3980.             struct SetFindListInfo
  3981.             {
  3982.                     size_t StructSize;
  3983.                     HANDLE hPanel;
  3984.                     const struct PluginPanelItem *PanelItem;
  3985.                     size_t ItemsNumber;
  3986.             };
  3987.  
  3988.             struct PutFilesInfo
  3989.             {
  3990.                     size_t StructSize;
  3991.                     HANDLE hPanel;
  3992.                     struct PluginPanelItem *PanelItem;
  3993.                     size_t ItemsNumber;
  3994.                     BOOL Move;
  3995.                     const wchar_t *SrcPath;
  3996.                     OPERATION_MODES OpMode;
  3997.             };
  3998.  
  3999.             struct ProcessHostFileInfo
  4000.             {
  4001.                     size_t StructSize;
  4002.                     HANDLE hPanel;
  4003.                     struct PluginPanelItem *PanelItem;
  4004.                     size_t ItemsNumber;
  4005.                     OPERATION_MODES OpMode;
  4006.             };
  4007.  
  4008.             struct MakeDirectoryInfo
  4009.             {
  4010.                     size_t StructSize;
  4011.                     HANDLE hPanel;
  4012.                     const wchar_t *Name;
  4013.                     OPERATION_MODES OpMode;
  4014.             };
  4015.  
  4016.             struct CompareInfo
  4017.             {
  4018.                     size_t StructSize;
  4019.                     HANDLE hPanel;
  4020.                     const struct PluginPanelItem *Item1;
  4021.                     const struct PluginPanelItem *Item2;
  4022.                     enum OPENPANELINFO_SORTMODES Mode;
  4023.             };
  4024.  
  4025.             struct GetFindDataInfo
  4026.             {
  4027.                     size_t StructSize;
  4028.                     HANDLE hPanel;
  4029.                     struct PluginPanelItem *PanelItem;
  4030.                     size_t ItemsNumber;
  4031.                     OPERATION_MODES OpMode;
  4032.             };
  4033.  
  4034.  
  4035.             struct FreeFindDataInfo
  4036.             {
  4037.                     size_t StructSize;
  4038.                     HANDLE hPanel;
  4039.                     struct PluginPanelItem *PanelItem;
  4040.                     size_t ItemsNumber;
  4041.             };
  4042.  
  4043.             struct GetFilesInfo
  4044.             {
  4045.                     size_t StructSize;
  4046.                     HANDLE hPanel;
  4047.                     struct PluginPanelItem *PanelItem;
  4048.                     size_t ItemsNumber;
  4049.                     BOOL Move;
  4050.                     const wchar_t *DestPath;
  4051.                     OPERATION_MODES OpMode;
  4052.             };
  4053.  
  4054.             struct DeleteFilesInfo
  4055.             {
  4056.                     size_t StructSize;
  4057.                     HANDLE hPanel;
  4058.                     struct PluginPanelItem *PanelItem;
  4059.                     size_t ItemsNumber;
  4060.                     OPERATION_MODES OpMode;
  4061.             };
  4062.  
  4063.             struct ProcessPanelInputInfo
  4064.             {
  4065.                     size_t StructSize;
  4066.                     HANDLE hPanel;
  4067.                     INPUT_RECORD Rec;
  4068.             };
  4069. *)
  4070. {!!!}
  4071.  
  4072. (*
  4073. struct ProcessEditorInputInfo
  4074. {
  4075.   size_t StructSize;
  4076.   INPUT_RECORD Rec;
  4077. };
  4078. *)
  4079. type
  4080.   PProcessEditorInputInfo = ^TProcessEditorInputInfo;
  4081.   TProcessEditorInputInfo = record
  4082.     StructSize :size_t;
  4083.     Rec :INPUT_RECORD;
  4084.   end;
  4085.  
  4086.  
  4087. type
  4088.   TProcessConsoleInputFlags = Int64;
  4089.  
  4090. const
  4091.   PCIF_NONE      = 0;
  4092.   PCIF_FROMMAIN  = $0000000000000001;
  4093.  
  4094. (*
  4095. struct ProcessConsoleInputInfo
  4096. {
  4097.   size_t StructSize;
  4098.   PROCESSCONSOLEINPUT_FLAGS Flags;
  4099.   INPUT_RECORD Rec;
  4100.   HANDLE hPanel;
  4101. };
  4102. *)
  4103. type
  4104.   PProcessConsoleInputInfo = ^TProcessConsoleInputInfo;
  4105.   TProcessConsoleInputInfo = record
  4106.     StructSize :size_t;
  4107.     Flags :TProcessConsoleInputFlags;
  4108.     Rec :TInputRecord;
  4109.     hPanel :THandle;
  4110.   end;
  4111.  
  4112. (*
  4113. struct ExitInfo
  4114. {
  4115.   size_t StructSize;
  4116. };
  4117. *)
  4118. type
  4119.   PExitInfo = ^TExitInfo;
  4120.   TExitInfo = record
  4121.     StructSize :size_t;
  4122.   end;
  4123.  
  4124. (*
  4125. struct ProcessPanelEventInfo
  4126. {
  4127.   size_t StructSize;
  4128.   intptr_t Event;
  4129.   void* Param;
  4130.   HANDLE hPanel;
  4131. };
  4132. *)
  4133.  
  4134. (*
  4135. struct ProcessEditorEventInfo
  4136. {
  4137.   size_t StructSize;
  4138.   intptr_t Event;
  4139.   void* Param;
  4140.   intptr_t EditorID;
  4141. };
  4142. *)
  4143. type
  4144.   PProcessEditorEventInfo = ^TProcessEditorEventInfo;
  4145.   TProcessEditorEventInfo = record
  4146.     StructSize :size_t;
  4147.     Event :TIntPtr;
  4148.     Param :Pointer;
  4149.     EditorID :TIntPtr;
  4150.   end;
  4151.  
  4152. (*
  4153. struct ProcessDialogEventInfo
  4154. {
  4155.   size_t StructSize;
  4156.   intptr_t Event;
  4157.   struct FarDialogEvent* Param;
  4158. };
  4159. *)
  4160. type
  4161.   PProcessDialogEventInfo = ^TProcessDialogEventInfo;
  4162.   TProcessDialogEventInfo = record
  4163.     StructSize :size_t;
  4164.     Event :TIntPtr;
  4165.     Param :PFarDialogEvent;
  4166.   end;
  4167.  
  4168. (*
  4169. struct ProcessSynchroEventInfo
  4170. {
  4171.   size_t StructSize;
  4172.   intptr_t Event;
  4173.   void* Param;
  4174. };
  4175. *)
  4176. type
  4177.   PProcessSynchroEventInfo = ^TProcessSynchroEventInfo;
  4178.   TProcessSynchroEventInfo = record
  4179.     StructSize :size_t;
  4180.     Event :TIntPtr;
  4181.     Param :Pointer;
  4182.   end;
  4183.  
  4184. (*
  4185. struct ProcessViewerEventInfo
  4186. {
  4187.   size_t StructSize;
  4188.   intptr_t Event;
  4189.   void* Param;
  4190.   intptr_t ViewerID;
  4191. };
  4192. *)
  4193. type
  4194.   PProcessViewerEventInfo = ^TProcessViewerEventInfo;
  4195.   TProcessViewerEventInfo = record
  4196.     StructSize :size_t;
  4197.     Event :TIntPtr;
  4198.     Param :Pointer;
  4199.     ViewerID :TIntPtr;
  4200.   end;
  4201.  
  4202. (*
  4203. struct ClosePanelInfo
  4204. {
  4205.   size_t StructSize;
  4206.   HANDLE hPanel;
  4207. };
  4208. *)
  4209. type
  4210.   PClosePanelInfo = ^TClosePanelInfo;
  4211.   TClosePanelInfo = record
  4212.     StructSize :size_t;
  4213.     hPanel :THandle;
  4214.   end;
  4215.  
  4216. (*
  4217. struct CloseAnalyseInfo
  4218. {
  4219.   size_t StructSize;
  4220.   HANDLE Handle;
  4221. };
  4222. *)
  4223. type
  4224.   PCloseAnalyseInfo = ^TCloseAnalyseInfo;
  4225.   TCloseAnalyseInfo = record
  4226.     StructSize :size_t;
  4227.     Handle :THandle;
  4228.   end;
  4229.  
  4230. (*
  4231. struct ConfigureInfo
  4232. {
  4233.   size_t StructSize;
  4234.   const GUID* Guid;
  4235. };
  4236. *)
  4237. type
  4238.   PConfigureInfo = ^TConfigureInfo;
  4239.   TConfigureInfo = record
  4240.     StructSize :size_t;
  4241.     GUID :PGUID;
  4242.   end;
  4243.  
  4244.  
  4245. (*
  4246. // Exported Functions
  4247. HANDLE   WINAPI AnalyseW(const struct AnalyseInfo *Info);
  4248. void     WINAPI CloseAnalyseW(const struct CloseAnalyseInfo *Info);
  4249. void     WINAPI ClosePanelW(const struct ClosePanelInfo *Info);
  4250. intptr_t WINAPI CompareW(const struct CompareInfo *Info);
  4251. intptr_t WINAPI ConfigureW(const struct ConfigureInfo *Info);
  4252. intptr_t WINAPI DeleteFilesW(const struct DeleteFilesInfo *Info);
  4253. void     WINAPI ExitFARW(const struct ExitInfo *Info);
  4254. void     WINAPI FreeFindDataW(const struct FreeFindDataInfo *Info);
  4255. intptr_t WINAPI GetFilesW(struct GetFilesInfo *Info);
  4256. intptr_t WINAPI GetFindDataW(struct GetFindDataInfo *Info);
  4257. void     WINAPI GetGlobalInfoW(struct GlobalInfo *Info);
  4258. void     WINAPI GetOpenPanelInfoW(struct OpenPanelInfo *Info);
  4259. void     WINAPI GetPluginInfoW(struct PluginInfo *Info);
  4260. intptr_t WINAPI MakeDirectoryW(struct MakeDirectoryInfo *Info);
  4261. HANDLE   WINAPI OpenW(const struct OpenInfo *Info);
  4262. intptr_t WINAPI ProcessDialogEventW(const struct ProcessDialogEventInfo *Info);
  4263. intptr_t WINAPI ProcessEditorEventW(const struct ProcessEditorEventInfo *Info);
  4264. intptr_t WINAPI ProcessEditorInputW(const struct ProcessEditorInputInfo *Info);
  4265. intptr_t WINAPI ProcessPanelEventW(const struct ProcessPanelEventInfo *Info);
  4266. intptr_t WINAPI ProcessHostFileW(const struct ProcessHostFileInfo *Info);
  4267. intptr_t WINAPI ProcessPanelInputW(const struct ProcessPanelInputInfo *Info);
  4268. intptr_t WINAPI ProcessConsoleInputW(struct ProcessConsoleInputInfo *Info);
  4269. intptr_t WINAPI ProcessSynchroEventW(const struct ProcessSynchroEventInfo *Info);
  4270. intptr_t WINAPI ProcessViewerEventW(const struct ProcessViewerEventInfo *Info);
  4271. intptr_t WINAPI PutFilesW(const struct PutFilesInfo *Info);
  4272. intptr_t WINAPI SetDirectoryW(const struct SetDirectoryInfo *Info);
  4273. intptr_t WINAPI SetFindListW(const struct SetFindListInfo *Info);
  4274. void     WINAPI SetStartupInfoW(const struct PluginStartupInfo *Info);
  4275. *)
  4276.  
  4277.  
  4278. function MakeFarVersion(Major :DWORD; Minor :DWORD; Revision :DWORD; Build :DWORD; Stage :DWORD) :TVersionInfo;
  4279.  
  4280. (*
  4281. #define Dlg_RedrawDialog(Info,hDlg)            Info.SendDlgMessage(hDlg,DM_REDRAW,0,0)
  4282.  
  4283. #define Dlg_GetDlgData(Info,hDlg)              Info.SendDlgMessage(hDlg,DM_GETDLGDATA,0,0)
  4284. #define Dlg_SetDlgData(Info,hDlg,Data)         Info.SendDlgMessage(hDlg,DM_SETDLGDATA,0,(intptr_t)Data)
  4285.  
  4286. #define Dlg_GetDlgItemData(Info,hDlg,ID)       Info.SendDlgMessage(hDlg,DM_GETITEMDATA,0,0)
  4287. #define Dlg_SetDlgItemData(Info,hDlg,ID,Data)  Info.SendDlgMessage(hDlg,DM_SETITEMDATA,0,(intptr_t)Data)
  4288.  
  4289. #define DlgItem_GetFocus(Info,hDlg)            Info.SendDlgMessage(hDlg,DM_GETFOCUS,0,0)
  4290. #define DlgItem_SetFocus(Info,hDlg,ID)         Info.SendDlgMessage(hDlg,DM_SETFOCUS,ID,0)
  4291. #define DlgItem_Enable(Info,hDlg,ID)           Info.SendDlgMessage(hDlg,DM_ENABLE,ID,TRUE)
  4292. #define DlgItem_Disable(Info,hDlg,ID)          Info.SendDlgMessage(hDlg,DM_ENABLE,ID,FALSE)
  4293. #define DlgItem_IsEnable(Info,hDlg,ID)         Info.SendDlgMessage(hDlg,DM_ENABLE,ID,-1)
  4294. #define DlgItem_SetText(Info,hDlg,ID,Str)      Info.SendDlgMessage(hDlg,DM_SETTEXTPTR,ID,(intptr_t)Str)
  4295.  
  4296. #define DlgItem_GetCheck(Info,hDlg,ID)         Info.SendDlgMessage(hDlg,DM_GETCHECK,ID,0)
  4297. #define DlgItem_SetCheck(Info,hDlg,ID,State)   Info.SendDlgMessage(hDlg,DM_SETCHECK,ID,State)
  4298.  
  4299. #define DlgEdit_AddHistory(Info,hDlg,ID,Str)   Info.SendDlgMessage(hDlg,DM_ADDHISTORY,ID,(intptr_t)Str)
  4300.  
  4301. #define DlgList_AddString(Info,hDlg,ID,Str)    Info.SendDlgMessage(hDlg,DM_LISTADDSTR,ID,(intptr_t)Str)
  4302. #define DlgList_GetCurPos(Info,hDlg,ID)        Info.SendDlgMessage(hDlg,DM_LISTGETCURPOS,ID,0)
  4303. #define DlgList_SetCurPos(Info,hDlg,ID,NewPos) {struct FarListPos LPos={sizeof(FarListPos),NewPos,-1};Info.SendDlgMessage(hDlg,DM_LISTSETCURPOS,ID,(intptr_t)&LPos);}
  4304. #define DlgList_ClearList(Info,hDlg,ID)        Info.SendDlgMessage(hDlg,DM_LISTDELETE,ID,0)
  4305. #define DlgList_DeleteItem(Info,hDlg,ID,Index) {struct FarListDelete FLDItem={sizeof(FarListDelete),Index,1}; Info.SendDlgMessage(hDlg,DM_LISTDELETE,ID,(intptr_t)&FLDItem);}
  4306. #define DlgList_SortUp(Info,hDlg,ID)           Info.SendDlgMessage(hDlg,DM_LISTSORT,ID,0)
  4307. #define DlgList_SortDown(Info,hDlg,ID)         Info.SendDlgMessage(hDlg,DM_LISTSORT,ID,1)
  4308. #define DlgList_GetItemData(Info,hDlg,ID,Index)          Info.SendDlgMessage(hDlg,DM_LISTGETDATA,ID,Index)
  4309. #define DlgList_SetItemStrAsData(Info,hDlg,ID,Index,Str) {struct FarListItemData FLID{sizeof(FarListItemData),Index,0,Str,0}; Info.SendDlgMessage(hDlg,DM_LISTSETDATA,ID,(intptr_t)&FLID);}
  4310. *)
  4311.  
  4312.  
  4313. const
  4314.   FindFileId        :TGUID = '{8C9EAD29-910F-4b24-A669-EDAFBA6ED964}';
  4315.   CopyOverwriteId   :TGUID = '{9FBCB7E1-ACA2-475d-B40D-0F7365B632FF}';
  4316.   FileOpenCreateId  :TGUID = '{1D07CEE2-8F4F-480a-BE93-069B4FF59A2B}';
  4317.   FileSaveAsId      :TGUID = '{9162F965-78B8-4476-98AC-D699E5B6AFE7}';
  4318.   MakeFolderId      :TGUID = '{FAD00DBE-3FFF-4095-9232-E1CC70C67737}';
  4319.   FileAttrDlgId     :TGUID = '{80695D20-1085-44d6-8061-F3C41AB5569C}';
  4320.   CopyReadOnlyId    :TGUID = '{879A8DE6-3108-4beb-80DE-6F264991CE98}';
  4321.   CopyFilesId       :TGUID = '{FCEF11C4-5490-451d-8B4A-62FA03F52759}';
  4322.   HardSymLinkId     :TGUID = '{5EB266F4-980D-46af-B3D2-2C50E64BCA81}';
  4323. {$endif ApiImpl}
  4324.  
  4325. {$ifndef FarAPI}
  4326. {******************************************************************************}
  4327. {******************************} implementation {******************************}
  4328. {******************************************************************************}
  4329. {$endif FarAPI}
  4330.  
  4331.  
  4332. {$ifndef ApiIntf}
  4333. function MakeFarVersion(Major :DWORD; Minor :DWORD; Revision :DWORD; Build :DWORD; Stage :DWORD) :TVersionInfo;
  4334. begin
  4335.   Result.Major := Major;
  4336.   Result.Minor := Minor;
  4337.   Result.Revision := Revision;
  4338.   Result.Build := Build;
  4339.   Result.Stage := Stage;
  4340. end;
  4341. {$endif ApiIntf}
  4342.  
  4343. {$ifndef FarAPI}
  4344. {$Warnings Off}
  4345. end.
  4346. {$endif FarAPI}
  4347.  
  4348.