Copyright | (c) 2007 Andrea Rossato 2009 Jan Vornberger 2023 Ilya Portnov |
---|---|
License | BSD-style (see xmonad/LICENSE) |
Maintainer | portnov84@rambler.ru |
Stability | unstable |
Portability | unportable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module defines DecorationGeometry
type class, and default implementation for it.
Synopsis
- class (Read (geom a), Show (geom a), Eq a) => DecorationGeometry geom a where
- describeGeometry :: geom a -> String
- shrinkWindow :: geom a -> Rectangle -> Rectangle -> Rectangle
- pureDecoration :: geom a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle
- decorateWindow :: geom a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle)
- newtype DefaultGeometry a = DefaultGeometry {}
Documentation
class (Read (geom a), Show (geom a), Eq a) => DecorationGeometry geom a where Source #
Decoration geometry class. Decoration geometry is responsible for placement of window decorations: whether they should be on the top of the window or on the bottom, should they go for full window width or only be of certain width, etc. This does not know what will be drawn inside decorations.
describeGeometry :: geom a -> String Source #
Give a name to decoration geometry implementation.
shrinkWindow :: geom a -> Rectangle -> Rectangle -> Rectangle Source #
Reduce original window size to make space for decoration, if necessary.
:: geom a | Decoration geometry instance |
-> Rectangle | Screen rectangle |
-> Stack a | Current stack of windows being displayed |
-> [(a, Rectangle)] | Set of all windows with their corresponding rectangle |
-> (a, Rectangle) | Window being decorated and its rectangle |
-> Maybe Rectangle |
The pure version of the main method, decorate
.
The method should return a rectangle where to place window decoration,
or Nothing
if this window is not to be decorated.
:: geom a | Decoration geometry instance |
-> Rectangle | Screen rectangle |
-> Stack a | Current stack of windows being displayed |
-> [(a, Rectangle)] | Set of all windows with their corresponding rectangle |
-> (a, Rectangle) | Window being decorated and its rectangle |
-> X (Maybe Rectangle) |
The method should return a rectangle where to place window decoration,
or Nothing
if this window is not to be decorated.
Instances
newtype DefaultGeometry a Source #
Data type for default implementation of DecorationGeometry
.
This defines simple decorations: a horizontal bar at the top of each window,
running for full width of the window.