ui

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 16 Imported by: 4

README

// Low level Window interface

Methods:
- Show Window
  - Form
  - Modal Form
  - Popup Form
- Close Window
- Set title
- Resize
- Move

Events:
- Window Created
- Window Closing
- Window Closed
- Window Size Changed
- Window Position Changed

Entities:
- Visibility
- Title
- Size
- Position

Types:
- Regular
- Modal
- Popup

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CursorArrow *glfw.Cursor
View Source
var CursorIBeam *glfw.Cursor
View Source
var CursorPointer *glfw.Cursor
View Source
var CursorResizeHor *glfw.Cursor
View Source
var CursorResizeVer *glfw.Cursor
View Source
var ServiceDrawBorders = false
View Source
var SimpleProgram uint32 = 0
View Source
var SimpleProgramFragment = `#version 330 core

out vec4 color;

uniform vec4 pixelColor;

void main()
{
    color = pixelColor;
}` + "\x00"
View Source
var SimpleProgramLoaded = false
View Source
var SimpleProgramVertex = `#version 330 core

layout (location = 0) in vec3 position;

void main()
{
    gl_Position = vec4(position.x, position.y, position.z, 1.0);
}` + "\x00"
View Source
var UseOpenGL33 bool = false

Functions

func InitOpenGL33

func InitOpenGL33()

func InitUI

func InitUI() error

func InitUISystem

func InitUISystem()

Types

type ClipSettings

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

type DrawContext

type DrawContext interface {
	Init()

	SetColor(col color.Color)
	SetStrokeWidth(w int)
	SetFontFamily(fontFamily string)
	SetFontSize(s float64)
	SetTextAlign(h canvas.HAlign, v canvas.VAlign)
	SetUnderline(underline bool)

	DrawLine(x1, y1, x2, y2 int)
	DrawEllipse(x, y, width, height int)
	DrawRect(x, y, width, height int)
	FillRect(x, y, width, height int)
	Save()
	Load()
	Translate(x, y int)
	//Clip(x, y, width, height int)
	ClipIn(x, y, width, height int)
	DrawImage(x, y, width, height int, img image.Image)
	DrawText(x, y, width, height int, text string)
	MeasureText(text string) (int, int)

	TranslatedX() int
	TranslatedY() int
	ClippedRegion() (int, int, int, int)

	GraphContextImage() *image.RGBA
	GG() *gg.Context

	State() canvas.CanvasDirectState

	Finish()
}

type DrawContextBase

type DrawContextBase struct {
	// Current settings
	CurrentColor color.Color
	StrokeWidth  int
	FontFamily   string
	FontSize     float64
	UnderLine    bool
	TextHAlign   canvas.HAlign
	TextVAlign   canvas.VAlign

	CurrentClipSettings ClipSettings
	StackClipSettings   stack.Stack
	WindowWidth         int
	WindowHeight        int

	Window *glfw.Window
}

func (*DrawContextBase) Finish

func (c *DrawContextBase) Finish()

func (*DrawContextBase) InitBase

func (c *DrawContextBase) InitBase()

func (*DrawContextBase) Load

func (c *DrawContextBase) Load()

func (*DrawContextBase) Save

func (c *DrawContextBase) Save()

func (*DrawContextBase) SetColor

func (c *DrawContextBase) SetColor(col color.Color)

func (*DrawContextBase) SetFontFamily

func (c *DrawContextBase) SetFontFamily(fontFamily string)

func (*DrawContextBase) SetFontSize

func (c *DrawContextBase) SetFontSize(s float64)

func (*DrawContextBase) SetStrokeWidth

func (c *DrawContextBase) SetStrokeWidth(w int)

func (*DrawContextBase) SetTextAlign

func (c *DrawContextBase) SetTextAlign(h canvas.HAlign, v canvas.VAlign)

func (*DrawContextBase) SetUnderline

func (c *DrawContextBase) SetUnderline(underline bool)

func (*DrawContextBase) TranslateAndClip

func (c *DrawContextBase) TranslateAndClip(x, y, width, height int)

type DrawContextGL

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

func NewDrawContext

func NewDrawContext(windowWidth, windowHeight int) *DrawContextGL

func (*DrawContextGL) Clip

func (c *DrawContextGL) Clip(x, y, width, height int)

func (*DrawContextGL) DrawEllipse

func (c *DrawContextGL) DrawEllipse(x, y, width, height int)

func (*DrawContextGL) DrawPolygon

func (c *DrawContextGL) DrawPolygon(x, y, width, height int)

func (*DrawContextGL) DrawText

func (c *DrawContextGL) DrawText(x, y, width, height int, text string)

func (*DrawContextGL) SetColor

func (c *DrawContextGL) SetColor(col color.Color)

func (*DrawContextGL) SetFont

func (c *DrawContextGL) SetFont(fontFamily string, fontSize float64, bold, italic, underline bool)

func (*DrawContextGL) UnClip

func (c *DrawContextGL) UnClip()

type DrawContextOpenGL

type DrawContextOpenGL struct {
	DrawContextBase
}

func NewDrawContextOpenGL

func NewDrawContextOpenGL(window *glfw.Window) *DrawContextOpenGL

func (*DrawContextOpenGL) Clip

func (c *DrawContextOpenGL) Clip(x, y, width, height int)

func (*DrawContextOpenGL) ClipIn

func (c *DrawContextOpenGL) ClipIn(x, y, width, height int)

func (*DrawContextOpenGL) ClippedRegion

func (c *DrawContextOpenGL) ClippedRegion() (int, int, int, int)

func (*DrawContextOpenGL) DrawEllipse

func (c *DrawContextOpenGL) DrawEllipse(x, y, width, height int)

func (*DrawContextOpenGL) DrawImage

