2016-10-03 11:23:23 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: ts=4 sw=4 expandtab:
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04: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/. */
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
#ifndef nsScreenManagerAndroid_h___
|
|
|
|
#define nsScreenManagerAndroid_h___
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2012-01-05 06:12:48 +04:00
|
|
|
#include "nsBaseScreen.h"
|
2010-06-04 00:56:36 +04:00
|
|
|
#include "nsIScreenManager.h"
|
2016-10-03 11:23:23 +03:00
|
|
|
#include "nsRect.h"
|
|
|
|
#include "mozilla/WidgetUtils.h"
|
2010-06-04 00:56:36 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsScreenAndroid final : public nsBaseScreen
|
2010-06-04 00:56:36 +04:00
|
|
|
{
|
|
|
|
public:
|
2016-10-03 11:23:23 +03:00
|
|
|
nsScreenAndroid(DisplayType aDisplayType, nsIntRect aRect);
|
2010-06-04 00:56:36 +04:00
|
|
|
~nsScreenAndroid();
|
|
|
|
|
2015-08-15 05:06:20 +03:00
|
|
|
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;
|
2010-12-22 01:34:29 +03:00
|
|
|
|
2016-10-03 11:23:23 +03:00
|
|
|
uint32_t GetId() const { return mId; };
|
|
|
|
DisplayType GetDisplayType() const { return mDisplayType; }
|
|
|
|
|
|
|
|
void SetDensity(double aDensity) { mDensity = aDensity; }
|
|
|
|
float GetDensity();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint32_t mId;
|
|
|
|
DisplayType mDisplayType;
|
|
|
|
nsIntRect mRect;
|
|
|
|
float mDensity;
|
2010-06-04 00:56:36 +04:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsScreenManagerAndroid final : public nsIScreenManager
|
2010-06-04 00:56:36 +04:00
|
|
|
{
|
2014-08-26 23:07:59 +04:00
|
|
|
private:
|
|
|
|
~nsScreenManagerAndroid();
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
public:
|
2016-09-23 18:03:00 +03:00
|
|
|
class ScreenManagerHelperSupport;
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
nsScreenManagerAndroid();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISCREENMANAGER
|
|
|
|
|
2017-03-09 14:30:53 +03:00
|
|
|
already_AddRefed<nsScreenAndroid> ScreenForId(uint32_t aId);
|
2016-10-03 11:23:23 +03:00
|
|
|
already_AddRefed<nsScreenAndroid> AddScreen(DisplayType aDisplayType,
|
|
|
|
nsIntRect aRect = nsIntRect());
|
|
|
|
void RemoveScreen(uint32_t aScreenId);
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
protected:
|
2016-10-03 11:23:23 +03:00
|
|
|
nsTArray<RefPtr<nsScreenAndroid>> mScreens;
|
2010-06-04 00:56:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsScreenManagerAndroid_h___ */
|