Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsSpaceManager::BandList Struct Reference

#include <nsSpaceManager.h>

Inheritance diagram for nsSpaceManager::BandList:
Inheritance graph
[legend]
Collaboration diagram for nsSpaceManager::BandList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BandList ()
PRBool IsEmpty () const
BandRectHead () const
BandRectTail () const
void Append (BandRect *aBandRect)
void Clear ()
BandRectNext () const
BandRectPrev () const
void InsertBefore (BandRect *aBandRect)
void InsertAfter (BandRect *aBandRect)
void Remove ()
BandRectSplitVertically (nscoord aBottom)
BandRectSplitHorizontally (nscoord aRight)
PRBool IsOccupiedBy (const nsIFrame *) const
void AddFrame (const nsIFrame *)
void RemoveFrame (const nsIFrame *)
PRBool HasSameFrameList (const BandRect *aBandRect) const
PRInt32 Length () const
 Internal helper function that counts the number of rects in this band including the current band rect.

Public Attributes

nscoord mLeft
nscoord mTop
nscoord mRight
nscoord mBottom
PRInt32 mNumFrames
union
nsSpaceManager::BandRect.__unnamed__ 
PRCList * next
PRCList * prev

Detailed Description

Definition at line 414 of file nsSpaceManager.h.


Constructor & Destructor Documentation


Member Function Documentation

Definition at line 1396 of file nsSpaceManager.cpp.