func (c *DrawContextOpenGL) DrawImage(x, y, width, height int, img image.Image)

func (*DrawContextOpenGL) DrawLine

func (c *DrawContextOpenGL) DrawLine(x1, y1, x2, y2 int)

func (*DrawContextOpenGL) DrawRect

func (c *DrawContextOpenGL) DrawRect(x, y, width, height int)

func (*DrawContextOpenGL) DrawText

func (c *DrawContextOpenGL) DrawText(x, y, width, height int, text string)

func (*DrawContextOpenGL) FillRect

func (c *DrawContextOpenGL) FillRect(x, y, width, height int)

func (*DrawContextOpenGL) Finish

func (c *DrawContextOpenGL) Finish()

func (*DrawContextOpenGL) GG

func (c *DrawContextOpenGL) GG() *gg.Context

func (*DrawContextOpenGL) GraphContextImage

func (c *DrawContextOpenGL) GraphContextImage() *image.RGBA

func (*DrawContextOpenGL) Init

func (c *DrawContextOpenGL) Init()

func (*DrawContextOpenGL) Load

func (c *DrawContextOpenGL) Load()

func (*DrawContextOpenGL) MeasureText

func (c *DrawContextOpenGL) MeasureText(text string) (int, int)

func (*DrawContextOpenGL) Save

func (c *DrawContextOpenGL) Save()

func (*DrawContextOpenGL) State

func (*DrawContextOpenGL) Translate

func (c *DrawContextOpenGL) Translate(x, y int)

func (*DrawContextOpenGL) TranslatedX

func (c *DrawContextOpenGL) TranslatedX() int

func (*DrawContextOpenGL) TranslatedY

func (c *DrawContextOpenGL) TranslatedY() int

type DrawContextSW

type DrawContextSW struct {
	DrawContextBase
	// contains filtered or unexported fields
}

func NewDrawContextSW

func NewDrawContextSW(window *glfw.Window) *DrawContextSW

func NewDrawContextSWSpecial

func NewDrawContextSWSpecial(width, height int) *DrawContextSW

func (*DrawContextSW) ClipIn

func (c *DrawContextSW) ClipIn(x, y, width, height int)

func (*DrawContextSW) ClippedRegion

func (c *DrawContextSW) ClippedRegion() (int, int, int, int)

func (*DrawContextSW) DrawEllipse

func (c *DrawContextSW) DrawEllipse(x, y, width, height int)

func (*DrawContextSW) DrawImage

func (c *DrawContextSW) DrawImage(x, y, width, height int, img image.Image)

func (*DrawContextSW) DrawLine

func (c *DrawContextSW) DrawLine(x1, y1, x2, y2 int)

func (*DrawContextSW) DrawRect

func (c *DrawContextSW) DrawRect(x, y, width, height int)

func (*DrawContextSW) DrawText

func (c *DrawContextSW) DrawText(x, y, width, height int, text string)

func (*DrawContextSW) FillRect

func (c *DrawContextSW) FillRect(x, y, width, height int)

func (*DrawContextSW) Finish

func (c *DrawContextSW) Finish()

func (*DrawContextSW) GG

func (c *DrawContextSW) GG() *gg.Context

func (*DrawContextSW) GraphContextImage

func (c *DrawContextSW) GraphContextImage() *image.RGBA

func (*DrawContextSW) Init

func (c *DrawContextSW) Init()

func (*DrawContextSW) Load

func (c *DrawContextSW) Load()

func (*DrawContextSW) MeasureText

func (c *DrawContextSW) MeasureText(text string) (int, int)

func (*DrawContextSW) Save

func (c *DrawContextSW) Save()

func (*DrawContextSW) State

func (*DrawContextSW) Translate

func (c *DrawContextSW) Translate(x, y int)

func (*DrawContextSW) TranslatedX

func (c *DrawContextSW) TranslatedX() int

func (*DrawContextSW) TranslatedY

func (c *DrawContextSW) TranslatedY() int

type ImageCache

type ImageCache struct {
	stats.Obj
	// contains filtered or unexported fields
}

func NewImageCache

func NewImageCache(name string) *ImageCache

func (*ImageCache) Clear

func (c *ImageCache) Clear()

func (*ImageCache) ClearXY

func (c *ImageCache) ClearXY(x, y int)

func (*ImageCache) GetXY

func (c *ImageCache) GetXY(x, y int) *canvas.CanvasDirect

func (*ImageCache) SetXY

func (c *ImageCache) SetXY(x, y int, cnv *canvas.CanvasDirect)

type MouseCursor

type MouseCursor int
const (
	MouseCursorNotDefined MouseCursor = 0
	MouseCursorArrow      MouseCursor = 1
	MouseCursorPointer    MouseCursor = 2
	MouseCursorResizeHor  MouseCursor = 3
	MouseCursorResizeVer  MouseCursor = 4
	MouseCursorIBeam      MouseCursor = 5
)

type Point

type Point struct {
	X int
	Y int
}

type StateStruct

type StateStruct struct {
	CurrentColor color.Color
	StrokeWidth  int
	FontFamily   string
	FontSize     float64
	UnderLine    bool
	TextHAlign   canvas.HAlign
	TextVAlign   canvas.VAlign

	CurrentClipSettings ClipSettings
}

type WidgetEvent

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

func (*WidgetEvent) AddListener

func (c *WidgetEvent) AddListener(l func()) int

func (*WidgetEvent) Invoke

func (c *WidgetEvent) Invoke()

func (*WidgetEvent) RemoveAllListeners

func (c *WidgetEvent) RemoveAllListeners()

func (*WidgetEvent) RemoveListener

func (c *WidgetEvent) RemoveListener(id int)

Jump to

Keyboard shortcuts

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