diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index bfc415525a..8e4f822597 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -177,7 +177,7 @@ static pid_t run_command(int ptm_fd, String command) return pid; } -static RefPtr create_settings_window(TerminalWidget& terminal) +static RefPtr create_settings_window(VT::TerminalWidget& terminal) { auto window = GUI::Window::construct(); window->set_window_type(GUI::WindowType::ToolWindow); @@ -194,25 +194,25 @@ static RefPtr create_settings_window(TerminalWidget& terminal) auto& no_bell_radio = *settings.find_descendant_of_type_named("no_bell_radio"); switch (terminal.bell_mode()) { - case TerminalWidget::BellMode::Visible: + case VT::TerminalWidget::BellMode::Visible: visual_bell_radio.set_checked(true); break; - case TerminalWidget::BellMode::AudibleBeep: + case VT::TerminalWidget::BellMode::AudibleBeep: beep_bell_radio.set_checked(true); break; - case TerminalWidget::BellMode::Disabled: + case VT::TerminalWidget::BellMode::Disabled: no_bell_radio.set_checked(true); break; } beep_bell_radio.on_checked = [&terminal](bool) { - terminal.set_bell_mode(TerminalWidget::BellMode::AudibleBeep); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::AudibleBeep); }; visual_bell_radio.on_checked = [&terminal](bool) { - terminal.set_bell_mode(TerminalWidget::BellMode::Visible); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::Visible); }; no_bell_radio.on_checked = [&terminal](bool) { - terminal.set_bell_mode(TerminalWidget::BellMode::Disabled); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::Disabled); }; auto& slider = *settings.find_descendant_of_type_named("background_opacity_slider"); @@ -230,7 +230,7 @@ static RefPtr create_settings_window(TerminalWidget& terminal) return window; } -static RefPtr create_find_window(TerminalWidget& terminal) +static RefPtr create_find_window(VT::TerminalWidget& terminal) { auto window = GUI::Window::construct(); window->set_window_type(GUI::WindowType::ToolWindow); @@ -365,7 +365,7 @@ int main(int argc, char** argv) window->set_background_color(Color::Black); window->set_double_buffering_enabled(false); - auto& terminal = window->set_main_widget(ptm_fd, true, config); + auto& terminal = window->set_main_widget(ptm_fd, true, config); terminal.on_command_exit = [&] { app->quit(0); }; @@ -381,11 +381,11 @@ int main(int argc, char** argv) auto bell = config->read_entry("Window", "Bell", "Visible"); if (bell == "AudibleBeep") { - terminal.set_bell_mode(TerminalWidget::BellMode::AudibleBeep); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::AudibleBeep); } else if (bell == "Disabled") { - terminal.set_bell_mode(TerminalWidget::BellMode::Disabled); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::Disabled); } else { - terminal.set_bell_mode(TerminalWidget::BellMode::Visible); + terminal.set_bell_mode(VT::TerminalWidget::BellMode::Visible); } RefPtr settings_window; diff --git a/Userland/DevTools/HackStudio/TerminalWrapper.cpp b/Userland/DevTools/HackStudio/TerminalWrapper.cpp index 0488352970..540070e302 100644 --- a/Userland/DevTools/HackStudio/TerminalWrapper.cpp +++ b/Userland/DevTools/HackStudio/TerminalWrapper.cpp @@ -178,7 +178,7 @@ TerminalWrapper::TerminalWrapper(bool user_spawned) set_layout(); RefPtr config = Core::ConfigFile::get_for_app("Terminal"); - m_terminal_widget = add(-1, false, config); + m_terminal_widget = add(-1, false, config); if (user_spawned) run_command("Shell"); diff --git a/Userland/DevTools/HackStudio/TerminalWrapper.h b/Userland/DevTools/HackStudio/TerminalWrapper.h index 9b5a8ed0a3..badc8d1bd1 100644 --- a/Userland/DevTools/HackStudio/TerminalWrapper.h +++ b/Userland/DevTools/HackStudio/TerminalWrapper.h @@ -27,8 +27,7 @@ #pragma once #include - -class TerminalWidget; +#include namespace HackStudio { @@ -41,14 +40,14 @@ public: void kill_running_command(); bool user_spawned() const { return m_user_spawned; } - TerminalWidget& terminal() { return *m_terminal_widget; } + VT::TerminalWidget& terminal() { return *m_terminal_widget; } Function on_command_exit; private: explicit TerminalWrapper(bool user_spawned = true); - RefPtr m_terminal_widget; + RefPtr m_terminal_widget; pid_t m_pid { -1 }; bool m_user_spawned { true }; }; diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index 1509511e5e..b9e09e716b 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -58,6 +58,8 @@ #include #include +namespace VT { + void TerminalWidget::set_pty_master_fd(int fd) { m_ptm_fd = fd; @@ -1130,3 +1132,5 @@ void TerminalWidget::set_font_and_resize_to_fit(const Gfx::Font& font) set_font(font); resize(widget_size_for_font(font)); } + +} diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h index 0972a65631..abbb59252f 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.h +++ b/Userland/Libraries/LibVT/TerminalWidget.h @@ -37,6 +37,8 @@ #include #include +namespace VT { + class TerminalWidget final : public GUI::Frame , public VT::TerminalClient { @@ -221,3 +223,5 @@ private: Gfx::IntPoint m_left_mousedown_position; }; + +}