xmonad-contrib-0.18.1: 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 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.

Minimal complete definition

describeGeometry, pureDecoration

Methods

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.

pureDecoration Source #

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 Source #

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 Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.DwmGeometry

Methods

describeGeometry :: DwmGeometry Window -> String Source #

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

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

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

Eq a => DecorationGeometry DefaultGeometry a Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.Geometry

Methods

describeGeometry :: DefaultGeometry a -> String Source #

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

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

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

DecorationGeometry TabbedGeometry Window Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.TabbedGeometry

Methods

describeGeometry :: TabbedGeometry Window -> String Source #

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

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

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

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.

Constructors

DefaultGeometry |

Fields

- gDecorationHeight :: Dimension

#### Instances

Instances details

Eq a => DecorationGeometry DefaultGeometry a Source # |

Instance details

Defined in XMonad.Layout.DecorationEx.Geometry

Methods

describeGeometry :: DefaultGeometry a -> String Source #

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

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

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

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