Drawable —
Drawing primitives.
drawArc:: DrawableClass d => d -> GC -> Bool -> Int -> Int -> Int -> Int -> Int -> Int -> IO () |
drawDrawable:: (DrawableClass dest, DrawableClass src) => dest -> GC -> src -> Int -> Int -> Int -> Int -> Int -> Int -> IO () |
drawLayout:: DrawableClass d => d -> GC -> Int -> Int -> PangoLayout -> IO () |
drawLayoutLine:: DrawableClass d => d -> GC -> Int -> Int -> LayoutLine -> IO () |
drawLayoutLineWithColors:: DrawableClass d => d -> GC -> Int -> Int -> LayoutLine -> Maybe Color -> Maybe Color -> IO () |
drawLayoutWithColors:: DrawableClass d => d -> GC -> Int -> Int -> PangoLayout -> Maybe Color -> Maybe Color -> IO () |
drawLine:: DrawableClass d => d -> GC -> Point -> Point -> IO () |
drawLines:: DrawableClass d => d -> GC -> [Point] -> IO () |
drawPixbuf:: DrawableClass d => d -> GC -> Pixbuf -> Int -> Int -> Int -> Int -> Int -> Int -> Dither -> Int -> Int -> IO () |
drawPoint:: DrawableClass d => d -> GC -> Point -> IO () |
drawPoints:: DrawableClass d => d -> GC -> [Point] -> IO () |
drawPolygon:: DrawableClass d => d -> GC -> Bool -> [Point] -> IO () |
drawRectangle:: DrawableClass d => d -> GC -> Bool -> Int -> Int -> Int -> Int -> IO () |
drawSegments:: DrawableClass d => d -> GC -> [(Point,Point)] -> IO () |
drawableGetClipRegion:: DrawableClass d => d -> IO Region |
drawableGetDepth:: DrawableClass d => d -> IO Int |
drawableGetSize:: DrawableClass d => d -> IO (Int,Int) |
drawableGetVisibleRegion:: DrawableClass d => d -> IO Region |
This module defines drawing primitives that can operate on DrawWindows, Pixmaps and Bitmaps.
if gdk_visuals are implemented, do: get_visual
if gdk_colormaps are implemented, do: set_colormap, get_colormap
add draw_glyphs if we are desparate
Draws an arc or a filled 'pie slice'.
| drawArc | :: d | :: GC | :: Bool | :: Int | :: Int | :: Int | :: Int | :: Int | :: Int | :: IO () |
| d | gc | filled | x | y | width | height | aStart | aEnd |
The arc is defined by the bounding rectangle of the entire ellipse, and the start and end angles of the part of the ellipse to be drawn.
The starting angle aStart is relative to the 3 o'clock position, counter-clockwise, in 1/64ths of a degree. aEnd is measured similarly, but relative to aStart.
Copies another Drawable.
| drawDrawable | :: dest | :: GC | :: src | :: Int | :: Int | :: Int | :: Int | :: Int | :: Int | :: IO () |
| dest | gc | src | xSrc | ySrc | xDest | yDest | width | height |
Copies the (width,height) region of the src at coordinates ( xSrc, ySrc) to coordinates ( xDest, yDest) in the dest. The width and/or height may be given as -1, in which case the entire source drawable will be copied.
Most fields in gc are not used for this operation, but notably the clip mask or clip region will be honored. The source and destination drawables must have the same visual and colormap, or errors will result. (On X11, failure to match visual/colormap results in a BadMatch error from the X server.) A common cause of this problem is an attempt to draw a bitmap to a color drawable. The way to draw a bitmap is to set the bitmap as a clip mask on your GC, then use drawRectangle to draw a rectangle clipped to the bitmap.
in that it uses the default colors from the graphics context. Draw a paragraph of text.
| drawLayout | :: d | :: GC | :: Int | :: Int | :: PangoLayout | :: IO () |
| d | gc | x | y | text |
The x and y values specify the upper left point of the layout.
in that it uses the default colors from the graphics context. Draw a single line of text.
| drawLayoutLine | :: d | :: GC | :: Int | :: Int | :: LayoutLine | :: IO () |
| d | gc | x | y | text |
The x coordinate specifies the start of the string, the y coordinate specifies the base line.
Draw a single line of text.
| drawLayoutLineWithColors | :: d | :: GC | :: Int | :: Int | :: LayoutLine | :: Maybe Color | :: Maybe Color | :: IO () |
| d | gc | x | y | text | foreground | background |
The x coordinate specifies the start of the string, the y coordinate specifies the base line.
If both colors are Nothing this function will behave like
Draw a paragraph of text.
| drawLayoutWithColors | :: d | :: GC | :: Int | :: Int | :: PangoLayout | :: Maybe Color | :: Maybe Color | :: IO () |
| d | gc | x | y | text | foreground | background |
The x and y values specify the upper left point of the layout.
If both colors are Nothing this function will behave like
Draw a line into a Drawable.
| drawLine | :: d | :: GC | :: Point | :: Point | :: IO () |
| d | gc | (x1, y1) | (x2, y2) |
The parameters are x1, y1, x2, y2.
Drawing several separate lines can be done more efficiently by drawSegments.
Draw several lines.
| drawLines | :: d | :: GC | :: [Point] | :: IO () |
| d | gc | points | ||
| d | gc | [] |
The function uses the current line width, dashing and especially the joining specification in the graphics context (in contrast to drawSegments.
Render a Pixbuf.
| drawPixbuf | :: d | :: GC | :: Pixbuf | :: Int | :: Int | :: Int | :: Int | :: Int | :: Int | :: Dither | :: Int | :: Int | :: IO () |
| d | gc | pb | srcX | srcY | destX | destY | srcWidth | srcHeight | dither | xDither | yDither |
Renders a rectangular portion of a Pixbuf to a Drawable. The srcX, srcY, srcWidth and srcHeight specify what part of the Pixbuf should be rendered. The latter two values may be -1 in which case the width and height are taken from pb. The image is placed at destX, destY. If you render parts of an image at a time, set ditherX and ditherY to the origin of the image you are rendering.
Since 2.2.
Draw several points into a Drawable.
| drawPoints | :: d | :: GC | :: [Point] | :: IO () |
| d | gc | points | ||
| d | gc | [] |
This function is more efficient than calling drawPoint on several points.
Draws an outlined or filled polygon.
| drawPolygon | :: d | :: GC | :: Bool | :: [Point] | :: IO () |
| d | gc | filled | points | ||
| _ | _ | _ | [] |
The polygon is closed automatically, connecting the last point to the first point if necessary.
Draw a rectangular object.
| drawRectangle | :: d | :: GC | :: Bool | :: Int | :: Int | :: Int | :: Int | :: IO () |
| d | gc | filled | x | y | width | height |
Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of the GC.
A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined. Calling drawRectangle w gc True 0 0 20 20 results in a filled rectangle 20 pixels wide and 20 pixels high. Calling drawRectangle d gc False 0 0 20 20 results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high.
Draw several unconnected lines.
| drawSegments | :: d | :: GC | :: [(Point,Point)] | :: IO () |
| d | gc | pps | ||
| d | gc | [] |
This method draws several unrelated lines.
Determine where not to draw.
| drawableGetClipRegion | :: d | :: IO Region |
| d |
Computes the region of a drawable that potentially can be written to by drawing primitives. This region will not take into account the clip region for the GC, and may also not take into account other factors such as if the window is obscured by other windows, but no area outside of this region will be affected by drawing primitives.
Get the size of pixels.
| drawableGetDepth | :: d | :: IO Int |
| d |
Returns the number of bits which are use to store information on each pixels in this Drawable.
Retrieve the size of the Drawable.
| drawableGetSize | :: d | :: IO (Int,Int) |
| d |
The result might not be up-to-date if there are still resizing messages to be processed.