summaryrefslogtreecommitdiff
path: root/Libraries/LibVT
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
commit11580babbfb1b8ae0acab2400f11d905c35642f5 (patch)
tree3b26fcd4bf7afe9ff92203468ba7cd95e192d55f /Libraries/LibVT
parent939a605334a71dd8b7af91cdcbe9047281f7b5b9 (diff)
downloadserenity-11580babbfb1b8ae0acab2400f11d905c35642f5.zip
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r--Libraries/LibVT/TerminalWidget.cpp18
-rw-r--r--Libraries/LibVT/TerminalWidget.h8
2 files changed, 13 insertions, 13 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp
index 364ff8af35..b6149f21dc 100644
--- a/Libraries/LibVT/TerminalWidget.cpp
+++ b/Libraries/LibVT/TerminalWidget.cpp
@@ -90,8 +90,8 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co
m_cursor_blink_timer = Core::Timer::construct();
m_visual_beep_timer = Core::Timer::construct();
- set_frame_shape(FrameShape::Container);
- set_frame_shadow(FrameShadow::Sunken);
+ set_frame_shape(Gfx::FrameShape::Container);
+ set_frame_shadow(Gfx::FrameShadow::Sunken);
set_frame_thickness(2);
m_scrollbar = GUI::ScrollBar::construct(Orientation::Vertical, this);
@@ -111,19 +111,19 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co
auto font_entry = m_config->read_entry("Text", "Font", "default");
if (font_entry == "default")
- set_font(Font::default_fixed_width_font());
+ set_font(Gfx::Font::default_fixed_width_font());
else
- set_font(Font::load_from_file(font_entry));
+ set_font(Gfx::Font::load_from_file(font_entry));
m_line_height = font().glyph_height() + m_line_spacing;
m_terminal.set_size(m_config->read_num_entry("Window", "Width", 80), m_config->read_num_entry("Window", "Height", 25));
- m_copy_action = GUI::Action::create("Copy", { Mod_Ctrl | Mod_Shift, Key_C }, GraphicsBitmap::load_from_file("/res/icons/16x16/edit-copy.png"), [this](auto&) {
+ m_copy_action = GUI::Action::create("Copy", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"), [this](auto&) {
copy();
});
- m_paste_action = GUI::Action::create("Paste", { Mod_Ctrl | Mod_Shift, Key_V }, GraphicsBitmap::load_from_file("/res/icons/paste16.png"), [this](auto&) {
+ m_paste_action = GUI::Action::create("Paste", { Mod_Ctrl | Mod_Shift, Key_V }, Gfx::Bitmap::load_from_file("/res/icons/paste16.png"), [this](auto&) {
paste();
});
}
@@ -420,7 +420,7 @@ void TerminalWidget::resize_event(GUI::ResizeEvent& event)
relayout(event.size());
}
-void TerminalWidget::relayout(const Size& size)
+void TerminalWidget::relayout(const Gfx::Size& size)
{
if (!m_scrollbar)
return;
@@ -495,7 +495,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 Point& position) const
+VT::Position TerminalWidget::buffer_position_at(const Gfx::Point& position) const
{
auto adjusted_position = position.translated(-(frame_thickness() + m_inset), -(frame_thickness() + m_inset));
int row = adjusted_position.y() / m_line_height;
@@ -723,7 +723,7 @@ void TerminalWidget::did_change_font()
m_line_height = font().glyph_height() + m_line_spacing;
// TODO: try to find a bold version of the new font (e.g. CsillaThin7x10 -> CsillaBold7x10)
- const Font& bold_font = Font::default_bold_fixed_width_font();
+ const Gfx::Font& bold_font = Gfx::Font::default_bold_fixed_width_font();
if (bold_font.glyph_height() == font().glyph_height() && bold_font.glyph_width(' ') == font().glyph_width(' '))
m_bold_font = &bold_font;
diff --git a/Libraries/LibVT/TerminalWidget.h b/Libraries/LibVT/TerminalWidget.h
index 1dcd24b8bf..ac7c543a40 100644
--- a/Libraries/LibVT/TerminalWidget.h
+++ b/Libraries/LibVT/TerminalWidget.h
@@ -60,7 +60,7 @@ public:
void apply_size_increments_to_window(GUI::Window&);
- const Font& bold_font() const { return *m_bold_font; }
+ const Gfx::Font& bold_font() const { return *m_bold_font; }
void set_opacity(u8);
float opacity() { return m_opacity; };
@@ -72,7 +72,7 @@ public:
bool has_selection() const;
bool selection_contains(const VT::Position&) const;
String selected_text() const;
- VT::Position buffer_position_at(const Point&) const;
+ VT::Position buffer_position_at(const Gfx::Point&) const;
VT::Position normalized_selection_start() const;
VT::Position normalized_selection_end() const;
@@ -120,7 +120,7 @@ private:
void update_cursor();
void invalidate_cursor();
- void relayout(const Size&);
+ void relayout(const Gfx::Size&);
Size compute_base_size() const;
int first_selection_column_on_row(int row) const;
@@ -152,7 +152,7 @@ private:
bool m_cursor_blink_state { true };
bool m_automatic_size_policy { false };
- RefPtr<Font> m_bold_font;
+ RefPtr<Gfx::Font> m_bold_font;
int m_glyph_width { 0 };