mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:07:44 +00:00
Everywhere: Pass AK::StringView by value
This commit is contained in:
parent
ad5d217e76
commit
8b1108e485
392 changed files with 978 additions and 978 deletions
|
@ -97,7 +97,7 @@ public:
|
|||
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_create_with_anonymous_buffer(BitmapFormat, Core::AnonymousBuffer, IntSize const&, int intrinsic_scale, Vector<RGBA32> const& palette);
|
||||
static ErrorOr<NonnullRefPtr<Bitmap>> try_create_from_serialized_byte_buffer(ByteBuffer&&);
|
||||
|
||||
static bool is_path_a_supported_image_format(StringView const& path)
|
||||
static bool is_path_a_supported_image_format(StringView path)
|
||||
{
|
||||
#define __ENUMERATE_IMAGE_FORMAT(Name, Ext) \
|
||||
if (path.ends_with(Ext, CaseSensitivity::CaseInsensitive)) \
|
||||
|
|
|
@ -316,7 +316,7 @@ int BitmapFont::glyph_or_emoji_width_for_variable_width_font(u32 code_point) con
|
|||
return emoji->size().width();
|
||||
}
|
||||
|
||||
int BitmapFont::width(StringView const& view) const { return unicode_view_width(Utf8View(view)); }
|
||||
int BitmapFont::width(StringView view) const { return unicode_view_width(Utf8View(view)); }
|
||||
int BitmapFont::width(Utf8View const& view) const { return unicode_view_width(view); }
|
||||
int BitmapFont::width(Utf32View const& view) const { return unicode_view_width(view); }
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
update_x_height();
|
||||
}
|
||||
|
||||
int width(StringView const&) const override;
|
||||
int width(StringView) const override;
|
||||
int width(Utf8View const&) const override;
|
||||
int width(Utf32View const&) const override;
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ void ClassicStylePainter::paint_window_frame(Painter& painter, IntRect const& re
|
|||
painter.draw_line(rect.bottom_left().translated(3, -3), rect.bottom_right().translated(-3, -3), base_color);
|
||||
}
|
||||
|
||||
void ClassicStylePainter::paint_progressbar(Painter& painter, IntRect const& rect, Palette const& palette, int min, int max, int value, StringView const& text, Orientation orientation)
|
||||
void ClassicStylePainter::paint_progressbar(Painter& painter, IntRect const& rect, Palette const& palette, int min, int max, int value, StringView text, Orientation orientation)
|
||||
{
|
||||
// First we fill the entire widget with the gradient. This incurs a bit of
|
||||
// overdraw but ensures a consistent look throughout the progression.
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
virtual void paint_tab_button(Painter&, IntRect const&, Palette const&, bool active, bool hovered, bool enabled, bool top, bool in_active_window) override;
|
||||
virtual void paint_frame(Painter&, IntRect const&, Palette const&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false) override;
|
||||
virtual void paint_window_frame(Painter&, IntRect const&, Palette const&) override;
|
||||
virtual void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView const& text, Orientation = Orientation::Horizontal) override;
|
||||
virtual void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView text, Orientation = Orientation::Horizontal) override;
|
||||
virtual void paint_radio_button(Painter&, IntRect const&, Palette const&, bool is_checked, bool is_being_pressed) override;
|
||||
virtual void paint_check_box(Painter&, IntRect const&, Palette const&, bool is_enabled, bool is_checked, bool is_being_pressed) override;
|
||||
virtual void paint_transparency_grid(Painter&, IntRect const&, Palette const&) override;
|
||||
|
|
|
@ -52,7 +52,7 @@ Gfx::IntRect ClassicWindowTheme::titlebar_text_rect(WindowType window_type, cons
|
|||
};
|
||||
}
|
||||
|
||||
void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, const StringView& window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, [[maybe_unused]] bool window_modified) const
|
||||
void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, [[maybe_unused]] bool window_modified) const
|
||||
{
|
||||
auto frame_rect = frame_rect_for_window(WindowType::Normal, window_rect, palette, menu_row_count);
|
||||
frame_rect.set_location({ 0, 0 });
|
||||
|
@ -94,7 +94,7 @@ void ClassicWindowTheme::paint_normal_frame(Painter& painter, WindowState window
|
|||
painter.draw_scaled_bitmap(titlebar_icon_rect, icon, icon.rect());
|
||||
}
|
||||
|
||||
void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, const StringView& title_text, const Palette& palette, const IntRect& leftmost_button_rect) const
|
||||
void ClassicWindowTheme::paint_tool_window_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView title_text, const Palette& palette, const IntRect& leftmost_button_rect) const
|
||||
{
|
||||
auto frame_rect = frame_rect_for_window(WindowType::ToolWindow, window_rect, palette, 0);
|
||||
frame_rect.set_location({ 0, 0 });
|
||||
|
|
|
@ -16,8 +16,8 @@ public:
|
|||
ClassicWindowTheme();
|
||||
virtual ~ClassicWindowTheme() override;
|
||||
|
||||
virtual void paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, const StringView& window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const override;
|
||||
virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, const StringView& title, const Palette&, const IntRect& leftmost_button_rect) const override;
|
||||
virtual void paint_normal_frame(Painter& painter, WindowState window_state, const IntRect& window_rect, StringView window_title, const Bitmap& icon, const Palette& palette, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const override;
|
||||
virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Palette&, const IntRect& leftmost_button_rect) const override;
|
||||
virtual void paint_notification_frame(Painter&, const IntRect& window_rect, const Palette&, const IntRect& close_button_rect) const override;
|
||||
|
||||
virtual int titlebar_height(WindowType, const Palette&) const override;
|
||||
|
|
|
@ -28,7 +28,7 @@ String Color::to_string_without_alpha() const
|
|||
return String::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue());
|
||||
}
|
||||
|
||||
static Optional<Color> parse_rgb_color(StringView const& string)
|
||||
static Optional<Color> parse_rgb_color(StringView string)
|
||||
{
|
||||
VERIFY(string.starts_with("rgb(", CaseSensitivity::CaseInsensitive));
|
||||
VERIFY(string.ends_with(")"));
|
||||
|
@ -49,7 +49,7 @@ static Optional<Color> parse_rgb_color(StringView const& string)
|
|||
return Color(r, g, b);
|
||||
}
|
||||
|
||||
static Optional<Color> parse_rgba_color(StringView const& string)
|
||||
static Optional<Color> parse_rgba_color(StringView string)
|
||||
{
|
||||
VERIFY(string.starts_with("rgba(", CaseSensitivity::CaseInsensitive));
|
||||
VERIFY(string.ends_with(")"));
|
||||
|
@ -73,7 +73,7 @@ static Optional<Color> parse_rgba_color(StringView const& string)
|
|||
return Color(r, g, b, a);
|
||||
}
|
||||
|
||||
Optional<Color> Color::from_string(StringView const& string)
|
||||
Optional<Color> Color::from_string(StringView string)
|
||||
{
|
||||
if (string.is_empty())
|
||||
return {};
|
||||
|
|
|
@ -269,7 +269,7 @@ public:
|
|||
|
||||
String to_string() const;
|
||||
String to_string_without_alpha() const;
|
||||
static Optional<Color> from_string(StringView const&);
|
||||
static Optional<Color> from_string(StringView);
|
||||
|
||||
constexpr HSV to_hsv() const
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
CursorParams CursorParams::parse_from_filename(StringView const& cursor_path, Gfx::IntPoint const& default_hotspot)
|
||||
CursorParams CursorParams::parse_from_filename(StringView cursor_path, Gfx::IntPoint const& default_hotspot)
|
||||
{
|
||||
LexicalPath path(cursor_path);
|
||||
auto file_title = path.title();
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Gfx {
|
|||
|
||||
class CursorParams {
|
||||
public:
|
||||
static CursorParams parse_from_filename(StringView const&, Gfx::IntPoint const&);
|
||||
static CursorParams parse_from_filename(StringView, Gfx::IntPoint const&);
|
||||
|
||||
CursorParams() = default;
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
virtual u8 baseline() const = 0;
|
||||
virtual u8 mean_line() const = 0;
|
||||
|
||||
virtual int width(const StringView&) const = 0;
|
||||
virtual int width(StringView) const = 0;
|
||||
virtual int width(const Utf8View&) const = 0;
|
||||
virtual int width(const Utf32View&) const = 0;
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ void FontDatabase::for_each_fixed_width_font(Function<void(const Gfx::Font&)> ca
|
|||
callback(*font);
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Font> FontDatabase::get_by_name(const StringView& name)
|
||||
RefPtr<Gfx::Font> FontDatabase::get_by_name(StringView name)
|
||||
{
|
||||
auto it = m_private->full_name_to_font_map.find(name);
|
||||
if (it == m_private->full_name_to_font_map.end()) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
RefPtr<Gfx::Font> get(const String& family, unsigned size, unsigned weight);
|
||||
RefPtr<Gfx::Font> get(const String& family, const String& variant, unsigned size);
|
||||
RefPtr<Gfx::Font> get_by_name(const StringView&);
|
||||
RefPtr<Gfx::Font> get_by_name(StringView);
|
||||
void for_each_font(Function<void(const Gfx::Font&)>);
|
||||
void for_each_fixed_width_font(Function<void(const Gfx::Font&)>);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ struct ICOLoadingContext {
|
|||
size_t largest_index;
|
||||
};
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_ico(const StringView& path)
|
||||
RefPtr<Gfx::Bitmap> load_ico(StringView path)
|
||||
{
|
||||
auto file_or_error = MappedFile::map(path);
|
||||
if (file_or_error.is_error())
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_ico(const StringView& path);
|
||||
RefPtr<Gfx::Bitmap> load_ico(StringView path);
|
||||
RefPtr<Gfx::Bitmap> load_ico_from_memory(u8 const*, size_t, String const& mmap_name = "<memory>");
|
||||
|
||||
struct ICOLoadingContext;
|
||||
|
|
|
@ -97,7 +97,7 @@ static bool read_image_data(PBMLoadingContext& context, Streamer& streamer)
|
|||
return true;
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_pbm(const StringView& path)
|
||||
RefPtr<Gfx::Bitmap> load_pbm(StringView path)
|
||||
{
|
||||
return load<PBMLoadingContext>(path);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_pbm(const StringView& path);
|
||||
RefPtr<Gfx::Bitmap> load_pbm(StringView path);
|
||||
RefPtr<Gfx::Bitmap> load_pbm_from_memory(u8 const*, size_t, String const& mmap_name = "<memory>");
|
||||
|
||||
struct PBMLoadingContext;
|
||||
|
|
|
@ -99,7 +99,7 @@ static bool read_image_data(PGMLoadingContext& context, Streamer& streamer)
|
|||
return true;
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_pgm(const StringView& path)
|
||||
RefPtr<Gfx::Bitmap> load_pgm(StringView path)
|
||||
{
|
||||
return load<PGMLoadingContext>(path);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_pgm(const StringView& path);
|
||||
RefPtr<Gfx::Bitmap> load_pgm(StringView path);
|
||||
RefPtr<Gfx::Bitmap> load_pgm_from_memory(u8 const*, size_t, String const& mmap_name = "<memory>");
|
||||
|
||||
struct PGMLoadingContext;
|
||||
|
|
|
@ -101,7 +101,7 @@ static bool read_image_data(PPMLoadingContext& context, Streamer& streamer)
|
|||
return true;
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_ppm(const StringView& path)
|
||||
RefPtr<Gfx::Bitmap> load_ppm(StringView path)
|
||||
{
|
||||
return load<PPMLoadingContext>(path);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_ppm(const StringView& path);
|
||||
RefPtr<Gfx::Bitmap> load_ppm(StringView path);
|
||||
RefPtr<Gfx::Bitmap> load_ppm_from_memory(u8 const*, size_t, String const& mmap_name = "<memory>");
|
||||
|
||||
struct PPMLoadingContext;
|
||||
|
|
|
@ -1548,7 +1548,7 @@ void Painter::do_draw_text(IntRect const& rect, Utf8View const& text, Font const
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_text(IntRect const& rect, StringView const& text, TextAlignment alignment, Color color, TextElision elision, TextWrapping wrapping)
|
||||
void Painter::draw_text(IntRect const& rect, StringView text, TextAlignment alignment, Color color, TextElision elision, TextWrapping wrapping)
|
||||
{
|
||||
draw_text(rect, text, font(), alignment, color, elision, wrapping);
|
||||
}
|
||||
|
@ -1558,7 +1558,7 @@ void Painter::draw_text(IntRect const& rect, Utf32View const& text, TextAlignmen
|
|||
draw_text(rect, text, font(), alignment, color, elision, wrapping);
|
||||
}
|
||||
|
||||
void Painter::draw_text(IntRect const& rect, StringView const& raw_text, Font const& font, TextAlignment alignment, Color color, TextElision elision, TextWrapping wrapping)
|
||||
void Painter::draw_text(IntRect const& rect, StringView raw_text, Font const& font, TextAlignment alignment, Color color, TextElision elision, TextWrapping wrapping)
|
||||
{
|
||||
Utf8View text { raw_text };
|
||||
do_draw_text(rect, text, font, alignment, elision, wrapping, [&](IntRect const& r, u32 code_point) {
|
||||
|
@ -1587,7 +1587,7 @@ void Painter::draw_text(Function<void(IntRect const&, u32)> draw_one_glyph, IntR
|
|||
});
|
||||
}
|
||||
|
||||
void Painter::draw_text(Function<void(IntRect const&, u32)> draw_one_glyph, IntRect const& rect, StringView const& raw_text, Font const& font, TextAlignment alignment, TextElision elision, TextWrapping wrapping)
|
||||
void Painter::draw_text(Function<void(IntRect const&, u32)> draw_one_glyph, IntRect const& rect, StringView raw_text, Font const& font, TextAlignment alignment, TextElision elision, TextWrapping wrapping)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -2143,7 +2143,7 @@ void Painter::blit_tiled(IntRect const& dst_rect, Gfx::Bitmap const& bitmap, Int
|
|||
}
|
||||
}
|
||||
|
||||
String parse_ampersand_string(StringView const& raw_text, Optional<size_t>* underline_offset)
|
||||
String parse_ampersand_string(StringView raw_text, Optional<size_t>* underline_offset)
|
||||
{
|
||||
if (raw_text.is_empty())
|
||||
return String::empty();
|
||||
|
@ -2165,7 +2165,7 @@ String parse_ampersand_string(StringView const& raw_text, Optional<size_t>* unde
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
void Gfx::Painter::draw_ui_text(Gfx::IntRect const& rect, StringView const& text, Gfx::Font const& font, Gfx::TextAlignment text_alignment, Gfx::Color color)
|
||||
void Gfx::Painter::draw_ui_text(Gfx::IntRect const& rect, StringView text, Gfx::Font const& font, Gfx::TextAlignment text_alignment, Gfx::Color color)
|
||||
{
|
||||
Optional<size_t> underline_offset;
|
||||
auto name_to_draw = parse_ampersand_string(text, &underline_offset);
|
||||
|
|
|
@ -69,14 +69,14 @@ public:
|
|||
void blit_offset(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, IntPoint const&);
|
||||
void blit_disabled(IntPoint const&, Gfx::Bitmap const&, IntRect const&, Palette const&);
|
||||
void blit_tiled(IntRect const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void draw_text(IntRect const&, StringView const&, Font const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, StringView const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, StringView, Font const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, StringView, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, Utf32View const&, Font const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, Utf32View const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, u32)>, IntRect const&, StringView const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, u32)>, IntRect const&, StringView, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, u32)>, IntRect const&, Utf8View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, u32)>, IntRect const&, Utf32View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_ui_text(Gfx::IntRect const&, StringView const&, Gfx::Font const&, TextAlignment, Gfx::Color);
|
||||
void draw_ui_text(Gfx::IntRect const&, StringView, Gfx::Font const&, TextAlignment, Gfx::Color);
|
||||
void draw_glyph(IntPoint const&, u32, Color);
|
||||
void draw_glyph(IntPoint const&, u32, Font const&, Color);
|
||||
void draw_emoji(IntPoint const&, Gfx::Bitmap const&, Font const&);
|
||||
|
@ -180,6 +180,6 @@ private:
|
|||
Painter& m_painter;
|
||||
};
|
||||
|
||||
String parse_ampersand_string(StringView const&, Optional<size_t>* underline_offset = nullptr);
|
||||
String parse_ampersand_string(StringView, Optional<size_t>* underline_offset = nullptr);
|
||||
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ static RefPtr<Gfx::Bitmap> load_from_memory(u8 const* data, size_t length, Strin
|
|||
}
|
||||
|
||||
template<typename TContext>
|
||||
static RefPtr<Gfx::Bitmap> load(const StringView& path)
|
||||
static RefPtr<Gfx::Bitmap> load(StringView path)
|
||||
{
|
||||
auto file_or_error = MappedFile::map(path);
|
||||
if (file_or_error.is_error())
|
||||
|
|
|
@ -38,7 +38,7 @@ void StylePainter::paint_window_frame(Painter& painter, const IntRect& rect, con
|
|||
current().paint_window_frame(painter, rect, palette);
|
||||
}
|
||||
|
||||
void StylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
||||
void StylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, StringView text, Orientation orientation)
|
||||
{
|
||||
current().paint_progressbar(painter, rect, palette, min, max, value, text, orientation);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
virtual void paint_tab_button(Painter&, IntRect const&, Palette const&, bool active, bool hovered, bool enabled, bool top, bool in_active_window) = 0;
|
||||
virtual void paint_frame(Painter&, IntRect const&, Palette const&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false) = 0;
|
||||
virtual void paint_window_frame(Painter&, IntRect const&, Palette const&) = 0;
|
||||
virtual void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView const& text, Orientation = Orientation::Horizontal) = 0;
|
||||
virtual void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView text, Orientation = Orientation::Horizontal) = 0;
|
||||
virtual void paint_radio_button(Painter&, IntRect const&, Palette const&, bool is_checked, bool is_being_pressed) = 0;
|
||||
virtual void paint_check_box(Painter&, IntRect const&, Palette const&, bool is_enabled, bool is_checked, bool is_being_pressed) = 0;
|
||||
virtual void paint_transparency_grid(Painter&, IntRect const&, Palette const&) = 0;
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
static void paint_tab_button(Painter&, IntRect const&, Palette const&, bool active, bool hovered, bool enabled, bool top, bool in_active_window);
|
||||
static void paint_frame(Painter&, IntRect const&, Palette const&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
|
||||
static void paint_window_frame(Painter&, IntRect const&, Palette const&);
|
||||
static void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView const& text, Orientation = Orientation::Horizontal);
|
||||
static void paint_progressbar(Painter&, IntRect const&, Palette const&, int min, int max, int value, StringView text, Orientation = Orientation::Horizontal);
|
||||
static void paint_radio_button(Painter&, IntRect const&, Palette const&, bool is_checked, bool is_being_pressed);
|
||||
static void paint_check_box(Painter&, IntRect const&, Palette const&, bool is_enabled, bool is_checked, bool is_being_pressed);
|
||||
static void paint_transparency_grid(Painter&, IntRect const&, Palette const&);
|
||||
|
|
|
@ -50,7 +50,7 @@ inline bool is_vertically_centered_text_alignment(TextAlignment alignment)
|
|||
}
|
||||
}
|
||||
|
||||
inline Optional<TextAlignment> text_alignment_from_string(const StringView& string)
|
||||
inline Optional<TextAlignment> text_alignment_from_string(StringView string)
|
||||
{
|
||||
#define __ENUMERATE(x) \
|
||||
if (string == #x) \
|
||||
|
|
|
@ -477,7 +477,7 @@ bool Font::is_fixed_width() const
|
|||
return glyph_metrics(glyph_id_for_code_point('.'), 1, 1).advance_width == glyph_metrics(glyph_id_for_code_point('X'), 1, 1).advance_width;
|
||||
}
|
||||
|
||||
int ScaledFont::width(StringView const& view) const { return unicode_view_width(Utf8View(view)); }
|
||||
int ScaledFont::width(StringView view) const { return unicode_view_width(Utf8View(view)); }
|
||||
int ScaledFont::width(Utf8View const& view) const { return unicode_view_width(view); }
|
||||
int ScaledFont::width(Utf32View const& view) const { return unicode_view_width(view); }
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public:
|
|||
virtual u8 glyph_fixed_width() const override;
|
||||
virtual u8 baseline() const override { return m_point_height; } // FIXME: Read from font
|
||||
virtual u8 mean_line() const override { return m_point_height; } // FIXME: Read from font
|
||||
virtual int width(StringView const&) const override;
|
||||
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()); }
|
||||
|
|
|
@ -31,8 +31,8 @@ public:
|
|||
|
||||
static WindowTheme& current();
|
||||
|
||||
virtual void paint_normal_frame(Painter&, WindowState, const IntRect& window_rect, const StringView& title, const Bitmap& icon, const Palette&, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const = 0;
|
||||
virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, const StringView& title, const Palette&, const IntRect& leftmost_button_rect) const = 0;
|
||||
virtual void paint_normal_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Bitmap& icon, const Palette&, const IntRect& leftmost_button_rect, int menu_row_count, bool window_modified) const = 0;
|
||||
virtual void paint_tool_window_frame(Painter&, WindowState, const IntRect& window_rect, StringView title, const Palette&, const IntRect& leftmost_button_rect) const = 0;
|
||||
virtual void paint_notification_frame(Painter&, const IntRect& window_rect, const Palette&, const IntRect& close_button_rect) const = 0;
|
||||
|
||||
virtual int titlebar_height(WindowType, const Palette&) const = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue