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