refactor: unify desktop apps and Settings under item catalog
This commit is contained in:
@@ -18,15 +18,32 @@ namespace gui {
|
||||
static constexpr int MAX_WINDOWS = 32;
|
||||
static constexpr int PANEL_HEIGHT = 32;
|
||||
|
||||
// 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 {
|
||||
@@ -150,10 +167,10 @@ struct DesktopState {
|
||||
|
||||
SvgIcon icon_volume;
|
||||
|
||||
// External apps discovered from 0:/apps/ manifests (dynamically grown)
|
||||
ExternalApp* external_apps;
|
||||
int external_app_count;
|
||||
int external_app_capacity;
|
||||
// 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;
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* desktop_applet.hpp
|
||||
* Shared-library desktop applet ABI for MontaukOS
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace gui::desktop_applet {
|
||||
|
||||
inline constexpr uint32_t ABI_VERSION = 1;
|
||||
inline constexpr uint32_t CAP_SYSTEM_CONFIGURATION = 1u << 0;
|
||||
|
||||
struct Host {
|
||||
char current_user[32];
|
||||
char home_dir[128];
|
||||
char user_config_dir[128];
|
||||
bool is_admin;
|
||||
};
|
||||
|
||||
struct Descriptor {
|
||||
uint32_t abi_version;
|
||||
uint32_t capabilities;
|
||||
const char* applet_id;
|
||||
const char* display_name;
|
||||
const char* icon_path;
|
||||
};
|
||||
|
||||
using QueryFn = const Descriptor* (*)();
|
||||
using OpenFn = bool (*)(const Host* host);
|
||||
|
||||
inline constexpr const char* QUERY_SYMBOL = "desktop_applet_query_v1";
|
||||
inline constexpr const char* OPEN_SYMBOL = "desktop_applet_open_v1";
|
||||
|
||||
} // namespace gui::desktop_applet
|
||||
Reference in New Issue
Block a user