gotk3: github.com/gotk3/gotk3/cairo Index | Files

package cairo

import "github.com/gotk3/gotk3/cairo"

Package cairo implements Go bindings for Cairo. Supports version 1.10 and later.

Index

Package Files

antialias.go cairo.go canvas.go errors.go fillrule.go format.go linecap.go linejoin.go matrix.go mimetype.go operator.go pattern.go status.go surface.go surfacetype.go text.go translations.go util.go

func StatusToString Uses

func StatusToString(status Status) string

type Antialias Uses

type Antialias int

Antialias is a representation of Cairo's cairo_antialias_t.

const (
    ANTIALIAS_DEFAULT  Antialias = C.CAIRO_ANTIALIAS_DEFAULT
    ANTIALIAS_NONE     Antialias = C.CAIRO_ANTIALIAS_NONE
    ANTIALIAS_GRAY     Antialias = C.CAIRO_ANTIALIAS_GRAY
    ANTIALIAS_SUBPIXEL Antialias = C.CAIRO_ANTIALIAS_SUBPIXEL
)

type Content Uses

type Content int

Content is a representation of Cairo's cairo_content_t.

const (
    CONTENT_COLOR       Content = C.CAIRO_CONTENT_COLOR
    CONTENT_ALPHA       Content = C.CAIRO_CONTENT_ALPHA
    CONTENT_COLOR_ALPHA Content = C.CAIRO_CONTENT_COLOR_ALPHA
)

type Context Uses

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

Context is a representation of Cairo's cairo_t.

func Create Uses

func Create(target *Surface) *Context

Create is a wrapper around cairo_create().

func WrapContext Uses

func WrapContext(p uintptr) *Context

func (*Context) Arc Uses

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

Arc is a wrapper around cairo_arc().

func (*Context) ArcNegative Uses

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

ArcNegative is a wrapper around cairo_arc_negative().

func (*Context) Clip Uses

func (v *Context) Clip()

Clip is a wrapper around cairo_clip().

func (*Context) ClipExtents Uses

func (v *Context) ClipExtents() (x1, y1, x2, y2 float64)

ClipExtents is a wrapper around cairo_clip_extents().

func (*Context) ClipPreserve Uses

func (v *Context) ClipPreserve()

ClipPreserve is a wrapper around cairo_clip_preserve().

func (*Context) Close Uses

func (v *Context) Close()

Closes the context. The context must not be used afterwards.

func (*Context) ClosePath Uses

func (v *Context) ClosePath()

ClosePath is a wrapper around cairo_close_path().

func (*Context) CopyPage Uses

func (v *Context) CopyPage()

CopyPage is a wrapper around cairo_copy_page().

func (*Context) CurveTo Uses

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

CurveTo is a wrapper around cairo_curve_to().

func (*Context) DeviceToUser Uses

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

DeviceToUser is a wrapper around cairo_device_to_user.

func (*Context) DeviceToUserDistance Uses

func (v *Context) DeviceToUserDistance(x, y float64) (float64, float64)

DeviceToUserDistance is a wrapper around cairo_device_to_user_distance.

func (*Context) Fill Uses

func (v *Context) Fill()

Fill is a wrapper around cairo_fill().

func (*Context) FillExtents Uses

func (v *Context) FillExtents() (x1, y1, x2, y2 float64)

FillExtents is a wrapper around cairo_fill_extents().

func (*Context) FillPreserve Uses

func (v *Context) FillPreserve()

FillPreserve is a wrapper around cairo_fill_preserve().

func (*Context) FontExtents Uses

func (v *Context) FontExtents() FontExtents

func (*Context) GetAntialias Uses

func (v *Context) GetAntialias() Antialias

GetAntialias is a wrapper around cairo_get_antialias().

func (*Context) GetCContext Uses

func (v *Context) GetCContext() *C.cairo_t

func (*Context) GetCurrentPoint Uses

func (v *Context) GetCurrentPoint() (x, y float64)

GetCurrentPoint is a wrapper around cairo_get_current_point().

func (*Context) GetDash Uses

func (v *Context) GetDash() (dashes []float64, offset float64)

GetDash is a wrapper around cairo_get_dash().

func (*Context) GetDashCount Uses

func (v *Context) GetDashCount() int

GetDashCount is a wrapper around cairo_get_dash_count().

func (*Context) GetFillRule Uses

func (v *Context) GetFillRule() FillRule

GetFillRule is a wrapper around cairo_get_fill_rule().

func (*Context) GetGroupTarget Uses

func (v *Context) GetGroupTarget() *Surface

GetGroupTarget is a wrapper around cairo_get_group_target().

func (*Context) GetLineCap Uses

func (v *Context) GetLineCap() LineCap

GetLineCap is a wrapper around cairo_get_line_cap().

func (*Context) GetLineJoin Uses

func (v *Context) GetLineJoin() LineJoin

GetLineJoin is a wrapper around cairo_get_line_join().

func (*Context) GetLineWidth Uses

func (v *Context) GetLineWidth() float64

GetLineWidth is a wrapper cairo_get_line_width().

func (*Context) GetMatrix Uses

func (v *Context) GetMatrix() *Matrix

GetMatrix is a wrapper around cairo_get_matrix.

func (*Context) GetMiterLimit Uses

func (v *Context) GetMiterLimit() float64

GetMiterLimit is a wrapper around cairo_get_miter_limit().

func (*Context) GetOperator Uses

func (v *Context) GetOperator() Operator

GetOperator is a wrapper around cairo_get_operator().

func (*Context) GetTarget Uses

func (v *Context) GetTarget() *Surface

GetTarget is a wrapper around cairo_get_target().

func (*Context) GetTolerance Uses

func (v *Context) GetTolerance() float64

GetTolerance is a wrapper around cairo_get_tolerance().

func (*Context) IdentityMatrix Uses

func (v *Context) IdentityMatrix()

IdentityMatrix is a wrapper around cairo_identity_matrix().

Resets the current transformation matrix (CTM) by setting it equal to the identity matrix. That is, the user-space and device-space axes will be aligned and one user-space unit will transform to one device-space unit.

func (*Context) InClip Uses

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

InClip is a wrapper around cairo_in_clip().

func (*Context) InFill Uses

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

InFill is a wrapper around cairo_in_fill().

func (*Context) InStroke Uses

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

InStroke is a wrapper around cairo_in_stroke().

func (*Context) LineTo Uses

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

LineTo is a wrapper around cairo_line_to().

func (*Context) MaskSurface Uses

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

MaskSurface is a wrapper around cairo_mask_surface().

func (*Context) MoveTo Uses

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

MoveTo is a wrapper around cairo_move_to().

func (*Context) Native Uses

func (v *Context) Native() uintptr

Native returns a pointer to the underlying cairo_t.

func (*Context) NewPath Uses

func (v *Context) NewPath()

NewPath is a wrapper around cairo_new_path().

func (*Context) Paint Uses

func (v *Context) Paint()

Paint is a wrapper around cairo_paint().

func (*Context) PaintWithAlpha Uses

func (v *Context) PaintWithAlpha(alpha float64)

PaintWithAlpha is a wrapper around cairo_paint_with_alpha().

func (*Context) PopGroupToSource Uses

func (v *Context) PopGroupToSource()

PopGroupToSource is a wrapper around cairo_pop_group_to_source().

func (*Context) PushGroup Uses

func (v *Context) PushGroup()

PushGroup is a wrapper around cairo_push_group().

func (*Context) PushGroupWithContent Uses

func (v *Context) PushGroupWithContent(content Content)

PushGroupWithContent is a wrapper around cairo_push_group_with_content().

func (*Context) Rectangle Uses

func (v *Context) Rectangle(x, y, w, h float64)

Rectangle is a wrapper around cairo_rectangle().

func (*Context) ResetClip Uses

func (v *Context) ResetClip()

ResetClip is a wrapper around cairo_reset_clip().

func (*Context) Restore Uses

func (v *Context) Restore()

Restore is a wrapper around cairo_restore().

func (*Context) Rotate Uses

func (v *Context) Rotate(angle float64)

Rotate is a wrapper around cairo_rotate.

func (*Context) Save Uses

func (v *Context) Save()

Save is a wrapper around cairo_save().

func (*Context) Scale Uses

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

Scale is a wrapper around cairo_scale.

func (*Context) SelectFontFace Uses

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

func (*Context) SetAntialias Uses

func (v *Context) SetAntialias(antialias Antialias)

SetAntialias is a wrapper around cairo_set_antialias().

func (*Context) SetDash Uses

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

SetDash is a wrapper around cairo_set_dash().

func (*Context) SetFillRule Uses

func (v *Context) SetFillRule(fillRule FillRule)

SetFillRule is a wrapper around cairo_set_fill_rule().

func (*Context) SetFontSize Uses

func (v *Context) SetFontSize(size float64)

func (*Context) SetLineCap Uses

func (v *Context) SetLineCap(lineCap LineCap)

SetLineCap is a wrapper around cairo_set_line_cap().

func (*Context) SetLineJoin Uses

func (v *Context) SetLineJoin(lineJoin LineJoin)

SetLineJoin is a wrapper around cairo_set_line_join().

func (*Context) SetLineWidth Uses

func (v *Context) SetLineWidth(width float64)

SetLineWidth is a wrapper around cairo_set_line_width().

func (*Context) SetMatrix Uses

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

SetMatrix is a wrapper around cairo_set_matrix.

func (*Context) SetMiterLimit Uses

func (v *Context) SetMiterLimit(limit float64)

SetMiterLimit is a wrapper around cairo_set_miter_limit().

func (*Context) SetOperator Uses

func (v *Context) SetOperator(op Operator)

SetOperator is a wrapper around cairo_set_operator().

func (*Context) SetSource Uses

func (v *Context) SetSource(p *Pattern)

SetSource is a wrapper around cairo_set_source().

func (*Context) SetSourceRGB Uses

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

SetSourceRGB is a wrapper around cairo_set_source_rgb().

func (*Context) SetSourceRGBA Uses

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

SetSourceRGBA is a wrapper around cairo_set_source_rgba().

func (*Context) SetSourceSurface Uses

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

SetSourceSurface is a wrapper around cairo_set_source_surface().

func (*Context) SetTolerance Uses

func (v *Context) SetTolerance(tolerance float64)

SetTolerance is a wrapper around cairo_set_tolerance().

func (*Context) ShowPage Uses

func (v *Context) ShowPage()

ShowPage is a wrapper around cairo_show_page().

func (*Context) ShowText Uses

func (v *Context) ShowText(utf8 string)

func (*Context) Status Uses

func (v *Context) Status() Status

Status is a wrapper around cairo_status().

func (*Context) Stroke Uses

func (v *Context) Stroke()

Stroke is a wrapper around cairo_stroke().

func (*Context) StrokeExtents Uses

func (v *Context) StrokeExtents() (x1, y1, x2, y2 float64)

StrokeExtents is a wrapper around cairo_stroke_extents().

func (*Context) StrokePreserve Uses

func (v *Context) StrokePreserve()

StrokePreserve is a wrapper around cairo_stroke_preserve().

func (*Context) TextExtents Uses

func (v *Context) TextExtents(utf8 string) TextExtents

func (*Context) Transform Uses

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

Transform is a wrapper around cairo_transform.

func (*Context) Translate Uses

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

Translate is a wrapper around cairo_translate.

func (*Context) UserToDevice Uses

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

UserToDevice is a wrapper around cairo_user_to_device.

func (*Context) UserToDeviceDistance Uses

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

UserToDeviceDistance is a wrapper around cairo_user_to_device_distance.

type ErrorStatus Uses

type ErrorStatus Status

func (ErrorStatus) Error Uses

func (e ErrorStatus) Error() string

type FillRule Uses

type FillRule int

FillRule is a representation of Cairo's cairo_fill_rule_t.

const (
    FILL_RULE_WINDING  FillRule = C.CAIRO_FILL_RULE_WINDING
    FILL_RULE_EVEN_ODD FillRule = C.CAIRO_FILL_RULE_EVEN_ODD
)

type FontExtents Uses

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

type FontSlant Uses

type FontSlant int

FontSlant is a representation of Cairo's cairo_font_slant_t

const (
    FONT_SLANT_NORMAL  FontSlant = C.CAIRO_FONT_SLANT_NORMAL
    FONT_SLANT_ITALIC  FontSlant = C.CAIRO_FONT_SLANT_ITALIC
    FONT_SLANT_OBLIQUE FontSlant = C.CAIRO_FONT_SLANT_OBLIQUE
)

type FontWeight Uses

type FontWeight int

FontWeight is a representation of Cairo's cairo_font_weight_t

const (
    FONT_WEIGHT_NORMAL FontWeight = C.CAIRO_FONT_WEIGHT_NORMAL
    FONT_WEIGHT_BOLD   FontWeight = C.CAIRO_FONT_WEIGHT_BOLD
)

type Format Uses

type Format int

Format is a representation of Cairo's cairo_format_t.

const (
    FORMAT_INVALID   Format = C.CAIRO_FORMAT_INVALID
    FORMAT_ARGB32    Format = C.CAIRO_FORMAT_ARGB32
    FORMAT_RGB24     Format = C.CAIRO_FORMAT_RGB24
    FORMAT_A8        Format = C.CAIRO_FORMAT_A8
    FORMAT_A1        Format = C.CAIRO_FORMAT_A1
    FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565
    FORMAT_RGB30     Format = C.CAIRO_FORMAT_RGB30
)

type LineCap Uses

type LineCap int

LineCap is a representation of Cairo's cairo_line_cap_t.

const (
    LINE_CAP_BUTT   LineCap = C.CAIRO_LINE_CAP_BUTT
    LINE_CAP_ROUND  LineCap = C.CAIRO_LINE_CAP_ROUND
    LINE_CAP_SQUARE LineCap = C.CAIRO_LINE_CAP_SQUARE
)

type LineJoin Uses

type LineJoin int

LineJoin is a representation of Cairo's cairo_line_join_t.

const (
    LINE_JOIN_MITER LineJoin = C.CAIRO_LINE_JOIN_MITER
    LINE_JOIN_ROUND LineJoin = C.CAIRO_LINE_JOIN_ROUND
    LINE_JOIN_BEVEL LineJoin = C.CAIRO_LINE_JOIN_BEVEL
)

type Matrix Uses

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

Matrix struct

func NewMatrix Uses

func NewMatrix(xx, yx, xy, yy, x0, y0 float64) *Matrix

NewMatrix creates a new identiy matrix

func (*Matrix) InitIdentity Uses

func (m *Matrix) InitIdentity()

InitIdentity initializes this matrix to identity matrix

func (*Matrix) InitRotate Uses

func (m *Matrix) InitRotate(radians float64)

InitRotate initializes a matrix with the given rotation

func (*Matrix) InitScale Uses

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

InitScale initializes a matrix with the give scale

func (*Matrix) InitTranslate Uses

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

InitTranslate initializes a matrix with the given translation

func (*Matrix) Invert Uses

func (m *Matrix) Invert()

Invert inverts the matrix

func (*Matrix) Multiply Uses

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

Multiply multiplies the matrix by another matrix

func (*Matrix) Native Uses

func (m *Matrix) Native() uintptr

Native returns native c pointer to a matrix

func (*Matrix) Rotate Uses

func (m *Matrix) Rotate(radians float64)

Rotate rotates the matrix by the given amount

func (*Matrix) Scale Uses

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

Scale scales the matrix by the given amounts

func (*Matrix) TransformDistance Uses

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

TransformDistance ...

func (*Matrix) TransformPoint Uses

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

TransformPoint ...

func (*Matrix) Translate Uses

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

Translate translates a matrix by the given amount

type MimeType Uses

type MimeType string

MimeType is a representation of Cairo's CAIRO_MIME_TYPE_* preprocessor constants.

const (
    MIME_TYPE_JP2       MimeType = "image/jp2"
    MIME_TYPE_JPEG      MimeType = "image/jpeg"
    MIME_TYPE_PNG       MimeType = "image/png"
    MIME_TYPE_URI       MimeType = "image/x-uri"
    MIME_TYPE_UNIQUE_ID MimeType = "application/x-cairo.uuid"
)

type Operator Uses

type Operator int

Operator is a representation of Cairo's cairo_operator_t.

const (
    OPERATOR_CLEAR          Operator = C.CAIRO_OPERATOR_CLEAR
    OPERATOR_SOURCE         Operator = C.CAIRO_OPERATOR_SOURCE
    OPERATOR_OVER           Operator = C.CAIRO_OPERATOR_OVER
    OPERATOR_IN             Operator = C.CAIRO_OPERATOR_IN
    OPERATOR_OUT            Operator = C.CAIRO_OPERATOR_OUT
    OPERATOR_ATOP           Operator = C.CAIRO_OPERATOR_ATOP
    OPERATOR_DEST           Operator = C.CAIRO_OPERATOR_DEST
    OPERATOR_DEST_OVER      Operator = C.CAIRO_OPERATOR_DEST_OVER
    OPERATOR_DEST_IN        Operator = C.CAIRO_OPERATOR_DEST_IN
    OPERATOR_DEST_OUT       Operator = C.CAIRO_OPERATOR_DEST_OUT
    OPERATOR_DEST_ATOP      Operator = C.CAIRO_OPERATOR_DEST_ATOP
    OPERATOR_XOR            Operator = C.CAIRO_OPERATOR_XOR
    OPERATOR_ADD            Operator = C.CAIRO_OPERATOR_ADD
    OPERATOR_SATURATE       Operator = C.CAIRO_OPERATOR_SATURATE
    OPERATOR_MULTIPLY       Operator = C.CAIRO_OPERATOR_MULTIPLY
    OPERATOR_SCREEN         Operator = C.CAIRO_OPERATOR_SCREEN
    OPERATOR_OVERLAY        Operator = C.CAIRO_OPERATOR_OVERLAY
    OPERATOR_DARKEN         Operator = C.CAIRO_OPERATOR_DARKEN
    OPERATOR_LIGHTEN        Operator = C.CAIRO_OPERATOR_LIGHTEN
    OPERATOR_COLOR_DODGE    Operator = C.CAIRO_OPERATOR_COLOR_DODGE
    OPERATOR_COLOR_BURN     Operator = C.CAIRO_OPERATOR_COLOR_BURN
    OPERATOR_HARD_LIGHT     Operator = C.CAIRO_OPERATOR_HARD_LIGHT
    OPERATOR_SOFT_LIGHT     Operator = C.CAIRO_OPERATOR_SOFT_LIGHT
    OPERATOR_DIFFERENCE     Operator = C.CAIRO_OPERATOR_DIFFERENCE
    OPERATOR_EXCLUSION      Operator = C.CAIRO_OPERATOR_EXCLUSION
    OPERATOR_HSL_HUE        Operator = C.CAIRO_OPERATOR_HSL_HUE
    OPERATOR_HSL_SATURATION Operator = C.CAIRO_OPERATOR_HSL_SATURATION
    OPERATOR_HSL_COLOR      Operator = C.CAIRO_OPERATOR_HSL_COLOR
    OPERATOR_HSL_LUMINOSITY Operator = C.CAIRO_OPERATOR_HSL_LUMINOSITY
)

type Pattern Uses

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

Pattern is a representation of Cairo's cairo_pattern_t.

func NewPatternForSurface Uses

func NewPatternForSurface(s *Surface) (*Pattern, error)

NewPatternForSurface is a wrapper around cairo_pattern_create_for_surface().

func NewPatternFromRGB Uses

func NewPatternFromRGB(red, green, blue float64) (*Pattern, error)

NewPatternFromRGB is a wrapper around cairo_pattern_create_rgb().

func NewPatternFromRGBA Uses

func NewPatternFromRGBA(red, green, blue, alpha float64) (*Pattern, error)

NewPatternFromRGBA is a wrapper around cairo_pattern_create_rgba().

func NewPatternLinear Uses

func NewPatternLinear(x0, y0, x1, y1 float64) (*Pattern, error)

NewPatternLinear is a wrapper around cairo_pattern_create_linear().

