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>
|
2023-06-23 12:01:40 +00:00
|
|
|
#include <flipper_application/flipper_application.h>
|
2023-05-04 03:48:13 +00:00
|
|
|
#include "loader.h"
|
|
|
|
#include "loader_menu.h"
|
2023-06-23 12:01:40 +00:00
|
|
|
#include "loader_applications.h"
|
2021-09-28 13:10:13 +00:00
|
|
|
|
2023-05-04 03:48:13 +00:00
|
|
|
typedef struct {
|
|
|
|
char* args;
|
|
|
|
FuriThread* thread;
|
|
|
|
bool insomniac;
|
2023-06-23 12:01:40 +00:00
|
|
|
FlipperApplication* fap;
|
2023-05-04 03:48:13 +00:00
|
|
|
} 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;
|
2023-06-23 12:01:40 +00:00
|
|
|
LoaderApplications* loader_applications;
|
2023-05-04 03:48:13 +00:00
|
|
|
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,
|
2023-06-23 12:01:40 +00:00
|
|
|
LoaderMessageTypeApplicationsClosed,
|
2023-05-04 03:48:13 +00:00
|
|
|
LoaderMessageTypeLock,
|
|
|
|
LoaderMessageTypeUnlock,
|
|
|
|
LoaderMessageTypeIsLocked,
|
2024-04-09 13:42:03 +00:00
|
|
|
LoaderMessageTypeStartByNameDetachedWithGuiError,
|
2024-06-21 20:44:36 +00:00
|
|
|
LoaderMessageTypeSignal,
|
|
|
|
LoaderMessageTypeGetApplicationName,
|
2023-05-04 03:48:13 +00:00
|
|
|
} LoaderMessageType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char* name;
|
|
|
|
const char* args;
|
2023-06-23 12:01:40 +00:00
|
|
|
FuriString* error_message;
|
2023-05-04 03:48:13 +00:00
|
|
|
} LoaderMessageStartByName;
|
|
|
|
|
2024-06-21 20:44:36 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t signal;
|
|
|
|
void* arg;
|
|
|
|
} LoaderMessageSignal;
|
|
|
|
|
2024-06-17 15:40:47 +00:00
|
|
|
typedef enum {
|
|
|
|
LoaderStatusErrorUnknown,
|
|
|
|
LoaderStatusErrorInvalidFile,
|
|
|
|
LoaderStatusErrorInvalidManifest,
|
|
|
|
LoaderStatusErrorMissingImports,
|
|
|
|
LoaderStatusErrorHWMismatch,
|
|
|
|
LoaderStatusErrorOutdatedApp,
|
|
|
|
LoaderStatusErrorOutOfMemory,
|
|
|
|
LoaderStatusErrorOutdatedFirmware,
|
|
|
|
} LoaderStatusError;
|
|
|
|
|
2023-05-04 03:48:13 +00:00
|
|
|
typedef struct {
|
|
|
|
LoaderStatus value;
|
2024-06-17 15:40:47 +00:00
|
|
|
LoaderStatusError error;
|
2023-05-04 03:48:13 +00:00
|
|
|
} LoaderMessageLoaderStatusResult;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
bool value;
|
|
|
|
} LoaderMessageBoolResult;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FuriApiLock api_lock;
|
|
|
|
LoaderMessageType type;
|
|
|
|
|
|
|
|
union {
|
|
|
|
LoaderMessageStartByName start;
|
2024-06-21 20:44:36 +00:00
|
|
|
LoaderMessageSignal signal;
|
|
|
|
FuriString* application_name;
|
2023-05-04 03:48:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
union {
|
|
|
|
LoaderMessageLoaderStatusResult* status_value;
|
|
|
|
LoaderMessageBoolResult* bool_value;
|
|
|
|
};
|
|
|
|
} LoaderMessage;
|