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