summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 13:08:32 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 13:08:32 +0100
commit9b87843af169b08f1b852da96f696004866783fe (patch)
treec5a7267ff44cc6a45ec39784e8ce34ea9774a96b
parent20cfd2a6bff8c469970651dd73ffee60ab0e5176 (diff)
downloadserenity-9b87843af169b08f1b852da96f696004866783fe.zip
LibGfx: Unpublish Gfx::Point from global namespace
-rw-r--r--Applications/PaintBrush/BucketTool.cpp2
-rw-r--r--Applications/PaintBrush/LineTool.cpp2
-rw-r--r--Applications/PaintBrush/PenTool.cpp2
-rw-r--r--Applications/Piano/WaveWidget.cpp4
-rw-r--r--Applications/QuickShow/QSWidget.cpp2
-rw-r--r--Applications/SoundPlayer/SampleWidget.cpp4
-rw-r--r--Applications/SystemMonitor/GraphWidget.cpp4
-rw-r--r--DevTools/HackStudio/CursorTool.h2
-rw-r--r--DevTools/VisualBuilder/VBForm.cpp2
-rw-r--r--Games/Minesweeper/Field.cpp8
-rw-r--r--Libraries/LibGUI/GAbstractTableView.cpp2
-rw-r--r--Libraries/LibGUI/GAbstractTableView.h2
-rw-r--r--Libraries/LibGUI/GApplication.cpp2
-rw-r--r--Libraries/LibGUI/GButton.cpp2
-rw-r--r--Libraries/LibGUI/GEvent.h2
-rw-r--r--Libraries/LibGUI/GListView.cpp2
-rw-r--r--Libraries/LibGUI/GListView.h2
-rw-r--r--Libraries/LibGUI/GScrollableWidget.cpp4
-rw-r--r--Libraries/LibGUI/GScrollableWidget.h4
-rw-r--r--Libraries/LibGUI/GTreeView.cpp8
-rw-r--r--Libraries/LibGUI/GVariant.h2
-rw-r--r--Libraries/LibGUI/GWidget.h4
-rw-r--r--Libraries/LibGUI/GWindow.cpp4
-rw-r--r--Libraries/LibGUI/GWindow.h2
-rw-r--r--Libraries/LibGfx/Point.h2
-rw-r--r--Servers/WindowServer/WSCompositor.cpp2
-rw-r--r--Servers/WindowServer/WSCursor.h2
-rw-r--r--Servers/WindowServer/WSEvent.h2
-rw-r--r--Servers/WindowServer/WSMenu.cpp12
-rw-r--r--Servers/WindowServer/WSMenuManager.cpp2
-rw-r--r--Servers/WindowServer/WSScreen.h2
-rw-r--r--Servers/WindowServer/WSWindow.h2
-rw-r--r--Servers/WindowServer/WSWindowManager.cpp2
-rw-r--r--Servers/WindowServer/WSWindowManager.h2
34 files changed, 51 insertions, 53 deletions
diff --git a/Applications/PaintBrush/BucketTool.cpp b/Applications/PaintBrush/BucketTool.cpp
index 38ca1ad79c..a227255979 100644
--- a/Applications/PaintBrush/BucketTool.cpp
+++ b/Applications/PaintBrush/BucketTool.cpp
@@ -47,7 +47,7 @@ static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::Point& start_position, Co
if (target_color == fill_color)
return;
- Queue<Point> queue;
+ Queue<Gfx::Point> queue;
queue.enqueue(start_position);
while (!queue.is_empty()) {
auto position = queue.dequeue();
diff --git a/Applications/PaintBrush/LineTool.cpp b/Applications/PaintBrush/LineTool.cpp
index 9f1bfef49b..f32af8fec0 100644
--- a/Applications/PaintBrush/LineTool.cpp
+++ b/Applications/PaintBrush/LineTool.cpp
@@ -31,7 +31,7 @@
#include <LibGUI/GPainter.h>
#include <LibM/math.h>
-Point constrain_line_angle(const Gfx::Point& start_pos, const Gfx::Point& end_pos, float angle_increment)
+static Gfx::Point constrain_line_angle(const Gfx::Point& start_pos, const Gfx::Point& end_pos, float angle_increment)
{
float current_angle = atan2(end_pos.y() - start_pos.y(), end_pos.x() - start_pos.x()) + M_PI * 2.;
diff --git a/Applications/PaintBrush/PenTool.cpp b/Applications/PaintBrush/PenTool.cpp
index 9dcb7114c4..1ba2a01bb1 100644
--- a/Applications/PaintBrush/PenTool.cpp
+++ b/Applications/PaintBrush/PenTool.cpp
@@ -63,7 +63,7 @@ void PenTool::on_mousemove(GUI::MouseEvent& event)
if (event.buttons() & GUI::MouseButton::Left || event.buttons() & GUI::MouseButton::Right) {
GUI::Painter painter(m_widget->bitmap());
- if (m_last_drawing_event_position != Point(-1, -1))
+ if (m_last_drawing_event_position != Gfx::Point(-1, -1))
painter.draw_line(m_last_drawing_event_position, event.position(), m_widget->color_for(event), m_thickness);
else
painter.draw_line(event.position(), event.position(), m_widget->color_for(event), m_thickness);
diff --git a/Applications/Piano/WaveWidget.cpp b/Applications/Piano/WaveWidget.cpp
index 817c80b029..894e8e8187 100644
--- a/Applications/Piano/WaveWidget.cpp
+++ b/Applications/Piano/WaveWidget.cpp
@@ -102,8 +102,8 @@ void WaveWidget::paint_event(GUI::PaintEvent& event)
for (size_t x = 1; x < buffer.size(); ++x) {
int y = sample_to_y(buffer[x].left);
- Point point1(prev_x * width_scale, prev_y);
- Point point2(x * width_scale, y);
+ Gfx::Point point1(prev_x * width_scale, prev_y);
+ Gfx::Point point2(x * width_scale, y);
painter.draw_line(point1, point2, wave_color);
prev_x = x;
diff --git a/Applications/QuickShow/QSWidget.cpp b/Applications/QuickShow/QSWidget.cpp
index b677063f08..a4161c07d7 100644
--- a/Applications/QuickShow/QSWidget.cpp
+++ b/Applications/QuickShow/QSWidget.cpp
@@ -113,7 +113,7 @@ void QSWidget::mousewheel_event(GUI::MouseEvent& event)
relayout();
auto new_scale_factor = (float)m_scale / 100.0f;
auto scale_factor_change = new_scale_factor - old_scale_factor;
- m_bitmap_rect.move_by(-Point((float)zoom_point.x() * scale_factor_change, (float)zoom_point.y() * scale_factor_change));
+ m_bitmap_rect.move_by(-Gfx::Point((float)zoom_point.x() * scale_factor_change, (float)zoom_point.y() * scale_factor_change));
if (old_scale != m_scale) {
if (on_scale_change)
on_scale_change(m_scale);
diff --git a/Applications/SoundPlayer/SampleWidget.cpp b/Applications/SoundPlayer/SampleWidget.cpp
index 7b405ce41d..d02369e477 100644
--- a/Applications/SoundPlayer/SampleWidget.cpp
+++ b/Applications/SoundPlayer/SampleWidget.cpp
@@ -64,8 +64,8 @@ void SampleWidget::paint_event(GUI::PaintEvent& event)
++count;
if (count >= samples_per_pixel) {
- Point min_point = { x, y_offset + static_cast<int>(-sample_max * frame_inner_rect().height() / 2) };
- Point max_point = { x++, y_offset + static_cast<int>(sample_max * frame_inner_rect().height() / 2) };
+ Gfx::Point min_point = { x, y_offset + static_cast<int>(-sample_max * frame_inner_rect().height() / 2) };
+ Gfx::Point max_point = { x++, y_offset + static_cast<int>(sample_max * frame_inner_rect().height() / 2) };
painter.draw_line(min_point, max_point, Color::Green);
count = 0;
diff --git a/Applications/SystemMonitor/GraphWidget.cpp b/Applications/SystemMonitor/GraphWidget.cpp
index 047911d7ba..2bfb042bd5 100644
--- a/Applications/SystemMonitor/GraphWidget.cpp
+++ b/Applications/SystemMonitor/GraphWidget.cpp
@@ -56,13 +56,13 @@ void GraphWidget::paint_event(GUI::PaintEvent& event)
auto inner_rect = frame_inner_rect();
float scale = (float)inner_rect.height() / (float)m_max;
- Point prev_point;
+ Gfx::Point prev_point;
for (int i = 0; i < m_values.size(); ++i) {
int x = inner_rect.right() - (i * 2) + 1;
if (x < 0)
break;
float scaled_value = (float)m_values.at(m_values.size() - i - 1) * scale;
- Point point = { x, inner_rect.bottom() - (int)scaled_value };
+ Gfx::Point point = { x, inner_rect.bottom() - (int)scaled_value };
if (i != 0)
painter.draw_line(prev_point, point, m_graph_color);
prev_point = point;
diff --git a/DevTools/HackStudio/CursorTool.h b/DevTools/HackStudio/CursorTool.h
index 7fc8368c3d..2980075a39 100644
--- a/DevTools/HackStudio/CursorTool.h
+++ b/DevTools/HackStudio/CursorTool.h
@@ -54,7 +54,7 @@ private:
Gfx::Rect rubber_band_rect() const;
Gfx::Point m_drag_origin;
- HashMap<GUI::Widget*, Point> m_positions_before_drag;
+ HashMap<GUI::Widget*, Gfx::Point> m_positions_before_drag;
bool m_dragging { false };
bool m_rubber_banding { false };
diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp
index 51e1ea9202..56f52f008f 100644
--- a/DevTools/VisualBuilder/VBForm.cpp
+++ b/DevTools/VisualBuilder/VBForm.cpp
@@ -90,7 +90,7 @@ void VBForm::insert_widget(VBWidgetType type)
{
auto* insertion_parent = single_selected_widget();
auto widget = VBWidget::create(type, *this, insertion_parent);
- Point insertion_position = m_next_insertion_position;
+ Gfx::Point insertion_position = m_next_insertion_position;
if (insertion_parent)
insertion_position.move_by(insertion_parent->gwidget()->window_relative_rect().location());
widget->set_rect({ insertion_position, { m_grid_size * 10 + 1, m_grid_size * 5 + 1 } });
diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp
index 5ccd5f0bcf..ddda972f3f 100644
--- a/Games/Minesweeper/Field.cpp
+++ b/Games/Minesweeper/Field.cpp
@@ -325,13 +325,13 @@ void Field::paint_event(GUI::PaintEvent& event)
painter.add_clip_rect(inner_rect);
for (int y = inner_rect.top() - 1; y <= inner_rect.bottom(); y += square_size()) {
- Point a { inner_rect.left(), y };
- Point b { inner_rect.right(), y };
+ Gfx::Point a { inner_rect.left(), y };
+ Gfx::Point b { inner_rect.right(), y };
painter.draw_line(a, b, Color::MidGray);
}
for (int x = frame_inner_rect().left() - 1; x <= frame_inner_rect().right(); x += square_size()) {
- Point a { x, inner_rect.top() };
- Point b { x, inner_rect.bottom() };
+ Gfx::Point a { x, inner_rect.top() };
+ Gfx::Point b { x, inner_rect.bottom() };
painter.draw_line(a, b, Color::MidGray);
}
}
diff --git a/Libraries/LibGUI/GAbstractTableView.cpp b/Libraries/LibGUI/GAbstractTableView.cpp
index 265ef25ab4..18cb8ef688 100644
--- a/Libraries/LibGUI/GAbstractTableView.cpp
+++ b/Libraries/LibGUI/GAbstractTableView.cpp
@@ -545,7 +545,7 @@ Gfx::Rect AbstractTableView::row_rect(int item_index) const
return { 0, header_height() + (item_index * item_height()), max(content_size().width(), width()), item_height() };
}
-Point AbstractTableView::adjusted_position(const Gfx::Point& position) const
+Gfx::Point AbstractTableView::adjusted_position(const Gfx::Point& position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}
diff --git a/Libraries/LibGUI/GAbstractTableView.h b/Libraries/LibGUI/GAbstractTableView.h
index c3b221c1df..77ce48a70d 100644
--- a/Libraries/LibGUI/GAbstractTableView.h
+++ b/Libraries/LibGUI/GAbstractTableView.h
@@ -62,7 +62,7 @@ public:
int horizontal_padding() const { return m_horizontal_padding; }
- Point adjusted_position(const Gfx::Point&) const;
+ Gfx::Point adjusted_position(const Gfx::Point&) const;
virtual Gfx::Rect content_rect(const ModelIndex&) const override;
Gfx::Rect content_rect(int row, int column) const;
diff --git a/Libraries/LibGUI/GApplication.cpp b/Libraries/LibGUI/GApplication.cpp
index 9c92010167..21c13e00c1 100644
--- a/Libraries/LibGUI/GApplication.cpp
+++ b/Libraries/LibGUI/GApplication.cpp
@@ -140,7 +140,7 @@ void Application::show_tooltip(const StringView& tooltip, const Gfx::Point& scre
Gfx::Rect desktop_rect = Desktop::the().rect();
const int margin = 30;
- Point adjusted_pos = screen_location;
+ Gfx::Point adjusted_pos = screen_location;
if (adjusted_pos.x() + m_tooltip_window->width() >= desktop_rect.width() - margin) {
adjusted_pos = adjusted_pos.translated(-m_tooltip_window->width(), 0);
}
diff --git a/Libraries/LibGUI/GButton.cpp b/Libraries/LibGUI/GButton.cpp
index 22d310e04d..0947b56a41 100644
--- a/Libraries/LibGUI/GButton.cpp
+++ b/Libraries/LibGUI/GButton.cpp
@@ -61,7 +61,7 @@ void Button::paint_event(PaintEvent& event)
return;
auto content_rect = rect().shrunken(8, 2);
- auto icon_location = m_icon ? content_rect.center().translated(-(m_icon->width() / 2), -(m_icon->height() / 2)) : Point();
+ auto icon_location = m_icon ? content_rect.center().translated(-(m_icon->width() / 2), -(m_icon->height() / 2)) : Gfx::Point();
if (m_icon && !text().is_empty())
icon_location.set_x(content_rect.x());
if (is_being_pressed() || is_checked())
diff --git a/Libraries/LibGUI/GEvent.h b/Libraries/LibGUI/GEvent.h
index bfff565bd4..a0b3650ef2 100644
--- a/Libraries/LibGUI/GEvent.h
+++ b/Libraries/LibGUI/GEvent.h
@@ -290,7 +290,7 @@ public:
{
}
- Point position() const { return m_position; }
+ Gfx::Point position() const { return m_position; }
int x() const { return m_position.x(); }
int y() const { return m_position.y(); }
MouseButton button() const { return m_button; }
diff --git a/Libraries/LibGUI/GListView.cpp b/Libraries/LibGUI/GListView.cpp
index 4d11539403..c0b3f6b5d5 100644
--- a/Libraries/LibGUI/GListView.cpp
+++ b/Libraries/LibGUI/GListView.cpp
@@ -99,7 +99,7 @@ ModelIndex ListView::index_at_event_position(const Gfx::Point& point) const
return {};
}
-Point ListView::adjusted_position(const Gfx::Point& position) const
+Gfx::Point ListView::adjusted_position(const Gfx::Point& position) const
{
return position.translated(horizontal_scrollbar().value() - frame_thickness(), vertical_scrollbar().value() - frame_thickness());
}
diff --git a/Libraries/LibGUI/GListView.h b/Libraries/LibGUI/GListView.h
index e12131d206..79c10f81c6 100644
--- a/Libraries/LibGUI/GListView.h
+++ b/Libraries/LibGUI/GListView.h
@@ -51,7 +51,7 @@ public:
void scroll_into_view(const ModelIndex&, Orientation);
- Point adjusted_position(const Gfx::Point&) const;
+ Gfx::Point adjusted_position(const Gfx::Point&) const;
virtual ModelIndex index_at_event_position(const Gfx::Point&) const override;
virtual Gfx::Rect content_rect(const ModelIndex&) const override;
diff --git a/Libraries/LibGUI/GScrollableWidget.cpp b/Libraries/LibGUI/GScrollableWidget.cpp
index f0141bce78..91df270035 100644
--- a/Libraries/LibGUI/GScrollableWidget.cpp
+++ b/Libraries/LibGUI/GScrollableWidget.cpp
@@ -209,7 +209,7 @@ Gfx::Rect ScrollableWidget::widget_inner_rect() const
return rect;
}
-Point ScrollableWidget::to_content_position(const Gfx::Point& widget_position) const
+Gfx::Point ScrollableWidget::to_content_position(const Gfx::Point& widget_position) const
{
auto content_position = widget_position;
content_position.move_by(horizontal_scrollbar().value(), vertical_scrollbar().value());
@@ -217,7 +217,7 @@ Point ScrollableWidget::to_content_position(const Gfx::Point& widget_position) c
return content_position;
}
-Point ScrollableWidget::to_widget_position(const Gfx::Point& content_position) const
+Gfx::Point ScrollableWidget::to_widget_position(const Gfx::Point& content_position) const
{
auto widget_position = content_position;
widget_position.move_by(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
diff --git a/Libraries/LibGUI/GScrollableWidget.h b/Libraries/LibGUI/GScrollableWidget.h
index b26c7deef6..670a4be00f 100644
--- a/Libraries/LibGUI/GScrollableWidget.h
+++ b/Libraries/LibGUI/GScrollableWidget.h
@@ -69,8 +69,8 @@ public:
void set_should_hide_unnecessary_scrollbars(bool b) { m_should_hide_unnecessary_scrollbars = b; }
bool should_hide_unnecessary_scrollbars() const { return m_should_hide_unnecessary_scrollbars; }
- Point to_content_position(const Gfx::Point& widget_position) const;
- Point to_widget_position(const Gfx::Point& content_position) const;
+ Gfx::Point to_content_position(const Gfx::Point& widget_position) const;
+ Gfx::Point to_widget_position(const Gfx::Point& content_position) const;
protected:
explicit ScrollableWidget(Widget* parent);
diff --git a/Libraries/LibGUI/GTreeView.cpp b/Libraries/LibGUI/GTreeView.cpp
index 88caa31c2d..8bdc5e23fc 100644
--- a/Libraries/LibGUI/GTreeView.cpp
+++ b/Libraries/LibGUI/GTreeView.cpp
@@ -281,16 +281,16 @@ void TreeView::paint_event(PaintEvent& event)
for (int i = indent_level; i > 0; --i) {
auto parent_of_index_at_indent = index_at_indent.parent();
bool index_at_indent_is_last_in_parent = index_at_indent.row() == model.row_count(parent_of_index_at_indent) - 1;
- Point a { tree_column_x_offset + horizontal_padding() + indent_width_in_pixels() * i - icon_size() / 2, rect.y() - 2 };
- Point b { a.x(), a.y() + item_height() - 1 };
+ Gfx::Point a { tree_column_x_offset + horizontal_padding() + indent_width_in_pixels() * i - icon_size() / 2, rect.y() - 2 };
+ Gfx::Point b { a.x(), a.y() + item_height() - 1 };
if (index_at_indent_is_last_in_parent)
b.set_y(rect.center().y());
if (!(i != indent_level && index_at_indent_is_last_in_parent))
painter.draw_line(a, b, Color::MidGray);
if (i == indent_level) {
- Point c { a.x(), rect.center().y() };
- Point d { c.x() + icon_size() / 2, c.y() };
+ Gfx::Point c { a.x(), rect.center().y() };
+ Gfx::Point d { c.x() + icon_size() / 2, c.y() };
painter.draw_line(c, d, Color::MidGray);
}
index_at_indent = parent_of_index_at_indent;
diff --git a/Libraries/LibGUI/GVariant.h b/Libraries/LibGUI/GVariant.h
index a0088bbe35..40a17eaaf4 100644
--- a/Libraries/LibGUI/GVariant.h
+++ b/Libraries/LibGUI/GVariant.h
@@ -184,7 +184,7 @@ public:
return m_value.as_float;
}
- Point as_point() const
+ Gfx::Point as_point() const
{
return { m_value.as_point.x, m_value.as_point.y };
}
diff --git a/Libraries/LibGUI/GWidget.h b/Libraries/LibGUI/GWidget.h
index 5d1eb1704a..48c19a7744 100644
--- a/Libraries/LibGUI/GWidget.h
+++ b/Libraries/LibGUI/GWidget.h
@@ -144,7 +144,7 @@ public:
virtual void second_paint_event(PaintEvent&);
Gfx::Rect relative_rect() const { return m_relative_rect; }
- Point relative_position() const { return m_relative_rect.location(); }
+ Gfx::Point relative_position() const { return m_relative_rect.location(); }
Gfx::Rect window_relative_rect() const;
Gfx::Rect screen_relative_rect() const;
@@ -170,7 +170,7 @@ public:
Yes };
struct HitTestResult {
Widget* widget { nullptr };
- Point local_position;
+ Gfx::Point local_position;
};
HitTestResult hit_test(const Gfx::Point&, ShouldRespectGreediness = ShouldRespectGreediness::Yes);
Widget* child_at(const Gfx::Point&) const;
diff --git a/Libraries/LibGUI/GWindow.cpp b/Libraries/LibGUI/GWindow.cpp
index b25c69a197..39ce6fe1f5 100644
--- a/Libraries/LibGUI/GWindow.cpp
+++ b/Libraries/LibGUI/GWindow.cpp
@@ -197,14 +197,14 @@ void Window::event(Core::Event& event)
auto& mouse_event = static_cast<MouseEvent&>(event);
if (m_global_cursor_tracking_widget) {
auto window_relative_rect = m_global_cursor_tracking_widget->window_relative_rect();
- Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
+ Gfx::Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
auto local_event = make<MouseEvent>((Event::Type)event.type(), local_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta());
m_global_cursor_tracking_widget->dispatch_event(*local_event, this);
return;
}
if (m_automatic_cursor_tracking_widget) {
auto window_relative_rect = m_automatic_cursor_tracking_widget->window_relative_rect();
- Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
+ Gfx::Point local_point { mouse_event.x() - window_relative_rect.x(), mouse_event.y() - window_relative_rect.y() };
auto local_event = make<MouseEvent>((Event::Type)event.type(), local_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta());
m_automatic_cursor_tracking_widget->dispatch_event(*local_event, this);
if (mouse_event.buttons() == 0)
diff --git a/Libraries/LibGUI/GWindow.h b/Libraries/LibGUI/GWindow.h
index 6eec7ac637..b57a22f2fa 100644
--- a/Libraries/LibGUI/GWindow.h
+++ b/Libraries/LibGUI/GWindow.h
@@ -106,7 +106,7 @@ public:
void set_rect(const Gfx::Rect&);
void set_rect(int x, int y, int width, int height) { set_rect({ x, y, width, height }); }
- Point position() const { return rect().location(); }
+ Gfx::Point position() const { return rect().location(); }
void move_to(int x, int y) { move_to({ x, y }); }
void move_to(const Gfx::Point& point) { set_rect({ point, size() }); }
diff --git a/Libraries/LibGfx/Point.h b/Libraries/LibGfx/Point.h
index 1c52b62cfa..bfc57ca21d 100644
--- a/Libraries/LibGfx/Point.h
+++ b/Libraries/LibGfx/Point.h
@@ -162,5 +162,3 @@ inline const LogStream& operator<<(const LogStream& stream, const Point& value)
}
}
-
-using Gfx::Point;
diff --git a/Servers/WindowServer/WSCompositor.cpp b/Servers/WindowServer/WSCompositor.cpp
index 0b8c45a511..ed9382cbbd 100644
--- a/Servers/WindowServer/WSCompositor.cpp
+++ b/Servers/WindowServer/WSCompositor.cpp
@@ -144,7 +144,7 @@ void WSCompositor::compose()
if (m_wallpaper_mode == WallpaperMode::Simple) {
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
} else if (m_wallpaper_mode == WallpaperMode::Center) {
- Point offset { ws.size().width() / 2 - m_wallpaper->size().width() / 2,
+ Gfx::Point offset { ws.size().width() / 2 - m_wallpaper->size().width() / 2,
ws.size().height() / 2 - m_wallpaper->size().height() / 2 };
m_back_painter->blit_offset(dirty_rect.location(), *m_wallpaper,
dirty_rect, offset);
diff --git a/Servers/WindowServer/WSCursor.h b/Servers/WindowServer/WSCursor.h
index bdba0e3a60..4f42de6ffd 100644
--- a/Servers/WindowServer/WSCursor.h
+++ b/Servers/WindowServer/WSCursor.h
@@ -47,7 +47,7 @@ public:
static RefPtr<WSCursor> create(WSStandardCursor);
~WSCursor();
- Point hotspot() const { return m_hotspot; }
+ Gfx::Point hotspot() const { return m_hotspot; }
const Gfx::Bitmap& bitmap() const { return *m_bitmap; }
Gfx::Rect rect() const { return m_bitmap->rect(); }
diff --git a/Servers/WindowServer/WSEvent.h b/Servers/WindowServer/WSEvent.h
index 48b9afc257..78f1c11a2d 100644
--- a/Servers/WindowServer/WSEvent.h
+++ b/Servers/WindowServer/WSEvent.h
@@ -108,7 +108,7 @@ public:
{
}
- Point position() const { return m_position; }
+ Gfx::Point position() const { return m_position; }
int x() const { return m_position.x(); }
int y() const { return m_position.y(); }
MouseButton button() const { return m_button; }
diff --git a/Servers/WindowServer/WSMenu.cpp b/Servers/WindowServer/WSMenu.cpp
index f5531367c9..61a469ea59 100644
--- a/Servers/WindowServer/WSMenu.cpp
+++ b/Servers/WindowServer/WSMenu.cpp
@@ -125,7 +125,7 @@ WSWindow& WSMenu::ensure_menu_window()
{
int width = this->content_width();
if (!m_menu_window) {
- Point next_item_location(frame_thickness(), frame_thickness());
+ Gfx::Point next_item_location(frame_thickness(), frame_thickness());
for (auto& item : m_items) {
int height = 0;
if (item.type() == WSMenuItem::Text)
@@ -249,8 +249,8 @@ void WSMenu::draw()
painter.draw_bitmap(submenu_arrow_rect.location(), submenu_arrow_bitmap, text_color);
}
} else if (item.type() == WSMenuItem::Separator) {
- Point p1(item.rect().translated(stripe_rect.width() + 4, 0).x(), item.rect().center().y() - 1);
- Point p2(width - 7, item.rect().center().y() - 1);
+ Gfx::Point p1(item.rect().translated(stripe_rect.width() + 4, 0).x(), item.rect().center().y() - 1);
+ Gfx::Point p2(width - 7, item.rect().center().y() - 1);
painter.draw_line(p1, p2, palette.threed_shadow1());
painter.draw_line(p1.translated(0, 1), p2.translated(0, 1), palette.threed_highlight());
}
@@ -305,8 +305,8 @@ void WSMenu::handle_mouse_move_event(const WSMouseEvent& mouse_event)
if (hovered_item() && hovered_item()->is_submenu()) {
auto item = *hovered_item();
- auto submenu_top_left = item.rect().location() + Point { item.rect().width(), 0 };
- auto submenu_bottom_left = submenu_top_left + Point { 0, item.submenu()->menu_window()->height() };
+ auto submenu_top_left = item.rect().location() + Gfx::Point { item.rect().width(), 0 };
+ auto submenu_bottom_left = submenu_top_left + Gfx::Point { 0, item.submenu()->menu_window()->height() };
auto safe_hover_triangle = Gfx::Triangle { m_last_position_in_hover, submenu_top_left, submenu_bottom_left };
m_last_position_in_hover = mouse_event.position();
@@ -510,7 +510,7 @@ void WSMenu::popup(const Gfx::Point& position, bool is_submenu)
redraw_if_theme_changed();
const int margin = 30;
- Point adjusted_pos = position;
+ Gfx::Point adjusted_pos = position;
if (adjusted_pos.x() + window.width() >= WSScreen::the().width() - margin) {
adjusted_pos = adjusted_pos.translated(-window.width(), 0);
diff --git a/Servers/WindowServer/WSMenuManager.cpp b/Servers/WindowServer/WSMenuManager.cpp
index 98aa96e746..110118a4a1 100644
--- a/Servers/WindowServer/WSMenuManager.cpp
+++ b/Servers/WindowServer/WSMenuManager.cpp
@@ -518,7 +518,7 @@ void WSMenuManager::set_current_menubar(WSMenuBar* menubar)
#ifdef DEBUG_MENUS
dbg() << "[WM] Current menubar is now " << menubar;
#endif
- Point next_menu_location { WSMenuManager::menubar_menu_margin() / 2, 0 };
+ Gfx::Point next_menu_location { WSMenuManager::menubar_menu_margin() / 2, 0 };
int index = 0;
for_each_active_menubar_menu([&](WSMenu& menu) {
int text_width = index == 1 ? Gfx::Font::default_bold_font().width(menu.name()) : Gfx::Font::default_font().width(menu.name());
diff --git a/Servers/WindowServer/WSScreen.h b/Servers/WindowServer/WSScreen.h
index 918bb9b3c6..28e486e10a 100644
--- a/Servers/WindowServer/WSScreen.h
+++ b/Servers/WindowServer/WSScreen.h
@@ -52,7 +52,7 @@ public:
Size size() const { return { width(), height() }; }
Gfx::Rect rect() const { return { 0, 0, width(), height() }; }
- Point cursor_location() const { return m_cursor_location; }
+ Gfx::Point cursor_location() const { return m_cursor_location; }
unsigned mouse_button_state() const { return m_mouse_button_state; }
void on_receive_mouse_data(const MousePacket&);
diff --git a/Servers/WindowServer/WSWindow.h b/Servers/WindowServer/WSWindow.h
index a8499be0ca..75976f397e 100644
--- a/Servers/WindowServer/WSWindow.h
+++ b/Servers/WindowServer/WSWindow.h
@@ -155,7 +155,7 @@ public:
void move_to(const Gfx::Point& position) { set_rect({ position, size() }); }
void move_to(int x, int y) { move_to({ x, y }); }
- Point position() const { return m_rect.location(); }
+ Gfx::Point position() const { return m_rect.location(); }
void set_position(const Gfx::Point& position) { set_rect({ position.x(), position.y(), width(), height() }); }
void set_position_without_repaint(const Gfx::Point& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); }
diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp
index 89663bd654..24502b4a7d 100644
--- a/Servers/WindowServer/WSWindowManager.cpp
+++ b/Servers/WindowServer/WSWindowManager.cpp
@@ -466,7 +466,7 @@ bool WSWindowManager::process_ongoing_window_move(WSMouseEvent& event, WSWindow*
m_move_window->set_tiled(WindowTileType::Right);
} else if (pixels_moved_from_start > 5 || m_move_window->tiled() == WindowTileType::None) {
m_move_window->set_tiled(WindowTileType::None);
- Point pos = m_move_window_origin.translated(event.position() - m_move_origin);
+ Gfx::Point pos = m_move_window_origin.translated(event.position() - m_move_origin);
m_move_window->set_position_without_repaint(pos);
if (m_move_window->rect().contains(event.position()))
hovered_window = m_move_window;
diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h
index 74bf3285e2..2704adc9cc 100644
--- a/Servers/WindowServer/WSWindowManager.h
+++ b/Servers/WindowServer/WSWindowManager.h
@@ -239,7 +239,7 @@ private:
struct DoubleClickInfo {
struct ClickMetadata {
Core::ElapsedTimer clock;
- Point last_position;
+ Gfx::Point last_position;
};
ClickMetadata& metadata_for_button(MouseButton);