func NewPatternRadial Uses

func NewPatternRadial(x0, y0, r0, x1, y1, r1 float64) (*Pattern, error)

NewPatternRadial is a wrapper around cairo_pattern_create_radial().

func (*Pattern) AddColorStopRGB Uses

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

AddColorStopRGB is a wrapper around cairo_pattern_add_color_stop_rgb().

func (*Pattern) AddColorStopRGBA Uses

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

AddColorStopRGBA is a wrapper around cairo_pattern_add_color_stop_rgba().

func (*Pattern) Native Uses

func (v *Pattern) Native() uintptr

Native returns a pointer to the underlying cairo_pattern_t.

func (*Pattern) Status Uses

func (v *Pattern) Status() Status

Status is a wrapper around cairo_pattern_status().

type Status Uses

type Status int

Status is a representation of Cairo's cairo_status_t.

const (
    STATUS_SUCCESS                   Status = C.CAIRO_STATUS_SUCCESS
    STATUS_NO_MEMORY                 Status = C.CAIRO_STATUS_NO_MEMORY
    STATUS_INVALID_RESTORE           Status = C.CAIRO_STATUS_INVALID_RESTORE
    STATUS_INVALID_POP_GROUP         Status = C.CAIRO_STATUS_INVALID_POP_GROUP
    STATUS_NO_CURRENT_POINT          Status = C.CAIRO_STATUS_NO_CURRENT_POINT
    STATUS_INVALID_MATRIX            Status = C.CAIRO_STATUS_INVALID_MATRIX
    STATUS_INVALID_STATUS            Status = C.CAIRO_STATUS_INVALID_STATUS
    STATUS_NULL_POINTER              Status = C.CAIRO_STATUS_NULL_POINTER
    STATUS_INVALID_STRING            Status = C.CAIRO_STATUS_INVALID_STRING
    STATUS_INVALID_PATH_DATA         Status = C.CAIRO_STATUS_INVALID_PATH_DATA
    STATUS_READ_ERROR                Status = C.CAIRO_STATUS_READ_ERROR
    STATUS_WRITE_ERROR               Status = C.CAIRO_STATUS_WRITE_ERROR
    STATUS_SURFACE_FINISHED          Status = C.CAIRO_STATUS_SURFACE_FINISHED
    STATUS_SURFACE_TYPE_MISMATCH     Status = C.CAIRO_STATUS_SURFACE_TYPE_MISMATCH
    STATUS_PATTERN_TYPE_MISMATCH     Status = C.CAIRO_STATUS_PATTERN_TYPE_MISMATCH
    STATUS_INVALID_CONTENT           Status = C.CAIRO_STATUS_INVALID_CONTENT
    STATUS_INVALID_FORMAT            Status = C.CAIRO_STATUS_INVALID_FORMAT
    STATUS_INVALID_VISUAL            Status = C.CAIRO_STATUS_INVALID_VISUAL
    STATUS_FILE_NOT_FOUND            Status = C.CAIRO_STATUS_FILE_NOT_FOUND
    STATUS_INVALID_DASH              Status = C.CAIRO_STATUS_INVALID_DASH
    STATUS_INVALID_DSC_COMMENT       Status = C.CAIRO_STATUS_INVALID_DSC_COMMENT
    STATUS_INVALID_INDEX             Status = C.CAIRO_STATUS_INVALID_INDEX
    STATUS_CLIP_NOT_REPRESENTABLE    Status = C.CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
    STATUS_TEMP_FILE_ERROR           Status = C.CAIRO_STATUS_TEMP_FILE_ERROR
    STATUS_INVALID_STRIDE            Status = C.CAIRO_STATUS_INVALID_STRIDE
    STATUS_FONT_TYPE_MISMATCH        Status = C.CAIRO_STATUS_FONT_TYPE_MISMATCH
    STATUS_USER_FONT_IMMUTABLE       Status = C.CAIRO_STATUS_USER_FONT_IMMUTABLE
    STATUS_USER_FONT_ERROR           Status = C.CAIRO_STATUS_USER_FONT_ERROR
    STATUS_NEGATIVE_COUNT            Status = C.CAIRO_STATUS_NEGATIVE_COUNT
    STATUS_INVALID_CLUSTERS          Status = C.CAIRO_STATUS_INVALID_CLUSTERS
    STATUS_INVALID_SLANT             Status = C.CAIRO_STATUS_INVALID_SLANT
    STATUS_INVALID_WEIGHT            Status = C.CAIRO_STATUS_INVALID_WEIGHT
    STATUS_INVALID_SIZE              Status = C.CAIRO_STATUS_INVALID_SIZE
    STATUS_USER_FONT_NOT_IMPLEMENTED Status = C.CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED
    STATUS_DEVICE_TYPE_MISMATCH      Status = C.CAIRO_STATUS_DEVICE_TYPE_MISMATCH
    STATUS_DEVICE_ERROR              Status = C.CAIRO_STATUS_DEVICE_ERROR
)

func (Status) String Uses

func (s Status) String() string

String returns a readable status messsage usable in texts.

func (Status) ToError Uses

func (s Status) ToError() error

ToError returns the error for the status. Returns nil if success.

type Surface Uses

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

Surface is a representation of Cairo's cairo_surface_t.

func CreateImageSurface Uses

func CreateImageSurface(format Format, width, height int) *Surface

CreateImageSurface is a wrapper around cairo_image_surface_create().

func CreatePDFSurface Uses

func CreatePDFSurface(fileName string, width float64, height float64) (*Surface, error)

/ Create a new PDF surface.

func NewSurface Uses

func NewSurface(s uintptr, needsRef bool) *Surface

NewSurface creates a gotk3 cairo Surface from a pointer to a C cairo_surface_t. This is primarily designed for use with other gotk3 packages and should be avoided by applications.

func NewSurfaceFromPNG Uses

func NewSurfaceFromPNG(fileName string) (*Surface, error)

func WrapSurface Uses

func WrapSurface(s uintptr) *Surface

func (*Surface) Close Uses

func (v *Surface) Close()

Closes the surface. The surface must not be used afterwards.

func (*Surface) CopyPage Uses

func (v *Surface) CopyPage()

CopyPage is a wrapper around cairo_surface_copy_page().

func (*Surface) CreateForRectangle Uses

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

CreateForRectangle is a wrapper around cairo_surface_create_for_rectangle().

func (*Surface) CreateSimilar Uses

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

CreateSimilar is a wrapper around cairo_surface_create_similar().

func (*Surface) Flush Uses

func (v *Surface) Flush()

Flush is a wrapper around cairo_surface_flush().

func (*Surface) GetData Uses

func (v *Surface) GetData() unsafe.Pointer

GetData is a wrapper around cairo_image_surface_get_data().

func (*Surface) GetDeviceOffset Uses

func (v *Surface) GetDeviceOffset() (x, y float64)

GetDeviceOffset is a wrapper around cairo_surface_get_device_offset().

func (*Surface) GetFallbackResolution Uses

func (v *Surface) GetFallbackResolution() (xPPI, yPPI float64)

GetFallbackResolution is a wrapper around cairo_surface_get_fallback_resolution().

func (*Surface) GetHeight Uses

func (v *Surface) GetHeight() int

GetHeight is a wrapper around cairo_image_surface_get_height().

func (*Surface) GetMimeData Uses

func (v *Surface) GetMimeData(mimeType MimeType) []byte

GetMimeData is a wrapper around cairo_surface_get_mime_data(). The returned mimetype data is returned as a Go byte slice.

func (*Surface) GetType Uses

func (v *Surface) GetType() SurfaceType

GetType is a wrapper around cairo_surface_get_type().

func (*Surface) GetWidth Uses

func (v *Surface) GetWidth() int

GetWidth is a wrapper around cairo_image_surface_get_width().

func (*Surface) HasShowTextGlyphs Uses

func (v *Surface) HasShowTextGlyphs() bool

HasShowTextGlyphs is a wrapper around cairo_surface_has_show_text_glyphs().

func (*Surface) MarkDirty Uses

func (v *Surface) MarkDirty()

MarkDirty is a wrapper around cairo_surface_mark_dirty().

