- Rename test-apps to base-apps with proper manifest.json for each app - Add is_system_app flag to app discovery and Lua API - Fix icon path resolution for /system/icons/ paths - Add layout.lua and layout.rcss for reusable UI components - Update home screen to dynamically load all apps from manifests - Update all app RML files to use layout components - Comprehensive testing framework documentation with JSON action format - Add tests/ directory structure for automated UI testing
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
// D:\Dev\Mosis\MosisService\designer\src\app_discovery.h
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace mosis {
|
|
|
|
struct AppInfo {
|
|
std::string id; // e.g., "com.mosis.sandbox-test"
|
|
std::string name; // Display name
|
|
std::string version; // Version string
|
|
std::string entry; // Entry point (e.g., "main.rml")
|
|
std::string icon; // Icon filename (e.g., "icon.tga") or path (e.g., "/system/icons/phone.tga")
|
|
std::string description; // App description
|
|
std::string app_path; // Full path to app directory
|
|
bool is_system_app = false; // True for system apps (com.mosis.*)
|
|
|
|
// Computed paths
|
|
std::string GetEntryPath() const { return app_path + "/" + entry; }
|
|
std::string GetIconPath() const {
|
|
// If icon starts with /, it's an absolute/system path - don't prepend app_path
|
|
if (!icon.empty() && icon[0] == '/') {
|
|
return icon;
|
|
}
|
|
return app_path + "/" + icon;
|
|
}
|
|
};
|
|
|
|
class AppDiscovery {
|
|
public:
|
|
// Scan a directory for apps (folders with manifest.json)
|
|
static std::vector<AppInfo> DiscoverApps(const std::string& apps_directory);
|
|
|
|
// Load a single app's manifest
|
|
static bool LoadAppManifest(const std::string& app_directory, AppInfo& info);
|
|
};
|
|
|
|
} // namespace mosis
|