1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:37:44 +00:00

Userland: Rename WindowServerConnection=>ConnectionToWindowServer

This was done with CLion's automatic rename feature.
This commit is contained in:
Itamar 2022-02-25 12:39:33 +02:00 committed by Andreas Kling
parent af132fdbd1
commit 935d023967
43 changed files with 201 additions and 201 deletions

View file

@ -16,13 +16,13 @@
#include <LibGUI/Button.h>
#include <LibGUI/Clipboard.h>
#include <LibGUI/ComboBox.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Desktop.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/FileSystemModel.h>
#include <LibGUI/IconView.h>
#include <LibGUI/ItemListModel.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/Palette.h>
#include <LibGfx/SystemTheme.h>

View file

@ -7,11 +7,11 @@
#include "DesktopSettingsWidget.h"
#include <Applications/DisplaySettings/DesktopSettingsGML.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Desktop.h>
#include <LibGUI/Label.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/SpinBox.h>
#include <LibGUI/WindowServerConnection.h>
namespace DisplaySettings {
@ -42,7 +42,7 @@ void DesktopSettingsWidget::apply_settings()
auto workspace_columns = (unsigned)m_workspace_columns_spinbox->value();
auto& desktop = GUI::Desktop::the();
if (workspace_rows != desktop.workspace_rows() || workspace_columns != desktop.workspace_columns()) {
if (!GUI::WindowServerConnection::the().apply_workspace_settings(workspace_rows, workspace_columns, true)) {
if (!GUI::ConnectionToWindowServer::the().apply_workspace_settings(workspace_rows, workspace_columns, true)) {
GUI::MessageBox::show(window(), String::formatted("Error applying workspace settings"),
"Workspace settings", GUI::MessageBox::Type::Error);
}

View file

@ -9,8 +9,8 @@
#include "FontSettingsWidget.h"
#include <Applications/DisplaySettings/FontSettingsGML.h>
#include <LibGUI/Button.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/FontPicker.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/FontDatabase.h>
namespace DisplaySettings {
@ -54,7 +54,7 @@ static void update_label_with_font(GUI::Label& label, Gfx::Font const& font)
void FontSettingsWidget::apply_settings()
{
GUI::WindowServerConnection::the().set_system_fonts(m_default_font_label->font().qualified_name(), m_fixed_width_font_label->font().qualified_name());
GUI::ConnectionToWindowServer::the().set_system_fonts(m_default_font_label->font().qualified_name(), m_fixed_width_font_label->font().qualified_name());
}
}

View file

@ -10,11 +10,11 @@
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/ComboBox.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/ItemListModel.h>
#include <LibGUI/Label.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/RadioButton.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/SystemTheme.h>
namespace DisplaySettings {
@ -140,7 +140,7 @@ static String display_name_from_edid(EDID::Parser const& edid)
void MonitorSettingsWidget::load_current_settings()
{
m_screen_layout = GUI::WindowServerConnection::the().get_screen_layout();
m_screen_layout = GUI::ConnectionToWindowServer::the().get_screen_layout();
m_screens.clear();
m_screen_edids.clear();
@ -214,9 +214,9 @@ void MonitorSettingsWidget::apply_settings()
{
// Fetch the latest configuration again, in case it has been changed by someone else.
// This isn't technically race free, but if the user automates changing settings we can't help...
auto current_layout = GUI::WindowServerConnection::the().get_screen_layout();
auto current_layout = GUI::ConnectionToWindowServer::the().get_screen_layout();
if (m_screen_layout != current_layout) {
auto result = GUI::WindowServerConnection::the().set_screen_layout(m_screen_layout, false);
auto result = GUI::ConnectionToWindowServer::the().set_screen_layout(m_screen_layout, false);
if (result.success()) {
load_current_settings(); // Refresh
@ -243,13 +243,13 @@ void MonitorSettingsWidget::apply_settings()
// If the user selects "No", closes the window or the window gets closed by the 10 seconds timer, revert the changes.
if (box->exec() == GUI::MessageBox::ExecYes) {
auto save_result = GUI::WindowServerConnection::the().save_screen_layout();
auto save_result = GUI::ConnectionToWindowServer::the().save_screen_layout();
if (!save_result.success()) {
GUI::MessageBox::show(window(), String::formatted("Error saving settings: {}", save_result.error_msg()),
"Unable to save setting", GUI::MessageBox::Type::Error);
}
} else {
auto restore_result = GUI::WindowServerConnection::the().set_screen_layout(current_layout, false);
auto restore_result = GUI::ConnectionToWindowServer::the().set_screen_layout(current_layout, false);
if (!restore_result.success()) {
GUI::MessageBox::show(window(), String::formatted("Error restoring settings: {}", restore_result.error_msg()),
"Unable to restore setting", GUI::MessageBox::Type::Error);
@ -269,7 +269,7 @@ void MonitorSettingsWidget::show_screen_numbers(bool show)
if (m_showing_screen_numbers == show)
return;
m_showing_screen_numbers = show;
GUI::WindowServerConnection::the().async_show_screen_numbers(show);
GUI::ConnectionToWindowServer::the().async_show_screen_numbers(show);
}
void MonitorSettingsWidget::show_event(GUI::ShowEvent&)

View file

@ -6,10 +6,10 @@
*/
#include "MagnifierWidget.h"
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/DisplayLink.h>
#include <LibGUI/Painter.h>
#include <LibGUI/Window.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/Rect.h>
MagnifierWidget::MagnifierWidget()
@ -53,7 +53,7 @@ void MagnifierWidget::sync()
auto size = frame_inner_rect().size();
Gfx::IntSize grab_size { size.width() / m_scale_factor, size.height() / m_scale_factor };
m_grabbed_bitmap = GUI::WindowServerConnection::the().get_screen_bitmap_around_cursor(grab_size).bitmap();
m_grabbed_bitmap = GUI::ConnectionToWindowServer::the().get_screen_bitmap_around_cursor(grab_size).bitmap();
m_grabbed_bitmaps.enqueue(m_grabbed_bitmap);
update();
}

View file

@ -7,10 +7,10 @@
#include "MouseWidget.h"
#include <Applications/MouseSettings/MouseWidgetGML.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Label.h>
#include <LibGUI/Slider.h>
#include <LibGUI/SpinBox.h>
#include <LibGUI/WindowServerConnection.h>
#include <WindowServer/Screen.h>
#include <WindowServer/WindowManager.h>
@ -28,12 +28,12 @@ MouseWidget::MouseWidget()
m_speed_slider->on_change = [&](int value) {
m_speed_label->set_text(String::formatted("{} %", value));
};
int const slider_value = float { speed_slider_scale } * GUI::WindowServerConnection::the().get_mouse_acceleration();
int const slider_value = float { speed_slider_scale } * GUI::ConnectionToWindowServer::the().get_mouse_acceleration();
m_speed_slider->set_value(slider_value);
m_scroll_length_spinbox = *find_descendant_of_type_named<GUI::SpinBox>("scroll_length_spinbox");
m_scroll_length_spinbox->set_min(WindowServer::scroll_step_size_min);
m_scroll_length_spinbox->set_value(GUI::WindowServerConnection::the().get_scroll_step_size());
m_scroll_length_spinbox->set_value(GUI::ConnectionToWindowServer::the().get_scroll_step_size());
m_double_click_arrow_widget = *find_descendant_of_type_named<MouseSettings::DoubleClickArrowWidget>("double_click_arrow_widget");
m_double_click_speed_label = *find_descendant_of_type_named<GUI::Label>("double_click_speed_label");
@ -44,18 +44,18 @@ MouseWidget::MouseWidget()
m_double_click_arrow_widget->set_double_click_speed(speed);
m_double_click_speed_label->set_text(String::formatted("{} ms", speed));
};
m_double_click_speed_slider->set_value(GUI::WindowServerConnection::the().get_double_click_speed());
m_double_click_speed_slider->set_value(GUI::ConnectionToWindowServer::the().get_double_click_speed());
m_switch_buttons_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("switch_buttons_input");
m_switch_buttons_checkbox->set_checked(GUI::WindowServerConnection::the().get_buttons_switched());
m_switch_buttons_checkbox->set_checked(GUI::ConnectionToWindowServer::the().get_buttons_switched());
}
void MouseWidget::apply_settings()
{
float const factor = m_speed_slider->value() / speed_slider_scale;
GUI::WindowServerConnection::the().async_set_mouse_acceleration(factor);
GUI::WindowServerConnection::the().async_set_scroll_step_size(m_scroll_length_spinbox->value());
GUI::WindowServerConnection::the().async_set_double_click_speed(m_double_click_speed_slider->value());
GUI::WindowServerConnection::the().async_set_buttons_switched(m_switch_buttons_checkbox->is_checked());
GUI::ConnectionToWindowServer::the().async_set_mouse_acceleration(factor);
GUI::ConnectionToWindowServer::the().async_set_scroll_step_size(m_scroll_length_spinbox->value());
GUI::ConnectionToWindowServer::the().async_set_double_click_speed(m_double_click_speed_slider->value());
GUI::ConnectionToWindowServer::the().async_set_buttons_switched(m_switch_buttons_checkbox->is_checked());
}
void MouseWidget::reset_default_values()

View file

@ -11,9 +11,9 @@
#include <LibCore/DirIterator.h>
#include <LibGUI/Button.h>
#include <LibGUI/ComboBox.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/SortingProxyModel.h>
#include <LibGUI/TableView.h>
#include <LibGUI/WindowServerConnection.h>
String MouseCursorModel::column_name(int column_index) const
{
@ -115,7 +115,7 @@ ThemeWidget::ThemeWidget()
m_cursors_tableview->set_column_width(0, 25);
m_cursors_tableview->model()->invalidate();
m_theme_name = GUI::WindowServerConnection::the().get_cursor_theme();
m_theme_name = GUI::ConnectionToWindowServer::the().get_cursor_theme();
mouse_cursor_model->change_theme(m_theme_name);
m_theme_name_box = find_descendant_of_type_named<GUI::ComboBox>("theme_name_box");
@ -130,7 +130,7 @@ ThemeWidget::ThemeWidget()
void ThemeWidget::apply_settings()
{
GUI::WindowServerConnection::the().async_apply_cursor_theme(m_theme_name_box->text());
GUI::ConnectionToWindowServer::the().async_apply_cursor_theme(m_theme_name_box->text());
}
void ThemeWidget::reset_default_values()

View file

@ -6,8 +6,8 @@
#include "TreeMapWidget.h"
#include <AK/NumberFormat.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Painter.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibGfx/Font.h>
#include <WindowServer/WindowManager.h>
@ -309,7 +309,7 @@ void TreeMapWidget::mousewheel_event(GUI::MouseEvent& event)
{
int delta = event.wheel_delta_y();
// FIXME: The wheel_delta_y is premultiplied in the window server, we actually want a raw value here.
int step_size = GUI::WindowServerConnection::the().get_scroll_step_size();
int step_size = GUI::ConnectionToWindowServer::the().get_scroll_step_size();
if (delta > 0) {
size_t step_back = delta / step_size;
if (step_back > m_viewpoint)

View file

@ -7,8 +7,8 @@
#include "TerminalSettingsWidget.h"
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/SettingsWindow.h>
#include <LibGUI/WindowServerConnection.h>
#include <LibMain/Main.h>
// Including this after to avoid LibIPC errors