xmonad-contrib-0.18.0: Community-maintained extensions for xmonad

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 | None
Language | Haskell2010

XMonad.Layout.DecorationEx.Geometry

Description

This module defines `DecorationGeometry` type class, and default implementation for it.

Synopsis

- class (Read (geom a), Show (geom a), Eq a) => DecorationGeometry (geom :: Type -> Type) 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 {
  - gDecorationHeight :: Dimension
  }

# Documentation

class (Read (geom a), Show (geom a), Eq a) => DecorationGeometry (geom :: Type -> Type) a where #

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.

Minimal complete definition

describeGeometry, pureDecoration

Methods

describeGeometry :: geom a -> String #

Give a name to decoration geometry implementation.

shrinkWindow :: geom a -> Rectangle -> Rectangle -> Rectangle #

Reduce original window size to make space for decoration, if necessary.

pureDecoration #

Arguments

:: 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.

decorateWindow #

Arguments

:: 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

Instances details

DecorationGeometry DwmGeometry Window # |

Instance details

Defined in XMonad.Layout.DecorationEx.DwmGeometry

Methods

describeGeometry :: DwmGeometry Window -> String #

shrinkWindow :: DwmGeometry Window -> Rectangle -> Rectangle -> Rectangle #

pureDecoration :: DwmGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> Maybe Rectangle #

decorateWindow :: DwmGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> X (Maybe Rectangle) #

Eq a => DecorationGeometry DefaultGeometry a # |

Instance details

Defined in XMonad.Layout.DecorationEx.Geometry

Methods

describeGeometry :: DefaultGeometry a -> String #

shrinkWindow :: DefaultGeometry a -> Rectangle -> Rectangle -> Rectangle #

pureDecoration :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle #

decorateWindow :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle) #

DecorationGeometry TabbedGeometry Window # |

Instance details

Defined in XMonad.Layout.DecorationEx.TabbedGeometry

Methods

describeGeometry :: TabbedGeometry Window -> String #

shrinkWindow :: TabbedGeometry Window -> Rectangle -> Rectangle -> Rectangle #

pureDecoration :: TabbedGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> Maybe Rectangle #

decorateWindow :: TabbedGeometry Window -> Rectangle -> Stack Window -> [(Window, Rectangle)] -> (Window, Rectangle) -> X (Maybe Rectangle) #

newtype DefaultGeometry a #

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.

Constructors

DefaultGeometry |

Fields

- gDecorationHeight :: Dimension

#### Instances

Instances details

Eq a => DecorationGeometry DefaultGeometry a # |

Instance details

Defined in XMonad.Layout.DecorationEx.Geometry

Methods

describeGeometry :: DefaultGeometry a -> String #

shrinkWindow :: DefaultGeometry a -> Rectangle -> Rectangle -> Rectangle #

pureDecoration :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle #

decorateWindow :: DefaultGeometry a -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle) #

Read (DefaultGeometry a) # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods readsPrec :: Int -> ReadS (DefaultGeometry a) # readList :: ReadS [DefaultGeometry a] # readPrec :: ReadPrec (DefaultGeometry a) # readListPrec :: ReadPrec [DefaultGeometry a] #
Show (DefaultGeometry a) # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods showsPrec :: Int -> DefaultGeometry a -> ShowS # show :: DefaultGeometry a -> String # showList :: [DefaultGeometry a] -> ShowS #
Default (DefaultGeometry a) # |
Instance details Defined in XMonad.Layout.DecorationEx.Geometry Methods def :: DefaultGeometry a #