aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/cairo
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
committerYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
commit32aa6f116acc6e3e20a1ec76cef45b29f7005ad7 (patch)
tree892b71060a88b58d9293d78033000b05818783df /include/cru/platform/graphics/cairo
parentfaf77949e19dc0d01f75bf8abb783eda70328048 (diff)
downloadcru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.gz
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.bz2
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.zip
Remove String stage 1.
Diffstat (limited to 'include/cru/platform/graphics/cairo')
-rw-r--r--include/cru/platform/graphics/cairo/CairoGraphicsFactory.h4
-rw-r--r--include/cru/platform/graphics/cairo/CairoResource.h2
-rw-r--r--include/cru/platform/graphics/cairo/PangoFont.h6
-rw-r--r--include/cru/platform/graphics/cairo/PangoTextLayout.h11
4 files changed, 9 insertions, 14 deletions
diff --git a/include/cru/platform/graphics/cairo/CairoGraphicsFactory.h b/include/cru/platform/graphics/cairo/CairoGraphicsFactory.h
index f0f7ecc5..563c6b40 100644
--- a/include/cru/platform/graphics/cairo/CairoGraphicsFactory.h
+++ b/include/cru/platform/graphics/cairo/CairoGraphicsFactory.h
@@ -26,11 +26,11 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoGraphicsFactory
std::unique_ptr<IGeometryBuilder> CreateGeometryBuilder() override;
- std::unique_ptr<IFont> CreateFont(String font_family,
+ std::unique_ptr<IFont> CreateFont(std::string font_family,
float font_size) override;
std::unique_ptr<ITextLayout> CreateTextLayout(std::shared_ptr<IFont> font,
- String text) override;
+ std::string text) override;
IImageFactory* GetImageFactory() override;
diff --git a/include/cru/platform/graphics/cairo/CairoResource.h b/include/cru/platform/graphics/cairo/CairoResource.h
index bf35ab26..14730e8a 100644
--- a/include/cru/platform/graphics/cairo/CairoResource.h
+++ b/include/cru/platform/graphics/cairo/CairoResource.h
@@ -17,7 +17,7 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoResource
~CairoResource() override;
- String GetPlatformId() const override;
+ std::string GetPlatformId() const override;
IGraphicsFactory* GetGraphicsFactory() override;
CairoGraphicsFactory* GetCairoGraphicsFactory() const { return factory_; }
diff --git a/include/cru/platform/graphics/cairo/PangoFont.h b/include/cru/platform/graphics/cairo/PangoFont.h
index 3014739d..e8dbf3ec 100644
--- a/include/cru/platform/graphics/cairo/PangoFont.h
+++ b/include/cru/platform/graphics/cairo/PangoFont.h
@@ -9,12 +9,12 @@ namespace cru::platform::graphics::cairo {
class CRU_PLATFORM_GRAPHICS_CAIRO_API PangoFont : public CairoResource,
public virtual IFont {
public:
- PangoFont(CairoGraphicsFactory* factory, String font_family, float font_size);
+ PangoFont(CairoGraphicsFactory* factory, std::string font_family, float font_size);
~PangoFont() override;
public:
- String GetFontName() override;
+ std::string GetFontName() override;
float GetFontSize() override;
PangoFontDescription* GetPangoFontDescription() {
@@ -22,7 +22,7 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API PangoFont : public CairoResource,
}
private:
- String font_family_;
+ std::string font_family_;
float font_size_;
PangoFontDescription* pango_font_description_;
};
diff --git a/include/cru/platform/graphics/cairo/PangoTextLayout.h b/include/cru/platform/graphics/cairo/PangoTextLayout.h
index cdc54e8d..270022ee 100644
--- a/include/cru/platform/graphics/cairo/PangoTextLayout.h
+++ b/include/cru/platform/graphics/cairo/PangoTextLayout.h
@@ -15,8 +15,8 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API PangoTextLayout
~PangoTextLayout() override;
public:
- String GetText() override;
- void SetText(String new_text) override;
+ std::string GetText() override;
+ void SetText(std::string new_text) override;
std::shared_ptr<IFont> GetFont() override;
void SetFont(std::shared_ptr<IFont> font) override;
@@ -40,12 +40,7 @@ class CRU_PLATFORM_GRAPHICS_CAIRO_API PangoTextLayout
PangoLayout* GetPangoLayout() { return pango_layout_; }
private:
- Index FromUtf8IndexToUtf16Index(Index index);
- Index FromUtf16IndexToUtf8Index(Index index);
-
- private:
- String text_;
- std::string utf8_text_;
+ std::string text_;
bool edit_mode_ = false;