1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 10:15:07 +00:00
serenity/Userland/Libraries/LibWeb/Painting/TextPaintable.h
Sam Atkins 3c7bd5a317 LibWeb+WebContent+headless-browser: Use CSSPixels for PageClient events
...and also for hit testing, which is involved in most of them.

Much of this is temporary conversions and other awkwardness, which
should resolve itself as the rest of LibWeb is converted to these new
types. Hopefully. :thousandyakstare:
2022-12-10 12:03:19 +00:00

29 lines
1 KiB
C++

/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Painting/PaintableBox.h>
namespace Web::Painting {
class TextPaintable : public Paintable {
public:
static NonnullRefPtr<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 DOM::Node* mouse_event_target() 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:
explicit TextPaintable(Layout::TextNode const&);
};
}