summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/Event.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-13 13:28:33 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-13 21:41:45 +0200
commitb78e13cf2e579d7e90e5166fbbc8eb666770cc1c (patch)
tree0a40408c790a552edb995c6303357d1142acb138 /Libraries/LibGUI/Event.h
parentc8d9f1b9c920e0314bb9ca67f183c8df743e845a (diff)
downloadserenity-b78e13cf2e579d7e90e5166fbbc8eb666770cc1c.zip
LibGUI: Make some GUI event getters return const references
There's no good reason to return rects/sizes/positions by value.
Diffstat (limited to 'Libraries/LibGUI/Event.h')
-rw-r--r--Libraries/LibGUI/Event.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Libraries/LibGUI/Event.h b/Libraries/LibGUI/Event.h
index 77f4e70426..5a920b66f2 100644
--- a/Libraries/LibGUI/Event.h
+++ b/Libraries/LibGUI/Event.h
@@ -132,8 +132,8 @@ public:
int parent_client_id() const { return m_parent_client_id; }
int parent_window_id() const { return m_parent_window_id; }
- String title() const { return m_title; }
- Gfx::IntRect rect() const { return m_rect; }
+ const String& title() const { return m_title; }
+ const Gfx::IntRect& rect() const { return m_rect; }
bool is_active() const { return m_active; }
bool is_modal() const { return m_modal; }
WindowType window_type() const { return m_window_type; }
@@ -162,7 +162,7 @@ public:
{
}
- Gfx::IntRect rect() const { return m_rect; }
+ const Gfx::IntRect& rect() const { return m_rect; }
private:
Gfx::IntRect m_rect;
@@ -195,7 +195,7 @@ public:
}
const Vector<Gfx::IntRect, 32>& rects() const { return m_rects; }
- Gfx::IntSize window_size() const { return m_window_size; }
+ const Gfx::IntSize& window_size() const { return m_window_size; }
private:
Vector<Gfx::IntRect, 32> m_rects;
@@ -211,8 +211,8 @@ public:
{
}
- Gfx::IntRect rect() const { return m_rect; }
- Gfx::IntSize window_size() const { return m_window_size; }
+ const Gfx::IntRect& rect() const { return m_rect; }
+ const Gfx::IntSize& window_size() const { return m_window_size; }
private:
Gfx::IntRect m_rect;
@@ -323,7 +323,7 @@ public:
{
}
- Gfx::IntPoint position() const { return m_position; }
+ const Gfx::IntPoint& 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; }