Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
BCCornerInfo Struct Reference

List of all members.

Public Member Functions

 BCCornerInfo ()
void Set (PRUint8 aSide, BCCellBorder border)
void Update (PRUint8 aSide, BCCellBorder border)

Public Attributes

nscolor ownerColor
PRUint16 ownerWidth
PRUint16 subWidth
PRUint32 ownerSide:2
PRUint32 ownerElem:3
PRUint32 ownerStyle:8
PRUint32 subSide:2
PRUint32 subElem:3
PRUint32 subStyle:8
PRUint32 hasDashDot:1
PRUint32 numSegs:3
PRUint32 bevel:1
PRUint32 unused:1

Detailed Description

Definition at line 5485 of file nsTableFrame.cpp.


Constructor & Destructor Documentation


Member Function Documentation

void BCCornerInfo::Set ( PRUint8  aSide,
BCCellBorder  border 
)

Definition at line 5514 of file nsTableFrame.cpp.

{
  ownerElem  = aBorder.owner;
  ownerStyle = aBorder.style;
  ownerWidth = aBorder.width;
  ownerColor = aBorder.color;
  ownerSide  = aSide;
  hasDashDot = 0;
  numSegs    = 0;
  if (aBorder.width > 0) {
    numSegs++;
    hasDashDot = (NS_STYLE_BORDER_STYLE_DASHED == aBorder.style) ||
                 (NS_STYLE_BORDER_STYLE_DOTTED == aBorder.style);
  }
  bevel      = 0;
  subWidth   = 0;
  // the following will get set later
  subSide    = ((aSide == NS_SIDE_LEFT) || (aSide == NS_SIDE_RIGHT)) ? NS_SIDE_TOP : NS_SIDE_LEFT; 
  subElem    = eTableOwner;
  subStyle   = NS_STYLE_BORDER_STYLE_SOLID; 
}

Here is the caller graph for this function:

void BCCornerInfo::Update ( PRUint8  aSide,
BCCellBorder  border 
)

Definition at line 5538 of file nsTableFrame.cpp.

{
  PRBool existingWins = PR_FALSE;
  if (0xFF == ownerStyle) { // initial value indiating that it hasn't been set yet
    Set(aSide, aBorder);
  }
  else {
    PRBool horizontal = (NS_SIDE_LEFT == aSide) || (NS_SIDE_RIGHT == aSide); // relative to the corner
    BCCellBorder oldBorder, tempBorder;
    oldBorder.owner  = (BCBorderOwner) ownerElem;
    oldBorder.style =  ownerStyle;
    oldBorder.width =  ownerWidth;
    oldBorder.color =  ownerColor;

    PRUint8 oldSide  = ownerSide;
    
    tempBorder = CompareBorders(CELL_CORNER, oldBorder, aBorder, horizontal, &existingWins); 
                         
    ownerElem  = tempBorder.owner;
    ownerStyle = tempBorder.style;
    ownerWidth = tempBorder.width;
    ownerColor = tempBorder.color;
    if (existingWins) { // existing corner is dominant
      if (::Perpendicular(ownerSide, aSide)) {
        // see if the new sub info replaces the old
        BCCellBorder subBorder;
        subBorder.owner = (BCBorderOwner) subElem;
        subBorder.style =  subStyle;
        subBorder.width =  subWidth;
        subBorder.color = 0; // we are not interested in subBorder color
        PRBool firstWins;

        tempBorder = CompareBorders(CELL_CORNER, subBorder, aBorder, horizontal, &firstWins);
        
        subElem  = tempBorder.owner;
        subStyle = tempBorder.style;
        subWidth = tempBorder.width;
        if (!firstWins) {
          subSide = aSide; 
        }
      }
    }
    else { // input args are dominant
      ownerSide = aSide;
      if (::Perpendicular(oldSide, ownerSide)) {
        subElem  = oldBorder.owner;
        subStyle = oldBorder.style;
        subWidth = oldBorder.width;
        subSide  = oldSide;
      }
    }
    if (aBorder.width > 0) {
      numSegs++;
      if (!hasDashDot && ((NS_STYLE_BORDER_STYLE_DASHED == aBorder.style) ||
                          (NS_STYLE_BORDER_STYLE_DOTTED == aBorder.style))) {
        hasDashDot = 1;
      }
    }
  
    // bevel the corner if only two perpendicular non dashed/dotted segments enter the corner
    bevel = (2 == numSegs) && (subWidth > 1) && (0 == hasDashDot);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 5509 of file nsTableFrame.cpp.

Definition at line 5507 of file nsTableFrame.cpp.

Definition at line 5508 of file nsTableFrame.cpp.

Definition at line 5496 of file nsTableFrame.cpp.

Definition at line 5502 of file nsTableFrame.cpp.

Definition at line 5500 of file nsTableFrame.cpp.

Definition at line 5503 of file nsTableFrame.cpp.

Definition at line 5497 of file nsTableFrame.cpp.

Definition at line 5505 of file nsTableFrame.cpp.

Definition at line 5504 of file nsTableFrame.cpp.

Definition at line 5506 of file nsTableFrame.cpp.

Definition at line 5498 of file nsTableFrame.cpp.

Definition at line 5510 of file nsTableFrame.cpp.


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