Backed out changeset 3732f69b6d81 (bug 843019) for mochitest-bc failures.
[gecko.git] / widget / nsIScreen.idl
blob3c99585789ecbf37a8f422bdeeecf1f870f31d90
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(D6F13AF4-8ACA-4A10-8687-3F99C3692AC0)]
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 * These report screen dimensions in (screen-specific) device pixels
35 void GetRect(out long left, out long top, out long width, out long height);
36 void GetAvailRect(out long left, out long top, out long width, out long height);
38 /**
39 * And these report in global display pixels
41 void GetRectDisplayPix(out long left, out long top, out long width, out long height);
42 void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height);
44 /**
45 * Locks the minimum brightness of the screen, forcing it to be at
46 * least as bright as a certain brightness level. Each call to this
47 * function must eventually be followed by a corresponding call to
48 * unlockMinimumBrightness, with the same brightness level.
50 * @param brightness A brightness level, one of the above constants.
52 void lockMinimumBrightness(in unsigned long brightness);
54 /**
55 * Releases a lock on the screen brightness. This must be called
56 * (eventually) after a corresponding call to lockMinimumBrightness.
58 * @param brightness A brightness level, one of the above constants.
60 void unlockMinimumBrightness(in unsigned long brightness);
62 readonly attribute long pixelDepth;
63 readonly attribute long colorDepth;
64 /**
65 * Get/set the screen rotation, on platforms that support changing
66 * screen rotation.
68 attribute unsigned long rotation;
70 /**
71 * The number of device pixels per screen point in HiDPI mode.
72 * Returns 1.0 if HiDPI mode is disabled or unsupported.
74 readonly attribute double contentsScaleFactor;