dzen-utils-0.1.1: Utilities for creating inputs for dzen.

Portabilitysemi-portable (uses MPTC and type families)
Stabilityexperimental
Maintainerfelipe.lessa@gmail.com
Safe HaskellSafe-Infered

System.Dzen.Graphics

Contents

Description

Support for the graphical abilities of dzen. Unfortunately this is not the strongest are of dzen, so there isn't a lot of functionality here, but there are "bindings" for every function they provide.

You can draw:

icons
With icon (see dzen documentation about formats and paths).
rectanges
With rect and rectO.
circles
With circ and circO.

Although it may seem that you can draw anything with the rectangle primitive (i.e. in the worst case just use 1x1 rectangles to simulate pixels), dzen does not allow you to control the y part of the shapes, only the x part (using pos and absPos): they are always vertically centered.

Synopsis

Data types

These data types are used to hint the purpose of each argument, making the type signatures more clear.

Icons

icon :: FilePath -> DStringSource

Draws an icon.

Shapes

rect :: Width -> Height -> DStringSource

rect w h draws and fills a rectangle of width w and height h. The rectangle is vertically centered (that is, if h == 1 then it is a centered line, something like ----).

rectO :: Width -> Height -> DStringSource

Like rect, but only draws and does not fills (i.e. draws an outline).

circ :: Radius -> DStringSource

circ r draws and fils a circle of radius r, also vertically centered.

circO :: Radius -> DStringSource

Like circ, but does not fills.

Positioning

pos :: Int -> DStringSource

pos p moves the position of the next input p pixels to the right. Note that p may be negative, effectively moving to the right.

absPos :: Int -> DStringSource

absPos p moves the position of the next input to be exactly p pixels to the right of the initial position. This should be used with care.

Misc

ignoreBg :: Transform a => Bool -> a -> aSource

If True, the transformed DString or Printer will ignore the background colour (i.e. it will draw over what was already drawn). The default is False, the background colour is used.