FarNet — .NET Far API and .NET module manager

Анонсы новых плагинов. Обсуждение плагинов ведется ниже.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager

Post by NightRoman »

Latest post of the previous page:

http://code.google.com/p/farnet/

= 4.3.1 =

!! This time update manually (do not use Update-PowerShellFar.ps1).

ANNOUNCEMENT

It is discussed and decided that FarNet plugins are not called PLUGINS any more
everywhere: in API, code, documentation. From now on they are called MODULES:
.NET assemblies implementing one or more FarNet MODULE TOOLS.

The folders structure is changed, see Readme.txt or just extract from the
archive to %FARHOME% keeping the structure. Then remove old Lib (it is now
%FARHOME%\FarNet) and Plugins.NET (it is now %FARHOME%\FarNet\Modules).
Do not forget to replace %FARHOME%\Far.exe.config with new one.

TERMINOLOGY: PLUGINS -> MODULES
(breaking name changes)

Module tools:
-- BasePlugin -> BaseModule
-- CommandPlugin -> ModuleCommand
-- EditorPlugin -> ModuleEditor
-- FilerPlugin -> ModuleFiler
-- ToolPlugin -> ModuleTool
-- PluginException -> ModuleException

Interfaces:
-- IPanel -> IAnyPanel (rename it first, before IPluginPanel -> IPanel)
-- IPluginPanel -> IPanel (rename it second, after IPanel -> IAnyPanel)
-- IPluginPanelInfo -> IPanelInfo

Members:
-- GetPluginPanel() -> FindPanel()
-- CreatePluginPanel() -> CreatePanel()

Let's also fix wrong names and bad names:
-- EnvExpanded -> ExpandEnvironmentVariables
-- Eol -> EndOfLine
-- HWnd -> MainWindowHandle
-- Msg -> Message
-- NoSmartCoords -> NoSmartCoordinates
-- RootFar -> RegistryFarPath
-- RootKey -> RegistryPluginsPath
-- StartSortDesc -> StartReverseSortOrder
-- UseAttrHighlighting -> UseAttribiteHighlighting

Let's also fix one confusing feature:
-- InputBox.NoLastHistory -> UseLastHistory
a) to have the same name as the property of IEdit
b) because by default it should be "don't use" (the least surprise)

OTHER CHANGES

*) Macros:
-- IMacro.GetNames(): fixed exceptions on missed areas.
-- Macro.Area type changed from string to enum MacroArea.
-- IMacro methods use the enum MacroArea.
-- API changes: see documentation.

*) Issue _090208_042536. IBaseList: removed the obsolete workaround method
.Clear(). Instead, the method .Items.Clear() should be used. If it still has
problems, report, it will be restored ASAP. (It was a bug in PowerShell that
looks fixed in V2 RTM).
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.2 =

CUSTOM COLORS OF DIALOG CONTROLS

New event IControl.Coloring allows to set 1-4 custom colors depending on the
control type. PowerShellFar script Test-Dialog-.ps1 shows a few examples.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.3 =

*) Removed the ".NET" item from the disk menu. It is not used. Note: ".NET"
items in F11 menus, even empty, are used internally and cannot be removed.

*) FarColumn, SetColumn: Width changed type from 'string' to 'int':
positive: absolute width; negative: percentage; 0: Far decides.

*) Fix: "event" Invoking() was not always called for module tools.

*) IMacro: new method Check(). Far 2.0.1381+

*) IEditor: new option WriteByteOrderMark. Far 2.0.1384+

*) Tracing: too frequent events moved from mode 3 to 4 (see Far.exe.config).
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.4 =

*) [e]Bu$ter fixed a recent bug of FarColumn percentage (negative) widths.

*) IMacro.Check() should start to work correctly in Far 2.0.1386+
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.5 =

MAJOR ARCHITECTURE CHANGES

*) Module tool classes:
-- Module tool class instance is created for each call of its Invoke() method.
-- Virtual Connect()\Disconnect() are removed. Use ModuleHost if you need them.
-- Virtual properties are replaced with class attributes, see documentation and
sample modules. Each class has its own attribute class: e.g. ModuleXyzAttribute
for ModuleXyz class.
-- Attributes are mandatory. Empty ("default") names are not allowed any more.

*) Simplified access to IFar host. It is now 'Far.Net' anywhere. In your code:
-- Module classes: replace 'Far.' with 'Far.Net.';
-- Other code: you do not have to think of exposing IFar (e.g. sending it to
constructors or keeping it in a static variable), just use 'Far.Net' anywhere.

