modifyLayout |
:: LayoutClass l a | | => m a | the layout modifier
| -> Workspace WorkspaceId (l a) a | current workspace
| -> Rectangle | screen rectangle
| -> X ([(a, Rectangle)], Maybe (l a)) | | modifyLayout allows you to intercept a call to runLayout
before it is called on the underlying layout, in order to
perform some effect in the X monad, and/or modify some of
the parameters before passing them on to the runLayout
method of the underlying layout.
The default implementation of modifyLayout simply calls
runLayout on the underlying layout.
|
|
|
handleMess :: m a -> SomeMessage -> X (Maybe (m a)) |
handleMess allows you to spy on messages to the underlying
layout, in order to have an effect in the X monad, or alter
the layout modifier state in some way (by returning Just
nm, where nm is a new modifier). In all cases, the
underlying layout will also receive the message as usual,
after the message has been processed by handleMess.
If you wish to possibly modify a message before it reaches
the underlying layout, you should use
handleMessOrMaybeModifyIt instead. If you do not need to
modify messages or have access to the X monad, you should use
pureMess instead.
The default implementation of handleMess calls unhook
when receiving a Hide or ReleaseResources method (after
which it returns Nothing), and otherwise passes the message
on to pureMess.
|
|
handleMessOrMaybeModifyIt :: m a -> SomeMessage -> X (Maybe (Either (m a) SomeMessage)) |
handleMessOrMaybeModifyIt allows you to intercept messages
sent to the underlying layout, in order to have an effect in
the X monad, alter the layout modifier state, or produce a
modified message to be passed on to the underlying layout.
The default implementation of handleMessOrMaybeModifyIt
simply passes on the message to handleMess.
|
|
pureMess :: m a -> SomeMessage -> Maybe (m a) |
pureMess allows you to spy on messages sent to the
underlying layout, in order to possibly change the layout
modifier state.
The default implementation of pureMess ignores messages
sent to it, and returns Nothing (causing the layout
modifier to remain unchanged).
|
|
redoLayout |
:: m a | the layout modifier
| -> Rectangle | screen rectangle
| -> Stack a | current window stack
| -> [(a, Rectangle)] | (window,rectangle) pairs returned
by the underlying layout
| -> X ([(a, Rectangle)], Maybe (m a)) | | redoLayout allows you to intercept a call to runLayout on
workspaces with at least one window, after it is called on
the underlying layout, in order to perform some effect in the
X monad, possibly return a new layout modifier, and/or
modify the results of runLayout before returning them.
If you don't need access to the X monad, use pureModifier
instead. Also, if the behavior you need can be cleanly
separated into an effect in the X monad, followed by a pure
transformation of the results of runLayout, you should
consider implementing hook and pureModifier instead of
redoLayout.
If you also need to perform some action when runLayout is
called on an empty workspace, see emptyLayoutMod.
The default implementation of redoLayout calls hook and
then pureModifier.
|
|
|
pureModifier |
:: m a | the layout modifier
| -> Rectangle | screen rectangle
| -> Stack a | current window stack
| -> [(a, Rectangle)] | (window, rectangle) pairs returned
by the underlying layout
| -> ([(a, Rectangle)], Maybe (m a)) | | pureModifier allows you to intercept a call to runLayout
after it is called on the underlying layout, in order to
modify the list of window/rectangle pairings it has returned,
and/or return a new layout modifier.
The default implementation of pureModifier returns the
window rectangles unmodified.
|
|
|
emptyLayoutMod :: m a -> Rectangle -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (m a)) |
emptyLayoutMod allows you to intercept a call to
runLayout on an empty workspace, after it is called on
the underlying layout, in order to perform some effect in the
X monad, possibly return a new layout modifier, and/or
modify the results of runLayout before returning them.
If you don't need access to the X monad, then tough luck.
There isn't a pure version of emptyLayoutMod.
The default implementation of emptyLayoutMod ignores its
arguments and returns an empty list of window/rectangle
pairings.
NOTE: emptyLayoutMod will likely be combined with
redoLayout soon!
|
|
hook :: m a -> X () |
hook is called by the default implementation of
redoLayout, and as such represents an X action which is to
be run each time runLayout is called on the underlying
layout, after runLayout has completed. Of course, if you
override redoLayout, then hook will not be called unless
you explicitly call it.
The default implementation of hook is return () (i.e., it
has no effect).
|
|
unhook :: m a -> X () |
unhook is called by the default implementation of
handleMess upon receiving a Hide or a ReleaseResources
message.
The default implementation, of course, does nothing.
|
|
modifierDescription :: m a -> String |
modifierDescription is used to give a String description to
this layout modifier. It is the empty string by default; you
should only override this if it is important that the
presence of the layout modifier be displayed in text
representations of the layout (for example, in the status bar
of a XMonad.Hooks.DynamicLog user).
|
|
modifyDescription :: LayoutClass l a => m a -> l a -> String |
modifyDescription gives a String description for the entire
layout (modifier + underlying layout). By default, it is
derived from the concatenation of the modifierDescription
with the description of the underlying layout, with a
"smart space" in between (the space is not included if the
modifierDescription is empty).
|