summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/code.google.com/p/draw2d/draw2d/gc.go
blob: 66dc5088fc5a719d58d69f1954dfc84b61db6c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2010 The draw2d Authors. All rights reserved.
// created: 21/11/2010 by Laurent Le Goff

package draw2d

import (
	"image"
	"image/color"
)

type FillRule int

const (
	FillRuleEvenOdd FillRule = iota
	FillRuleWinding
)

type GraphicContext interface {
	Path
	// Create a new path
	BeginPath()
	GetMatrixTransform() MatrixTransform
	SetMatrixTransform(tr MatrixTransform)
	ComposeMatrixTransform(tr MatrixTransform)
	Rotate(angle float64)
	Translate(tx, ty float64)
	Scale(sx, sy float64)
	SetStrokeColor(c color.Color)
	SetFillColor(c color.Color)
	SetFillRule(f FillRule)
	SetLineWidth(lineWidth float64)
	SetLineCap(cap Cap)
	SetLineJoin(join Join)
	SetLineDash(dash []float64, dashOffset float64)
	SetFontSize(fontSize float64)
	GetFontSize() float64
	SetFontData(fontData FontData)
	GetFontData() FontData
	DrawImage(image image.Image)
	Save()
	Restore()
	Clear()
	ClearRect(x1, y1, x2, y2 int)
	SetDPI(dpi int)
	GetDPI() int
	GetStringBounds(s string) (left, top, right, bottom float64)
	CreateStringPath(text string, x, y float64) (cursor float64)
	FillString(text string) (cursor float64)
	FillStringAt(text string, x, y float64) (cursor float64)
	StrokeString(text string) (cursor float64)
	StrokeStringAt(text string, x, y float64) (cursor float64)
	Stroke(paths ...*PathStorage)
	Fill(paths ...*PathStorage)
	FillStroke(paths ...*PathStorage)
}