mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-13 06:32:26 +00:00
4cf98867a0
* Add signal API * Add signal support to loader * Add signal support to ViewDispatcher * Remove extra signal definitions * Fix typos Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com> * scripts: runfap: close current app pre-launch * loader: enable backlight when starting an app * scripts: removed distfap.py * Do not expose signal API via ViewDispatcher * scripts: runfap: iterative retry to launch * Add a loader signal subcommand * Furi, Gui: move signal handling from View Dispatcher to Event Loop Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com> Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
#pragma once
|
|
#include <furi.h>
|
|
#include <toolbox/api_lock.h>
|
|
#include <flipper_application/flipper_application.h>
|
|
#include "loader.h"
|
|
#include "loader_menu.h"
|
|
#include "loader_applications.h"
|
|
|
|
typedef struct {
|
|
char* args;
|
|
FuriThread* thread;
|
|
bool insomniac;
|
|
FlipperApplication* fap;
|
|
} LoaderAppData;
|
|
|
|
struct Loader {
|
|
FuriPubSub* pubsub;
|
|
FuriMessageQueue* queue;
|
|
LoaderMenu* loader_menu;
|
|
LoaderApplications* loader_applications;
|
|
LoaderAppData app;
|
|
};
|
|
|
|
typedef enum {
|
|
LoaderMessageTypeStartByName,
|
|
LoaderMessageTypeAppClosed,
|
|
LoaderMessageTypeShowMenu,
|
|
LoaderMessageTypeMenuClosed,
|
|
LoaderMessageTypeApplicationsClosed,
|
|
LoaderMessageTypeLock,
|
|
LoaderMessageTypeUnlock,
|
|
LoaderMessageTypeIsLocked,
|
|
LoaderMessageTypeStartByNameDetachedWithGuiError,
|
|
LoaderMessageTypeSignal,
|
|
LoaderMessageTypeGetApplicationName,
|
|
} LoaderMessageType;
|
|
|
|
typedef struct {
|
|
const char* name;
|
|
const char* args;
|
|
FuriString* error_message;
|
|
} LoaderMessageStartByName;
|
|
|
|
typedef struct {
|
|
uint32_t signal;
|
|
void* arg;
|
|
} LoaderMessageSignal;
|
|
|
|
typedef enum {
|
|
LoaderStatusErrorUnknown,
|
|
LoaderStatusErrorInvalidFile,
|
|
LoaderStatusErrorInvalidManifest,
|
|
LoaderStatusErrorMissingImports,
|
|
LoaderStatusErrorHWMismatch,
|
|
LoaderStatusErrorOutdatedApp,
|
|
LoaderStatusErrorOutOfMemory,
|
|
LoaderStatusErrorOutdatedFirmware,
|
|
} LoaderStatusError;
|
|
|
|
typedef struct {
|
|
LoaderStatus value;
|
|
LoaderStatusError error;
|
|
} LoaderMessageLoaderStatusResult;
|
|
|
|
typedef struct {
|
|
bool value;
|
|
} LoaderMessageBoolResult;
|
|
|
|
typedef struct {
|
|
FuriApiLock api_lock;
|
|
LoaderMessageType type;
|
|
|
|
union {
|
|
LoaderMessageStartByName start;
|
|
LoaderMessageSignal signal;
|
|
FuriString* application_name;
|
|
};
|
|
|
|
union {
|
|
LoaderMessageLoaderStatusResult* status_value;
|
|
LoaderMessageBoolResult* bool_value;
|
|
};
|
|
} LoaderMessage;
|