2021-11-15 15:39:38 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2020-07-30 20:02:02 +03:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
#ifndef mozilla_widget_ScrollbarDrawingGTK_h
|
|
|
|
#define mozilla_widget_ScrollbarDrawingGTK_h
|
2020-07-30 20:02:02 +03:00
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
#include "nsITheme.h"
|
|
|
|
#include "nsNativeTheme.h"
|
|
|
|
#include "ScrollbarDrawing.h"
|
2020-07-30 20:02:02 +03:00
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
namespace mozilla::widget {
|
|
|
|
|
|
|
|
class ScrollbarDrawingGTK final : public ScrollbarDrawing {
|
2020-07-30 20:02:02 +03:00
|
|
|
public:
|
2022-03-04 16:44:51 +03:00
|
|
|
ScrollbarDrawingGTK() : ScrollbarDrawing(Kind::Gtk) {}
|
2021-11-15 15:39:38 +03:00
|
|
|
virtual ~ScrollbarDrawingGTK() = default;
|
2020-07-30 20:02:02 +03:00
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*,
|
|
|
|
StyleAppearance aAppearance,
|
|
|
|
nsIFrame* aFrame) override;
|
2021-10-05 12:40:00 +03:00
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
Maybe<nsITheme::Transparency> GetScrollbarPartTransparency(
|
|
|
|
nsIFrame* aFrame, StyleAppearance aAppearance) override;
|
2020-10-06 00:15:18 +03:00
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
template <typename PaintBackendData>
|
|
|
|
bool DoPaintScrollbarThumb(PaintBackendData&, const LayoutDeviceRect&,
|
2022-05-09 20:09:24 +03:00
|
|
|
ScrollbarKind, nsIFrame*, const ComputedStyle&,
|
2021-11-15 15:39:38 +03:00
|
|
|
const EventStates& aElementState,
|
|
|
|
const EventStates& aDocumentState, const Colors&,
|
|
|
|
const DPIRatio&);
|
2022-05-10 06:47:37 +03:00
|
|
|
bool PaintScrollbarThumb(DrawTarget&, const LayoutDeviceRect&, ScrollbarKind,
|
|
|
|
nsIFrame*, const ComputedStyle& aStyle,
|
2021-02-23 13:49:37 +03:00
|
|
|
const EventStates& aElementState,
|
2021-10-05 12:40:00 +03:00
|
|
|
const EventStates& aDocumentState, const Colors&,
|
2021-11-15 15:39:38 +03:00
|
|
|
const DPIRatio&) override;
|
2021-03-12 17:44:13 +03:00
|
|
|
bool PaintScrollbarThumb(WebRenderBackendData&, const LayoutDeviceRect&,
|
2022-05-09 20:09:24 +03:00
|
|
|
ScrollbarKind, nsIFrame*,
|
2021-02-23 13:49:37 +03:00
|
|
|
const ComputedStyle& aStyle,
|
2020-10-27 18:27:31 +03:00
|
|
|
const EventStates& aElementState,
|
2021-10-05 12:40:00 +03:00
|
|
|
const EventStates& aDocumentState, const Colors&,
|
2021-11-15 15:39:38 +03:00
|
|
|
const DPIRatio&) override;
|
2021-11-15 14:15:56 +03:00
|
|
|
|
2021-11-15 15:39:39 +03:00
|
|
|
void RecomputeScrollbarParams() override;
|
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
bool ShouldDrawScrollbarButtons() override;
|
2020-07-30 20:02:02 +03:00
|
|
|
};
|
|
|
|
|
2021-11-15 15:39:38 +03:00
|
|
|
} // namespace mozilla::widget
|
|
|
|
|
2020-07-30 20:02:02 +03:00
|
|
|
#endif
|