draw

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FONT_STYLE_NORMAL     = 0x00
	FONT_STYLE_BOLD       = 0x01
	FONT_STYLE_ITALIC     = 0x02
	FONT_STYLE_UNDER_LINE = 0x04
	FONT_STYLE_STRIKE_OUT = 0x08
)
View Source
const (
	OBJ_ATTR_TYPE_INT  = 0
	OBJ_ATTR_TYPE_BOOL = 1
	OBJ_ATTR_TYPE_UINT = 2
)
View Source
const (
	PEN_TYPE_COSMETIC  = 0
	PEN_TYPE_GEOMETRIC = 1
)

Pen types

View Source
const (
	PEN_SOLID        = 0
	PEN_DASH         = 1
	PEN_DOT          = 2
	PEN_DASH_DOT     = 3
	PEN_DASH_DOT_DOT = 4
	PEN_NULL         = 5
)

Pen styles

View Source
const (
	PEN_CAP_ROUND  = 0
	PEN_CAP_SQUARE = 1
	PEN_CAP_FLAT   = 2
)

Pen cap styles

View Source
const (
	PEN_JOIN_ROUND = 0
	PEN_JOIN_BEVEL = 1
	PEN_JOIN_MITER = 2
)

Pen join styles

View Source
const (
	LANGUAGE_CHINESE_ENGLISH = 0x0409
	LANGUAGE_CHINESE_SIMPLE  = 0x0804
	LANGUAGE_CHINESE_TW      = 0x0404
	LANGUAGE_CHINESE_HK      = 0x0C04
	LANGUAGE_CHINESE_SGP     = 0x1004
)

Variables

This section is empty.

Functions

func FileEqual

func FileEqual(filename1, filename2 string) bool

func GetCurrentPath

func GetCurrentPath() string

func LogErrors

func LogErrors() bool

func NewError

func NewError(message string) error

func PanicOnError

func PanicOnError() bool

func PathOrFileIsExist

func PathOrFileIsExist(pathOrFile string) (bool, error)

func ReplaceFileSuffix

func ReplaceFileSuffix(filename, newSuffix string) string

func SetLogErrors

func SetLogErrors(v bool)

func SetPanicOnError

func SetPanicOnError(v bool)

Types

type ArrowStyle

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

type Color

type Color uint32
var (
	ColorBlack Color = RGB(0, 0, 0)
	ColorWhite Color = RGB(255, 255, 255)
	ColorRed   Color = RGB(255, 0, 0)
	ColorGreen Color = RGB(0, 255, 0)
	ColorBlue  Color = RGB(0, 0, 255)
	ColorAqua  Color = RGB(0, 255, 255)
	ColorGold  Color = RGB(255, 201, 14)
)

func ARGB

func ARGB(alpha, red, green, blue byte) Color

func RGB

func RGB(red, green, blue byte) Color

func (Color) ARGBString

func (c Color) ARGBString() string

func (Color) Alpha

func (c Color) Alpha() byte

func (Color) Blue

func (c Color) Blue() byte

func (Color) Green

func (c Color) Green() byte

func (Color) RGBString

func (c Color) RGBString() string

func (Color) Red

func (c Color) Red() byte

type ColorPool

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

func NewColorPool

func NewColorPool() *ColorPool

func (*ColorPool) AddColor

func (this *ColorPool) AddColor(name string, color Color)

func (*ColorPool) GetColor

func (this *ColorPool) GetColor(name string) (color Color, ok bool)

type ControlBase

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

func (*ControlBase) SetVisible

func (this *ControlBase) SetVisible(visible bool)

type Error

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

func (*Error) Error

func (this *Error) Error() string

func (*Error) Inner

func (this *Error) Inner() error

func (*Error) Message

func (this *Error) Message() string

type Font

type Font struct {
	Name            string
	FrontColor      Color
	BackgroundColor Color
	Style           int
	Size            int
}

func NewFont

func NewFont(Name string, Style, Size int) *Font

func (*Font) GetDotName

func (this *Font) GetDotName() string

func (*Font) GetPlantumlName

func (this *Font) GetPlantumlName() string

func (*Font) GetStyleName

func (this *Font) GetStyleName() string

type Handler

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

func (*Handler) GetControlById

func (this *Handler) GetControlById(id int) IControlBase

func (*Handler) GetControlByName

func (this *Handler) GetControlByName(name string) IControlBase

func (*Handler) SetObject

func (this *Handler) SetObject(obj IObject)

func (*Handler) SetVisible

func (this *Handler) SetVisible(controlName string, visible bool)

type IBrush

type IBrush interface {
	Dispose()
}

type ICanvas

type ICanvas interface {
	DrawLine(pen IPen, from, to Point) error
	DrawRectangle(pen IPen, rect Rectangle) error
	FillRectangle(brush IBrush, rect Rectangle) error
	DrawEllipse(pen IPen, rect Rectangle) error
	FillEllipse(brush IBrush, rect Rectangle) error
	DrawCircle(pen IPen, center Point, radius int) error
	FillCircle(brush IBrush, center Point, radius int) error
	//DrawImage(image Image, location Point) error
	//PaintImage(image Image, f func() error) error
	Dispose()
}

type IControlBase

type IControlBase interface {
	IObject
}

type IGraphic

type IGraphic interface {
	Draw(canvas ICanvas) error
	Add(child IGraphic) error
	Remove(child IGraphic) error
	Parent() IGraphic
	Level() int
}

