CheckBoxPaintable.cpp 918 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGUI/Event.h>
  7. #include <LibWeb/HTML/BrowsingContext.h>
  8. #include <LibWeb/HTML/HTMLImageElement.h>
  9. #include <LibWeb/Layout/CheckBox.h>
  10. #include <LibWeb/Layout/Label.h>
  11. #include <LibWeb/Painting/CheckBoxPaintable.h>
  12. namespace Web::Painting {
  13. JS::NonnullGCPtr<CheckBoxPaintable> CheckBoxPaintable::create(Layout::CheckBox const& layout_box)
  14. {
  15. return layout_box.heap().allocate_without_realm<CheckBoxPaintable>(layout_box);
  16. }
  17. CheckBoxPaintable::CheckBoxPaintable(Layout::CheckBox const& layout_box)
  18. : LabelablePaintable(layout_box)
  19. {
  20. }
  21. Layout::CheckBox const& CheckBoxPaintable::layout_box() const
  22. {
  23. return static_cast<Layout::CheckBox const&>(layout_node());
  24. }
  25. Layout::CheckBox& CheckBoxPaintable::layout_box()
  26. {
  27. return static_cast<Layout::CheckBox&>(layout_node());
  28. }
  29. }