xmonad-contrib-0.18.1: 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 HaskellSafe-Inferred
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 Source #

Information about decoration of one window

Constructors

WindowDecoration 

Fields

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

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

Methods

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

Execute the command

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

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

Type class for decoration widgets

Associated Types

type WidgetCommand widget Source #

Type of window commands which this type of widgets can execute

Methods

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

Get window command which is associated with this widget.

isShrinkable :: widget -> Bool Source #

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) Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Widgets

Associated Types

type WidgetCommand (GenericWidget cmd) Source #

data WidgetPlace Source #

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

Defined in XMonad.Layout.DecorationEx.Common

data WidgetLayout a Source #

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

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

Methods

themeWidgets :: theme widget -> WidgetLayout widget Source #

Instances

Instances details
HasWidgets (GenericTheme style) widget Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

themeWidgets :: GenericTheme style widget -> WidgetLayout widget Source #

class ClickHandler theme widget where Source #

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

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

Arguments

:: theme widget 
-> Int

Mouse button number

-> Bool 

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

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

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

Associated Types

type Style theme Source #

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

Methods

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

Select style based on window state.

widgetsPadding :: theme -> BoxBorders Dimension Source #

Define padding between decoration rectangle and widgets.

defaultBgColor :: theme -> String Source #

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

themeFontName :: theme -> String Source #

Font name defined in the theme.

Instances

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

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) Source #

type XPaintingContext = (Display, Pixmap, GC) Source #

Painting context for decoration engines based on plain X11 calls.

data BoxBorders a Source #

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

Constructors

BoxBorders 

Fields

Instances

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

Defined in XMonad.Layout.DecorationEx.Common

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

Defined in XMonad.Layout.DecorationEx.Common

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

Defined in XMonad.Layout.DecorationEx.Common

Methods

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

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

type BorderColors = BoxBorders String Source #

Convinience data type describing colors of decoration rectangle borders.

data SimpleStyle Source #

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

Constructors

SimpleStyle 

Fields

Instances

Instances details
Read SimpleStyle Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Show SimpleStyle Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Default (WidgetCommand widget) => Default (ThemeEx widget) Source # 
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) Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) Source #

ClickHandler (GenericTheme SimpleStyle) widget Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle

data GenericTheme style widget Source #

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) Source # 
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) Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Associated Types

type Style (ThemeEx widget) Source #

ClickHandler (GenericTheme SimpleStyle) widget Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

HasWidgets (GenericTheme style) widget Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

Methods

themeWidgets :: GenericTheme style widget -> WidgetLayout widget Source #

(Read widget, Read (WidgetCommand widget), Read style) => Read (GenericTheme style widget) Source # 
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) Source # 
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) Source # 
Instance details

Defined in XMonad.Layout.DecorationEx.Common

type Style (ThemeEx widget) = SimpleStyle

type ThemeEx widget = GenericTheme SimpleStyle widget Source #

Convience type for themes used by TextDecoration.

Utilities

widgetLayout :: WidgetLayout widget -> [widget] Source #

Utility function to convert WidgetLayout to plain list of widgets.

windowStyleType :: Window -> X ThemeStyleType Source #

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

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

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

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

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