2023-05-04 03:48:13 +00:00
|
|
|
#pragma once
|
2021-07-18 18:09:00 +00:00
|
|
|
#include <furi.h>
|
2023-05-04 03:48:13 +00:00
|
|
|
#include <toolbox/api_lock.h>
|
|
|
|
#include "loader.h"
|
|
|
|
#include "loader_menu.h"
|
2021-09-28 13:10:13 +00:00
|
|
|
|
2023-05-04 03:48:13 +00:00
|
|
|
typedef struct {
|
|
|
|
char* args;
|
|
|
|
char* name;
|
|
|
|
FuriThread* thread;
|
|
|
|
bool insomniac;
|
|
|
|
} LoaderAppData;
|
2021-07-18 18:09:00 +00:00
|
|
|
|
|
|
|
struct Loader {
|
2022-01-02 21:39:56 +00:00
|
|
|
FuriPubSub* pubsub;
|
2023-05-04 03:48:13 +00:00
|
|
|
FuriMessageQueue* queue;
|
|
|
|
LoaderMenu* loader_menu;
|
|
|
|
LoaderAppData app;
|
2021-07-18 18:09:00 +00:00
|
|
|
};
|
2021-09-28 13:10:13 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2023-05-04 03:48:13 +00:00
|
|
|
LoaderMessageTypeStartByName,
|
|
|
|
LoaderMessageTypeAppClosed,
|
|
|
|
LoaderMessageTypeShowMenu,
|
|
|
|
LoaderMessageTypeMenuClosed,
|
|
|
|
LoaderMessageTypeLock,
|
|
|
|
LoaderMessageTypeUnlock,
|
|
|
|
LoaderMessageTypeIsLocked,
|
|
|
|
} LoaderMessageType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char* name;
|
|
|
|
const char* args;
|
|
|
|
} LoaderMessageStartByName;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
LoaderStatus value;
|
|
|
|
} LoaderMessageLoaderStatusResult;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
bool value;
|
|
|
|
} LoaderMessageBoolResult;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuriApiLock api_lock;
|
|
|
|
LoaderMessageType type;
|
|
|
|
|
|
|
|
union {
|
|
|
|
LoaderMessageStartByName start;
|
|
|
|
};
|
|
|
|
|
|
|
|
union {
|
|
|
|
LoaderMessageLoaderStatusResult* status_value;
|
|
|
|
LoaderMessageBoolResult* bool_value;
|
|
|
|
};
|
|
|
|
} LoaderMessage;
|