nsIScreenManager 编辑
widget/public/nsIScreenManager.idl
Scriptable This interface lets you get information about the display screen (or screens) attached to the user's computer. 66 Introduced Gecko 0.9.5 Inherits from: nsISupports
Last changed in Gecko 1.9 (Firefox 3)Implemented by: @mozilla.org/gfx/screenmanager;1
as a service:
var screenManager = Components.classes["@mozilla.org/gfx/screenmanager;1"] .getService(Components.interfaces.nsIScreenManager);
Method overview
nsIScreen screenForNativeWidget( in voidPtr nativeWidget ); Native code only! |
nsIScreen screenForRect( in long left, in long top, in long width, in long height ); |
Attributes
Attribute | Type | Description |
numberOfScreens | unsigned long | The number of screens on the user's computer. Read only. |
primaryScreen |
| The primary display screen; this is the screen with the menu bar (on the Mac) or taskbar or equivalent on Windows or Linux. Read only. |
Methods
Native code only!screenForNativeWidget
Returns the nsIScreen
instance for the native widget pointer. This pointer's definition is specific to the platform's native widget implementation, and is typically of the same type as NS_NATIVE_WINDOW
.
nsIScreen screenForNativeWidget( in voidPtr nativeWidget );
Parameters
nativeWidget
- The native widget for which to obtain an
nsIScreen
instance.
Return value
The nsIScreen
instance for the native widget pointer.
screenForRect()
Returns the nsIScreen
containing the specified rectangle. If the rectangle overlaps multiple screens, the screen containing the majority of the rectangle's area is selected and returned.
The coordinates must be specified using global (screen) coordinates, and are in pixels.
nsIScreen screenForRect( in long left, in long top, in long width, in long height );
Parameters
left
- The left edge of the rectangle.
top
- The top edge of the rectangle.
width
- The width of the rectangle.
height
- The height of the rectangle.
Return value
The nsIScreen
containing the majority of the rectangle's area.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论