/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::Painting { class TextPaintable final : public Paintable { JS_CELL(TextPaintable, Paintable); public: static JS::NonnullGCPtr create(Layout::TextNode const&); Layout::TextNode const& layout_node() const { return static_cast(Paintable::layout_node()); } virtual bool wants_mouse_events() const override; virtual DOM::Node* mouse_event_target() const override; virtual DispatchEventOfSameName handle_mousedown(Badge, CSSPixelPoint, unsigned button, unsigned modifiers) override; virtual DispatchEventOfSameName handle_mouseup(Badge, CSSPixelPoint, unsigned button, unsigned modifiers) override; virtual DispatchEventOfSameName handle_mousemove(Badge, CSSPixelPoint, unsigned button, unsigned modifiers) override; private: explicit TextPaintable(Layout::TextNode const&); }; }