Refactored manifest onStart/onStop to onCreate/onDestroy (#195)

When writing documentation, I realized how `onStart`/`onStop` isn't clearly communicating what it does (it could imply show/hide), so I renamed it to `onCreate` and `onDestroy`.
This commit is contained in:
Ken Van Hoeylandt
2025-01-28 21:34:48 +01:00
committed by GitHub
parent 6c67845645
commit 7856827ecf
9 changed files with 30 additions and 30 deletions
+3 -3
View File
@@ -17,14 +17,14 @@ void tt_app_register(
manifest->icon,
(tt::app::CreateData)manifest->createData,
(tt::app::DestroyData)manifest->destroyData,
(tt::app::OnStart)manifest->onStart,
(tt::app::OnStop)manifest->onStop,
(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
);
#else
tt_crash("TactilityC is intended for PC/Simulator");
tt_crash("TactilityC is not intended for PC/Simulator");
#endif
}
+4 -4
View File
@@ -19,8 +19,8 @@ typedef void* AppHandle;
/** Important: These function types must map to t::app types exactly */
typedef void* (*AppCreateData)();
typedef void (*AppDestroyData)(void* data);
typedef void (*AppOnStart)(AppHandle app, void* _Nullable data);
typedef void (*AppOnStop)(AppHandle app, void* _Nullable data);
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);
@@ -35,9 +35,9 @@ typedef struct {
/** If createData is specified, this one must be specified too */
AppDestroyData _Nullable destroyData;
/** Called when the app is launched (started) */
AppOnStart _Nullable onStart;
AppOnCreate _Nullable onCreate;
/** Called when the app is exited (stopped) */
AppOnStop _Nullable onStop;
AppOnDestroy _Nullable onDestroy;
/** Called when the app is about to be shown to the user (app becomes visible) */
AppOnShow _Nullable onShow;
/** Called when the app is about to be invisible to the user (e.g. other app was launched by this app, and this app goes to the background) */