desktop_scene_hw_mismatch.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "../desktop_i.h"
  2. #include "../views/desktop_hw_mismatch.h"
  3. void desktop_scene_hw_mismatch_callback(DesktopHwMismatchEvent event, void* context) {
  4. Desktop* desktop = (Desktop*)context;
  5. view_dispatcher_send_custom_event(desktop->view_dispatcher, event);
  6. }
  7. void desktop_scene_hw_mismatch_on_enter(void* context) {
  8. Desktop* desktop = (Desktop*)context;
  9. desktop_hw_mismatch_set_callback(
  10. desktop->hw_mismatch_view, desktop_scene_hw_mismatch_callback, desktop);
  11. view_dispatcher_switch_to_view(desktop->view_dispatcher, DesktopViewHwMismatch);
  12. }
  13. bool desktop_scene_hw_mismatch_on_event(void* context, SceneManagerEvent event) {
  14. Desktop* desktop = (Desktop*)context;
  15. bool consumed = false;
  16. if(event.type == SceneManagerEventTypeCustom) {
  17. switch(event.event) {
  18. case DesktopHwMismatchEventExit:
  19. scene_manager_previous_scene(desktop->scene_manager);
  20. consumed = true;
  21. break;
  22. default:
  23. break;
  24. }
  25. }
  26. return consumed;
  27. }
  28. void desktop_scene_hw_mismatch_on_exit(void* context) {
  29. // Desktop* desktop = (Desktop*)context;
  30. }