Bumping manifests a=b2g-bump
[gecko.git] / widget / nsIScreen.idl
blob104cd9f9f7cc2666957ffa3159ad9fd6f5c90df5
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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 #include "nsISupports.idl"
9 [scriptable, uuid(826e80c8-d70f-42e2-8aa9-82c05f2a370a)]
10 interface nsIScreen : nsISupports
12 /**
13 * Levels of brightness for the screen, from off to full brightness.
15 const unsigned long BRIGHTNESS_DIM = 0;
16 const unsigned long BRIGHTNESS_FULL = 1;
18 /* The number of different brightness levels */
19 const unsigned long BRIGHTNESS_LEVELS = 2;
21 /**
22 * Allowable screen rotations, when the underlying widget toolkit
23 * supports rotating the screen.
25 * ROTATION_0_DEG is the default, unrotated configuration.
27 const unsigned long ROTATION_0_DEG = 0;
28 const unsigned long ROTATION_90_DEG = 1;
29 const unsigned long ROTATION_180_DEG = 2;
30 const unsigned long ROTATION_270_DEG = 3;
32 /**
33 * A unique identifier for this device, useful for requerying
34 * for it via nsIScreenManager.
36 readonly attribute unsigned long id;
38 /**
39 * These report screen dimensions in (screen-specific) device pixels
41 void GetRect(out long left, out long top, out long width, out long height);
42 void GetAvailRect(out long left, out long top, out long width, out long height);
44 /**
45 * And these report in global display pixels
47 void GetRectDisplayPix(out long left, out long top, out long width, out long height);
48 void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height);
50 /**
51 * Locks the minimum brightness of the screen, forcing it to be at
52 * least as bright as a certain brightness level. Each call to this
53 * function must eventually be followed by a corresponding call to
54 * unlockMinimumBrightness, with the same brightness level.
56 * @param brightness A brightness level, one of the above constants.
58 void lockMinimumBrightness(in unsigned long brightness);
60 /**
61 * Releases a lock on the screen brightness. This must be called
62 * (eventually) after a corresponding call to lockMinimumBrightness.
64 * @param brightness A brightness level, one of the above constants.
66 void unlockMinimumBrightness(in unsigned long brightness);
68 readonly attribute long pixelDepth;
69 readonly attribute long colorDepth;
70 /**
71 * Get/set the screen rotation, on platforms that support changing
72 * screen rotation.
74 attribute unsigned long rotation;
76 /**
77 * The number of device pixels per screen point in HiDPI mode.
78 * Returns 1.0 if HiDPI mode is disabled or unsupported.
80 readonly attribute double contentsScaleFactor;