Autogenerated with:
cp dom/.clang-format widget/ && mach format widget/**.{cpp,h,mm}
Manual changes:
* Had to add a manual override in nsWaylandDisplay.h /
DMABufFormats.cpp to include mozwayland before protocols.
* Missing includes in nsWindowWayland/X11.h / nsDragService.
* nsFilePicker missed an nsWindow forward declaration.
* Various overrides in widget/windows because windows headers are order
dependent.
Differential Revision: https://phabricator.services.mozilla.com/D311688
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* 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/. */
|
|
|
|
#ifndef mozilla_widget_gtk_ScreenHelperGTK_h
|
|
#define mozilla_widget_gtk_ScreenHelperGTK_h
|
|
|
|
#include "gdk/gdk.h"
|
|
#include "mozilla/widget/ScreenManager.h"
|
|
#ifdef MOZ_WAYLAND
|
|
# include "nsWaylandDisplay.h"
|
|
#endif
|
|
|
|
class nsWindow;
|
|
|
|
namespace mozilla::widget {
|
|
class ScreenGetterGtk;
|
|
|
|
class ScreenHelperGTK final : public ScreenManager::Helper {
|
|
public:
|
|
ScreenHelperGTK();
|
|
~ScreenHelperGTK();
|
|
|
|
static int GetMonitorCount();
|
|
static gint GetGTKMonitorScaleFactor(gint aMonitorNum = 0);
|
|
static float GetGTKMonitorFractionalScaleFactor(gint aMonitorNum = 0);
|
|
static RefPtr<widget::Screen> GetScreenForWindow(nsWindow* aWindow);
|
|
|
|
static void RequestRefreshScreens(bool aInitialRefresh = false);
|
|
static int GetLastSerial() { return gLastSerial; }
|
|
#ifdef MOZ_WAYLAND
|
|
static void ScreensPrefChanged(const char* aPrefIgnored, void* aDataIgnored);
|
|
#endif
|
|
private:
|
|
static GdkWindow* sRootWindow;
|
|
static StaticRefPtr<ScreenGetterGtk> gLastScreenGetter;
|
|
static int gLastSerial;
|
|
};
|
|
|
|
} // namespace mozilla::widget
|
|
|
|
#endif // mozilla_widget_gtk_ScreenHelperGTK_h
|