Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
TableBackgroundPainter::TableBackgroundData Struct Reference
Collaboration diagram for TableBackgroundPainter::TableBackgroundData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

PRBool IsVisible () const
 Data is valid & frame is visible.
 TableBackgroundData ()
 Constructor.
 ~TableBackgroundData ()
 Destructor.
void Destroy (nsPresContext *aPresContext)
 Destroys synthesized data.
void Clear ()
 Clear background data.
void SetFull (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, nsIFrame *aFrame)
 Calculate and set all data values to represent aFrame.
void SetFrame (nsIFrame *aFrame)
 Set frame data (mFrame, mRect) but leave style data empty.
void SetData (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext)
 Calculate the style data for mFrame.
PRBool ShouldSetBCBorder ()
 True if need to set border-collapse border; must call SetFull beforehand.
nsresult SetBCBorder (nsMargin &aBorderWidth, TableBackgroundPainter *aPainter)
 Set border-collapse border with aBorderWidth as widths.

Public Attributes

nsIFramemFrame
nsRect mRect
 mRect is the rect of mFrame in the current coordinate system
const nsStyleBackgroundmBackground
const nsStyleBordermBorder

Private Attributes

nsStyleBordermSynthBorder

Detailed Description

Definition at line 176 of file nsTablePainter.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 137 of file nsTablePainter.cpp.

{
  NS_ASSERTION(!mSynthBorder, "must call Destroy before dtor");
  MOZ_COUNT_DTOR(TableBackgroundData);
}

Member Function Documentation

Clear background data.

Definition at line 154 of file nsTablePainter.cpp.

Here is the caller graph for this function:

Destroys synthesized data.

MUST be called before destructor

Parameters:
aPresContext- the pres context

Definition at line 144 of file nsTablePainter.cpp.

{
  NS_PRECONDITION(aPresContext, "null prescontext");
  if (mSynthBorder) {
    mSynthBorder->Destroy(aPresContext);
    mSynthBorder = nsnull;
  }
}

Here is the caller graph for this function:

Data is valid & frame is visible.

Definition at line 184 of file nsTablePainter.h.

{ return mBackground != nsnull; }

Here is the caller graph for this function:

Set border-collapse border with aBorderWidth as widths.

Definition at line 205 of file nsTablePainter.cpp.

{
  NS_PRECONDITION(aPainter, "null painter");
  if (!mSynthBorder) {
    mSynthBorder = new (aPainter->mPresContext)
                        nsStyleBorder(aPainter->mZeroBorder);
    if (!mSynthBorder) return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_FOR_CSS_SIDES(side) {
    mSynthBorder->SetBorderWidth(side, aBorder.side(side));
  }
  
  mBorder = mSynthBorder;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Calculate the style data for mFrame.

Definition at line 171 of file nsTablePainter.cpp.

{
  NS_PRECONDITION(mFrame, "null frame");
  /* IsVisibleForPainting doesn't use aRenderingContext except in nsTextFrames,
     so we're not going to bother translating.*/
  PRBool isVisible;
  nsresult rv = mFrame->IsVisibleForPainting(aPresContext, aRenderingContext,
                                             PR_TRUE, &isVisible);
  if (NS_SUCCEEDED(rv) && isVisible &&
      mFrame->GetStyleVisibility()->IsVisible()) {
    mBackground = mFrame->GetStyleBackground();
    mBorder = mFrame->GetStyleBorder();
  }
}

Here is the caller graph for this function:

Set frame data (mFrame, mRect) but leave style data empty.

Definition at line 163 of file nsTablePainter.cpp.

{
  NS_PRECONDITION(aFrame, "null frame");
  mFrame = aFrame;
  mRect = aFrame->GetRect();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TableBackgroundPainter::TableBackgroundData::SetFull ( nsPresContext aPresContext,
nsIRenderingContext aRenderingContext,
nsIFrame aFrame 
)

Calculate and set all data values to represent aFrame.

Definition at line 188 of file nsTablePainter.cpp.

{
  NS_PRECONDITION(aFrame, "null frame");
  SetFrame(aFrame);
  SetData(aPresContext, aRenderingContext);
}

Here is the caller graph for this function:

True if need to set border-collapse border; must call SetFull beforehand.

Definition at line 198 of file nsTablePainter.cpp.

{
  /* we only need accurate border data when positioning background images*/
  return mBackground && !(mBackground->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 180 of file nsTablePainter.h.

Definition at line 181 of file nsTablePainter.h.

Definition at line 177 of file nsTablePainter.h.

mRect is the rect of mFrame in the current coordinate system

Definition at line 179 of file nsTablePainter.h.

Definition at line 219 of file nsTablePainter.h.


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