xmonad-contrib-0.11.1: Third party extensions for xmonad

Portability | unportable
Stability | unstable
Maintainer | trupill@gmail.com
Safe Haskell | None

XMonad.Util.Image

Contents

- Usage:

Description

Utilities for manipulating [[Bool]] as images

Synopsis

- data Placement
  - = OffsetLeft Int Int
  - | OffsetRight Int Int
  - | CenterLeft Int
  - | CenterRight Int
- iconPosition :: Rectangle -> Placement -> [[Bool]] -> (Position, Position)
- drawIcon :: (Functor m, MonadIO m) => Display -> Drawable -> GC -> String -> String -> Position -> Position -> [[Bool]] -> m ()

# Usage:

This module uses matrices of boolean values as images. When drawing them, a True value tells that we want the fore color, and a False value that we want the background color to be painted. In the module we suppose that those matrices are represented as [[Bool]], so the lengths of the inner lists must be the same.

See Xmonad.Layout.Decoration for usage examples

data Placement

Placement of the icon in the title bar

Constructors

OffsetLeft Int Int | An exact amount of pixels from the upper left corner
OffsetRight Int Int | An exact amount of pixels from the right left corner
CenterLeft Int | Centered in the y-axis, an amount of pixels from the left
CenterRight Int | Centered in the y-axis, an amount of pixels from the right

Instances

Read Placement |
Show Placement |

iconPosition :: Rectangle -> Placement -> [[Bool]] -> (Position, Position)

Return the `x` and `y` positions inside a `Rectangle` to start drawing the image given its `Placement`

drawIcon :: (Functor m, MonadIO m) => Display -> Drawable -> GC -> String -> String -> Position -> Position -> [[Bool]] -> m ()

Draw an image into a X surface