add farcommon.h to SDK where common typedef-s are resided (touch #1947)
[far2l.git] / far2l / far2sdk / farplug-mb.h
blob161f00eaada0d7945dd190ddeb266c867a4f59fc
1 #pragma once
2 #ifndef __FAR2SDK_FARPLUG_MB_H__
3 #define __FAR2SDK_FARPLUG_MB_H__
5 namespace oldfar
7 #ifndef _WIN64
8 #ifdef __GNUC__
9 #pragma pack(2)
10 #else
11 #pragma pack(push,2)
12 #endif
13 #endif
14 #include "farcommon.h"
15 const int NM = MAX_PATH;
17 enum FARMESSAGEFLAGS
19 FMSG_WARNING = 0x00000001,
20 FMSG_ERRORTYPE = 0x00000002,
21 FMSG_KEEPBACKGROUND = 0x00000004,
22 FMSG_DOWN = 0x00000008,
23 FMSG_LEFTALIGN = 0x00000010,
25 FMSG_ALLINONE = 0x00000020,
26 FMSG_COLOURS = 0x00000040,
28 FMSG_DISPLAYNOTIFY = 0x00000080,
30 FMSG_MB_OK = 0x00010000,
31 FMSG_MB_OKCANCEL = 0x00020000,
32 FMSG_MB_ABORTRETRYIGNORE = 0x00030000,
33 FMSG_MB_YESNO = 0x00040000,
34 FMSG_MB_YESNOCANCEL = 0x00050000,
35 FMSG_MB_RETRYCANCEL = 0x00060000,
38 typedef int (WINAPI *FARAPIMESSAGE)(
39 INT_PTR PluginNumber,
40 DWORD Flags,
41 const char *HelpTopic,
42 const char * const *Items,
43 int ItemsNumber,
44 int ButtonsNumber
48 enum DialogItemTypes
50 DI_TEXT,
51 DI_VTEXT,
52 DI_SINGLEBOX,
53 DI_DOUBLEBOX,
54 DI_EDIT,
55 DI_PSWEDIT,
56 DI_FIXEDIT,
57 DI_BUTTON,
58 DI_CHECKBOX,
59 DI_RADIOBUTTON,
60 DI_COMBOBOX,
61 DI_LISTBOX,
62 DI_MEMOEDIT,
64 DI_USERCONTROL=255,
67 enum FarDialogItemFlags
69 DIF_COLORMASK = 0x000000ffUL,
70 DIF_SETCOLOR = 0x00000100UL,
71 DIF_BOXCOLOR = 0x00000200UL,
72 DIF_GROUP = 0x00000400UL,
73 DIF_LEFTTEXT = 0x00000800UL,
74 DIF_MOVESELECT = 0x00001000UL,
75 DIF_SHOWAMPERSAND = 0x00002000UL,
76 DIF_CENTERGROUP = 0x00004000UL,
77 DIF_NOBRACKETS = 0x00008000UL,
78 DIF_MANUALADDHISTORY = 0x00008000UL,
79 DIF_SEPARATOR = 0x00010000UL,
80 DIF_VAREDIT = 0x00010000UL,
81 DIF_SEPARATOR2 = 0x00020000UL,
82 DIF_EDITOR = 0x00020000UL,
83 DIF_LISTNOAMPERSAND = 0x00020000UL,
84 DIF_LISTNOBOX = 0x00040000UL,
85 DIF_HISTORY = 0x00040000UL,
86 DIF_BTNNOCLOSE = 0x00040000UL,
87 DIF_CENTERTEXT = 0x00040000UL,
88 DIF_NOTCVTUSERCONTROL = 0x00040000UL,
89 DIF_SEPARATORUSER = 0x00080000UL,
90 DIF_EDITEXPAND = 0x00080000UL,
91 DIF_DROPDOWNLIST = 0x00100000UL,
92 DIF_USELASTHISTORY = 0x00200000UL,
93 DIF_MASKEDIT = 0x00400000UL,
94 DIF_SELECTONENTRY = 0x00800000UL,
95 DIF_3STATE = 0x00800000UL,
96 DIF_EDITPATH = 0x01000000UL,
97 DIF_LISTWRAPMODE = 0x01000000UL,
98 DIF_LISTAUTOHIGHLIGHT = 0x02000000UL,
99 DIF_LISTNOCLOSE = 0x04000000UL,
100 DIF_AUTOMATION = 0x08000000UL,
101 DIF_HIDDEN = 0x10000000UL,
102 DIF_READONLY = 0x20000000UL,
103 DIF_NOFOCUS = 0x40000000UL,
104 DIF_DISABLE = 0x80000000UL,
107 enum FarMessagesProc
109 DM_FIRST=0,
110 DM_CLOSE,
111 DM_ENABLE,
112 DM_ENABLEREDRAW,
113 DM_GETDLGDATA,
114 DM_GETDLGITEM,
115 DM_GETDLGRECT,
116 DM_GETTEXT,
117 DM_GETTEXTLENGTH,
118 DM_KEY,
119 DM_MOVEDIALOG,
120 DM_SETDLGDATA,
121 DM_SETDLGITEM,
122 DM_SETFOCUS,
123 DM_REDRAW,
124 DM_SETREDRAW=DM_REDRAW,
125 DM_SETTEXT,
126 DM_SETMAXTEXTLENGTH,
127 DM_SETTEXTLENGTH=DM_SETMAXTEXTLENGTH,
128 DM_SHOWDIALOG,
129 DM_GETFOCUS,
130 DM_GETCURSORPOS,
131 DM_SETCURSORPOS,
132 DM_GETTEXTPTR,
133 DM_SETTEXTPTR,
134 DM_SHOWITEM,
135 DM_ADDHISTORY,
137 DM_GETCHECK,
138 DM_SETCHECK,
139 DM_SET3STATE,
141 DM_LISTSORT,
142 DM_LISTGETITEM,
143 DM_LISTGETCURPOS,
144 DM_LISTSETCURPOS,
145 DM_LISTDELETE,
146 DM_LISTADD,
147 DM_LISTADDSTR,
148 DM_LISTUPDATE,
149 DM_LISTINSERT,
150 DM_LISTFINDSTRING,
151 DM_LISTINFO,
152 DM_LISTGETDATA,
153 DM_LISTSETDATA,
154 DM_LISTSETTITLES,
155 DM_LISTGETTITLES,
157 DM_RESIZEDIALOG,
158 DM_SETITEMPOSITION,
160 DM_GETDROPDOWNOPENED,
161 DM_SETDROPDOWNOPENED,
163 DM_SETHISTORY,
165 DM_GETITEMPOSITION,
166 DM_SETMOUSEEVENTNOTIFY,
168 DM_EDITUNCHANGEDFLAG,
170 DM_GETITEMDATA,
171 DM_SETITEMDATA,
173 DM_LISTSET,
174 DM_LISTSETMOUSEREACTION,
176 DM_GETCURSORSIZE,
177 DM_SETCURSORSIZE,
179 DM_LISTGETDATASIZE,
181 DM_GETSELECTION,
182 DM_SETSELECTION,
184 DN_LISTHOTKEY,
186 DM_GETEDITPOSITION,
187 DM_SETEDITPOSITION,
189 DM_SETCOMBOBOXEVENT,
190 DM_GETCOMBOBOXEVENT,
192 DN_FIRST=0x1000,
193 DN_BTNCLICK,
194 DN_CTLCOLORDIALOG,
195 DN_CTLCOLORDLGITEM,
196 DN_CTLCOLORDLGLIST,
197 DN_DRAWDIALOG,
198 DN_DRAWDLGITEM,
199 DN_EDITCHANGE,
200 DN_ENTERIDLE,
201 DN_GOTFOCUS,
202 DN_HELP,
203 DN_HOTKEY,
204 DN_INITDIALOG,
205 DN_KILLFOCUS,
206 DN_LISTCHANGE,
207 DN_MOUSECLICK,
208 DN_DRAGGED,
209 DN_RESIZECONSOLE,
210 DN_MOUSEEVENT,
211 DN_DRAWDIALOGDONE,
213 DN_CLOSE=DM_CLOSE,
214 DN_KEY=DM_KEY,
216 DM_USER=0x4000,
218 DM_KILLSAVESCREEN=DN_FIRST-1,
219 DM_ALLKEYMODE=DN_FIRST-2,
220 DN_ACTIVATEAPP=DM_USER-1,
223 enum FARCHECKEDSTATE
225 BSTATE_UNCHECKED = 0,
226 BSTATE_CHECKED = 1,
227 BSTATE_3STATE = 2,
228 BSTATE_TOGGLE = 3,
231 enum FARLISTMOUSEREACTIONTYPE
233 LMRT_ONLYFOCUS = 0,
234 LMRT_ALWAYS = 1,
235 LMRT_NEVER = 2,
238 enum LISTITEMFLAGS
240 LIF_SELECTED = 0x00010000UL,
241 LIF_CHECKED = 0x00020000UL,
242 LIF_SEPARATOR = 0x00040000UL,
243 LIF_DISABLE = 0x00080000UL,
244 LIF_GRAYED = 0x00100000UL,
245 LIF_HIDDEN = 0x00200000UL,
246 LIF_USETEXTPTR = 0x40000000UL,
247 LIF_DELETEUSERDATA = 0x80000000UL,
250 struct FarListItem
252 DWORD Flags;
253 char Text[128];
254 DWORD Reserved[3];
257 struct FarListUpdate
259 int Index;
260 struct FarListItem Item;
263 struct FarListInsert
265 int Index;
266 struct FarListItem Item;
269 struct FarListGetItem
271 int ItemIndex;
272 struct FarListItem Item;
275 struct FarListPos
277 int SelectPos;
278 int TopPos;
281 enum FARLISTFINDFLAGS
283 LIFIND_EXACTMATCH = 0x00000001,
286 struct FarListFind
288 int StartIndex;
289 const char *Pattern;
290 DWORD Flags;
291 DWORD Reserved;
294 struct FarListDelete
296 int StartIndex;
297 int Count;
300 enum FARLISTINFOFLAGS
302 LINFO_SHOWNOBOX = 0x00000400,
303 LINFO_AUTOHIGHLIGHT = 0x00000800,
304 LINFO_REVERSEHIGHLIGHT = 0x00001000,
305 LINFO_WRAPMODE = 0x00008000,
306 LINFO_SHOWAMPERSAND = 0x00010000,
309 struct FarListInfo
311 DWORD Flags;
312 int ItemsNumber;
313 int SelectPos;
314 int TopPos;
315 int MaxHeight;
316 int MaxLength;
317 DWORD Reserved[6];
320 struct FarListItemData
322 int Index;
323 int DataSize;
324 void *Data;
325 DWORD Reserved;
328 struct FarList
330 int ItemsNumber;
331 struct FarListItem *Items;
334 struct FarListTitles
336 int TitleLen;
337 char *Title;
338 int BottomLen;
339 char *Bottom;
342 struct FarListColors
344 DWORD Flags;
345 DWORD Reserved;
346 int ColorCount;
347 LPBYTE Colors;
350 struct FarDialogItem
352 int Type;
353 int X1,Y1,X2,Y2;
354 int Focus;
355 union
357 DWORD_PTR Reserved;
358 int Selected;
359 const char *History;
360 const char *Mask;
361 struct FarList *ListItems;
362 int ListPos;
363 CHAR_INFO *VBuf;
365 #ifdef _FAR_NO_NAMELESS_UNIONS
366 Param
367 #endif
369 DWORD Flags;
370 int DefaultButton;
371 union
373 char Data[512];
374 struct
376 DWORD PtrFlags;
377 int PtrLength;
378 char *PtrData;
379 char PtrTail[1];
380 } Ptr;
382 #ifdef _FAR_NO_NAMELESS_UNIONS
383 Data
384 #endif
388 struct FarDialogItemData
390 int PtrLength;
391 char *PtrData;
394 struct FarDialogEvent
396 HANDLE hDlg;
397 int Msg;
398 int Param1;
399 LONG_PTR Param2;
400 LONG_PTR Result;
403 struct OpenDlgPluginData
405 int ItemNumber;
406 HANDLE hDlg;
409 enum FARDIALOGFLAGS
411 FDLG_WARNING = 0x00000001,
412 FDLG_SMALLDIALOG = 0x00000002,
413 FDLG_NODRAWSHADOW = 0x00000004,
414 FDLG_NODRAWPANEL = 0x00000008,
415 FDLG_NONMODAL = 0x00000010,
416 FDLG_KEEPCONSOLETITLE = 0x00000020,
417 FDLG_REGULARIDLE = 0x00000040 // causes dialog to receive DN_ENTERIDLE at least once per second
420 typedef LONG_PTR(WINAPI *FARWINDOWPROC)(
421 HANDLE hDlg,
422 int Msg,
423 int Param1,
424 LONG_PTR Param2
427 typedef LONG_PTR(WINAPI *FARAPISENDDLGMESSAGE)(
428 HANDLE hDlg,
429 int Msg,
430 int Param1,
431 LONG_PTR Param2
434 typedef LONG_PTR(WINAPI *FARAPIDEFDLGPROC)(
435 HANDLE hDlg,
436 int Msg,
437 int Param1,
438 LONG_PTR Param2
441 typedef int (WINAPI *FARAPIDIALOG)(
442 INT_PTR PluginNumber,
443 int X1,
444 int Y1,
445 int X2,
446 int Y2,
447 const char *HelpTopic,
448 struct FarDialogItem *Item,
449 int ItemsNumber
452 typedef int (WINAPI *FARAPIDIALOGEX)(
453 INT_PTR PluginNumber,
454 int X1,
455 int Y1,
456 int X2,
457 int Y2,
458 const char *HelpTopic,
459 struct FarDialogItem *Item,
460 int ItemsNumber,
461 DWORD Reserved,
462 DWORD Flags,
463 FARWINDOWPROC DlgProc,
464 LONG_PTR Param
468 struct FarMenuItem
470 char Text[128];
471 int Selected;
472 int Checked;
473 int Separator;
476 enum MENUITEMFLAGS
478 MIF_SELECTED = 0x00010000UL,
479 MIF_CHECKED = 0x00020000UL,
480 MIF_SEPARATOR = 0x00040000UL,
481 MIF_DISABLE = 0x00080000UL,
482 MIF_GRAYED = 0x00100000UL,
483 MIF_HIDDEN = 0x00200000UL,
484 MIF_USETEXTPTR = 0x80000000UL,
487 struct FarMenuItemEx
489 DWORD Flags;
490 union
492 char Text[128];
493 const char *TextPtr;
494 } Text;
495 DWORD AccelKey;
496 DWORD Reserved;
497 DWORD_PTR UserData;
500 enum FARMENUFLAGS
502 FMENU_SHOWAMPERSAND = 0x00000001,
503 FMENU_WRAPMODE = 0x00000002,
504 FMENU_AUTOHIGHLIGHT = 0x00000004,
505 FMENU_REVERSEAUTOHIGHLIGHT = 0x00000008,
506 FMENU_SHOWNOBOX = 0x00000010,
507 FMENU_USEEXT = 0x00000020,
508 FMENU_CHANGECONSOLETITLE = 0x00000040,
511 typedef int (WINAPI *FARAPIMENU)(
512 INT_PTR PluginNumber,
513 int X,
514 int Y,
515 int MaxHeight,
516 DWORD Flags,
517 const char *Title,
518 const char *Bottom,
519 const char *HelpTopic,
520 const int *BreakKeys,
521 int *BreakCode,
522 const struct FarMenuItem *Item,
523 int ItemsNumber
527 enum PLUGINPANELITEMFLAGS
529 PPIF_PROCESSDESCR = 0x80000000,
530 PPIF_SELECTED = 0x40000000,
531 PPIF_USERDATA = 0x20000000,
534 struct FAR_FIND_DATA
536 FILETIME ftCreationTime;
537 FILETIME ftLastAccessTime;
538 FILETIME ftLastWriteTime;
539 DWORD64 nPhysicalSize;
540 DWORD64 nFileSize;
541 DWORD dwFileAttributes;
542 DWORD dwUnixMode;
543 CHAR cFileName[MAX_NAME];
546 struct PluginPanelItem
548 FAR_FIND_DATA FindData;
549 DWORD_PTR UserData;
550 DWORD Flags;
551 DWORD NumberOfLinks;
552 char *Description;
553 char *Owner;
554 char *Group;
555 char **CustomColumnData;
556 int CustomColumnNumber;
557 DWORD CRC32;
558 DWORD_PTR Reserved[2];
561 enum PANELINFOFLAGS
563 PFLAGS_SHOWHIDDEN = 0x00000001,
564 PFLAGS_HIGHLIGHT = 0x00000002,
565 PFLAGS_REVERSESORTORDER = 0x00000004,
566 PFLAGS_USESORTGROUPS = 0x00000008,
567 PFLAGS_SELECTEDFIRST = 0x00000010,
568 PFLAGS_REALNAMES = 0x00000020,
569 PFLAGS_NUMERICSORT = 0x00000040,
570 PFLAGS_PANELLEFT = 0x00000080,
573 enum PANELINFOTYPE
575 PTYPE_FILEPANEL,
576 PTYPE_TREEPANEL,
577 PTYPE_QVIEWPANEL,
578 PTYPE_INFOPANEL
581 struct PanelInfo
583 int PanelType;
584 int Plugin;
585 RECT PanelRect;
586 struct PluginPanelItem *PanelItems;
587 int ItemsNumber;
588 struct PluginPanelItem *SelectedItems;
589 int SelectedItemsNumber;
590 int CurrentItem;
591 int TopPanelItem;
592 int Visible;
593 int Focus;
594 int ViewMode;
595 char ColumnTypes[80];
596 char ColumnWidths[80];
597 char CurDir[NM];
598 int SortMode;
599 DWORD Flags;
600 DWORD Reserved;
604 struct PanelRedrawInfo
606 int CurrentItem;
607 int TopPanelItem;
610 struct CmdLineSelect
612 int SelStart;
613 int SelEnd;
616 enum FILE_CONTROL_COMMANDS
618 FCTL_CLOSEPLUGIN,
619 FCTL_GETPANELINFO,
620 FCTL_GETANOTHERPANELINFO,
621 FCTL_UPDATEPANEL,
622 FCTL_UPDATEANOTHERPANEL,
623 FCTL_REDRAWPANEL,
624 FCTL_REDRAWANOTHERPANEL,
625 FCTL_SETANOTHERPANELDIR,
626 FCTL_GETCMDLINE,
627 FCTL_SETCMDLINE,
628 FCTL_SETSELECTION,
629 FCTL_SETANOTHERSELECTION,
630 FCTL_SETVIEWMODE,
631 FCTL_SETANOTHERVIEWMODE,
632 FCTL_INSERTCMDLINE,
633 FCTL_SETUSERSCREEN,
634 FCTL_SETPANELDIR,
635 FCTL_SETCMDLINEPOS,
636 FCTL_GETCMDLINEPOS,
637 FCTL_SETSORTMODE,
638 FCTL_SETANOTHERSORTMODE,
639 FCTL_SETSORTORDER,
640 FCTL_SETANOTHERSORTORDER,
641 FCTL_GETCMDLINESELECTEDTEXT,
642 FCTL_SETCMDLINESELECTION,
643 FCTL_GETCMDLINESELECTION,
644 FCTL_GETPANELSHORTINFO,
645 FCTL_GETANOTHERPANELSHORTINFO,
646 FCTL_CHECKPANELSEXIST,
647 FCTL_SETNUMERICSORT,
648 FCTL_SETANOTHERNUMERICSORT,
649 FCTL_GETUSERSCREEN,
652 typedef int (WINAPI *FARAPICONTROL)(
653 HANDLE hPlugin,
654 int Command,
655 void *Param
658 typedef void (WINAPI *FARAPITEXT)(
659 int X,
660 int Y,
661 int Color,
662 const char *Str
665 typedef HANDLE(WINAPI *FARAPISAVESCREEN)(int X1, int Y1, int X2, int Y2);
667 typedef void (WINAPI *FARAPIRESTORESCREEN)(HANDLE hScreen);
670 typedef int (WINAPI *FARAPIGETDIRLIST)(
671 const char *Dir,
672 struct PluginPanelItem **pPanelItem,
673 int *pItemsNumber
676 typedef int (WINAPI *FARAPIGETPLUGINDIRLIST)(
677 INT_PTR PluginNumber,
678 HANDLE hPlugin,
679 const char *Dir,
680 struct PluginPanelItem **pPanelItem,
681 int *pItemsNumber
684 typedef void (WINAPI *FARAPIFREEDIRLIST)(const struct PluginPanelItem *PanelItem);
686 enum VIEWER_FLAGS
688 VF_NONMODAL = 0x00000001,
689 VF_DELETEONCLOSE = 0x00000002,
690 VF_ENABLE_F6 = 0x00000004,
691 VF_DISABLEHISTORY = 0x00000008,
692 VF_IMMEDIATERETURN = 0x00000100,
693 VF_DELETEONLYFILEONCLOSE = 0x00000200,
696 typedef int (WINAPI *FARAPIVIEWER)(
697 const char *FileName,
698 const char *Title,
699 int X1,
700 int Y1,
701 int X2,
702 int Y2,
703 DWORD Flags
706 enum EDITOR_FLAGS
708 EF_NONMODAL = 0x00000001,
709 EF_CREATENEW = 0x00000002,
710 EF_ENABLE_F6 = 0x00000004,
711 EF_DISABLEHISTORY = 0x00000008,
712 EF_DELETEONCLOSE = 0x00000010,
713 EF_USEEXISTING = 0x00000020,
714 EF_BREAKIFOPEN = 0x00000040,
715 EF_NEWIFOPEN = 0x00000080,
716 EF_IMMEDIATERETURN = 0x00000100,
717 EF_DELETEONLYFILEONCLOSE = 0x00000200,
718 EF_SERVICEREGION = 0x00001000,
721 enum EDITOR_EXITCODE
723 EEC_OPEN_ERROR = 0,
724 EEC_MODIFIED = 1,
725 EEC_NOT_MODIFIED = 2,
726 EEC_LOADING_INTERRUPTED = 3,
727 EEC_OPENED_EXISTING = 4,
728 EEC_ALREADY_EXISTS = 5,
729 EEC_OPEN_NEWINSTANCE = 6,
730 EEC_RELOAD = 7,
733 typedef int (WINAPI *FARAPIEDITOR)(
734 const char *FileName,
735 const char *Title,
736 int X1,
737 int Y1,
738 int X2,
739 int Y2,
740 DWORD Flags,
741 int StartLine,
742 int StartChar
745 typedef int (WINAPI *FARAPICMPNAME)(
746 const char *Pattern,
747 const char *String,
748 int SkipPath
752 enum FARCHARTABLE_COMMAND
754 FCT_DETECT=0x40000000,
757 struct CharTableSet
759 unsigned char DecodeTable[256];
760 unsigned char EncodeTable[256];
761 unsigned char UpperTable[256];
762 unsigned char LowerTable[256];
763 char TableName[128];
766 typedef int (WINAPI *FARAPICHARTABLE)(
767 int Command,
768 char *Buffer,
769 int BufferSize
772 typedef const char*(WINAPI *FARAPIGETMSG)(
773 INT_PTR PluginNumber,
774 FarLangMsgID MsgId
778 enum FarHelpFlags
780 FHELP_NOSHOWERROR = 0x80000000,
781 FHELP_SELFHELP = 0x00000000,
782 FHELP_FARHELP = 0x00000001,
783 FHELP_CUSTOMFILE = 0x00000002,
784 FHELP_CUSTOMPATH = 0x00000004,
785 FHELP_USECONTENTS = 0x40000000,
788 typedef BOOL (WINAPI *FARAPISHOWHELP)(
789 const char *ModuleName,
790 const char *Topic,
791 DWORD Flags
794 enum ADVANCED_CONTROL_COMMANDS
796 ACTL_GETFARVERSION = 0,
797 ACTL_CONSOLEMODE = 1,
798 ACTL_GETSYSWORDDIV = 2,
799 ACTL_WAITKEY = 3,
800 ACTL_GETCOLOR = 4,
801 ACTL_GETARRAYCOLOR = 5,
802 ACTL_EJECTMEDIA = 6,
803 ACTL_KEYMACRO = 7,
804 ACTL_POSTKEYSEQUENCE = 8,
805 ACTL_GETWINDOWINFO = 9,
806 ACTL_GETWINDOWCOUNT = 10,
807 ACTL_SETCURRENTWINDOW = 11,
808 ACTL_COMMIT = 12,
809 ACTL_GETFARHWND = 13,
810 ACTL_GETSYSTEMSETTINGS = 14,
811 ACTL_GETPANELSETTINGS = 15,
812 ACTL_GETINTERFACESETTINGS = 16,
813 ACTL_GETCONFIRMATIONS = 17,
814 ACTL_GETDESCSETTINGS = 18,
815 ACTL_SETARRAYCOLOR = 19,
816 ACTL_GETWCHARMODE = 20,
817 ACTL_GETPLUGINMAXREADDATA = 21,
818 ACTL_GETDIALOGSETTINGS = 22,
819 ACTL_GETSHORTWINDOWINFO = 23,
820 ACTL_REMOVEMEDIA = 24,
821 ACTL_GETMEDIATYPE = 25,
822 ACTL_GETPOLICIES = 26,
823 ACTL_REDRAWALL = 27,
826 enum FarPoliciesFlags
828 FFPOL_MAINMENUSYSTEM = 0x00000001,
829 FFPOL_MAINMENUPANEL = 0x00000002,
830 FFPOL_MAINMENUINTERFACE = 0x00000004,
831 FFPOL_MAINMENULANGUAGE = 0x00000008,
832 FFPOL_MAINMENUPLUGINS = 0x00000010,
833 FFPOL_MAINMENUDIALOGS = 0x00000020,
834 FFPOL_MAINMENUCONFIRMATIONS = 0x00000040,
835 FFPOL_MAINMENUPANELMODE = 0x00000080,
836 FFPOL_MAINMENUFILEDESCR = 0x00000100,
837 FFPOL_MAINMENUFOLDERDESCR = 0x00000200,
838 FFPOL_MAINMENUVIEWER = 0x00000800,
839 FFPOL_MAINMENUEDITOR = 0x00001000,
840 FFPOL_MAINMENUCOLORS = 0x00004000,
841 FFPOL_MAINMENUHILIGHT = 0x00008000,
842 FFPOL_MAINMENUSAVEPARAMS = 0x00020000,
844 FFPOL_CREATEMACRO = 0x00040000,
845 FFPOL_USEPSWITCH = 0x00080000,
846 FFPOL_PERSONALPATH = 0x00100000,
847 FFPOL_KILLTASK = 0x00200000,
848 FFPOL_SHOWHIDDENDRIVES = 0x80000000,
851 enum FarSystemSettings
853 FSS_DELETETORECYCLEBIN = 0x00000002,
854 FSS_WRITETHROUGH = 0x00000004,
855 FSS_RESERVED = 0x00000008,
856 FSS_SAVECOMMANDSHISTORY = 0x00000020,
857 FSS_SAVEFOLDERSHISTORY = 0x00000040,
858 FSS_SAVEVIEWANDEDITHISTORY = 0x00000080,
859 FSS_USEWINDOWSREGISTEREDTYPES = 0x00000100,
860 FSS_AUTOSAVESETUP = 0x00000200,
861 FSS_SCANSYMLINK = 0x00000400,
864 enum FarPanelSettings
866 FPS_SHOWHIDDENANDSYSTEMFILES = 0x00000001,
867 FPS_HIGHLIGHTFILES = 0x00000002,
868 FPS_AUTOCHANGEFOLDER = 0x00000004,
869 FPS_SELECTFOLDERS = 0x00000008,
870 FPS_ALLOWREVERSESORTMODES = 0x00000010,
871 FPS_SHOWCOLUMNTITLES = 0x00000020,
872 FPS_SHOWSTATUSLINE = 0x00000040,
873 FPS_SHOWFILESTOTALINFORMATION = 0x00000080,
874 FPS_SHOWFREESIZE = 0x00000100,
875 FPS_SHOWSCROLLBAR = 0x00000200,
876 FPS_SHOWBACKGROUNDSCREENSNUMBER = 0x00000400,
877 FPS_SHOWSORTMODELETTER = 0x00000800,
880 enum FarDialogSettings
882 FDIS_HISTORYINDIALOGEDITCONTROLS = 0x00000001,
883 FDIS_PERSISTENTBLOCKSINEDITCONTROLS = 0x00000002,
884 FDIS_AUTOCOMPLETEININPUTLINES = 0x00000004,
885 FDIS_BSDELETEUNCHANGEDTEXT = 0x00000008,
888 enum FarInterfaceSettings
890 FIS_CLOCKINPANELS = 0x00000001,
891 FIS_CLOCKINVIEWERANDEDITOR = 0x00000002,
892 FIS_MOUSE = 0x00000004,
893 FIS_SHOWKEYBAR = 0x00000008,
894 FIS_ALWAYSSHOWMENUBAR = 0x00000010,
895 FIS_USERIGHTALTASALTGR = 0x00000080,
896 FIS_SHOWTOTALCOPYPROGRESSINDICATOR = 0x00000100,
897 FIS_SHOWCOPYINGTIMEINFO = 0x00000200,
898 FIS_USECTRLPGUPTOCHANGEDRIVE = 0x00000800,
901 enum FarConfirmationsSettings
903 FCS_COPYOVERWRITE = 0x00000001,
904 FCS_MOVEOVERWRITE = 0x00000002,
905 FCS_DRAGANDDROP = 0x00000004,
906 FCS_DELETE = 0x00000008,
907 FCS_DELETENONEMPTYFOLDERS = 0x00000010,
908 FCS_INTERRUPTOPERATION = 0x00000020,
909 FCS_DISCONNECTNETWORKDRIVE = 0x00000040,
910 FCS_RELOADEDITEDFILE = 0x00000080,
911 FCS_CLEARHISTORYLIST = 0x00000100,
912 FCS_EXIT = 0x00000200,
915 enum FarDescriptionSettings
917 FDS_UPDATEALWAYS = 0x00000001,
918 FDS_UPDATEIFDISPLAYED = 0x00000002,
919 FDS_SETHIDDEN = 0x00000004,
920 FDS_UPDATEREADONLY = 0x00000008,
923 enum FAREJECTMEDIAFLAGS
925 EJECT_NO_MESSAGE = 0x00000001,
926 EJECT_LOAD_MEDIA = 0x00000002,
927 EJECT_NOTIFY_AFTERREMOVE = 0x00000004,
928 EJECT_READY = 0x80000000,
931 struct ActlEjectMedia
933 DWORD Letter;
934 DWORD Flags;
937 enum FARMEDIATYPE
939 FMT_DRIVE_ERROR = -1,
940 FMT_DRIVE_UNKNOWN = DRIVE_UNKNOWN,
941 FMT_DRIVE_NO_ROOT_DIR = DRIVE_NO_ROOT_DIR,
942 FMT_DRIVE_REMOVABLE = DRIVE_REMOVABLE,
943 FMT_DRIVE_FIXED = DRIVE_FIXED,
944 FMT_DRIVE_REMOTE = DRIVE_REMOTE,
945 FMT_DRIVE_CDROM = DRIVE_CDROM,
946 FMT_DRIVE_RAMDISK = DRIVE_RAMDISK,
947 FMT_DRIVE_SUBSTITUTE = 15,
948 FMT_DRIVE_REMOTE_NOT_CONNECTED = 16,
949 FMT_DRIVE_CD_RW = 18,
950 FMT_DRIVE_CD_RWDVD = 19,
951 FMT_DRIVE_DVD_ROM = 20,
952 FMT_DRIVE_DVD_RW = 21,
953 FMT_DRIVE_DVD_RAM = 22,
954 FMT_DRIVE_USBDRIVE = 40,
955 FMT_DRIVE_NOT_INIT = 255,
958 enum FARMEDIATYPEFLAGS
960 MEDIATYPE_NODETECTCDROM = 0x80000000,
963 struct ActlMediaType
965 DWORD Letter;
966 DWORD Flags;
967 DWORD Reserved[2];
970 enum FARKEYSEQUENCEFLAGS
972 KSFLAGS_DISABLEOUTPUT = 0x00000001,
973 KSFLAGS_NOSENDKEYSTOPLUGINS = 0x00000002
976 struct KeySequence
978 DWORD Flags;
979 int Count;
980 DWORD *Sequence;
983 enum FARMACROCOMMAND
985 MCMD_LOADALL = 0,
986 MCMD_SAVEALL = 1,
987 MCMD_POSTMACROSTRING = 2,
988 MCMD_COMPILEMACRO = 3,
989 MCMD_CHECKMACRO = 4,
990 MCMD_GETSTATE = 5,
993 enum FARMACROSTATE
995 MACROSTATE_NOMACRO =0,
996 MACROSTATE_EXECUTING =1,
997 MACROSTATE_EXECUTING_COMMON =2,
998 MACROSTATE_RECORDING =3,
999 MACROSTATE_RECORDING_COMMON =4,
1002 struct ActlKeyMacro
1004 int Command;
1005 union
1007 struct
1009 char *SequenceText;
1010 DWORD Flags;
1011 } PlainText;
1012 struct KeySequence Compile;
1013 struct
1015 const char *ErrMsg1;
1016 const char *ErrMsg2;
1017 const char *ErrMsg3;
1018 } MacroResult;
1019 DWORD_PTR Reserved[3];
1020 } Param;
1023 enum FARCOLORFLAGS
1025 FCLR_REDRAW = 0x00000001,
1028 struct FarSetColors
1030 DWORD Flags;
1031 int StartIndex;
1032 int ColorCount;
1033 LPBYTE Colors;
1036 enum WINDOWINFO_TYPE
1038 WTYPE_VIRTUAL,
1039 // ПРОСЬБА НЕ ЗАБЫВАТЬ СИНХРОНИЗИРОВАТЬ ИЗМЕНЕНИЯ
1040 // WTYPE_* и MODALTYPE_* (frame.hpp)!!!
1041 // (и не надо убирать этот комментарий, пока ситуация не изменится ;)
1042 WTYPE_PANELS=1,
1043 WTYPE_VIEWER,
1044 WTYPE_EDITOR,
1045 WTYPE_DIALOG,
1046 WTYPE_VMENU,
1047 WTYPE_HELP,
1048 WTYPE_COMBOBOX,
1049 WTYPE_FINDFOLDER,
1050 WTYPE_USER,
1053 struct WindowInfo
1055 int Pos;
1056 int Type;
1057 int Modified;
1058 int Current;
1059 char TypeName[64];
1060 char Name[NM];
1063 typedef INT_PTR(WINAPI *FARAPIADVCONTROL)(
1064 INT_PTR ModuleNumber,
1065 int Command,
1066 void *Param
1070 enum VIEWER_CONTROL_COMMANDS
1072 VCTL_GETINFO,
1073 VCTL_QUIT,
1074 VCTL_REDRAW,
1075 VCTL_SETKEYBAR,
1076 VCTL_SETPOSITION,
1077 VCTL_SELECT,
1078 VCTL_SETMODE,
1081 enum VIEWER_OPTIONS
1083 VOPT_SAVEFILEPOSITION=1,
1084 VOPT_AUTODETECTTABLE=2,
1087 enum VIEWER_SETMODE_TYPES
1089 VSMT_HEX,
1090 VSMT_WRAP,
1091 VSMT_WORDWRAP,
1094 enum VIEWER_SETMODEFLAGS_TYPES
1096 VSMFL_REDRAW = 0x00000001,
1099 struct ViewerSetMode
1101 int Type;
1102 union
1104 int iParam;
1105 char *cParam;
1106 } Param;
1107 DWORD Flags;
1108 DWORD Reserved;
1111 struct ViewerSelect
1113 INT64 BlockStartPos;
1114 int BlockLen;
1117 enum VIEWER_SETPOS_FLAGS
1119 VSP_NOREDRAW = 0x0001,
1120 VSP_PERCENT = 0x0002,
1121 VSP_RELATIVE = 0x0004,
1122 VSP_NORETNEWPOS = 0x0008,
1125 struct ViewerSetPosition
1127 DWORD Flags;
1128 INT64 StartPos;
1129 int LeftPos;
1132 struct ViewerMode
1134 int UseDecodeTable;
1135 int TableNum;
1136 int AnsiMode;
1137 int Unicode;
1138 int Wrap;
1139 int WordWrap;
1140 int Hex;
1141 int Processed;
1142 DWORD Reserved[3];
1145 struct ViewerInfo
1147 int StructSize;
1148 int ViewerID;
1149 const char *FileName;
1150 INT64 FileSize;
1151 INT64 FilePos;
1152 int WindowSizeX;
1153 int WindowSizeY;
1154 DWORD Options;
1155 int TabSize;
1156 struct ViewerMode CurMode;
1157 int LeftPos;
1158 DWORD Reserved3;
1161 typedef int (WINAPI *FARAPIVIEWERCONTROL)(
1162 int Command,
1163 void *Param
1166 enum VIEWER_EVENTS
1168 VE_READ =0,
1169 VE_CLOSE =1,
1171 VE_GOTFOCUS =6,
1172 VE_KILLFOCUS =7,
1176 enum EDITOR_EVENTS
1178 EE_READ =0,
1179 EE_SAVE =1,
1180 EE_REDRAW =2,
1181 EE_CLOSE =3,
1183 EE_GOTFOCUS =6,
1184 EE_KILLFOCUS =7,
1187 enum DIALOG_EVENTS
1189 DE_DLGPROCINIT =0,
1190 DE_DEFDLGPROCINIT =1,
1191 DE_DLGPROCEND =2,
1194 //#define EEREDRAW_ALL (void*)0
1195 //#define EEREDRAW_CHANGE (void*)1
1196 //#define EEREDRAW_LINE (void*)2
1198 enum EDITOR_CONTROL_COMMANDS
1200 ECTL_GETSTRING,
1201 ECTL_SETSTRING,
1202 ECTL_INSERTSTRING,
1203 ECTL_DELETESTRING,
1204 ECTL_DELETECHAR,
1205 ECTL_INSERTTEXT,
1206 ECTL_GETINFO,
1207 ECTL_SETPOSITION,
1208 ECTL_SELECT,
1209 ECTL_REDRAW,
1210 ECTL_EDITORTOOEM,
1211 ECTL_OEMTOEDITOR,
1212 ECTL_TABTOREAL,
1213 ECTL_REALTOTAB,
1214 ECTL_EXPANDTABS,
1215 ECTL_SETTITLE,
1216 ECTL_READINPUT,
1217 ECTL_PROCESSINPUT,
1218 ECTL_ADDCOLOR,
1219 ECTL_GETCOLOR,
1220 ECTL_SAVEFILE,
1221 ECTL_QUIT,
1222 ECTL_SETKEYBAR,
1223 ECTL_PROCESSKEY,
1224 ECTL_SETPARAM,
1225 ECTL_GETBOOKMARKS,
1226 ECTL_TURNOFFMARKINGBLOCK,
1227 ECTL_DELETEBLOCK,
1228 ECTL_ADDSTACKBOOKMARK,
1229 ECTL_PREVSTACKBOOKMARK,
1230 ECTL_NEXTSTACKBOOKMARK,
1231 ECTL_CLEARSTACKBOOKMARKS,
1232 ECTL_DELETESTACKBOOKMARK,
1233 ECTL_GETSTACKBOOKMARKS,
1234 ECTL_SERVICEREGION,
1235 ECTL_ADDTRUECOLOR,
1236 ECTL_GETTRUECOLOR,
1239 enum EDITOR_SETPARAMETER_TYPES
1241 ESPT_TABSIZE,
1242 ESPT_EXPANDTABS,
1243 ESPT_AUTOINDENT,
1244 ESPT_CURSORBEYONDEOL,
1245 ESPT_CHARCODEBASE,
1246 ESPT_CHARTABLE,
1247 ESPT_SAVEFILEPOSITION,
1248 ESPT_LOCKMODE,
1249 ESPT_SETWORDDIV,
1250 ESPT_GETWORDDIV,
1253 struct EditorServiceRegion
1255 int Command;
1256 DWORD Flags;
1260 struct EditorSetParameter
1262 int Type;
1263 union
1265 int iParam;
1266 char *cParam;
1267 DWORD Reserved1;
1268 } Param;
1269 DWORD Flags;
1270 DWORD Reserved2;
1273 struct EditorGetString
1275 int StringNumber;
1276 char *StringText;
1277 char *StringEOL;
1278 int StringLength;
1279 int SelStart;
1280 int SelEnd;
1284 struct EditorSetString
1286 int StringNumber;
1287 const char *StringText;
1288 const char *StringEOL;
1289 int StringLength;
1292 enum EXPAND_TABS
1294 EXPAND_NOTABS,
1295 EXPAND_ALLTABS,
1296 EXPAND_NEWTABS
1300 enum EDITOR_OPTIONS
1302 EOPT_EXPANDALLTABS = 0x00000001,
1303 EOPT_PERSISTENTBLOCKS = 0x00000002,
1304 EOPT_DELREMOVESBLOCKS = 0x00000004,
1305 EOPT_AUTOINDENT = 0x00000008,
1306 EOPT_SAVEFILEPOSITION = 0x00000010,
1307 EOPT_AUTODETECTTABLE = 0x00000020,
1308 EOPT_CURSORBEYONDEOL = 0x00000040,
1309 EOPT_EXPANDONLYNEWTABS = 0x00000080,
1313 enum EDITOR_BLOCK_TYPES
1315 BTYPE_NONE,
1316 BTYPE_STREAM,
1317 BTYPE_COLUMN
1320 enum EDITOR_CURRENTSTATE
1322 ECSTATE_MODIFIED = 0x00000001,
1323 ECSTATE_SAVED = 0x00000002,
1324 ECSTATE_LOCKED = 0x00000004,
1328 struct EditorInfo
1330 int EditorID;
1331 const char *FileName;
1332 int WindowSizeX;
1333 int WindowSizeY;
1334 int TotalLines;
1335 int CurLine;
1336 int CurPos;
1337 int CurTabPos;
1338 int TopScreenLine;
1339 int LeftPos;
1340 int Overtype;
1341 int BlockType;
1342 int BlockStartLine;
1343 int AnsiMode;
1344 int TableNum;
1345 DWORD Options;
1346 int TabSize;
1347 int BookMarkCount;
1348 DWORD CurState;
1349 DWORD Reserved[6];
1352 struct EditorBookMarks
1354 long *Line;
1355 long *Cursor;
1356 long *ScreenLine;
1357 long *LeftPos;
1358 DWORD Reserved[4];
1361 struct EditorSetPosition
1363 int CurLine;
1364 int CurPos;
1365 int CurTabPos;
1366 int TopScreenLine;
1367 int LeftPos;
1368 int Overtype;
1372 struct EditorSelect
1374 int BlockType;
1375 int BlockStartLine;
1376 int BlockStartPos;
1377 int BlockWidth;
1378 int BlockHeight;
1382 struct EditorConvertText
1384 char *Text;
1385 int TextLength;
1389 struct EditorConvertPos
1391 int StringNumber;
1392 int SrcPos;
1393 int DestPos;
1397 enum EDITORCOLORFLAGS
1399 ECF_TAB1 = 0x10000,
1402 struct EditorColor
1404 int StringNumber;
1405 int ColorItem;
1406 int StartPos;
1407 int EndPos;
1408 int Color;
1411 struct FarTrueColor
1413 unsigned char R;
1414 unsigned char G;
1415 unsigned char B;
1416 unsigned char Flags; // bit one - 'active' flag, others - ignored and must be set to zero
1419 struct EditorTrueColor
1421 struct EditorColor Base;
1422 struct FarTrueColor TrueFore;
1423 struct FarTrueColor TrueBack;
1426 struct EditorSaveFile
1428 char FileName[NM];
1429 char *FileEOL;
1432 typedef int (WINAPI *FARAPIEDITORCONTROL)(
1433 int Command,
1434 void *Param
1437 enum INPUTBOXFLAGS
1439 FIB_ENABLEEMPTY = 0x00000001,
1440 FIB_PASSWORD = 0x00000002,
1441 FIB_EXPANDENV = 0x00000004,
1442 FIB_NOUSELASTHISTORY = 0x00000008,
1443 FIB_BUTTONS = 0x00000010,
1444 FIB_NOAMPERSAND = 0x00000020,
1445 FIB_CHECKBOX = 0x00010000,
1446 FIB_EDITPATH = 0x01000000,
1449 typedef int (WINAPI *FARAPIINPUTBOX)(
1450 const char *Title,
1451 const char *SubTitle,
1452 const char *HistoryName,
1453 const char *SrcText,
1454 char *DestText,
1455 int DestLength,
1456 const char *HelpTopic,
1457 DWORD Flags
1460 // <C&C++>
1461 typedef int (WINAPIV *FARSTDSPRINTF)(char *Buffer,const char *Format,...);
1462 typedef int (WINAPIV *FARSTDSNPRINTF)(char *Buffer,size_t Sizebuf,const char *Format,...);
1463 typedef int (WINAPIV *FARSTDSSCANF)(const char *Buffer, const char *Format,...);
1464 // </C&C++>
1465 typedef void (WINAPI *FARSTDQSORT)(void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *));
1466 typedef void (WINAPI *FARSTDQSORTEX)(void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *,void *userparam),void *userparam);
1467 typedef void *(WINAPI *FARSTDBSEARCH)(const void *key, const void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *));
1468 typedef int (WINAPI *FARSTDGETFILEOWNER)(const char *Computer,const char *Name,char *Owner);
1469 typedef int (WINAPI *FARSTDGETNUMBEROFLINKS)(const char *Name);
1470 typedef int (WINAPI *FARSTDATOI)(const char *s);
1471 typedef int64_t(WINAPI *FARSTDATOI64)(const char *s);
1472 typedef char *(WINAPI *FARSTDITOA64)(int64_t value, char *string, int radix);
1473 typedef char *(WINAPI *FARSTDITOA)(int value, char *string, int radix);
1474 typedef char *(WINAPI *FARSTDLTRIM)(char *Str);
1475 typedef char *(WINAPI *FARSTDRTRIM)(char *Str);
1476 typedef char *(WINAPI *FARSTDTRIM)(char *Str);
1477 // truncation functions below uses console cells count as limiting unit
1478 typedef char *(WINAPI *FARSTDTRUNCSTR)(char *Str,int MaxCells);
1479 typedef char *(WINAPI *FARSTDTRUNCPATHSTR)(char *Str,int MaxCells);
1480 typedef char *(WINAPI *FARSTDQUOTESPACEONLY)(char *Str);
1481 typedef char*(WINAPI *FARSTDPOINTTONAME)(char *Path);
1482 typedef void (WINAPI *FARSTDGETPATHROOT)(const char *Path,char *Root);
1483 typedef BOOL (WINAPI *FARSTDADDENDSLASH)(char *Path);
1484 typedef int (WINAPI *FARSTDCOPYTOCLIPBOARD)(const char *Data);
1485 typedef char *(WINAPI *FARSTDPASTEFROMCLIPBOARD)(void);
1486 typedef FarKey (WINAPI *FARSTDINPUTRECORDTOKEY)(const INPUT_RECORD *r);
1487 typedef int (WINAPI *FARSTDLOCALISLOWER)(unsigned Ch);
1488 typedef int (WINAPI *FARSTDLOCALISUPPER)(unsigned Ch);
1489 typedef int (WINAPI *FARSTDLOCALISALPHA)(unsigned Ch);
1490 typedef int (WINAPI *FARSTDLOCALISALPHANUM)(unsigned Ch);
1491 typedef unsigned(WINAPI *FARSTDLOCALUPPER)(unsigned LowerChar);
1492 typedef unsigned(WINAPI *FARSTDLOCALLOWER)(unsigned UpperChar);
1493 typedef void (WINAPI *FARSTDLOCALUPPERBUF)(char *Buf,int Length);
1494 typedef void (WINAPI *FARSTDLOCALLOWERBUF)(char *Buf,int Length);
1495 typedef void (WINAPI *FARSTDLOCALSTRUPR)(char *s1);
1496 typedef void (WINAPI *FARSTDLOCALSTRLWR)(char *s1);
1497 typedef int (WINAPI *FARSTDLOCALSTRICMP)(const char *s1,const char *s2);
1498 typedef int (WINAPI *FARSTDLOCALSTRNICMP)(const char *s1,const char *s2,int n);
1500 enum PROCESSNAME_FLAGS
1502 PN_CMPNAME = 0x00000000UL,
1503 PN_CMPNAMELIST = 0x00001000UL,
1504 PN_GENERATENAME = 0x00002000UL,
1505 PN_SKIPPATH = 0x00100000UL,
1508 typedef int (WINAPI *FARSTDPROCESSNAME)(const char *param1, char *param2, DWORD flags);
1510 typedef void (WINAPI *FARSTDUNQUOTE)(char *Str);
1512 typedef DWORD (WINAPI *FARSTDEXPANDENVIRONMENTSTR)(
1513 const char *src,
1514 char *dst,
1515 size_t size
1518 enum XLATMODE
1520 XLAT_SWITCHKEYBLAYOUT = 0x00000001UL, // unsupported
1521 XLAT_SWITCHKEYBBEEP = 0x00000002UL, // unsupported
1522 XLAT_USEKEYBLAYOUTNAME = 0x00000004UL, // unsupported
1523 XLAT_CONVERTALLCMDLINE = 0x00010000UL, // deprecated
1526 typedef char*(WINAPI *FARSTDXLAT)(char *Line,int StartPos,int EndPos,const struct CharTableSet *TableSet,DWORD Flags);
1527 typedef BOOL (WINAPI *FARSTDKEYTOKEYNAME)(FarKey Key,char *KeyText,int Size);
1528 typedef FarKey (WINAPI *FARSTDKEYNAMETOKEY)(const char *Name);
1530 typedef int (WINAPI *FRSUSERFUNC)(
1531 const WIN32_FIND_DATAA *FData,
1532 const char *FullName,
1533 void *Param
1536 enum FRSMODE
1538 FRS_RETUPDIR = 0x01,
1539 FRS_RECUR = 0x02,
1540 FRS_SCANSYMLINK = 0x04,
1543 typedef void (WINAPI *FARSTDRECURSIVESEARCH)(const char *InitDir,const char *Mask,FRSUSERFUNC Func,DWORD Flags,void *Param);
1544 typedef char*(WINAPI *FARSTDMKTEMP)(char *Dest,const char *Prefix);
1545 typedef void (WINAPI *FARSTDDELETEBUFFER)(void *Buffer);
1547 enum MKLINKOP
1549 FLINK_HARDLINK = 1,
1550 FLINK_JUNCTION = 2,
1551 FLINK_SYMLINK = FLINK_JUNCTION,
1552 FLINK_VOLMOUNT = 3,
1553 FLINK_SYMLINKFILE = 4,
1554 FLINK_SYMLINKDIR = 5,
1556 FLINK_SHOWERRMSG = 0x10000,
1557 FLINK_DONOTUPDATEPANEL = 0x20000,
1559 typedef int (WINAPI *FARSTDMKLINK)(const char *Src,const char *Dest,DWORD Flags);
1560 typedef int (WINAPI *FARCONVERTNAMETOREAL)(const char *Src,char *Dest, int DestSize);
1561 typedef int (WINAPI *FARGETREPARSEPOINTINFO)(const char *Src,char *Dest,int DestSize);
1563 enum EXECUTEFLAGS
1565 EF_HIDEOUT = 0x01, // dont display output of the command
1566 EF_NOWAIT = 0x02, // dont wait for command completion
1567 EF_SUDO = 0x04, // command must be run with root privileges
1568 EF_NOTIFY = 0x08, // notify when command completed (if such notifications enabled in settings)
1569 EF_NOCMDPRINT = 0x10, // dont print command in command line nor include it to history
1570 EF_OPEN = 0x20 // use desktop shell (if present) to open command (e.g. URLs, documents..)
1573 typedef int (WINAPI *FAREXECUTE)(const char *CmdStr, unsigned int ExecFlags);
1574 typedef int (WINAPI *FAREXECUTE_LIBRARY)(const char *Library, const char *Symbol, const char *CmdStr, unsigned int ExecFlags);
1575 typedef void (WINAPI *FARDISPLAYNOTIFICATION)(const char *action, const char *object);
1576 typedef int (WINAPI *FARDISPATCHNTRTHRDCALLS)();
1577 // If plugin implements tasks running in background it may invoke this function to indicate about
1578 // pending task in left-top corner. Info is a short description of task or just its owner and must
1579 // be same string when invoked with Started TRUE or FALSE.
1580 typedef void (WINAPI *FARBACKGROUNDTASK)(const char *Info, BOOL Started);
1581 // Returns count of console cells which will be used to display given string of CharsCount characters.
1582 typedef size_t (WINAPI *FARSTRCELLSCOUNT)(const char *Str, size_t CharsCount);
1583 // Returns count of characters which will be used for fill up to *CellsCount cells from given string
1584 // of CharsCount characters.
1585 // RoundUp argument tells what to do with full-width characters that crossed by *CellsCount.
1586 // On return *CellsCount contains cells count that will be filled by returned characters count, that:
1587 // Can be smaller than initial value if string has too few characters to fill all *CellsCount cells
1588 // or if RoundUp was set to FALSE and last character would then overflow wanted amount.
1589 // Can be larger by one than initial value if RoundUp was set to TRUE and last full-width character
1590 // crossed initial value specified in *CellsCount.
1591 typedef size_t (WINAPI *FARSTRSIZEOFCELLS)(const char *Str, size_t CharsCount, size_t *CellsCount, BOOL RoundUp);
1593 typedef struct FarStandardFunctions
1595 int StructSize;
1597 FARSTDATOI atoi;
1598 FARSTDATOI64 atoi64;
1599 FARSTDITOA itoa;
1600 FARSTDITOA64 itoa64;
1601 // <C&C++>
1602 FARSTDSPRINTF sprintf;
1603 FARSTDSSCANF sscanf;
1604 // </C&C++>
1605 FARSTDQSORT qsort;
1606 FARSTDBSEARCH bsearch;
1607 FARSTDQSORTEX qsortex;
1609 // <C&C++>
1610 FARSTDSNPRINTF snprintf;
1611 // </C&C++>
1613 DWORD_PTR Reserved[20];
1615 FARSTDUNQUOTE Unquote;
1616 FARSTDEXPANDENVIRONMENTSTR ExpandEnvironmentStr;
1617 FARSTDLTRIM LTrim;
1618 FARSTDRTRIM RTrim;
1619 FARSTDTRIM Trim;
1620 FARSTDTRUNCSTR TruncStr;
1621 FARSTDTRUNCPATHSTR TruncPathStr;
1622 FARSTDQUOTESPACEONLY QuoteSpaceOnly;
1623 FARSTDPOINTTONAME PointToName;
1624 FARSTDGETPATHROOT GetPathRoot;
1625 FARSTDADDENDSLASH AddEndSlash;
1626 FARSTDCOPYTOCLIPBOARD CopyToClipboard;
1627 FARSTDPASTEFROMCLIPBOARD PasteFromClipboard;
1628 FARSTDKEYTOKEYNAME FarKeyToName;
1629 FARSTDKEYNAMETOKEY FarNameToKey;
1630 FARSTDINPUTRECORDTOKEY FarInputRecordToKey;
1631 FARSTDXLAT XLat;
1632 FARSTDGETFILEOWNER GetFileOwner;
1633 FARSTDGETNUMBEROFLINKS GetNumberOfLinks;
1634 FARSTDRECURSIVESEARCH FarRecursiveSearch;
1635 FARSTDMKTEMP MkTemp;
1636 FARSTDDELETEBUFFER DeleteBuffer;
1637 FARSTDPROCESSNAME ProcessName;
1638 FARSTDMKLINK MkLink;
1639 FARCONVERTNAMETOREAL ConvertNameToReal;
1640 FARGETREPARSEPOINTINFO GetReparsePointInfo;
1641 FAREXECUTE Execute;
1642 FAREXECUTE_LIBRARY ExecuteLibrary;
1643 FARDISPLAYNOTIFICATION DisplayNotification;
1644 FARDISPATCHNTRTHRDCALLS DispatchInterThreadCalls;
1645 FARBACKGROUNDTASK BackgroundTask;
1646 FARSTRCELLSCOUNT StrCellsCount;
1647 FARSTRSIZEOFCELLS StrSizeOfCells;
1648 } FARSTANDARDFUNCTIONS;
1650 struct PluginStartupInfo
1652 int StructSize;
1653 char ModuleName[NM];
1654 INT_PTR ModuleNumber;
1655 const char *RootKey;
1657 FARAPIMENU Menu;
1658 FARAPIDIALOG Dialog;
1659 FARAPIMESSAGE Message;
1660 FARAPIGETMSG GetMsg;
1661 FARAPICONTROL Control;
1662 FARAPISAVESCREEN SaveScreen;
1663 FARAPIRESTORESCREEN RestoreScreen;
1664 FARAPIGETDIRLIST GetDirList;
1665 FARAPIGETPLUGINDIRLIST GetPluginDirList;
1666 FARAPIFREEDIRLIST FreeDirList;
1667 FARAPIVIEWER Viewer;
1668 FARAPIEDITOR Editor;
1669 FARAPICMPNAME CmpName;
1670 FARAPICHARTABLE CharTable;
1671 FARAPITEXT Text;
1672 FARAPIEDITORCONTROL EditorControl;
1674 FARSTANDARDFUNCTIONS *FSF;
1676 FARAPISHOWHELP ShowHelp;
1677 FARAPIADVCONTROL AdvControl;
1678 FARAPIINPUTBOX InputBox;
1679 FARAPIDIALOGEX DialogEx;
1680 FARAPISENDDLGMESSAGE SendDlgMessage;
1681 FARAPIDEFDLGPROC DefDlgProc;
1682 DWORD_PTR Reserved;
1683 FARAPIVIEWERCONTROL ViewerControl;
1687 enum PLUGIN_FLAGS
1689 PF_PRELOAD = 0x0001, // early dlopen and initialize plugin
1690 PF_DISABLEPANELS = 0x0002,
1691 PF_EDITOR = 0x0004,
1692 PF_VIEWER = 0x0008,
1693 PF_FULLCMDLINE = 0x0010,
1694 PF_DIALOG = 0x0020,
1695 PF_PREOPEN = 0x8000 // early dlopen plugin but initialize it later, when it will be really needed
1699 struct PluginInfo
1701 int StructSize;
1702 DWORD Flags;
1703 const char * const *DiskMenuStrings;
1704 int *DiskMenuNumbers;
1705 int DiskMenuStringsNumber;
1706 const char * const *PluginMenuStrings;
1707 int PluginMenuStringsNumber;
1708 const char * const *PluginConfigStrings;
1709 int PluginConfigStringsNumber;
1710 const char *CommandPrefix;
1711 DWORD SysID;
1715 struct InfoPanelLine
1717 char Text[80];
1718 char Data[80];
1719 int Separator;
1722 struct PanelMode
1724 char *ColumnTypes;
1725 char *ColumnWidths;
1726 char **ColumnTitles;
1727 int FullScreen;
1728 int DetailedStatus;
1729 int AlignExtensions;
1730 int CaseConversion;
1731 char *StatusColumnTypes;
1732 char *StatusColumnWidths;
1733 DWORD Reserved[2];
1737 enum OPENPLUGININFO_FLAGS
1739 OPIF_USEFILTER = 0x00000001,
1740 OPIF_USESORTGROUPS = 0x00000002,
1741 OPIF_USEHIGHLIGHTING = 0x00000004,
1742 OPIF_ADDDOTS = 0x00000008,
1743 OPIF_RAWSELECTION = 0x00000010,
1744 OPIF_REALNAMES = 0x00000020,
1745 OPIF_SHOWNAMESONLY = 0x00000040,
1746 OPIF_SHOWRIGHTALIGNNAMES = 0x00000080,
1747 OPIF_SHOWPRESERVECASE = 0x00000100,
1748 OPIF_COMPAREFATTIME = 0x00000400,
1749 OPIF_EXTERNALGET = 0x00000800,
1750 OPIF_EXTERNALPUT = 0x00001000,
1751 OPIF_EXTERNALDELETE = 0x00002000,
1752 OPIF_EXTERNALMKDIR = 0x00004000,
1753 OPIF_USEATTRHIGHLIGHTING = 0x00008000,
1757 enum OPENPLUGININFO_SORTMODES
1759 SM_DEFAULT,
1760 SM_UNSORTED,
1761 SM_NAME,
1762 SM_EXT,
1763 SM_MTIME,
1764 SM_CTIME,
1765 SM_ATIME,
1766 SM_SIZE,
1767 SM_DESCR,
1768 SM_OWNER,
1769 SM_COMPRESSEDSIZE,
1770 SM_NUMLINKS
1774 struct KeyBarTitles
1776 char *Titles[12];
1777 char *CtrlTitles[12];
1778 char *AltTitles[12];
1779 char *ShiftTitles[12];
1781 char *CtrlShiftTitles[12];
1782 char *AltShiftTitles[12];
1783 char *CtrlAltTitles[12];
1787 enum OPERATION_MODES
1789 OPM_SILENT =0x0001,
1790 OPM_FIND =0x0002,
1791 OPM_VIEW =0x0004,
1792 OPM_EDIT =0x0008,
1793 OPM_TOPLEVEL =0x0010,
1794 OPM_DESCR =0x0020,
1795 OPM_QUICKVIEW =0x0040,
1796 OPM_PGDN =0x0080,
1797 OPM_COMMANDS =0x0100,
1800 struct OpenPluginInfo
1802 int StructSize;
1803 DWORD Flags;
1804 const char *HostFile;
1805 const char *CurDir;
1806 const char *Format;
1807 const char *PanelTitle;
1808 const struct InfoPanelLine *InfoLines;
1809 int InfoLinesNumber;
1810 const char * const *DescrFiles;
1811 int DescrFilesNumber;
1812 const struct PanelMode *PanelModesArray;
1813 int PanelModesNumber;
1814 int StartPanelMode;
1815 int StartSortMode;
1816 int StartSortOrder;
1817 const struct KeyBarTitles *KeyBar;
1818 const char *ShortcutData;
1819 long Reserved;
1822 enum OPENPLUGIN_OPENFROM
1824 OPEN_DISKMENU = 0,
1825 OPEN_PLUGINSMENU = 1,
1826 OPEN_FINDLIST = 2,
1827 OPEN_SHORTCUT = 3,
1828 OPEN_COMMANDLINE = 4,
1829 OPEN_EDITOR = 5,
1830 OPEN_VIEWER = 6,
1831 OPEN_FILEPANEL = 7,
1832 OPEN_DIALOG = 8,
1833 OPEN_FROMMACRO = 0x10000,
1836 enum FAR_PKF_FLAGS
1838 PKF_CONTROL = 0x00000001,
1839 PKF_ALT = 0x00000002,
1840 PKF_SHIFT = 0x00000004,
1841 PKF_PREPROCESS = 0x00080000, // for "Key", function ProcessKey()
1844 enum FAR_EVENTS
1846 FE_CHANGEVIEWMODE =0,
1847 FE_REDRAW =1,
1848 FE_IDLE =2,
1849 FE_CLOSE =3,
1850 FE_BREAK =4,
1851 FE_COMMAND =5,
1853 FE_GOTFOCUS =6,
1854 FE_KILLFOCUS =7,
1857 #ifndef _WIN64
1858 #ifdef __GNUC__
1859 #pragma pack()
1860 #else
1861 #pragma pack(pop)
1862 #endif
1863 #endif
1866 #endif // __FAR2SDK_FARPLUG_MB_H__