dolphin_i.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "dolphin.h"
  3. #include "dolphin_state.h"
  4. #include "dolphin_views.h"
  5. #include <furi.h>
  6. #include <api-hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/canvas.h>
  10. #include <menu/menu.h>
  11. #include <assets_icons.h>
  12. #include <stdint.h>
  13. typedef enum {
  14. DolphinEventTypeDeed,
  15. DolphinEventTypeSave,
  16. } DolphinEventType;
  17. typedef struct {
  18. DolphinEventType type;
  19. union {
  20. DolphinDeed deed;
  21. };
  22. } DolphinEvent;
  23. struct Dolphin {
  24. // Internal message queue
  25. osMessageQueueId_t event_queue;
  26. // State
  27. DolphinState* state;
  28. // Menu
  29. ValueMutex* menu_vm;
  30. // GUI
  31. ViewDispatcher* idle_view_dispatcher;
  32. View* idle_view_first_start;
  33. View* idle_view_main;
  34. View* idle_view_up;
  35. View* idle_view_down;
  36. View* idle_view_meta;
  37. View* view_hw_mismatch;
  38. View* view_lockmenu;
  39. ViewPort* passport;
  40. ViewPort* lock_viewport;
  41. Icon* lock_icon;
  42. bool locked;
  43. uint8_t lock_count;
  44. };
  45. // Temporary
  46. const IconName idle_scenes[] = {A_Wink_128x64, A_WatchingTV_128x64};
  47. Dolphin* dolphin_alloc();
  48. /* Save Dolphin state (write to permanent memory)
  49. * Thread safe
  50. */
  51. void dolphin_save(Dolphin* dolphin);