Table of Contents

Class TreeLayoutPlugin

Namespace
Whim.TreeLayout
Assembly
Whim.TreeLayout.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public class TreeLayoutPlugin : ITreeLayoutPlugin, IPlugin
Inheritance
TreeLayoutPlugin
Implements
Inherited Members

Constructors

TreeLayoutPlugin(IContext)

Initializes a new instance of the TreeLayoutPlugin class.
public TreeLayoutPlugin(IContext context)

Parameters

context IContext

Properties

Name

whim.tree_layout
public string Name { get; }

Property Value

string

PluginCommands

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

Property Value

IPluginCommands

Remarks

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

Methods

GetAddWindowDirection(IMonitor)

Get the current direction for adding new windows to the tree layout for the given monitor. This will only work if the monitor's current workspace's active layout engine is or contains a tree layout engine.
public Direction? GetAddWindowDirection(IMonitor monitor)

Parameters

monitor IMonitor

Returns

Direction?

GetAddWindowDirection(TreeLayoutEngine)

Get the current direction for adding new windows to the tree layout for the given layout engine engine.
public Direction GetAddWindowDirection(TreeLayoutEngine engine)

Parameters

engine TreeLayoutEngine

Returns

Direction

LoadState(JsonElement)

Load the plugin's state from state.
public 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.
public 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)).
public void PreInitialize()

SaveState()

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

Returns

JsonElement?
The plugin's state.

SetAddWindowDirection(IMonitor, Direction)

Set the direction in which to add new windows to the tree layout for the given monitor. This will only work if the monitor's current workspace's active layout engine is or contains a tree layout engine.
public void SetAddWindowDirection(IMonitor monitor, Direction direction)

Parameters

monitor IMonitor
direction Direction

SetAddWindowDirection(TreeLayoutEngine, Direction)

Set the direction in which to add new windows to the tree layout for the given layout engine engine.
public void SetAddWindowDirection(TreeLayoutEngine engine, Direction direction)

Parameters

engine TreeLayoutEngine
direction Direction

Events

AddWindowDirectionChanged

Event raised when the direction in which to add new windows to the tree layout for a monitor changes.
public event EventHandler<AddWindowDirectionChangedEventArgs>? AddWindowDirectionChanged

Event Type

EventHandler<AddWindowDirectionChangedEventArgs>