xmonad-contrib-0.13: Third party extensions for xmonad

Copyright | (c) 2010 Alejandro Serrano
License | BSD-style (see xmonad/LICENSE)
Maintainer | trupill@gmail.com
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

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 # |
Methods readsPrec :: Int -> ReadS Placement # readList :: ReadS [Placement] # readPrec :: ReadPrec Placement # readListPrec :: ReadPrec [Placement] #
Show Placement # |
Methods showsPrec :: Int -> Placement -> ShowS # show :: Placement -> String # showList :: [Placement] -> ShowS #

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