Compare commits
3 Commits
a4e067cacb
...
0d93d73c32
Author | SHA1 | Date | |
---|---|---|---|
0d93d73c32 | |||
006921d690 | |||
f2bcc217a4 |
5
go.mod
5
go.mod
@ -3,11 +3,8 @@ module git.tebibyte.media/tomo/backend
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
git.tebibyte.media/tomo/tomo v0.34.0
|
||||
git.tebibyte.media/tomo/tomo v0.35.0
|
||||
git.tebibyte.media/tomo/typeset v0.7.1
|
||||
)
|
||||
|
||||
require (
|
||||
git.tebibyte.media/tomo/xgbkb v1.0.1
|
||||
github.com/jezek/xgb v1.1.1
|
||||
github.com/jezek/xgbutil v0.0.0-20231116234834-47f30c120111
|
||||
|
4
go.sum
4
go.sum
@ -1,6 +1,6 @@
|
||||
git.tebibyte.media/sashakoshka/xgbkb v1.0.0/go.mod h1:pNcE6TRO93vHd6q42SdwLSTTj25L0Yzggz7yLe0JV6Q=
|
||||
git.tebibyte.media/tomo/tomo v0.34.0 h1:r5yJPks9rtzdDI2RyAUdqa1qb6BebG0QFe2cTmcFi+0=
|
||||
git.tebibyte.media/tomo/tomo v0.34.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
|
||||
git.tebibyte.media/tomo/tomo v0.35.0 h1:1XvcUcWg1rBZXov3KfuX6VfiuBQ2mcJHIslHMLn07no=
|
||||
git.tebibyte.media/tomo/tomo v0.35.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
|
||||
git.tebibyte.media/tomo/typeset v0.7.1 h1:aZrsHwCG5ZB4f5CruRFsxLv5ezJUCFUFsQJJso2sXQ8=
|
||||
git.tebibyte.media/tomo/typeset v0.7.1/go.mod h1:PwDpSdBF3l/EzoIsa2ME7QffVVajnTHZN6l3MHEGe1g=
|
||||
git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE=
|
||||
|
@ -19,6 +19,8 @@ type box struct {
|
||||
parent parent
|
||||
outer anyBox
|
||||
|
||||
role tomo.Role
|
||||
|
||||
bounds image.Rectangle
|
||||
minSize image.Point
|
||||
userMinSize image.Point
|
||||
@ -106,6 +108,10 @@ func (this *box) MinimumSize () image.Point {
|
||||
return this.minSize
|
||||
}
|
||||
|
||||
func (this *box) Role () tomo.Role {
|
||||
return this.role
|
||||
}
|
||||
|
||||
func (this *box) borderSum () tomo.Inset {
|
||||
sum := tomo.Inset { }
|
||||
for _, border := range this.border {
|
||||
@ -182,6 +188,10 @@ func (this *box) SetPadding (padding tomo.Inset) {
|
||||
this.invalidateMinimum()
|
||||
}
|
||||
|
||||
func (this *box) SetRole (role tomo.Role) {
|
||||
this.role = role
|
||||
}
|
||||
|
||||
func (this *box) SetDNDData (dat data.Data) {
|
||||
this.dndData = dat
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ func (this *Backend) NewTexture (source image.Image) canvas.TextureCloser {
|
||||
return xcanvas.NewTextureFrom(source)
|
||||
}
|
||||
|
||||
func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.Canvas {
|
||||
func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.CanvasCloser {
|
||||
return xcanvas.NewCanvas(this.x, bounds)
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,10 @@ func (this *Canvas) Push (window xproto.Window) {
|
||||
}
|
||||
|
||||
// Close frees this canvas from the X server.
|
||||
func (this *Canvas) Close () {
|
||||
func (this *Canvas) Close () error {
|
||||
this.assert()
|
||||
this.Image.Destroy()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *Canvas) assert () {
|
||||
|
Loading…
Reference in New Issue
Block a user