refactor: unify desktop apps and Settings under item catalog

This commit is contained in:
2026-07-29 13:59:46 +01:00
parent 84ea28a978
commit 75ae7ede56
38 changed files with 322 additions and 797 deletions
+23 -6
View File
@@ -17,18 +17,34 @@ namespace gui {
static constexpr int MAX_WINDOWS = 8;
static constexpr int PANEL_HEIGHT = 32;
static constexpr int MAX_EXTERNAL_APPS = 32;
static constexpr int MAX_LAUNCHER_ITEMS = 64;
// External app discovered from 0:/apps/ manifest
struct ExternalApp {
enum DesktopItemSection : uint8_t {
DESKTOP_ITEM_SECTION_HIDDEN = 0,
DESKTOP_ITEM_SECTION_APPS,
DESKTOP_ITEM_SECTION_SETTINGS,
};
enum DesktopItemLaunchKind : uint8_t {
DESKTOP_ITEM_LAUNCH_EXECUTABLE = 0,
DESKTOP_ITEM_LAUNCH_BUILTIN,
};
// Launchable desktop item discovered from an app manifest or supplied by the
// desktop's built-in registry.
struct DesktopItem {
char id[48];
char name[48];
char binary_path[128];
char icon_path[128];
char category[24];
SvgIcon icon;
DesktopItemSection section;
DesktopItemLaunchKind launch_kind;
int builtin_id;
bool menu_visible;
bool launch_with_home;
bool admin_only;
};
enum LauncherItemKind : uint8_t {
@@ -152,9 +168,10 @@ struct DesktopState {
SvgIcon icon_volume;
// External apps discovered from 0:/apps/ manifests
ExternalApp external_apps[MAX_EXTERNAL_APPS];
int external_app_count;
// Desktop items discovered from 0:/apps/ manifests (dynamically grown).
DesktopItem* desktop_items;
int desktop_item_count;
int desktop_item_capacity;
bool ctx_menu_open;
int ctx_menu_x, ctx_menu_y;