dolphin_i.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "dolphin.h"
  3. #include "dolphin_state.h"
  4. #include <flipper_v2.h>
  5. #include <gui/gui.h>
  6. #include <gui/widget.h>
  7. #include <gui/canvas.h>
  8. #include <menu/menu.h>
  9. #include <assets_icons.h>
  10. #include <stdint.h>
  11. typedef enum {
  12. DolphinEventTypeDeed,
  13. } DolphinEventType;
  14. typedef struct {
  15. DolphinEventType type;
  16. union {
  17. DolphinDeed deed;
  18. };
  19. } DolphinEvent;
  20. typedef enum {
  21. DolphinScreenDebug,
  22. DolphinScreenIdle,
  23. DolphinScreenStats,
  24. } DolphinScreen;
  25. struct Dolphin {
  26. Icon* icon;
  27. Widget* widget;
  28. ValueMutex* menu_vm;
  29. // State
  30. DolphinState* state;
  31. DolphinScreen screen;
  32. // Internal message queue
  33. osMessageQueueId_t event_queue;
  34. };
  35. void dolphin_draw_callback(Canvas* canvas, void* context);
  36. void dolphin_draw_idle(Canvas* canvas, Dolphin* dolphin);
  37. void dolphin_draw_debug(Canvas* canvas, Dolphin* dolphin);
  38. void dolphin_draw_stats(Canvas* canvas, Dolphin* dolphin);
  39. void dolphin_input_callback(InputEvent* event, void* context);
  40. Dolphin* dolphin_alloc();