Class ProxyFloatingLayoutEngine
- Namespace
- Whim.FloatingWindow
- Assembly
- Whim.FloatingWindow.dll
A proxy layout engine to allow windows to be free-floating within another layout.
public record ProxyFloatingLayoutEngine : BaseProxyLayoutEngine, ILayoutEngine, IEquatable<BaseProxyLayoutEngine>, IEquatable<ProxyFloatingLayoutEngine>
- Inheritance
-
ProxyFloatingLayoutEngine
- Implements
- Inherited Members
Constructors
ProxyFloatingLayoutEngine(IContext, IFloatingWindowPlugin, ILayoutEngine)
Creates a new instance of the proxy layout engine ProxyFloatingLayoutEngine.
public ProxyFloatingLayoutEngine(IContext context, IFloatingWindowPlugin plugin, ILayoutEngine innerLayoutEngine)
Parameters
contextIContextpluginIFloatingWindowPlugininnerLayoutEngineILayoutEngine
Properties
Count
The number of windows in the layout engine.
public override int Count { get; }
Property Value
FloatingWindowRects
The positions of the floating windows.
public ImmutableDictionary<IWindow, IRectangle<double>> FloatingWindowRects { get; }
Property Value
MinimizedWindowRects
The former positions of the minimized windows.
public ImmutableDictionary<IWindow, IRectangle<double>> MinimizedWindowRects { get; }
Property Value
Methods
AddWindow(IWindow)
Adds a
window to the layout engine.public override ILayoutEngine AddWindow(IWindow window)
Parameters
windowIWindow
Returns
- ILayoutEngine
- The new ILayoutEngine after the add.
ContainsWindow(IWindow)
Determines whether the layout engine contains the
window.public override bool ContainsWindow(IWindow window)
Parameters
windowIWindow
Returns
- bool
- True if the layout engine contains the
window, otherwise false.
DoLayout(IRectangle<int>, IMonitor)
Performs a layout inside the available
rectangle.public override IEnumerable<IWindowState> DoLayout(IRectangle<int> rectangle, IMonitor monitor)
Parameters
rectangleIRectangle<int>- The available area to do a layout inside.
monitorIMonitor- The monitor which the layout is being done for.
Returns
- IEnumerable<IWindowState>
- The layout result.
Remarks
For a given
rectangle, the layout engine should return the same
result every time.FocusWindowInDirection(Direction, IWindow)
Focuses the
window in the direction.
It's recommended that this method is not called directly, but rather
through dispatching FocusWindowInDirectionTransform.public override ILayoutEngine FocusWindowInDirection(Direction direction, IWindow window)
Parameters
Returns
GetFirstWindow()
Retrieves the first window in the layout engine.
public override IWindow? GetFirstWindow()
Returns
MinimizeWindowEnd(IWindow)
Called when a window is being unminimized - i.e., the window size will no longer be
Minimized.
The layout engine can choose to ignore this call, if it does not support unminimizing
windows.
public override ILayoutEngine MinimizeWindowEnd(IWindow window)
Parameters
windowIWindow
Returns
MinimizeWindowStart(IWindow)
Called when a window is being minimized - i.e., the window size will become
Minimized.
The layout engine can choose to ignore this call, if it does not support minimizing
windows.
public override ILayoutEngine MinimizeWindowStart(IWindow window)
Parameters
windowIWindow
Returns
MoveWindowEdgesInDirection(Direction, IPoint<double>, IWindow)
Moves the focused window's edges by the specified
deltas.public override ILayoutEngine MoveWindowEdgesInDirection(Direction edge, IPoint<double> deltas, IWindow window)
Parameters
edgeDirectiondeltasIPoint<double>- The deltas to change the given
edgesby. Thedeltasare in the range [0, 1] for both x and y (the unit square). windowIWindow
Returns
- ILayoutEngine
- The new ILayoutEngine after the move.
MoveWindowToPoint(IWindow, IPoint<double>)
Move the
window to the point.
The point has a coordinate space of [0, 1] for both x and y.public override ILayoutEngine MoveWindowToPoint(IWindow window, IPoint<double> point)
Parameters
Returns
- ILayoutEngine
- The new ILayoutEngine after the move.
PerformCustomAction<T>(LayoutEngineCustomAction<T>)
Attempts to trigger a custom action in a layout engine.
public override ILayoutEngine PerformCustomAction<T>(LayoutEngineCustomAction<T> action)
Parameters
actionLayoutEngineCustomAction<T>- Metadata about the action to perform, and the payload to perform it with.
Returns
- ILayoutEngine
- A new layout engine if the action is handled, otherwise it returns the current layout engine.
Type Parameters
T- The type of the
action's payload.
Remarks
This method is used to handle custom actions that are not part of the
ILayoutEngine interface.
For example, the SliceLayoutEngine uses this method to promote/demote windows in the
window stack.
RemoveWindow(IWindow)
Removes a
window from the layout engine.public override ILayoutEngine RemoveWindow(IWindow window)
Parameters
windowIWindow
Returns
- ILayoutEngine
- The new ILayoutEngine after the remove.
SwapWindowInDirection(Direction, IWindow)
Swaps the
window in the direction.
It's recommended that this method is not called directly, but rather
through duspatching SwapWindowInDirectionTransform.public override ILayoutEngine SwapWindowInDirection(Direction direction, IWindow window)
Parameters
Returns
- ILayoutEngine
- The new ILayoutEngine after the swap.