Skip to content

Commit 27fae78

Browse files
MacDueawesomekling
authored andcommitted
Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
1 parent e011eaf commit 27fae78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+142
-142
lines changed

Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static bool is_primitive_type(DeprecatedString const& type)
6969
static bool is_simple_type(DeprecatedString const& type)
7070
{
7171
// Small types that it makes sense just to pass by value.
72-
return type.is_one_of("Gfx::Color", "Gfx::IntPoint", "Gfx::FloatPoint");
72+
return type.is_one_of("Gfx::Color", "Gfx::IntPoint", "Gfx::FloatPoint", "Gfx::IntSize");
7373
}
7474

7575
static bool is_primitive_or_simple_type(DeprecatedString const& type)

Userland/Applications/Browser/BrowserWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ void BrowserWindow::broadcast_window_position(Gfx::IntPoint position)
698698
});
699699
}
700700

701-
void BrowserWindow::broadcast_window_size(Gfx::IntSize const& size)
701+
void BrowserWindow::broadcast_window_size(Gfx::IntSize size)
702702
{
703703
tab_widget().for_each_child_of_type<Browser::Tab>([&](auto& tab) {
704704
tab.window_size_changed(size);

Userland/Applications/Browser/BrowserWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BrowserWindow final : public GUI::Window
4646
void proxy_mappings_changed();
4747

4848
void broadcast_window_position(Gfx::IntPoint);
49-
void broadcast_window_size(Gfx::IntSize const&);
49+
void broadcast_window_size(Gfx::IntSize);
5050

5151
private:
5252
explicit BrowserWindow(CookieJar&, URL);

Userland/Applications/Browser/Tab.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Tab::Tab(BrowserWindow& window)
277277
return this->window().position();
278278
};
279279

280-
view().on_resize_window = [this](Gfx::IntSize const& size) {
280+
view().on_resize_window = [this](Gfx::IntSize size) {
281281
this->window().resize(size);
282282
return this->window().size();
283283
};
@@ -619,7 +619,7 @@ void Tab::window_position_changed(Gfx::IntPoint position)
619619
m_web_content_view->set_window_position(position);
620620
}
621621

622-
void Tab::window_size_changed(Gfx::IntSize const& size)
622+
void Tab::window_size_changed(Gfx::IntSize size)
623623
{
624624
m_web_content_view->set_window_size(size);
625625
}

Userland/Applications/Browser/Tab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Tab final : public GUI::Widget {
5757
void action_left(GUI::Action&);
5858

5959
void window_position_changed(Gfx::IntPoint);
60-
void window_size_changed(Gfx::IntSize const&);
60+
void window_size_changed(Gfx::IntSize);
6161

6262
Function<void(DeprecatedString const&)> on_title_change;
6363
Function<void(const URL&)> on_tab_open_request;

Userland/Applications/PixelPaint/CreateNewImageDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CreateNewImageDialog final : public GUI::Dialog {
1414
C_OBJECT(CreateNewImageDialog)
1515

1616
public:
17-
Gfx::IntSize const& image_size() const { return m_image_size; }
17+
Gfx::IntSize image_size() const { return m_image_size; }
1818
DeprecatedString const& image_name() const { return m_image_name; }
1919

2020
private:

Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace PixelPaint {
1515

16-
CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
16+
CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window)
1717
: Dialog(parent_window)
1818
{
1919
set_title("Create new layer");

Userland/Applications/PixelPaint/CreateNewLayerDialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class CreateNewLayerDialog final : public GUI::Dialog {
1414
C_OBJECT(CreateNewLayerDialog);
1515

1616
public:
17-
Gfx::IntSize const& layer_size() const { return m_layer_size; }
17+
Gfx::IntSize layer_size() const { return m_layer_size; }
1818
DeprecatedString const& layer_name() const { return m_layer_name; }
1919

2020
private:
21-
CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window);
21+
CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Window* parent_window);
2222

2323
Gfx::IntSize m_layer_size;
2424
DeprecatedString m_layer_name;

Userland/Applications/PixelPaint/Image.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace PixelPaint {
2626

27-
ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& size)
27+
ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize size)
2828
{
2929
VERIFY(!size.is_empty());
3030

@@ -34,7 +34,7 @@ ErrorOr<NonnullRefPtr<Image>> Image::try_create_with_size(Gfx::IntSize const& si
3434
return adopt_nonnull_ref_or_enomem(new (nothrow) Image(size));
3535
}
3636

37-
Image::Image(Gfx::IntSize const& size)
37+
Image::Image(Gfx::IntSize size)
3838
: m_size(size)
3939
, m_selection(*this)
4040
{
@@ -548,7 +548,7 @@ Optional<Gfx::IntRect> Image::nonempty_content_bounding_rect() const
548548
return bounding_rect;
549549
}
550550

551-
void Image::resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode)
551+
void Image::resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode)
552552
{
553553
float scale_x = 1.0f;
554554
float scale_y = 1.0f;

Userland/Applications/PixelPaint/Image.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ImageClient {
4646

4747
class Image : public RefCounted<Image> {
4848
public:
49-
static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize const&);
49+
static ErrorOr<NonnullRefPtr<Image>> try_create_with_size(Gfx::IntSize);
5050
static ErrorOr<NonnullRefPtr<Image>> try_create_from_pixel_paint_json(JsonObject const&);
5151
static ErrorOr<NonnullRefPtr<Image>> try_create_from_bitmap(NonnullRefPtr<Gfx::Bitmap>);
5252

@@ -63,7 +63,7 @@ class Image : public RefCounted<Image> {
6363
Layer const& layer(size_t index) const { return m_layers.at(index); }
6464
Layer& layer(size_t index) { return m_layers.at(index); }
6565

66-
Gfx::IntSize const& size() const { return m_size; }
66+
Gfx::IntSize size() const { return m_size; }
6767
Gfx::IntRect rect() const { return { {}, m_size }; }
6868

6969
void add_layer(NonnullRefPtr<Layer>);
@@ -100,14 +100,14 @@ class Image : public RefCounted<Image> {
100100
void flip(Gfx::Orientation orientation);
101101
void rotate(Gfx::RotationDirection direction);
102102
void crop(Gfx::IntRect const& rect);
103-
void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
103+
void resize(Gfx::IntSize new_size, Gfx::Painter::ScalingMode scaling_mode);
104104

105105
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
106106

107107
Color color_at(Gfx::IntPoint point) const;
108108

109109
private:
110-
explicit Image(Gfx::IntSize const&);
110+
explicit Image(Gfx::IntSize);
111111

112112
void did_change(Gfx::IntRect const& modified_rect = {});
113113
void did_change_rect(Gfx::IntRect const& modified_rect = {});

0 commit comments

Comments
 (0)