dolphin_i.h 913 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "dolphin.h"
  3. #include "dolphin_state.h"
  4. #include "dolphin_views.h"
  5. #include <furi.h>
  6. #include <gui/gui.h>
  7. #include <gui/view_dispatcher.h>
  8. #include <gui/canvas.h>
  9. #include <menu/menu.h>
  10. #include <assets_icons.h>
  11. #include <stdint.h>
  12. typedef enum {
  13. DolphinEventTypeDeed,
  14. DolphinEventTypeSave,
  15. } DolphinEventType;
  16. typedef struct {
  17. DolphinEventType type;
  18. union {
  19. DolphinDeed deed;
  20. };
  21. } DolphinEvent;
  22. struct Dolphin {
  23. // Internal message queue
  24. osMessageQueueId_t event_queue;
  25. // State
  26. DolphinState* state;
  27. // Menu
  28. ValueMutex* menu_vm;
  29. // GUI
  30. ViewDispatcher* idle_view_dispatcher;
  31. View* idle_view_first_start;
  32. View* idle_view_main;
  33. View* idle_view_stats;
  34. View* idle_view_debug;
  35. };
  36. Dolphin* dolphin_alloc();
  37. /* Save Dolphin state (write to permanent memory)
  38. * Thread safe
  39. */
  40. void dolphin_save(Dolphin* dolphin);