xmonad-contrib-0.15: 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 Source #

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 Source # |
Instance details Defined in XMonad.Util.Image Methods readsPrec :: Int -> ReadS Placement Source # readList :: ReadS [Placement] Source # readPrec :: ReadPrec Placement Source # readListPrec :: ReadPrec [Placement] Source #
Show Placement Source # |
Instance details Defined in XMonad.Util.Image Methods showsPrec :: Int -> Placement -> ShowS Source # show :: Placement -> String Source # showList :: [Placement] -> ShowS Source #

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

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

Draw an image into a X surface