backend.go 884 B

123456789101112131415161718192021222324252627282930313233
  1. package backend
  2. import . "gitlab.com/beoran/ebsgo/zori/types"
  3. // import "gitlab.com/beoran/ebsgo/zori/event"
  4. type Loader interface {
  5. LoadBitmap(name string) (Bitmap, error)
  6. LoadFont(name string, size int) (Font, error)
  7. }
  8. type Drawer interface {
  9. DrawBitmap(x, y int, bitmap Bitmap)
  10. DrawScaledBitmap(sx, sy, sw, sh, dx, dy, dw, dh int, bitmap Bitmap)
  11. DrawRectangle(x, y, w, h int, color Color, thickness int)
  12. DrawSlab(x, y, w, h int, color Color)
  13. DrawRoundedRectangle(x, y, w, h, rx, ry int, color Color, thickness int)
  14. DrawRoundedSlab(x, y, w, h, rx, ry int, color Color)
  15. DrawText(font Font, color Color, x, y int, text string)
  16. DrawMultilineText(font Font, color Color, x, y, max_width, line_height int, text string)
  17. }
  18. type Displayer interface {
  19. Display() Display
  20. }
  21. type Backend interface {
  22. Displayer
  23. Loader
  24. Drawer
  25. }