Back to index

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

#include <nsScreenManagerGtk.h>

Inheritance diagram for nsScreenManagerGtk:
Inheritance graph
Collaboration diagram for nsScreenManagerGtk:
Collaboration graph

List of all members.

Public Member Functions

 nsScreenManagerGtk ()
virtual ~nsScreenManagerGtk ()
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

nsresult EnsureInit (void)

Private Attributes

nsCOMPtr< nsISupportsArraymCachedScreenArray
int mNumScreens

Detailed Description

Definition at line 48 of file nsScreenManagerGtk.h.

Constructor & Destructor Documentation

Definition at line 54 of file nsScreenManagerGtk.cpp.

  // 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.
  mNumScreens = 0;

Definition at line 63 of file nsScreenManagerGtk.cpp.

  // nothing to see here.

Member Function Documentation

Definition at line 75 of file nsScreenManagerGtk.cpp.

  if (!mCachedScreenArray) {
    mCachedScreenArray = do_CreateInstance(";1");
    if (!mCachedScreenArray) {
      return NS_ERROR_OUT_OF_MEMORY;
    // get the number of screens via xinerama
    XineramaScreenInfo *screenInfo;
    if (XineramaIsActive(GDK_DISPLAY())) {
      screenInfo = XineramaQueryScreens(GDK_DISPLAY(), &mNumScreens);
    else {
      screenInfo = NULL;
      mNumScreens = 1;
    mNumScreens = 1;
    // there will be < 2 screens if we are either not building with
    // xinerama support or xinerama isn't running on the current
    // display.
    if (mNumScreens < 2) {
      mNumScreens = 1;
      nsRefPtr<nsScreenGtk> screen = new nsScreenGtk();
      if (!screen)
        return NS_ERROR_OUT_OF_MEMORY;


      nsISupports *supportsScreen = screen;
    // If Xinerama is enabled and there's more than one screen, fill
    // in the info for all of the screens.  If that's not the case
    // then nsScreenGTK() defaults to the screen width + height
    else {
#ifdef DEBUG
      printf("Xinerama superpowers activated for %d screens!\n", mNumScreens);
      int i;
      for (i=0; i < mNumScreens; i++) {
        nsRefPtr<nsScreenGtk> screen = new nsScreenGtk();
        if (!screen) {
          return NS_ERROR_OUT_OF_MEMORY;

        // initialize this screen object

        nsISupports *screenSupports = screen;

  return NS_OK;;

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 63 of file nsScreenManagerGtk.h.

Definition at line 65 of file nsScreenManagerGtk.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: