|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
|
+ * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
*/
|
|
@@ -16,28 +16,23 @@ namespace Web {
|
|
|
|
|
|
class PaintContext {
|
|
class PaintContext {
|
|
public:
|
|
public:
|
|
- explicit PaintContext(Gfx::Painter& painter, const Palette& palette, const Gfx::IntPoint& scroll_offset)
|
|
|
|
- : m_painter(painter)
|
|
|
|
- , m_palette(palette)
|
|
|
|
- , m_scroll_offset(scroll_offset)
|
|
|
|
- {
|
|
|
|
- }
|
|
|
|
|
|
+ PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint const& scroll_offset);
|
|
|
|
|
|
Gfx::Painter& painter() const { return m_painter; }
|
|
Gfx::Painter& painter() const { return m_painter; }
|
|
- const Palette& palette() const { return m_palette; }
|
|
|
|
|
|
+ Palette const& palette() const { return m_palette; }
|
|
|
|
|
|
bool has_svg_context() const { return m_svg_context.has_value(); }
|
|
bool has_svg_context() const { return m_svg_context.has_value(); }
|
|
- SVGContext& svg_context() { return m_svg_context.value(); }
|
|
|
|
- void set_svg_context(SVGContext context) { m_svg_context = context; }
|
|
|
|
- void clear_svg_context() { m_svg_context.clear(); }
|
|
|
|
|
|
+ SVGContext& svg_context();
|
|
|
|
+ void set_svg_context(SVGContext);
|
|
|
|
+ void clear_svg_context();
|
|
|
|
|
|
bool should_show_line_box_borders() const { return m_should_show_line_box_borders; }
|
|
bool should_show_line_box_borders() const { return m_should_show_line_box_borders; }
|
|
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
|
|
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
|
|
|
|
|
|
Gfx::IntRect viewport_rect() const { return m_viewport_rect; }
|
|
Gfx::IntRect viewport_rect() const { return m_viewport_rect; }
|
|
- void set_viewport_rect(const Gfx::IntRect& rect) { m_viewport_rect = rect; }
|
|
|
|
|
|
+ void set_viewport_rect(Gfx::IntRect const& rect) { m_viewport_rect = rect; }
|
|
|
|
|
|
- const Gfx::IntPoint& scroll_offset() const { return m_scroll_offset; }
|
|
|
|
|
|
+ Gfx::IntPoint scroll_offset() const { return m_scroll_offset; }
|
|
|
|
|
|
bool has_focus() const { return m_focus; }
|
|
bool has_focus() const { return m_focus; }
|
|
void set_has_focus(bool focus) { m_focus = focus; }
|
|
void set_has_focus(bool focus) { m_focus = focus; }
|