I am going insane

This commit is contained in:
2023-03-31 01:06:29 -04:00
parent 53bfc8df68
commit 7b300333cf
45 changed files with 527 additions and 508 deletions

View File

@@ -12,8 +12,6 @@ import "github.com/jezek/xgbutil/xgraphics"
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/data"
import "git.tebibyte.media/sashakoshka/tomo/input"
import "git.tebibyte.media/sashakoshka/tomo/theme"
import "git.tebibyte.media/sashakoshka/tomo/config"
import "git.tebibyte.media/sashakoshka/tomo/canvas"
// import "runtime/debug"
@@ -30,8 +28,8 @@ type window struct {
modalParent *window
hasModal bool
theme theme.Theme
config config.Config
theme tomo.Theme
config tomo.Config
selectionRequest *selectionRequest
selectionClaim *selectionClaim
@@ -334,14 +332,14 @@ func (window *window) OnClose (callback func ()) {
window.onClose = callback
}
func (window *window) SetTheme (theme theme.Theme) {
func (window *window) SetTheme (theme tomo.Theme) {
window.theme = theme
if child, ok := window.child.(tomo.Themeable); ok {
child.SetTheme(theme)
}
}
func (window *window) SetConfig (config config.Config) {
func (window *window) SetConfig (config tomo.Config) {
window.config = config
if child, ok := window.child.(tomo.Configurable); ok {
child.SetConfig(config)

View File

@@ -1,8 +1,6 @@
package x
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/theme"
import "git.tebibyte.media/sashakoshka/tomo/config"
import "github.com/jezek/xgbutil"
import "github.com/jezek/xgb/xproto"
@@ -26,8 +24,8 @@ type Backend struct {
hyper uint16
}
theme theme.Theme
config config.Config
theme tomo.Theme
config tomo.Config
windows map[xproto.Window] *window
@@ -37,11 +35,9 @@ type Backend struct {
// NewBackend instantiates an X backend.
func NewBackend () (output tomo.Backend, err error) {
backend := &Backend {
windows: map[xproto.Window] *window { },
windows: map[xproto.Window] *window { },
doChannel: make(chan func (), 32),
theme: theme.Default { },
config: config.Default { },
open: true,
open: true,
}
// connect to X
@@ -97,7 +93,7 @@ func (backend *Backend) Do (callback func ()) {
}
// SetTheme sets the theme of all open windows.
func (backend *Backend) SetTheme (theme theme.Theme) {
func (backend *Backend) SetTheme (theme tomo.Theme) {
backend.assert()
backend.theme = theme
for _, window := range backend.windows {
@@ -106,7 +102,7 @@ func (backend *Backend) SetTheme (theme theme.Theme) {
}
// SetConfig sets the configuration of all open windows.
func (backend *Backend) SetConfig (config config.Config) {
func (backend *Backend) SetConfig (config tomo.Config) {
backend.assert()
backend.config = config
for _, window := range backend.windows {