mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:17:45 +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
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window* parent_window, const StringView& version)
|
||||
AboutDialog::AboutDialog(StringView name, const Gfx::Bitmap* icon, Window* parent_window, StringView version)
|
||||
: Dialog(parent_window)
|
||||
, m_name(name)
|
||||
, m_icon(icon)
|
||||
|
@ -58,7 +58,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
|
|||
right_container.set_layout<VerticalBoxLayout>();
|
||||
right_container.layout()->set_margins({ 12, 4, 4, 0 });
|
||||
|
||||
auto make_label = [&](const StringView& text, bool bold = false) {
|
||||
auto make_label = [&](StringView text, bool bold = false) {
|
||||
auto& label = right_container.add<Label>(text);
|
||||
label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
label.set_fixed_height(14);
|
||||
|
|
|
@ -16,7 +16,7 @@ class AboutDialog final : public Dialog {
|
|||
public:
|
||||
virtual ~AboutDialog() override;
|
||||
|
||||
static void show(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, const StringView& version = Core::Version::SERENITY_VERSION)
|
||||
static void show(StringView name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, StringView version = Core::Version::SERENITY_VERSION)
|
||||
{
|
||||
auto dialog = AboutDialog::construct(name, icon, parent_window, version);
|
||||
if (window_icon)
|
||||
|
@ -25,7 +25,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
AboutDialog(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const StringView& version = Core::Version::SERENITY_VERSION);
|
||||
AboutDialog(StringView name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, StringView version = Core::Version::SERENITY_VERSION);
|
||||
|
||||
String m_name;
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
|
|
|
@ -684,7 +684,7 @@ void AbstractView::set_searchable(bool searchable)
|
|||
stop_highlighted_search_timer();
|
||||
}
|
||||
|
||||
void AbstractView::draw_item_text(Gfx::Painter& painter, ModelIndex const& index, bool is_selected, Gfx::IntRect const& text_rect, StringView const& item_text, Gfx::Font const& font, Gfx::TextAlignment alignment, Gfx::TextElision elision, size_t search_highlighting_offset)
|
||||
void AbstractView::draw_item_text(Gfx::Painter& painter, ModelIndex const& index, bool is_selected, Gfx::IntRect const& text_rect, StringView item_text, Gfx::Font const& font, Gfx::TextAlignment alignment, Gfx::TextElision elision, size_t search_highlighting_offset)
|
||||
{
|
||||
if (m_edit_index == index)
|
||||
return;
|
||||
|
|
|
@ -154,7 +154,7 @@ protected:
|
|||
virtual void did_change_cursor_index([[maybe_unused]] ModelIndex const& old_index, [[maybe_unused]] ModelIndex const& new_index) { }
|
||||
virtual void editing_widget_did_change([[maybe_unused]] ModelIndex const& index) { }
|
||||
|
||||
void draw_item_text(Gfx::Painter&, ModelIndex const&, bool, Gfx::IntRect const&, StringView const&, Gfx::Font const&, Gfx::TextAlignment, Gfx::TextElision, size_t search_highlighting_offset = 0);
|
||||
void draw_item_text(Gfx::Painter&, ModelIndex const&, bool, Gfx::IntRect const&, StringView, Gfx::Font const&, Gfx::TextAlignment, Gfx::TextElision, size_t search_highlighting_offset = 0);
|
||||
|
||||
void set_suppress_update_on_selection_change(bool value) { m_suppress_update_on_selection_change = value; }
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ ComboBox::~ComboBox()
|
|||
{
|
||||
}
|
||||
|
||||
void ComboBox::set_editor_placeholder(const StringView& placeholder)
|
||||
void ComboBox::set_editor_placeholder(StringView placeholder)
|
||||
{
|
||||
m_editor->set_placeholder(placeholder);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
int model_column() const;
|
||||
void set_model_column(int);
|
||||
|
||||
void set_editor_placeholder(const StringView& placeholder);
|
||||
void set_editor_placeholder(StringView placeholder);
|
||||
const String& editor_placeholder() const;
|
||||
|
||||
Function<void(const String&, const ModelIndex&)> on_change;
|
||||
|
|
|
@ -45,17 +45,17 @@ void Desktop::did_receive_screen_rects(Badge<WindowServerConnection>, const Vect
|
|||
callback(*this);
|
||||
}
|
||||
|
||||
void Desktop::set_background_color(const StringView& background_color)
|
||||
void Desktop::set_background_color(StringView background_color)
|
||||
{
|
||||
WindowServerConnection::the().async_set_background_color(background_color);
|
||||
}
|
||||
|
||||
void Desktop::set_wallpaper_mode(const StringView& mode)
|
||||
void Desktop::set_wallpaper_mode(StringView mode)
|
||||
{
|
||||
WindowServerConnection::the().async_set_wallpaper_mode(mode);
|
||||
}
|
||||
|
||||
bool Desktop::set_wallpaper(const StringView& path, bool save_config)
|
||||
bool Desktop::set_wallpaper(StringView path, bool save_config)
|
||||
{
|
||||
WindowServerConnection::the().async_set_wallpaper(path);
|
||||
auto ret_val = WindowServerConnection::the().wait_for_specific_message<Messages::WindowClient::SetWallpaperFinished>()->success();
|
||||
|
|
|
@ -25,12 +25,12 @@ public:
|
|||
static Desktop& the();
|
||||
Desktop();
|
||||
|
||||
void set_background_color(const StringView& background_color);
|
||||
void set_background_color(StringView background_color);
|
||||
|
||||
void set_wallpaper_mode(const StringView& mode);
|
||||
void set_wallpaper_mode(StringView mode);
|
||||
|
||||
String wallpaper() const;
|
||||
bool set_wallpaper(const StringView& path, bool save_config = true);
|
||||
bool set_wallpaper(StringView path, bool save_config = true);
|
||||
|
||||
Gfx::IntRect rect() const { return m_bounding_rect; }
|
||||
const Vector<Gfx::IntRect, 4>& rects() const { return m_rects; }
|
||||
|
|
|
@ -26,7 +26,7 @@ static Vector<u32> supported_emoji_code_points()
|
|||
auto lexical_path = LexicalPath(filename);
|
||||
if (lexical_path.extension() != "png")
|
||||
continue;
|
||||
auto& basename = lexical_path.basename();
|
||||
auto basename = lexical_path.basename();
|
||||
if (!basename.starts_with("U+"))
|
||||
continue;
|
||||
u32 code_point = strtoul(basename.to_string().characters() + 2, nullptr, 16);
|
||||
|
|
|
@ -138,7 +138,7 @@ public:
|
|||
|
||||
class WMWindowStateChangedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, int parent_client_id, int parent_window_id, const StringView& title, const Gfx::IntRect& rect, unsigned virtual_desktop_row, unsigned virtual_desktop_column, bool is_active, bool is_modal, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, int parent_client_id, int parent_window_id, StringView title, const Gfx::IntRect& rect, unsigned virtual_desktop_row, unsigned virtual_desktop_column, bool is_active, bool is_modal, WindowType window_type, bool is_minimized, bool is_frameless, Optional<int> progress)
|
||||
: WMEvent(Event::Type::WM_WindowStateChanged, client_id, window_id)
|
||||
, m_parent_client_id(parent_client_id)
|
||||
, m_parent_window_id(parent_window_id)
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, const StringView& path, bool folder, ScreenPosition screen_position)
|
||||
Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, StringView path, bool folder, ScreenPosition screen_position)
|
||||
{
|
||||
auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path, screen_position);
|
||||
|
||||
|
@ -50,7 +50,7 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri
|
|||
return {};
|
||||
}
|
||||
|
||||
Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path, ScreenPosition screen_position)
|
||||
Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, StringView path, ScreenPosition screen_position)
|
||||
{
|
||||
auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path, screen_position);
|
||||
|
||||
|
@ -65,7 +65,7 @@ Optional<String> FilePicker::get_save_filepath(Window* parent_window, const Stri
|
|||
return {};
|
||||
}
|
||||
|
||||
FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filename, const StringView& path, ScreenPosition screen_position)
|
||||
FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, StringView path, ScreenPosition screen_position)
|
||||
: Dialog(parent_window, screen_position)
|
||||
, m_model(FileSystemModel::create(path))
|
||||
, m_mode(mode)
|
||||
|
|
|
@ -28,8 +28,8 @@ public:
|
|||
Save
|
||||
};
|
||||
|
||||
static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, const StringView& path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, StringView path = Core::StandardPaths::home_directory(), bool folder = false, ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
|
||||
virtual ~FilePicker() override;
|
||||
|
||||
|
@ -43,7 +43,7 @@ private:
|
|||
// ^GUI::ModelClient
|
||||
virtual void model_did_update(unsigned) override;
|
||||
|
||||
FilePicker(Window* parent_window, Mode type = Mode::Open, const StringView& filename = "Untitled", const StringView& path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled", StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent);
|
||||
|
||||
static String ok_button_name(Mode mode)
|
||||
{
|
||||
|
|
|
@ -615,7 +615,7 @@ Icon FileSystemModel::icon_for(Node const& node) const
|
|||
|
||||
static HashMap<String, RefPtr<Gfx::Bitmap>> s_thumbnail_cache;
|
||||
|
||||
static RefPtr<Gfx::Bitmap> render_thumbnail(StringView const& path)
|
||||
static RefPtr<Gfx::Bitmap> render_thumbnail(StringView path)
|
||||
{
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_load_from_file(path);
|
||||
if (bitmap_or_error.is_error())
|
||||
|
@ -760,7 +760,7 @@ void FileSystemModel::set_data(ModelIndex const& index, Variant const& data)
|
|||
on_rename_successful(node.full_path(), new_full_path);
|
||||
}
|
||||
|
||||
Vector<ModelIndex> FileSystemModel::matches(StringView const& searching, unsigned flags, ModelIndex const& index)
|
||||
Vector<ModelIndex> FileSystemModel::matches(StringView searching, unsigned flags, ModelIndex const& index)
|
||||
{
|
||||
Node& node = const_cast<Node&>(this->node(index));
|
||||
node.reify_if_needed();
|
||||
|
|
|
@ -133,7 +133,7 @@ public:
|
|||
virtual bool is_editable(ModelIndex const&) const override;
|
||||
virtual bool is_searchable() const override { return true; }
|
||||
virtual void set_data(ModelIndex const&, Variant const&) override;
|
||||
virtual Vector<ModelIndex> matches(StringView const&, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual void invalidate() override;
|
||||
|
||||
static String timestamp_string(time_t timestamp)
|
||||
|
|
|
@ -79,7 +79,7 @@ void FilteringProxyModel::filter()
|
|||
add_matching(parent_index);
|
||||
}
|
||||
|
||||
void FilteringProxyModel::set_filter_term(StringView const& term)
|
||||
void FilteringProxyModel::set_filter_term(StringView term)
|
||||
{
|
||||
if (m_filter_term == term)
|
||||
return;
|
||||
|
@ -104,7 +104,7 @@ bool FilteringProxyModel::is_searchable() const
|
|||
return m_model.is_searchable();
|
||||
}
|
||||
|
||||
Vector<ModelIndex> FilteringProxyModel::matches(StringView const& searching, unsigned flags, ModelIndex const& index)
|
||||
Vector<ModelIndex> FilteringProxyModel::matches(StringView searching, unsigned flags, ModelIndex const& index)
|
||||
{
|
||||
auto found_indices = m_model.matches(searching, flags, index);
|
||||
for (size_t i = 0; i < found_indices.size(); i++)
|
||||
|
|
|
@ -29,9 +29,9 @@ public:
|
|||
virtual void invalidate() override;
|
||||
virtual ModelIndex index(int row, int column = 0, ModelIndex const& parent = ModelIndex()) const override;
|
||||
virtual bool is_searchable() const override;
|
||||
virtual Vector<ModelIndex> matches(StringView const&, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
|
||||
void set_filter_term(StringView const& term);
|
||||
void set_filter_term(StringView term);
|
||||
|
||||
ModelIndex map(ModelIndex const&) const;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
virtual ~GMLAutocompleteProvider() override { }
|
||||
|
||||
private:
|
||||
static bool can_have_declared_layout(const StringView& class_name)
|
||||
static bool can_have_declared_layout(StringView class_name)
|
||||
{
|
||||
return class_name.is_one_of("GUI::Widget", "GUI::Frame");
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ static String format_gml_object(const JsonObject& node, size_t indentation = 0,
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
String format_gml(const StringView& string)
|
||||
String format_gml(StringView string)
|
||||
{
|
||||
// FIXME: Preserve comments somehow, they're not contained
|
||||
// in the JSON object returned by parse_gml()
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
String format_gml(const StringView&);
|
||||
String format_gml(StringView);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
GMLLexer::GMLLexer(StringView const& input)
|
||||
GMLLexer::GMLLexer(StringView input)
|
||||
: m_input(input)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ struct GMLToken {
|
|||
|
||||
class GMLLexer {
|
||||
public:
|
||||
GMLLexer(StringView const&);
|
||||
GMLLexer(StringView);
|
||||
|
||||
Vector<GMLToken> lex();
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ static Optional<JsonValue> parse_core_object(Queue<GMLToken>& tokens)
|
|||
return object;
|
||||
}
|
||||
|
||||
JsonValue parse_gml(const StringView& string)
|
||||
JsonValue parse_gml(StringView string)
|
||||
{
|
||||
auto lexer = GMLLexer(string);
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
JsonValue parse_gml(const StringView&);
|
||||
JsonValue parse_gml(StringView);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ REGISTER_WIDGET(GUI, GroupBox)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
GroupBox::GroupBox(const StringView& title)
|
||||
GroupBox::GroupBox(StringView title)
|
||||
: m_title(title)
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("title", title, set_title);
|
||||
|
@ -58,7 +58,7 @@ void GroupBox::fonts_change_event(FontsChangeEvent& event)
|
|||
invalidate_layout();
|
||||
}
|
||||
|
||||
void GroupBox::set_title(const StringView& title)
|
||||
void GroupBox::set_title(StringView title)
|
||||
{
|
||||
if (m_title == title)
|
||||
return;
|
||||
|
|
|
@ -16,11 +16,11 @@ public:
|
|||
virtual ~GroupBox() override;
|
||||
|
||||
String title() const { return m_title; }
|
||||
void set_title(const StringView&);
|
||||
void set_title(StringView);
|
||||
virtual Margins content_margins() const override;
|
||||
|
||||
protected:
|
||||
explicit GroupBox(const StringView& title = {});
|
||||
explicit GroupBox(StringView title = {});
|
||||
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void fonts_change_event(FontsChangeEvent&) override;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
IniLexer::IniLexer(StringView const& input)
|
||||
IniLexer::IniLexer(StringView input)
|
||||
: m_input(input)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ struct IniToken {
|
|||
|
||||
class IniLexer {
|
||||
public:
|
||||
IniLexer(StringView const&);
|
||||
IniLexer(StringView);
|
||||
|
||||
Vector<IniToken> lex();
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ void IconImpl::set_bitmap_for_size(int size, RefPtr<Gfx::Bitmap>&& bitmap)
|
|||
m_bitmaps.set(size, move(bitmap));
|
||||
}
|
||||
|
||||
Icon Icon::default_icon(const StringView& name)
|
||||
Icon Icon::default_icon(StringView name)
|
||||
{
|
||||
RefPtr<Gfx::Bitmap> bitmap16;
|
||||
RefPtr<Gfx::Bitmap> bitmap32;
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
Icon(const Icon&);
|
||||
~Icon() { }
|
||||
|
||||
static Icon default_icon(const StringView&);
|
||||
static Icon default_icon(StringView);
|
||||
|
||||
Icon& operator=(const Icon& other)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ REGISTER_WIDGET(GUI, ImageWidget)
|
|||
|
||||
namespace GUI {
|
||||
|
||||
ImageWidget::ImageWidget(const StringView&)
|
||||
ImageWidget::ImageWidget(StringView)
|
||||
: m_timer(Core::Timer::construct())
|
||||
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ void ImageWidget::animate()
|
|||
}
|
||||
}
|
||||
|
||||
void ImageWidget::load_from_file(const StringView& path)
|
||||
void ImageWidget::load_from_file(StringView path)
|
||||
{
|
||||
auto file_or_error = MappedFile::map(path);
|
||||
if (file_or_error.is_error())
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
bool auto_resize() const { return m_auto_resize; }
|
||||
|
||||
void animate();
|
||||
void load_from_file(const StringView&);
|
||||
void load_from_file(StringView);
|
||||
|
||||
int opacity_percent() const { return m_opacity_percent; }
|
||||
void set_opacity_percent(int percent);
|
||||
|
@ -34,7 +34,7 @@ public:
|
|||
Function<void()> on_click;
|
||||
|
||||
protected:
|
||||
explicit ImageWidget(const StringView& text = {});
|
||||
explicit ImageWidget(StringView text = {});
|
||||
|
||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
InputBox::InputBox(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder, InputType input_type)
|
||||
InputBox::InputBox(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
: Dialog(parent_window)
|
||||
, m_text_value(text_value)
|
||||
, m_prompt(prompt)
|
||||
|
@ -28,7 +28,7 @@ InputBox::~InputBox()
|
|||
{
|
||||
}
|
||||
|
||||
int InputBox::show(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder, InputType input_type)
|
||||
int InputBox::show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type)
|
||||
{
|
||||
auto box = InputBox::construct(parent_window, text_value, prompt, title, placeholder, input_type);
|
||||
box->set_resizable(false);
|
||||
|
|
|
@ -21,10 +21,10 @@ class InputBox : public Dialog {
|
|||
public:
|
||||
virtual ~InputBox() override;
|
||||
|
||||
static int show(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder = {}, InputType input_type = InputType::Text);
|
||||
static int show(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder = {}, InputType input_type = InputType::Text);
|
||||
|
||||
private:
|
||||
explicit InputBox(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder, InputType input_type);
|
||||
explicit InputBox(Window* parent_window, String& text_value, StringView prompt, StringView title, StringView placeholder, InputType input_type);
|
||||
|
||||
String text_value() const { return m_text_value; }
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
}
|
||||
|
||||
virtual bool is_searchable() const override { return true; }
|
||||
virtual Vector<GUI::ModelIndex> matches(StringView const& searching, unsigned flags, GUI::ModelIndex const&) override
|
||||
virtual Vector<GUI::ModelIndex> matches(StringView searching, unsigned flags, GUI::ModelIndex const&) override
|
||||
{
|
||||
Vector<GUI::ModelIndex> found_indices;
|
||||
if constexpr (IsTwoDimensional) {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
int MessageBox::show(Window* parent_window, const StringView& text, const StringView& title, Type type, InputType input_type)
|
||||
int MessageBox::show(Window* parent_window, StringView text, StringView title, Type type, InputType input_type)
|
||||
{
|
||||
auto box = MessageBox::construct(parent_window, text, title, type, input_type);
|
||||
if (parent_window)
|
||||
|
@ -21,12 +21,12 @@ int MessageBox::show(Window* parent_window, const StringView& text, const String
|
|||
return box->exec();
|
||||
}
|
||||
|
||||
int MessageBox::show_error(Window* parent_window, const StringView& text)
|
||||
int MessageBox::show_error(Window* parent_window, StringView text)
|
||||
{
|
||||
return show(parent_window, text, "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK);
|
||||
}
|
||||
|
||||
MessageBox::MessageBox(Window* parent_window, const StringView& text, const StringView& title, Type type, InputType input_type)
|
||||
MessageBox::MessageBox(Window* parent_window, StringView text, StringView title, Type type, InputType input_type)
|
||||
: Dialog(parent_window)
|
||||
, m_text(text)
|
||||
, m_type(type)
|
||||
|
|
|
@ -30,11 +30,11 @@ public:
|
|||
|
||||
virtual ~MessageBox() override;
|
||||
|
||||
static int show(Window* parent_window, const StringView& text, const StringView& title, Type type = Type::None, InputType input_type = InputType::OK);
|
||||
static int show_error(Window* parent_window, const StringView& text);
|
||||
static int show(Window* parent_window, StringView text, StringView title, Type type = Type::None, InputType input_type = InputType::OK);
|
||||
static int show_error(Window* parent_window, StringView text);
|
||||
|
||||
private:
|
||||
explicit MessageBox(Window* parent_window, const StringView& text, const StringView& title, Type type = Type::None, InputType input_type = InputType::OK);
|
||||
explicit MessageBox(Window* parent_window, StringView text, StringView title, Type type = Type::None, InputType input_type = InputType::OK);
|
||||
|
||||
bool should_include_ok_button() const;
|
||||
bool should_include_cancel_button() const;
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
virtual void set_data(ModelIndex const&, Variant const&) { }
|
||||
virtual int tree_column() const { return 0; }
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const;
|
||||
virtual Vector<ModelIndex> matches(StringView const&, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) { return {}; }
|
||||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) { return {}; }
|
||||
|
||||
virtual bool is_column_sortable([[maybe_unused]] int column_index) const { return true; }
|
||||
virtual void sort([[maybe_unused]] int column, SortOrder) { }
|
||||
|
@ -104,7 +104,7 @@ protected:
|
|||
void for_each_client(Function<void(ModelClient&)>);
|
||||
void did_update(unsigned flags = UpdateFlag::InvalidateAllIndices);
|
||||
|
||||
static bool string_matches(StringView const& str, StringView const& needle, unsigned flags)
|
||||
static bool string_matches(StringView str, StringView needle, unsigned flags)
|
||||
{
|
||||
auto case_sensitivity = (flags & CaseInsensitive) ? CaseSensitivity::CaseInsensitive : CaseSensitivity::CaseSensitive;
|
||||
if (flags & MatchFull)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
ProcessChooser::ProcessChooser(const StringView& window_title, const StringView& button_label, const Gfx::Bitmap* window_icon, GUI::Window* parent_window)
|
||||
ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, const Gfx::Bitmap* window_icon, GUI::Window* parent_window)
|
||||
: Dialog(parent_window)
|
||||
, m_window_title(window_title)
|
||||
, m_button_label(button_label)
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
pid_t pid() const { return m_pid; }
|
||||
|
||||
private:
|
||||
ProcessChooser(const StringView& window_title = "Process Chooser", const StringView& button_label = "Select", const Gfx::Bitmap* window_icon = nullptr, GUI::Window* parent_window = nullptr);
|
||||
ProcessChooser(StringView window_title = "Process Chooser", StringView button_label = "Select", const Gfx::Bitmap* window_icon = nullptr, GUI::Window* parent_window = nullptr);
|
||||
|
||||
void set_pid_from_index_and_close(const ModelIndex&);
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ bool SortingProxyModel::is_searchable() const
|
|||
return source().is_searchable();
|
||||
}
|
||||
|
||||
Vector<ModelIndex> SortingProxyModel::matches(StringView const& searching, unsigned flags, ModelIndex const& proxy_index)
|
||||
Vector<ModelIndex> SortingProxyModel::matches(StringView searching, unsigned flags, ModelIndex const& proxy_index)
|
||||
{
|
||||
auto found_indices = source().matches(searching, flags, map_to_source(proxy_index));
|
||||
for (size_t i = 0; i < found_indices.size(); i++)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual bool is_editable(ModelIndex const&) const override;
|
||||
virtual bool is_searchable() const override;
|
||||
virtual void set_data(ModelIndex const&, Variant const&) override;
|
||||
virtual Vector<ModelIndex> matches(StringView const&, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual Vector<ModelIndex> matches(StringView, unsigned = MatchesFlag::AllMatching, ModelIndex const& = ModelIndex()) override;
|
||||
virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const override;
|
||||
|
||||
virtual bool is_column_sortable(int column_index) const override;
|
||||
|
|
|
@ -44,7 +44,7 @@ TabWidget::~TabWidget()
|
|||
{
|
||||
}
|
||||
|
||||
void TabWidget::add_widget(const StringView& title, Widget& widget)
|
||||
void TabWidget::add_widget(StringView title, Widget& widget)
|
||||
{
|
||||
m_tabs.append({ title, nullptr, &widget });
|
||||
add_child(widget);
|
||||
|
@ -537,7 +537,7 @@ Optional<size_t> TabWidget::active_tab_index() const
|
|||
return {};
|
||||
}
|
||||
|
||||
void TabWidget::set_tab_title(Widget& tab, const StringView& title)
|
||||
void TabWidget::set_tab_title(Widget& tab, StringView title)
|
||||
{
|
||||
for (auto& t : m_tabs) {
|
||||
if (t.widget == &tab) {
|
||||
|
|
|
@ -36,11 +36,11 @@ public:
|
|||
GUI::Margins const& container_margins() const { return m_container_margins; }
|
||||
void set_container_margins(GUI::Margins const&);
|
||||
|
||||
void add_widget(const StringView&, Widget&);
|
||||
void add_widget(StringView, Widget&);
|
||||
void remove_widget(Widget&);
|
||||
|
||||
template<class T, class... Args>
|
||||
T& add_tab(const StringView& title, Args&&... args)
|
||||
T& add_tab(StringView title, Args&&... args)
|
||||
{
|
||||
auto t = T::construct(forward<Args>(args)...);
|
||||
add_widget(title, *t);
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
void remove_tab(Widget& tab) { remove_widget(tab); }
|
||||
void remove_all_tabs_except(Widget& tab);
|
||||
|
||||
void set_tab_title(Widget& tab, const StringView& title);
|
||||
void set_tab_title(Widget& tab, StringView title);
|
||||
void set_tab_icon(Widget& tab, const Gfx::Bitmap*);
|
||||
|
||||
void activate_next_tab();
|
||||
|
|
|
@ -39,7 +39,7 @@ TextDocument::~TextDocument()
|
|||
{
|
||||
}
|
||||
|
||||
bool TextDocument::set_text(const StringView& text, AllowCallback allow_callback)
|
||||
bool TextDocument::set_text(StringView text, AllowCallback allow_callback)
|
||||
{
|
||||
m_client_notifications_enabled = false;
|
||||
m_undo_stack.clear();
|
||||
|
@ -161,7 +161,7 @@ TextDocumentLine::TextDocumentLine(TextDocument& document)
|
|||
clear(document);
|
||||
}
|
||||
|
||||
TextDocumentLine::TextDocumentLine(TextDocument& document, const StringView& text)
|
||||
TextDocumentLine::TextDocumentLine(TextDocument& document, StringView text)
|
||||
{
|
||||
set_text(document, text);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ void TextDocumentLine::set_text(TextDocument& document, const Vector<u32> text)
|
|||
document.update_views({});
|
||||
}
|
||||
|
||||
bool TextDocumentLine::set_text(TextDocument& document, const StringView& text)
|
||||
bool TextDocumentLine::set_text(TextDocument& document, StringView text)
|
||||
{
|
||||
if (text.is_empty()) {
|
||||
clear(document);
|
||||
|
@ -403,7 +403,7 @@ TextPosition TextDocument::previous_position_before(const TextPosition& position
|
|||
return { position.line(), position.column() - 1 };
|
||||
}
|
||||
|
||||
void TextDocument::update_regex_matches(const StringView& needle)
|
||||
void TextDocument::update_regex_matches(StringView needle)
|
||||
{
|
||||
if (m_regex_needs_update || needle != m_regex_needle) {
|
||||
Regex<PosixExtended> re(needle);
|
||||
|
@ -421,7 +421,7 @@ void TextDocument::update_regex_matches(const StringView& needle)
|
|||
}
|
||||
}
|
||||
|
||||
TextRange TextDocument::find_next(const StringView& needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
|
||||
TextRange TextDocument::find_next(StringView needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
|
||||
{
|
||||
if (needle.is_empty())
|
||||
return {};
|
||||
|
@ -501,7 +501,7 @@ TextRange TextDocument::find_next(const StringView& needle, const TextPosition&
|
|||
return {};
|
||||
}
|
||||
|
||||
TextRange TextDocument::find_previous(const StringView& needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
|
||||
TextRange TextDocument::find_previous(StringView needle, const TextPosition& start, SearchShouldWrap should_wrap, bool regmatch, bool match_case)
|
||||
{
|
||||
if (needle.is_empty())
|
||||
return {};
|
||||
|
@ -585,7 +585,7 @@ TextRange TextDocument::find_previous(const StringView& needle, const TextPositi
|
|||
return {};
|
||||
}
|
||||
|
||||
Vector<TextRange> TextDocument::find_all(const StringView& needle, bool regmatch)
|
||||
Vector<TextRange> TextDocument::find_all(StringView needle, bool regmatch)
|
||||
{
|
||||
Vector<TextRange> ranges;
|
||||
|
||||
|
@ -889,7 +889,7 @@ void RemoveTextCommand::undo()
|
|||
m_document.set_all_cursors(new_cursor);
|
||||
}
|
||||
|
||||
TextPosition TextDocument::insert_at(const TextPosition& position, const StringView& text, const Client* client)
|
||||
TextPosition TextDocument::insert_at(const TextPosition& position, StringView text, const Client* client)
|
||||
{
|
||||
TextPosition cursor = position;
|
||||
Utf8View utf8_view(text);
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
void set_spans(Vector<TextDocumentSpan> spans) { m_spans = move(spans); }
|
||||
|
||||
bool set_text(const StringView&, AllowCallback = AllowCallback::Yes);
|
||||
bool set_text(StringView, AllowCallback = AllowCallback::Yes);
|
||||
|
||||
const NonnullOwnPtrVector<TextDocumentLine>& lines() const { return m_lines; }
|
||||
NonnullOwnPtrVector<TextDocumentLine>& lines() { return m_lines; }
|
||||
|
@ -88,11 +88,11 @@ public:
|
|||
String text() const;
|
||||
String text_in_range(const TextRange&) const;
|
||||
|
||||
Vector<TextRange> find_all(const StringView& needle, bool regmatch = false);
|
||||
Vector<TextRange> find_all(StringView needle, bool regmatch = false);
|
||||
|
||||
void update_regex_matches(const StringView&);
|
||||
TextRange find_next(const StringView&, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
|
||||
TextRange find_previous(const StringView&, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
|
||||
void update_regex_matches(StringView);
|
||||
TextRange find_next(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
|
||||
TextRange find_previous(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);
|
||||
|
||||
TextPosition next_position_after(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
|
||||
TextPosition previous_position_before(const TextPosition&, SearchShouldWrap = SearchShouldWrap::Yes) const;
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
void set_all_cursors(const TextPosition&);
|
||||
|
||||
TextPosition insert_at(const TextPosition&, u32, const Client* = nullptr);
|
||||
TextPosition insert_at(const TextPosition&, const StringView&, const Client* = nullptr);
|
||||
TextPosition insert_at(const TextPosition&, StringView, const Client* = nullptr);
|
||||
void remove(const TextRange&);
|
||||
|
||||
virtual bool is_code_document() const { return false; }
|
||||
|
@ -154,14 +154,14 @@ private:
|
|||
class TextDocumentLine {
|
||||
public:
|
||||
explicit TextDocumentLine(TextDocument&);
|
||||
explicit TextDocumentLine(TextDocument&, const StringView&);
|
||||
explicit TextDocumentLine(TextDocument&, StringView);
|
||||
|
||||
String to_utf8() const;
|
||||
|
||||
Utf32View view() const { return { code_points(), length() }; }
|
||||
const u32* code_points() const { return m_text.data(); }
|
||||
size_t length() const { return m_text.size(); }
|
||||
bool set_text(TextDocument&, const StringView&);
|
||||
bool set_text(TextDocument&, StringView);
|
||||
void set_text(TextDocument&, Vector<u32>);
|
||||
void append(TextDocument&, u32);
|
||||
void prepend(TextDocument&, u32);
|
||||
|
|
|
@ -101,7 +101,7 @@ void TextEditor::create_actions()
|
|||
m_select_all_action = CommonActions::make_select_all_action([this](auto&) { select_all(); }, this);
|
||||
}
|
||||
|
||||
void TextEditor::set_text(StringView const& text, AllowCallback allow_callback)
|
||||
void TextEditor::set_text(StringView text, AllowCallback allow_callback)
|
||||
{
|
||||
m_selection.clear();
|
||||
|
||||
|
@ -1378,7 +1378,7 @@ void TextEditor::delete_text_range(TextRange range)
|
|||
update();
|
||||
}
|
||||
|
||||
void TextEditor::insert_at_cursor_or_replace_selection(StringView const& text)
|
||||
void TextEditor::insert_at_cursor_or_replace_selection(StringView text)
|
||||
{
|
||||
ReflowDeferrer defer(*this);
|
||||
VERIFY(is_editable());
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
virtual void set_document(TextDocument&);
|
||||
|
||||
String const& placeholder() const { return m_placeholder; }
|
||||
void set_placeholder(StringView const& placeholder) { m_placeholder = placeholder; }
|
||||
void set_placeholder(StringView placeholder) { m_placeholder = placeholder; }
|
||||
|
||||
TextDocumentLine& current_line() { return line(m_cursor.line()); }
|
||||
TextDocumentLine const& current_line() const { return line(m_cursor.line()); }
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
Function<void()> on_focusin;
|
||||
Function<void()> on_focusout;
|
||||
|
||||
void set_text(StringView const&, AllowCallback = AllowCallback::Yes);
|
||||
void set_text(StringView, AllowCallback = AllowCallback::Yes);
|
||||
void scroll_cursor_into_view();
|
||||
void scroll_position_into_view(TextPosition const&);
|
||||
size_t line_count() const { return document().line_count(); }
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
TextPosition cursor() const { return m_cursor; }
|
||||
TextRange normalized_selection() const { return m_selection.normalized(); }
|
||||
|
||||
void insert_at_cursor_or_replace_selection(StringView const&);
|
||||
void insert_at_cursor_or_replace_selection(StringView);
|
||||
bool write_to_file(String const& path);
|
||||
bool write_to_file_and_close(int fd);
|
||||
bool has_selection() const { return m_selection.is_valid(); }
|
||||
|
|
|
@ -163,7 +163,7 @@ Variant::Variant(const FlyString& value)
|
|||
{
|
||||
}
|
||||
|
||||
Variant::Variant(const StringView& value)
|
||||
Variant::Variant(StringView value)
|
||||
: Variant(value.to_string())
|
||||
{
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
Variant(u32);
|
||||
Variant(u64);
|
||||
Variant(const char*);
|
||||
Variant(const StringView&);
|
||||
Variant(StringView);
|
||||
Variant(const String&);
|
||||
Variant(const FlyString&);
|
||||
Variant(const Gfx::Bitmap&);
|
||||
|
|
|
@ -1055,7 +1055,7 @@ void Widget::set_override_cursor(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<
|
|||
}
|
||||
}
|
||||
|
||||
bool Widget::load_from_gml(const StringView& gml_string)
|
||||
bool Widget::load_from_gml(StringView gml_string)
|
||||
{
|
||||
return load_from_gml(gml_string, [](const String& class_name) -> RefPtr<Core::Object> {
|
||||
dbgln("Class '{}' not registered", class_name);
|
||||
|
@ -1063,7 +1063,7 @@ bool Widget::load_from_gml(const StringView& gml_string)
|
|||
});
|
||||
}
|
||||
|
||||
bool Widget::load_from_gml(const StringView& gml_string, RefPtr<Core::Object> (*unregistered_child_handler)(const String&))
|
||||
bool Widget::load_from_gml(StringView gml_string, RefPtr<Core::Object> (*unregistered_child_handler)(const String&))
|
||||
{
|
||||
auto value = parse_gml(gml_string);
|
||||
if (!value.is_object())
|
||||
|
|
|
@ -280,8 +280,8 @@ public:
|
|||
AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> override_cursor() const { return m_override_cursor; }
|
||||
void set_override_cursor(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>>);
|
||||
|
||||
bool load_from_gml(const StringView&);
|
||||
bool load_from_gml(const StringView&, RefPtr<Core::Object> (*unregistered_child_handler)(const String&));
|
||||
bool load_from_gml(StringView);
|
||||
bool load_from_gml(StringView, RefPtr<Core::Object> (*unregistered_child_handler)(const String&));
|
||||
|
||||
void set_shrink_to_fit(bool);
|
||||
bool is_shrink_to_fit() const { return m_shrink_to_fit; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue