mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:57:46 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -59,11 +59,11 @@ struct Attribute {
|
|||
|
||||
Flags flags { Flags::NoAttributes };
|
||||
|
||||
constexpr bool operator==(const Attribute& other) const
|
||||
constexpr bool operator==(Attribute const& other) const
|
||||
{
|
||||
return foreground_color == other.foreground_color && background_color == other.background_color && flags == other.flags;
|
||||
}
|
||||
constexpr bool operator!=(const Attribute& other) const
|
||||
constexpr bool operator!=(Attribute const& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
constexpr bool operator==(const Color& other) const
|
||||
constexpr bool operator==(Color const& other) const
|
||||
{
|
||||
if (m_kind != other.kind())
|
||||
return false;
|
||||
|
|
|
@ -19,7 +19,7 @@ class EscapeSequenceExecutor {
|
|||
public:
|
||||
virtual ~EscapeSequenceExecutor() = default;
|
||||
|
||||
using Parameters = Span<const unsigned>;
|
||||
using Parameters = Span<unsigned const>;
|
||||
using Intermediates = Span<const u8>;
|
||||
using OscParameter = Span<const u8>;
|
||||
using OscParameters = Span<const OscParameter>;
|
||||
|
|
|
@ -117,7 +117,7 @@ void Line::take_cells_from_next_line(size_t new_length, Line* next_line, bool cu
|
|||
next_line->m_cells.clear();
|
||||
}
|
||||
|
||||
void Line::clear_range(size_t first_column, size_t last_column, const Attribute& attribute)
|
||||
void Line::clear_range(size_t first_column, size_t last_column, Attribute const& attribute)
|
||||
{
|
||||
VERIFY(first_column <= last_column);
|
||||
VERIFY(last_column < m_cells.size());
|
||||
|
|
|
@ -31,18 +31,18 @@ public:
|
|||
bool operator!=(Cell const& other) const { return code_point != other.code_point || attribute != other.attribute; }
|
||||
};
|
||||
|
||||
const Attribute& attribute_at(size_t index) const { return m_cells[index].attribute; }
|
||||
Attribute const& attribute_at(size_t index) const { return m_cells[index].attribute; }
|
||||
Attribute& attribute_at(size_t index) { return m_cells[index].attribute; }
|
||||
|
||||
Cell& cell_at(size_t index) { return m_cells[index]; }
|
||||
const Cell& cell_at(size_t index) const { return m_cells[index]; }
|
||||
Cell const& cell_at(size_t index) const { return m_cells[index]; }
|
||||
|
||||
void clear(const Attribute& attribute = Attribute())
|
||||
void clear(Attribute const& attribute = Attribute())
|
||||
{
|
||||
m_terminated_at.clear();
|
||||
clear_range(0, m_cells.size() - 1, attribute);
|
||||
}
|
||||
void clear_range(size_t first_column, size_t last_column, const Attribute& attribute = Attribute());
|
||||
void clear_range(size_t first_column, size_t last_column, Attribute const& attribute = Attribute());
|
||||
bool has_only_one_background_color() const;
|
||||
|
||||
bool is_empty() const
|
||||
|
|
|
@ -23,27 +23,27 @@ public:
|
|||
int row() const { return m_row; }
|
||||
int column() const { return m_column; }
|
||||
|
||||
bool operator<(const Position& other) const
|
||||
bool operator<(Position const& other) const
|
||||
{
|
||||
return m_row < other.m_row || (m_row == other.m_row && m_column < other.m_column);
|
||||
}
|
||||
|
||||
bool operator<=(const Position& other) const
|
||||
bool operator<=(Position const& other) const
|
||||
{
|
||||
return *this < other || *this == other;
|
||||
}
|
||||
|
||||
bool operator>=(const Position& other) const
|
||||
bool operator>=(Position const& other) const
|
||||
{
|
||||
return !(*this < other);
|
||||
}
|
||||
|
||||
bool operator==(const Position& other) const
|
||||
bool operator==(Position const& other) const
|
||||
{
|
||||
return m_row == other.m_row && m_column == other.m_column;
|
||||
}
|
||||
|
||||
bool operator!=(const Position& other) const
|
||||
bool operator!=(Position const& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
m_end = Position(m_end.row() + delta, m_end.column());
|
||||
}
|
||||
|
||||
bool operator==(const Range& other) const
|
||||
bool operator==(Range const& other) const
|
||||
{
|
||||
return m_start == other.m_start && m_end == other.m_end;
|
||||
}
|
||||
|
|
|
@ -1347,7 +1347,7 @@ void Terminal::inject_string(StringView str)
|
|||
|
||||
void Terminal::emit_string(StringView string)
|
||||
{
|
||||
m_client.emit((const u8*)string.characters_without_null_termination(), string.length());
|
||||
m_client.emit((u8 const*)string.characters_without_null_termination(), string.length());
|
||||
}
|
||||
|
||||
void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags)
|
||||
|
@ -1657,7 +1657,7 @@ void Terminal::invalidate_cursor()
|
|||
active_buffer()[cursor_row()].set_dirty(true);
|
||||
}
|
||||
|
||||
Attribute Terminal::attribute_at(const Position& position) const
|
||||
Attribute Terminal::attribute_at(Position const& position) const
|
||||
{
|
||||
if (!position.is_valid())
|
||||
return {};
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
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;
|
||||
virtual void emit(const u8*, size_t) = 0;
|
||||
virtual void emit(u8 const*, size_t) = 0;
|
||||
virtual void set_cursor_style(CursorStyle) = 0;
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
return m_normal_screen_buffer[index - m_history.size()];
|
||||
}
|
||||
}
|
||||
const Line& line(size_t index) const
|
||||
Line const& line(size_t index) const
|
||||
{
|
||||
return const_cast<Terminal*>(this)->line(index);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
return active_buffer()[index];
|
||||
}
|
||||
|
||||
const Line& visible_line(size_t index) const
|
||||
Line const& visible_line(size_t index) const
|
||||
{
|
||||
return active_buffer()[index];
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public:
|
|||
void handle_key_press(KeyCode, u32, u8 flags);
|
||||
|
||||
#ifndef KERNEL
|
||||
Attribute attribute_at(const Position&) const;
|
||||
Attribute attribute_at(Position const&) const;
|
||||
#endif
|
||||
|
||||
bool needs_bracketed_paste() const
|
||||
|
@ -404,7 +404,7 @@ protected:
|
|||
}
|
||||
|
||||
NonnullOwnPtrVector<Line>& active_buffer() { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
const NonnullOwnPtrVector<Line>& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
NonnullOwnPtrVector<Line> const& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
NonnullOwnPtrVector<Line> m_normal_screen_buffer;
|
||||
NonnullOwnPtrVector<Line> m_alternate_screen_buffer;
|
||||
#endif
|
||||
|
|
|
@ -492,7 +492,7 @@ void TerminalWidget::resize_event(GUI::ResizeEvent& event)
|
|||
relayout(event.size());
|
||||
}
|
||||
|
||||
void TerminalWidget::relayout(const Gfx::IntSize& size)
|
||||
void TerminalWidget::relayout(Gfx::IntSize const& size)
|
||||
{
|
||||
if (!m_scrollbar)
|
||||
return;
|
||||
|
@ -580,7 +580,7 @@ bool TerminalWidget::selection_contains(const VT::Position& position) const
|
|||
return position >= normalized_selection.start() && position <= normalized_selection.end();
|
||||
}
|
||||
|
||||
VT::Position TerminalWidget::buffer_position_at(const Gfx::IntPoint& position) const
|
||||
VT::Position TerminalWidget::buffer_position_at(Gfx::IntPoint const& position) const
|
||||
{
|
||||
auto adjusted_position = position.translated(-(frame_thickness() + m_inset), -(frame_thickness() + m_inset));
|
||||
int row = adjusted_position.y() / m_line_height;
|
||||
|
@ -1030,7 +1030,7 @@ void TerminalWidget::beep()
|
|||
update();
|
||||
}
|
||||
|
||||
void TerminalWidget::emit(const u8* data, size_t size)
|
||||
void TerminalWidget::emit(u8 const* data, size_t size)
|
||||
{
|
||||
if (write(m_ptm_fd, data, size) < 0) {
|
||||
perror("TerminalWidget::emit: write");
|
||||
|
@ -1229,7 +1229,7 @@ void TerminalWidget::set_color_scheme(StringView name)
|
|||
update();
|
||||
}
|
||||
|
||||
Gfx::IntSize TerminalWidget::widget_size_for_font(const Gfx::Font& font) const
|
||||
Gfx::IntSize TerminalWidget::widget_size_for_font(Gfx::Font const& font) const
|
||||
{
|
||||
return {
|
||||
(frame_thickness() * 2) + (m_inset * 2) + (m_terminal.columns() * font.glyph_width('x')) + m_scrollbar->width(),
|
||||
|
@ -1260,7 +1260,7 @@ constexpr Gfx::Color TerminalWidget::terminal_color_to_rgb(VT::Color color) cons
|
|||
}
|
||||
};
|
||||
|
||||
void TerminalWidget::set_font_and_resize_to_fit(const Gfx::Font& font)
|
||||
void TerminalWidget::set_font_and_resize_to_fit(Gfx::Font const& font)
|
||||
{
|
||||
set_font(font);
|
||||
resize(widget_size_for_font(font));
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
String selected_text() const;
|
||||
VT::Range normalized_selection() const { return m_selection.normalized(); }
|
||||
void set_selection(const VT::Range& selection);
|
||||
VT::Position buffer_position_at(const Gfx::IntPoint&) const;
|
||||
VT::Position buffer_position_at(Gfx::IntPoint const&) const;
|
||||
|
||||
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);
|
||||
|
@ -85,14 +85,14 @@ public:
|
|||
const StringView color_scheme_name() const { return m_color_scheme_name; }
|
||||
|
||||
Function<void(StringView)> on_title_change;
|
||||
Function<void(const Gfx::IntSize&)> on_terminal_size_change;
|
||||
Function<void(Gfx::IntSize const&)> on_terminal_size_change;
|
||||
Function<void()> on_command_exit;
|
||||
|
||||
GUI::Menu& context_menu() { return *m_context_menu; }
|
||||
|
||||
constexpr Gfx::Color terminal_color_to_rgb(VT::Color) const;
|
||||
|
||||
void set_font_and_resize_to_fit(const Gfx::Font&);
|
||||
void set_font_and_resize_to_fit(Gfx::Font const&);
|
||||
|
||||
void set_color_scheme(StringView);
|
||||
|
||||
|
@ -123,11 +123,11 @@ private:
|
|||
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;
|
||||
virtual void emit(const u8*, size_t) override;
|
||||
virtual void emit(u8 const*, size_t) override;
|
||||
virtual void set_cursor_style(CursorStyle) override;
|
||||
|
||||
// ^GUI::Clipboard::ClipboardClient
|
||||
virtual void clipboard_content_did_change(const String&) override { update_paste_action(); }
|
||||
virtual void clipboard_content_did_change(String const&) override { update_paste_action(); }
|
||||
|
||||
void set_logical_focus(bool);
|
||||
|
||||
|
@ -136,12 +136,12 @@ private:
|
|||
Gfx::IntRect glyph_rect(u16 row, u16 column);
|
||||
Gfx::IntRect row_rect(u16 row);
|
||||
|
||||
Gfx::IntSize widget_size_for_font(const Gfx::Font&) const;
|
||||
Gfx::IntSize widget_size_for_font(Gfx::Font const&) const;
|
||||
|
||||
void update_cursor();
|
||||
void invalidate_cursor();
|
||||
|
||||
void relayout(const Gfx::IntSize&);
|
||||
void relayout(Gfx::IntSize const&);
|
||||
|
||||
void update_copy_action();
|
||||
void update_paste_action();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue