-
Notifications
You must be signed in to change notification settings - Fork 0
/
impress.go
35 lines (29 loc) · 1.05 KB
/
impress.go
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
package impress
import (
"image"
"log"
"github.com/codeation/impress/driver"
)
// NewApplication creates main application window for default GUI driver.
// Consider using MakeApplication func instead
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
}
// NewImage returns a image resources struct for default GUI driver.
//
// Deprecated: Use *Application.NewImage func instead.
var NewImage func(img image.Image) *Image
// NewFont return a font selection struct for default GUI driver.
//
// Deprecated: Use *Application.NewFont func instead.
var NewFont func(height int, attributes map[string]string) *Font
// Register is an internal function that makes the GUI driver available.
func Register(d driver.Driver) {
NewApplication = func(rect image.Rectangle, title string) *Application {
app := MakeApplication(d, rect, title)
NewImage = app.NewImage
NewFont = app.NewFont
return app
}
}