OpenPluginInfo
The OpenPluginInfo structure describes a plugin instance to FAR.
struct OpenPluginInfo { int StructSize; DWORD Flags; const char *HostFile; const char *CurDir; const char *Format; const char *PanelTitle; const struct InfoPanelLine *InfoLines; int InfoLinesNumber; const char * const *DescrFiles; int DescrFilesNumber; const struct PanelMode *PanelModesArray; int PanelModesNumber; int StartPanelMode; int StartSortMode; int StartSortOrder; const struct KeyBarTitles *KeyBar; const char *ShortcutData; long Reserverd; };
Elements
StructSize
This field should contain size of the OpenPluginInfo structure:
C: Opi.StructSize = sizeof (struct OpenPluginInfo);
Pascal: Opi.StructSize := SizeOf(Info);
Flags
A combination of the following values (the OPENPLUGININFO_FLAGS enumeration):
Flag | Description |
---|---|
OPIF_USEFILTER | Use filter in the plugin panel. |
OPIF_USESORTGROUPS | Use sort groups in the plugin panel. |
OPIF_USEHIGHLIGHTING | Use file highlighting in the plugin panel. |
OPIF_ADDDOTS | Add ".. " item automatically if it is absent. |
OPIF_RAWSELECTION | Folders may be selected regardless of FAR settings. |
OPIF_REALNAMES | Turns on the standard FAR file processing mechanism if requested operation is not supported by the plugin. If this flag is set, the items on the plugin panel should be real file names. |
OPIF_SHOWNAMESONLY | Show file names without paths by default. |
OPIF_SHOWRIGHTALIGNNAMES | Show file names right-aligned by default in all panel display modes. |
OPIF_SHOWPRESERVECASE | Show file names using original case regardless of FAR settings. |
OPIF_FINDFOLDERS | Apply "Find file" command for folders. The OPIF_FINDFOLDERS flag has no effect since FAR Manager 1.70 beta 4. |
OPIF_COMPAREFATTIME | Convert timestamps to FAT format for the Compare folders operation. Set this flag if the plugin file system doesn't provide the time accuracy necessary for standard comparison operations. |
OPIF_EXTERNALGET OPIF_EXTERNALPUT OPIF_EXTERNALDELETE OPIF_EXTERNALMKDIR |
These flags can be used with OPIF_REALNAMES only. Forces usage of corresponding internal FAR functions, even if plugin exports such function. |
OPIF_USEATTRHIGHLIGHTING |
FAR Manager 1.70 build #963 and below: use attribute-based file highlighting.
All file highlighting templates, except * and *.* will be ignored.FAR Manager 1.70 build #964 and above: use attributes only for file highlighting. File names will be ignored. Color is chosen from file color groups, which have templates excluded from analysis (i.e. option " [ ] Match file mask(s) " in file
highlighting setup dialog is off).
|
HostFile
File name on emulated file system. If plugin doesn't emulate a file system based on files,
set this field to
NULL
.CurDir
Current directory of plugin. If plugin returns empty string here, FAR will close plugin automatically
if ENTER is pressed on ".." item.
Format
Plugin's format name. This is shown in the file copy dialog.
PanelTitle
Plugin panel header.
InfoLines
Pointer to an array of InfoPanelLine structures.
Each structure describes one line in the information panel. If no plugin-dependent information needs to be shown in the
information panel, set this field to
NULL
.InfoLinesNumber
Number of structures in InfoPanelLine.
DescrFiles
Pointer to an array of pointers to strings with description file names.
FAR tries to read these files (using the GetFiles function)
when descriptions are shown and refresh them after file processing, if
the PPIF_PROCESSDESCR flag in the PluginPanelItem structure
was set. Depending on the plugin type, description processing can take significant time.
If you don't need this functionality, set the field to
NULL
.DescrFilesNumber
Number of description file names.
PanelModesArray
Pointer to an array of PanelMode structures.
Panel display mode settings can be redefined using this field.
The first structure describes display mode number 0, the second - number 1, etc.
If new panel display modes are not required, set the field to
NULL
.PanelModesNumber
Number of PanelMode structures.
StartPanelMode
The panel display mode to set on panel creation.
Must be in the form
'0'+<view mode number>
.
For example, '1' (0x31) will set Brief view mode. If you don't want to change panel display mode
at plugin startup, set the field to 0.StartSortMode
The sort mode to set on panel creation.
One of the following values can be specified:
SM_UNSORTED, SM_NAME, SM_EXT, SM_MTIME, SM_CTIME, SM_ATIME, SM_SIZE, SM_DESCR, SM_OWNER, SM_COMPRESSEDSIZE, SM_NUMLINKS.
If you don't want to change sort mode at plugin startup, set the field to SM_DEFAULT or 0.
StartSortOrder
If StartSortMode is specified, this field must be used
to set sort direction: 0 for ascending, 1 - for descedning.
KeyBar
Pointer to the KeyBarTitles structure.
Function key labels are redefined using this field.
Set to
NULL
if not required.ShortcutData
Pointer to a null-terminated string, which describes the current state of the plugin.
The length of string should be less than or equal to MAXSIZE_SHORTCUTDATA.
This string is passed to the OpenPlugin function,
when the plugin is activated by the link to folder command.
For example, an FTP client can place the server host name, login and password here.
The current directory is not required as FAR will restore this itself.
If no additional information is required for activation of links to a folder, set this field to
If no additional information is required for activation of links to a folder, set this field to
NULL
. Reserverd
Reserved for future use, set to 0.
Remarks
- All data, passed through this structure should be valid after return from the GetOpenPluginInfo function. This means, for example, that pointers to the stack are not allowed, use static or global variables instead.
- When this structure is passed to a plugin's GetOpenPluginInfo function, it can be assumed to be cleared to zeros.
See also: