Documentation
¶
Index ¶
- Variables
- func Register(d driver.Driver)
- type Application
- func (app *Application) Chan() <-chan event.Eventer
- func (app *Application) ClipboardGet(typeID int)
- func (app *Application) ClipboardPut(c clipboard.Clipboarder)
- func (app *Application) Close()
- func (app *Application) NewFont(height int, attributes map[string]string) *Font
- func (app *Application) NewFrame(rect image.Rectangle) *Frame
- func (app *Application) NewImage(img image.Image) *Image
- func (app *Application) NewMenu(label string) *Menu
- func (app *Application) NewWindow(rect image.Rectangle, background color.Color) *Window
- func (app *Application) Size(rect image.Rectangle)
- func (app *Application) Sync()
- func (app *Application) Title(title string)
- type Font
- type Frame
- type Image
- type Menu
- type Window
- func (w *Window) Clear()
- func (w *Window) Drop()
- func (w *Window) Fill(rect image.Rectangle, foreground color.Color)
- func (w *Window) Image(rect image.Rectangle, img *Image)
- func (w *Window) Line(from image.Point, to image.Point, foreground color.Color)
- func (w *Window) Raise()
- func (w *Window) Show()
- func (w *Window) Size(rect image.Rectangle)
- func (w *Window) Text(text string, font *Font, from image.Point, foreground color.Color)
Constants ¶
This section is empty.
Variables ¶
var NewApplication = func(rect image.Rectangle, title string) *Application { log.Fatalf("GUI driver must be registered. Add GTK driver to use by default:\nimport _ \"github.com/codeation/impress/duo\"") return nil }
NewApplication creates the main application window for the default GUI driver. Consider using the MakeApplication function instead.
var NewFont func(height int, attributes map[string]string) *Font
NewFont returns a Font struct for the default GUI driver.
Deprecated: Use the *Application.NewFont function instead.
var NewImage func(img image.Image) *Image
NewImage returns an Image struct containing the image resources for the default GUI driver.
Deprecated: Use the *Application.NewImage function instead.
Functions ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application represents the top-level window of the application.
func MakeApplication ¶ added in v0.5.0
MakeApplication creates the top application window for the specified GUI driver.
func (*Application) Chan ¶ added in v0.1.10
func (app *Application) Chan() <-chan event.Eventer
Chan returns the event channel.
func (*Application) ClipboardGet ¶ added in v0.4.0
func (app *Application) ClipboardGet(typeID int)
ClipboardGet requests an event with the clipboard content.
func (*Application) ClipboardPut ¶ added in v0.4.0
func (app *Application) ClipboardPut(c clipboard.Clipboarder)
ClipboardPut sets the content to the OS clipboard.
func (*Application) NewFont ¶ added in v0.5.0
func (app *Application) NewFont(height int, attributes map[string]string) *Font
NewFont returns a Font struct representing a font selection. Note that "family" and other attributes are driver-specific. Open duo/font.go for details.
func (*Application) NewFrame ¶ added in v0.2.4
func (app *Application) NewFrame(rect image.Rectangle) *Frame
NewFrame creates a new inner frame with the specified size.
func (*Application) NewImage ¶ added in v0.5.0
func (app *Application) NewImage(img image.Image) *Image
NewImage returns an Image struct containing the image resources.
func (*Application) NewMenu ¶ added in v0.1.7
func (app *Application) NewMenu(label string) *Menu
NewMenu returns a new top-level menu node with the specified label.
func (*Application) NewWindow ¶
NewWindow creates a new inner window with a specified size and background color.
func (*Application) Size ¶
func (app *Application) Size(rect image.Rectangle)
Size sets the application window size.
func (*Application) Sync ¶ added in v0.2.3
func (app *Application) Sync()
Sync flushes the graphics content to the screen driver.
func (*Application) Title ¶
func (app *Application) Title(title string)
Title sets the application window title.
type Font ¶
type Font struct { Height int LineHeight int Baseline int Ascent int Descent int Attributes map[string]string // contains filtered or unexported fields }
Font represents a font selection.
func (*Font) Close ¶
func (f *Font) Close()
Close destroys the font selection. Note that a closed font can no longer be used.
type Frame ¶ added in v0.2.4
type Frame struct {
// contains filtered or unexported fields
}
Frame represents a GUI frame.
func (*Frame) Drop ¶ added in v0.2.4
func (f *Frame) Drop()
Drop deletes the frame. Note that a dropped frame can no longer be used.
func (*Frame) NewFrame ¶ added in v0.2.4
NewFrame creates a new child frame with the specified size.
func (*Frame) NewWindow ¶ added in v0.2.4
NewWindow creates a new frame window with a specified size and background color.
type Menu ¶ added in v0.1.7
type Menu struct {
// contains filtered or unexported fields
}
Menu represents any menu node.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window represents an inner window.
func (*Window) Drop ¶
func (w *Window) Drop()
Drop deletes the window. Note that a dropped window can no longer be used.
func (*Window) Image ¶
Image draws an image into the specified rectangle. Specify a different rectangle size to scale the image.
func (*Window) Raise ¶ added in v0.1.7
func (w *Window) Raise()
Raise brings the window to the forefront.
func (*Window) Show ¶
func (w *Window) Show()
Show sends the contents of the window to the screen. Note that drawings are not visible until Show is called.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package to register WebAssembly driver as default impress driver
|
Package to register WebAssembly driver as default impress driver |
canvasdriver
Package to connect to WebAssembly driver
|
Package to connect to WebAssembly driver |
Package to register GTK driver as default impress driver
|
Package to register GTK driver as default impress driver |
duodriver
Package to connect to GTK driver
|
Package to connect to GTK driver |
Package event defines various types of GUI events
|
Package event defines various types of GUI events |
examples
|
|
joint
|
|
bus
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
domain
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
drawrecv
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
drawsend
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
drawwait
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
eventchan
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
eventrecv
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
eventsend
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
idcycle
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
iface
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
lazy
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
rpc
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |
serversocket
Package implements an internal mechanism to communicate with an impress terminal.
|
Package implements an internal mechanism to communicate with an impress terminal. |