add base-apps with manifests, layout system, and testing documentation
- 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
This commit is contained in:
@@ -1097,7 +1097,7 @@ bool InitializeRmlUi(const std::string& assets_path, int fb_width, int fb_height
|
||||
lua_pushstring(L, app.GetIconPath().c_str());
|
||||
lua_setfield(L, -2, "icon");
|
||||
|
||||
lua_pushboolean(L, false); // Not a system app
|
||||
lua_pushboolean(L, app.is_system_app);
|
||||
lua_setfield(L, -2, "is_system_app");
|
||||
|
||||
lua_pushstring(L, app.app_path.c_str());
|
||||
|
||||
@@ -68,6 +68,7 @@ bool AppDiscovery::LoadAppManifest(const std::string& app_directory, AppInfo& in
|
||||
info.version = j.value("version", "1.0.0");
|
||||
info.icon = j.value("icon", "icon.tga");
|
||||
info.description = j.value("description", "");
|
||||
info.is_system_app = j.value("is_system_app", false);
|
||||
|
||||
// Normalize path separators
|
||||
info.app_path = app_directory;
|
||||
|
||||
@@ -11,13 +11,20 @@ struct AppInfo {
|
||||
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")
|
||||
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 { return app_path + "/" + icon; }
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user