Add ability to create an undecorated window
This commit is contained in:
parent
bebd58dac1
commit
89f7bf47ce
|
@ -11,12 +11,19 @@ import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
type Backend interface {
|
type Backend interface {
|
||||||
// These methods create new objects. The backend must reject any object
|
// These methods create new objects. The backend must reject any object
|
||||||
// that was not made by it.
|
// that was not made by it.
|
||||||
NewWindow (image.Rectangle) (MainWindow, error)
|
|
||||||
NewBox () Box
|
NewBox () Box
|
||||||
NewTextBox () TextBox
|
NewTextBox () TextBox
|
||||||
NewCanvasBox () CanvasBox
|
NewCanvasBox () CanvasBox
|
||||||
NewContainerBox () ContainerBox
|
NewContainerBox () ContainerBox
|
||||||
|
|
||||||
|
// NewWindow creates a normal MainWindow and returns it.
|
||||||
|
NewWindow (image.Rectangle) (MainWindow, error)
|
||||||
|
|
||||||
|
// NewPlainWindow creates an undecorated window that does not appear in
|
||||||
|
// window lists and returns it. This is intended for making things like
|
||||||
|
// panels, docks, etc.
|
||||||
|
NewPlainWindow (image.Rectangle) (MainWindow, error)
|
||||||
|
|
||||||
// NewTexture creates a new texture from an image. The backend must
|
// NewTexture creates a new texture from an image. The backend must
|
||||||
// reject any texture that was not made by it.
|
// reject any texture that was not made by it.
|
||||||
NewTexture (image.Image) canvas.TextureCloser
|
NewTexture (image.Image) canvas.TextureCloser
|
||||||
|
|
8
tomo.go
8
tomo.go
|
@ -57,6 +57,14 @@ func NewWindow (bounds image.Rectangle) (MainWindow, error) {
|
||||||
return backend.NewWindow(bounds)
|
return backend.NewWindow(bounds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewPlainWindow is like NewWindow, but it creates an undecorated window that
|
||||||
|
// does not appear in window lists. It is intended for creating things like
|
||||||
|
// docks, panels, etc.
|
||||||
|
func NewPlainWindow (bounds image.Rectangle) (MainWindow, error) {
|
||||||
|
assertBackend()
|
||||||
|
return backend.NewPlainWindow(bounds)
|
||||||
|
}
|
||||||
|
|
||||||
// NewBox creates and returns a basic Box.
|
// NewBox creates and returns a basic Box.
|
||||||
func NewBox () Box {
|
func NewBox () Box {
|
||||||
assertBackend()
|
assertBackend()
|
||||||
|
|
Loading…
Reference in New Issue