func (*Surface) MarkDirtyRectangle Uses

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

MarkDirtyRectangle is a wrapper around cairo_surface_mark_dirty_rectangle().

func (*Surface) Native Uses

func (v *Surface) Native() uintptr

Native returns a pointer to the underlying cairo_surface_t.

func (*Surface) SetDeviceOffset Uses

func (v *Surface) SetDeviceOffset(x, y float64)

SetDeviceOffset is a wrapper around cairo_surface_set_device_offset().

func (*Surface) SetFallbackResolution Uses

func (v *Surface) SetFallbackResolution(xPPI, yPPI float64)

SetFallbackResolution is a wrapper around cairo_surface_set_fallback_resolution().

func (*Surface) ShowPage Uses

func (v *Surface) ShowPage()

ShowPage is a wrapper around cairo_surface_show_page().

func (*Surface) Status Uses

func (v *Surface) Status() Status

Status is a wrapper around cairo_surface_status().

func (*Surface) WriteToPNG Uses

func (v *Surface) WriteToPNG(fileName string) error

WriteToPNG is a wrapper around cairo_surface_write_png(). It writes the Cairo surface to the given file in PNG format.

type SurfaceType Uses

type SurfaceType int

SurfaceType is a representation of Cairo's cairo_surface_type_t.

const (
    SURFACE_TYPE_IMAGE          SurfaceType = C.CAIRO_SURFACE_TYPE_IMAGE
    SURFACE_TYPE_PDF            SurfaceType = C.CAIRO_SURFACE_TYPE_PDF
    SURFACE_TYPE_PS             SurfaceType = C.CAIRO_SURFACE_TYPE_PS
    SURFACE_TYPE_XLIB           SurfaceType = C.CAIRO_SURFACE_TYPE_XLIB
    SURFACE_TYPE_XCB            SurfaceType = C.CAIRO_SURFACE_TYPE_XCB
    SURFACE_TYPE_GLITZ          SurfaceType = C.CAIRO_SURFACE_TYPE_GLITZ
    SURFACE_TYPE_QUARTZ         SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ
    SURFACE_TYPE_WIN32          SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32
    SURFACE_TYPE_BEOS           SurfaceType = C.CAIRO_SURFACE_TYPE_BEOS
    SURFACE_TYPE_DIRECTFB       SurfaceType = C.CAIRO_SURFACE_TYPE_DIRECTFB
    SURFACE_TYPE_SVG            SurfaceType = C.CAIRO_SURFACE_TYPE_SVG
    SURFACE_TYPE_OS2            SurfaceType = C.CAIRO_SURFACE_TYPE_OS2
    SURFACE_TYPE_WIN32_PRINTING SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32_PRINTING
    SURFACE_TYPE_QUARTZ_IMAGE   SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
    SURFACE_TYPE_SCRIPT         SurfaceType = C.CAIRO_SURFACE_TYPE_SCRIPT
    SURFACE_TYPE_QT             SurfaceType = C.CAIRO_SURFACE_TYPE_QT
    SURFACE_TYPE_RECORDING      SurfaceType = C.CAIRO_SURFACE_TYPE_RECORDING
    SURFACE_TYPE_VG             SurfaceType = C.CAIRO_SURFACE_TYPE_VG
    SURFACE_TYPE_GL             SurfaceType = C.CAIRO_SURFACE_TYPE_GL
    SURFACE_TYPE_DRM            SurfaceType = C.CAIRO_SURFACE_TYPE_DRM
    SURFACE_TYPE_TEE            SurfaceType = C.CAIRO_SURFACE_TYPE_TEE
    SURFACE_TYPE_XML            SurfaceType = C.CAIRO_SURFACE_TYPE_XML
    SURFACE_TYPE_SKIA           SurfaceType = C.CAIRO_SURFACE_TYPE_SKIA
    SURFACE_TYPE_SUBSURFACE     SurfaceType = C.CAIRO_SURFACE_TYPE_SUBSURFACE
)

type TextExtents Uses

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

Package cairo imports 7 packages (graph) and is imported by 38 packages. Updated 2019-01-09. Refresh now. Tools for package owners.