Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
nsRecessedBorder Struct Reference
Inheritance diagram for nsRecessedBorder:
Inheritance graph
[legend]
Collaboration diagram for nsRecessedBorder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsRecessedBorder (nscoord aBorderWidth)
voidoperator new (size_t sz, nsPresContext *aContext) CPP_THROW_NEW
void Destroy (nsPresContext *aContext)
nsChangeHint CalcDifference (const nsStyleBorder &aOther) const
void EnsureBorderColors ()
void ClearBorderColors (PRUint8 aSide)
void SetBorderWidth (PRUint8 aSide, nscoord aBorderWidth)
const nsMarginGetBorder () const
nscoord GetBorderWidth (PRUint8 aSide) const
PRUint8 GetBorderStyle (PRUint8 aSide) const
void SetBorderStyle (PRUint8 aSide, PRUint8 aStyle)
void GetBorderColor (PRUint8 aSide, nscolor &aColor, PRBool &aTransparent, PRBool &aForeground) const
void SetBorderColor (PRUint8 aSide, nscolor aColor)
void GetCompositeColors (PRInt32 aIndex, nsBorderColors **aColors) const
void AppendBorderColor (PRInt32 aIndex, nscolor aColor, PRBool aTransparent)
void SetBorderTransparent (PRUint8 aSide)
void SetBorderToForeground (PRUint8 aSide)
void CalcBorderFor (const nsIFrame *aFrame, nsMargin &aBorder) const
void CalcBorderFor (const nsIFrame *aFrame, PRUint8 aSide, nscoord &aWidth) const

Static Public Member Functions

static PRBool IsVisibleStyle (PRUint8 aStyle)

Public Attributes

nsStyleSides mBorderRadius
PRUint8 mFloatEdge
nsBorderColors ** mBorderColors

Protected Attributes

nsMargin mComputedBorder
nsMargin mBorder
PRUint8 mBorderStyle [4]
nscolor mBorderColor [4]

Detailed Description

Definition at line 1168 of file nsImageFrame.cpp.


Constructor & Destructor Documentation

nsRecessedBorder::nsRecessedBorder ( nscoord  aBorderWidth) [inline]

Definition at line 1169 of file nsImageFrame.cpp.

    : nsStyleBorder()
  {
    NS_FOR_CSS_SIDES(side) {
      // Note: use SetBorderColor here because we want to make sure
      // the "special" flags are unset.
      SetBorderColor(side, NS_RGB(0, 0, 0));
      mBorder.side(side) = aBorderWidth;
      // Note: use SetBorderStyle here because we want to affect
      // mComputedBorder
      SetBorderStyle(side, NS_STYLE_BORDER_STYLE_INSET);
    }
  }

Here is the call graph for this function:


Member Function Documentation

void nsStyleBorder::AppendBorderColor ( PRInt32  aIndex,
nscolor  aColor,
PRBool  aTransparent 
) [inline, inherited]

Definition at line 446 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aIndex >= 0 && aIndex <= 3, "bad side for composite border color");
    nsBorderColors* colorEntry = new nsBorderColors(aColor, aTransparent);
    if (!mBorderColors[aIndex])
      mBorderColors[aIndex] = colorEntry;
    else {
      nsBorderColors* last = mBorderColors[aIndex];
      while (last->mNext)
        last = last->mNext;
      last->mNext = colorEntry;
    }
    mBorderStyle[aIndex] &= ~BORDER_COLOR_SPECIAL;
  }

Here is the caller graph for this function:

void nsStyleBorder::CalcBorderFor ( const nsIFrame aFrame,
nsMargin aBorder 
) const [inline, inherited]

Definition at line 476 of file nsStyleStruct.h.

  {
    aBorder = GetBorder();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleBorder::CalcBorderFor ( const nsIFrame aFrame,
PRUint8  aSide,
nscoord aWidth 
) const [inline, inherited]

Definition at line 480 of file nsStyleStruct.h.

                                            {
    aWidth = GetBorderWidth(aSide);
  }

Here is the call graph for this function:

Definition at line 470 of file nsStyleStruct.cpp.

{
  // Note that differences in mBorder don't affect rendering (which should only
  // use mComputedBorder), so don't need to be tested for here.
  if (mComputedBorder == aOther.mComputedBorder && 
      mFloatEdge == aOther.mFloatEdge) {
    // Note that mBorderStyle stores not only the border style but also
    // color-related flags.  Given that we've already done an mComputedBorder
    // comparison, border-style differences can only lead to a VISUAL hint.  So
    // it's OK to just compare the values directly -- if either the actual
    // style or the color flags differ we want to repaint.
    NS_FOR_CSS_SIDES(ix) {
      if (mBorderStyle[ix] != aOther.mBorderStyle[ix] || 
          mBorderColor[ix] != aOther.mBorderColor[ix]) {
        return NS_STYLE_HINT_VISUAL;
      }
    }

    if (mBorderRadius != aOther.mBorderRadius ||
        !mBorderColors != !aOther.mBorderColors) {
      return NS_STYLE_HINT_VISUAL;
    }

    // Note that at this point if mBorderColors is non-null so is
    // aOther.mBorderColors
    if (mBorderColors) {
      NS_FOR_CSS_SIDES(ix) {
        if (!mBorderColors[ix] != !aOther.mBorderColors[ix]) {
          return NS_STYLE_HINT_VISUAL;
        } else if (mBorderColors[ix] && aOther.mBorderColors[ix]) {
          if (!mBorderColors[ix]->Equals(aOther.mBorderColors[ix]))
            return NS_STYLE_HINT_VISUAL;
        }
      }
    }


    return NS_STYLE_HINT_NONE;
  }
  return NS_STYLE_HINT_REFLOW;
}

Here is the call graph for this function:

void nsStyleBorder::ClearBorderColors ( PRUint8  aSide) [inline, inherited]

Definition at line 363 of file nsStyleStruct.h.

                                        {
    if (mBorderColors[aSide]) {
      delete mBorderColors[aSide];
      mBorderColors[aSide] = nsnull;
    }
  }

Here is the caller graph for this function:

void nsStyleBorder::Destroy ( nsPresContext aContext) [inherited]

Definition at line 464 of file nsStyleStruct.cpp.

                                              {
  this->~nsStyleBorder();
  aContext->FreeToShell(sizeof(nsStyleBorder), this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleBorder::EnsureBorderColors ( ) [inline, inherited]

Definition at line 354 of file nsStyleStruct.h.

                            {
    if (!mBorderColors) {
      mBorderColors = new nsBorderColors*[4];
      if (mBorderColors)
        for (PRInt32 i = 0; i < 4; i++)
          mBorderColors[i] = nsnull;
    }
  }

Here is the caller graph for this function:

const nsMargin& nsStyleBorder::GetBorder ( ) const [inline, inherited]

Definition at line 387 of file nsStyleStruct.h.

  {
    return mComputedBorder;
  }

Here is the caller graph for this function:

void nsStyleBorder::GetBorderColor ( PRUint8  aSide,
nscolor aColor,
PRBool aTransparent,
PRBool aForeground 
) const [inline, inherited]

Definition at line 418 of file nsStyleStruct.h.

  {
    aTransparent = aForeground = PR_FALSE;
    NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); 
    if ((mBorderStyle[aSide] & BORDER_COLOR_SPECIAL) == 0)
      aColor = mBorderColor[aSide]; 
    else if (mBorderStyle[aSide] & BORDER_COLOR_FOREGROUND)
      aForeground = PR_TRUE;
    else
      aTransparent = PR_TRUE;
  }

Here is the caller graph for this function:

PRUint8 nsStyleBorder::GetBorderStyle ( PRUint8  aSide) const [inline, inherited]

Definition at line 400 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); 
    return (mBorderStyle[aSide] & BORDER_STYLE_MASK); 
  }

