Region —
A set of rectangles describing areas to be redrawn.
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 () |
Regions consist of a set of non-overlapping rectangles. They are used to specify the area of a window which needs updating.
The Span functions and callbacks are not implemented since retrieving a set of rectangles and working on them within Haskell seems to be easier.
Convert a polygon into a Region.
| regionPolygon | :: [Point] | :: FillRule | :: IO Region |
| points | rule |
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.
Checks if a point it is within a region.
| regionPointIn | :: Region | :: Point | :: IO Bool |
| r | (x, y) |
Check if a rectangle is within a region.
| regionRectIn | :: Region | :: Rectangle | :: IO OverlapType |
| reg | rect |
Move a region.
| regionShrink | :: Region | :: Int | :: Int | :: IO () |
| r | dx | dy |
Positive values shrink the region, negative values expand it.
Removes pars of a Region.
| regionSubtract | :: Region | :: Region | :: IO () |
| reg1 | reg2 |
Reduces the region reg1 so that is does not include any areas of reg2.
Updates the region to include the rectangle.
| regionUnionWithRect | :: Region | :: Rectangle | :: IO () |
| reg | rect |
XORs two Regions.
| regionXor | :: Region | :: Region | :: IO () |
| reg1 | reg2 |
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.