scenes.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "flipper.h"
  2. #include "app_state.h"
  3. #include "scenes.h"
  4. #include "scene_main_menu.h"
  5. #include "scene_edit.h"
  6. /** collection of all scene on_enter handlers */
  7. void (*const resistors_scene_on_enter_handlers[])(void*) = {
  8. resistors_main_menu_scene_on_enter,
  9. resistors_edit_scene_on_enter};
  10. /** collection of all scene on event handlers */
  11. bool (*const resistors_scene_on_event_handlers[])(void*, SceneManagerEvent) = {
  12. resistors_main_menu_scene_on_event,
  13. resistors_edit_scene_on_event};
  14. /** collection of all scene on exit handlers */
  15. void (*const resistors_scene_on_exit_handlers[])(void*) = {
  16. resistors_main_menu_scene_on_exit,
  17. resistors_edit_scene_on_exit};
  18. /** collection of all on_enter, on_event, on_exit handlers */
  19. const SceneManagerHandlers resistors_scene_manager_handlers = {
  20. .on_enter_handlers = resistors_scene_on_enter_handlers,
  21. .on_event_handlers = resistors_scene_on_event_handlers,
  22. .on_exit_handlers = resistors_scene_on_exit_handlers,
  23. .scene_num = ResistorsSceneCount};
  24. /* callbacks */
  25. /** custom event handler */
  26. bool resistors_custom_callback(void* context, uint32_t custom_event) {
  27. furi_assert(context);
  28. App* app = context;
  29. return scene_manager_handle_custom_event(app->scene_manager, custom_event);
  30. }
  31. bool resistors_back_event_callback(void* context) {
  32. furi_assert(context);
  33. App* app = context;
  34. return scene_manager_handle_back_event(app->scene_manager);
  35. }