loader.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include <core/pubsub.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define RECORD_LOADER "loader"
  8. typedef struct Loader Loader;
  9. typedef enum {
  10. LoaderStatusOk,
  11. LoaderStatusErrorAppStarted,
  12. LoaderStatusErrorUnknownApp,
  13. LoaderStatusErrorInternal,
  14. } LoaderStatus;
  15. typedef enum {
  16. LoaderEventTypeApplicationStarted,
  17. LoaderEventTypeApplicationStopped
  18. } LoaderEventType;
  19. typedef struct {
  20. LoaderEventType type;
  21. } LoaderEvent;
  22. /** Start application
  23. * @param name - application name
  24. * @param args - application arguments
  25. * @retval true on success
  26. */
  27. LoaderStatus loader_start(Loader* instance, const char* name, const char* args);
  28. /** Lock application start
  29. * @retval true on success
  30. */
  31. bool loader_lock(Loader* instance);
  32. /** Unlock application start */
  33. void loader_unlock(Loader* instance);
  34. /** Get loader lock status */
  35. bool loader_is_locked(const Loader* instance);
  36. /** Show primary loader */
  37. void loader_show_menu();
  38. /** Show primary loader */
  39. void loader_update_menu();
  40. /** Show primary loader */
  41. FuriPubSub* loader_get_pubsub(Loader* instance);
  42. #ifdef __cplusplus
  43. }
  44. #endif