Name

Region —

A set of rectangles describing areas to be redrawn.

Synopsis

newtype
        Region
regionNew:: IO Region
regionPolygon:: [Point] -> FillRule -> IO Region
regionRectangle:: Rectangle -> IO Region
regionCopy:: Region -> IO Region
regionEmpty:: Region -> IO Bool
regionEqual:: Region -> Region -> IO Bool
regionGetClipbox:: Region -> IO Rectangle
regionGetRectangles:: Region -> IO [Rectangle]

regionInterset <no type information>

regionOffset:: Region -> Int -> Int -> IO ()
regionPointIn:: Region -> Point -> IO Bool
regionRectIn:: Region -> Rectangle -> IO OverlapType
regionShrink:: Region -> Int -> Int -> IO ()
regionSubtract:: Region -> Region -> IO ()
regionUnionWithRect:: Region -> Rectangle -> IO ()
regionXor:: Region -> Region -> IO ()

Introduction

Regions consist of a set of non-overlapping rectangles. They are used to specify the area of a window which needs updating.

Todo

The Span functions and callbacks are not implemented since retrieving a set of rectangles and working on them within Haskell seems to be easier.

Datatypes

newtype Region

newtype Region =Region (ForeignPtr (Region))

Constructors

regionNew

Create an empty region.

regionNew

regionPolygon

Convert a polygon into a Region.

regionPolygon:: [Point]:: FillRule:: IO Region
pointsrule

regionRectangle

Convert a rectangle to a Region.

regionRectangle:: Rectangle:: IO Region
rect

Methods

regionCopy

Copy a Region.

regionCopy:: Region:: IO Region
r

regionEmpty

Test if a Region is empty.

regionEmpty:: Region:: IO Bool
r

regionEqual

Compares two Regions for equality.

regionEqual:: Region:: Region:: IO Bool
r1r2

regionGetClipbox

Smallest rectangle including the Region.

regionGetClipbox:: Region:: IO Rectangle
r

regionGetRectangles

Turn the Region into its rectangles.

regionGetRectangles:: Region:: IO [Rectangle]
r

A Region is a set of horizontal bands. Each band consists of one or more rectangles of the same height. No rectangles in a band touch.

no type info on symbol regionInterset

regionOffset

Move a region.

regionOffset:: Region:: Int:: Int:: IO ()
rdxdy

regionPointIn

Checks if a point it is within a region.

regionPointIn:: Region:: Point:: IO Bool
r(x, y)

regionRectIn

Check if a rectangle is within a region.

regionRectIn:: Region:: Rectangle:: IO OverlapType
regrect

regionShrink

Move a region.

regionShrink:: Region:: Int:: Int:: IO ()
rdxdy

Positive values shrink the region, negative values expand it.

regionSubtract

Removes pars of a Region.

regionSubtract:: Region:: Region:: IO ()
reg1reg2

Reduces the region reg1 so that is does not include any areas of reg2.

regionUnionWithRect

Updates the region to include the rectangle.

regionUnionWithRect:: Region:: Rectangle:: IO ()
regrect

regionXor

XORs two Regions.

regionXor:: Region:: Region:: IO ()
reg1reg2

The exclusive or of two regions contains all areas which were not overlapping. In other words, it is the union of the regions minus their intersections.