/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::Painting { class VideoPaintable final : public PaintableBox { JS_CELL(VideoPaintable, PaintableBox); public: static JS::NonnullGCPtr create(Layout::VideoBox const&); virtual void paint(PaintContext&, PaintPhase) const override; Layout::VideoBox& layout_box(); Layout::VideoBox const& layout_box() const; private: VideoPaintable(Layout::VideoBox const&); virtual bool wants_mouse_events() const override { return true; } virtual DispatchEventOfSameName handle_mouseup(Badge, CSSPixelPoint, unsigned button, unsigned modifiers) override; virtual DispatchEventOfSameName handle_mousemove(Badge, CSSPixelPoint, unsigned buttons, unsigned modifiers) override; void paint_loaded_video_controls(PaintContext&, HTML::HTMLVideoElement const&, DevicePixelRect video_rect, Optional const& mouse_position) const; DevicePixelRect paint_control_bar_playback_button(PaintContext&, HTML::HTMLVideoElement const&, DevicePixelRect control_box_rect, Optional const& mouse_position) const; DevicePixelRect paint_control_bar_timeline(PaintContext&, HTML::HTMLVideoElement const&, DevicePixelRect control_box_rect, Optional const& mouse_position) const; DevicePixelRect paint_control_bar_timestamp(PaintContext&, HTML::HTMLVideoElement const&, DevicePixelRect control_box_rect) const; void paint_placeholder_video_controls(PaintContext&, DevicePixelRect video_rect, Optional const& mouse_position) const; }; }