Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / widget / ScrollbarDrawingCocoa.h
blob840da6c23259e35059b9e0c4c5abb1239e918066
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_widget_ScrollbarDrawingCocoa_h
8 #define mozilla_widget_ScrollbarDrawingCocoa_h
10 #include "ScrollbarDrawing.h"
12 #include "mozilla/Array.h"
14 namespace mozilla::widget {
16 class ScrollbarDrawingCocoa final : public ScrollbarDrawing {
17 public:
18 ScrollbarDrawingCocoa() : ScrollbarDrawing(Kind::Cocoa) {}
19 virtual ~ScrollbarDrawingCocoa() = default;
21 LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*,
22 StyleAppearance aAppearance,
23 nsIFrame* aFrame) override;
25 static CSSIntCoord GetScrollbarSize(StyleScrollbarWidth, bool aOverlay);
27 template <typename PaintBackendData>
28 void DoPaintScrollbarThumb(PaintBackendData&, const LayoutDeviceRect& aRect,
29 ScrollbarKind, nsIFrame* aFrame,
30 const ComputedStyle& aStyle, const ElementState&,
31 const DocumentState&, const Colors&,
32 const DPIRatio&);
33 bool PaintScrollbarThumb(DrawTarget&, const LayoutDeviceRect&, ScrollbarKind,
34 nsIFrame*, const ComputedStyle&, const ElementState&,
35 const DocumentState&, const Colors&,
36 const DPIRatio&) override;
37 bool PaintScrollbarThumb(WebRenderBackendData&, const LayoutDeviceRect&,
38 ScrollbarKind, nsIFrame*, const ComputedStyle&,
39 const ElementState&, const DocumentState&,
40 const Colors&, const DPIRatio&) override;
42 template <typename PaintBackendData>
43 void DoPaintScrollbarTrack(PaintBackendData&, const LayoutDeviceRect&,
44 ScrollbarKind, nsIFrame*, const ComputedStyle&,
45 const DocumentState&, const Colors&,
46 const DPIRatio&);
47 bool PaintScrollbarTrack(DrawTarget&, const LayoutDeviceRect& aRect,
48 ScrollbarKind, nsIFrame* aFrame,
49 const ComputedStyle& aStyle, const DocumentState&,
50 const Colors&, const DPIRatio&) override;
51 bool PaintScrollbarTrack(WebRenderBackendData&, const LayoutDeviceRect& aRect,
52 ScrollbarKind, nsIFrame* aFrame,
53 const ComputedStyle& aStyle, const DocumentState&,
54 const Colors&, const DPIRatio&) override;
56 template <typename PaintBackendData>
57 void DoPaintScrollCorner(PaintBackendData&, const LayoutDeviceRect&,
58 ScrollbarKind, nsIFrame*, const ComputedStyle&,
59 const DocumentState&, const Colors&,
60 const DPIRatio&);
61 bool PaintScrollCorner(DrawTarget&, const LayoutDeviceRect&, ScrollbarKind,
62 nsIFrame*, const ComputedStyle&, const DocumentState&,
63 const Colors&, const DPIRatio&) override;
64 bool PaintScrollCorner(WebRenderBackendData&, const LayoutDeviceRect&,
65 ScrollbarKind, nsIFrame*, const ComputedStyle&,
66 const DocumentState&, const Colors&,
67 const DPIRatio&) override;
69 void RecomputeScrollbarParams() override;
71 bool ShouldDrawScrollbarButtons() override { return false; }
74 } // namespace mozilla::widget
76 #endif