implemented basic desktop

This commit is contained in:
Ken Van Hoeylandt
2024-01-03 14:13:13 +01:00
parent f6c547ad45
commit 48d2fd6c2d
19 changed files with 241 additions and 219 deletions
+6 -1
View File
@@ -12,11 +12,16 @@ typedef struct _lv_obj_t lv_obj_t;
typedef enum {
AppTypeService,
AppTypeSystem,
AppTypeDesktop,
AppTypeUser
} AppType;
typedef enum {
AppStackSizeNormal = 2048
AppStackSizeTiny = 512,
AppStackSizeSmall = 1024,
AppStackSizeNormal = 2048,
AppStackSizeLarge = 4096,
AppStackSizeHuge = 8192,
} AppStackSize;
typedef void (*AppOnStart)(void _Nonnull* parameter);
+4 -4
View File
@@ -64,16 +64,16 @@ const AppManifest _Nullable* app_manifest_registry_find_by_id(const char* id) {
return (manifest != NULL) ? *manifest : NULL;
}
void app_manifest_registry_for_each_of_type(AppType type, AppManifestCallback callback) {
void app_manifest_registry_for_each_of_type(AppType type, void* _Nullable context, AppManifestCallback callback) {
APP_REGISTRY_FOR_EACH(manifest, {
if (manifest->type == type) {
callback(manifest);
callback(manifest, context);
}
});
}
void app_manifest_registry_for_each(AppManifestCallback callback) {
void app_manifest_registry_for_each(AppManifestCallback callback, void* _Nullable context) {
APP_REGISTRY_FOR_EACH(manifest, {
callback(manifest);
callback(manifest, context);
});
}
+3 -3
View File
@@ -9,14 +9,14 @@ extern "C" {
extern const AppManifest* const INTERNAL_APP_MANIFESTS[];
extern const size_t INTERNAL_APP_COUNT;
typedef void (*AppManifestCallback)(const AppManifest*);
typedef void (*AppManifestCallback)(const AppManifest*, void* context);
void app_manifest_registry_init();
void app_manifest_registry_add(const AppManifest _Nonnull* manifest);
void app_manifest_registry_remove(const AppManifest _Nonnull* manifest);
const AppManifest _Nullable* app_manifest_registry_find_by_id(const char* id);
void app_manifest_registry_for_each(AppManifestCallback callback);
void app_manifest_registry_for_each_of_type(AppType type, AppManifestCallback callback);
void app_manifest_registry_for_each(AppManifestCallback callback, void* _Nullable context);
void app_manifest_registry_for_each_of_type(AppType type, void* _Nullable context, AppManifestCallback callback);
#ifdef __cplusplus
}