type IHandler

type IHandler interface {
	SetObject(obj IObject)
	GetControlById(id int) IControlBase
	GetControlByName(name string) IControlBase

	SetVisible(name string, isVisible bool)
	SetDisable(name string, isDisable bool)

	SetTitle(name string, title string)
	GetTitle(name string) string
}

type IImage

type IImage interface {
	BeginPaint(canvas ICanvas) error
	EndPaint()
	Draw(canvas ICanvas) error
	Dispose()
	Size() Size
	SaveToFile(filename, format string) error
}

type IObject

type IObject interface {
	GetId() int
	GetName() string
	SetName(name string)

	IsClass(name string) bool
	IsThisObject(id int, name string) bool

	GetObjectClass() string
	BaseObjectClassName() string

	RegisterHandler(handler IHandler) bool
	SetHandler(handler IHandler)
	GetHandler() IHandler

	OnBaseMessage(id, msg int, wParam, lParam int) int
	OnControlUpdate(rect *Rectangle, isUpdate bool, controlBase IControlBase) int

	SetAttribute(name string, value string, isLoading bool) int
	LoadAttributesInfo() bool
	LoadFromXml(decoder xml.Decoder, start *xml.StartElement, loadSubControl bool) bool

	OnInit() bool

	SetRect(rect *Rectangle)
	GetRect() Rectangle
}

type IPen

type IPen interface {
	Dispose()
	Width() int
	Style() PenStyle
}

type LineGraphic

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

func (*LineGraphic) Add

func (this *LineGraphic) Add(child IGraphic) error

func (*LineGraphic) Draw

func (this *LineGraphic) Draw(canvas ICanvas) error

func (*LineGraphic) Level

func (this *LineGraphic) Level(child IGraphic) int

func (*LineGraphic) Parent

func (this *LineGraphic) Parent() IGraphic

func (*LineGraphic) Remove

func (this *LineGraphic) Remove(child IGraphic) error

type LineStyle

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

type LineType

type LineType uint32

type Object

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

func (*Object) BaseObjectClassName

func (this *Object) BaseObjectClassName() string

func (*Object) GetHandler

func (this *Object) GetHandler() IHandler

func (*Object) GetId

func (this *Object) GetId() int

func (*Object) GetName

func (this *Object) GetName() string

func (*Object) GetObjectClass

func (this *Object) GetObjectClass() string

func (*Object) GetRect

func (this *Object) GetRect() Rectangle

func (*Object) IsClass

func (this *Object) IsClass(name string) bool

func (*Object) IsThisObject

func (this *Object) IsThisObject(id int, name string) bool

func (*Object) LoadAttributesInfo

func (this *Object) LoadAttributesInfo() bool

func (*Object) LoadFromXml

func (this *Object) LoadFromXml(decoder xml.Decoder, start *xml.StartElement, loadSubControl bool) bool

func (*Object) OnBaseMessage

func (this *Object) OnBaseMessage(id, msg int, wParam, lParam int) int

func (*Object) OnControlUpdate

func (this *Object) OnControlUpdate(rect *Rectangle, isUpdate bool, controlBase IControlBase) int

func (*Object) OnInit

func (this *Object) OnInit() bool

func (*Object) RegisterHandler

func (this *Object) RegisterHandler(handler IHandler) bool

func (*Object) SetAttribute

func (this *Object) SetAttribute(name string, value string, isLoading bool) int

func (*Object) SetHandler

func (this *Object) SetHandler(handler IHandler)

func (*Object) SetName

func (this *Object) SetName(name string)

func (*Object) SetRect

func (this *Object) SetRect(rect *Rectangle)

type ObjectAttributeInfo

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

type PenStyle

type PenStyle struct {
	Type      byte
	Style     byte
	CapStyle  byte
	JoinStyle byte
}

type Point

type Point struct {
	X int
	Y int
}

type RectangStyle

type RectangStyle struct {
	Level       int
	DrawBorder  bool
	DoFill      bool
	FillColor   Color
	BorderColor Color
	BorderWidth int
}

type Rectangle

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

type RectangleGraphic

type RectangleGraphic struct {
	Style RectangStyle
	// contains filtered or unexported fields
}

func (*RectangleGraphic) Add

func (this *RectangleGraphic) Add(child IGraphic) error

func (*RectangleGraphic) Draw

func (this *RectangleGraphic) Draw(canvas ICanvas) error

func (*RectangleGraphic) Level

func (this *RectangleGraphic) Level(child IGraphic) int

func (*RectangleGraphic) Parent

func (this *RectangleGraphic) Parent() IGraphic

func (*RectangleGraphic) Remove

func (this *RectangleGraphic) Remove(child IGraphic) error

type Size

type Size struct {
	Width  int
	Height int
}

type System

type System struct {
	// contains filtered or unexported fields
}
var SystemInstace *System

func (*System) GetCurrentLanguage

func (this *System) GetCurrentLanguage() int

func (*System) GetExePath

func (this *System) GetExePath() string

func (*System) GetLanguage

func (this *System) GetLanguage() string

func (*System) GetRootPath

func (this *System) GetRootPath() string

func (*System) GetSkinPath

func (this *System) GetSkinPath() string

func (*System) GetXmlPath

func (this *System) GetXmlPath() string

func (*System) SetCurrentLanguage

func (this *System) SetCurrentLanguage(languaeId int)

func (*System) SetRootPath

func (this *System) SetRootPath(rootPath string)

type Text

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL