cairo_t
The cairo drawing context
cairoCreate(target)cairoStatus(cr)cairoSave(cr)cairoRestore(cr)cairoGetTarget(cr)cairoPushGroup(cr)cairoPushGroupWithContent(cr, content)cairoPopGroup(cr)cairoPopGroupToSource(cr)cairoGetGroupTarget(cr)cairoSetSourceRgb(cr, red, green, blue)cairoSetSourceRgba(cr, red, green, blue, alpha)cairoSetSource(cr, source)cairoSetSourceSurface(cr, surface, x, y)cairoGetSource(cr)cairoSetAntialias(cr, antialias)cairoGetAntialias(cr)cairoSetDash(cr, dashes, offset)cairoGetDashCount(cr)cairoGetDash(cr)cairoSetFillRule(cr, fill.rule)cairoGetFillRule(cr)cairoSetLineCap(cr, line.cap)cairoGetLineCap(cr)cairoSetLineJoin(cr, line.join)cairoGetLineJoin(cr)cairoSetLineWidth(cr, width)cairoGetLineWidth(cr)cairoSetMiterLimit(cr, limit)cairoGetMiterLimit(cr)cairoSetOperator(cr, op)cairoGetOperator(cr)cairoSetTolerance(cr, tolerance)cairoGetTolerance(cr)cairoClip(cr)cairoClipPreserve(cr)cairoClipExtents(cr)cairoResetClip(cr)cairoCopyClipRectangleList(cr)cairoFill(cr)cairoFillPreserve(cr)cairoFillExtents(cr)cairoInFill(cr, x, y)cairoMask(cr, pattern)cairoMaskSurface(cr, surface, surface.x, surface.y)cairoPaint(cr)cairoPaintWithAlpha(cr, alpha)cairoStroke(cr)cairoStrokePreserve(cr)cairoStrokeExtents(cr)cairoInStroke(cr, x, y)cairoCopyPage(cr)cairoShowPage(cr)cairoSetUserData(cr, key, user.data)cairoGetUserData(cr, key)cairo(target)
Cairo is the main object used when drawing with cairo. To
draw with cairo, you create a Cairo, set the target surface,
and drawing options for the Cairo, create shapes with
functions like cairoMoveTo and cairoLineTo, and then
draw shapes with cairoStroke or cairoFill.
Cairo's can be pushed to a stack via cairoSave.
They may then safely be changed, without loosing the current state.
Use cairoRestore to restore to the saved state.
CairoA Cairo contains the current state of the rendering device,
including coordinates of yet to be drawn shapes.
Cairo contexts, as Cairo objects are named, are central to
cairo and all drawing with cairo is always done to a Cairo
object.
Memory management of Cairo is done with
cairoReference() and cairoDestroy().
CairoRectangleA data structure for holding a rectangle.
Since 1.4
CairoRectangle is a transparent-type.
x[numeric] X coordinate of the left side of the rectangle
y[numeric] Y coordinate of the the top side of the rectangle
width[numeric] width of the rectangle
height[numeric] height of the rectangle
CairoRectangleListA data structure for holding a dynamically allocated
array of rectangles.
Since 1.4
CairoRectangleList is a transparent-type.
status[CairoStatus] Error status of the rectangle list
rectangles[CairoRectangle] list containing the rectangles
num_rectangles[integer] Number of rectangles in this list
cairo is the equivalent of cairoCreate.
CairoAntialiasSpecifies the type of antialiasing to do when rendering text or shapes.
defaultUse the default antialiasing for the subsystem and target device
noneUse a bilevel alpha mask
grayPerform single-color antialiasing (using shades of gray for black text on a white background, for example).
subpixelPerform antialiasing by taking advantage of the order of subpixel elements on devices such as LCD panels
CairoFillRuleCairoFillRule is used to select how paths are filled. For both
fill rules, whether or not a point is included in the fill is
determined by taking a ray from that point to infinity and looking
at intersections with the path. The ray can be in any direction,
as long as it doesn't pass through the end point of a segment
or have a tricky intersection such as intersecting tangent to the path.
(Note that filling is not actually implemented in this way. This
is just a description of the rule that is applied.)
The default fill rule is CAIRO_FILL_RULE_WINDING.
New entries may be added in future versions.
windingIf the path crosses the ray from left-to-right, counts +1. If the path crosses the ray from right to left, counts -1. (Left and right are determined from the perspective of looking along the ray from the starting point.) If the total count is non-zero, the point will be filled.
even-oddCounts the total number of intersections, without regard to the orientation of the contour. If the total number of intersections is odd, the point will be filled.
CairoLineCapSpecifies how to render the endpoints of the path when stroking.
The default line cap style is CAIRO_LINE_CAP_BUTT.
buttstart(stop) the line exactly at the start(end) point
rounduse a round ending, the center of the circle is the end point
squareuse squared ending, the center of the square is the end point
CairoLineJoinSpecifies how to render the junction of two lines when stroking.
The default line join style is CAIRO_LINE_JOIN_MITER.
miter use a sharp (angled) corner, see
cairoSetMiterLimit
rounduse a rounded join, the center of the circle is the joint point
beveluse a cut-off join, the join is cut off at half the line width from the joint point
CairoOperatorCairoOperator is used to set the compositing operator for all cairo
drawing operations.
The default operator is CAIRO_OPERATOR_OVER.
The operators marked as unbounded modify their destination even outside of the mask layer (that is, their effect is not bound by the mask layer). However, their effect can still be limited by way of clipping.
To keep things simple, the operator descriptions here document the behavior for when both source and destination are either fully transparent or fully opaque. The actual implementation works for translucent layers too. For a more detailed explanation of the effects of each operator, including the mathematical definitions, see http://cairographics.org/operators/ (http://cairographics.org/operators/).
clearclear destination layer (bounded)
sourcereplace destination layer (bounded)
overdraw source layer on top of destination layer (bounded)
indraw source where there was destination content (unbounded)
outdraw source where there was no destination content (unbounded)
atopdraw source on top of destination content and only there
destignore the source
dest-overdraw destination on top of source
dest-inleave destination only where there was source content (unbounded)
dest-outleave destination only where there was no source content
dest-atopleave destination on top of source content and only there (unbounded)
xorsource and destination are shown where there is only one of them
addsource and destination layers are accumulated
saturatelike over, but assuming source and dest are disjoint geometries
Derived by RGtkGen from GTK+ documentation
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.