*) Simplified module manifest files (.cfg), see Readme.txt if you use them.

*) A few renamings, e.g. ToolOptions -> ModuleToolOptions, CommandEventArgs ->
ModuleCommandEventArgs, etc. New names describe themselves better.

*) These changes are breaking, indeed, and the modules should be updated.
If you have problems on loading after update try to drop the cache:
HKEY_CURRENT_USER\Software\Far2\Plugins\FarNet\<cache>

MINOR RELATED CHANGES

*) For a menu tool default Options value changed from 'AllMenus' to 'None'.
Thus, it is mandatory to specify Options, otherwise an item is not shown:
[ModuleTool(Name = "Hello", Options = ModuleToolOptions.Panels)]

*) Invoke() in some module tools: sender is null now, not IFar instance. It is
useless to send IFar because it is available as Far.Net anywhere.

*) Sample module Tutorial-Tool is replaced with Tutorial-Host. It still
contains the same sample module tool and a sample module host is added.
This host is not preloadable. Example of preloadable host is PSF.

OTHER CHANGES

*) IEditor: options WordDiv, ShowWhiteSpace, WriteByteOrderMark can be set
before (new!) or after opening the editor.

*) PanelModeInfo: new properties IsAlignedExtensions, IsCaseConversion.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.6 =

UPDATE STEPS

Remove the registry key "Far2\Plugins\FarNet" and make sure you do not start
old FarNet after that, otherwise you will get never used FarNet registry data.

MAIN CHANGES

*) All module items (actions and hosts) should have a Guid attribute. Generate
it once for each class or registered action and never change. But you can now
use any class or action names and change them as you want: registry data will
not be affected. All sample modules use these GUIDs.

N.B. Guid attribute is not absolutely mandatory, you can play in your local
sandbox without it. But if you publish a module, please, set these GUIDs.

*) Module actions: new attribute property Resources. If it is true the property
Name is the name of a resource string from the module .resources files.

*) All Register*\Unregister* methods moved from IFar to IModuleManager.

*) IFar: new methods GetModuleCommand, GetModuleFiler, GetModuleTool allow to
call an action of any module (loaded or not yet) from any other module.

*) Configuration menus and dialogs were changed a little bit. For tools we now
can set internal hotkeys (do not use standard Far hotkeys!). This is temporary,
hopefully Far will use GUIDs for menus, then module items will be able to use
standard Far hotkeys.

OTHER CHANGES

*) IControl: new property Data: user data (for FarNet controls only).

*) IAnyPanel: new method UnselectNames(), opposite to SelectNames().

*) Recommendation: how modules should keep their settings. IFar: removed
methods GetPluginValue(), SetPluginValue(), this place is not for modules.
Use new IModuleManager.OpenSubKey().
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.7 =

PROGRESS

*) Modules with dynamically added actions do not have to unregister them on
disconnection: they are unregistered automatically.

*) IMacro: added support for Consts and Vars areas.

*) Optimized module loading, unloading, caching.

*) Fixed crash on incorrect use of a listbox.

REFACTORING, BREAKING FOR SOME MODULES

*) Abstract registry access:
-- Removed properties IFar .RegistryFarPath, .RegistryPluginsPath.
-- Modules should not operate on the registry directly (though they can, of
course). They should access data via IRegistryKey returned by OpenRegistryKey()
of IModuleManager (normally) or IFar (only when really needed).
-- For Far Manager IRegistryKey works with the Windows registry, it is the
wrapper of Microsoft.Win32.RegistryKey. But modules should not rely on this.

*) IFar: window members moved to the operator:
Members GetWindowInfo, GetWindowType, SetCurrentWindow, WindowCount, and
WindowType moved to new window operator IFar.Window (and names adapted).

*) Type -> Kind:
The word 'Type' is replaced with 'Kind' in most cases. 'Type' should deal with
.NET System.Type class only. This change should reduce confusions and fix some
code analysis issues.
Renamed:
-- WindowType -> WindowKind, Type -> Kind, TypeName -> KindName
-- SelectionType -> RegionKind (and used more general 'Region')
-- FarColumn, SetColumn: Type -> Kind
-- ISelection.Type -> Kind
-- PanelType -> PanelKind
-- IAnyPanel.Type -> Kind
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.8 =

FarNet configuration dialog for a module tool allows to set a hotkey for the
.NET menus (as usual) and to disable\enable the default areas where the tool
menu items are shown (new feature). As a result, normally modules should not
care of these configuration settings, they are common for all modules and
configured by the core.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.9 =

