mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 02:57:44 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include <AK/BuiltinWrappers.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/BMPLoader.h>
|
||||
|
||||
|
@ -78,7 +78,7 @@ template<typename T>
|
|||
struct Formatter<Gfx::Endpoint<T>> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Gfx::Endpoint<T> const& value)
|
||||
{
|
||||
return Formatter<StringView>::format(builder, String::formatted("({}, {}, {})", value.x, value.y, value.z));
|
||||
return Formatter<StringView>::format(builder, DeprecatedString::formatted("({}, {}, {})", value.x, value.y, value.z));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
#include <AK/Bitmap.h>
|
||||
#include <AK/Checked.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/Memory.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Queue.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Try.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibCore/System.h>
|
||||
|
@ -498,7 +498,7 @@ Bitmap::~Bitmap()
|
|||
delete[] m_palette;
|
||||
}
|
||||
|
||||
void Bitmap::set_mmap_name([[maybe_unused]] String const& name)
|
||||
void Bitmap::set_mmap_name([[maybe_unused]] DeprecatedString const& name)
|
||||
{
|
||||
VERIFY(m_needs_munmap);
|
||||
#ifdef AK_OS_SERENITY
|
||||
|
@ -571,7 +571,7 @@ ErrorOr<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, IntSiz
|
|||
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
|
||||
#ifdef AK_OS_SERENITY
|
||||
map_flags |= MAP_PURGEABLE;
|
||||
void* data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, String::formatted("GraphicsBitmap [{}]", size).characters());
|
||||
void* data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, DeprecatedString::formatted("GraphicsBitmap [{}]", size).characters());
|
||||
#else
|
||||
void* data = mmap(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, -1, 0);
|
||||
#endif
|
||||
|
|
|
@ -206,7 +206,7 @@ public:
|
|||
[[nodiscard]] bool has_alpha_channel() const { return m_format == BitmapFormat::BGRA8888 || m_format == BitmapFormat::RGBA8888; }
|
||||
[[nodiscard]] BitmapFormat format() const { return m_format; }
|
||||
|
||||
void set_mmap_name(String const&);
|
||||
void set_mmap_name(DeprecatedString const&);
|
||||
|
||||
[[nodiscard]] static constexpr size_t size_in_bytes(size_t pitch, int physical_height) { return pitch * physical_height; }
|
||||
[[nodiscard]] size_t size_in_bytes() const { return size_in_bytes(m_pitch, physical_height()); }
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FloatingPointStringConversions.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
@ -18,14 +18,14 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
String Color::to_string() const
|
||||
DeprecatedString Color::to_string() const
|
||||
{
|
||||
return String::formatted("#{:02x}{:02x}{:02x}{:02x}", red(), green(), blue(), alpha());
|
||||
return DeprecatedString::formatted("#{:02x}{:02x}{:02x}{:02x}", red(), green(), blue(), alpha());
|
||||
}
|
||||
|
||||
String Color::to_string_without_alpha() const
|
||||
DeprecatedString Color::to_string_without_alpha() const
|
||||
{
|
||||
return String::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue());
|
||||
return DeprecatedString::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue());
|
||||
}
|
||||
|
||||
static Optional<Color> parse_rgb_color(StringView string)
|
||||
|
|
|
@ -352,8 +352,8 @@ public:
|
|||
return m_value == other.m_value;
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
String to_string_without_alpha() const;
|
||||
DeprecatedString to_string() const;
|
||||
DeprecatedString to_string_without_alpha() const;
|
||||
static Optional<Color> from_string(StringView);
|
||||
|
||||
constexpr HSV to_hsv() const
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/DDSLoader.h>
|
||||
|
|
|
@ -111,7 +111,7 @@ void fill_path(Painter& painter, Path const& path, Color color, Gfx::Painter::Wi
|
|||
});
|
||||
if constexpr (fill_path_mode == FillPathMode::PlaceOnIntGrid && FILL_PATH_DEBUG) {
|
||||
if ((int)scanline % 10 == 0) {
|
||||
painter.draw_text(Gfx::Rect<GridCoordinateType>(active_list.last().x - 20, scanline, 20, 10), String::number((int)scanline));
|
||||
painter.draw_text(Gfx::Rect<GridCoordinateType>(active_list.last().x - 20, scanline, 20, 10), DeprecatedString::number((int)scanline));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::masked_character_set() const
|
|||
return adopt_nonnull_ref_or_enomem(new (nothrow) BitmapFont(m_name, m_family, new_rows, new_widths, m_fixed_width, m_glyph_width, m_glyph_height, m_glyph_spacing, new_range_mask_size, new_range_mask, m_baseline, m_mean_line, m_presentation_size, m_weight, m_slope, true));
|
||||
}
|
||||
|
||||
BitmapFont::BitmapFont(String name, String family, u8* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing, u16 range_mask_size, u8* range_mask, u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, u8 slope, bool owns_arrays)
|
||||
BitmapFont::BitmapFont(DeprecatedString name, DeprecatedString family, u8* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing, u16 range_mask_size, u8* range_mask, u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, u8 slope, bool owns_arrays)
|
||||
: m_name(move(name))
|
||||
, m_family(move(family))
|
||||
, m_range_mask_size(range_mask_size)
|
||||
|
@ -222,15 +222,15 @@ ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::load_from_memory(u8 const* data)
|
|||
glyph_count += 256 * popcount(range_mask[i]);
|
||||
u8* rows = range_mask + header.range_mask_size;
|
||||
u8* widths = (u8*)(rows) + glyph_count * bytes_per_glyph;
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) BitmapFont(String(header.name), String(header.family), rows, widths, !header.is_variable_width, header.glyph_width, header.glyph_height, header.glyph_spacing, header.range_mask_size, range_mask, header.baseline, header.mean_line, header.presentation_size, header.weight, header.slope));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) BitmapFont(DeprecatedString(header.name), DeprecatedString(header.family), rows, widths, !header.is_variable_width, header.glyph_width, header.glyph_height, header.glyph_spacing, header.range_mask_size, range_mask, header.baseline, header.mean_line, header.presentation_size, header.weight, header.slope));
|
||||
}
|
||||
|
||||
RefPtr<BitmapFont> BitmapFont::load_from_file(String const& path)
|
||||
RefPtr<BitmapFont> BitmapFont::load_from_file(DeprecatedString const& path)
|
||||
{
|
||||
return MUST(try_load_from_file(move(path)));
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_load_from_file(String const& path)
|
||||
ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_load_from_file(DeprecatedString const& path)
|
||||
{
|
||||
auto file = TRY(Core::MappedFile::map(path));
|
||||
auto font = TRY(load_from_memory((u8 const*)file->data()));
|
||||
|
@ -238,7 +238,7 @@ ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_load_from_file(String const&
|
|||
return font;
|
||||
}
|
||||
|
||||
ErrorOr<void> BitmapFont::write_to_file(String const& path)
|
||||
ErrorOr<void> BitmapFont::write_to_file(DeprecatedString const& path)
|
||||
{
|
||||
FontFileHeader header;
|
||||
memset(&header, 0, sizeof(FontFileHeader));
|
||||
|
@ -364,12 +364,12 @@ ALWAYS_INLINE int BitmapFont::unicode_view_width(T const& view) const
|
|||
return longest_width;
|
||||
}
|
||||
|
||||
String BitmapFont::qualified_name() const
|
||||
DeprecatedString BitmapFont::qualified_name() const
|
||||
{
|
||||
return String::formatted("{} {} {} {}", family(), presentation_size(), weight(), slope());
|
||||
return DeprecatedString::formatted("{} {} {} {}", family(), presentation_size(), weight(), slope());
|
||||
}
|
||||
|
||||
String BitmapFont::variant() const
|
||||
DeprecatedString BitmapFont::variant() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append(weight_to_name(weight()));
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/CharacterTypes.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
|
@ -30,9 +30,9 @@ public:
|
|||
ErrorOr<NonnullRefPtr<BitmapFont>> masked_character_set() const;
|
||||
ErrorOr<NonnullRefPtr<BitmapFont>> unmasked_character_set() const;
|
||||
|
||||
static RefPtr<BitmapFont> load_from_file(String const& path);
|
||||
static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_file(String const& path);
|
||||
ErrorOr<void> write_to_file(String const& path);
|
||||
static RefPtr<BitmapFont> load_from_file(DeprecatedString const& path);
|
||||
static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_file(DeprecatedString const& path);
|
||||
ErrorOr<void> write_to_file(DeprecatedString const& path);
|
||||
|
||||
~BitmapFont();
|
||||
|
||||
|
@ -92,8 +92,8 @@ public:
|
|||
int width(Utf8View const&) const override;
|
||||
int width(Utf32View const&) const override;
|
||||
|
||||
String name() const override { return m_name; }
|
||||
void set_name(String name) { m_name = move(name); }
|
||||
DeprecatedString name() const override { return m_name; }
|
||||
void set_name(DeprecatedString name) { m_name = move(name); }
|
||||
|
||||
bool is_fixed_width() const override { return m_fixed_width; }
|
||||
void set_fixed_width(bool b) { m_fixed_width = b; }
|
||||
|
@ -113,15 +113,15 @@ public:
|
|||
u16 range_size() const { return m_range_mask_size; }
|
||||
bool is_range_empty(u32 code_point) const { return !(m_range_mask[code_point / 256 / 8] & 1 << (code_point / 256 % 8)); }
|
||||
|
||||
String family() const override { return m_family; }
|
||||
void set_family(String family) { m_family = move(family); }
|
||||
String variant() const override;
|
||||
DeprecatedString family() const override { return m_family; }
|
||||
void set_family(DeprecatedString family) { m_family = move(family); }
|
||||
DeprecatedString variant() const override;
|
||||
|
||||
String qualified_name() const override;
|
||||
String human_readable_name() const override { return String::formatted("{} {} {}", family(), variant(), presentation_size()); }
|
||||
DeprecatedString qualified_name() const override;
|
||||
DeprecatedString human_readable_name() const override { return DeprecatedString::formatted("{} {} {}", family(), variant(), presentation_size()); }
|
||||
|
||||
private:
|
||||
BitmapFont(String name, String family, u8* rows, u8* widths, bool is_fixed_width,
|
||||
BitmapFont(DeprecatedString name, DeprecatedString family, u8* rows, u8* widths, bool is_fixed_width,
|
||||
u8 glyph_width, u8 glyph_height, u8 glyph_spacing, u16 range_mask_size, u8* range_mask,
|
||||
u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, u8 slope, bool owns_arrays = false);
|
||||
|
||||
|
@ -133,8 +133,8 @@ private:
|
|||
void update_x_height() { m_x_height = m_baseline - m_mean_line; };
|
||||
int glyph_or_emoji_width_for_variable_width_font(u32 code_point) const;
|
||||
|
||||
String m_name;
|
||||
String m_family;
|
||||
DeprecatedString m_name;
|
||||
DeprecatedString m_family;
|
||||
size_t m_glyph_count { 0 };
|
||||
|
||||
u16 m_range_mask_size { 0 };
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font/Emoji.h>
|
||||
|
@ -18,7 +18,7 @@ namespace Gfx {
|
|||
// https://unicode.org/emoji/charts/emoji-list.html
|
||||
// https://unicode.org/emoji/charts/emoji-zwj-sequences.html
|
||||
|
||||
static HashMap<String, RefPtr<Gfx::Bitmap>> s_emojis;
|
||||
static HashMap<DeprecatedString, RefPtr<Gfx::Bitmap>> s_emojis;
|
||||
|
||||
Bitmap const* Emoji::emoji_for_code_point(u32 code_point)
|
||||
{
|
||||
|
@ -28,13 +28,13 @@ Bitmap const* Emoji::emoji_for_code_point(u32 code_point)
|
|||
Bitmap const* Emoji::emoji_for_code_points(Span<u32 const> const& code_points)
|
||||
{
|
||||
// FIXME: This function is definitely not fast.
|
||||
auto basename = String::join('_', code_points, "U+{:X}"sv);
|
||||
auto basename = DeprecatedString::join('_', code_points, "U+{:X}"sv);
|
||||
|
||||
auto it = s_emojis.find(basename);
|
||||
if (it != s_emojis.end())
|
||||
return (*it).value.ptr();
|
||||
|
||||
auto bitmap_or_error = Bitmap::try_load_from_file(String::formatted("/res/emoji/{}.png", basename));
|
||||
auto bitmap_or_error = Bitmap::try_load_from_file(DeprecatedString::formatted("/res/emoji/{}.png", basename));
|
||||
if (bitmap_or_error.is_error()) {
|
||||
s_emojis.set(basename, nullptr);
|
||||
return nullptr;
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include <AK/Bitmap.h>
|
||||
#include <AK/ByteReader.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
virtual int width(Utf8View const&) const = 0;
|
||||
virtual int width(Utf32View const&) const = 0;
|
||||
|
||||
virtual String name() const = 0;
|
||||
virtual DeprecatedString name() const = 0;
|
||||
|
||||
virtual bool is_fixed_width() const = 0;
|
||||
|
||||
|
@ -152,11 +152,11 @@ public:
|
|||
|
||||
virtual size_t glyph_count() const = 0;
|
||||
|
||||
virtual String family() const = 0;
|
||||
virtual String variant() const = 0;
|
||||
virtual DeprecatedString family() const = 0;
|
||||
virtual DeprecatedString variant() const = 0;
|
||||
|
||||
virtual String qualified_name() const = 0;
|
||||
virtual String human_readable_name() const = 0;
|
||||
virtual DeprecatedString qualified_name() const = 0;
|
||||
virtual DeprecatedString human_readable_name() const = 0;
|
||||
|
||||
Font const& bold_variant() const;
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ FontDatabase& FontDatabase::the()
|
|||
}
|
||||
|
||||
static RefPtr<Font> s_default_font;
|
||||
static String s_default_font_query;
|
||||
static DeprecatedString s_default_font_query;
|
||||
|
||||
static RefPtr<Font> s_window_title_font;
|
||||
static String s_window_title_font_query;
|
||||
static DeprecatedString s_window_title_font_query;
|
||||
|
||||
static RefPtr<Font> s_fixed_width_font;
|
||||
static String s_fixed_width_font_query;
|
||||
static DeprecatedString s_fixed_width_font_query;
|
||||
|
||||
static String s_default_fonts_lookup_path = "/res/fonts";
|
||||
static DeprecatedString s_default_fonts_lookup_path = "/res/fonts";
|
||||
|
||||
void FontDatabase::set_default_font_query(String query)
|
||||
void FontDatabase::set_default_font_query(DeprecatedString query)
|
||||
{
|
||||
if (s_default_font_query == query)
|
||||
return;
|
||||
|
@ -44,12 +44,12 @@ void FontDatabase::set_default_font_query(String query)
|
|||
s_default_font = nullptr;
|
||||
}
|
||||
|
||||
String FontDatabase::default_font_query()
|
||||
DeprecatedString FontDatabase::default_font_query()
|
||||
{
|
||||
return s_default_font_query;
|
||||
}
|
||||
|
||||
void FontDatabase::set_window_title_font_query(String query)
|
||||
void FontDatabase::set_window_title_font_query(DeprecatedString query)
|
||||
{
|
||||
if (s_window_title_font_query == query)
|
||||
return;
|
||||
|
@ -57,19 +57,19 @@ void FontDatabase::set_window_title_font_query(String query)
|
|||
s_window_title_font = nullptr;
|
||||
}
|
||||
|
||||
String FontDatabase::window_title_font_query()
|
||||
DeprecatedString FontDatabase::window_title_font_query()
|
||||
{
|
||||
return s_window_title_font_query;
|
||||
}
|
||||
|
||||
void FontDatabase::set_default_fonts_lookup_path(String path)
|
||||
void FontDatabase::set_default_fonts_lookup_path(DeprecatedString path)
|
||||
{
|
||||
if (s_default_fonts_lookup_path == path)
|
||||
return;
|
||||
s_default_fonts_lookup_path = move(path);
|
||||
}
|
||||
|
||||
String FontDatabase::default_fonts_lookup_path()
|
||||
DeprecatedString FontDatabase::default_fonts_lookup_path()
|
||||
{
|
||||
return s_default_fonts_lookup_path;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ Font& FontDatabase::window_title_font()
|
|||
return *s_window_title_font;
|
||||
}
|
||||
|
||||
void FontDatabase::set_fixed_width_font_query(String query)
|
||||
void FontDatabase::set_fixed_width_font_query(DeprecatedString query)
|
||||
{
|
||||
if (s_fixed_width_font_query == query)
|
||||
return;
|
||||
|
@ -102,7 +102,7 @@ void FontDatabase::set_fixed_width_font_query(String query)
|
|||
s_fixed_width_font = nullptr;
|
||||
}
|
||||
|
||||
String FontDatabase::fixed_width_font_query()
|
||||
DeprecatedString FontDatabase::fixed_width_font_query()
|
||||
{
|
||||
return s_fixed_width_font_query;
|
||||
}
|
||||
|
@ -118,13 +118,13 @@ Font& FontDatabase::default_fixed_width_font()
|
|||
}
|
||||
|
||||
struct FontDatabase::Private {
|
||||
HashMap<String, NonnullRefPtr<Gfx::Font>> full_name_to_font_map;
|
||||
HashMap<DeprecatedString, NonnullRefPtr<Gfx::Font>> full_name_to_font_map;
|
||||
HashMap<FlyString, Vector<NonnullRefPtr<Typeface>>> typefaces;
|
||||
};
|
||||
|
||||
void FontDatabase::load_all_fonts_from_path(String const& root)
|
||||
void FontDatabase::load_all_fonts_from_path(DeprecatedString const& root)
|
||||
{
|
||||
Queue<String> path_queue;
|
||||
Queue<DeprecatedString> path_queue;
|
||||
path_queue.enqueue(root);
|
||||
|
||||
while (!path_queue.is_empty()) {
|
||||
|
@ -206,7 +206,7 @@ RefPtr<Gfx::Font> FontDatabase::get_by_name(StringView name)
|
|||
auto slope = parts.take_last().to_int().value_or(0);
|
||||
auto weight = parts.take_last().to_int().value_or(0);
|
||||
auto size = parts.take_last().to_int().value_or(0);
|
||||
auto family = String::join(' ', parts);
|
||||
auto family = DeprecatedString::join(' ', parts);
|
||||
return get(family, size, weight, slope);
|
||||
}
|
||||
dbgln("Font lookup failed: '{}'", name);
|
||||
|
@ -239,7 +239,7 @@ RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, FlyString const& va
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Typeface> FontDatabase::get_or_create_typeface(String const& family, String const& variant)
|
||||
RefPtr<Typeface> FontDatabase::get_or_create_typeface(DeprecatedString const& family, DeprecatedString const& variant)
|
||||
{
|
||||
auto it = m_private->typefaces.find(family);
|
||||
if (it != m_private->typefaces.end()) {
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGfx/Font/Typeface.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
|
@ -38,15 +38,15 @@ public:
|
|||
static Font& default_fixed_width_font();
|
||||
static Font& window_title_font();
|
||||
|
||||
static String default_font_query();
|
||||
static String window_title_font_query();
|
||||
static String fixed_width_font_query();
|
||||
static DeprecatedString default_font_query();
|
||||
static DeprecatedString window_title_font_query();
|
||||
static DeprecatedString fixed_width_font_query();
|
||||
|
||||
static String default_fonts_lookup_path();
|
||||
static void set_default_font_query(String);
|
||||
static void set_window_title_font_query(String);
|
||||
static void set_fixed_width_font_query(String);
|
||||
static void set_default_fonts_lookup_path(String);
|
||||
static DeprecatedString default_fonts_lookup_path();
|
||||
static void set_default_font_query(DeprecatedString);
|
||||
static void set_window_title_font_query(DeprecatedString);
|
||||
static void set_fixed_width_font_query(DeprecatedString);
|
||||
static void set_default_fonts_lookup_path(DeprecatedString);
|
||||
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
void for_each_typeface(Function<void(Typeface const&)>);
|
||||
|
||||
void load_all_fonts_from_path(String const&);
|
||||
void load_all_fonts_from_path(DeprecatedString const&);
|
||||
|
||||
private:
|
||||
FontDatabase();
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
|
||||
void load_fonts();
|
||||
|
||||
RefPtr<Typeface> get_or_create_typeface(String const& family, String const& variant);
|
||||
RefPtr<Typeface> get_or_create_typeface(DeprecatedString const& family, DeprecatedString const& variant);
|
||||
|
||||
struct Private;
|
||||
OwnPtr<Private> m_private;
|
||||
|
|
|
@ -57,14 +57,14 @@ public:
|
|||
virtual int width(StringView) const override;
|
||||
virtual int width(Utf8View const&) const override;
|
||||
virtual int width(Utf32View const&) const override;
|
||||
virtual String name() const override { return String::formatted("{} {}", family(), variant()); }
|
||||
virtual DeprecatedString name() const override { return DeprecatedString::formatted("{} {}", family(), variant()); }
|
||||
virtual bool is_fixed_width() const override { return m_font->is_fixed_width(); }
|
||||
virtual u8 glyph_spacing() const override { return 0; }
|
||||
virtual size_t glyph_count() const override { return m_font->glyph_count(); }
|
||||
virtual String family() const override { return m_font->family(); }
|
||||
virtual String variant() const override { return m_font->variant(); }
|
||||
virtual String qualified_name() const override { return String::formatted("{} {} {} {}", family(), presentation_size(), weight(), slope()); }
|
||||
virtual String human_readable_name() const override { return String::formatted("{} {} {}", family(), variant(), presentation_size()); }
|
||||
virtual DeprecatedString family() const override { return m_font->family(); }
|
||||
virtual DeprecatedString variant() const override { return m_font->variant(); }
|
||||
virtual DeprecatedString qualified_name() const override { return DeprecatedString::formatted("{} {} {} {}", family(), presentation_size(), weight(), slope()); }
|
||||
virtual DeprecatedString human_readable_name() const override { return DeprecatedString::formatted("{} {} {}", family(), variant(), presentation_size()); }
|
||||
|
||||
private:
|
||||
NonnullRefPtr<VectorFont> m_font;
|
||||
|
|
|
@ -296,7 +296,7 @@ Optional<i16> Kern::read_glyph_kerning_format0(ReadonlyBytes slice, u16 left_gly
|
|||
return 0;
|
||||
}
|
||||
|
||||
String Name::string_for_id(NameId id) const
|
||||
DeprecatedString Name::string_for_id(NameId id) const
|
||||
{
|
||||
auto num_entries = be_u16(m_slice.offset_pointer(2));
|
||||
auto string_offset = be_u16(m_slice.offset_pointer(4));
|
||||
|
@ -310,7 +310,7 @@ String Name::string_for_id(NameId id) const
|
|||
}
|
||||
|
||||
if (valid_ids.is_empty())
|
||||
return String::empty();
|
||||
return DeprecatedString::empty();
|
||||
|
||||
auto it = valid_ids.find_if([this](auto const& i) {
|
||||
// check if font has naming table for en-US language id
|
||||
|
@ -330,7 +330,7 @@ String Name::string_for_id(NameId id) const
|
|||
return decoder.to_utf8(StringView { (char const*)m_slice.offset_pointer(string_offset + offset), length });
|
||||
}
|
||||
|
||||
return String((char const*)m_slice.offset_pointer(string_offset + offset), length);
|
||||
return DeprecatedString((char const*)m_slice.offset_pointer(string_offset + offset), length);
|
||||
}
|
||||
|
||||
GlyphHorizontalMetrics Hmtx::get_glyph_horizontal_metrics(u32 glyph_id) const
|
||||
|
@ -354,7 +354,7 @@ GlyphHorizontalMetrics Hmtx::get_glyph_horizontal_metrics(u32 glyph_id) const
|
|||
};
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_file(String path, unsigned index)
|
||||
ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_file(DeprecatedString path, unsigned index)
|
||||
{
|
||||
auto file = TRY(Core::MappedFile::map(path));
|
||||
auto font = TRY(try_load_from_externally_owned_memory(file->bytes(), index));
|
||||
|
@ -590,7 +590,7 @@ u16 Font::units_per_em() const
|
|||
return m_head.units_per_em();
|
||||
}
|
||||
|
||||
String Font::family() const
|
||||
DeprecatedString Font::family() const
|
||||
{
|
||||
auto string = m_name.typographic_family_name();
|
||||
if (!string.is_empty())
|
||||
|
@ -598,7 +598,7 @@ String Font::family() const
|
|||
return m_name.family_name();
|
||||
}
|
||||
|
||||
String Font::variant() const
|
||||
DeprecatedString Font::variant() const
|
||||
{
|
||||
auto string = m_name.typographic_subfamily_name();
|
||||
if (!string.is_empty())
|
||||
|
|
|
@ -22,7 +22,7 @@ class Font : public Gfx::VectorFont {
|
|||
AK_MAKE_NONCOPYABLE(Font);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_file(String path, unsigned index = 0);
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_file(DeprecatedString path, unsigned index = 0);
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_externally_owned_memory(ReadonlyBytes bytes, unsigned index = 0);
|
||||
|
||||
virtual Gfx::ScaledFontMetrics metrics(float x_scale, float y_scale) const override;
|
||||
|
@ -32,8 +32,8 @@ public:
|
|||
virtual u32 glyph_count() const override;
|
||||
virtual u16 units_per_em() const override;
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const override { return m_cmap.glyph_id_for_code_point(code_point); }
|
||||
virtual String family() const override;
|
||||
virtual String variant() const override;
|
||||
virtual DeprecatedString family() const override;
|
||||
virtual DeprecatedString variant() const override;
|
||||
virtual u16 weight() const override;
|
||||
virtual u8 slope() const override;
|
||||
virtual bool is_fixed_width() const override;
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/FixedArray.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
|
||||
namespace TTF {
|
||||
|
||||
|
@ -173,10 +173,10 @@ public:
|
|||
};
|
||||
static Optional<Name> from_slice(ReadonlyBytes);
|
||||
|
||||
String family_name() const { return string_for_id(NameId::FamilyName); }
|
||||
String subfamily_name() const { return string_for_id(NameId::SubfamilyName); }
|
||||
String typographic_family_name() const { return string_for_id(NameId::TypographicFamilyName); }
|
||||
String typographic_subfamily_name() const { return string_for_id(NameId::TypographicSubfamilyName); }
|
||||
DeprecatedString family_name() const { return string_for_id(NameId::FamilyName); }
|
||||
DeprecatedString subfamily_name() const { return string_for_id(NameId::SubfamilyName); }
|
||||
DeprecatedString typographic_family_name() const { return string_for_id(NameId::TypographicFamilyName); }
|
||||
DeprecatedString typographic_subfamily_name() const { return string_for_id(NameId::TypographicSubfamilyName); }
|
||||
|
||||
private:
|
||||
enum class NameId {
|
||||
|
@ -200,7 +200,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
String string_for_id(NameId id) const;
|
||||
DeprecatedString string_for_id(NameId id) const;
|
||||
|
||||
ReadonlyBytes m_slice;
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Gfx {
|
|||
|
||||
class Typeface : public RefCounted<Typeface> {
|
||||
public:
|
||||
Typeface(String const& family, String const& variant)
|
||||
Typeface(DeprecatedString const& family, DeprecatedString const& variant)
|
||||
: m_family(family)
|
||||
, m_variant(variant)
|
||||
{
|
||||
|
|
|
@ -40,8 +40,8 @@ public:
|
|||
virtual u32 glyph_count() const = 0;
|
||||
virtual u16 units_per_em() const = 0;
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const = 0;
|
||||
virtual String family() const = 0;
|
||||
virtual String variant() const = 0;
|
||||
virtual DeprecatedString family() const = 0;
|
||||
virtual DeprecatedString variant() const = 0;
|
||||
virtual u16 weight() const = 0;
|
||||
virtual u8 slope() const = 0;
|
||||
virtual bool is_fixed_width() const = 0;
|
||||
|
|
|
@ -50,7 +50,7 @@ static u16 pow_2_less_than_or_equal(u16 x)
|
|||
return result;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_file(String path, unsigned int index)
|
||||
ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_file(DeprecatedString path, unsigned int index)
|
||||
{
|
||||
auto file = TRY(Core::MappedFile::map(path));
|
||||
return try_load_from_externally_owned_memory(file->bytes(), index);
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font/VectorFont.h>
|
||||
|
@ -20,7 +20,7 @@ class Font : public Gfx::VectorFont {
|
|||
AK_MAKE_NONCOPYABLE(Font);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_file(String path, unsigned index = 0);
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_file(DeprecatedString path, unsigned index = 0);
|
||||
static ErrorOr<NonnullRefPtr<Font>> try_load_from_externally_owned_memory(ReadonlyBytes bytes, unsigned index = 0);
|
||||
|
||||
virtual Gfx::ScaledFontMetrics metrics(float x_scale, float y_scale) const override { return m_input_font->metrics(x_scale, y_scale); }
|
||||
|
@ -30,8 +30,8 @@ public:
|
|||
virtual u32 glyph_count() const override { return m_input_font->glyph_count(); }
|
||||
virtual u16 units_per_em() const override { return m_input_font->units_per_em(); }
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const override { return m_input_font->glyph_id_for_code_point(code_point); }
|
||||
virtual String family() const override { return m_input_font->family(); }
|
||||
virtual String variant() const override { return m_input_font->variant(); }
|
||||
virtual DeprecatedString family() const override { return m_input_font->family(); }
|
||||
virtual DeprecatedString variant() const override { return m_input_font->variant(); }
|
||||
virtual u16 weight() const override { return m_input_font->weight(); }
|
||||
virtual u8 slope() const override { return m_input_font->slope(); }
|
||||
virtual bool is_fixed_width() const override { return m_input_font->is_fixed_width(); }
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Format.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
return Line<U>(*this);
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
DeprecatedString to_string() const;
|
||||
|
||||
private:
|
||||
Point<T> m_a;
|
||||
|
@ -149,15 +149,15 @@ private:
|
|||
};
|
||||
|
||||
template<>
|
||||
inline String IntLine::to_string() const
|
||||
inline DeprecatedString IntLine::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
|
||||
return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
|
||||
}
|
||||
|
||||
template<>
|
||||
inline String FloatLine::to_string() const
|
||||
inline DeprecatedString FloatLine::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
|
||||
return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
#include <AK/Concepts.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/SIMDExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCompress/Zlib.h>
|
||||
#include <LibCrypto/Checksum/CRC32.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
@ -22,9 +22,9 @@ class PNGChunk {
|
|||
using data_length_type = u32;
|
||||
|
||||
public:
|
||||
explicit PNGChunk(String);
|
||||
explicit PNGChunk(DeprecatedString);
|
||||
auto const& data() const { return m_data; };
|
||||
String const& type() const { return m_type; };
|
||||
DeprecatedString const& type() const { return m_type; };
|
||||
void reserve(size_t bytes) { m_data.ensure_capacity(bytes); }
|
||||
|
||||
template<typename T>
|
||||
|
@ -47,10 +47,10 @@ private:
|
|||
requires(IsUnsigned<T>) void add(T);
|
||||
|
||||
ByteBuffer m_data;
|
||||
String m_type;
|
||||
DeprecatedString m_type;
|
||||
};
|
||||
|
||||
PNGChunk::PNGChunk(String type)
|
||||
PNGChunk::PNGChunk(DeprecatedString type)
|
||||
: m_type(move(type))
|
||||
{
|
||||
add<data_length_type>(0);
|
||||
|
|
|
@ -2398,10 +2398,10 @@ void Painter::blit_tiled(IntRect const& dst_rect, Gfx::Bitmap const& bitmap, Int
|
|||
}
|
||||
}
|
||||
|
||||
String parse_ampersand_string(StringView raw_text, Optional<size_t>* underline_offset)
|
||||
DeprecatedString parse_ampersand_string(StringView raw_text, Optional<size_t>* underline_offset)
|
||||
{
|
||||
if (raw_text.is_empty())
|
||||
return String::empty();
|
||||
return DeprecatedString::empty();
|
||||
|
||||
StringBuilder builder;
|
||||
|
||||
|
|
|
@ -202,6 +202,6 @@ private:
|
|||
Painter& m_painter;
|
||||
};
|
||||
|
||||
String parse_ampersand_string(StringView, Optional<size_t>* underline_offset = nullptr);
|
||||
DeprecatedString parse_ampersand_string(StringView, Optional<size_t>* underline_offset = nullptr);
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ int PaletteImpl::metric(MetricRole role) const
|
|||
return theme().metric[(int)role];
|
||||
}
|
||||
|
||||
String PaletteImpl::path(PathRole role) const
|
||||
DeprecatedString PaletteImpl::path(PathRole role) const
|
||||
{
|
||||
VERIFY((int)role < (int)PathRole::__Count);
|
||||
return theme().path[(int)role];
|
||||
|
@ -78,7 +78,7 @@ void Palette::set_metric(MetricRole role, int value)
|
|||
theme.metric[(int)role] = value;
|
||||
}
|
||||
|
||||
void Palette::set_path(PathRole role, String path)
|
||||
void Palette::set_path(PathRole role, DeprecatedString path)
|
||||
{
|
||||
if (m_impl->ref_count() != 1)
|
||||
m_impl = m_impl->clone();
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
}
|
||||
|
||||
int metric(MetricRole) const;
|
||||
String path(PathRole) const;
|
||||
DeprecatedString path(PathRole) const;
|
||||
SystemTheme const& theme() const { return *m_theme_buffer.data<SystemTheme>(); }
|
||||
|
||||
void replace_internal_buffer(Badge<GUI::Application>, Core::AnonymousBuffer buffer);
|
||||
|
@ -151,24 +151,24 @@ public:
|
|||
int window_title_button_width() const { return metric(MetricRole::TitleButtonWidth); }
|
||||
int window_title_button_height() const { return metric(MetricRole::TitleButtonHeight); }
|
||||
|
||||
String title_button_icons_path() const { return path(PathRole::TitleButtonIcons); }
|
||||
String active_window_shadow_path() const { return path(PathRole::ActiveWindowShadow); }
|
||||
String inactive_window_shadow_path() const { return path(PathRole::InactiveWindowShadow); }
|
||||
String menu_shadow_path() const { return path(PathRole::MenuShadow); }
|
||||
String taskbar_shadow_path() const { return path(PathRole::TaskbarShadow); }
|
||||
String tooltip_shadow_path() const { return path(PathRole::TooltipShadow); }
|
||||
DeprecatedString title_button_icons_path() const { return path(PathRole::TitleButtonIcons); }
|
||||
DeprecatedString active_window_shadow_path() const { return path(PathRole::ActiveWindowShadow); }
|
||||
DeprecatedString inactive_window_shadow_path() const { return path(PathRole::InactiveWindowShadow); }
|
||||
DeprecatedString menu_shadow_path() const { return path(PathRole::MenuShadow); }
|
||||
DeprecatedString taskbar_shadow_path() const { return path(PathRole::TaskbarShadow); }
|
||||
DeprecatedString tooltip_shadow_path() const { return path(PathRole::TooltipShadow); }
|
||||
|
||||
Color color(ColorRole role) const { return m_impl->color(role); }
|
||||
Gfx::TextAlignment alignment(AlignmentRole role) const { return m_impl->alignment(role); }
|
||||
bool flag(FlagRole role) const { return m_impl->flag(role); }
|
||||
int metric(MetricRole role) const { return m_impl->metric(role); }
|
||||
String path(PathRole role) const { return m_impl->path(role); }
|
||||
DeprecatedString path(PathRole role) const { return m_impl->path(role); }
|
||||
|
||||
void set_color(ColorRole, Color);
|
||||
void set_alignment(AlignmentRole, Gfx::TextAlignment);
|
||||
void set_flag(FlagRole, bool);
|
||||
void set_metric(MetricRole, int);
|
||||
void set_path(PathRole, String);
|
||||
void set_path(PathRole, DeprecatedString);
|
||||
|
||||
SystemTheme const& theme() const { return m_impl->theme(); }
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ void Path::close_all_subpaths()
|
|||
}
|
||||
}
|
||||
|
||||
String Path::to_string() const
|
||||
DeprecatedString Path::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append("Path { "sv);
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
@ -245,7 +245,7 @@ public:
|
|||
|
||||
Path copy_transformed(AffineTransform const&) const;
|
||||
|
||||
String to_string() const;
|
||||
DeprecatedString to_string() const;
|
||||
|
||||
private:
|
||||
void invalidate_split_lines()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
|
@ -36,15 +36,15 @@ template<typename T>
|
|||
}
|
||||
|
||||
template<>
|
||||
String IntPoint::to_string() const
|
||||
DeprecatedString IntPoint::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{}]", x(), y());
|
||||
return DeprecatedString::formatted("[{},{}]", x(), y());
|
||||
}
|
||||
|
||||
template<>
|
||||
String FloatPoint::to_string() const
|
||||
DeprecatedString FloatPoint::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{}]", x(), y());
|
||||
return DeprecatedString::formatted("[{},{}]", x(), y());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ public:
|
|||
return Point<U>(ceil(x()), ceil(y()));
|
||||
}
|
||||
|
||||
[[nodiscard]] String to_string() const;
|
||||
[[nodiscard]] DeprecatedString to_string() const;
|
||||
|
||||
private:
|
||||
T m_x { 0 };
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -261,11 +261,11 @@ static RefPtr<Gfx::Bitmap> load_impl(u8 const* data, size_t data_size)
|
|||
}
|
||||
|
||||
template<typename TContext>
|
||||
static RefPtr<Gfx::Bitmap> load_from_memory(u8 const* data, size_t length, String const& mmap_name)
|
||||
static RefPtr<Gfx::Bitmap> load_from_memory(u8 const* data, size_t length, DeprecatedString const& mmap_name)
|
||||
{
|
||||
auto bitmap = load_impl<TContext>(data, length);
|
||||
if (bitmap)
|
||||
bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded {}: {}", bitmap->size(), TContext::FormatDetails::image_type, mmap_name));
|
||||
bitmap->set_mmap_name(DeprecatedString::formatted("Gfx::Bitmap [{}] - Decoded {}: {}", bitmap->size(), TContext::FormatDetails::image_type, mmap_name));
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "QOIWriter.h"
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Line.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
@ -15,15 +15,15 @@
|
|||
namespace Gfx {
|
||||
|
||||
template<>
|
||||
String IntRect::to_string() const
|
||||
DeprecatedString IntRect::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{} {}x{}]", x(), y(), width(), height());
|
||||
return DeprecatedString::formatted("[{},{} {}x{}]", x(), y(), width(), height());
|
||||
}
|
||||
|
||||
template<>
|
||||
String FloatRect::to_string() const
|
||||
DeprecatedString FloatRect::to_string() const
|
||||
{
|
||||
return String::formatted("[{},{} {}x{}]", x(), y(), width(), height());
|
||||
return DeprecatedString::formatted("[{},{} {}x{}]", x(), y(), width(), height());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -997,7 +997,7 @@ public:
|
|||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] String to_string() const;
|
||||
[[nodiscard]] DeprecatedString to_string() const;
|
||||
|
||||
private:
|
||||
Point<T> m_location;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGfx/Size.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
|
@ -12,15 +12,15 @@
|
|||
namespace Gfx {
|
||||
|
||||
template<>
|
||||
String IntSize::to_string() const
|
||||
DeprecatedString IntSize::to_string() const
|
||||
{
|
||||
return String::formatted("[{}x{}]", m_width, m_height);
|
||||
return DeprecatedString::formatted("[{}x{}]", m_width, m_height);
|
||||
}
|
||||
|
||||
template<>
|
||||
String FloatSize::to_string() const
|
||||
DeprecatedString FloatSize::to_string() const
|
||||
{
|
||||
return String::formatted("[{}x{}]", m_width, m_height);
|
||||
return DeprecatedString::formatted("[{}x{}]", m_width, m_height);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ public:
|
|||
return Size<U>(*this);
|
||||
}
|
||||
|
||||
[[nodiscard]] String to_string() const;
|
||||
[[nodiscard]] DeprecatedString to_string() const;
|
||||
|
||||
template<Integral I>
|
||||
[[nodiscard]] Size<I> to_rounded() const
|
||||
|
|
|
@ -148,7 +148,7 @@ Core::AnonymousBuffer load_system_theme(Core::ConfigFile const& file)
|
|||
return buffer;
|
||||
}
|
||||
|
||||
Core::AnonymousBuffer load_system_theme(String const& path)
|
||||
Core::AnonymousBuffer load_system_theme(DeprecatedString const& path)
|
||||
{
|
||||
return load_system_theme(Core::ConfigFile::open(path).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ Vector<SystemThemeMetaData> list_installed_system_themes()
|
|||
Core::DirIterator dt("/res/themes", Core::DirIterator::SkipDots);
|
||||
while (dt.has_next()) {
|
||||
auto theme_name = dt.next_path();
|
||||
auto theme_path = String::formatted("/res/themes/{}", theme_name);
|
||||
auto theme_path = DeprecatedString::formatted("/res/themes/{}", theme_name);
|
||||
system_themes.append({ LexicalPath::title(theme_name), theme_path });
|
||||
}
|
||||
quick_sort(system_themes, [](auto& a, auto& b) { return a.name < b.name; });
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/AnonymousBuffer.h>
|
||||
|
@ -272,11 +272,11 @@ struct SystemTheme {
|
|||
Core::AnonymousBuffer& current_system_theme_buffer();
|
||||
void set_system_theme(Core::AnonymousBuffer);
|
||||
Core::AnonymousBuffer load_system_theme(Core::ConfigFile const&);
|
||||
Core::AnonymousBuffer load_system_theme(String const& path);
|
||||
Core::AnonymousBuffer load_system_theme(DeprecatedString const& path);
|
||||
|
||||
struct SystemThemeMetaData {
|
||||
String name;
|
||||
String path;
|
||||
DeprecatedString name;
|
||||
DeprecatedString path;
|
||||
};
|
||||
|
||||
Vector<SystemThemeMetaData> list_installed_system_themes();
|
||||
|
|
|
@ -40,7 +40,7 @@ IntRect TextLayout::bounding_rect(TextWrapping wrapping, int line_spacing) const
|
|||
return bounding_rect;
|
||||
}
|
||||
|
||||
Vector<String, 32> TextLayout::wrap_lines(TextElision elision, TextWrapping wrapping, int line_spacing, FitWithinRect fit_within_rect) const
|
||||
Vector<DeprecatedString, 32> TextLayout::wrap_lines(TextElision elision, TextWrapping wrapping, int line_spacing, FitWithinRect fit_within_rect) const
|
||||
{
|
||||
Vector<Block> blocks;
|
||||
|
||||
|
@ -117,7 +117,7 @@ Vector<String, 32> TextLayout::wrap_lines(TextElision elision, TextWrapping wrap
|
|||
if (max_lines_that_can_fit == 0)
|
||||
return {};
|
||||
|
||||
Vector<String> lines;
|
||||
Vector<DeprecatedString> lines;
|
||||
StringBuilder builder;
|
||||
size_t line_width = 0;
|
||||
size_t current_block = 0;
|
||||
|
@ -183,7 +183,7 @@ blocks_processed:
|
|||
return lines;
|
||||
}
|
||||
|
||||
String TextLayout::elide_text_from_right(Utf8View text, bool force_elision) const
|
||||
DeprecatedString TextLayout::elide_text_from_right(Utf8View text, bool force_elision) const
|
||||
{
|
||||
size_t text_width = m_font->width(text);
|
||||
if (force_elision || text_width > static_cast<unsigned>(m_rect.width())) {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Utf32View.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
IntRect const& rect() const { return m_rect; }
|
||||
void set_rect(IntRect const& rect) { m_rect = rect; }
|
||||
|
||||
Vector<String, 32> lines(TextElision elision, TextWrapping wrapping, int line_spacing) const
|
||||
Vector<DeprecatedString, 32> lines(TextElision elision, TextWrapping wrapping, int line_spacing) const
|
||||
{
|
||||
return wrap_lines(elision, wrapping, line_spacing, FitWithinRect::Yes);
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ public:
|
|||
IntRect bounding_rect(TextWrapping wrapping, int line_spacing) const;
|
||||
|
||||
private:
|
||||
Vector<String, 32> wrap_lines(TextElision, TextWrapping, int line_spacing, FitWithinRect) const;
|
||||
String elide_text_from_right(Utf8View, bool force_elision) const;
|
||||
Vector<DeprecatedString, 32> wrap_lines(TextElision, TextWrapping, int line_spacing, FitWithinRect) const;
|
||||
DeprecatedString elide_text_from_right(Utf8View, bool force_elision) const;
|
||||
|
||||
Font const* m_font;
|
||||
Utf8View m_text;
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGfx/Triangle.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
template<>
|
||||
String Triangle<int>::to_string() const
|
||||
DeprecatedString Triangle<int>::to_string() const
|
||||
{
|
||||
return String::formatted("({},{},{})", m_a, m_b, m_c);
|
||||
return DeprecatedString::formatted("({},{},{})", m_a, m_b, m_c);
|
||||
}
|
||||
|
||||
template<>
|
||||
String Triangle<float>::to_string() const
|
||||
DeprecatedString Triangle<float>::to_string() const
|
||||
{
|
||||
return String::formatted("({},{},{})", m_a, m_b, m_c);
|
||||
return DeprecatedString::formatted("({},{},{})", m_a, m_b, m_c);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
DeprecatedString to_string() const;
|
||||
|
||||
private:
|
||||
T m_determinant { 0 };
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Format.h>
|
||||
#include <AK/Math.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
#define LOOP_UNROLL_N 4
|
||||
|
@ -243,14 +243,14 @@ public:
|
|||
return VectorN<3, T>(x(), y(), z());
|
||||
}
|
||||
|
||||
[[nodiscard]] String to_string() const
|
||||
[[nodiscard]] DeprecatedString to_string() const
|
||||
{
|
||||
if constexpr (N == 2)
|
||||
return String::formatted("[{},{}]", x(), y());
|
||||
return DeprecatedString::formatted("[{},{}]", x(), y());
|
||||
else if constexpr (N == 3)
|
||||
return String::formatted("[{},{},{}]", x(), y(), z());
|
||||
return DeprecatedString::formatted("[{},{},{}]", x(), y(), z());
|
||||
else
|
||||
return String::formatted("[{},{},{},{}]", x(), y(), z(), w());
|
||||
return DeprecatedString::formatted("[{},{},{},{}]", x(), y(), z(), w());
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue