aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/Base.hpp20
-rw-r--r--include/cru/ui/Control.hpp8
-rw-r--r--include/cru/ui/ShortcutHub.hpp22
-rw-r--r--include/cru/ui/UiEvent.hpp30
-rw-r--r--include/cru/ui/UiManager.hpp8
-rw-r--r--include/cru/ui/WindowHost.hpp42
-rw-r--r--include/cru/ui/render/BorderRenderObject.hpp26
-rw-r--r--include/cru/ui/render/CanvasRenderObject.hpp2
-rw-r--r--include/cru/ui/render/LayoutRenderObject.hpp2
-rw-r--r--include/cru/ui/render/RenderObject.hpp12
-rw-r--r--include/cru/ui/render/ScrollRenderObject.hpp4
-rw-r--r--include/cru/ui/render/TextRenderObject.hpp38
12 files changed, 107 insertions, 107 deletions
diff --git a/include/cru/ui/Base.hpp b/include/cru/ui/Base.hpp
index dd93f187..36d0eb78 100644
--- a/include/cru/ui/Base.hpp
+++ b/include/cru/ui/Base.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "cru/common/Base.hpp"
-#include "cru/platform/graph/Base.hpp"
-#include "cru/platform/native/Base.hpp"
+#include "cru/platform/graphics/Base.hpp"
+#include "cru/platform/gui/Base.hpp"
#include <functional>
#include <memory>
@@ -19,9 +19,9 @@ using cru::platform::RoundedRect;
using cru::platform::Size;
using cru::platform::TextRange;
using cru::platform::Thickness;
-using cru::platform::native::MouseButton;
+using cru::platform::gui::MouseButton;
-namespace mouse_buttons = cru::platform::native::mouse_buttons;
+namespace mouse_buttons = cru::platform::gui::mouse_buttons;
namespace colors = cru::platform::colors;
@@ -83,27 +83,27 @@ inline bool operator!=(const CornerRadius& left, const CornerRadius& right) {
}
struct BorderStyle {
- std::shared_ptr<platform::graph::IBrush> border_brush;
+ std::shared_ptr<platform::graphics::IBrush> border_brush;
Thickness border_thickness;
CornerRadius border_radius;
- std::shared_ptr<platform::graph::IBrush> foreground_brush;
- std::shared_ptr<platform::graph::IBrush> background_brush;
+ std::shared_ptr<platform::graphics::IBrush> foreground_brush;
+ std::shared_ptr<platform::graphics::IBrush> background_brush;
};
class CanvasPaintEventArgs {
public:
- CanvasPaintEventArgs(platform::graph::IPainter* painter,
+ CanvasPaintEventArgs(platform::graphics::IPainter* painter,
const Size& paint_size)
: painter_(painter), paint_size_(paint_size) {}
CRU_DEFAULT_COPY(CanvasPaintEventArgs)
CRU_DEFAULT_MOVE(CanvasPaintEventArgs)
~CanvasPaintEventArgs() = default;
- platform::graph::IPainter* GetPainter() const { return painter_; }
+ platform::graphics::IPainter* GetPainter() const { return painter_; }
Size GetPaintSize() const { return paint_size_; }
private:
- platform::graph::IPainter* painter_;
+ platform::graphics::IPainter* painter_;
Size paint_size_;
};
diff --git a/include/cru/ui/Control.hpp b/include/cru/ui/Control.hpp
index 0021ad62..5f381965 100644
--- a/include/cru/ui/Control.hpp
+++ b/include/cru/ui/Control.hpp
@@ -58,13 +58,13 @@ class Control : public Object {
// Cursor is inherited from parent recursively if not set.
public:
// null for not set
- std::shared_ptr<platform::native::ICursor> GetCursor();
+ std::shared_ptr<platform::gui::ICursor> GetCursor();
// will not return nullptr
- std::shared_ptr<platform::native::ICursor> GetInheritedCursor();
+ std::shared_ptr<platform::gui::ICursor> GetInheritedCursor();
// null to unset
- void SetCursor(std::shared_ptr<platform::native::ICursor> cursor);
+ void SetCursor(std::shared_ptr<platform::gui::ICursor> cursor);
//*************** region: events ***************
public:
@@ -146,6 +146,6 @@ class Control : public Object {
private:
bool is_mouse_over_ = false;
- std::shared_ptr<platform::native::ICursor> cursor_ = nullptr;
+ std::shared_ptr<platform::gui::ICursor> cursor_ = nullptr;
};
} // namespace cru::ui
diff --git a/include/cru/ui/ShortcutHub.hpp b/include/cru/ui/ShortcutHub.hpp
index 5382f63e..1145c661 100644
--- a/include/cru/ui/ShortcutHub.hpp
+++ b/include/cru/ui/ShortcutHub.hpp
@@ -3,7 +3,7 @@
#include "cru/common/Base.hpp"
#include "cru/common/Event.hpp"
-#include "cru/platform/native/Keyboard.hpp"
+#include "cru/platform/gui/Keyboard.hpp"
#include "cru/ui/UiEvent.hpp"
#include <cstddef>
@@ -20,8 +20,8 @@ namespace cru::ui {
class ShortcutKeyBind {
public:
- ShortcutKeyBind(platform::native::KeyCode key,
- platform::native::KeyModifier modifier)
+ ShortcutKeyBind(platform::gui::KeyCode key,
+ platform::gui::KeyModifier modifier)
: key_(key), modifier_(modifier) {}
CRU_DEFAULT_COPY(ShortcutKeyBind)
@@ -29,11 +29,11 @@ class ShortcutKeyBind {
~ShortcutKeyBind() = default;
- platform::native::KeyCode GetKey() const { return key_; }
- platform::native::KeyModifier GetModifier() const { return modifier_; }
+ platform::gui::KeyCode GetKey() const { return key_; }
+ platform::gui::KeyModifier GetModifier() const { return modifier_; }
- bool Is(platform::native::KeyCode key,
- platform::native::KeyModifier modifier) const {
+ bool Is(platform::gui::KeyCode key,
+ platform::gui::KeyModifier modifier) const {
return key == key_ && modifier == modifier_;
}
@@ -47,15 +47,15 @@ class ShortcutKeyBind {
std::u16string ToString() {
std::u16string result = u"(";
- result += platform::native::ToString(modifier_);
+ result += platform::gui::ToString(modifier_);
result += u")";
- result += platform::native::ToString(key_);
+ result += platform::gui::ToString(key_);
return result;
}
private:
- platform::native::KeyCode key_;
- platform::native::KeyModifier modifier_;
+ platform::gui::KeyCode key_;
+ platform::gui::KeyModifier modifier_;
};
} // namespace cru::ui
diff --git a/include/cru/ui/UiEvent.hpp b/include/cru/ui/UiEvent.hpp
index 5adace8a..c0b2a902 100644
--- a/include/cru/ui/UiEvent.hpp
+++ b/include/cru/ui/UiEvent.hpp
@@ -2,14 +2,14 @@
#include "Base.hpp"
#include "cru/common/Event.hpp"
-#include "cru/platform/native/Keyboard.hpp"
+#include "cru/platform/gui/Keyboard.hpp"
#include <memory>
#include <optional>
#include <string>
#include <type_traits>
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IPainter;
}
@@ -94,13 +94,13 @@ class MouseButtonEventArgs : public MouseEventArgs {
public:
MouseButtonEventArgs(Object* sender, Object* original_sender,
const Point& point, const MouseButton button,
- platform::native::KeyModifier key_modifier)
+ platform::gui::KeyModifier key_modifier)
: MouseEventArgs(sender, original_sender, point),
button_(button),
key_modifier_(key_modifier) {}
MouseButtonEventArgs(Object* sender, Object* original_sender,
const MouseButton button,
- platform::native::KeyModifier key_modifier)
+ platform::gui::KeyModifier key_modifier)
: MouseEventArgs(sender, original_sender),
button_(button),
key_modifier_(key_modifier) {}
@@ -111,11 +111,11 @@ class MouseButtonEventArgs : public MouseEventArgs {
~MouseButtonEventArgs() override = default;
MouseButton GetButton() const { return button_; }
- platform::native::KeyModifier GetKeyModifier() const { return key_modifier_; }
+ platform::gui::KeyModifier GetKeyModifier() const { return key_modifier_; }
private:
MouseButton button_;
- platform::native::KeyModifier key_modifier_;
+ platform::gui::KeyModifier key_modifier_;
};
class MouseWheelEventArgs : public MouseEventArgs {
@@ -138,7 +138,7 @@ class MouseWheelEventArgs : public MouseEventArgs {
class PaintEventArgs : public UiEventArgs {
public:
PaintEventArgs(Object* sender, Object* original_sender,
- platform::graph::IPainter* painter)
+ platform::graphics::IPainter* painter)
: UiEventArgs(sender, original_sender), painter_(painter) {}
PaintEventArgs(const PaintEventArgs& other) = default;
PaintEventArgs(PaintEventArgs&& other) = default;
@@ -146,10 +146,10 @@ class PaintEventArgs : public UiEventArgs {
PaintEventArgs& operator=(PaintEventArgs&& other) = default;
~PaintEventArgs() = default;
- platform::graph::IPainter* GetPainter() const { return painter_; }
+ platform::graphics::IPainter* GetPainter() const { return painter_; }
private:
- platform::graph::IPainter* painter_;
+ platform::graphics::IPainter* painter_;
};
class FocusChangeEventArgs : public UiEventArgs {
@@ -191,8 +191,8 @@ class ToggleEventArgs : public UiEventArgs {
class KeyEventArgs : public UiEventArgs {
public:
KeyEventArgs(Object* sender, Object* original_sender,
- platform::native::KeyCode key_code,
- platform::native::KeyModifier key_modifier)
+ platform::gui::KeyCode key_code,
+ platform::gui::KeyModifier key_modifier)
: UiEventArgs(sender, original_sender),
key_code_(key_code),
key_modifier_(key_modifier) {}
@@ -202,12 +202,12 @@ class KeyEventArgs : public UiEventArgs {
KeyEventArgs& operator=(KeyEventArgs&& other) = default;
~KeyEventArgs() override = default;
- platform::native::KeyCode GetKeyCode() const { return key_code_; }
- platform::native::KeyModifier GetKeyModifier() const { return key_modifier_; }
+ platform::gui::KeyCode GetKeyCode() const { return key_code_; }
+ platform::gui::KeyModifier GetKeyModifier() const { return key_modifier_; }
private:
- platform::native::KeyCode key_code_;
- platform::native::KeyModifier key_modifier_;
+ platform::gui::KeyCode key_code_;
+ platform::gui::KeyModifier key_modifier_;
};
class CharEventArgs : public UiEventArgs {
diff --git a/include/cru/ui/UiManager.hpp b/include/cru/ui/UiManager.hpp
index 46f06ac2..64599d99 100644
--- a/include/cru/ui/UiManager.hpp
+++ b/include/cru/ui/UiManager.hpp
@@ -9,10 +9,10 @@
namespace cru::ui {
struct ThemeResources {
std::u16string default_font_family;
- std::shared_ptr<platform::graph::IFont> default_font;
- std::shared_ptr<platform::graph::IBrush> text_brush;
- std::shared_ptr<platform::graph::IBrush> text_selection_brush;
- std::shared_ptr<platform::graph::IBrush> caret_brush;
+ std::shared_ptr<platform::graphics::IFont> default_font;
+ std::shared_ptr<platform::graphics::IBrush> text_brush;
+ std::shared_ptr<platform::graphics::IBrush> text_selection_brush;
+ std::shared_ptr<platform::graphics::IBrush> caret_brush;
controls::ButtonStyle button_style;
controls::TextBoxBorderStyle text_box_border_style;
};
diff --git a/include/cru/ui/WindowHost.hpp b/include/cru/ui/WindowHost.hpp
index c3221dcf..97acf72e 100644
--- a/include/cru/ui/WindowHost.hpp
+++ b/include/cru/ui/WindowHost.hpp
@@ -2,8 +2,8 @@
#include "Base.hpp"
#include "cru/common/Event.hpp"
-#include "cru/platform/native/UiApplication.hpp"
-#include "cru/platform/native/Window.hpp"
+#include "cru/platform/gui/UiApplication.hpp"
+#include "cru/platform/gui/Window.hpp"
#include "render/Base.hpp"
#include <functional>
@@ -24,7 +24,7 @@ class WindowHost : public Object {
~WindowHost() override;
public:
- platform::native::INativeWindow* GetNativeWindow() { return native_window_; }
+ platform::gui::INativeWindow* GetNativeWindow() { return native_window_; }
// Mark the layout as invalid, and arrange a re-layout later.
// This method could be called more than one times in a message cycle. But
@@ -87,30 +87,30 @@ class WindowHost : public Object {
private:
//*************** region: native messages ***************
- void OnNativeDestroy(platform::native::INativeWindow* window, std::nullptr_t);
- void OnNativePaint(platform::native::INativeWindow* window, std::nullptr_t);
- void OnNativeResize(platform::native::INativeWindow* window,
+ void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t);
+ void OnNativePaint(platform::gui::INativeWindow* window, std::nullptr_t);
+ void OnNativeResize(platform::gui::INativeWindow* window,
const Size& size);
- void OnNativeFocus(platform::native::INativeWindow* window,
- cru::platform::native::FocusChangeType focus);
+ void OnNativeFocus(platform::gui::INativeWindow* window,
+ cru::platform::gui::FocusChangeType focus);
void OnNativeMouseEnterLeave(
- platform::native::INativeWindow* window,
- cru::platform::native::MouseEnterLeaveType enter);
- void OnNativeMouseMove(platform::native::INativeWindow* window,
+ platform::gui::INativeWindow* window,
+ cru::platform::gui::MouseEnterLeaveType enter);
+ void OnNativeMouseMove(platform::gui::INativeWindow* window,
const Point& point);
void OnNativeMouseDown(
- platform::native::INativeWindow* window,
- const platform::native::NativeMouseButtonEventArgs& args);
+ platform::gui::INativeWindow* window,
+ const platform::gui::NativeMouseButtonEventArgs& args);
void OnNativeMouseUp(
- platform::native::INativeWindow* window,
- const platform::native::NativeMouseButtonEventArgs& args);
+ platform::gui::INativeWindow* window,
+ const platform::gui::NativeMouseButtonEventArgs& args);
- void OnNativeKeyDown(platform::native::INativeWindow* window,
- const platform::native::NativeKeyEventArgs& args);
- void OnNativeKeyUp(platform::native::INativeWindow* window,
- const platform::native::NativeKeyEventArgs& args);
+ void OnNativeKeyDown(platform::gui::INativeWindow* window,
+ const platform::gui::NativeKeyEventArgs& args);
+ void OnNativeKeyUp(platform::gui::INativeWindow* window,
+ const platform::gui::NativeKeyEventArgs& args);
//*************** region: event dispatcher helper ***************
@@ -123,10 +123,10 @@ class WindowHost : public Object {
Control* root_control_ = nullptr;
render::RenderObject* root_render_object_ = nullptr;
- platform::native::INativeWindow* native_window_ = nullptr;
+ platform::gui::INativeWindow* native_window_ = nullptr;
bool need_layout_ = false;
- platform::native::TimerAutoCanceler relayout_timer_canceler_;
+ platform::gui::TimerAutoCanceler relayout_timer_canceler_;
Event<AfterLayoutEventArgs> after_layout_event_;
std::vector<std::function<void()> > after_layout_stable_action_;
diff --git a/include/cru/ui/render/BorderRenderObject.hpp b/include/cru/ui/render/BorderRenderObject.hpp
index 587f051a..f1b957cf 100644
--- a/include/cru/ui/render/BorderRenderObject.hpp
+++ b/include/cru/ui/render/BorderRenderObject.hpp
@@ -16,11 +16,11 @@ class BorderRenderObject : public RenderObject {
bool IsBorderEnabled() const { return is_border_enabled_; }
void SetBorderEnabled(bool enabled) { is_border_enabled_ = enabled; }
- std::shared_ptr<platform::graph::IBrush> GetBorderBrush() {
+ std::shared_ptr<platform::graphics::IBrush> GetBorderBrush() {
return border_brush_;
}
- void SetBorderBrush(std::shared_ptr<platform::graph::IBrush> brush) {
+ void SetBorderBrush(std::shared_ptr<platform::graphics::IBrush> brush) {
if (brush == border_brush_) return;
border_brush_ = std::move(brush);
InvalidatePaint();
@@ -42,21 +42,21 @@ class BorderRenderObject : public RenderObject {
RecreateGeometry();
}
- std::shared_ptr<platform::graph::IBrush> GetForegroundBrush() {
+ std::shared_ptr<platform::graphics::IBrush> GetForegroundBrush() {
return foreground_brush_;
}
- void SetForegroundBrush(std::shared_ptr<platform::graph::IBrush> brush) {
+ void SetForegroundBrush(std::shared_ptr<platform::graphics::IBrush> brush) {
if (brush == foreground_brush_) return;
foreground_brush_ = std::move(brush);
InvalidatePaint();
}
- std::shared_ptr<platform::graph::IBrush> GetBackgroundBrush() {
+ std::shared_ptr<platform::graphics::IBrush> GetBackgroundBrush() {
return background_brush_;
}
- void SetBackgroundBrush(std::shared_ptr<platform::graph::IBrush> brush) {
+ void SetBackgroundBrush(std::shared_ptr<platform::graphics::IBrush> brush) {
if (brush == background_brush_) return;
background_brush_ = std::move(brush);
InvalidatePaint();
@@ -67,7 +67,7 @@ class BorderRenderObject : public RenderObject {
RenderObject* HitTest(const Point& point) override;
protected:
- void OnDrawCore(platform::graph::IPainter* painter) override;
+ void OnDrawCore(platform::graphics::IPainter* painter) override;
Size OnMeasureCore(const MeasureRequirement& requirement,
const MeasureSize& preferred_size) override;
@@ -87,19 +87,19 @@ class BorderRenderObject : public RenderObject {
private:
bool is_border_enabled_ = false;
- std::shared_ptr<platform::graph::IBrush> border_brush_;
+ std::shared_ptr<platform::graphics::IBrush> border_brush_;
Thickness border_thickness_;
CornerRadius border_radius_;
- std::shared_ptr<platform::graph::IBrush> foreground_brush_;
- std::shared_ptr<platform::graph::IBrush> background_brush_;
+ std::shared_ptr<platform::graphics::IBrush> foreground_brush_;
+ std::shared_ptr<platform::graphics::IBrush> background_brush_;
// The ring. Used for painting.
- std::unique_ptr<platform::graph::IGeometry> geometry_;
+ std::unique_ptr<platform::graphics::IGeometry> geometry_;
// Area including inner area of the border. Used for painting foreground and
// background.
- std::unique_ptr<platform::graph::IGeometry> border_inner_geometry_;
+ std::unique_ptr<platform::graphics::IGeometry> border_inner_geometry_;
// Area including border ring and inner area. Used for hit test.
- std::unique_ptr<platform::graph::IGeometry> border_outer_geometry_;
+ std::unique_ptr<platform::graphics::IGeometry> border_outer_geometry_;
};
} // namespace cru::ui::render
diff --git a/include/cru/ui/render/CanvasRenderObject.hpp b/include/cru/ui/render/CanvasRenderObject.hpp
index 3216f08c..58fee59c 100644
--- a/include/cru/ui/render/CanvasRenderObject.hpp
+++ b/include/cru/ui/render/CanvasRenderObject.hpp
@@ -22,7 +22,7 @@ class CanvasRenderObject : public RenderObject {
IEvent<CanvasPaintEventArgs>* PaintEvent() { return &paint_event_; }
protected:
- void OnDrawContent(platform::graph::IPainter* painter) override;
+ void OnDrawContent(platform::graphics::IPainter* painter) override;
Size OnMeasureContent(const MeasureRequirement& requirement,
const MeasureSize& preferred_size) override;
diff --git a/include/cru/ui/render/LayoutRenderObject.hpp b/include/cru/ui/render/LayoutRenderObject.hpp
index b46ba0d0..732031a1 100644
--- a/include/cru/ui/render/LayoutRenderObject.hpp
+++ b/include/cru/ui/render/LayoutRenderObject.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "RenderObject.hpp"
-#include "cru/platform/graph/util/Painter.hpp"
+#include "cru/platform/graphics/util/Painter.hpp"
namespace cru::ui::render {
template <typename TChildLayoutData>
diff --git a/include/cru/ui/render/RenderObject.hpp b/include/cru/ui/render/RenderObject.hpp
index 20e095fa..436cf6b2 100644
--- a/include/cru/ui/render/RenderObject.hpp
+++ b/include/cru/ui/render/RenderObject.hpp
@@ -33,7 +33,7 @@ namespace cru::ui::render {
//
// To write a custom RenderObject, override following methods:
// public:
-// void Draw(platform::graph::IPainter* painter) override;
+// void Draw(platform::graphics::IPainter* painter) override;
// RenderObject* HitTest(const Point& point) override;
// protected:
// Size OnMeasureContent(const MeasureRequirement& requirement) override;
@@ -129,7 +129,7 @@ class RenderObject : public Object {
// This will set offset of this render object and call OnLayoutCore.
void Layout(const Point& offset);
- void Draw(platform::graph::IPainter* painter);
+ void Draw(platform::graphics::IPainter* painter);
// Param point must be relative the lefttop of render object including margin.
// Add offset before pass point to children.
@@ -163,15 +163,15 @@ class RenderObject : public Object {
virtual void OnRemoveChild(RenderObject* removed_child, Index position);
// Draw all children with offset.
- void DefaultDrawChildren(platform::graph::IPainter* painter);
+ void DefaultDrawChildren(platform::graphics::IPainter* painter);
// Draw all children with translation of content rect lefttop.
- void DefaultDrawContent(platform::graph::IPainter* painter);
+ void DefaultDrawContent(platform::graphics::IPainter* painter);
// Call DefaultDrawContent. Then call DefaultDrawChildren.
- virtual void OnDrawCore(platform::graph::IPainter* painter);
+ virtual void OnDrawCore(platform::graphics::IPainter* painter);
- virtual void OnDrawContent(platform::graph::IPainter* painter);
+ virtual void OnDrawContent(platform::graphics::IPainter* painter);
// Size measure including margin and padding. Please reduce margin and padding
// or other custom things and pass the result content measure requirement and
diff --git a/include/cru/ui/render/ScrollRenderObject.hpp b/include/cru/ui/render/ScrollRenderObject.hpp
index 9b0cbf9a..3cc0e4c4 100644
--- a/include/cru/ui/render/ScrollRenderObject.hpp
+++ b/include/cru/ui/render/ScrollRenderObject.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "RenderObject.hpp"
-#include "cru/platform/graph/util/Painter.hpp"
+#include "cru/platform/graphics/util/Painter.hpp"
#include <optional>
@@ -44,7 +44,7 @@ class ScrollRenderObject : public RenderObject {
void ScrollToContain(const Rect& rect, const Thickness& margin = Thickness{});
protected:
- void OnDrawCore(platform::graph::IPainter* painter) override;
+ void OnDrawCore(platform::graphics::IPainter* painter) override;
// Logic:
// If available size is bigger than child's preferred size, then child's
diff --git a/include/cru/ui/render/TextRenderObject.hpp b/include/cru/ui/render/TextRenderObject.hpp
index 3be42bbb..fa569c8c 100644
--- a/include/cru/ui/render/TextRenderObject.hpp
+++ b/include/cru/ui/render/TextRenderObject.hpp
@@ -24,10 +24,10 @@ class TextRenderObject : public RenderObject {
constexpr static float default_caret_width = 2;
public:
- TextRenderObject(std::shared_ptr<platform::graph::IBrush> brush,
- std::shared_ptr<platform::graph::IFont> font,
- std::shared_ptr<platform::graph::IBrush> selection_brush,
- std::shared_ptr<platform::graph::IBrush> caret_brush);
+ TextRenderObject(std::shared_ptr<platform::graphics::IBrush> brush,
+ std::shared_ptr<platform::graphics::IFont> font,
+ std::shared_ptr<platform::graphics::IBrush> selection_brush,
+ std::shared_ptr<platform::graphics::IBrush> caret_brush);
TextRenderObject(const TextRenderObject& other) = delete;
TextRenderObject(TextRenderObject&& other) = delete;
TextRenderObject& operator=(const TextRenderObject& other) = delete;
@@ -38,25 +38,25 @@ class TextRenderObject : public RenderObject {
std::u16string_view GetTextView() const;
void SetText(std::u16string new_text);
- std::shared_ptr<platform::graph::IBrush> GetBrush() const { return brush_; }
- void SetBrush(std::shared_ptr<platform::graph::IBrush> new_brush);
+ std::shared_ptr<platform::graphics::IBrush> GetBrush() const { return brush_; }
+ void SetBrush(std::shared_ptr<platform::graphics::IBrush> new_brush);
- std::shared_ptr<platform::graph::IFont> GetFont() const;
- void SetFont(std::shared_ptr<platform::graph::IFont> font);
+ std::shared_ptr<platform::graphics::IFont> GetFont() const;
+ void SetFont(std::shared_ptr<platform::graphics::IFont> font);
std::vector<Rect> TextRangeRect(const TextRange& text_range);
Point TextSinglePoint(gsl::index position, bool trailing);
- platform::graph::TextHitTestResult TextHitTest(const Point& point);
+ platform::graphics::TextHitTestResult TextHitTest(const Point& point);
std::optional<TextRange> GetSelectionRange() const {
return selection_range_;
}
void SetSelectionRange(std::optional<TextRange> new_range);
- std::shared_ptr<platform::graph::IBrush> GetSelectionBrush() const {
+ std::shared_ptr<platform::graphics::IBrush> GetSelectionBrush() const {
return selection_brush_;
}
- void SetSelectionBrush(std::shared_ptr<platform::graph::IBrush> new_brush);
+ void SetSelectionBrush(std::shared_ptr<platform::graphics::IBrush> new_brush);
bool IsDrawCaret() const { return draw_caret_; }
void SetDrawCaret(bool draw_caret);
@@ -72,10 +72,10 @@ class TextRenderObject : public RenderObject {
// Lefttop relative to render object lefttop.
Rect GetCaretRect();
- std::shared_ptr<platform::graph::IBrush> GetCaretBrush() const {
+ std::shared_ptr<platform::graphics::IBrush> GetCaretBrush() const {
return caret_brush_;
}
- void GetCaretBrush(std::shared_ptr<platform::graph::IBrush> brush);
+ void GetCaretBrush(std::shared_ptr<platform::graphics::IBrush> brush);
float GetCaretWidth() const { return caret_width_; }
void SetCaretWidth(float width);
@@ -83,7 +83,7 @@ class TextRenderObject : public RenderObject {
RenderObject* HitTest(const Point& point) override;
protected:
- void OnDrawContent(platform::graph::IPainter* painter) override;
+ void OnDrawContent(platform::graphics::IPainter* painter) override;
// See remarks of this class.
Size OnMeasureContent(const MeasureRequirement& requirement,
@@ -93,16 +93,16 @@ class TextRenderObject : public RenderObject {
void OnAfterLayout() override;
private:
- std::shared_ptr<platform::graph::IBrush> brush_;
- std::shared_ptr<platform::graph::IFont> font_;
- std::unique_ptr<platform::graph::ITextLayout> text_layout_;
+ std::shared_ptr<platform::graphics::IBrush> brush_;
+ std::shared_ptr<platform::graphics::IFont> font_;
+ std::unique_ptr<platform::graphics::ITextLayout> text_layout_;
std::optional<TextRange> selection_range_ = std::nullopt;
- std::shared_ptr<platform::graph::IBrush> selection_brush_;
+ std::shared_ptr<platform::graphics::IBrush> selection_brush_;
bool draw_caret_ = false;
gsl::index caret_position_ = 0;
- std::shared_ptr<platform::graph::IBrush> caret_brush_;
+ std::shared_ptr<platform::graphics::IBrush> caret_brush_;
float caret_width_ = default_caret_width;
};
} // namespace cru::ui::render