michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIScreen.idl" michael@0: michael@0: [scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)] michael@0: interface nsIScreenManager : nsISupports michael@0: { michael@0: // michael@0: // Returns the screen that contains the rectangle. If the rect overlaps michael@0: // multiple screens, it picks the screen with the greatest area of intersection. michael@0: // michael@0: // The coordinates are in pixels (not twips) and in screen coordinates. michael@0: // michael@0: nsIScreen screenForRect ( in long left, in long top, in long width, in long height ) ; michael@0: michael@0: // The screen with the menubar/taskbar. This shouldn't be needed very michael@0: // often. michael@0: readonly attribute nsIScreen primaryScreen; michael@0: michael@0: // Holds the number of screens that are available michael@0: readonly attribute unsigned long numberOfScreens; michael@0: michael@0: // The default DPI scaling factor of the screen environment (number of michael@0: // screen pixels corresponding to 1 CSS px, at the default zoom level). michael@0: // michael@0: // This is currently fixed at 1.0 on most platforms, but varies on Windows michael@0: // if the "logical DPI" scaling option in the Display control panel is set michael@0: // to a value other than 100% (e.g. 125% or 150% are increasingly common michael@0: // defaults on laptops with high-dpi screens). See bug 851520. michael@0: // michael@0: // NOTE that on OS X, this does -not- reflect the "backing scale factor" michael@0: // used to support Retina displays, which is a per-display property, michael@0: // not a system-wide scaling factor. The default ratio of CSS pixels to michael@0: // Cocoa points remains 1:1, even on a Retina screen where one Cocoa point michael@0: // corresponds to two device pixels. (This is exposed via other APIs: michael@0: // see window.devicePixelRatio). michael@0: // michael@0: // NOTE also that on Linux, this does -not- currently reflect changes michael@0: // to the system-wide (X11 or Gtk2) DPI value, as Firefox does not yet michael@0: // honor these settings. See bug 798362 and bug 712898. michael@0: readonly attribute float systemDefaultScale; michael@0: michael@0: // Returns the nsIScreen instance for the given native widget pointer; michael@0: // the pointer is specific to the particular widget implementation, michael@0: // and is generally of the same type that NS_NATIVE_WINDOW is. michael@0: [noscript] nsIScreen screenForNativeWidget ( in voidPtr nativeWidget ); michael@0: }; michael@0: michael@0: michael@0: %{ C++ michael@0: michael@0: %}