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 ScrollbarSizes
GetScrollbarSizes(nsPresContext
*, StyleScrollbarWidth
,
24 LayoutDeviceIntSize
GetMinimumWidgetSize(nsPresContext
*,
25 StyleAppearance aAppearance
,
26 nsIFrame
* aFrame
) override
;
28 sRGBColor
ComputeScrollbarTrackColor(nsIFrame
*, const ComputedStyle
&,
29 const DocumentState
& aDocumentState
,
30 const Colors
&) override
;
31 sRGBColor
ComputeScrollbarThumbColor(nsIFrame
*, const ComputedStyle
&,
32 const ElementState
& aElementState
,
33 const DocumentState
& aDocumentState
,
34 const Colors
&) override
;
36 // Returned colors are button, arrow.
37 std::pair
<sRGBColor
, sRGBColor
> ComputeScrollbarButtonColors(
38 nsIFrame
*, StyleAppearance
, const ComputedStyle
&,
39 const ElementState
& aElementState
, const DocumentState
& aDocumentState
,
40 const Colors
&) override
;
42 bool PaintScrollbarButton(DrawTarget
&, StyleAppearance
,
43 const LayoutDeviceRect
&, ScrollbarKind
, nsIFrame
*,
45 const ElementState
& aElementState
,
46 const DocumentState
& aDocumentState
, const Colors
&,
47 const DPIRatio
&) override
;
49 template <typename PaintBackendData
>
50 bool DoPaintScrollbarThumb(PaintBackendData
&, const LayoutDeviceRect
&,
51 ScrollbarKind
, nsIFrame
*, const ComputedStyle
&,
52 const ElementState
& aElementState
,
53 const DocumentState
& aDocumentState
, const Colors
&,
55 bool PaintScrollbarThumb(DrawTarget
&, const LayoutDeviceRect
&, ScrollbarKind
,
56 nsIFrame
*, const ComputedStyle
&,
57 const ElementState
& aElementState
,
58 const DocumentState
& aDocumentState
, const Colors
&,
59 const DPIRatio
&) override
;
60 bool PaintScrollbarThumb(WebRenderBackendData
&, const LayoutDeviceRect
&,
61 ScrollbarKind
, nsIFrame
*, const ComputedStyle
&,
62 const ElementState
& aElementState
,
63 const DocumentState
& aDocumentState
, const Colors
&,
64 const DPIRatio
&) override
;
67 } // namespace mozilla::widget