2006-01-11 21:28:25 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2006-01-11 21:27:48 +00:00
|
|
|
|
|
|
|
#ifndef nsScreenGtk_h___
|
|
|
|
#define nsScreenGtk_h___
|
|
|
|
|
2012-01-05 02:12:48 +00:00
|
|
|
#include "nsBaseScreen.h"
|
2006-01-11 21:28:41 +00:00
|
|
|
#include "nsRect.h"
|
2006-09-18 23:37:21 +00:00
|
|
|
#include "gdk/gdk.h"
|
2008-08-06 20:48:55 +00:00
|
|
|
#ifdef MOZ_X11
|
2006-09-18 23:37:21 +00:00
|
|
|
#include <X11/Xlib.h>
|
2006-01-11 21:27:48 +00:00
|
|
|
|
2007-05-02 20:07:32 +00:00
|
|
|
// from Xinerama.h
|
|
|
|
typedef struct {
|
|
|
|
int screen_number;
|
|
|
|
short x_org;
|
|
|
|
short y_org;
|
|
|
|
short width;
|
|
|
|
short height;
|
|
|
|
} XineramaScreenInfo;
|
2008-08-06 20:48:55 +00:00
|
|
|
#endif /* MOZ_X11 */
|
2006-01-11 21:28:44 +00:00
|
|
|
|
2006-01-11 21:27:48 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2012-01-05 02:12:48 +00:00
|
|
|
class nsScreenGtk : public nsBaseScreen
|
2006-01-11 21:27:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-01-11 21:28:41 +00:00
|
|
|
nsScreenGtk();
|
|
|
|
~nsScreenGtk();
|
2006-01-11 21:27:48 +00:00
|
|
|
|
2016-02-26 22:34:11 +00:00
|
|
|
NS_IMETHOD GetId(uint32_t* aId) override;
|
|
|
|
NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop,
|
|
|
|
int32_t* aWidth, int32_t* aHeight) override;
|
|
|
|
NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop,
|
|
|
|
int32_t* aWidth, int32_t* aHeight) override;
|
|
|
|
NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) override;
|
|
|
|
NS_IMETHOD GetColorDepth(int32_t* aColorDepth) override;
|
|
|
|
NS_IMETHOD GetDefaultCSSScaleFactor(double* aScaleFactor) override;
|
2006-01-11 21:27:48 +00:00
|
|
|
|
2008-07-14 03:20:30 +00:00
|
|
|
void Init(GdkWindow *aRootWindow);
|
2008-08-06 20:48:55 +00:00
|
|
|
#ifdef MOZ_X11
|
2006-01-11 21:28:41 +00:00
|
|
|
void Init(XineramaScreenInfo *aScreenInfo);
|
2008-08-06 20:48:55 +00:00
|
|
|
#endif /* MOZ_X11 */
|
2006-01-11 21:28:41 +00:00
|
|
|
|
2015-04-23 16:35:00 +00:00
|
|
|
static gint GetGtkMonitorScaleFactor();
|
|
|
|
static double GetDPIScale();
|
2015-02-10 07:14:00 +00:00
|
|
|
|
2006-01-11 21:28:41 +00:00
|
|
|
private:
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mScreenNum;
|
2009-01-15 03:27:09 +00:00
|
|
|
nsIntRect mRect;
|
|
|
|
nsIntRect mAvailRect;
|
2014-07-14 17:22:26 +00:00
|
|
|
uint32_t mId;
|
2006-01-11 21:27:48 +00:00
|
|
|
};
|
|
|
|
|
2015-02-10 07:14:00 +00:00
|
|
|
#endif // nsScreenGtk_h___
|