1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:47:34 +00:00

AK+Everywhere: Rename FlyString to DeprecatedFlyString

DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
This commit is contained in:
Timothy Flynn 2023-01-08 19:23:00 -05:00 committed by Linus Groh
parent 2eacc7aec1
commit f3db548a3d
316 changed files with 1177 additions and 1177 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/FlyString.h>
#include <AK/DeprecatedFlyString.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/Queue.h>
#include <AK/QuickSort.h>
@ -118,7 +118,7 @@ Font& FontDatabase::default_fixed_width_font()
struct FontDatabase::Private {
HashMap<DeprecatedString, NonnullRefPtr<Gfx::Font>> full_name_to_font_map;
HashMap<FlyString, Vector<NonnullRefPtr<Typeface>>> typefaces;
HashMap<DeprecatedFlyString, Vector<NonnullRefPtr<Typeface>>> typefaces;
};
void FontDatabase::load_all_fonts_from_path(DeprecatedString const& root)
@ -214,7 +214,7 @@ RefPtr<Gfx::Font> FontDatabase::get_by_name(StringView name)
return it->value;
}
RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch allow_inexact_size_match)
RefPtr<Gfx::Font> FontDatabase::get(DeprecatedFlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch allow_inexact_size_match)
{
auto it = m_private->typefaces.find(family);
if (it == m_private->typefaces.end())
@ -226,7 +226,7 @@ RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, float point_size, u
return nullptr;
}
RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match)
RefPtr<Gfx::Font> FontDatabase::get(DeprecatedFlyString const& family, DeprecatedFlyString const& variant, float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match)
{
auto it = m_private->typefaces.find(family);
if (it == m_private->typefaces.end())

View file

@ -48,8 +48,8 @@ public:
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);
RefPtr<Gfx::Font> get(DeprecatedFlyString const& family, float point_size, unsigned weight, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
RefPtr<Gfx::Font> get(DeprecatedFlyString const& family, DeprecatedFlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
RefPtr<Gfx::Font> get_by_name(StringView);
void for_each_font(Function<void(Gfx::Font const&)>);
void for_each_fixed_width_font(Function<void(Gfx::Font const&)>);

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/FlyString.h>
#include <AK/DeprecatedFlyString.h>
#include <AK/Function.h>
#include <AK/RefCounted.h>
#include <AK/Vector.h>
@ -24,8 +24,8 @@ public:
{
}
FlyString const& family() const { return m_family; }
FlyString const& variant() const { return m_variant; }
DeprecatedFlyString const& family() const { return m_family; }
DeprecatedFlyString const& variant() const { return m_variant; }
unsigned weight() const;
u8 slope() const;
@ -39,8 +39,8 @@ public:
RefPtr<Font> get_font(float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No) const;
private:
FlyString m_family;
FlyString m_variant;
DeprecatedFlyString m_family;
DeprecatedFlyString m_variant;
Vector<RefPtr<BitmapFont>> m_bitmap_fonts;
RefPtr<VectorFont> m_vector_font;