PixelPaint: Convert to east-const style

This commit is contained in:
Andreas Kling 2021-06-11 13:27:47 +02:00
parent 242742b6c2
commit 29e80178a8
Notes: sideshowbarker 2024-07-18 12:23:24 +09:00
23 changed files with 72 additions and 72 deletions

View File

@ -52,7 +52,7 @@ void BrushTool::on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&)
}
}
void BrushTool::draw_point(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& point)
void BrushTool::draw_point(Gfx::Bitmap& bitmap, Gfx::Color const& color, Gfx::IntPoint const& point)
{
for (int y = point.y() - m_size; y < point.y() + m_size; y++) {
for (int x = point.x() - m_size; x < point.x() + m_size; x++) {
@ -70,7 +70,7 @@ void BrushTool::draw_point(Gfx::Bitmap& bitmap, const Gfx::Color& color, const G
}
}
void BrushTool::draw_line(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& start, const Gfx::IntPoint& end)
void BrushTool::draw_line(Gfx::Bitmap& bitmap, Gfx::Color const& color, Gfx::IntPoint const& start, Gfx::IntPoint const& end)
{
int length_x = end.x() - start.x();
int length_y = end.y() - start.y();

View File

@ -27,8 +27,8 @@ private:
bool m_was_drawing { false };
Gfx::IntPoint m_last_position;
void draw_line(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& start, const Gfx::IntPoint& end);
void draw_point(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& point);
void draw_line(Gfx::Bitmap& bitmap, Gfx::Color const& color, Gfx::IntPoint const& start, Gfx::IntPoint const& end);
void draw_point(Gfx::Bitmap& bitmap, Gfx::Color const& color, Gfx::IntPoint const& point);
};
}

View File

@ -25,7 +25,7 @@ BucketTool::~BucketTool()
{
}
static float color_distance_squared(const Gfx::Color& lhs, const Gfx::Color& rhs)
static float color_distance_squared(Gfx::Color const& lhs, Gfx::Color const& rhs)
{
int a = rhs.red() - lhs.red();
int b = rhs.green() - lhs.green();
@ -33,7 +33,7 @@ static float color_distance_squared(const Gfx::Color& lhs, const Gfx::Color& rhs
return (a * a + b * b + c * c) / (255.0f * 255.0f);
}
static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::IntPoint& start_position, Color target_color, Color fill_color, int threshold)
static void flood_fill(Gfx::Bitmap& bitmap, Gfx::IntPoint const& start_position, Color target_color, Color fill_color, int threshold)
{
VERIFY(bitmap.bpp() == 32);

View File

@ -14,8 +14,8 @@ class CreateNewImageDialog final : public GUI::Dialog {
C_OBJECT(CreateNewImageDialog)
public:
const Gfx::IntSize& image_size() const { return m_image_size; }
const String& image_name() const { return m_image_name; }
Gfx::IntSize const& image_size() const { return m_image_size; }
String const& image_name() const { return m_image_name; }
private:
CreateNewImageDialog(GUI::Window* parent_window);

View File

@ -13,7 +13,7 @@
namespace PixelPaint {
CreateNewLayerDialog::CreateNewLayerDialog(const Gfx::IntSize& suggested_size, GUI::Window* parent_window)
CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window)
: Dialog(parent_window)
{
set_title("Create new layer");

View File

@ -14,11 +14,11 @@ class CreateNewLayerDialog final : public GUI::Dialog {
C_OBJECT(CreateNewLayerDialog);
public:
const Gfx::IntSize& layer_size() const { return m_layer_size; }
const String& layer_name() const { return m_layer_name; }
Gfx::IntSize const& layer_size() const { return m_layer_size; }
String const& layer_name() const { return m_layer_name; }
private:
CreateNewLayerDialog(const Gfx::IntSize& suggested_size, GUI::Window* parent_window);
CreateNewLayerDialog(Gfx::IntSize const& suggested_size, GUI::Window* parent_window);
Gfx::IntSize m_layer_size;
String m_layer_name;

View File

@ -23,7 +23,7 @@ EllipseTool::~EllipseTool()
{
}
void EllipseTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& ellipse_intersecting_rect)
void EllipseTool::draw_using(GUI::Painter& painter, Gfx::IntRect const& ellipse_intersecting_rect)
{
switch (m_mode) {
case Mode::Outline:
@ -71,7 +71,7 @@ void EllipseTool::on_mousemove(Layer&, GUI::MouseEvent& event, GUI::MouseEvent&)
m_editor->update();
}
void EllipseTool::on_second_paint(const Layer& layer, GUI::PaintEvent& event)
void EllipseTool::on_second_paint(Layer const& layer, GUI::PaintEvent& event)
{
if (m_drawing_button == GUI::MouseButton::None)
return;

View File

@ -21,7 +21,7 @@ public:
virtual void on_mousemove(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_mouseup(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) override;
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) override;
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
virtual void on_keydown(GUI::KeyEvent&) override;
private:
@ -30,7 +30,7 @@ private:
Fill,
};
void draw_using(GUI::Painter&, const Gfx::IntRect&);
void draw_using(GUI::Painter&, Gfx::IntRect const&);
GUI::MouseButton m_drawing_button { GUI::MouseButton::None };
Gfx::IntPoint m_ellipse_start_position;

View File

@ -22,7 +22,7 @@ EraseTool::~EraseTool()
{
}
Gfx::IntRect EraseTool::build_rect(const Gfx::IntPoint& pos, const Gfx::IntRect& widget_rect)
Gfx::IntRect EraseTool::build_rect(Gfx::IntPoint const& pos, Gfx::IntRect const& widget_rect)
{
const int base_eraser_size = 10;
const int eraser_size = (base_eraser_size * m_thickness);

View File

@ -25,7 +25,7 @@ public:
private:
Gfx::Color get_color() const;
Gfx::IntRect build_rect(const Gfx::IntPoint& pos, const Gfx::IntRect& widget_rect);
Gfx::IntRect build_rect(Gfx::IntPoint const& pos, Gfx::IntRect const& widget_rect);
RefPtr<GUI::Menu> m_context_menu;
bool m_use_secondary_color { false };

View File

@ -31,7 +31,7 @@ class GenericConvolutionFilterInputDialog : public GUI::Dialog {
C_OBJECT(GenericConvolutionFilterInputDialog);
public:
const Matrix<N, float>& matrix() const { return m_matrix; }
Matrix<N, float> const& matrix() const { return m_matrix; }
bool should_wrap() const { return m_should_wrap; }
private:

View File

@ -41,10 +41,10 @@ public:
static RefPtr<Image> create_from_bitmap(RefPtr<Gfx::Bitmap> bitmap);
size_t layer_count() const { return m_layers.size(); }
const Layer& layer(size_t index) const { return m_layers.at(index); }
Layer const& layer(size_t index) const { return m_layers.at(index); }
Layer& layer(size_t index) { return m_layers.at(index); }
const Gfx::IntSize& size() const { return m_size; }
Gfx::IntSize const& size() const { return m_size; }
Gfx::IntRect rect() const { return { {}, m_size }; }
void add_layer(NonnullRefPtr<Layer>);
@ -70,10 +70,10 @@ public:
void layer_did_modify_bitmap(Badge<Layer>, Layer const&);
void layer_did_modify_properties(Badge<Layer>, Layer const&);
size_t index_of(const Layer&) const;
size_t index_of(Layer const&) const;
private:
explicit Image(const Gfx::IntSize&);
explicit Image(Gfx::IntSize const&);
static RefPtr<Image> create_from_pixel_paint_file(String const& file_path);

View File

@ -97,12 +97,12 @@ void ImageEditor::paint_event(GUI::PaintEvent& event)
}
}
Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(const Layer& layer, const Gfx::IntRect& layer_rect) const
Gfx::FloatRect ImageEditor::layer_rect_to_editor_rect(Layer const& layer, Gfx::IntRect const& layer_rect) const
{
return image_rect_to_editor_rect(layer_rect.translated(layer.location()));
}
Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(const Gfx::IntRect& image_rect) const
Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(Gfx::IntRect const& image_rect) const
{
Gfx::FloatRect editor_rect;
editor_rect.set_location(image_position_to_editor_position(image_rect.location()));
@ -111,7 +111,7 @@ Gfx::FloatRect ImageEditor::image_rect_to_editor_rect(const Gfx::IntRect& image_
return editor_rect;
}
Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(const Gfx::IntRect& editor_rect) const
Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(Gfx::IntRect const& editor_rect) const
{
Gfx::FloatRect image_rect;
image_rect.set_location(editor_position_to_image_position(editor_rect.location()));
@ -120,12 +120,12 @@ Gfx::FloatRect ImageEditor::editor_rect_to_image_rect(const Gfx::IntRect& editor
return image_rect;
}
Gfx::FloatPoint ImageEditor::layer_position_to_editor_position(const Layer& layer, const Gfx::IntPoint& layer_position) const
Gfx::FloatPoint ImageEditor::layer_position_to_editor_position(Layer const& layer, Gfx::IntPoint const& layer_position) const
{
return image_position_to_editor_position(layer_position.translated(layer.location()));
}
Gfx::FloatPoint ImageEditor::image_position_to_editor_position(const Gfx::IntPoint& image_position) const
Gfx::FloatPoint ImageEditor::image_position_to_editor_position(Gfx::IntPoint const& image_position) const
{
Gfx::FloatPoint editor_position;
editor_position.set_x(m_editor_image_rect.x() + ((float)image_position.x() * m_scale));
@ -133,7 +133,7 @@ Gfx::FloatPoint ImageEditor::image_position_to_editor_position(const Gfx::IntPoi
return editor_position;
}
Gfx::FloatPoint ImageEditor::editor_position_to_image_position(const Gfx::IntPoint& editor_position) const
Gfx::FloatPoint ImageEditor::editor_position_to_image_position(Gfx::IntPoint const& editor_position) const
{
Gfx::FloatPoint image_position;
image_position.set_x(((float)editor_position.x() - m_editor_image_rect.x()) / m_scale);
@ -147,7 +147,7 @@ void ImageEditor::second_paint_event(GUI::PaintEvent& event)
m_active_tool->on_second_paint(*m_active_layer, event);
}
GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(const GUI::MouseEvent& event) const
GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(GUI::MouseEvent const& event) const
{
auto image_position = editor_position_to_image_position(event.position());
return {
@ -160,7 +160,7 @@ GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(const GUI::MouseEv
};
}
GUI::MouseEvent ImageEditor::event_adjusted_for_layer(const GUI::MouseEvent& event, const Layer& layer) const
GUI::MouseEvent ImageEditor::event_adjusted_for_layer(GUI::MouseEvent const& event, Layer const& layer) const
{
auto image_position = editor_position_to_image_position(event.position());
image_position.translate_by(-layer.location().x(), -layer.location().y());
@ -309,7 +309,7 @@ Color ImageEditor::color_for(GUI::MouseButton button) const
VERIFY_NOT_REACHED();
}
Color ImageEditor::color_for(const GUI::MouseEvent& event) const
Color ImageEditor::color_for(GUI::MouseEvent const& event) const
{
if (event.buttons() & GUI::MouseButton::Left)
return m_primary_color;
@ -336,7 +336,7 @@ void ImageEditor::set_secondary_color(Color color)
on_secondary_color_change(color);
}
Layer* ImageEditor::layer_at_editor_position(const Gfx::IntPoint& editor_position)
Layer* ImageEditor::layer_at_editor_position(Gfx::IntPoint const& editor_position)
{
if (!m_image)
return nullptr;
@ -360,7 +360,7 @@ void ImageEditor::clamped_scale(float scale_delta)
m_scale = 100.0f;
}
void ImageEditor::scale_centered_on_position(const Gfx::IntPoint& position, float scale_delta)
void ImageEditor::scale_centered_on_position(Gfx::IntPoint const& position, float scale_delta)
{
auto old_scale = m_scale;
clamped_scale(scale_delta);

View File

@ -24,7 +24,7 @@ class ImageEditor final
public:
virtual ~ImageEditor() override;
const Image* image() const { return m_image; }
Image const* image() const { return m_image; }
Image* image() { return m_image; }
void set_image(RefPtr<Image>);
@ -41,9 +41,9 @@ public:
void layers_did_change();
Layer* layer_at_editor_position(const Gfx::IntPoint&);
Layer* layer_at_editor_position(Gfx::IntPoint const&);
void scale_centered_on_position(const Gfx::IntPoint&, float);
void scale_centered_on_position(Gfx::IntPoint const&, float);
void reset_scale_and_position();
void scale_by(float);
@ -53,7 +53,7 @@ public:
Color secondary_color() const { return m_secondary_color; }
void set_secondary_color(Color);
Color color_for(const GUI::MouseEvent&) const;
Color color_for(GUI::MouseEvent const&) const;
Color color_for(GUI::MouseButton) const;
Function<void(Color)> on_primary_color_change;
@ -61,12 +61,12 @@ public:
Function<void(Layer*)> on_active_layer_change;
Gfx::FloatRect layer_rect_to_editor_rect(const Layer&, const Gfx::IntRect&) const;
Gfx::FloatRect image_rect_to_editor_rect(const Gfx::IntRect&) const;
Gfx::FloatRect editor_rect_to_image_rect(const Gfx::IntRect&) const;
Gfx::FloatPoint layer_position_to_editor_position(const Layer&, const Gfx::IntPoint&) const;
Gfx::FloatPoint image_position_to_editor_position(const Gfx::IntPoint&) const;
Gfx::FloatPoint editor_position_to_image_position(const Gfx::IntPoint&) const;
Gfx::FloatRect layer_rect_to_editor_rect(Layer const&, Gfx::IntRect const&) const;
Gfx::FloatRect image_rect_to_editor_rect(Gfx::IntRect const&) const;
Gfx::FloatRect editor_rect_to_image_rect(Gfx::IntRect const&) const;
Gfx::FloatPoint layer_position_to_editor_position(Layer const&, Gfx::IntPoint const&) const;
Gfx::FloatPoint image_position_to_editor_position(Gfx::IntPoint const&) const;
Gfx::FloatPoint editor_position_to_image_position(Gfx::IntPoint const&) const;
private:
ImageEditor();
@ -85,8 +85,8 @@ private:
virtual void image_did_change() override;
virtual void image_select_layer(Layer*) override;
GUI::MouseEvent event_adjusted_for_layer(const GUI::MouseEvent&, const Layer&) const;
GUI::MouseEvent event_with_pan_and_scale_applied(const GUI::MouseEvent&) const;
GUI::MouseEvent event_adjusted_for_layer(GUI::MouseEvent const&, Layer const&) const;
GUI::MouseEvent event_with_pan_and_scale_applied(GUI::MouseEvent const&) const;
void clamped_scale(float);
void relayout();

View File

@ -10,7 +10,7 @@
namespace PixelPaint {
RefPtr<Layer> Layer::create_with_size(Image& image, const Gfx::IntSize& size, const String& name)
RefPtr<Layer> Layer::create_with_size(Image& image, Gfx::IntSize const& size, String const& name)
{
if (size.is_empty())
return nullptr;
@ -21,7 +21,7 @@ RefPtr<Layer> Layer::create_with_size(Image& image, const Gfx::IntSize& size, co
return adopt_ref(*new Layer(image, size, name));
}
RefPtr<Layer> Layer::create_with_bitmap(Image& image, const Gfx::Bitmap& bitmap, const String& name)
RefPtr<Layer> Layer::create_with_bitmap(Image& image, Gfx::Bitmap const& bitmap, String const& name)
{
if (bitmap.size().is_empty())
return nullptr;
@ -32,7 +32,7 @@ RefPtr<Layer> Layer::create_with_bitmap(Image& image, const Gfx::Bitmap& bitmap,
return adopt_ref(*new Layer(image, bitmap, name));
}
RefPtr<Layer> Layer::create_snapshot(Image& image, const Layer& layer)
RefPtr<Layer> Layer::create_snapshot(Image& image, Layer const& layer)
{
auto snapshot = create_with_bitmap(image, *layer.bitmap().clone(), layer.name());
/*
@ -49,14 +49,14 @@ RefPtr<Layer> Layer::create_snapshot(Image& image, const Layer& layer)
return snapshot;
}
Layer::Layer(Image& image, const Gfx::IntSize& size, const String& name)
Layer::Layer(Image& image, Gfx::IntSize const& size, String const& name)
: m_image(image)
, m_name(name)
{
m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, size);
}
Layer::Layer(Image& image, const Gfx::Bitmap& bitmap, const String& name)
Layer::Layer(Image& image, Gfx::Bitmap const& bitmap, String const& name)
: m_image(image)
, m_name(name)
, m_bitmap(bitmap)
@ -84,7 +84,7 @@ void Layer::set_opacity_percent(int opacity_percent)
m_image.layer_did_modify_properties({}, *this);
}
void Layer::set_name(const String& name)
void Layer::set_name(String const& name)
{
if (m_name == name)
return;

View File

@ -24,24 +24,24 @@ class Layer
AK_MAKE_NONMOVABLE(Layer);
public:
static RefPtr<Layer> create_with_size(Image&, const Gfx::IntSize&, const String& name);
static RefPtr<Layer> create_with_bitmap(Image&, const Gfx::Bitmap&, const String& name);
static RefPtr<Layer> create_snapshot(Image&, const Layer&);
static RefPtr<Layer> create_with_size(Image&, Gfx::IntSize const&, String const& name);
static RefPtr<Layer> create_with_bitmap(Image&, Gfx::Bitmap const&, String const& name);
static RefPtr<Layer> create_snapshot(Image&, Layer const&);
~Layer() { }
const Gfx::IntPoint& location() const { return m_location; }
void set_location(const Gfx::IntPoint& location) { m_location = location; }
Gfx::IntPoint const& location() const { return m_location; }
void set_location(Gfx::IntPoint const& location) { m_location = location; }
const Gfx::Bitmap& bitmap() const { return *m_bitmap; }
Gfx::Bitmap const& bitmap() const { return *m_bitmap; }
Gfx::Bitmap& bitmap() { return *m_bitmap; }
Gfx::IntSize size() const { return bitmap().size(); }
Gfx::IntRect relative_rect() const { return { location(), size() }; }
Gfx::IntRect rect() const { return { {}, size() }; }
const String& name() const { return m_name; }
void set_name(const String&);
String const& name() const { return m_name; }
void set_name(String const&);
void set_bitmap(Gfx::Bitmap& bitmap) { m_bitmap = bitmap; }
@ -57,8 +57,8 @@ public:
void set_opacity_percent(int);
private:
Layer(Image&, const Gfx::IntSize&, const String& name);
Layer(Image&, const Gfx::Bitmap&, const String& name);
Layer(Image&, Gfx::IntSize const&, String const& name);
Layer(Image&, Gfx::Bitmap const&, String const& name);
Image& m_image;

View File

@ -103,7 +103,7 @@ void LayerListWidget::paint_event(GUI::PaintEvent& event)
paint_gadget(m_gadgets[m_moving_gadget_index.value()]);
}
Optional<size_t> LayerListWidget::gadget_at(const Gfx::IntPoint& position)
Optional<size_t> LayerListWidget::gadget_at(Gfx::IntPoint const& position)
{
for (size_t i = 0; i < m_gadgets.size(); ++i) {
if (m_gadgets[i].rect.contains(position))

View File

@ -57,7 +57,7 @@ private:
bool is_moving_gadget() const { return m_moving_gadget_index.has_value(); }
Optional<size_t> gadget_at(const Gfx::IntPoint&);
Optional<size_t> gadget_at(Gfx::IntPoint const&);
Vector<Gadget> m_gadgets;
RefPtr<Image> m_image;

View File

@ -14,7 +14,7 @@
namespace PixelPaint {
static Gfx::IntPoint constrain_line_angle(const Gfx::IntPoint& start_pos, const Gfx::IntPoint& end_pos, float angle_increment)
static Gfx::IntPoint constrain_line_angle(Gfx::IntPoint const& start_pos, Gfx::IntPoint const& end_pos, float angle_increment)
{
float current_angle = atan2f(end_pos.y() - start_pos.y(), end_pos.x() - start_pos.x()) + float { M_PI * 2 };
@ -76,7 +76,7 @@ void LineTool::on_mousemove(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEven
m_editor->update();
}
void LineTool::on_second_paint(const Layer& layer, GUI::PaintEvent& event)
void LineTool::on_second_paint(Layer const& layer, GUI::PaintEvent& event)
{
if (m_drawing_button == GUI::MouseButton::None)
return;

View File

@ -21,7 +21,7 @@ public:
virtual void on_mousemove(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_mouseup(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) override;
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) override;
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
virtual void on_keydown(GUI::KeyEvent&) override;
virtual void on_keyup(GUI::KeyEvent&) override;

View File

@ -23,7 +23,7 @@ RectangleTool::~RectangleTool()
{
}
void RectangleTool::draw_using(GUI::Painter& painter, const Gfx::IntRect& rect)
void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntRect const& rect)
{
switch (m_mode) {
case Mode::Fill:
@ -75,7 +75,7 @@ void RectangleTool::on_mousemove(Layer&, GUI::MouseEvent& event, GUI::MouseEvent
m_editor->update();
}
void RectangleTool::on_second_paint(const Layer& layer, GUI::PaintEvent& event)
void RectangleTool::on_second_paint(Layer const& layer, GUI::PaintEvent& event)
{
if (m_drawing_button == GUI::MouseButton::None)
return;

View File

@ -21,7 +21,7 @@ public:
virtual void on_mousemove(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_mouseup(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override;
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) override;
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) override;
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) override;
virtual void on_keydown(GUI::KeyEvent&) override;
private:
@ -31,7 +31,7 @@ private:
Gradient,
};
void draw_using(GUI::Painter&, const Gfx::IntRect&);
void draw_using(GUI::Painter&, Gfx::IntRect const&);
GUI::MouseButton m_drawing_button { GUI::MouseButton::None };
Gfx::IntPoint m_rectangle_start_position;

View File

@ -23,7 +23,7 @@ public:
virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { }
virtual void on_context_menu(Layer&, GUI::ContextMenuEvent&) { }
virtual void on_tool_button_contextmenu(GUI::ContextMenuEvent&) { }
virtual void on_second_paint(const Layer&, GUI::PaintEvent&) { }
virtual void on_second_paint(Layer const&, GUI::PaintEvent&) { }
virtual void on_keydown(GUI::KeyEvent&) { }
virtual void on_keyup(GUI::KeyEvent&) { }
virtual GUI::Widget* get_properties_widget() { return nullptr; }