aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform')
-rw-r--r--include/cru/platform/graph/text_layout.hpp2
-rw-r--r--include/cru/platform/native/ui_application.hpp15
2 files changed, 11 insertions, 6 deletions
diff --git a/include/cru/platform/graph/text_layout.hpp b/include/cru/platform/graph/text_layout.hpp
index 0d104742..d91834c0 100644
--- a/include/cru/platform/graph/text_layout.hpp
+++ b/include/cru/platform/graph/text_layout.hpp
@@ -17,7 +17,7 @@ struct ITextLayout : virtual IGraphResource {
virtual Rect GetTextBounds() = 0;
virtual std::vector<Rect> TextRangeRect(const TextRange& text_range) = 0;
- virtual Point TextSingleRect(gsl::index position, bool trailing) = 0;
+ virtual Point TextSinglePoint(gsl::index position, bool trailing) = 0;
virtual TextHitTestResult HitTest(const Point& point) = 0;
};
} // namespace cru::platform::graph
diff --git a/include/cru/platform/native/ui_application.hpp b/include/cru/platform/native/ui_application.hpp
index 006255db..afcc7117 100644
--- a/include/cru/platform/native/ui_application.hpp
+++ b/include/cru/platform/native/ui_application.hpp
@@ -32,11 +32,16 @@ struct IUiApplication : public virtual INativeResource {
virtual void AddOnQuitHandler(std::function<void()> handler) = 0;
virtual void InvokeLater(std::function<void()> action) = 0;
- virtual unsigned long SetTimeout(std::chrono::milliseconds milliseconds,
- std::function<void()> action) = 0;
- virtual unsigned long SetInterval(std::chrono::milliseconds milliseconds,
- std::function<void()> action) = 0;
- virtual void CancelTimer(unsigned long id) = 0;
+ // Timer id should always be positive and never the same. So it's ok to use
+ // negative value to represent no timer.
+ 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.
+ virtual void CancelTimer(long long id) = 0;
virtual std::vector<INativeWindow*> GetAllWindow() = 0;
virtual std::shared_ptr<INativeWindowResolver> CreateWindow(