dolphin_i.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // Scene
  31. FuriThread* scene_thread;
  32. // GUI
  33. Gui* gui;
  34. ViewDispatcher* idle_view_dispatcher;
  35. View* idle_view_first_start;
  36. View* idle_view_main;
  37. View* idle_view_up;
  38. View* idle_view_down;
  39. View* idle_view_meta;
  40. View* view_hw_mismatch;
  41. View* view_lockmenu;
  42. ViewPort* lock_viewport;
  43. Icon* lock_icon;
  44. bool locked;
  45. uint8_t lock_count;
  46. };
  47. // Temporary
  48. const IconName idle_scenes[] = {A_Wink_128x64, A_WatchingTV_128x64};
  49. Dolphin* dolphin_alloc();
  50. void dolphin_free(Dolphin* dolphin);
  51. /* Save Dolphin state (write to permanent memory)
  52. * Thread safe
  53. */
  54. void dolphin_save(Dolphin* dolphin);