diff options
author | crupest <crupest@outlook.com> | 2020-10-17 15:57:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-17 15:57:53 +0800 |
commit | 46ff47d2f47a66372ca0a8a09dd08c4fb04004f3 (patch) | |
tree | 0a1168ea234cb545f76b6d9a8031c36c0f224f5c /include/cru/platform/native | |
parent | 937b16dff40b6eba68d6bc13162f838c8432f43b (diff) | |
download | cru-46ff47d2f47a66372ca0a8a09dd08c4fb04004f3.tar.gz cru-46ff47d2f47a66372ca0a8a09dd08c4fb04004f3.tar.bz2 cru-46ff47d2f47a66372ca0a8a09dd08c4fb04004f3.zip |
Refactor timer.
Diffstat (limited to 'include/cru/platform/native')
-rw-r--r-- | include/cru/platform/native/UiApplication.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/cru/platform/native/UiApplication.hpp b/include/cru/platform/native/UiApplication.hpp index 1aa4df57..135e95c3 100644 --- a/include/cru/platform/native/UiApplication.hpp +++ b/include/cru/platform/native/UiApplication.hpp @@ -31,16 +31,16 @@ struct IUiApplication : public virtual INativeResource { virtual void AddOnQuitHandler(std::function<void()> handler) = 0; - virtual void InvokeLater(std::function<void()> action) = 0; - // Timer id should always be positive and never the same. So it's ok to use - // negative value to represent no timer. + // Timer id should always be positive (not 0) and never the same. So it's ok + // to use negative value (or 0) to represent no timer. + virtual long long SetImmediate(std::function<void()> action) = 0; virtual long long SetTimeout(std::chrono::milliseconds milliseconds, std::function<void()> action) = 0; virtual long long SetInterval(std::chrono::milliseconds milliseconds, std::function<void()> action) = 0; // Implementation should guarantee calls on timer id already canceled have no - // effects and do not crash. Also canceling negative id should always result - // in no-op. + // effects and do not crash. Also canceling negative id or 0 should always + // result in no-op. virtual void CancelTimer(long long id) = 0; virtual std::vector<INativeWindow*> GetAllWindow() = 0; |