mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
Fixes for enums
This commit is contained in:
parent
a170dfe8a9
commit
ea88165b08
@ -18,7 +18,7 @@ BundleHandle _Nullable tt_app_get_parameters(AppHandle handle);
|
||||
* @param[in] result the result state to set
|
||||
* @param[in] bundle the result bundle to set
|
||||
*/
|
||||
void tt_app_set_result(AppHandle handle, Result result, BundleHandle _Nullable bundle);
|
||||
void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle _Nullable bundle);
|
||||
|
||||
/** @return true if a result was set for this app context */
|
||||
bool tt_app_has_result(AppHandle handle);
|
||||
|
||||
@ -9,14 +9,14 @@ extern "C" {
|
||||
|
||||
/** Important: These values must map to tt::app::Result values exactly */
|
||||
typedef enum {
|
||||
AppResultOk = 0,
|
||||
AppResultCancelled = 1,
|
||||
AppResultError = 2
|
||||
} Result;
|
||||
APP_RESULT_OK = 0,
|
||||
APP_RESULT_CANCELLED = 1,
|
||||
APP_RESULT_ERROR = 2
|
||||
} AppResult;
|
||||
|
||||
typedef void* AppHandle;
|
||||
|
||||
typedef unsigned int LaunchId;
|
||||
typedef unsigned int AppLaunchId;
|
||||
|
||||
/** Important: These function types must map to t::app types exactly */
|
||||
typedef void* (*AppCreateData)();
|
||||
@ -25,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, LaunchId launchId, Result result, BundleHandle resultData);
|
||||
typedef void (*AppOnResult)(AppHandle app, void* _Nullable data, AppLaunchId launchId, AppResult result, BundleHandle resultData);
|
||||
|
||||
typedef struct {
|
||||
/** The application's human-readable name */
|
||||
|
||||
@ -10,9 +10,9 @@ BundleHandle _Nullable tt_app_get_parameters(AppHandle handle) {
|
||||
return (BundleHandle)HANDLE_AS_APP_CONTEXT(handle)->getParameters().get();
|
||||
}
|
||||
|
||||
void tt_app_set_result(AppHandle handle, Result result, BundleHandle _Nullable bundle) {
|
||||
auto shared_bundle = std::unique_ptr<tt::Bundle>((tt::Bundle*)bundle);
|
||||
HANDLE_AS_APP_CONTEXT(handle)->getApp()->setResult((tt::app::Result)result, std::move(shared_bundle));
|
||||
void tt_app_set_result(AppHandle handle, AppResult result, BundleHandle _Nullable bundle) {
|
||||
auto shared_bundle = std::unique_ptr<tt::Bundle>(static_cast<tt::Bundle*>(bundle));
|
||||
HANDLE_AS_APP_CONTEXT(handle)->getApp()->setResult(static_cast<tt::app::Result>(result), std::move(shared_bundle));
|
||||
}
|
||||
|
||||
bool tt_app_has_result(AppHandle handle) {
|
||||
@ -24,7 +24,7 @@ void tt_app_start(const char* appId) {
|
||||
}
|
||||
|
||||
void tt_app_start_with_bundle(const char* appId, BundleHandle parameters) {
|
||||
tt::app::start(appId, std::shared_ptr<tt::Bundle>((tt::Bundle*)parameters));
|
||||
tt::app::start(appId, std::shared_ptr<tt::Bundle>(static_cast<tt::Bundle*>(parameters)));
|
||||
}
|
||||
|
||||
void tt_app_stop() {
|
||||
|
||||
@ -7,7 +7,6 @@ struct TimerWrapper {
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
TimerHandle tt_timer_alloc(TimerType type, TimerCallback callback, void* callbackContext) {
|
||||
auto wrapper = std::make_shared<TimerWrapper>();
|
||||
wrapper->timer = std::make_unique<tt::Timer>((tt::Timer::Type)type, [callback, callbackContext](){ callback(callbackContext); });
|
||||
@ -54,4 +53,3 @@ void tt_timer_set_thread_priority(TimerHandle handle, ThreadPriority priority) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user