widget/nsIScreen.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIScreen.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,75 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +[scriptable, uuid(D6F13AF4-8ACA-4A10-8687-3F99C3692AC0)]
    1.13 +interface nsIScreen : nsISupports
    1.14 +{
    1.15 +  /**
    1.16 +   * Levels of brightness for the screen, from off to full brightness.
    1.17 +   */
    1.18 +  const unsigned long BRIGHTNESS_DIM = 0;
    1.19 +  const unsigned long BRIGHTNESS_FULL = 1;
    1.20 +
    1.21 +  /* The number of different brightness levels */
    1.22 +  const unsigned long BRIGHTNESS_LEVELS = 2;
    1.23 +
    1.24 +  /**
    1.25 +   * Allowable screen rotations, when the underlying widget toolkit
    1.26 +   * supports rotating the screen.
    1.27 +   *
    1.28 +   * ROTATION_0_DEG is the default, unrotated configuration.
    1.29 +   */
    1.30 +  const unsigned long   ROTATION_0_DEG = 0;
    1.31 +  const unsigned long  ROTATION_90_DEG = 1;
    1.32 +  const unsigned long ROTATION_180_DEG = 2;
    1.33 +  const unsigned long ROTATION_270_DEG = 3;
    1.34 +
    1.35 +  /**
    1.36 +   * These report screen dimensions in (screen-specific) device pixels
    1.37 +   */
    1.38 +  void GetRect(out long left, out long top, out long width, out long height);
    1.39 +  void GetAvailRect(out long left, out long top, out long width, out long height);
    1.40 +
    1.41 +  /**
    1.42 +   * And these report in global display pixels
    1.43 +   */
    1.44 +  void GetRectDisplayPix(out long left, out long top, out long width, out long height);
    1.45 +  void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height);
    1.46 +
    1.47 +  /**
    1.48 +   * Locks the minimum brightness of the screen, forcing it to be at
    1.49 +   * least as bright as a certain brightness level. Each call to this
    1.50 +   * function must eventually be followed by a corresponding call to
    1.51 +   * unlockMinimumBrightness, with the same brightness level.
    1.52 +   *
    1.53 +   * @param brightness A brightness level, one of the above constants.
    1.54 +   */
    1.55 +  void lockMinimumBrightness(in unsigned long brightness);
    1.56 +
    1.57 +  /**
    1.58 +   * Releases a lock on the screen brightness. This must be called
    1.59 +   * (eventually) after a corresponding call to lockMinimumBrightness.
    1.60 +   *
    1.61 +   * @param brightness A brightness level, one of the above constants.
    1.62 +   */
    1.63 +  void unlockMinimumBrightness(in unsigned long brightness);
    1.64 +  
    1.65 +  readonly attribute long pixelDepth;
    1.66 +  readonly attribute long colorDepth;
    1.67 +  /**
    1.68 +   * Get/set the screen rotation, on platforms that support changing
    1.69 +   * screen rotation.
    1.70 +   */
    1.71 +  attribute unsigned long rotation;
    1.72 +
    1.73 +  /**
    1.74 +   * The number of device pixels per screen point in HiDPI mode.
    1.75 +   * Returns 1.0 if HiDPI mode is disabled or unsupported.
    1.76 +   */
    1.77 +  readonly attribute double contentsScaleFactor;
    1.78 +};

mercurial