{
  if (1 == mNumFrames) {
    nsIFrame* f = mFrame;
    mFrames = new nsVoidArray;
    mFrames->AppendElement(f);
  }

  mNumFrames++;
  mFrames->AppendElement((void*)aFrame);
  NS_POSTCONDITION(mFrames->Count() == mNumFrames, "bad frame count");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsSpaceManager::BandList::Append ( BandRect aBandRect) [inline]

Definition at line 423 of file nsSpaceManager.h.

{PR_APPEND_LINK(aBandRect, this);}

Here is the caller graph for this function:

Definition at line 70 of file nsSpaceManager.cpp.

{
  if (!IsEmpty()) {
    BandRect* bandRect = Head();
  
    while (bandRect != this) {
      BandRect* nxt = bandRect->Next();
  
      delete bandRect;
      bandRect = nxt;
    }
  
    PR_INIT_CLIST(this);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1425 of file nsSpaceManager.cpp.

{
  PRBool  result;

  // Check whether they're occupied by the same number of frames
  if (mNumFrames != aBandRect->mNumFrames) {
    result = PR_FALSE;
  } else if (1 == mNumFrames) {
    result = (mFrame == aBandRect->mFrame);
  } else {
    result = PR_TRUE;

    // For each frame occupying this band rect check whether it also occupies
    // aBandRect
    PRInt32 count = mFrames->Count();
    for (PRInt32 i = 0; i < count; i++) {
      nsIFrame* f = (nsIFrame*)mFrames->ElementAt(i);

      if (-1 == aBandRect->mFrames->IndexOf(f)) {
        result = PR_FALSE;
        break;
      }
    }
  }

  return result;
}

Here is the caller graph for this function:

Definition at line 419 of file nsSpaceManager.h.

{return (BandRect*)PR_LIST_HEAD(this);}

Here is the caller graph for this function:

void nsSpaceManager::BandRect::InsertAfter ( BandRect aBandRect) [inline, inherited]

Definition at line 388 of file nsSpaceManager.h.

{PR_INSERT_AFTER(aBandRect, this);}

Here is the caller graph for this function:

void nsSpaceManager::BandRect::InsertBefore ( BandRect aBandRect) [inline, inherited]

Definition at line 387 of file nsSpaceManager.h.

{PR_INSERT_BEFORE(aBandRect, this);}

Here is the caller graph for this function:

Definition at line 418 of file nsSpaceManager.h.

{return PR_CLIST_IS_EMPTY((PRCListStr*)this);}

Here is the caller graph for this function:

Definition at line 1372 of file nsSpaceManager.cpp.

{
  PRBool  result;

  if (1 == mNumFrames) {
    result = (mFrame == aFrame);
  } else {
    PRInt32 count = mFrames->Count();

    result = PR_FALSE;
    for (PRInt32 i = 0; i < count; i++) {
      nsIFrame* f = (nsIFrame*)mFrames->ElementAt(i);

      if (f == aFrame) {
        result = PR_TRUE;
        break;
      }
    }
  }

  return result;
}

Here is the caller graph for this function:

Internal helper function that counts the number of rects in this band including the current band rect.

Definition at line 1458 of file nsSpaceManager.cpp.

{
  PRInt32   len = 1;
  BandRect* bandRect = Next();

  // Because there's a header cell we know we'll either find the next band
  // (which has a different y-offset) or the header cell which has an invalid
  // y-offset
  while (bandRect->mTop == mTop) {
    len++;
    bandRect = bandRect->Next();
  }

  return len;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BandRect* nsSpaceManager::BandRect::Next ( ) const [inline, inherited]

Definition at line 385 of file nsSpaceManager.h.

{return (BandRect*)PR_NEXT_LINK(this);}

Here is the caller graph for this function:

BandRect* nsSpaceManager::BandRect::Prev ( ) const [inline, inherited]

Definition at line 386 of file nsSpaceManager.h.

{return (BandRect*)PR_PREV_LINK(this);}
void nsSpaceManager::BandRect::Remove ( ) [inline, inherited]

Definition at line 389 of file nsSpaceManager.h.

{PR_REMOVE_LINK(this);}

Here is the caller graph for this function:

Definition at line 1410 of file nsSpaceManager.cpp.

{
  NS_PRECONDITION(mNumFrames > 1, "only one frame");
  mFrames->RemoveElement((void*)aFrame);
  mNumFrames--;

  if (1 == mNumFrames) {
    nsIFrame* f = (nsIFrame*)mFrames->ElementAt(0);

    delete mFrames;
    mFrame = f;
  }
}

Here is the caller graph for this function:

Definition at line 1352 of file nsSpaceManager.cpp.

{
  // Allow aRight == mLeft, so we can split off an empty rectangle
  NS_PRECONDITION((aRight >= mLeft) && (aRight < mRight), "bad argument");
  
  // Create a new band rect for the right part
  BandRect* rightBandRect;
                                            
  if (mNumFrames > 1) {
    rightBandRect = new BandRect(aRight, mTop, mRight, mBottom, mFrames);
  } else {
    rightBandRect = new BandRect(aRight, mTop, mRight, mBottom, mFrame);
  }
                                           
  // This band rect becomes the left part, so adjust the right edge
  mRight = aRight;
  return rightBandRect;
}

Here is the caller graph for this function:

Definition at line 1332 of file nsSpaceManager.cpp.

{
  // Allow aBottom == mTop, so we can split off an empty rectangle
  NS_PRECONDITION((aBottom >= mTop) && (aBottom < mBottom), "bad argument");

  // Create a new band rect for the bottom part
  BandRect* bottomBandRect;
                                            
  if (mNumFrames > 1) {
    bottomBandRect = new BandRect(mLeft, aBottom, mRight, mBottom, mFrames);
  } else {
    bottomBandRect = new BandRect(mLeft, aBottom, mRight, mBottom, mFrame);
  }
                                           
  // This band rect becomes the top part, so adjust the bottom edge
  mBottom = aBottom;
  return bottomBandRect;
}

Here is the caller graph for this function:

Definition at line 420 of file nsSpaceManager.h.

{return (BandRect*)PR_LIST_TAIL(this);}

Here is the caller graph for this function:


Member Data Documentation

union { ... } [inherited]

Definition at line 369 of file nsSpaceManager.h.

Definition at line 368 of file nsSpaceManager.h.

Definition at line 370 of file nsSpaceManager.h.

Definition at line 369 of file nsSpaceManager.h.

Definition at line 368 of file nsSpaceManager.h.

PRCList* PRCListStr::next [inherited]

Definition at line 49 of file prclist.h.

PRCList* PRCListStr::prev [inherited]

Definition at line 50 of file prclist.h.


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