Create image manager and related stuff
This commit is contained in:
@@ -19,8 +19,9 @@ import "github.com/flopp/go-findfont"
|
||||
|
||||
// factory instantiates an X backend.
|
||||
func factory (
|
||||
application *stone.Application,
|
||||
application *stone.Application,
|
||||
callbackManager *stone.CallbackManager,
|
||||
imageManager *stone.ImageManager,
|
||||
) (
|
||||
output stone.Backend,
|
||||
err error,
|
||||
@@ -29,6 +30,7 @@ func factory (
|
||||
application: application,
|
||||
config: application.Config(),
|
||||
callbackManager: callbackManager,
|
||||
imageManager: imageManager,
|
||||
}
|
||||
|
||||
// load font
|
||||
|
||||
@@ -17,6 +17,7 @@ type Backend struct {
|
||||
application *stone.Application
|
||||
config *stone.Config
|
||||
callbackManager *stone.CallbackManager
|
||||
imageManager *stone.ImageManager
|
||||
connection *xgbutil.XUtil
|
||||
window *xwindow.Window
|
||||
canvas *xgraphics.Image
|
||||
@@ -88,6 +89,12 @@ func (backend *Backend) SetIcon (icons []image.Image) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (backend *Backend) CellMetrics () (width, height int) {
|
||||
width = backend.metrics.cellWidth
|
||||
height = backend.metrics.cellHeight
|
||||
return
|
||||
}
|
||||
|
||||
// calculateWindowSize calculates window bounds based on the internal buffer
|
||||
// size.
|
||||
func (backend *Backend) calculateWindowSize () (x, y int) {
|
||||
|
||||
Reference in New Issue
Block a user