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/. */ 5 6 #ifndef mozilla_widget_ScrollbarDrawingWin11_h 7 #define mozilla_widget_ScrollbarDrawingWin11_h 8 9 #include "nsITheme.h" 10 #include "nsNativeTheme.h" 11 #include "ScrollbarDrawing.h" 12 #include "ScrollbarDrawingWin.h" 13 14 namespace mozilla::widget { 15 16 class ScrollbarDrawingWin11 final : public ScrollbarDrawingWin { 17 public: ScrollbarDrawingWin11()18 ScrollbarDrawingWin11() : ScrollbarDrawingWin(Kind::Win11) {} 19 virtual ~ScrollbarDrawingWin11() = default; 20 21 ScrollbarSizes GetScrollbarSizes(nsPresContext*, StyleScrollbarWidth, 22 Overlay) override; 23 24 LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*, 25 StyleAppearance aAppearance, 26 nsIFrame* aFrame) override; 27 28 sRGBColor ComputeScrollbarTrackColor(nsIFrame*, const ComputedStyle&, 29 const EventStates& aDocumentState, 30 const Colors&) override; 31 sRGBColor ComputeScrollbarThumbColor(nsIFrame*, const ComputedStyle&, 32 const EventStates& aElementState, 33 const EventStates& aDocumentState, 34 const Colors&) override; 35 36 // Returned colors are button, arrow. 37 std::pair<sRGBColor, sRGBColor> ComputeScrollbarButtonColors( 38 nsIFrame*, StyleAppearance, const ComputedStyle&, 39 const EventStates& aElementState, const EventStates& aDocumentState, 40 const Colors&) override; 41 42 bool PaintScrollbarButton(DrawTarget&, StyleAppearance, 43 const LayoutDeviceRect&, nsIFrame*, 44 const ComputedStyle&, 45 const EventStates& aElementState, 46 const EventStates& aDocumentState, const Colors&, 47 const DPIRatio&) override; 48 49 template <typename PaintBackendData> 50 bool DoPaintScrollbarThumb(PaintBackendData&, const LayoutDeviceRect&, 51 bool aHorizontal, nsIFrame*, const ComputedStyle&, 52 const EventStates& aElementState, 53 const EventStates& aDocumentState, const Colors&, 54 const DPIRatio&); 55 bool PaintScrollbarThumb(DrawTarget&, const LayoutDeviceRect&, 56 bool aHorizontal, nsIFrame*, const ComputedStyle&, 57 const EventStates& aElementState, 58 const EventStates& aDocumentState, const Colors&, 59 const DPIRatio&) override; 60 bool PaintScrollbarThumb(WebRenderBackendData&, const LayoutDeviceRect&, 61 bool aHorizontal, nsIFrame*, const ComputedStyle&, 62 const EventStates& aElementState, 63 const EventStates& aDocumentState, const Colors&, 64 const DPIRatio&) override; 65 }; 66 67 } // namespace mozilla::widget 68 69 #endif 70