Create image manager and related stuff

This commit is contained in:
2022-11-17 18:58:30 -05:00
parent 0fb6d8a6b2
commit db20ea707d
5 changed files with 93 additions and 3 deletions

View File

@@ -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

View File

@@ -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) {