desktop_debug.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <gui/gui_i.h>
  3. #include <gui/view.h>
  4. #include <gui/canvas.h>
  5. #include <gui/elements.h>
  6. #include <furi.h>
  7. #include <storage/storage.h>
  8. typedef enum {
  9. DesktopDebugEventDeed,
  10. DesktopDebugEventWrongDeed,
  11. DesktopDebugEventSaveState,
  12. DesktopDebugEventExit,
  13. } DesktopDebugEvent;
  14. typedef struct DesktopDebugView DesktopDebugView;
  15. typedef void (*DesktopDebugViewCallback)(DesktopDebugEvent event, void* context);
  16. // Debug info
  17. typedef enum {
  18. DesktopViewStatsFw,
  19. DesktopViewStatsBoot,
  20. DesktopViewStatsMeta,
  21. DesktopViewStatsTotalCount,
  22. } DesktopViewStatsScreens;
  23. struct DesktopDebugView {
  24. View* view;
  25. DesktopDebugViewCallback callback;
  26. void* context;
  27. };
  28. typedef struct {
  29. uint32_t icounter;
  30. uint32_t butthurt;
  31. DesktopViewStatsScreens screen;
  32. } DesktopDebugViewModel;
  33. void desktop_debug_set_callback(
  34. DesktopDebugView* debug_view,
  35. DesktopDebugViewCallback callback,
  36. void* context);
  37. View* desktop_debug_get_view(DesktopDebugView* debug_view);
  38. DesktopDebugView* desktop_debug_alloc();
  39. void desktop_debug_free(DesktopDebugView* debug_view);
  40. void desktop_debug_get_dolphin_data(DesktopDebugView* debug_view);
  41. void desktop_debug_reset_screen_idx(DesktopDebugView* debug_view);