12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package widget
- import . "gitlab.com/beoran/ebsgo/zori/types"
- import "gitlab.com/beoran/ebsgo/zori/event"
- import "gitlab.com/beoran/ebsgo/zori/backend"
- import "gitlab.com/beoran/ebsgo/zori/style"
- import "gitlab.com/beoran/ebsgo/monolog"
- type Root struct {
- * Basic
- Icons map[string]Bitmap
- MyConsole Console
- UITheme style.Theme
- Cursors
- Active *PageWidget
- }
- func NewRoot (backend backend.Backend, theme * style.Theme) * Root {
- root := &Root{}
- if theme != nil {
- root.UITheme = * theme
- }
- root.Basic = NewBasicWithTheme(nil, nil, theme, nil)
- root.Be = backend
- root.MyRoot= root
- return root
- }
- func NewRootWidget(backend backend.Backend, theme * style.Theme) Widget {
- return Widget(NewRoot(backend, theme))
- }
- func (root * Root) Dispatch(ev event.Event) event.Result {
- return DispatchRecursive(root, ev)
- }
- func (root * Root) Draw(ev event.Draw) event.Result {
- monolog.Debug("Root.Draw")
- return event.Pass
- }
- func (root * Root) Update(ev event.Update) event.Result {
- return event.Pass
- }
- func (root * Root) MouseCursor() Cursor {
- return root.Cursors.Mouse
- }
- func (root * Root) KeyjoyCursor() Cursor {
- return root.Cursors.Keyjoy
- }
- func (root Root) MarkedTheme() style.Theme {
- return root.Cursors.Keyjoy.TargetTheme
- }
- func (root Root) HoveredTheme() style.Theme {
- return root.Cursors.Mouse.TargetTheme
- }
|