Ken Van Hoeylandt 27730260e0
Project restructuring: add tactility-headless (#55)
- Created `tactility-headless` to support ESP32 firmwares that don't require graphics
- `tactility` subproject now contains both PC and ESP32 code (to avoid having to split up `tactility` and `tactility-headless` into separate projects, which would result in a very complex dependency tree)
- `tactility` subproject is now defined as component for ESP32 and as regular module for PC
- Improvements for dispatcher
- Added `project-structure.puml` to docs
- `Gui` service now depends on `Loader` service instead of the reverse
- Added `statusbar_updater` service for updating Wi-Fi and SD card icons
2024-08-31 17:56:28 +02:00

78 lines
1.6 KiB
C

#pragma once
#include "app_manifest.h"
#include "bundle.h"
#include "pubsub.h"
#include "service_manifest.h"
#include "tactility_core.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Loader Loader;
typedef enum {
LoaderStatusOk,
LoaderStatusErrorAppStarted,
LoaderStatusErrorUnknownApp,
LoaderStatusErrorInternal,
} LoaderStatus;
typedef enum {
LoaderEventTypeApplicationStarted,
LoaderEventTypeApplicationShowing,
LoaderEventTypeApplicationHiding,
LoaderEventTypeApplicationStopped
} LoaderEventType;
typedef struct {
App* app;
} LoaderEventAppStarted;
typedef struct {
App* app;
} LoaderEventAppShowing;
typedef struct {
App* app;
} LoaderEventAppHiding;
typedef struct {
AppManifest* manifest;
} LoaderEventAppStopped;
typedef struct {
LoaderEventType type;
union {
LoaderEventAppStarted app_started;
LoaderEventAppShowing app_showing;
LoaderEventAppHiding app_hiding;
LoaderEventAppStopped app_stopped;
};
} LoaderEvent;
/**
* @brief Start an app
* @param[in] id application name or id
* @param[in] blocking application arguments
* @param[in] bundle optional bundle. Ownership is transferred to Loader.
* @return LoaderStatus
*/
LoaderStatus loader_start_app(const char* id, bool blocking, Bundle* _Nullable bundle);
/**
* @brief Stop the currently showing app. Show the previous app if any app was still running.
*/
void loader_stop_app();
App _Nullable loader_get_current_app();
/**
* @brief PubSub for LoaderEvent
*/
PubSub* loader_get_pubsub();
#ifdef __cplusplus
}
#endif