PluginInfo

Far Manager

PluginInfo

The PluginInfo structure describes a FAR Manager plugin.
struct PluginInfo
{
  int StructSize;
  DWORD Flags;
  const char * const *DiskMenuStrings;
  int *DiskMenuNumbers;
  int DiskMenuStringsNumber;
  const char * const *PluginMenuStrings;
  int PluginMenuStringsNumber;
  const char * const *PluginConfigStrings;
  int PluginConfigStringsNumber;
  const char *CommandPrefix;
  DWORD Reserved;
};

Elements

StructSize
This field should contain the size of the PluginInfo structure.
Flags
A combination of the following values (the PLUGIN_FLAGS enumeration).
FlagDescription
PF_PRELOAD Disables plugin parameters caching and forces FAR to always load the plugin at startup. Must be specified if it is necessary to change items in "Disks", "Plugins" or "Plugins configuration" menus dynamically. This flag decreases efficiency of memory usage.
PF_DISABLEPANELS Do not show the plugin in the "Plugin commands" menu called from panels.
PF_EDITOR Show the plugin in the "Plugin commands" menu called from the FAR editor.
PF_VIEWER Show the plugin in the "Plugin commands" menu called from the FAR viewer.
PF_DIALOG Show the plugin in the "Plugin commands" menu called from the FAR dialog.
PF_FULLCMDLINE Forces FAR to pass the full command line (with the prefix CommandPrefix) to the plugin. Use this flag when a plugin can handle multiple command line prefixes.
DiskMenuStrings
If the plugin adds items to the Disks menu, this field is set to the address of an array with pointers to menu items, otherwise set it to NULL.
DiskMenuNumbers
Preferred hotkey numbers for the items added to the Disks menu. To have FAR autoassign them, either set DiskMenuNumbers to NULL or set preferred numbers to 0.
If specified number is already in use by another plugin, FAR reassigns it itself.
DiskMenuStringsNumber
Number of items to be added to the Disks menu.
PluginMenuStrings
Similar to DiskMenuStrings, but items are added to the "Plugin commands" menu.
PluginMenuStringsNumber
Number of items to be added to the "Plugin commands" menu.
PluginConfigStrings
Similar to DiskMenuStrings, but items are added to the "Plugins configuration" menu.
PluginConfigStringsNumber
Numer of items to be added to the "Plugins configuration" menu.
CommandPrefix
This parameter can contain a string of command line prefixes that will be used to intercept FAR commands. For example, if the string passed in this field is ftp and the user enters anything beginning with ftp: in the command line, OpenPlugin with OPEN_COMMANDLINE will be called.
To define more than one prefix, the plugin must separate the prefixes with a colon. For example, if the plugin needs to process the edit:, goto: and view: prefixes, the string passed in this field should be to:
CommandPrefix="edit:view:goto";
If the plugin does not process FAR commands, set this parameter to NULL.
Reserved
Reserved for future use, should be set to NULL.

Remarks

  1. All data passed in this structure must be valid after returning from GetPluginInfo, therfore pointers to the stack are illegal, use static or global variables instead.
  2. The structure passed to the GetPluginInfo function, is preinitialized to zeros.
See also: