aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform')
-rw-r--r--include/cru/platform/graphics/Base.hpp (renamed from include/cru/platform/graph/Base.hpp)2
-rw-r--r--include/cru/platform/graphics/Brush.hpp (renamed from include/cru/platform/graph/Brush.hpp)2
-rw-r--r--include/cru/platform/graphics/Factory.hpp (renamed from include/cru/platform/graph/Factory.hpp)2
-rw-r--r--include/cru/platform/graphics/Font.hpp (renamed from include/cru/platform/graph/Font.hpp)2
-rw-r--r--include/cru/platform/graphics/Geometry.hpp (renamed from include/cru/platform/graph/Geometry.hpp)2
-rw-r--r--include/cru/platform/graphics/Painter.hpp (renamed from include/cru/platform/graph/Painter.hpp)2
-rw-r--r--include/cru/platform/graphics/Resource.hpp (renamed from include/cru/platform/graph/Resource.hpp)2
-rw-r--r--include/cru/platform/graphics/TextLayout.hpp (renamed from include/cru/platform/graph/TextLayout.hpp)2
-rw-r--r--include/cru/platform/graphics/util/Painter.hpp (renamed from include/cru/platform/graph/util/Painter.hpp)4
-rw-r--r--include/cru/platform/gui/Base.hpp (renamed from include/cru/platform/native/Base.hpp)6
-rw-r--r--include/cru/platform/gui/Cursor.hpp (renamed from include/cru/platform/native/Cursor.hpp)4
-rw-r--r--include/cru/platform/gui/InputMethod.hpp (renamed from include/cru/platform/native/InputMethod.hpp)8
-rw-r--r--include/cru/platform/gui/Keyboard.hpp (renamed from include/cru/platform/native/Keyboard.hpp)4
-rw-r--r--include/cru/platform/gui/UiApplication.hpp (renamed from include/cru/platform/native/UiApplication.hpp)6
-rw-r--r--include/cru/platform/gui/Window.hpp (renamed from include/cru/platform/native/Window.hpp)6
15 files changed, 27 insertions, 27 deletions
diff --git a/include/cru/platform/graph/Base.hpp b/include/cru/platform/graphics/Base.hpp
index 61cfc5ef..e751ebdb 100644
--- a/include/cru/platform/graph/Base.hpp
+++ b/include/cru/platform/graphics/Base.hpp
@@ -5,7 +5,7 @@
#include <memory>
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
// forward declarations
struct IGraphFactory;
struct IBrush;
diff --git a/include/cru/platform/graph/Brush.hpp b/include/cru/platform/graphics/Brush.hpp
index e67384de..10c666b5 100644
--- a/include/cru/platform/graph/Brush.hpp
+++ b/include/cru/platform/graphics/Brush.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "Resource.hpp"
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IBrush : virtual IGraphResource {};
struct ISolidColorBrush : virtual IBrush {
diff --git a/include/cru/platform/graph/Factory.hpp b/include/cru/platform/graphics/Factory.hpp
index b4e68f12..d1b37783 100644
--- a/include/cru/platform/graph/Factory.hpp
+++ b/include/cru/platform/graphics/Factory.hpp
@@ -9,7 +9,7 @@
#include <string>
#include <string_view>
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
// Entry point of the graph module.
struct IGraphFactory : virtual INativeResource {
virtual std::unique_ptr<ISolidColorBrush> CreateSolidColorBrush() = 0;
diff --git a/include/cru/platform/graph/Font.hpp b/include/cru/platform/graphics/Font.hpp
index 182cc15b..70392a69 100644
--- a/include/cru/platform/graph/Font.hpp
+++ b/include/cru/platform/graphics/Font.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "Resource.hpp"
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IFont : virtual IGraphResource {
virtual float GetFontSize() = 0;
};
diff --git a/include/cru/platform/graph/Geometry.hpp b/include/cru/platform/graphics/Geometry.hpp
index 354efd97..b0ce6ad9 100644
--- a/include/cru/platform/graph/Geometry.hpp
+++ b/include/cru/platform/graphics/Geometry.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "Resource.hpp"
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IGeometry : virtual IGraphResource {
virtual bool FillContains(const Point& point) = 0;
};
diff --git a/include/cru/platform/graph/Painter.hpp b/include/cru/platform/graphics/Painter.hpp
index 27ae420b..76140c32 100644
--- a/include/cru/platform/graph/Painter.hpp
+++ b/include/cru/platform/graphics/Painter.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "Resource.hpp"
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IPainter : virtual INativeResource {
virtual Matrix GetTransform() = 0;
diff --git a/include/cru/platform/graph/Resource.hpp b/include/cru/platform/graphics/Resource.hpp
index 8859360c..a1625ce4 100644
--- a/include/cru/platform/graph/Resource.hpp
+++ b/include/cru/platform/graphics/Resource.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "Base.hpp"
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct IGraphFactory;
struct IGraphResource : virtual INativeResource {
diff --git a/include/cru/platform/graph/TextLayout.hpp b/include/cru/platform/graphics/TextLayout.hpp
index a101983f..efd017d6 100644
--- a/include/cru/platform/graph/TextLayout.hpp
+++ b/include/cru/platform/graphics/TextLayout.hpp
@@ -4,7 +4,7 @@
#include <string>
#include <vector>
-namespace cru::platform::graph {
+namespace cru::platform::graphics {
struct ITextLayout : virtual IGraphResource {
virtual std::u16string GetText() = 0;
virtual std::u16string_view GetTextView() = 0;
diff --git a/include/cru/platform/graph/util/Painter.hpp b/include/cru/platform/graphics/util/Painter.hpp
index f9aec027..af3a1997 100644
--- a/include/cru/platform/graph/util/Painter.hpp
+++ b/include/cru/platform/graphics/util/Painter.hpp
@@ -4,7 +4,7 @@
#include <functional>
#include <type_traits>
-namespace cru::platform::graph::util {
+namespace cru::platform::graphics::util {
template <typename Fn>
void WithTransform(IPainter* painter, const Matrix& matrix, const Fn& action) {
static_assert(std::is_invocable_v<decltype(action), IPainter*>,
@@ -14,4 +14,4 @@ void WithTransform(IPainter* painter, const Matrix& matrix, const Fn& action) {
action(painter);
painter->SetTransform(old);
}
-} // namespace cru::platform::graph::util
+} // namespace cru::platform::graphics::util
diff --git a/include/cru/platform/native/Base.hpp b/include/cru/platform/gui/Base.hpp
index c3e87439..fb196f02 100644
--- a/include/cru/platform/native/Base.hpp
+++ b/include/cru/platform/gui/Base.hpp
@@ -2,11 +2,11 @@
#include "Keyboard.hpp"
#include "cru/common/Base.hpp"
#include "cru/common/Bitmask.hpp"
-#include "cru/platform/graph/Base.hpp"
+#include "cru/platform/graphics/Base.hpp"
#include "../Resource.hpp"
-namespace cru::platform::native {
+namespace cru::platform::gui {
struct ICursor;
struct ICursorManager;
struct IUiApplication;
@@ -44,4 +44,4 @@ struct NativeKeyEventArgs {
enum class FocusChangeType { Gain, Lost };
enum class MouseEnterLeaveType { Enter, Leave };
-} // namespace cru::platform::native
+} // namespace cru::platform::gui
diff --git a/include/cru/platform/native/Cursor.hpp b/include/cru/platform/gui/Cursor.hpp
index 447cd694..3f1679e4 100644
--- a/include/cru/platform/native/Cursor.hpp
+++ b/include/cru/platform/gui/Cursor.hpp
@@ -3,7 +3,7 @@
#include <memory>
-namespace cru::platform::native {
+namespace cru::platform::gui {
struct ICursor : virtual INativeResource {};
struct ICursorManager : virtual INativeResource {
@@ -11,4 +11,4 @@ struct ICursorManager : virtual INativeResource {
// TODO: Add method to create cursor.
};
-} // namespace cru::platform::native
+} // namespace cru::platform::gui
diff --git a/include/cru/platform/native/InputMethod.hpp b/include/cru/platform/gui/InputMethod.hpp
index de752417..53a8d671 100644
--- a/include/cru/platform/native/InputMethod.hpp
+++ b/include/cru/platform/gui/InputMethod.hpp
@@ -7,7 +7,7 @@
#include <memory>
#include <vector>
-namespace cru::platform::native {
+namespace cru::platform::gui {
struct CompositionClause {
int start;
int end;
@@ -51,17 +51,17 @@ struct IInputMethodContext : virtual INativeResource {
virtual IEvent<std::u16string_view>* TextEvent() = 0;
};
-} // namespace cru::platform::native
+} // namespace cru::platform::gui
template <>
-struct fmt::formatter<cru::platform::native::CompositionText, char16_t>
+struct fmt::formatter<cru::platform::gui::CompositionText, char16_t>
: fmt::formatter<std::u16string_view, char16_t> {
auto parse(fmt::basic_format_parse_context<char16_t>& ctx) {
return fmt::formatter<std::u16string_view, char16_t>::parse(ctx);
}
template <typename FormatContext>
- auto format(const cru::platform::native::CompositionText& ct,
+ auto format(const cru::platform::gui::CompositionText& ct,
FormatContext& ctx) {
auto output = ctx.out();
output = format_to(output, u"text: {}\n", ct.text);
diff --git a/include/cru/platform/native/Keyboard.hpp b/include/cru/platform/gui/Keyboard.hpp
index 67a35c8a..e12cccda 100644
--- a/include/cru/platform/native/Keyboard.hpp
+++ b/include/cru/platform/gui/Keyboard.hpp
@@ -4,7 +4,7 @@
#include <string>
#include <string_view>
-namespace cru::platform::native {
+namespace cru::platform::gui {
// Because of the complexity of keyboard layout, I only add code in US keyboard
// layout, the most widely used layout in China. We should try to make it easy
// to add new keyboard layout.
@@ -124,4 +124,4 @@ struct KeyModifiers {
std::u16string_view ToString(KeyCode key_code);
std::u16string ToString(KeyModifier key_modifier,
std::u16string_view separator = u"+");
-} // namespace cru::platform::native
+} // namespace cru::platform::gui
diff --git a/include/cru/platform/native/UiApplication.hpp b/include/cru/platform/gui/UiApplication.hpp
index 2b1b047a..6a2eb067 100644
--- a/include/cru/platform/native/UiApplication.hpp
+++ b/include/cru/platform/gui/UiApplication.hpp
@@ -6,7 +6,7 @@
#include <memory>
#include <vector>
-namespace cru::platform::native {
+namespace cru::platform::gui {
// The entry point of a ui application.
struct IUiApplication : public virtual INativeResource {
public:
@@ -45,7 +45,7 @@ struct IUiApplication : public virtual INativeResource {
virtual std::vector<INativeWindow*> GetAllWindow() = 0;
virtual INativeWindow* CreateWindow(INativeWindow* parent) = 0;
- virtual cru::platform::graph::IGraphFactory* GetGraphFactory() = 0;
+ virtual cru::platform::graphics::IGraphFactory* GetGraphFactory() = 0;
virtual ICursorManager* GetCursorManager() = 0;
};
@@ -106,4 +106,4 @@ class TimerListAutoCanceler {
// Bootstrap from this.
std::unique_ptr<IUiApplication> CreateUiApplication();
-} // namespace cru::platform::native
+} // namespace cru::platform::gui
diff --git a/include/cru/platform/native/Window.hpp b/include/cru/platform/gui/Window.hpp
index c8abdeac..26d1a476 100644
--- a/include/cru/platform/native/Window.hpp
+++ b/include/cru/platform/gui/Window.hpp
@@ -5,7 +5,7 @@
#include <string_view>
-namespace cru::platform::native {
+namespace cru::platform::gui {
// Represents a native window, which exposes some low-level events and
// operations.
struct INativeWindow : virtual INativeResource {
@@ -38,7 +38,7 @@ struct INativeWindow : virtual INativeResource {
virtual void RequestRepaint() = 0;
// Remember to call EndDraw on return value and destroy it.
- virtual std::unique_ptr<graph::IPainter> BeginPaint() = 0;
+ virtual std::unique_ptr<graphics::IPainter> BeginPaint() = 0;
// Don't use this instance after receive this event.
virtual IEvent<std::nullptr_t>* DestroyEvent() = 0;
@@ -54,4 +54,4 @@ struct INativeWindow : virtual INativeResource {
virtual IInputMethodContext* GetInputMethodContext() = 0;
};
-} // namespace cru::platform::native
+} // namespace cru::platform::gui