Here is the caller graph for this function:

nscoord nsStyleBorder::GetBorderWidth ( PRUint8  aSide) const [inline, inherited]

Definition at line 395 of file nsStyleStruct.h.

  {
    return mComputedBorder.side(aSide);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleBorder::GetCompositeColors ( PRInt32  aIndex,
nsBorderColors **  aColors 
) const [inline, inherited]

Definition at line 438 of file nsStyleStruct.h.

  {
    if (!mBorderColors)
      *aColors = nsnull;
    else
      *aColors = mBorderColors[aIndex];
  }

Here is the caller graph for this function:

static PRBool nsStyleBorder::IsVisibleStyle ( PRUint8  aStyle) [inline, static, inherited]

Definition at line 372 of file nsStyleStruct.h.

                                               {
    return aStyle != NS_STYLE_BORDER_STYLE_NONE &&
           aStyle != NS_STYLE_BORDER_STYLE_HIDDEN;
  }

Here is the caller graph for this function:

void * nsStyleBorder::operator new ( size_t  sz,
nsPresContext aContext 
) [inherited]

Definition at line 456 of file nsStyleStruct.cpp.

                                                                            {
  void* result = aContext->AllocateFromShell(sz);
  if (result)
    memset(result, 0, sz);
  return result;
}

Here is the call graph for this function:

void nsStyleBorder::SetBorderColor ( PRUint8  aSide,
nscolor  aColor 
) [inline, inherited]

Definition at line 431 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); 
    mBorderColor[aSide] = aColor; 
    mBorderStyle[aSide] &= ~BORDER_COLOR_SPECIAL;
  }

Here is the caller graph for this function:

void nsStyleBorder::SetBorderStyle ( PRUint8  aSide,
PRUint8  aStyle 
) [inline, inherited]

Definition at line 406 of file nsStyleStruct.h.

  {
    NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); 
    mBorderStyle[aSide] &= ~BORDER_STYLE_MASK; 
    mBorderStyle[aSide] |= (aStyle & BORDER_STYLE_MASK);
    if (IsVisibleStyle(aStyle)) {
      mComputedBorder.side(aSide) = mBorder.side(aSide);
    } else {
      mComputedBorder.side(aSide) = 0;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nsStyleBorder::SetBorderToForeground ( PRUint8  aSide) [inline, inherited]

Definition at line 468 of file nsStyleStruct.h.

Here is the caller graph for this function:

void nsStyleBorder::SetBorderTransparent ( PRUint8  aSide) [inline, inherited]

Definition at line 461 of file nsStyleStruct.h.

Here is the caller graph for this function:

void nsStyleBorder::SetBorderWidth ( PRUint8  aSide,
nscoord  aBorderWidth 
) [inline, inherited]

Definition at line 378 of file nsStyleStruct.h.

  {
    mBorder.side(aSide) = aBorderWidth;
    if (IsVisibleStyle(GetBorderStyle(aSide))) {
      mComputedBorder.side(aSide) = aBorderWidth;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

nsMargin nsStyleBorder::mBorder [protected, inherited]

Definition at line 500 of file nsStyleStruct.h.

nscolor nsStyleBorder::mBorderColor[4] [protected, inherited]

Definition at line 503 of file nsStyleStruct.h.

Definition at line 352 of file nsStyleStruct.h.

Definition at line 350 of file nsStyleStruct.h.

PRUint8 nsStyleBorder::mBorderStyle[4] [protected, inherited]

Definition at line 502 of file nsStyleStruct.h.

nsMargin nsStyleBorder::mComputedBorder [protected, inherited]

Definition at line 489 of file nsStyleStruct.h.

Definition at line 351 of file nsStyleStruct.h.


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