| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A module for writing easy layout modifiers, which do not define a layout in and of themselves, but modify the behavior of or add new functionality to other layouts. If you ever find yourself writing a layout which takes another layout as a parameter, chances are you should be writing a LayoutModifier instead! In case it is not clear, this module is not intended to help you configure xmonad, it is to help you write other extension modules. So get hacking! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Synopsis | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The LayoutModifier class is provided to help extension developers write easy layout modifiers. End users won't find much of interest here. =) To write a layout modifier using the LayoutModifier class, define a data type to represent the layout modification (storing any necessary state), define an instance of LayoutModifier, and export an appropriate function for applying the modifier. For example: data MyModifier a = MyModifier MyState deriving (Show, Read) instance LayoutModifier MyModifier a where -- override whatever methods from LayoutModifier you like modify :: l a -> ModifiedLayout MyModifier l a modify = ModifiedLayout (MyModifier initialState) When defining an instance of LayoutModifier, you are free to override as many or as few of the methods as you see fit. See the documentation below for specific information about the effect of overriding each method. Every method has a default implementation; an instance of LayoutModifier which did not provide a non-default implementation of any of the methods would simply act as the identity on any layouts to which it is applied. For more specific usage examples, see
and several others. You probably want to start by looking at some of the above examples; the documentation below is detailed but possibly confusing, and in many cases the creation of a LayoutModifier is actually quite simple. Important note: because of the way the LayoutModifier class is intended to be used, by overriding any of its methods and keeping default implementations for all the others, LayoutModifier methods should never be called explicitly. It is likely that such explicit calls will not have the intended effect. Rather, the LayoutModifier methods should only be called indirectly through the LayoutClass instance for ModifiedLayout, since it is this instance that defines the semantics of overriding the various LayoutModifier methods. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The LayoutModifier class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
class (Show (m a), Read (m a)) => LayoutModifier m a where | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data ModifiedLayout m l a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Produced by Haddock version 2.4.2 |