mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 18:30:27 +00:00
Instead of copying the layout node's text, retrieve the text from the layout node directly.
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/TextNode.h>
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
class TextPaintable final : public Paintable {
|
|
GC_CELL(TextPaintable, Paintable);
|
|
GC_DECLARE_ALLOCATOR(TextPaintable);
|
|
|
|
public:
|
|
static GC::Ref<TextPaintable> create(Layout::TextNode const&);
|
|
|
|
Layout::TextNode const& layout_node() const { return static_cast<Layout::TextNode const&>(Paintable::layout_node()); }
|
|
|
|
virtual bool wants_mouse_events() const override;
|
|
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
|
|
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
|
|
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
|
|
|
|
private:
|
|
virtual bool is_text_paintable() const override { return true; }
|
|
|
|
TextPaintable(Layout::TextNode const&);
|
|
};
|
|
|
|
}
|