unleashed-firmware/applications/services/loader/loader_i.h
Sergey Gavrilov 761a14e6e2
[FL-2837][FL-3270] Loader refaptoring: second encounter (#2779)
* Core: rename internal FlipperApplication to FlipperInternalApplication
* FAP Loader: move load_name_and_icon to flipper_application library
* Loader menu: rework api
* View holder: move to gui service
* Loader: simple "loading" worker
* Loader: applications dialog
* Loader: fapping
* Update f18 api
* Apps: remove fap_loader
* Libs, flipper application: store args, rename thread allocation
* Loader: error handling
* Apps: use loader error handling
* Loader: documentation
* FBT: accomodate loader
* Loader: do not raise gui error if loader is locked
* Archive: accomodate loader
* Loader: fix loading message
* Flipper: drop some old dolphin legacy
* Loader: generalize error construction

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-06-23 21:01:40 +09:00

62 lines
1.3 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,
} LoaderMessageType;
typedef struct {
const char* name;
const char* args;
FuriString* error_message;
} 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;