1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:17:45 +00:00

LibWeb: Rename Painting::Box => Paintable

Calling this "Box" made it very confusing to look at code that used both
Layout::Box and Painting::Box. Let's try calling it Paintable instead.
This commit is contained in:
Andreas Kling 2022-03-10 11:26:01 +01:00
parent 7af03df4c3
commit f6497b64ac
32 changed files with 64 additions and 64 deletions

View file

@ -11,7 +11,7 @@
#include <LibWeb/Layout/InlineFormattingContext.h>
#include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {
@ -131,9 +131,9 @@ bool BlockContainer::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&
return true;
}
Painting::BoxWithLines const* BlockContainer::paint_box() const
Painting::PaintableWithLines const* BlockContainer::paint_box() const
{
return static_cast<Painting::BoxWithLines const*>(Box::paint_box());
return static_cast<Painting::PaintableWithLines const*>(Box::paint_box());
}
}

View file

@ -31,7 +31,7 @@ public:
const Gfx::FloatPoint& scroll_offset() const { return m_scroll_offset; }
void set_scroll_offset(const Gfx::FloatPoint&);
Painting::BoxWithLines const* paint_box() const;
Painting::PaintableWithLines const* paint_box() const;
private:
virtual bool is_block_container() const final { return true; }

View file

@ -15,7 +15,7 @@
#include <LibWeb/Layout/FormattingContext.h>
#include <LibWeb/Painting/BackgroundPainting.h>
#include <LibWeb/Painting/BorderPainting.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/Painting/ShadowPainting.h>
namespace Web::Layout {
@ -34,7 +34,7 @@ Box::~Box()
{
}
void Box::set_paint_box(OwnPtr<Painting::Box> paint_box)
void Box::set_paint_box(OwnPtr<Painting::Paintable> paint_box)
{
m_paint_box = move(paint_box);
}

View file

@ -20,10 +20,10 @@ struct LineBoxFragmentCoordinate {
class Box : public NodeWithStyleAndBoxModelMetrics {
public:
Painting::Box const* paint_box() const { return m_paint_box.ptr(); }
void set_paint_box(OwnPtr<Painting::Box>);
Painting::Paintable const* paint_box() const { return m_paint_box.ptr(); }
void set_paint_box(OwnPtr<Painting::Paintable>);
OwnPtr<Painting::Box> m_paint_box;
OwnPtr<Painting::Paintable> m_paint_box;
bool is_out_of_flow(FormattingContext const&) const;

View file

@ -12,7 +12,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/Label.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -6,7 +6,7 @@
#include <LibGfx/Painter.h>
#include <LibWeb/Layout/CanvasBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -12,7 +12,7 @@
#include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/Layout/CheckBox.h>
#include <LibWeb/Layout/Label.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -41,10 +41,10 @@ void FormattingState::commit()
// For boxes, transfer all the state needed for painting.
if (is<Layout::Box>(node)) {
auto& box = static_cast<Layout::Box&>(node);
box.set_paint_box([](Layout::Box const& layout_box) -> OwnPtr<Painting::Box> {
box.set_paint_box([](Layout::Box const& layout_box) -> OwnPtr<Painting::Paintable> {
if (is<Layout::BlockContainer>(layout_box))
return Painting::BoxWithLines::create(static_cast<Layout::BlockContainer const&>(layout_box));
return Painting::Box::create(static_cast<Layout::Box const&>(layout_box));
return Painting::PaintableWithLines::create(static_cast<Layout::BlockContainer const&>(layout_box));
return Painting::Paintable::create(static_cast<Layout::Box const&>(layout_box));
}(box));
box.m_paint_box->set_offset(node_state.offset);
box.m_paint_box->set_content_size(node_state.content_width, node_state.content_height);
@ -52,7 +52,7 @@ void FormattingState::commit()
box.m_paint_box->set_containing_line_box_fragment(node_state.containing_line_box_fragment);
if (is<Layout::BlockContainer>(box))
static_cast<Painting::BoxWithLines&>(*box.m_paint_box).set_line_boxes(move(node_state.line_boxes));
static_cast<Painting::PaintableWithLines&>(*box.m_paint_box).set_line_boxes(move(node_state.line_boxes));
}
}
}

View file

@ -10,7 +10,7 @@
#include <LibGfx/Point.h>
#include <LibWeb/Layout/Box.h>
#include <LibWeb/Layout/LineBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {
@ -55,12 +55,12 @@ struct FormattingState {
float border_box_width() const { return border_box_left() + content_width + border_box_right(); }
float border_box_height() const { return border_box_top() + content_height + border_box_bottom(); }
Optional<Painting::Box::OverflowData> overflow_data;
Optional<Painting::Paintable::OverflowData> overflow_data;
Painting::Box::OverflowData& ensure_overflow_data()
Painting::Paintable::OverflowData& ensure_overflow_data()
{
if (!overflow_data.has_value())
overflow_data = Painting::Box::OverflowData {};
overflow_data = Painting::Paintable::OverflowData {};
return *overflow_data;
}

View file

@ -10,7 +10,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/FrameBox.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -11,7 +11,7 @@
#include <LibWeb/CSS/ValueID.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/ImageBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -8,7 +8,7 @@
#include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/Painting/StackingContext.h>
namespace Web::Layout {

View file

@ -14,7 +14,7 @@
#include <LibWeb/Layout/Label.h>
#include <LibWeb/Layout/LabelableNode.h>
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -8,7 +8,7 @@
#include <AK/StringBuilder.h>
#include <LibGfx/Painter.h>
#include <LibWeb/Layout/ListItemMarkerBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -7,7 +7,7 @@
#include <LibGfx/Painter.h>
#include <LibGfx/StylePainter.h>
#include <LibWeb/Layout/Progress.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -11,7 +11,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/Label.h>
#include <LibWeb/Layout/RadioButton.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {

View file

@ -8,7 +8,7 @@
#include <LibGfx/AntiAliasingPainter.h>
#include <LibGfx/Painter.h>
#include <LibWeb/Layout/SVGGeometryBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
#include <LibWeb/SVG/SVGPathElement.h>
#include <LibWeb/SVG/SVGSVGElement.h>

View file

@ -5,7 +5,7 @@
*/
#include <LibWeb/Layout/SVGSVGBox.h>
#include <LibWeb/Painting/Box.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::Layout {