gocairo: github.com/evmar/gocairo/cairo Index | Files

package cairo

import "github.com/evmar/gocairo/cairo"

Package cairo wraps the Cairo graphics library.

http://cairographics.org/

Most functions are one-to-one with the corresponding Cairo functions. See the C documentation at http://cairographics.org/manual/ for details.

Subtyping

Though Cairo is a C API, it has a simple notion of subtypes; for example, an ImageSurface is a Surface with some extra methods.

These are implemented in the Go API as two separate types with embedding. Any method on a Surface can also be called on an ImageSurface (and similarly for Pattern and MeshPattern and so on). If a function expects a Surface as an argument and you have an ImageSurface, you must call it like foo(imageSurface.Surface).

Error Handling

Cairo's C API handles errors in a way similar to C's errno -- you're supposed to check for an error after making each Cairo call. But in practice the only errors Cairo can encounter are programmer errors, such as calling PopGroup() when you haven't called PushGroup() first.

Because of this, this library implicitly checks the error value after every call and panic()s on any error. The value passed to panic() is a cairo.Status which can be compared against various constants; it also implements Error so it can be stringified.

(There's a few places that still accidentally return an error, but those will be fixed.)

Index

Package Files

cairo.go doc.go path.go util.go

func SVGGetVersions Uses

func SVGGetVersions() []SVGVersion

See cairo_svg_get_versions().

C API documentation: http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-get-versions

func Version Uses

func Version() int

See cairo_version().

C API documentation: http://cairographics.org/manual/cairo-Version-Information.html#cairo-version

func VersionString Uses

func VersionString() string

See cairo_version_string().

C API documentation: http://cairographics.org/manual/cairo-Version-Information.html#cairo-version-string

type Antialias Uses

type Antialias int

See cairo_antialias_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t

const (
    AntialiasDefault  Antialias = C.CAIRO_ANTIALIAS_DEFAULT
    AntialiasNone     Antialias = C.CAIRO_ANTIALIAS_NONE
    AntialiasGray     Antialias = C.CAIRO_ANTIALIAS_GRAY
    AntialiasSubpixel Antialias = C.CAIRO_ANTIALIAS_SUBPIXEL
    AntialiasFast     Antialias = C.CAIRO_ANTIALIAS_FAST
    AntialiasGood     Antialias = C.CAIRO_ANTIALIAS_GOOD
    AntialiasBest     Antialias = C.CAIRO_ANTIALIAS_BEST
)

func (Antialias) String Uses

func (i Antialias) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Content Uses

type Content int

See cairo_content_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-content-t

const (
    ContentColor      Content = C.CAIRO_CONTENT_COLOR
    ContentAlpha      Content = C.CAIRO_CONTENT_ALPHA
    ContentColorAlpha Content = C.CAIRO_CONTENT_COLOR_ALPHA
)

func (Content) String Uses

func (i Content) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Context Uses

type Context struct {
    Ptr *C.cairo_t
}

See cairo_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-t

func BorrowContext Uses

func BorrowContext(p unsafe.Pointer) *Context

Construct a Context from a C cairo_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func Create Uses

func Create(target *Surface) *Context

See cairo_create().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-create

func WrapContext Uses

func WrapContext(p unsafe.Pointer) *Context

Wrap a C cairo_t* found from some external source as a *Context. The Go side will destroy the reference when it's no longer used.

func (*Context) AppendPath Uses

func (cr *Context) AppendPath(path *Path)

See cairo_append_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-append-path

func (*Context) Arc Uses

func (cr *Context) Arc(xc, yc, radius, angle1, angle2 float64)

See cairo_arc().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-arc

func (*Context) ArcNegative Uses

func (cr *Context) ArcNegative(xc, yc, radius, angle1, angle2 float64)

See cairo_arc_negative().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-arc-negative

func (*Context) Clip Uses

func (cr *Context) Clip()

See cairo_clip().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-clip

func (*Context) ClipExtents Uses

func (cr *Context) ClipExtents() (float64, float64, float64, float64)

See cairo_clip_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-clip-extents

func (*Context) ClipPreserve Uses

func (cr *Context) ClipPreserve()

See cairo_clip_preserve().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-clip-preserve

func (*Context) ClosePath Uses

func (cr *Context) ClosePath()

See cairo_close_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-close-path

func (*Context) CopyPage Uses

func (cr *Context) CopyPage()

See cairo_copy_page().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-copy-page

func (*Context) CopyPath Uses

func (cr *Context) CopyPath() *Path

See cairo_copy_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-copy-path

func (*Context) CopyPathFlat Uses

func (cr *Context) CopyPathFlat() *Path

See cairo_copy_path_flat().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-copy-path-flat

func (*Context) CurveTo Uses

func (cr *Context) CurveTo(x1, y1, x2, y2, x3, y3 float64)

See cairo_curve_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-curve-to

func (*Context) DeviceToUser Uses

func (cr *Context) DeviceToUser(x, y *float64)

See cairo_device_to_user().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-device-to-user

func (*Context) DeviceToUserDistance Uses

func (cr *Context) DeviceToUserDistance(dx, dy *float64)

See cairo_device_to_user_distance().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-device-to-user-distance

func (*Context) Fill Uses

func (cr *Context) Fill()

See cairo_fill().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill

func (*Context) FillExtents Uses

func (cr *Context) FillExtents() (float64, float64, float64, float64)

See cairo_fill_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-extents

func (*Context) FillPreserve Uses

func (cr *Context) FillPreserve()

See cairo_fill_preserve().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-preserve

func (*Context) FontExtents Uses

func (cr *Context) FontExtents(extents *FontExtents)

See cairo_font_extents().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-font-extents

func (*Context) GetAntialias Uses

func (cr *Context) GetAntialias() Antialias

See cairo_get_antialias().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-antialias

func (*Context) GetCurrentPoint Uses

func (cr *Context) GetCurrentPoint() (float64, float64)

See cairo_get_current_point().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-get-current-point

func (*Context) GetDash Uses

func (cr *Context) GetDash(dashes, offset *float64)

See cairo_get_dash().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-dash

func (*Context) GetDashCount Uses

func (cr *Context) GetDashCount() int

See cairo_get_dash_count().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-dash-count

func (*Context) GetFillRule Uses

func (cr *Context) GetFillRule() FillRule

See cairo_get_fill_rule().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-fill-rule

func (*Context) GetFontFace Uses

func (cr *Context) GetFontFace() *FontFace

See cairo_get_font_face().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-get-font-face

func (*Context) GetFontMatrix Uses

func (cr *Context) GetFontMatrix(matrix *Matrix)

See cairo_get_font_matrix().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-get-font-matrix

func (*Context) GetFontOptions Uses

func (cr *Context) GetFontOptions(options *FontOptions)

See cairo_get_font_options().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-get-font-options

func (*Context) GetGroupTarget Uses

func (cr *Context) GetGroupTarget() *Surface

See cairo_get_group_target().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-group-target

func (*Context) GetLineCap Uses

func (cr *Context) GetLineCap() LineCap

See cairo_get_line_cap().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-line-cap

func (*Context) GetLineJoin Uses

func (cr *Context) GetLineJoin() LineJoin

See cairo_get_line_join().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-line-join

func (*Context) GetLineWidth Uses

func (cr *Context) GetLineWidth() float64

See cairo_get_line_width().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-line-width

func (*Context) GetMatrix Uses

func (cr *Context) GetMatrix(matrix *Matrix)

See cairo_get_matrix().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-get-matrix

func (*Context) GetMiterLimit Uses

func (cr *Context) GetMiterLimit() float64

See cairo_get_miter_limit().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-miter-limit

func (*Context) GetOperator Uses

func (cr *Context) GetOperator() Operator

See cairo_get_operator().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-operator

func (*Context) GetScaledFont Uses

func (cr *Context) GetScaledFont() *ScaledFont

See cairo_get_scaled_font().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-get-scaled-font

func (*Context) GetSource Uses

func (cr *Context) GetSource() *Pattern

See cairo_get_source().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-source

func (*Context) GetTarget Uses

func (cr *Context) GetTarget() *Surface

See cairo_get_target().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-target

func (*Context) GetTolerance Uses

func (cr *Context) GetTolerance() float64

See cairo_get_tolerance().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-get-tolerance

func (*Context) GlyphExtents Uses

func (cr *Context) GlyphExtents(glyphs []Glyph, extents *TextExtents)

See cairo_glyph_extents().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-glyph-extents

func (*Context) GlyphPath Uses

func (cr *Context) GlyphPath(glyphs []Glyph)

See cairo_glyph_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-glyph-path

func (*Context) HasCurrentPoint Uses

func (cr *Context) HasCurrentPoint() bool

See cairo_has_current_point().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-has-current-point

func (*Context) IdentityMatrix Uses

func (cr *Context) IdentityMatrix()

See cairo_identity_matrix().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-identity-matrix

func (*Context) InClip Uses

func (cr *Context) InClip(x, y float64) bool

See cairo_in_clip().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-in-clip

func (*Context) InFill Uses

func (cr *Context) InFill(x, y float64) bool

See cairo_in_fill().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-in-fill

func (*Context) InStroke Uses

func (cr *Context) InStroke(x, y float64) bool

See cairo_in_stroke().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-in-stroke

func (*Context) LineTo Uses

func (cr *Context) LineTo(x, y float64)

See cairo_line_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-line-to

func (*Context) Mask Uses

func (cr *Context) Mask(pattern *Pattern)

See cairo_mask().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-mask

func (*Context) MaskSurface Uses

func (cr *Context) MaskSurface(surface *Surface, surfaceX, surfaceY float64)

See cairo_mask_surface().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-mask-surface

func (*Context) MoveTo Uses

func (cr *Context) MoveTo(x, y float64)

See cairo_move_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-move-to

func (*Context) NewPath Uses

func (cr *Context) NewPath()

See cairo_new_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-new-path

func (*Context) NewSubPath Uses

func (cr *Context) NewSubPath()

See cairo_new_sub_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-new-sub-path

func (*Context) Paint Uses

func (cr *Context) Paint()

See cairo_paint().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-paint

func (*Context) PaintWithAlpha Uses

func (cr *Context) PaintWithAlpha(alpha float64)

See cairo_paint_with_alpha().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-paint-with-alpha

func (*Context) PathExtents Uses

func (cr *Context) PathExtents() (float64, float64, float64, float64)

See cairo_path_extents().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-path-extents

func (*Context) PopGroup Uses

func (cr *Context) PopGroup() *Pattern

See cairo_pop_group().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-pop-group

func (*Context) PopGroupToSource Uses

func (cr *Context) PopGroupToSource()

See cairo_pop_group_to_source().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-pop-group-to-source

func (*Context) PushGroup Uses

func (cr *Context) PushGroup()

See cairo_push_group().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-push-group

func (*Context) PushGroupWithContent Uses

func (cr *Context) PushGroupWithContent(content Content)

See cairo_push_group_with_content().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-push-group-with-content

func (*Context) Rectangle Uses

func (cr *Context) Rectangle(x, y, width, height float64)

See cairo_rectangle().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-rectangle

func (*Context) RelCurveTo Uses

func (cr *Context) RelCurveTo(dx1, dy1, dx2, dy2, dx3, dy3 float64)

See cairo_rel_curve_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-rel-curve-to

func (*Context) RelLineTo Uses

func (cr *Context) RelLineTo(dx, dy float64)

See cairo_rel_line_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-rel-line-to

func (*Context) RelMoveTo Uses

func (cr *Context) RelMoveTo(dx, dy float64)

See cairo_rel_move_to().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-rel-move-to

func (*Context) ResetClip Uses

func (cr *Context) ResetClip()

See cairo_reset_clip().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-reset-clip

func (*Context) Restore Uses

func (cr *Context) Restore()

See cairo_restore().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-restore

func (*Context) Rotate Uses

func (cr *Context) Rotate(angle float64)

See cairo_rotate().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-rotate

func (*Context) Save Uses

func (cr *Context) Save()

See cairo_save().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-save

func (*Context) Scale Uses

func (cr *Context) Scale(sx, sy float64)

See cairo_scale().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-scale

func (*Context) SelectFontFace Uses

func (cr *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight)

See cairo_select_font_face().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-select-font-face

func (*Context) SetAntialias Uses

func (cr *Context) SetAntialias(antialias Antialias)

See cairo_set_antialias().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-antialias

func (*Context) SetDash Uses

func (cr *Context) SetDash(dashes []float64, offset float64)

See cairo_set_dash().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-dash

func (*Context) SetFillRule Uses

func (cr *Context) SetFillRule(fillRule FillRule)

See cairo_set_fill_rule().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-fill-rule

func (*Context) SetFontFace Uses

func (cr *Context) SetFontFace(fontFace *FontFace)

See cairo_set_font_face().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-set-font-face

func (*Context) SetFontMatrix Uses

func (cr *Context) SetFontMatrix(matrix *Matrix)

See cairo_set_font_matrix().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-set-font-matrix

func (*Context) SetFontOptions Uses

func (cr *Context) SetFontOptions(options *FontOptions)

See cairo_set_font_options().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-set-font-options

func (*Context) SetFontSize Uses

func (cr *Context) SetFontSize(size float64)

See cairo_set_font_size().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-set-font-size

func (*Context) SetLineCap Uses

func (cr *Context) SetLineCap(lineCap LineCap)

See cairo_set_line_cap().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-cap

func (*Context) SetLineJoin Uses

func (cr *Context) SetLineJoin(lineJoin LineJoin)

See cairo_set_line_join().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-join

func (*Context) SetLineWidth Uses

func (cr *Context) SetLineWidth(width float64)

See cairo_set_line_width().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-width

func (*Context) SetMatrix Uses

func (cr *Context) SetMatrix(matrix *Matrix)

See cairo_set_matrix().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-set-matrix

func (*Context) SetMiterLimit Uses

func (cr *Context) SetMiterLimit(limit float64)

See cairo_set_miter_limit().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-miter-limit

func (*Context) SetOperator Uses

func (cr *Context) SetOperator(op Operator)

See cairo_set_operator().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-operator

func (*Context) SetScaledFont Uses

func (cr *Context) SetScaledFont(scaledFont *ScaledFont)

See cairo_set_scaled_font().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-set-scaled-font

func (*Context) SetSource Uses

func (cr *Context) SetSource(source *Pattern)

See cairo_set_source().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source

func (*Context) SetSourceRGB Uses

func (cr *Context) SetSourceRGB(red, green, blue float64)

See cairo_set_source_rgb().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-rgb

func (*Context) SetSourceRGBA Uses

func (cr *Context) SetSourceRGBA(red, green, blue, alpha float64)

See cairo_set_source_rgba().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-rgba

func (*Context) SetSourceSurface Uses

func (cr *Context) SetSourceSurface(surface *Surface, x, y float64)

See cairo_set_source_surface().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-surface

func (*Context) SetTolerance Uses

func (cr *Context) SetTolerance(tolerance float64)

See cairo_set_tolerance().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-set-tolerance

func (*Context) ShowGlyphs Uses

func (cr *Context) ShowGlyphs(glyphs []Glyph)

See cairo_show_glyphs().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-show-glyphs

func (*Context) ShowPage Uses

func (cr *Context) ShowPage()

See cairo_show_page().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-show-page

func (*Context) ShowText Uses

func (cr *Context) ShowText(utf8 string)

See cairo_show_text().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-show-text

func (*Context) Stroke Uses

func (cr *Context) Stroke()

See cairo_stroke().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-stroke

func (*Context) StrokeExtents Uses

func (cr *Context) StrokeExtents() (float64, float64, float64, float64)

See cairo_stroke_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-stroke-extents

func (*Context) StrokePreserve Uses

func (cr *Context) StrokePreserve()

See cairo_stroke_preserve().

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-stroke-preserve

func (*Context) TextExtents Uses

func (cr *Context) TextExtents(utf8 string, extents *TextExtents)

See cairo_text_extents().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-text-extents

func (*Context) TextPath Uses

func (cr *Context) TextPath(utf8 string)

See cairo_text_path().

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-text-path

func (*Context) Transform Uses

func (cr *Context) Transform(matrix *Matrix)

See cairo_transform().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-transform

func (*Context) Translate Uses

func (cr *Context) Translate(tx, ty float64)

See cairo_translate().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-translate

func (*Context) UserToDevice Uses

func (cr *Context) UserToDevice(x, y *float64)

See cairo_user_to_device().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-user-to-device

func (*Context) UserToDeviceDistance Uses

func (cr *Context) UserToDeviceDistance(dx, dy *float64)

See cairo_user_to_device_distance().

C API documentation: http://cairographics.org/manual/cairo-Transformations.html#cairo-user-to-device-distance

type Device Uses

type Device struct {
    Ptr *C.cairo_device_t
}

See cairo_device_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-t

func BorrowDevice Uses

func BorrowDevice(p unsafe.Pointer) *Device

Construct a Device from a C cairo_device_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func WrapDevice Uses

func WrapDevice(p unsafe.Pointer) *Device

Wrap a C cairo_device_t* found from some external source as a *Device. The Go side will destroy the reference when it's no longer used.

func (*Device) Acquire Uses

func (device *Device) Acquire() error

See cairo_device_acquire().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-acquire

func (*Device) Finish Uses

func (device *Device) Finish()

See cairo_device_finish().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-finish

func (*Device) Flush Uses

func (device *Device) Flush()

See cairo_device_flush().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-flush

func (*Device) GetType Uses

func (device *Device) GetType() DeviceType

See cairo_device_get_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-get-type

func (*Device) ObserverElapsed Uses

func (device *Device) ObserverElapsed() float64

See cairo_device_observer_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-elapsed

func (*Device) ObserverFillElapsed Uses

func (device *Device) ObserverFillElapsed() float64

See cairo_device_observer_fill_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-fill-elapsed

func (*Device) ObserverGlyphsElapsed Uses

func (device *Device) ObserverGlyphsElapsed() float64

See cairo_device_observer_glyphs_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-glyphs-elapsed

func (*Device) ObserverMaskElapsed Uses

func (device *Device) ObserverMaskElapsed() float64

See cairo_device_observer_mask_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-mask-elapsed

func (*Device) ObserverPaintElapsed Uses

func (device *Device) ObserverPaintElapsed() float64

See cairo_device_observer_paint_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-paint-elapsed

func (*Device) ObserverStrokeElapsed Uses

func (device *Device) ObserverStrokeElapsed() float64

See cairo_device_observer_stroke_elapsed().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-stroke-elapsed

func (*Device) Release Uses

func (device *Device) Release()

See cairo_device_release().

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-release

type DeviceType Uses

type DeviceType int

See cairo_device_type_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-type-t

const (
    DeviceTypeDRM     DeviceType = C.CAIRO_DEVICE_TYPE_DRM
    DeviceTypeGL      DeviceType = C.CAIRO_DEVICE_TYPE_GL
    DeviceTypeScript  DeviceType = C.CAIRO_DEVICE_TYPE_SCRIPT
    DeviceTypeXCB     DeviceType = C.CAIRO_DEVICE_TYPE_XCB
    DeviceTypeXlib    DeviceType = C.CAIRO_DEVICE_TYPE_XLIB
    DeviceTypeXML     DeviceType = C.CAIRO_DEVICE_TYPE_XML
    DeviceTypeCOGL    DeviceType = C.CAIRO_DEVICE_TYPE_COGL
    DeviceTypeWin32   DeviceType = C.CAIRO_DEVICE_TYPE_WIN32
    DeviceTypeInvalid DeviceType = C.CAIRO_DEVICE_TYPE_INVALID
)

func (DeviceType) String Uses

func (i DeviceType) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Extend Uses

type Extend int

See cairo_extend_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-extend-t

const (
    ExtendNone    Extend = C.CAIRO_EXTEND_NONE
    ExtendRepeat  Extend = C.CAIRO_EXTEND_REPEAT
    ExtendReflect Extend = C.CAIRO_EXTEND_REFLECT
    ExtendPad     Extend = C.CAIRO_EXTEND_PAD
)

func (Extend) String Uses

func (i Extend) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type FillRule Uses

type FillRule int

See cairo_fill_rule_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-rule-t

const (
    FillRuleWinding FillRule = C.CAIRO_FILL_RULE_WINDING
    FillRuleEvenOdd FillRule = C.CAIRO_FILL_RULE_EVEN_ODD
)

func (FillRule) String Uses

func (i FillRule) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Filter Uses

type Filter int

See cairo_filter_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-filter-t

const (
    FilterFast     Filter = C.CAIRO_FILTER_FAST
    FilterGood     Filter = C.CAIRO_FILTER_GOOD
    FilterBest     Filter = C.CAIRO_FILTER_BEST
    FilterNearest  Filter = C.CAIRO_FILTER_NEAREST
    FilterBilinear Filter = C.CAIRO_FILTER_BILINEAR
    FilterGaussian Filter = C.CAIRO_FILTER_GAUSSIAN
)

func (Filter) String Uses

func (i Filter) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type FontExtents Uses

type FontExtents struct {
    Ascent      float64
    Descent     float64
    Height      float64
    MaxXAdvance float64
    MaxYAdvance float64
}

See cairo_font_extents_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-font-extents-t

type FontFace Uses

type FontFace struct {
    Ptr *C.cairo_font_face_t
}

See cairo_font_face_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-face-t

func BorrowFontFace Uses

func BorrowFontFace(p unsafe.Pointer) *FontFace

Construct a FontFace from a C cairo_font_face_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func UserFontFaceCreate Uses

func UserFontFaceCreate() *FontFace

See cairo_user_font_face_create().

C API documentation: http://cairographics.org/manual/cairo-User-Fonts.html#cairo-user-font-face-create

func WrapFontFace Uses

func WrapFontFace(p unsafe.Pointer) *FontFace

Wrap a C cairo_font_face_t* found from some external source as a *FontFace. The Go side will destroy the reference when it's no longer used.

func (*FontFace) GetType Uses

func (fontFace *FontFace) GetType() FontType

See cairo_font_face_get_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-face-get-type

type FontOptions Uses

type FontOptions struct {
    Ptr *C.cairo_font_options_t
}

See cairo_font_options_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-t

func BorrowFontOptions Uses

func BorrowFontOptions(p unsafe.Pointer) *FontOptions

Construct a FontOptions from a C cairo_font_options_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func FontOptionsCreate Uses

func FontOptionsCreate() *FontOptions

See cairo_font_options_create().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-create

func WrapFontOptions Uses

func WrapFontOptions(p unsafe.Pointer) *FontOptions

Wrap a C cairo_font_options_t* found from some external source as a *FontOptions. The Go side will destroy the reference when it's no longer used.

func (*FontOptions) Copy Uses

func (original *FontOptions) Copy() *FontOptions

See cairo_font_options_copy().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-copy

func (*FontOptions) Equal Uses

func (options *FontOptions) Equal(other *FontOptions) bool

See cairo_font_options_equal().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-equal

func (*FontOptions) GetAntialias Uses

func (options *FontOptions) GetAntialias() Antialias

See cairo_font_options_get_antialias().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-antialias

func (*FontOptions) GetHintMetrics Uses

func (options *FontOptions) GetHintMetrics() HintMetrics

See cairo_font_options_get_hint_metrics().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-hint-metrics

func (*FontOptions) GetHintStyle Uses

func (options *FontOptions) GetHintStyle() HintStyle

See cairo_font_options_get_hint_style().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-hint-style

func (*FontOptions) GetSubpixelOrder Uses

func (options *FontOptions) GetSubpixelOrder() SubpixelOrder

See cairo_font_options_get_subpixel_order().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-get-subpixel-order

func (*FontOptions) Hash Uses

func (options *FontOptions) Hash() uint32

See cairo_font_options_hash().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-hash

func (*FontOptions) Merge Uses

func (options *FontOptions) Merge(other *FontOptions)

See cairo_font_options_merge().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-merge

func (*FontOptions) SetAntialias Uses

func (options *FontOptions) SetAntialias(antialias Antialias)

See cairo_font_options_set_antialias().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-set-antialias

func (*FontOptions) SetHintMetrics Uses

func (options *FontOptions) SetHintMetrics(hintMetrics HintMetrics)

See cairo_font_options_set_hint_metrics().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-set-hint-metrics

func (*FontOptions) SetHintStyle Uses

func (options *FontOptions) SetHintStyle(hintStyle HintStyle)

See cairo_font_options_set_hint_style().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-set-hint-style

func (*FontOptions) SetSubpixelOrder Uses

func (options *FontOptions) SetSubpixelOrder(subpixelOrder SubpixelOrder)

See cairo_font_options_set_subpixel_order().

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-set-subpixel-order

type FontSlant Uses

type FontSlant int

See cairo_font_slant_t.

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-font-slant-t

const (
    FontSlantNormal  FontSlant = C.CAIRO_FONT_SLANT_NORMAL
    FontSlantItalic  FontSlant = C.CAIRO_FONT_SLANT_ITALIC
    FontSlantOblique FontSlant = C.CAIRO_FONT_SLANT_OBLIQUE
)

func (FontSlant) String Uses

func (i FontSlant) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type FontType Uses

type FontType int

See cairo_font_type_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-face-t.html#cairo-font-type-t

const (
    FontTypeToy    FontType = C.CAIRO_FONT_TYPE_TOY
    FontTypeFt     FontType = C.CAIRO_FONT_TYPE_FT
    FontTypeWin32  FontType = C.CAIRO_FONT_TYPE_WIN32
    FontTypeQuartz FontType = C.CAIRO_FONT_TYPE_QUARTZ
    FontTypeUser   FontType = C.CAIRO_FONT_TYPE_USER
)

func (FontType) String Uses

func (i FontType) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type FontWeight Uses

type FontWeight int

See cairo_font_weight_t.

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-font-weight-t

const (
    FontWeightNormal FontWeight = C.CAIRO_FONT_WEIGHT_NORMAL
    FontWeightBold   FontWeight = C.CAIRO_FONT_WEIGHT_BOLD
)

func (FontWeight) String Uses

func (i FontWeight) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Format Uses

type Format int

See cairo_format_t.

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t

const (
    FormatInvalid  Format = C.CAIRO_FORMAT_INVALID
    FormatARGB32   Format = C.CAIRO_FORMAT_ARGB32
    FormatRGB24    Format = C.CAIRO_FORMAT_RGB24
    FormatA8       Format = C.CAIRO_FORMAT_A8
    FormatA1       Format = C.CAIRO_FORMAT_A1
    FormatRGB16565 Format = C.CAIRO_FORMAT_RGB16_565
    FormatRGB30    Format = C.CAIRO_FORMAT_RGB30
)

func (Format) StrideForWidth Uses

func (format Format) StrideForWidth(width int) int

See cairo_format_stride_for_width().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-stride-for-width

func (Format) String Uses

func (i Format) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Glyph Uses

type Glyph struct {
    Index uint32
    X     float64
    Y     float64
}

See cairo_glyph_t.

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-glyph-t

type HintMetrics Uses

type HintMetrics int

See cairo_hint_metrics_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-hint-metrics-t

const (
    HintMetricsDefault HintMetrics = C.CAIRO_HINT_METRICS_DEFAULT
    HintMetricsOff     HintMetrics = C.CAIRO_HINT_METRICS_OFF
    HintMetricsOn      HintMetrics = C.CAIRO_HINT_METRICS_ON
)

func (HintMetrics) String Uses

func (i HintMetrics) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type HintStyle Uses

type HintStyle int

See cairo_hint_style_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-hint-style-t

const (
    HintStyleDefault HintStyle = C.CAIRO_HINT_STYLE_DEFAULT
    HintStyleNone    HintStyle = C.CAIRO_HINT_STYLE_NONE
    HintStyleSlight  HintStyle = C.CAIRO_HINT_STYLE_SLIGHT
    HintStyleMedium  HintStyle = C.CAIRO_HINT_STYLE_MEDIUM
    HintStyleFull    HintStyle = C.CAIRO_HINT_STYLE_FULL
)

func (HintStyle) String Uses

func (i HintStyle) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type ImageSurface Uses

type ImageSurface struct {
    *Surface
}

func ImageSurfaceCreate Uses

func ImageSurfaceCreate(format Format, width, height int) *ImageSurface

See cairo_image_surface_create().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-create

func ImageSurfaceCreateFromPNGStream Uses

func ImageSurfaceCreateFromPNGStream(r io.Reader) (*ImageSurface, error)

ImageSurfaceCreateFromPNGStream creates an ImageSurface from a stream of PNG data.

func (*ImageSurface) Data Uses

func (i *ImageSurface) Data() []byte

See cairo_image_surface_get_data().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-data

func (*ImageSurface) GetFormat Uses

func (surface *ImageSurface) GetFormat() Format

See cairo_image_surface_get_format().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-format

func (*ImageSurface) GetHeight Uses

func (surface *ImageSurface) GetHeight() int

See cairo_image_surface_get_height().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-height

func (*ImageSurface) GetStride Uses

func (surface *ImageSurface) GetStride() int

See cairo_image_surface_get_stride().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-stride

func (*ImageSurface) GetWidth Uses

func (surface *ImageSurface) GetWidth() int

See cairo_image_surface_get_width().

C API documentation: http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-width

type LineCap Uses

type LineCap int

See cairo_line_cap_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-line-cap-t

const (
    LineCapButt   LineCap = C.CAIRO_LINE_CAP_BUTT
    LineCapRound  LineCap = C.CAIRO_LINE_CAP_ROUND
    LineCapSquare LineCap = C.CAIRO_LINE_CAP_SQUARE
)

func (LineCap) String Uses

func (i LineCap) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type LineJoin Uses

type LineJoin int

See cairo_line_join_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-line-join-t

const (
    LineJoinMiter LineJoin = C.CAIRO_LINE_JOIN_MITER
    LineJoinRound LineJoin = C.CAIRO_LINE_JOIN_ROUND
    LineJoinBevel LineJoin = C.CAIRO_LINE_JOIN_BEVEL
)

func (LineJoin) String Uses

func (i LineJoin) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Matrix Uses

type Matrix struct {
    Xx  float64
    Yx  float64
    Xy  float64
    Yy  float64
    X0  float64
    Y0  float64
}

See cairo_matrix_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-t

func (*Matrix) InitIdentity Uses

func (matrix *Matrix) InitIdentity()

See cairo_matrix_init_identity().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-init-identity

func (*Matrix) InitRotate Uses

func (matrix *Matrix) InitRotate(radians float64)

See cairo_matrix_init_rotate().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-init-rotate

func (*Matrix) InitScale Uses

func (matrix *Matrix) InitScale(sx, sy float64)

See cairo_matrix_init_scale().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-init-scale

func (*Matrix) InitTranslate Uses

func (matrix *Matrix) InitTranslate(tx, ty float64)

See cairo_matrix_init_translate().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-init-translate

func (*Matrix) Invert Uses

func (matrix *Matrix) Invert() error

See cairo_matrix_invert().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-invert

func (*Matrix) Multiply Uses

func (result *Matrix) Multiply(a, b *Matrix)

See cairo_matrix_multiply().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-multiply

func (*Matrix) Rotate Uses

func (matrix *Matrix) Rotate(radians float64)

See cairo_matrix_rotate().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-rotate

func (*Matrix) Scale Uses

func (matrix *Matrix) Scale(sx, sy float64)

See cairo_matrix_scale().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-scale

func (*Matrix) TransformDistance Uses

func (matrix *Matrix) TransformDistance(dx, dy *float64)

See cairo_matrix_transform_distance().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-transform-distance

func (*Matrix) TransformPoint Uses

func (matrix *Matrix) TransformPoint(x, y *float64)

See cairo_matrix_transform_point().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-transform-point

func (*Matrix) Translate Uses

func (matrix *Matrix) Translate(tx, ty float64)

See cairo_matrix_translate().

C API documentation: http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-translate

type MeshPattern Uses

type MeshPattern struct {
    *Pattern
}

func (*MeshPattern) BeginPatch Uses

func (pattern *MeshPattern) BeginPatch()

See cairo_mesh_pattern_begin_patch().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-begin-patch

func (*MeshPattern) CurveTo Uses

func (pattern *MeshPattern) CurveTo(x1, y1, x2, y2, x3, y3 float64)

See cairo_mesh_pattern_curve_to().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-curve-to

func (*MeshPattern) EndPatch Uses

func (pattern *MeshPattern) EndPatch()

See cairo_mesh_pattern_end_patch().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-end-patch

func (*MeshPattern) GetPath Uses

func (pattern *MeshPattern) GetPath(patchNum int) *Path

See cairo_mesh_pattern_get_path().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-get-path

func (*MeshPattern) LineTo Uses

func (pattern *MeshPattern) LineTo(x, y float64)

See cairo_mesh_pattern_line_to().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-line-to

func (*MeshPattern) MoveTo Uses

func (pattern *MeshPattern) MoveTo(x, y float64)

See cairo_mesh_pattern_move_to().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-move-to

func (*MeshPattern) SetControlPoint Uses

func (pattern *MeshPattern) SetControlPoint(pointNum int, x, y float64)

See cairo_mesh_pattern_set_control_point().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-control-point

func (*MeshPattern) SetCornerColorRGB Uses

func (pattern *MeshPattern) SetCornerColorRGB(cornerNum int, red, green, blue float64)

See cairo_mesh_pattern_set_corner_color_rgb().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-corner-color-rgb

func (*MeshPattern) SetCornerColorRGBA Uses

func (pattern *MeshPattern) SetCornerColorRGBA(cornerNum int, red, green, blue, alpha float64)

See cairo_mesh_pattern_set_corner_color_rgba().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-mesh-pattern-set-corner-color-rgba

type Operator Uses

type Operator int

See cairo_operator_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t

const (
    OperatorClear         Operator = C.CAIRO_OPERATOR_CLEAR
    OperatorSource        Operator = C.CAIRO_OPERATOR_SOURCE
    OperatorOver          Operator = C.CAIRO_OPERATOR_OVER
    OperatorIn            Operator = C.CAIRO_OPERATOR_IN
    OperatorOut           Operator = C.CAIRO_OPERATOR_OUT
    OperatorAtop          Operator = C.CAIRO_OPERATOR_ATOP
    OperatorDest          Operator = C.CAIRO_OPERATOR_DEST
    OperatorDestOver      Operator = C.CAIRO_OPERATOR_DEST_OVER
    OperatorDestIn        Operator = C.CAIRO_OPERATOR_DEST_IN
    OperatorDestOut       Operator = C.CAIRO_OPERATOR_DEST_OUT
    OperatorDestAtop      Operator = C.CAIRO_OPERATOR_DEST_ATOP
    OperatorXOR           Operator = C.CAIRO_OPERATOR_XOR
    OperatorAdd           Operator = C.CAIRO_OPERATOR_ADD
    OperatorSaturate      Operator = C.CAIRO_OPERATOR_SATURATE
    OperatorMultiply      Operator = C.CAIRO_OPERATOR_MULTIPLY
    OperatorScreen        Operator = C.CAIRO_OPERATOR_SCREEN
    OperatorOverlay       Operator = C.CAIRO_OPERATOR_OVERLAY
    OperatorDarken        Operator = C.CAIRO_OPERATOR_DARKEN
    OperatorLighten       Operator = C.CAIRO_OPERATOR_LIGHTEN
    OperatorColorDodge    Operator = C.CAIRO_OPERATOR_COLOR_DODGE
    OperatorColorBurn     Operator = C.CAIRO_OPERATOR_COLOR_BURN
    OperatorHardLight     Operator = C.CAIRO_OPERATOR_HARD_LIGHT
    OperatorSoftLight     Operator = C.CAIRO_OPERATOR_SOFT_LIGHT
    OperatorDifference    Operator = C.CAIRO_OPERATOR_DIFFERENCE
    OperatorExclusion     Operator = C.CAIRO_OPERATOR_EXCLUSION
    OperatorHslHue        Operator = C.CAIRO_OPERATOR_HSL_HUE
    OperatorHslSaturation Operator = C.CAIRO_OPERATOR_HSL_SATURATION
    OperatorHslColor      Operator = C.CAIRO_OPERATOR_HSL_COLOR
    OperatorHslLuminosity Operator = C.CAIRO_OPERATOR_HSL_LUMINOSITY
)

func (Operator) String Uses

func (i Operator) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Path Uses

type Path struct {
    Ptr *C.cairo_path_t
}

See cairo_path_t.

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-path-t

func BorrowPath Uses

func BorrowPath(p unsafe.Pointer) *Path

Construct a Path from a C cairo_path_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func WrapPath Uses

func WrapPath(p unsafe.Pointer) *Path

Wrap a C cairo_path_t* found from some external source as a *Path. The Go side will destroy the reference when it's no longer used.

func (*Path) Iter Uses

func (p *Path) Iter() *PathIter

PathIter creates an iterator over the segments within the path.

type PathDataType Uses

type PathDataType int

See cairo_path_data_type_t.

C API documentation: http://cairographics.org/manual/cairo-Paths.html#cairo-path-data-type-t

const (
    PathMoveTo    PathDataType = C.CAIRO_PATH_MOVE_TO
    PathLineTo    PathDataType = C.CAIRO_PATH_LINE_TO
    PathCurveTo   PathDataType = C.CAIRO_PATH_CURVE_TO
    PathClosePath PathDataType = C.CAIRO_PATH_CLOSE_PATH
)

func (PathDataType) String Uses

func (i PathDataType) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type PathIter Uses

type PathIter struct {
    // contains filtered or unexported fields
}

PathIter iterates a Path.

func (*PathIter) Next Uses

func (pi *PathIter) Next() *PathSegment

Next returns the next PathSegment, or returns nil at the end of the path.

type PathPoint Uses

type PathPoint struct {
    X, Y float64
}

PathPoints are produced by iterating paths.

type PathSegment Uses

type PathSegment struct {
    Type   PathDataType
    Points []PathPoint
}

PathSegments are produced by iterating paths.

type Pattern Uses

type Pattern struct {
    Ptr *C.cairo_pattern_t
}

See cairo_pattern_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-t

func BorrowPattern Uses

func BorrowPattern(p unsafe.Pointer) *Pattern

Construct a Pattern from a C cairo_pattern_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func PatternCreateForSurface Uses

func PatternCreateForSurface(surface *Surface) *Pattern

See cairo_pattern_create_for_surface().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-for-surface

func PatternCreateLinear Uses

func PatternCreateLinear(x0, y0, x1, y1 float64) *Pattern

See cairo_pattern_create_linear().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-linear

func PatternCreateMesh Uses

func PatternCreateMesh() *Pattern

See cairo_pattern_create_mesh().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-mesh

func PatternCreateRGB Uses

func PatternCreateRGB(red, green, blue float64) *Pattern

See cairo_pattern_create_rgb().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-rgb

func PatternCreateRGBA Uses

func PatternCreateRGBA(red, green, blue, alpha float64) *Pattern

See cairo_pattern_create_rgba().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-rgba

func PatternCreateRadial Uses

func PatternCreateRadial(cx0, cy0, radius0, cx1, cy1, radius1 float64) *Pattern

See cairo_pattern_create_radial().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-radial

func WrapPattern Uses

func WrapPattern(p unsafe.Pointer) *Pattern

Wrap a C cairo_pattern_t* found from some external source as a *Pattern. The Go side will destroy the reference when it's no longer used.

func (*Pattern) AddColorStopRGB Uses

func (pattern *Pattern) AddColorStopRGB(offset, red, green, blue float64)

See cairo_pattern_add_color_stop_rgb().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-add-color-stop-rgb

func (*Pattern) AddColorStopRGBA Uses

func (pattern *Pattern) AddColorStopRGBA(offset, red, green, blue, alpha float64)

See cairo_pattern_add_color_stop_rgba().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-add-color-stop-rgba

func (*Pattern) GetExtend Uses

func (pattern *Pattern) GetExtend() Extend

See cairo_pattern_get_extend().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-extend

func (*Pattern) GetFilter Uses

func (pattern *Pattern) GetFilter() Filter

See cairo_pattern_get_filter().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-filter

func (*Pattern) GetMatrix Uses

func (pattern *Pattern) GetMatrix(matrix *Matrix)

See cairo_pattern_get_matrix().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-matrix

func (*Pattern) GetType Uses

func (pattern *Pattern) GetType() PatternType

See cairo_pattern_get_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-get-type

func (*Pattern) SetExtend Uses

func (pattern *Pattern) SetExtend(extend Extend)

See cairo_pattern_set_extend().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-set-extend

func (*Pattern) SetFilter Uses

func (pattern *Pattern) SetFilter(filter Filter)

See cairo_pattern_set_filter().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-set-filter

func (*Pattern) SetMatrix Uses

func (pattern *Pattern) SetMatrix(matrix *Matrix)

See cairo_pattern_set_matrix().

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-set-matrix

type PatternType Uses

type PatternType int

See cairo_pattern_type_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-type-t

const (
    PatternTypeSolid        PatternType = C.CAIRO_PATTERN_TYPE_SOLID
    PatternTypeSurface      PatternType = C.CAIRO_PATTERN_TYPE_SURFACE
    PatternTypeLinear       PatternType = C.CAIRO_PATTERN_TYPE_LINEAR
    PatternTypeRadial       PatternType = C.CAIRO_PATTERN_TYPE_RADIAL
    PatternTypeMesh         PatternType = C.CAIRO_PATTERN_TYPE_MESH
    PatternTypeRasterSource PatternType = C.CAIRO_PATTERN_TYPE_RASTER_SOURCE
)

func (PatternType) String Uses

func (i PatternType) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type RecordingSurface Uses

type RecordingSurface struct {
    *Surface
}

func RecordingSurfaceCreate Uses

func RecordingSurfaceCreate(content Content, extents *Rectangle) *RecordingSurface

See cairo_recording_surface_create().

C API documentation: http://cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-create

func (*RecordingSurface) GetExtents Uses

func (surface *RecordingSurface) GetExtents(extents *Rectangle) bool

See cairo_recording_surface_get_extents().

C API documentation: http://cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-get-extents

func (*RecordingSurface) InkExtents Uses

func (surface *RecordingSurface) InkExtents() (float64, float64, float64, float64)

See cairo_recording_surface_ink_extents().

C API documentation: http://cairographics.org/manual/cairo-Recording-Surfaces.html#cairo-recording-surface-ink-extents

type Rectangle Uses

type Rectangle struct {
    X      float64
    Y      float64
    Width  float64
    Height float64
}

See cairo_rectangle_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-t.html#cairo-rectangle-t

type Region Uses

type Region struct {
    Ptr *C.cairo_region_t
}

See cairo_region_t.

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-t

func BorrowRegion Uses

func BorrowRegion(p unsafe.Pointer) *Region

Construct a Region from a C cairo_region_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func RegionCreate Uses

func RegionCreate() *Region

See cairo_region_create().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-create

func WrapRegion Uses

func WrapRegion(p unsafe.Pointer) *Region

Wrap a C cairo_region_t* found from some external source as a *Region. The Go side will destroy the reference when it's no longer used.

func (*Region) ContainsPoint Uses

func (region *Region) ContainsPoint(x, y int) bool

See cairo_region_contains_point().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-contains-point

func (*Region) Copy Uses

func (original *Region) Copy() *Region

See cairo_region_copy().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-copy

func (*Region) Equal Uses

func (a *Region) Equal(b *Region) bool

See cairo_region_equal().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-equal

func (*Region) Intersect Uses

func (dst *Region) Intersect(other *Region) error

See cairo_region_intersect().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-intersect

func (*Region) IsEmpty Uses

func (region *Region) IsEmpty() bool

See cairo_region_is_empty().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-is-empty

func (*Region) NumRectangles Uses

func (region *Region) NumRectangles() int

See cairo_region_num_rectangles().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-num-rectangles

func (*Region) Subtract Uses

func (dst *Region) Subtract(other *Region) error

See cairo_region_subtract().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-subtract

func (*Region) Translate Uses

func (region *Region) Translate(dx, dy int)

See cairo_region_translate().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-translate

func (*Region) Union Uses

func (dst *Region) Union(other *Region) error

See cairo_region_union().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-union

func (*Region) XOR Uses

func (dst *Region) XOR(other *Region) error

See cairo_region_xor().

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-xor

type RegionOverlap Uses

type RegionOverlap int

See cairo_region_overlap_t.

C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-overlap-t

const (
    RegionOverlapIn   RegionOverlap = C.CAIRO_REGION_OVERLAP_IN
    RegionOverlapOut  RegionOverlap = C.CAIRO_REGION_OVERLAP_OUT
    RegionOverlapPart RegionOverlap = C.CAIRO_REGION_OVERLAP_PART
)

func (RegionOverlap) String Uses

func (i RegionOverlap) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type SVGSurface Uses

type SVGSurface struct {
    *Surface
}

func SVGSurfaceCreate Uses

func SVGSurfaceCreate(filename string, widthInPoints, heightInPoints float64) *SVGSurface

See cairo_svg_surface_create().

C API documentation: http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-create

func (*SVGSurface) RestrictToVersion Uses

func (surface *SVGSurface) RestrictToVersion(version SVGVersion)

See cairo_svg_surface_restrict_to_version().

C API documentation: http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version

type SVGVersion Uses

type SVGVersion int

See cairo_svg_version_t.

C API documentation: http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-version-t

const (
    SVGVersion11 SVGVersion = C.CAIRO_SVG_VERSION_1_1
    SVGVersion12 SVGVersion = C.CAIRO_SVG_VERSION_1_2
)

func (SVGVersion) String Uses

func (i SVGVersion) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

func (SVGVersion) ToString Uses

func (version SVGVersion) ToString() string

See cairo_svg_version_to_string().

C API documentation: http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-version-to-string

type ScaledFont Uses

type ScaledFont struct {
    Ptr *C.cairo_scaled_font_t
}

See cairo_scaled_font_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-t

func BorrowScaledFont Uses

func BorrowScaledFont(p unsafe.Pointer) *ScaledFont

Construct a ScaledFont from a C cairo_scaled_font_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func ScaledFontCreate Uses

func ScaledFontCreate(fontFace *FontFace, fontMatrix, ctm *Matrix, options *FontOptions) *ScaledFont

See cairo_scaled_font_create().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-create

func WrapScaledFont Uses

func WrapScaledFont(p unsafe.Pointer) *ScaledFont

Wrap a C cairo_scaled_font_t* found from some external source as a *ScaledFont. The Go side will destroy the reference when it's no longer used.

func (*ScaledFont) Extents Uses

func (scaledFont *ScaledFont) Extents(extents *FontExtents)

See cairo_scaled_font_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-extents

func (*ScaledFont) GetCTM Uses

func (scaledFont *ScaledFont) GetCTM(ctm *Matrix)

See cairo_scaled_font_get_ctm().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-ctm

func (*ScaledFont) GetFontFace Uses

func (scaledFont *ScaledFont) GetFontFace() *FontFace

See cairo_scaled_font_get_font_face().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-face

func (*ScaledFont) GetFontMatrix Uses

func (scaledFont *ScaledFont) GetFontMatrix(fontMatrix *Matrix)

See cairo_scaled_font_get_font_matrix().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-matrix

func (*ScaledFont) GetFontOptions Uses

func (scaledFont *ScaledFont) GetFontOptions(options *FontOptions)

See cairo_scaled_font_get_font_options().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-options

func (*ScaledFont) GetScaleMatrix Uses

func (scaledFont *ScaledFont) GetScaleMatrix(scaleMatrix *Matrix)

See cairo_scaled_font_get_scale_matrix().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-scale-matrix

func (*ScaledFont) GetType Uses

func (scaledFont *ScaledFont) GetType() FontType

See cairo_scaled_font_get_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-type

func (*ScaledFont) GlyphExtents Uses

func (scaledFont *ScaledFont) GlyphExtents(glyphs []Glyph, extents *TextExtents)

See cairo_scaled_font_glyph_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-glyph-extents

func (*ScaledFont) TextExtents Uses

func (scaledFont *ScaledFont) TextExtents(utf8 string, extents *TextExtents)

See cairo_scaled_font_text_extents().

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-scaled-font-text-extents

type Status Uses

type Status int

See cairo_status_t.

C API documentation: http://cairographics.org/manual/cairo-Error-handling.html#cairo-status-t

const (
    StatusSuccess                 Status = C.CAIRO_STATUS_SUCCESS
    StatusNoMemory                Status = C.CAIRO_STATUS_NO_MEMORY
    StatusInvalidRestore          Status = C.CAIRO_STATUS_INVALID_RESTORE
    StatusInvalidPopGroup         Status = C.CAIRO_STATUS_INVALID_POP_GROUP
    StatusNoCurrentPoint          Status = C.CAIRO_STATUS_NO_CURRENT_POINT
    StatusInvalidMatrix           Status = C.CAIRO_STATUS_INVALID_MATRIX
    StatusInvalidStatus           Status = C.CAIRO_STATUS_INVALID_STATUS
    StatusNullPointer             Status = C.CAIRO_STATUS_NULL_POINTER
    StatusInvalidString           Status = C.CAIRO_STATUS_INVALID_STRING
    StatusInvalidPathData         Status = C.CAIRO_STATUS_INVALID_PATH_DATA
    StatusReadError               Status = C.CAIRO_STATUS_READ_ERROR
    StatusWriteError              Status = C.CAIRO_STATUS_WRITE_ERROR
    StatusSurfaceFinished         Status = C.CAIRO_STATUS_SURFACE_FINISHED
    StatusSurfaceTypeMismatch     Status = C.CAIRO_STATUS_SURFACE_TYPE_MISMATCH
    StatusPatternTypeMismatch     Status = C.CAIRO_STATUS_PATTERN_TYPE_MISMATCH
    StatusInvalidContent          Status = C.CAIRO_STATUS_INVALID_CONTENT
    StatusInvalidFormat           Status = C.CAIRO_STATUS_INVALID_FORMAT
    StatusInvalidVisual           Status = C.CAIRO_STATUS_INVALID_VISUAL
    StatusFileNotFound            Status = C.CAIRO_STATUS_FILE_NOT_FOUND
    StatusInvalidDash             Status = C.CAIRO_STATUS_INVALID_DASH
    StatusInvalidDscComment       Status = C.CAIRO_STATUS_INVALID_DSC_COMMENT
    StatusInvalidIndex            Status = C.CAIRO_STATUS_INVALID_INDEX
    StatusClipNotRepresentable    Status = C.CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
    StatusTempFileError           Status = C.CAIRO_STATUS_TEMP_FILE_ERROR
    StatusInvalidStride           Status = C.CAIRO_STATUS_INVALID_STRIDE
    StatusFontTypeMismatch        Status = C.CAIRO_STATUS_FONT_TYPE_MISMATCH
    StatusUserFontImmutable       Status = C.CAIRO_STATUS_USER_FONT_IMMUTABLE
    StatusUserFontError           Status = C.CAIRO_STATUS_USER_FONT_ERROR
    StatusNegativeCount           Status = C.CAIRO_STATUS_NEGATIVE_COUNT
    StatusInvalidClusters         Status = C.CAIRO_STATUS_INVALID_CLUSTERS
    StatusInvalidSlant            Status = C.CAIRO_STATUS_INVALID_SLANT
    StatusInvalidWeight           Status = C.CAIRO_STATUS_INVALID_WEIGHT
    StatusInvalidSize             Status = C.CAIRO_STATUS_INVALID_SIZE
    StatusUserFontNotImplemented  Status = C.CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED
    StatusDeviceTypeMismatch      Status = C.CAIRO_STATUS_DEVICE_TYPE_MISMATCH
    StatusDeviceError             Status = C.CAIRO_STATUS_DEVICE_ERROR
    StatusInvalidMeshConstruction Status = C.CAIRO_STATUS_INVALID_MESH_CONSTRUCTION
    StatusDeviceFinished          Status = C.CAIRO_STATUS_DEVICE_FINISHED
    StatusJbig2GlobalMissing      Status = C.CAIRO_STATUS_JBIG2_GLOBAL_MISSING
    StatusLastStatus              Status = C.CAIRO_STATUS_LAST_STATUS
)

func (Status) Error Uses

func (s Status) Error() string

Error implements the error interface.

type SubpixelOrder Uses

type SubpixelOrder int

See cairo_subpixel_order_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-subpixel-order-t

const (
    SubpixelOrderDefault SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_DEFAULT
    SubpixelOrderRGB     SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_RGB
    SubpixelOrderBGR     SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_BGR
    SubpixelOrderVRGB    SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_VRGB
    SubpixelOrderVBGR    SubpixelOrder = C.CAIRO_SUBPIXEL_ORDER_VBGR
)

func (SubpixelOrder) String Uses

func (i SubpixelOrder) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type Surface Uses

type Surface struct {
    Ptr *C.cairo_surface_t
}

See cairo_surface_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-t

func BorrowSurface Uses

func BorrowSurface(p unsafe.Pointer) *Surface

Construct a Surface from a C cairo_surface_t* found from some exernal source. It is the caller's responsibility to ensure the pointer lives.

func WrapSurface Uses

func WrapSurface(p unsafe.Pointer) *Surface

Wrap a C cairo_surface_t* found from some external source as a *Surface. The Go side will destroy the reference when it's no longer used.

func (*Surface) CopyPage Uses

func (surface *Surface) CopyPage()

See cairo_surface_copy_page().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-copy-page

func (*Surface) CreateForRectangle Uses

func (target *Surface) CreateForRectangle(x, y, width, height float64) *Surface

See cairo_surface_create_for_rectangle().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-for-rectangle

func (*Surface) CreateObserver Uses

func (target *Surface) CreateObserver(mode SurfaceObserverMode) *SurfaceObserver

See cairo_surface_create_observer().

func (*Surface) CreateSimilar Uses

func (other *Surface) CreateSimilar(content Content, width, height int) *Surface

See cairo_surface_create_similar().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-similar

func (*Surface) CreateSimilarImage Uses

func (other *Surface) CreateSimilarImage(format Format, width, height int) *Surface

See cairo_surface_create_similar_image().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-create-similar-image

func (*Surface) Finish Uses

func (surface *Surface) Finish()

See cairo_surface_finish().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-finish

func (*Surface) Flush Uses

func (surface *Surface) Flush()

See cairo_surface_flush().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-flush

func (*Surface) GetContent Uses

func (surface *Surface) GetContent() Content

See cairo_surface_get_content().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-content

func (*Surface) GetDevice Uses

func (surface *Surface) GetDevice() *Device

See cairo_surface_get_device().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device

func (*Surface) GetDeviceOffset Uses

func (surface *Surface) GetDeviceOffset() (float64, float64)

See cairo_surface_get_device_offset().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device-offset

func (*Surface) GetDeviceScale Uses

func (surface *Surface) GetDeviceScale() (float64, float64)

See cairo_surface_get_device_scale().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-device-scale

func (*Surface) GetFallbackResolution Uses

func (surface *Surface) GetFallbackResolution() (float64, float64)

See cairo_surface_get_fallback_resolution().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-fallback-resolution

func (*Surface) GetFontOptions Uses

func (surface *Surface) GetFontOptions(options *FontOptions)

See cairo_surface_get_font_options().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-font-options

func (*Surface) GetType Uses

func (surface *Surface) GetType() SurfaceType

See cairo_surface_get_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-get-type

func (*Surface) HasShowTextGlyphs Uses

func (surface *Surface) HasShowTextGlyphs() bool

See cairo_surface_has_show_text_glyphs().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-has-show-text-glyphs

func (*Surface) MarkDirty Uses

func (surface *Surface) MarkDirty()

See cairo_surface_mark_dirty().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-mark-dirty

func (*Surface) MarkDirtyRectangle Uses

func (surface *Surface) MarkDirtyRectangle(x, y, width, height int)

See cairo_surface_mark_dirty_rectangle().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-mark-dirty-rectangle

func (*Surface) SetDeviceOffset Uses

func (surface *Surface) SetDeviceOffset(xOffset, yOffset float64)

See cairo_surface_set_device_offset().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-device-offset

func (*Surface) SetDeviceScale Uses

func (surface *Surface) SetDeviceScale(xScale, yScale float64)

See cairo_surface_set_device_scale().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-device-scale

func (*Surface) SetFallbackResolution Uses

func (surface *Surface) SetFallbackResolution(xPixelsPerInch, yPixelsPerInch float64)

See cairo_surface_set_fallback_resolution().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-fallback-resolution

func (*Surface) ShowPage Uses

func (surface *Surface) ShowPage()

See cairo_surface_show_page().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-show-page

func (*Surface) SupportsMimeType Uses

func (surface *Surface) SupportsMimeType(mimeType string) bool

See cairo_surface_supports_mime_type().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-supports-mime-type

func (*Surface) UnmapImage Uses

func (surface *Surface) UnmapImage(image *Surface)

See cairo_surface_unmap_image().

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-unmap-image

func (*Surface) WriteToPNG Uses

func (surface *Surface) WriteToPNG(w io.Writer) error

WriteToPNG encodes a Surface to an io.Writer as a PNG file.

type SurfaceObserver Uses

type SurfaceObserver struct {
    *Surface
}

func (*SurfaceObserver) Elapsed Uses

func (surface *SurfaceObserver) Elapsed() float64

See cairo_surface_observer_elapsed().

type SurfaceObserverMode Uses

type SurfaceObserverMode int

See cairo_surface_observer_mode_t.

const (
    SurfaceObserverNormal           SurfaceObserverMode = C.CAIRO_SURFACE_OBSERVER_NORMAL
    SurfaceObserverRecordOperations SurfaceObserverMode = C.CAIRO_SURFACE_OBSERVER_RECORD_OPERATIONS
)

func (SurfaceObserverMode) String Uses

func (i SurfaceObserverMode) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type SurfaceType Uses

type SurfaceType int

See cairo_surface_type_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-type-t

const (
    SurfaceTypeImage         SurfaceType = C.CAIRO_SURFACE_TYPE_IMAGE
    SurfaceTypePDF           SurfaceType = C.CAIRO_SURFACE_TYPE_PDF
    SurfaceTypePS            SurfaceType = C.CAIRO_SURFACE_TYPE_PS
    SurfaceTypeXlib          SurfaceType = C.CAIRO_SURFACE_TYPE_XLIB
    SurfaceTypeXCB           SurfaceType = C.CAIRO_SURFACE_TYPE_XCB
    SurfaceTypeGlitz         SurfaceType = C.CAIRO_SURFACE_TYPE_GLITZ
    SurfaceTypeQuartz        SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ
    SurfaceTypeWin32         SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32
    SurfaceTypeBeos          SurfaceType = C.CAIRO_SURFACE_TYPE_BEOS
    SurfaceTypeDirectfb      SurfaceType = C.CAIRO_SURFACE_TYPE_DIRECTFB
    SurfaceTypeSVG           SurfaceType = C.CAIRO_SURFACE_TYPE_SVG
    SurfaceTypeOS2           SurfaceType = C.CAIRO_SURFACE_TYPE_OS2
    SurfaceTypeWin32Printing SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32_PRINTING
    SurfaceTypeQuartzImage   SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
    SurfaceTypeScript        SurfaceType = C.CAIRO_SURFACE_TYPE_SCRIPT
    SurfaceTypeQt            SurfaceType = C.CAIRO_SURFACE_TYPE_QT
    SurfaceTypeRecording     SurfaceType = C.CAIRO_SURFACE_TYPE_RECORDING
    SurfaceTypeVG            SurfaceType = C.CAIRO_SURFACE_TYPE_VG
    SurfaceTypeGL            SurfaceType = C.CAIRO_SURFACE_TYPE_GL
    SurfaceTypeDRM           SurfaceType = C.CAIRO_SURFACE_TYPE_DRM
    SurfaceTypeTee           SurfaceType = C.CAIRO_SURFACE_TYPE_TEE
    SurfaceTypeXML           SurfaceType = C.CAIRO_SURFACE_TYPE_XML
    SurfaceTypeSkia          SurfaceType = C.CAIRO_SURFACE_TYPE_SKIA
    SurfaceTypeSubsurface    SurfaceType = C.CAIRO_SURFACE_TYPE_SUBSURFACE
    SurfaceTypeCOGL          SurfaceType = C.CAIRO_SURFACE_TYPE_COGL
)

func (SurfaceType) String Uses

func (i SurfaceType) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type TextClusterFlags Uses

type TextClusterFlags int

See cairo_text_cluster_flags_t.

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-text-cluster-flags-t

const (
    TextClusterFlagBackward TextClusterFlags = C.CAIRO_TEXT_CLUSTER_FLAG_BACKWARD
)

func (TextClusterFlags) String Uses

func (i TextClusterFlags) String() string

String implements the Stringer interface, which is used in places like fmt's %q. For all enums like this it returns the Go name of the constant.

type TextExtents Uses

type TextExtents struct {
    XBearing float64
    YBearing float64
    Width    float64
    Height   float64
    XAdvance float64
    YAdvance float64
}

See cairo_text_extents_t.

C API documentation: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-text-extents-t

type ToyFontFace Uses

type ToyFontFace struct {
    *FontFace
}

func ToyFontFaceCreate Uses

func ToyFontFaceCreate(family string, slant FontSlant, weight FontWeight) *ToyFontFace

See cairo_toy_font_face_create().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-toy-font-face-create

func (*ToyFontFace) GetFamily Uses

func (fontFace *ToyFontFace) GetFamily() string

See cairo_toy_font_face_get_family().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-family

func (*ToyFontFace) GetSlant Uses

func (fontFace *ToyFontFace) GetSlant() FontSlant

See cairo_toy_font_face_get_slant().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-slant

func (*ToyFontFace) GetWeight Uses

func (fontFace *ToyFontFace) GetWeight() FontWeight

See cairo_toy_font_face_get_weight().

C API documentation: http://cairographics.org/manual/cairo-text.html#cairo-toy-font-face-get-weight

type XlibDevice Uses

type XlibDevice struct {
    *Device
}

func (*XlibDevice) DebugCapXrenderVersion Uses

func (device *XlibDevice) DebugCapXrenderVersion(majorVersion, minorVersion int)

See cairo_xlib_device_debug_cap_xrender_version().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-device-debug-cap-xrender-version

func (*XlibDevice) DebugGetPrecision Uses

func (device *XlibDevice) DebugGetPrecision() int

See cairo_xlib_device_debug_get_precision().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-device-debug-get-precision

func (*XlibDevice) DebugSetPrecision Uses

func (device *XlibDevice) DebugSetPrecision(precision int)

See cairo_xlib_device_debug_set_precision().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-device-debug-set-precision

type XlibSurface Uses

type XlibSurface struct {
    *Surface
}

func XlibSurfaceCreate Uses

func XlibSurfaceCreate(dpy unsafe.Pointer, drawable uint64, visual unsafe.Pointer, width, height int) *XlibSurface

See cairo_xlib_surface_create().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-create

func XlibSurfaceCreateForBitmap Uses

func XlibSurfaceCreateForBitmap(dpy unsafe.Pointer, bitmap uint64, screen unsafe.Pointer, width, height int) *XlibSurface

See cairo_xlib_surface_create_for_bitmap().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-create-for-bitmap

func (*XlibSurface) GetDepth Uses

func (surface *XlibSurface) GetDepth() int

See cairo_xlib_surface_get_depth().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-depth

func (*XlibSurface) GetDisplay Uses

func (surface *XlibSurface) GetDisplay() unsafe.Pointer

See cairo_xlib_surface_get_display().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-display

func (*XlibSurface) GetDrawable Uses

func (surface *XlibSurface) GetDrawable() uint64

See cairo_xlib_surface_get_drawable().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-drawable

func (*XlibSurface) GetHeight Uses

func (surface *XlibSurface) GetHeight() int

See cairo_xlib_surface_get_height().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-height

func (*XlibSurface) GetScreen Uses

func (surface *XlibSurface) GetScreen() unsafe.Pointer

See cairo_xlib_surface_get_screen().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-screen

func (*XlibSurface) GetVisual Uses

func (surface *XlibSurface) GetVisual() unsafe.Pointer

See cairo_xlib_surface_get_visual().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-visual

func (*XlibSurface) GetWidth Uses

func (surface *XlibSurface) GetWidth() int

See cairo_xlib_surface_get_width().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-get-width

func (*XlibSurface) SetDrawable Uses

func (surface *XlibSurface) SetDrawable(drawable uint64, width, height int)

See cairo_xlib_surface_set_drawable().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-set-drawable

func (*XlibSurface) SetSize Uses

func (surface *XlibSurface) SetSize(width, height int)

See cairo_xlib_surface_set_size().

C API documentation: http://cairographics.org/manual/cairo-XLib-Surfaces.html#cairo-xlib-surface-set-size

Package cairo imports 7 packages (graph) and is imported by 4 packages. Updated 2016-07-26. Refresh now. Tools for package owners.