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

Portabilitysemi-portable (uses MPTC and type families)
Safe HaskellSafe-Infered




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:

With icon (see dzen documentation about formats and paths).
With rect and rectO.
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.


Data types

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


icon :: FilePath -> DStringSource

Draws an icon.


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.


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.


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.