Table of Contents

Interface IPlugin

Namespace
Whim
Assembly
Whim.dll
A plugin for Whim.
public interface IPlugin

Properties

Name

Unique name of the plugin, in the snake case format of "author_name.plugin_name". The name must be unique among all plugins. The name will be used in the names of the commands from PluginCommands.
string Name { get; }

Property Value

string

PluginCommands

The commands and keybinds for this plugin. These are registered during PreInitialize().
IPluginCommands PluginCommands { get; }

Property Value

IPluginCommands

Remarks

Keybindings can be overridden by the user using SetKeybind(string, IKeybind).

Methods

LoadState(JsonElement)

Load the plugin's state from state.
void LoadState(JsonElement state)

Parameters

state JsonElement
The plugin's state.

Remarks

State is loaded after PostInitialize() and the user's configuration has been loaded. Thus, be careful on how you interact with the user's configuration.

PostInitialize()

This method is to be called by the plugin manager. Initializes the plugin after the rest of the IContext has been initialized. Put things which rely on the rest of the context here.
void PostInitialize()

PreInitialize()

This method is to be called by the plugin manager. Initializes the plugin before the IContext has been initialized. Put things like event listeners here or adding proxy layout engines (see AddProxyLayoutEngine(ProxyLayoutEngineCreator)).
void PreInitialize()

SaveState()

Save the plugin's state as a JsonElement.
JsonElement? SaveState()

Returns

JsonElement?
The plugin's state.