1 /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_widget_ScrollbarDrawingWin11_h
7 #define mozilla_widget_ScrollbarDrawingWin11_h
10 #include "nsNativeTheme.h"
11 #include "ScrollbarDrawing.h"
12 #include "ScrollbarDrawingWin.h"
14 namespace mozilla::widget
{
16 class ScrollbarDrawingWin11 final
: public ScrollbarDrawingWin
{
18 ScrollbarDrawingWin11() : ScrollbarDrawingWin(Kind::Win11
) {}
19 virtual ~ScrollbarDrawingWin11() = default;
21 LayoutDeviceIntSize
GetMinimumWidgetSize(nsPresContext
*,
22 StyleAppearance aAppearance
,
23 nsIFrame
* aFrame
) override
;
25 sRGBColor
ComputeScrollbarTrackColor(nsIFrame
*, const ComputedStyle
&,
26 const DocumentState
& aDocumentState
,
27 const Colors
&) override
;
28 sRGBColor
ComputeScrollbarThumbColor(nsIFrame
*, const ComputedStyle
&,
29 const ElementState
& aElementState
,
30 const DocumentState
& aDocumentState
,
31 const Colors
&) override
;
33 // Returned colors are button, arrow.
34 std::pair
<sRGBColor
, sRGBColor
> ComputeScrollbarButtonColors(
35 nsIFrame
*, StyleAppearance
, const ComputedStyle
&,
36 const ElementState
& aElementState
, const DocumentState
& aDocumentState
,
37 const Colors
&) override
;
39 bool PaintScrollbarButton(DrawTarget
&, StyleAppearance
,
40 const LayoutDeviceRect
&, ScrollbarKind
, nsIFrame
*,
42 const ElementState
& aElementState
,
43 const DocumentState
& aDocumentState
, const Colors
&,
44 const DPIRatio
&) override
;
46 template <typename PaintBackendData
>
47 bool DoPaintScrollbarThumb(PaintBackendData
&, const LayoutDeviceRect
&,
48 ScrollbarKind
, nsIFrame
*, const ComputedStyle
&,
49 const ElementState
& aElementState
,
50 const DocumentState
& aDocumentState
, const Colors
&,
52 bool PaintScrollbarThumb(DrawTarget
&, const LayoutDeviceRect
&, ScrollbarKind
,
53 nsIFrame
*, const ComputedStyle
&,
54 const ElementState
& aElementState
,
55 const DocumentState
& aDocumentState
, const Colors
&,
56 const DPIRatio
&) override
;
57 bool PaintScrollbarThumb(WebRenderBackendData
&, const LayoutDeviceRect
&,
58 ScrollbarKind
, nsIFrame
*, const ComputedStyle
&,
59 const ElementState
& aElementState
,
60 const DocumentState
& aDocumentState
, const Colors
&,
61 const DPIRatio
&) override
;
63 void RecomputeScrollbarParams() override
;
66 } // namespace mozilla::widget