loader.h 1.0 KB

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