widget.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package widget
  2. import . "gitlab.com/beoran/ebsgo/zori/types"
  3. import "gitlab.com/beoran/ebsgo/zori/backend"
  4. import "gitlab.com/beoran/ebsgo/zori/state"
  5. import "gitlab.com/beoran/ebsgo/zori/style"
  6. import "gitlab.com/beoran/ebsgo/zori/event"
  7. /* Mouse or keyboard/joystick cursor. */
  8. type Cursor struct {
  9. Point
  10. Hover Widget
  11. Focus Widget
  12. Bitmap
  13. state.Flag
  14. style.Basic
  15. TargetTheme style.Theme
  16. }
  17. /* Support multiple cursors... */
  18. type Cursors struct {
  19. Mouse Cursor
  20. Keyjoy Cursor
  21. }
  22. type Prioritized interface {
  23. Priority() int
  24. }
  25. type Backended interface {
  26. Backend() backend.Backend
  27. }
  28. type Parented interface {
  29. Parent() Widget
  30. Children() []Widget
  31. }
  32. type Rooted interface {
  33. Root() RootWidget
  34. }
  35. type Moveable interface {
  36. MoveBy(dx, dy int)
  37. }
  38. type Widget interface {
  39. Sized
  40. Positioned
  41. Prioritized
  42. style.Themed
  43. Backended
  44. Parented
  45. Rooted
  46. Moveable
  47. String() string
  48. event.Handler
  49. }
  50. type RootWidget interface {
  51. Widget
  52. MouseCursor() Cursor
  53. KeyjoyCursor() Cursor
  54. MarkedTheme() style.Theme
  55. HoveredTheme() style.Theme
  56. }