Implemented LaunchId and FileSelection, updated Notes (#281)
- Implemented `LaunchId` to keep track of the apps that are started - Implemented `FileSelection` app to select existing and/or new files. - Moved some re-usable file functionality to `tt::file::` - Renamed `Files` app to `FileBrowser` - Updated `Notes` app to use new `FileSelection` functionality, and cleaned it up a bit. - General code cleanliness improvements
This commit is contained in:
committed by
GitHub
parent
74eb830870
commit
2691dbb014
@@ -16,6 +16,8 @@ typedef enum {
|
||||
|
||||
typedef void* AppHandle;
|
||||
|
||||
typedef unsigned int LaunchId;
|
||||
|
||||
/** Important: These function types must map to t::app types exactly */
|
||||
typedef void* (*AppCreateData)();
|
||||
typedef void (*AppDestroyData)(void* data);
|
||||
@@ -23,7 +25,7 @@ typedef void (*AppOnCreate)(AppHandle app, void* _Nullable data);
|
||||
typedef void (*AppOnDestroy)(AppHandle app, void* _Nullable data);
|
||||
typedef void (*AppOnShow)(AppHandle app, void* _Nullable data, lv_obj_t* parent);
|
||||
typedef void (*AppOnHide)(AppHandle app, void* _Nullable data);
|
||||
typedef void (*AppOnResult)(AppHandle app, void* _Nullable data, Result result, BundleHandle resultData);
|
||||
typedef void (*AppOnResult)(AppHandle app, void* _Nullable data, LaunchId launchId, Result result, BundleHandle resultData);
|
||||
|
||||
typedef struct {
|
||||
/** The application's human-readable name */
|
||||
|
||||
@@ -12,16 +12,16 @@ void tt_app_register(
|
||||
) {
|
||||
#ifdef ESP_PLATFORM
|
||||
assert((manifest->createData == nullptr) == (manifest->destroyData == nullptr));
|
||||
tt::app::setElfAppManifest(
|
||||
setElfAppManifest(
|
||||
manifest->name,
|
||||
manifest->icon,
|
||||
(tt::app::CreateData)manifest->createData,
|
||||
(tt::app::DestroyData)manifest->destroyData,
|
||||
(tt::app::OnCreate)manifest->onCreate,
|
||||
(tt::app::OnDestroy)manifest->onDestroy,
|
||||
(tt::app::OnShow)manifest->onShow,
|
||||
(tt::app::OnHide)manifest->onHide,
|
||||
(tt::app::OnResult)manifest->onResult
|
||||
manifest->createData,
|
||||
manifest->destroyData,
|
||||
manifest->onCreate,
|
||||
manifest->onDestroy,
|
||||
manifest->onShow,
|
||||
manifest->onHide,
|
||||
reinterpret_cast<tt::app::OnResult>(manifest->onResult)
|
||||
);
|
||||
#else
|
||||
tt_crash("TactilityC is not intended for PC/Simulator");
|
||||
|
||||
Reference in New Issue
Block a user