widget/nsIScreen.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     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
    11 {
    12   /**
    13    * Levels of brightness for the screen, from off to full brightness.
    14    */
    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.
    24    *
    25    * ROTATION_0_DEG is the default, unrotated configuration.
    26    */
    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
    34    */
    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
    40    */
    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.
    49    *
    50    * @param brightness A brightness level, one of the above constants.
    51    */
    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.
    57    *
    58    * @param brightness A brightness level, one of the above constants.
    59    */
    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.
    67    */
    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.
    73    */
    74   readonly attribute double contentsScaleFactor;
    75 };

mercurial