Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
[gecko.git] / widget / ScreenProxy.h
blob756cc6c1a36d5c8f8dd9ee60ac2a6f5400e3fdd3
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
2 /* vim: set sw=4 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_widget_ScreenProxy_h
8 #define mozilla_widget_ScreenProxy_h
10 #include "nsBaseScreen.h"
11 #include "mozilla/dom/PScreenManagerChild.h"
12 #include "mozilla/dom/TabChild.h"
14 class nsScreenManagerProxy;
16 namespace mozilla {
17 namespace widget {
19 class ScreenProxy : public nsBaseScreen
21 public:
22 ScreenProxy(nsScreenManagerProxy* aScreenManager,
23 mozilla::dom::ScreenDetails aDetails);
24 ~ScreenProxy() {};
26 NS_IMETHOD GetId(uint32_t* aId) MOZ_OVERRIDE;
28 NS_IMETHOD GetRect(int32_t* aLeft,
29 int32_t* aTop,
30 int32_t* aWidth,
31 int32_t* aHeight) MOZ_OVERRIDE;
32 NS_IMETHOD GetRectDisplayPix(int32_t* aLeft,
33 int32_t* aTop,
34 int32_t* aWidth,
35 int32_t* aHeight) MOZ_OVERRIDE;
36 NS_IMETHOD GetAvailRect(int32_t* aLeft,
37 int32_t* aTop,
38 int32_t* aWidth,
39 int32_t* aHeight) MOZ_OVERRIDE;
40 NS_IMETHOD GetAvailRectDisplayPix(int32_t* aLeft,
41 int32_t* aTop,
42 int32_t* aWidth,
43 int32_t* aHeight) MOZ_OVERRIDE;
44 NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) MOZ_OVERRIDE;
45 NS_IMETHOD GetColorDepth(int32_t* aColorDepth) MOZ_OVERRIDE;
47 private:
49 void PopulateByDetails(mozilla::dom::ScreenDetails aDetails);
50 bool EnsureCacheIsValid();
51 void InvalidateCacheOnNextTick();
52 void InvalidateCache();
54 double mContentsScaleFactor;
55 nsRefPtr<nsScreenManagerProxy> mScreenManager;
56 uint32_t mId;
57 int32_t mPixelDepth;
58 int32_t mColorDepth;
59 nsIntRect mRect;
60 nsIntRect mRectDisplayPix;
61 nsIntRect mAvailRect;
62 nsIntRect mAvailRectDisplayPix;
63 bool mCacheValid;
64 bool mCacheWillInvalidate;
67 } // namespace widget
68 } // namespace mozilla
69 #endif