mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:47:34 +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
|
@ -1324,13 +1324,13 @@ void Terminal::execute_dcs_sequence()
|
|||
{
|
||||
}
|
||||
|
||||
void Terminal::inject_string(const StringView& str)
|
||||
void Terminal::inject_string(StringView str)
|
||||
{
|
||||
for (size_t i = 0; i < str.length(); ++i)
|
||||
on_input(str[i]);
|
||||
}
|
||||
|
||||
void Terminal::emit_string(const StringView& string)
|
||||
void Terminal::emit_string(StringView string)
|
||||
{
|
||||
m_client.emit((const u8*)string.characters_without_null_termination(), string.length());
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual ~TerminalClient() { }
|
||||
|
||||
virtual void beep() = 0;
|
||||
virtual void set_window_title(const StringView&) = 0;
|
||||
virtual void set_window_title(StringView) = 0;
|
||||
virtual void set_window_progress(int value, int max) = 0;
|
||||
virtual void terminal_did_resize(u16 columns, u16 rows) = 0;
|
||||
virtual void terminal_history_changed(int delta) = 0;
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
size_t history_size() const { return m_use_alternate_screen_buffer ? 0 : m_history.size(); }
|
||||
#endif
|
||||
|
||||
void inject_string(const StringView&);
|
||||
void inject_string(StringView);
|
||||
void handle_key_press(KeyCode, u32, u8 flags);
|
||||
|
||||
#ifndef KERNEL
|
||||
|
@ -230,7 +230,7 @@ protected:
|
|||
void unimplemented_csi_sequence(Parameters, Intermediates, u8 last_byte);
|
||||
void unimplemented_osc_sequence(OscParameters, u8 last_byte);
|
||||
|
||||
void emit_string(const StringView&);
|
||||
void emit_string(StringView);
|
||||
|
||||
void alter_ansi_mode(bool should_set, Parameters);
|
||||
void alter_private_mode(bool should_set, Parameters);
|
||||
|
|
|
@ -458,7 +458,7 @@ void TerminalWidget::set_window_progress(int value, int max)
|
|||
window()->set_progress((int)roundf(progress));
|
||||
}
|
||||
|
||||
void TerminalWidget::set_window_title(const StringView& title)
|
||||
void TerminalWidget::set_window_title(StringView title)
|
||||
{
|
||||
if (!Utf8View(title).validate()) {
|
||||
dbgln("TerminalWidget: Attempted to set window title to invalid UTF-8 string");
|
||||
|
@ -649,7 +649,7 @@ static u32 to_lowercase_code_point(u32 code_point)
|
|||
return code_point;
|
||||
}
|
||||
|
||||
VT::Range TerminalWidget::find_next(const StringView& needle, const VT::Position& start, bool case_sensitivity, bool should_wrap)
|
||||
VT::Range TerminalWidget::find_next(StringView needle, const VT::Position& start, bool case_sensitivity, bool should_wrap)
|
||||
{
|
||||
if (needle.is_empty())
|
||||
return {};
|
||||
|
@ -681,7 +681,7 @@ VT::Range TerminalWidget::find_next(const StringView& needle, const VT::Position
|
|||
return {};
|
||||
}
|
||||
|
||||
VT::Range TerminalWidget::find_previous(const StringView& needle, const VT::Position& start, bool case_sensitivity, bool should_wrap)
|
||||
VT::Range TerminalWidget::find_previous(StringView needle, const VT::Position& start, bool case_sensitivity, bool should_wrap)
|
||||
{
|
||||
if (needle.is_empty())
|
||||
return {};
|
||||
|
@ -1159,7 +1159,7 @@ void TerminalWidget::update_paste_action()
|
|||
m_paste_action->set_enabled(GUI::Clipboard::the().mime_type().starts_with("text/") && !GUI::Clipboard::the().data().is_empty());
|
||||
}
|
||||
|
||||
void TerminalWidget::set_color_scheme(const StringView& name)
|
||||
void TerminalWidget::set_color_scheme(StringView name)
|
||||
{
|
||||
if (name.contains('/')) {
|
||||
dbgln("Shenanigans! Color scheme names can't contain slashes.");
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
virtual ~TerminalWidget() override;
|
||||
|
||||
void set_pty_master_fd(int fd);
|
||||
void inject_string(const StringView& string)
|
||||
void inject_string(StringView string)
|
||||
{
|
||||
m_terminal.inject_string(string);
|
||||
flush_dirty_lines();
|
||||
|
@ -59,8 +59,8 @@ public:
|
|||
void set_selection(const VT::Range& selection);
|
||||
VT::Position buffer_position_at(const Gfx::IntPoint&) const;
|
||||
|
||||
VT::Range find_next(const StringView&, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
VT::Range find_previous(const StringView&, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
VT::Range find_next(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
VT::Range find_previous(StringView, const VT::Position& start = {}, bool case_sensitivity = false, bool should_wrap = false);
|
||||
|
||||
void scroll_to_bottom();
|
||||
void scroll_to_row(int);
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
const StringView color_scheme_name() const { return m_color_scheme_name; }
|
||||
|
||||
Function<void(const StringView&)> on_title_change;
|
||||
Function<void(StringView)> on_title_change;
|
||||
Function<void(const Gfx::IntSize&)> on_terminal_size_change;
|
||||
Function<void()> on_command_exit;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
void set_font_and_resize_to_fit(const Gfx::Font&);
|
||||
|
||||
void set_color_scheme(const StringView&);
|
||||
void set_color_scheme(StringView);
|
||||
|
||||
private:
|
||||
TerminalWidget(int ptm_fd, bool automatic_size_policy);
|
||||
|
@ -116,7 +116,7 @@ private:
|
|||
|
||||
// ^TerminalClient
|
||||
virtual void beep() override;
|
||||
virtual void set_window_title(const StringView&) override;
|
||||
virtual void set_window_title(StringView) override;
|
||||
virtual void set_window_progress(int value, int max) override;
|
||||
virtual void terminal_did_resize(u16 columns, u16 rows) override;
|
||||
virtual void terminal_history_changed(int delta) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue