xmonad-contrib-0.18.0: Community-maintained extensions for xmonad
Copyright(c) 2007 Andrea Rossato 2009 Jan Vornberger 2023 Ilya Portnov
LicenseBSD-style (see xmonad/LICENSE)
Maintainerportnov84@rambler.ru
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

XMonad.Layout.DecorationEx.Common

Description

This module exposes a number of types which are used by other sub-modules of XMonad.Layout.DecorationEx module.

Synopsis

Common types

data WindowDecoration #

Information about decoration of one window

Constructors

WindowDecoration 

Fields

class (Read cmd, Show cmd) => WindowCommand cmd where #

Type class for window commands (such as maximize or close window)

Methods

executeWindowCommand :: cmd -> Window -> X Bool #

Execute the command

isCommandChecked :: cmd -> Window -> X Bool #

Is the command currently in checked state. For example, for sticky command, check if the window is currently sticky.

class (WindowCommand (WidgetCommand widget), Read widget, Show widget) => DecorationWidget widget where #

Type class for decoration widgets

Associated Types

type WidgetCommand widget #

Type of window commands which this type of widgets can execute

Methods

widgetCommand :: widget -> Int -> WidgetCommand widget #

Get window command which is associated with this widget.

isShrinkable :: widget -> Bool #

Check if the widget is shrinkable, i.e. if it's width can be reduced if there is not enough place in the decoration.

Instances

Instances details
(Default cmd, Read cmd, Show cmd, WindowCommand cmd) => DecorationWidget (GenericWidget cmd) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Widgets

Associated Types

type WidgetCommand (GenericWidget cmd) 
Instance details

Defined in XMonad.Layout.DecorationEx.Widgets

type WidgetCommand (GenericWidget cmd) = cmd

data WidgetPlace #

Data type describing where the decoration widget (e.g. window button) should be placed. All coordinates are relative to decoration rectangle.

Constructors

WidgetPlace 

Fields

Instances

Instances details
Show WidgetPlace # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

data WidgetLayout a #

Layout of widgets

Constructors

WidgetLayout 

Fields

  • wlLeft :: ![a]

    Widgets that should be aligned to the left side of decoration

  • wlCenter :: ![a]

    Widgets that should be in the center of decoration

  • wlRight :: ![a]

    Widgets taht should be aligned to the right side of decoration

class HasWidgets (theme :: Type -> Type) widget where #

Type class for themes, which claims that the theme contains the list of widgets and their alignments.

Methods

themeWidgets :: theme widget -> WidgetLayout widget #

Instances

Instances details
HasWidgets (GenericTheme style) widget # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

themeWidgets :: GenericTheme style widget -> WidgetLayout widget #

class ClickHandler (theme :: Type -> Type) widget where #

Type class for themes, which claims that the theme can describe how the decoration should respond to clicks on decoration itself (between widgets).

Methods

onDecorationClick #

Arguments

:: theme widget 
-> Int

Mouse button number

-> Maybe (WidgetCommand widget) 

This is called when the user clicks on the decoration rectangle (not on one of widgets).

isDraggingEnabled #

Arguments

:: theme widget 
-> Int

Mouse button number

-> Bool 

Determine if it is possible to drag window by it's decoration with mouse button.

Instances

Instances details
ClickHandler (GenericTheme SimpleStyle) widget # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

class (Read theme, Show theme) => ThemeAttributes theme where #

Type class for themes, which claims that the theme is responsible for determining looks of decoration.

Associated Types

type Style theme #

Type which describes looks of decoration in one of window states (active, inactive, urgent, etc).

Methods

selectWindowStyle :: theme -> Window -> X (Style theme) #

Select style based on window state.

widgetsPadding :: theme -> BoxBorders Dimension #

Define padding between decoration rectangle and widgets.

defaultBgColor :: theme -> String #

Initial background color of decoration rectangle. When decoration widget is created, it is initially filled with this color.

themeFontName :: theme -> String #

Font name defined in the theme.

Instances

Instances details
(Show widget, Read widget, Read (WidgetCommand widget), Show (WidgetCommand widget)) => ThemeAttributes (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle

type XPaintingContext = (Display, Pixmap, GC) #

Painting context for decoration engines based on plain X11 calls.

data BoxBorders a #

Generic data type which is used to describe characteristics of rectangle borders.

Constructors

BoxBorders 

Fields

Instances

Instances details
Read a => Read (BoxBorders a) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Show a => Show (BoxBorders a) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Eq a => Eq (BoxBorders a) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

(==) :: BoxBorders a -> BoxBorders a -> Bool #

(/=) :: BoxBorders a -> BoxBorders a -> Bool #

type BorderColors = BoxBorders String #

Convinience data type describing colors of decoration rectangle borders.

data ThemeStyleType #

Supported states of windows (on which looks of decorations can depend).

data SimpleStyle #

Data type describing look of window decoration in particular state (active or inactive)

Constructors

SimpleStyle 

Fields

Instances

Instances details
Read SimpleStyle # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Show SimpleStyle # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Default (WidgetCommand widget) => Default (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

def :: ThemeEx widget #

(Show widget, Read widget, Read (WidgetCommand widget), Show (WidgetCommand widget)) => ThemeAttributes (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle
ClickHandler (GenericTheme SimpleStyle) widget # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle

data GenericTheme style widget #

Generic Theme data type. This is used by TextEngine and can be used by other relatively simple decoration engines.

Constructors

GenericTheme 

Fields

Instances

Instances details
Default (WidgetCommand widget) => Default (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

def :: ThemeEx widget #

(Show widget, Read widget, Read (WidgetCommand widget), Show (WidgetCommand widget)) => ThemeAttributes (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle
ClickHandler (GenericTheme SimpleStyle) widget # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

HasWidgets (GenericTheme style) widget # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

themeWidgets :: GenericTheme style widget -> WidgetLayout widget #

(Read widget, Read (WidgetCommand widget), Read style) => Read (GenericTheme style widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

readsPrec :: Int -> ReadS (GenericTheme style widget) #

readList :: ReadS [GenericTheme style widget] #

readPrec :: ReadPrec (GenericTheme style widget) #

readListPrec :: ReadPrec [GenericTheme style widget] #

(Show widget, Show (WidgetCommand widget), Show style) => Show (GenericTheme style widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

showsPrec :: Int -> GenericTheme style widget -> ShowS #

show :: GenericTheme style widget -> String #

showList :: [GenericTheme style widget] -> ShowS #

type Style (ThemeEx widget) # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle

type ThemeEx widget = GenericTheme SimpleStyle widget #

Convience type for themes used by TextDecoration.

Utilities

widgetLayout :: WidgetLayout widget -> [widget] #

Utility function to convert WidgetLayout to plain list of widgets.

windowStyleType :: Window -> X ThemeStyleType #

Detect type of style to be used from current state of the window.

genericWindowStyle :: Window -> GenericTheme style widget -> X style #

Generic utility function to select style from GenericTheme based on current state of the window.

themeEx :: Default (WidgetCommand widget) => Theme -> ThemeEx widget #

Convert Theme type from XMonad.Layout.Decoration to theme type used by XMonad.Layout.DecorationEx.TextEngine.