mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:07:34 +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:
parent
7af03df4c3
commit
f6497b64ac
32 changed files with 64 additions and 64 deletions
|
@ -5,29 +5,29 @@
|
|||
*/
|
||||
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Painting/Box.h>
|
||||
#include <LibWeb/Painting/Paintable.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
||||
Box::Box(Layout::Box const& layout_box)
|
||||
Paintable::Paintable(Layout::Box const& layout_box)
|
||||
: m_layout_box(layout_box)
|
||||
{
|
||||
}
|
||||
|
||||
Box::~Box()
|
||||
Paintable::~Paintable()
|
||||
{
|
||||
}
|
||||
|
||||
BoxWithLines::BoxWithLines(Layout::BlockContainer const& layout_box)
|
||||
: Box(layout_box)
|
||||
PaintableWithLines::PaintableWithLines(Layout::BlockContainer const& layout_box)
|
||||
: Paintable(layout_box)
|
||||
{
|
||||
}
|
||||
|
||||
BoxWithLines::~BoxWithLines()
|
||||
PaintableWithLines::~PaintableWithLines()
|
||||
{
|
||||
}
|
||||
|
||||
void Box::set_offset(const Gfx::FloatPoint& offset)
|
||||
void Paintable::set_offset(const Gfx::FloatPoint& offset)
|
||||
{
|
||||
if (m_offset == offset)
|
||||
return;
|
||||
|
@ -36,7 +36,7 @@ void Box::set_offset(const Gfx::FloatPoint& offset)
|
|||
const_cast<Layout::Box&>(m_layout_box).did_set_rect();
|
||||
}
|
||||
|
||||
void Box::set_content_size(Gfx::FloatSize const& size)
|
||||
void Paintable::set_content_size(Gfx::FloatSize const& size)
|
||||
{
|
||||
if (m_content_size == size)
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ void Box::set_content_size(Gfx::FloatSize const& size)
|
|||
const_cast<Layout::Box&>(m_layout_box).did_set_rect();
|
||||
}
|
||||
|
||||
Gfx::FloatPoint Box::effective_offset() const
|
||||
Gfx::FloatPoint Paintable::effective_offset() const
|
||||
{
|
||||
if (m_containing_line_box_fragment.has_value()) {
|
||||
auto const& fragment = m_layout_box.containing_block()->paint_box()->line_boxes()[m_containing_line_box_fragment->line_box_index].fragments()[m_containing_line_box_fragment->fragment_index];
|
||||
|
@ -54,7 +54,7 @@ Gfx::FloatPoint Box::effective_offset() const
|
|||
return m_offset;
|
||||
}
|
||||
|
||||
Gfx::FloatRect Box::absolute_rect() const
|
||||
Gfx::FloatRect Paintable::absolute_rect() const
|
||||
{
|
||||
Gfx::FloatRect rect { effective_offset(), content_size() };
|
||||
for (auto* block = m_layout_box.containing_block(); block; block = block->containing_block())
|
||||
|
@ -62,12 +62,12 @@ Gfx::FloatRect Box::absolute_rect() const
|
|||
return rect;
|
||||
}
|
||||
|
||||
void Box::set_containing_line_box_fragment(Optional<Layout::LineBoxFragmentCoordinate> fragment_coordinate)
|
||||
void Paintable::set_containing_line_box_fragment(Optional<Layout::LineBoxFragmentCoordinate> fragment_coordinate)
|
||||
{
|
||||
m_containing_line_box_fragment = fragment_coordinate;
|
||||
}
|
||||
|
||||
Painting::StackingContext* Box::enclosing_stacking_context()
|
||||
Painting::StackingContext* Paintable::enclosing_stacking_context()
|
||||
{
|
||||
for (auto* ancestor = m_layout_box.parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
if (!is<Layout::Box>(ancestor))
|
|
@ -13,14 +13,14 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
class Box {
|
||||
class Paintable {
|
||||
public:
|
||||
static NonnullOwnPtr<Box> create(Layout::Box const& layout_box)
|
||||
static NonnullOwnPtr<Paintable> create(Layout::Box const& layout_box)
|
||||
{
|
||||
return adopt_own(*new Box(layout_box));
|
||||
return adopt_own(*new Paintable(layout_box));
|
||||
}
|
||||
|
||||
virtual ~Box();
|
||||
virtual ~Paintable();
|
||||
|
||||
Layout::Box const& m_layout_box;
|
||||
|
||||
|
@ -110,19 +110,19 @@ public:
|
|||
StackingContext* enclosing_stacking_context();
|
||||
|
||||
protected:
|
||||
explicit Box(Layout::Box const&);
|
||||
explicit Paintable(Layout::Box const&);
|
||||
|
||||
private:
|
||||
OwnPtr<Painting::StackingContext> m_stacking_context;
|
||||
};
|
||||
|
||||
class BoxWithLines : public Box {
|
||||
class PaintableWithLines : public Paintable {
|
||||
public:
|
||||
static NonnullOwnPtr<BoxWithLines> create(Layout::BlockContainer const& block_container)
|
||||
static NonnullOwnPtr<PaintableWithLines> create(Layout::BlockContainer const& block_container)
|
||||
{
|
||||
return adopt_own(*new BoxWithLines(block_container));
|
||||
return adopt_own(*new PaintableWithLines(block_container));
|
||||
}
|
||||
virtual ~BoxWithLines() override;
|
||||
virtual ~PaintableWithLines() override;
|
||||
|
||||
Vector<Layout::LineBox> const& line_boxes() const { return m_line_boxes; }
|
||||
void set_line_boxes(Vector<Layout::LineBox>&& line_boxes) { m_line_boxes = move(line_boxes); }
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
BoxWithLines(Layout::BlockContainer const&);
|
||||
PaintableWithLines(Layout::BlockContainer const&);
|
||||
|
||||
Vector<Layout::LineBox> m_line_boxes;
|
||||
};
|
|
@ -10,7 +10,7 @@
|
|||
#include <LibWeb/Layout/Box.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||
#include <LibWeb/Layout/ReplacedBox.h>
|
||||
#include <LibWeb/Painting/Box.h>
|
||||
#include <LibWeb/Painting/Paintable.h>
|
||||
#include <LibWeb/Painting/StackingContext.h>
|
||||
|
||||
namespace Web::Painting {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue