Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | [scriptable, uuid(D6F13AF4-8ACA-4A10-8687-3F99C3692AC0)] |
michael@0 | 10 | interface nsIScreen : nsISupports |
michael@0 | 11 | { |
michael@0 | 12 | /** |
michael@0 | 13 | * Levels of brightness for the screen, from off to full brightness. |
michael@0 | 14 | */ |
michael@0 | 15 | const unsigned long BRIGHTNESS_DIM = 0; |
michael@0 | 16 | const unsigned long BRIGHTNESS_FULL = 1; |
michael@0 | 17 | |
michael@0 | 18 | /* The number of different brightness levels */ |
michael@0 | 19 | const unsigned long BRIGHTNESS_LEVELS = 2; |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * Allowable screen rotations, when the underlying widget toolkit |
michael@0 | 23 | * supports rotating the screen. |
michael@0 | 24 | * |
michael@0 | 25 | * ROTATION_0_DEG is the default, unrotated configuration. |
michael@0 | 26 | */ |
michael@0 | 27 | const unsigned long ROTATION_0_DEG = 0; |
michael@0 | 28 | const unsigned long ROTATION_90_DEG = 1; |
michael@0 | 29 | const unsigned long ROTATION_180_DEG = 2; |
michael@0 | 30 | const unsigned long ROTATION_270_DEG = 3; |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * These report screen dimensions in (screen-specific) device pixels |
michael@0 | 34 | */ |
michael@0 | 35 | void GetRect(out long left, out long top, out long width, out long height); |
michael@0 | 36 | void GetAvailRect(out long left, out long top, out long width, out long height); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * And these report in global display pixels |
michael@0 | 40 | */ |
michael@0 | 41 | void GetRectDisplayPix(out long left, out long top, out long width, out long height); |
michael@0 | 42 | void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height); |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Locks the minimum brightness of the screen, forcing it to be at |
michael@0 | 46 | * least as bright as a certain brightness level. Each call to this |
michael@0 | 47 | * function must eventually be followed by a corresponding call to |
michael@0 | 48 | * unlockMinimumBrightness, with the same brightness level. |
michael@0 | 49 | * |
michael@0 | 50 | * @param brightness A brightness level, one of the above constants. |
michael@0 | 51 | */ |
michael@0 | 52 | void lockMinimumBrightness(in unsigned long brightness); |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Releases a lock on the screen brightness. This must be called |
michael@0 | 56 | * (eventually) after a corresponding call to lockMinimumBrightness. |
michael@0 | 57 | * |
michael@0 | 58 | * @param brightness A brightness level, one of the above constants. |
michael@0 | 59 | */ |
michael@0 | 60 | void unlockMinimumBrightness(in unsigned long brightness); |
michael@0 | 61 | |
michael@0 | 62 | readonly attribute long pixelDepth; |
michael@0 | 63 | readonly attribute long colorDepth; |
michael@0 | 64 | /** |
michael@0 | 65 | * Get/set the screen rotation, on platforms that support changing |
michael@0 | 66 | * screen rotation. |
michael@0 | 67 | */ |
michael@0 | 68 | attribute unsigned long rotation; |
michael@0 | 69 | |
michael@0 | 70 | /** |
michael@0 | 71 | * The number of device pixels per screen point in HiDPI mode. |
michael@0 | 72 | * Returns 1.0 if HiDPI mode is disabled or unsupported. |
michael@0 | 73 | */ |
michael@0 | 74 | readonly attribute double contentsScaleFactor; |
michael@0 | 75 | }; |