export.Open

LuaFAR 3

export.Open


ret = export.Open (OpenFrom, Guid, Item)

Definitions:
  "int64"
    Type of userdata, produced by bit64 library.
  "binary"
    By convention, it is a string enclosed in a table as its first element.
    The string is intended to be passed to and from without conversions UTF-8 <-> UTF-16LE.
  "panel"
    By convention, it is a panel handle (any non-false Lua value) enclosed in a table
    as its first element. The table must contain the field ["type"]="panel".

Parameters:
  OpenFrom: integer
  Guid:     string
  Item:
    if OpenFrom == OPEN_FROMMACRO:
      table (array of arguments):
      - each argument can be either of:
        string, nil, boolean, number, "int64", or "binary"
      - field n of the table holds the length of the array
    if OpenFrom == OPEN_COMMANDLINE:
      string
    if OpenFrom == OPEN_SHORTCUT:
      table:
        HostFile:     string
        ShortcutData: string
        Flags:        flags
    if OpenFrom == OPEN_DIALOG:
      table:
        hDlg: userdata
    if OpenFrom == OPEN_ANALYSE:
      table tAnalyseInfo
    if OpenFrom == something else:
      integer

Returns:
  if OpenFrom == OPEN_FROMMACRO:
    0 or more Lua values.
    Currently, values of the following types are supported:
        string, nil, boolean, number, "int64", "binary", or "panel".
    To open a panel, return a "panel" value as the first return value.
  if OpenFrom == something else:
    ret: any Lua value; it is processed by LuaFAR as follows:
    - Nil and false: NULL is returned to Far.
    - Number -1: PANEL_STOP is returned to Far.
    - Otherwise: ret is considered a panel object, stored in the Lua
      registry, its registry reference is returned to Far.
      The object is passed to other exported functions when they are
      called by Far.

Note:
  Return value of -1 can be used with OpenFrom == OPEN_ANALYSE,
  when the plugin does actions other than opening a panel, to tell
  Far that the file has already been processed.

Far API used:
  OpenW, OpenInfo