InlinePaintable.h 700 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Layout/InlineNode.h>
  8. #include <LibWeb/Painting/PaintableBox.h>
  9. namespace Web::Painting {
  10. class InlinePaintable final : public Paintable {
  11. public:
  12. static NonnullRefPtr<InlinePaintable> create(Layout::InlineNode const&);
  13. virtual void paint(PaintContext&, PaintPhase) const override;
  14. Layout::InlineNode const& layout_node() const;
  15. auto const& box_model() const { return layout_node().box_model(); }
  16. private:
  17. InlinePaintable(Layout::InlineNode const&);
  18. template<typename Callback>
  19. void for_each_fragment(Callback) const;
  20. };
  21. }