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 | #include "nsIScreen.idl" |
michael@0 | 9 | |
michael@0 | 10 | [scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)] |
michael@0 | 11 | interface nsIScreenManager : nsISupports |
michael@0 | 12 | { |
michael@0 | 13 | // |
michael@0 | 14 | // Returns the screen that contains the rectangle. If the rect overlaps |
michael@0 | 15 | // multiple screens, it picks the screen with the greatest area of intersection. |
michael@0 | 16 | // |
michael@0 | 17 | // The coordinates are in pixels (not twips) and in screen coordinates. |
michael@0 | 18 | // |
michael@0 | 19 | nsIScreen screenForRect ( in long left, in long top, in long width, in long height ) ; |
michael@0 | 20 | |
michael@0 | 21 | // The screen with the menubar/taskbar. This shouldn't be needed very |
michael@0 | 22 | // often. |
michael@0 | 23 | readonly attribute nsIScreen primaryScreen; |
michael@0 | 24 | |
michael@0 | 25 | // Holds the number of screens that are available |
michael@0 | 26 | readonly attribute unsigned long numberOfScreens; |
michael@0 | 27 | |
michael@0 | 28 | // The default DPI scaling factor of the screen environment (number of |
michael@0 | 29 | // screen pixels corresponding to 1 CSS px, at the default zoom level). |
michael@0 | 30 | // |
michael@0 | 31 | // This is currently fixed at 1.0 on most platforms, but varies on Windows |
michael@0 | 32 | // if the "logical DPI" scaling option in the Display control panel is set |
michael@0 | 33 | // to a value other than 100% (e.g. 125% or 150% are increasingly common |
michael@0 | 34 | // defaults on laptops with high-dpi screens). See bug 851520. |
michael@0 | 35 | // |
michael@0 | 36 | // NOTE that on OS X, this does -not- reflect the "backing scale factor" |
michael@0 | 37 | // used to support Retina displays, which is a per-display property, |
michael@0 | 38 | // not a system-wide scaling factor. The default ratio of CSS pixels to |
michael@0 | 39 | // Cocoa points remains 1:1, even on a Retina screen where one Cocoa point |
michael@0 | 40 | // corresponds to two device pixels. (This is exposed via other APIs: |
michael@0 | 41 | // see window.devicePixelRatio). |
michael@0 | 42 | // |
michael@0 | 43 | // NOTE also that on Linux, this does -not- currently reflect changes |
michael@0 | 44 | // to the system-wide (X11 or Gtk2) DPI value, as Firefox does not yet |
michael@0 | 45 | // honor these settings. See bug 798362 and bug 712898. |
michael@0 | 46 | readonly attribute float systemDefaultScale; |
michael@0 | 47 | |
michael@0 | 48 | // Returns the nsIScreen instance for the given native widget pointer; |
michael@0 | 49 | // the pointer is specific to the particular widget implementation, |
michael@0 | 50 | // and is generally of the same type that NS_NATIVE_WINDOW is. |
michael@0 | 51 | [noscript] nsIScreen screenForNativeWidget ( in voidPtr nativeWidget ); |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | |
michael@0 | 55 | %{ C++ |
michael@0 | 56 | |
michael@0 | 57 | %} |