widget/nsIScreenManager.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIScreenManager.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     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 +#include "nsIScreen.idl"
    1.12 +
    1.13 +[scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)]
    1.14 +interface nsIScreenManager : nsISupports
    1.15 +{
    1.16 +    //
    1.17 +    // Returns the screen that contains the rectangle. If the rect overlaps
    1.18 +    // multiple screens, it picks the screen with the greatest area of intersection.
    1.19 +    //
    1.20 +    // The coordinates are in pixels (not twips) and in screen coordinates.
    1.21 +    //
    1.22 +  nsIScreen screenForRect ( in long left, in long top, in long width, in long height ) ;
    1.23 +  
    1.24 +    // The screen with the menubar/taskbar. This shouldn't be needed very
    1.25 +    // often.
    1.26 +  readonly attribute nsIScreen primaryScreen;
    1.27 +  
    1.28 +    // Holds the number of screens that are available
    1.29 +  readonly attribute unsigned long numberOfScreens;
    1.30 +
    1.31 +    // The default DPI scaling factor of the screen environment (number of
    1.32 +    // screen pixels corresponding to 1 CSS px, at the default zoom level).
    1.33 +    //
    1.34 +    // This is currently fixed at 1.0 on most platforms, but varies on Windows
    1.35 +    // if the "logical DPI" scaling option in the Display control panel is set
    1.36 +    // to a value other than 100% (e.g. 125% or 150% are increasingly common
    1.37 +    // defaults on laptops with high-dpi screens). See bug 851520.
    1.38 +    //
    1.39 +    // NOTE that on OS X, this does -not- reflect the "backing scale factor"
    1.40 +    // used to support Retina displays, which is a per-display property,
    1.41 +    // not a system-wide scaling factor. The default ratio of CSS pixels to
    1.42 +    // Cocoa points remains 1:1, even on a Retina screen where one Cocoa point
    1.43 +    // corresponds to two device pixels. (This is exposed via other APIs:
    1.44 +    // see window.devicePixelRatio).
    1.45 +    //
    1.46 +    // NOTE also that on Linux, this does -not- currently reflect changes
    1.47 +    // to the system-wide (X11 or Gtk2) DPI value, as Firefox does not yet
    1.48 +    // honor these settings. See bug 798362 and bug 712898.
    1.49 +  readonly attribute float systemDefaultScale;
    1.50 +
    1.51 +    // Returns the nsIScreen instance for the given native widget pointer;
    1.52 +    // the pointer is specific to the particular widget implementation,
    1.53 +    // and is generally of the same type that NS_NATIVE_WINDOW is.
    1.54 +  [noscript] nsIScreen screenForNativeWidget ( in voidPtr nativeWidget );
    1.55 +};
    1.56 +
    1.57 +
    1.58 +%{ C++
    1.59 +
    1.60 +%}

mercurial