Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nsScreenManagerWin Class Reference

#include <nsScreenManagerWin.h>

Inheritance diagram for nsScreenManagerWin:
Inheritance graph
Collaboration diagram for nsScreenManagerWin:
Collaboration graph

List of all members.

Public Member Functions

 nsScreenManagerWin ()
 ~nsScreenManagerWin ()
nsIScreen screenForRect (in long left, in long top, in long width, in long height)

Public Attributes

readonly attribute nsIScreen primaryScreen
readonly attribute unsigned long numberOfScreens

Private Member Functions

nsIScreenCreateNewScreenObject (void *inScreen)

Private Attributes

PRBool mHasMultiMonitorAPIs
PRUint32 mNumberOfScreens
FARPROC mGetMonitorInfoProc
FARPROC mMonitorFromRectProc
FARPROC mEnumDisplayMonitorsProc
nsAutoVoidArray mScreenList

Detailed Description

Definition at line 52 of file nsScreenManagerWin.h.

Constructor & Destructor Documentation

Definition at line 81 of file nsScreenManagerWin.cpp.

  : mHasMultiMonitorAPIs(PR_FALSE), mNumberOfScreens(0),
    mGetMonitorInfoProc(nsnull), mMonitorFromRectProc(nsnull),
  // figure out if we can call the multiple monitor APIs that are only
  // available on Win98/2000.
  HMODULE lib = GetModuleHandle("user32.dll");
  if ( lib ) {
    mGetMonitorInfoProc = GetProcAddress ( lib, GetMonitorInfoQuoted );
    mMonitorFromRectProc = GetProcAddress ( lib, "MonitorFromRect" );
    mEnumDisplayMonitorsProc = GetProcAddress ( lib, "EnumDisplayMonitors" );
    if ( mGetMonitorInfoProc && mMonitorFromRectProc && mEnumDisplayMonitorsProc )
      mHasMultiMonitorAPIs = PR_TRUE;

  // nothing else to do. I guess we could cache a bunch of information
  // here, but we want to ask the device at runtime in case anything
  // has changed.

Definition at line 103 of file nsScreenManagerWin.cpp.

  // walk our list of cached screens and delete them.
  for ( int i = 0; i < mScreenList.Count(); ++i ) {
    ScreenListItem* item = NS_REINTERPRET_CAST(ScreenListItem*, mScreenList[i]);
    delete item;

Member Function Documentation

Definition at line 126 of file nsScreenManagerWin.cpp.

  nsIScreen* retScreen = nsnull;
  // look through our screen list, hoping to find it. If it's not there,
  // add it and return the new one.
  for ( int i = 0; i < mScreenList.Count(); ++i ) {
    ScreenListItem* curr = NS_REINTERPRET_CAST(ScreenListItem*, mScreenList[i]);
    if ( inScreen == curr->mMon ) {
      NS_IF_ADDREF(retScreen = curr->mScreen.get());
      return retScreen;
  } // for each screen.
  retScreen = new nsScreenWin(inScreen);
  ScreenListItem* listItem = new ScreenListItem ( (HMONITOR)inScreen, retScreen );
  mScreenList.AppendElement ( listItem );

  return retScreen;

Here is the call graph for this function:

nsIScreen nsIScreenManager::screenForRect ( in long  left,
in long  top,
in long  width,
in long  height 
) [inherited]

Member Data Documentation

Definition at line 72 of file nsScreenManagerWin.h.

Definition at line 70 of file nsScreenManagerWin.h.

Definition at line 65 of file nsScreenManagerWin.h.

Definition at line 71 of file nsScreenManagerWin.h.

Definition at line 66 of file nsScreenManagerWin.h.

nsAutoVoidArray nsScreenManagerWin::mScreenList [private]

Definition at line 75 of file nsScreenManagerWin.h.

readonly attribute unsigned long nsIScreenManager::numberOfScreens [inherited]

Definition at line 59 of file nsIScreenManager.idl.

Definition at line 56 of file nsIScreenManager.idl.

The documentation for this class was generated from the following files: