summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-12-06 21:35:32 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-07 11:48:27 +0100
commit27fae783359ece05400dcbee66c50fee97cd1b0b (patch)
tree7918baf077884d287a8dce3ad7ccad9f9d1aaaf0 /Userland/Applications
parente011eafd3790ca0375a4678a9cb2debd0ae95ac7 (diff)
downloadserenity-27fae783359ece05400dcbee66c50fee97cd1b0b.zip
Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp2
-rw-r--r--Userland/Applications/Browser/BrowserWindow.h2
-rw-r--r--Userland/Applications/Browser/Tab.cpp4
-rw-r--r--Userland/Applications/Browser/Tab.h2
-rw-r--r--Userland/Applications/PixelPaint/CreateNewImageDialog.h2
-rw-r--r--Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp2
-rw-r--r--Userland/Applications/PixelPaint/CreateNewLayerDialog.h4
-rw-r--r--Userland/Applications/PixelPaint/Image.cpp6
-rw-r--r--Userland/Applications/PixelPaint/Image.h8
-rw-r--r--Userland/Applications/PixelPaint/Layer.cpp6
-rw-r--r--Userland/Applications/PixelPaint/Layer.h6
-rw-r--r--Userland/Applications/PixelPaint/ResizeImageDialog.cpp2
-rw-r--r--Userland/Applications/PixelPaint/ResizeImageDialog.h4
-rw-r--r--Userland/Applications/Terminal/main.cpp2
14 files changed, 26 insertions, 26 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index 68d1bc938d..56c55727a5 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -698,7 +698,7 @@ void BrowserWindow::broadcast_window_position(Gfx::IntPoint position)
});
}
-void BrowserWindow::broadcast_window_size(Gfx::IntSize const& size)
+void BrowserWindow::broadcast_window_size(Gfx::IntSize size)
{
tab_widget().for_each_child_of_type<Browser::Tab>([&](auto& tab) {
tab.window_size_changed(size);
diff --git a/Userland/Applications/Browser/BrowserWindow.h b/Userland/Applications/Browser/BrowserWindow.h
index 19b4c4e6df..82882d5159 100644
--- a/Userland/Applications/Browser/BrowserWindow.h
+++ b/Userland/Applications/Browser/BrowserWindow.h
@@ -46,7 +46,7 @@ public:
void proxy_mappings_changed();
void broadcast_window_position(Gfx::IntPoint);
- void broadcast_window_size(Gfx::IntSize const&);
+ void broadcast_window_size(Gfx::IntSize);
private:
explicit BrowserWindow(CookieJar&, URL);
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index 38203900df..db097a87eb 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -277,7 +277,7 @@ Tab::Tab(BrowserWindow& window)
return this->window().position();
};
- view().on_resize_window = [this](Gfx::IntSize const& size) {
+ view().on_resize_window = [this](Gfx::IntSize size) {
this->window().resize(size);
return this->window().size();
};
@@ -619,7 +619,7 @@ void Tab::window_position_changed(Gfx::IntPoint position)
m_web_content_view->set_window_position(position);
}
-void Tab::window_size_changed(Gfx::IntSize const& size)
+void Tab::window_size_changed(Gfx::IntSize size)
{
m_web_content_view->set_window_size(size);
}
diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h
index 61308248cb..e24e73646b 100644
--- a/Userland/Applications/Browser/Tab.h
+++ b/Userland/Applications/Browser/Tab.h
@@ -57,7 +57,7 @@ public:
void action_left(GUI::Action&);
void window_position_changed(Gfx::IntPoint);
- void window_size_changed(Gfx::IntSize const&);
+ void window_size_changed(Gfx::IntSize);
Function<void(DeprecatedString const&)> on_title_change;
Function<void(const URL&)> on_tab_open_request;
diff --git a/Userland/Applications/PixelPaint/CreateNewImageDialog.h b/Userland/Applications/PixelPaint/CreateNewImageDialog.h
index b4280d0ff0..67bf5e0bae 100644
--- a/Userland/Applications/PixelPaint/CreateNewImageDialog.h
+++ b/Userland/Applications/PixelPaint/CreateNewImageDialog.h
@@ -14,7 +14,7 @@ class CreateNewImageDialog final : public GUI::Dialog {
C_OBJECT(CreateNewImageDialog)
public:
- Gfx::IntSize const& image_size() const { return m_image_size; }
+ Gfx::IntSize image_size() const { return m_image_size; }
DeprecatedString const& image_name() const { return m_image_name; }
private:
diff --git a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp
index 89f41220bb..d923451e32 100644
--- a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp
+++ b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp
@@ -13,7 +13,7 @@
namespace PixelPaint {
-CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
+CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window)
: Dialog(parent_window)
{
set_title("Create new layer");
diff --git a/Userland/Applications/PixelPaint/CreateNewLayerDialog.h b/Userland/Applications/PixelPaint/CreateNewLayerDialog.h
index fb446b561b..b28d6a37f6 100644
--- a/Userland/Applications/PixelPaint/CreateNewLayerDialog.h
+++ b/Userland/Applications/PixelPaint/CreateNewLayerDialog.h
@@ -14,11 +14,11 @@ class CreateNewLayerDialog final : public GUI::Dialog {
C_OBJECT(CreateNewLayerDialog);
public:
- Gfx::IntSize const& layer_size() const { return m_layer_size; }
+ Gfx::IntSize layer_size() const { return m_layer_size; }
DeprecatedString const& layer_name() const { return m_layer_name; }
private:
- CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window);
+ CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window);
Gfx::IntSize m_layer_size;
DeprecatedString m_layer_name;
diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp
index a77dd6a36c..9d7f971d59 100644
--- a/Userland/Applications/PixelPaint/Image.cpp
+++ b/Userland/Applications/PixelPaint/Image.cpp
@@ -24,7 +24,7 @@
namespace PixelPaint {
-ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& size)
+ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize size)
{
VERIFY(!size.is_empty());
@@ -34,7 +34,7 @@ ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& si
return adopt_nonnull_ref_or_enomem(new (nothrow) Image(size));
}
-Image::Image(Gfx::IntSize const& size)
+Image::Image(Gfx::IntSize size)
: m_size(size)
, m_selection(*this)
{
@@ -548,7 +548,7 @@ Optional<Gfx::IntRect> Image::nonempty_content_bounding_rect() const
return bounding_rect;
}
-void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
+void Image::resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode)
{
float scale_x = 1.0f;
float scale_y = 1.0f;
diff --git a/Userland/Applications/PixelPaint/Image.h b/Userland/Applications/PixelPaint/Image.h
index 6a8b2a26d6..3ad98ba468 100644
--- a/Userland/Applications/PixelPaint/Image.h
+++ b/Userland/Applications/PixelPaint/Image.h
@@ -46,7 +46,7 @@ protected:
class Image : public RefCounted<Image> {
public:
- static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize const&);
+ static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize);
static ErrorOr<NonnullRefPtr<Image>> try_create_from_pixel_paint_json(JsonObject const&);
static ErrorOr<NonnullRefPtr<Image>> try_create_from_bitmap(NonnullRefPtr<Gfx::Bitmap>);
@@ -63,7 +63,7 @@ public:
Layer const& layer(size_t index) const { return m_layers.at(index); }
Layer& layer(size_t index) { return m_layers.at(index); }
- Gfx::IntSize const& size() const { return m_size; }
+ Gfx::IntSize size() const { return m_size; }
Gfx::IntRect rect() const { return { {}, m_size }; }
void add_layer(NonnullRefPtr<Layer>);
@@ -100,14 +100,14 @@ public:
void flip(Gfx::Orientation orientation);
void rotate(Gfx::RotationDirection direction);
void crop(Gfx::IntRect const& rect);
- void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
+ void resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode);
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
Color color_at(Gfx::IntPoint point) const;
private:
- explicit Image(Gfx::IntSize const&);
+ explicit Image(Gfx::IntSize);
void did_change(Gfx::IntRect const& modified_rect = {});
void did_change_rect(Gfx::IntRect const& modified_rect = {});
diff --git a/Userland/Applications/PixelPaint/Layer.cpp b/Userland/Applications/PixelPaint/Layer.cpp
index a235818168..ef784a4308 100644
--- a/Userland/Applications/PixelPaint/Layer.cpp
+++ b/Userland/Applications/PixelPaint/Layer.cpp
@@ -16,7 +16,7 @@
namespace PixelPaint {
-ErrorOr<NonnullRefPtr<Layer>> Layer::try_create_with_size(Image& image, Gfx::IntSize const& size, DeprecatedString name)
+ErrorOr<NonnullRefPtr<Layer>> Layer::try_create_with_size(Image& image, Gfx::IntSize size, DeprecatedString name)
{
VERIFY(!size.is_empty());
@@ -221,7 +221,7 @@ void Layer::crop(Gfx::IntRect const& rect)
did_modify_bitmap();
}
-void Layer::resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode)
+void Layer::resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode)
{
auto src_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), size());
auto dst_rect = Gfx::IntRect(Gfx::IntPoint(0, 0), new_size);
@@ -261,7 +261,7 @@ void Layer::resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scali
resize(new_rect.size(), new_rect.location(), scaling_mode);
}
-void Layer::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
+void Layer::resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode)
{
resize(new_size, location(), scaling_mode);
}
diff --git a/Userland/Applications/PixelPaint/Layer.h b/Userland/Applications/PixelPaint/Layer.h
index 22ccfb2d84..ba5e86d113 100644
--- a/Userland/Applications/PixelPaint/Layer.h
+++ b/Userland/Applications/PixelPaint/Layer.h
@@ -29,7 +29,7 @@ class Layer
AK_MAKE_NONMOVABLE(Layer);
public:
- static ErrorOr<NonnullRefPtr<Layer>> try_create_with_size(Image&, Gfx::IntSize const&, DeprecatedString name);
+ static ErrorOr<NonnullRefPtr<Layer>> try_create_with_size(Image&, Gfx::IntSize, DeprecatedString name);
static ErrorOr<NonnullRefPtr<Layer>> try_create_with_bitmap(Image&, NonnullRefPtr<Gfx::Bitmap>, DeprecatedString name);
static ErrorOr<NonnullRefPtr<Layer>> try_create_snapshot(Image&, Layer const&);
@@ -59,9 +59,9 @@ public:
void flip(Gfx::Orientation orientation);
void rotate(Gfx::RotationDirection direction);
void crop(Gfx::IntRect const& rect);
- void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
+ void resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode);
void resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scaling_mode);
- void resize(Gfx::IntSize const& new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
+ void resize(Gfx::IntSize new_size, Gfx::IntPoint new_location, Gfx::Painter::ScalingMode scaling_mode);
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
diff --git a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp
index 643658e65a..d198fc5c7b 100644
--- a/Userland/Applications/PixelPaint/ResizeImageDialog.cpp
+++ b/Userland/Applications/PixelPaint/ResizeImageDialog.cpp
@@ -16,7 +16,7 @@
namespace PixelPaint {
-ResizeImageDialog::ResizeImageDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
+ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window)
: Dialog(parent_window)
{
m_desired_size.set_width(max(1, suggested_size.width()));
diff --git a/Userland/Applications/PixelPaint/ResizeImageDialog.h b/Userland/Applications/PixelPaint/ResizeImageDialog.h
index b74ae3d037..f4b58f0810 100644
--- a/Userland/Applications/PixelPaint/ResizeImageDialog.h
+++ b/Userland/Applications/PixelPaint/ResizeImageDialog.h
@@ -15,12 +15,12 @@ class ResizeImageDialog final : public GUI::Dialog {
C_OBJECT(ResizeImageDialog);
public:
- Gfx::IntSize const& desired_size() const { return m_desired_size; }
+ Gfx::IntSize desired_size() const { return m_desired_size; }
Gfx::Painter::ScalingMode scaling_mode() const { return m_scaling_mode; }
bool should_rescale() const { return m_rescale_image; }
private:
- ResizeImageDialog(Gfx::IntSize const& starting_size, GUI::Window* parent_window);
+ ResizeImageDialog(Gfx::IntSize starting_size, GUI::Window* parent_window);
Gfx::IntSize m_desired_size;
Gfx::Painter::ScalingMode m_scaling_mode;
diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp
index 66fdaad891..0f6f7bea0c 100644
--- a/Userland/Applications/Terminal/main.cpp
+++ b/Userland/Applications/Terminal/main.cpp
@@ -302,7 +302,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
terminal->on_title_change = [&](auto title) {
window->set_title(title);
};
- terminal->on_terminal_size_change = [&](auto& size) {
+ terminal->on_terminal_size_change = [&](auto size) {
window->resize(size);
};
terminal->apply_size_increments_to_window(*window);