Fixed a few configuration bugs of FarNet 4.3.8.

Disk menu: show just tool names with no .NET prefix and hotkeys.

Tutorial-Host sample module: used Options=AllAreas, for demo and testing sake.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.10 =

ACTION GUID

Guid attribute is now mandatory for module action classes (tools, commands,
editors, filers). Generate it, do not copy\paste it from some sample code :).

At the same time Guid attribute is not required for module host classes. It is
not an error to set it, it is just not used by FarNet. Each module host is well
identified by its module name, because module names have to be unique.

PANEL KEY PROCESSING

Preprocessing of panel keys is now done by the new event IPanel.KeyPressing.
As a result:
1) Event IPanel.KeyPressed is not called on this, KeyPressing is called;
2) Flag PanelKeyEventArgs.Preprocess was removed, it is not needed now.

Also, some misterious and\or annoying pseudo key events are filtered out
internally and panel key events are not called (e.g. KEY_NONE, KEY_IDLE,
KEY_KILLFOCUS, KEY_GOTFOCUS - some of them are not documented in Far API).

This change is breaking for panels using PanelKeyEventArgs.Preprocess. But it
makes processing of IPanel.KeyPressed simpler because in most cases panels are
not interested in preprocessing events. Thus, panels do not have to filter out
noise of preprocessing keys and pseudo keys.

Just in case, [e]Bu$ter's module "Windows7.Libraries" should work fine.

MINOR CHANGES

FarNet module tool config: minor issue: if a new version of an installed module
tool adds new menu areas then items may be not shown there by default if a user
had already modified the tool configuration. Fixed for new modules to come. Old
module tool settings may be updated manually when needed.

IFar: removed method ShowPanelMenu(), it is unlikely ever needed for modules.

Internal: impoved management of editor opening events.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.11 =

Changes are mostly internal, important for the future. They are not breaking if
modules do not use something not recommended.

FarNet host configuration: some settings in "Far.exe.config" are replaced with
environment variables, see Readme.txt for details. But normally you should use
default settings.

New DLLs are included into the FarNet package: FarNet.Works.*.dll. They contain
pure .NET host independent internal tools. They should not be used by modules
directly. They are used only by the FarNet host (actual Far plugin). In the
future they will be used by other FarNet hosts.

Some public API was extended. This should not affect modules and they should
not use it (marked "for internal use").

Related internal change: renamed namespace FarNet.Support into FarNet.Works; it
contains internal FarNet stuff that should not be used by modules.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.12 =

MASSIVE REVISION OF EDITOR AND EDITOR LINES
(breaking for modules working with editors)

As it was mentioned at the forum some time ago, API of editor and edit lines is
revised in this version. There are many changes, they are not listed in here,
everything is explained in the API documentation. Just two words: basic stuff
and principles are the same. But some "too smart" and practically not really
useful features were cut off. Some names were changed to be more informative.

Also, key and mouse events are split up: OnKey -> KeyDown, KeyUp; OnMouse ->
MouseClick, MouseDoubleClick, MouseMove, MouseWheel. Thus, now in many cases
handlers do not have to check event kinds.

NEW PANELS FEATURES
(new in Far API)

*) New property DirectoriesFirst (bool) ~ new sorting mode
*) New PanelSortMode values: StreamCount, StreamSize, FullName

OTHER CHANGES

Included two more internal .NET assemblies into the FarNet package.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.13 =

Technical build with some changes in the API documentation.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.14 =

Technical build. API is not changed.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.15 =

IDialog
-- New property IEnumerable<IControl> Controls
-- Breaking change: GetControl is replaced with the indexer [int]

IEditor
-- New method ChangeTitle: changes the title permanently.
This API may be changed or removed depending on Mantis 1334.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

Re: FarNet - .NET Far API and .NET module manager

Post by NightRoman »

http://code.google.com/p/farnet/

= 4.3.16 =

IEditor
-- Removed the workaround method ChangeTitle because Mantis 1334 was recently
resolved: the property .Title now changes the title permanently, null or empty
string restores the original title.

Module EditorKit
The module TrimSaving is replaced with a new module EditorKit. It contains:
-- TrimSaving (old) - trims line ends on saving;
-- ExpandTabsAll (new) - sets tabs expansion mode to 'All' for some files.
Notes:
-- Reminder: file types are configurable via FarNet configuration UI.
-- You may want to remove or rename this registry key:
HKEY_CURRENT_USER\Software\Far2\Plugins\FarNet\TrimSaving.dll
Post Reply

Return to “Анонсы новых плагинов”