2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-07-11 04:08:08 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-07-11 04:08:08 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-07-11 04:08:08 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-07-11 04:08:08 +04:00
|
|
|
#ifndef CellData_h__
|
|
|
|
#define CellData_h__
|
|
|
|
|
1999-10-09 03:42:13 +04:00
|
|
|
#include "nsISupports.h"
|
2002-02-19 18:48:28 +03:00
|
|
|
#include "nsCoord.h"
|
1999-10-09 03:42:13 +04:00
|
|
|
|
1998-07-11 04:08:08 +04:00
|
|
|
class nsTableCellFrame;
|
2006-01-14 00:08:17 +03:00
|
|
|
class nsCellMap;
|
|
|
|
class BCCellData;
|
1998-07-11 04:08:08 +04:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
/**
|
|
|
|
* Data stored by nsCellMap to rationalize rowspan and colspan cells.
|
1998-07-11 04:08:08 +04:00
|
|
|
*/
|
|
|
|
class CellData
|
|
|
|
{
|
|
|
|
public:
|
2003-01-19 18:15:22 +03:00
|
|
|
/** Initialize the mOrigCell pointer
|
|
|
|
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
|
|
|
*/
|
2002-02-19 18:48:28 +03:00
|
|
|
void Init(nsTableCellFrame* aCellFrame);
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** does a cell originate from here
|
|
|
|
* @return is true if a cell corresponds to this cellmap entry
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsOrig() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the celldata valid
|
|
|
|
* @return is true if no cell originates and the cell is not spanned by
|
|
|
|
* a row- or colspan. mBits are 0 in this case and mOrigCell is
|
|
|
|
* nsnull
|
|
|
|
*/
|
2002-02-19 18:48:28 +03:00
|
|
|
PRBool IsDead() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the entry spanned by row- or a colspan
|
|
|
|
* @return is true if the entry is spanned by a row- or colspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsSpan() const;
|
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by rowspan
|
|
|
|
* @return is true if the entry is spanned by a rowspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsRowSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the entry spanned by a zero rowspan
|
|
|
|
* zero rowspans span all cells starting from the originating cell down to
|
|
|
|
* the end of the rowgroup or a cell originating in the same column
|
|
|
|
* @return is true if the entry is spanned by a zero rowspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsZeroRowSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** mark the current entry as spanned by a zero rowspan
|
|
|
|
* @param aIsZero if true mark the entry as covered by a zero rowspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
void SetZeroRowSpan(PRBool aIsZero);
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** get the distance from the current entry to the corresponding origin of the rowspan
|
|
|
|
* @return containing the distance in the column to the originating cell
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRUint32 GetRowSpanOffset() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** set the distance from the current entry to the corresponding origin of the rowspan
|
|
|
|
* @param the distance in the column to the originating cell
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
void SetRowSpanOffset(PRUint32 aSpan);
|
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** is the entry spanned by colspan
|
|
|
|
* @return is true if the entry is spanned by a colspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsColSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** is the entry spanned by a zero colspan
|
|
|
|
* zero colspans span all cells starting from the originating cell towards
|
|
|
|
* the end of the colgroup or a cell originating in the same row
|
|
|
|
* or a rowspanned entry
|
|
|
|
* @return is true if the entry is spanned by a zero colspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsZeroColSpan() const;
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** mark the current entry as spanned by a zero colspan
|
|
|
|
* @param aIsZero if true mark the entry as covered by a zero colspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
void SetZeroColSpan(PRBool aIsZero);
|
2003-01-19 18:15:22 +03:00
|
|
|
|
|
|
|
/** get the distance from the current entry to the corresponding origin of the colspan
|
|
|
|
* @return containing the distance in the row to the originating cell
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRUint32 GetColSpanOffset() const;
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** set the distance from the current entry to the corresponding origin of the colspan
|
|
|
|
* @param the distance in the column to the originating cell
|
|
|
|
*/
|
|
|
|
void SetColSpanOffset(PRUint32 aSpan);
|
|
|
|
|
|
|
|
/** is the entry spanned by a row- and a colspan
|
|
|
|
* @return is true if the entry is spanned by a row- and a colspan
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
PRBool IsOverlap() const;
|
|
|
|
|
2003-01-19 18:15:22 +03:00
|
|
|
/** mark the current entry as spanned by a row- and a colspan
|
|
|
|
* @param aOverlap if true mark the entry as covered by a row- and a colspan
|
|
|
|
*/
|
|
|
|
void SetOverlap(PRBool aOverlap);
|
|
|
|
|
|
|
|
/** get the table cell frame for this entry
|
|
|
|
* @return a pointer to the cellframe, this will be nsnull when the entry
|
|
|
|
* is only a spanned entry
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
nsTableCellFrame* GetCellFrame() const;
|
|
|
|
|
2006-01-14 00:08:17 +03:00
|
|
|
private:
|
|
|
|
friend class nsCellMap;
|
|
|
|
friend class BCCellData;
|
|
|
|
|
|
|
|
/** constructor.
|
|
|
|
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
|
|
|
*/
|
|
|
|
CellData(nsTableCellFrame* aOrigCell); // implemented in nsCellMap.cpp
|
|
|
|
|
|
|
|
/** destructor */
|
|
|
|
~CellData(); // implemented in nsCellMap.cpp
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
// this union relies on the assumption that an object (not primitive type) does
|
|
|
|
// not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in effect
|
|
|
|
// and the data does not represent a span. If mSpan is 1, then mBits is in
|
|
|
|
// effect and the data represents a span.
|
2003-02-28 09:35:12 +03:00
|
|
|
// mBits must be an unsigned long because it must match the size of
|
|
|
|
// mOrigCell on both 32- and 64-bit platforms.
|
2000-01-13 08:29:38 +03:00
|
|
|
union {
|
|
|
|
nsTableCellFrame* mOrigCell;
|
2003-02-28 09:35:12 +03:00
|
|
|
unsigned long mBits;
|
2000-01-13 08:29:38 +03:00
|
|
|
};
|
1998-07-11 04:08:08 +04:00
|
|
|
};
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
// Border Collapsing Cell Data
|
|
|
|
enum BCBorderOwner
|
|
|
|
{
|
|
|
|
eTableOwner = 0,
|
|
|
|
eColGroupOwner = 1,
|
|
|
|
eAjaColGroupOwner = 2, // col group to the left
|
|
|
|
eColOwner = 3,
|
|
|
|
eAjaColOwner = 4, // col to the left
|
|
|
|
eRowGroupOwner = 5,
|
|
|
|
eAjaRowGroupOwner = 6, // row group above
|
|
|
|
eRowOwner = 7,
|
|
|
|
eAjaRowOwner = 8, // row above
|
|
|
|
eCellOwner = 9,
|
2002-02-20 16:48:50 +03:00
|
|
|
eAjaCellOwner = 10 // cell to the top or to the left
|
2002-02-19 18:48:28 +03:00
|
|
|
};
|
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
typedef PRUint16 BCPixelSize;
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
// These are the max sizes that are stored. If they are exceeded, then the max is stored and
|
|
|
|
// the actual value is computed when needed.
|
2005-04-07 22:04:38 +04:00
|
|
|
#define MAX_BORDER_WIDTH nscoord(PR_BITMASK(sizeof(BCPixelSize) * 8))
|
|
|
|
|
|
|
|
#define BC_BORDER_TOP_HALF_COORD(p2t,px) NSToCoordRound(float((px) - (px) / 2) * (p2t) )
|
|
|
|
#define BC_BORDER_RIGHT_HALF_COORD(p2t,px) NSToCoordRound(float( (px) / 2) * (p2t) )
|
|
|
|
#define BC_BORDER_BOTTOM_HALF_COORD(p2t,px) NSToCoordRound(float( (px) / 2) * (p2t) )
|
|
|
|
#define BC_BORDER_LEFT_HALF_COORD(p2t,px) NSToCoordRound(float((px) - (px) / 2) * (p2t) )
|
|
|
|
|
|
|
|
#define BC_BORDER_TOP_HALF(px) ((px) - (px) / 2)
|
|
|
|
#define BC_BORDER_RIGHT_HALF(px) ((px) / 2)
|
|
|
|
#define BC_BORDER_BOTTOM_HALF(px) ((px) / 2)
|
|
|
|
#define BC_BORDER_LEFT_HALF(px) ((px) - (px) / 2)
|
2002-02-19 18:48:28 +03:00
|
|
|
|
|
|
|
// BCData stores the top and left border info and the corner connecting the two.
|
|
|
|
class BCData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BCData();
|
|
|
|
|
|
|
|
~BCData();
|
|
|
|
|
|
|
|
nscoord GetLeftEdge(BCBorderOwner& aOwner,
|
|
|
|
PRBool& aStart) const;
|
|
|
|
|
|
|
|
void SetLeftEdge(BCBorderOwner aOwner,
|
|
|
|
nscoord aSize,
|
|
|
|
PRBool aStart);
|
|
|
|
|
|
|
|
nscoord GetTopEdge(BCBorderOwner& aOwner,
|
|
|
|
PRBool& aStart) const;
|
|
|
|
|
|
|
|
void SetTopEdge(BCBorderOwner aOwner,
|
|
|
|
nscoord aSize,
|
|
|
|
PRBool aStart);
|
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
BCPixelSize GetCorner(PRUint8& aCornerOwner,
|
|
|
|
PRPackedBool& aBevel) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
void SetCorner(BCPixelSize aSubSize,
|
|
|
|
PRUint8 aOwner,
|
2002-02-19 18:48:28 +03:00
|
|
|
PRBool aBevel);
|
|
|
|
|
|
|
|
PRBool IsLeftStart() const;
|
|
|
|
|
|
|
|
void SetLeftStart(PRBool aValue);
|
|
|
|
|
|
|
|
PRBool IsTopStart() const;
|
|
|
|
|
|
|
|
void SetTopStart(PRBool aValue);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
2005-04-07 22:04:38 +04:00
|
|
|
BCPixelSize mLeftSize; // size in pixels of left border
|
|
|
|
BCPixelSize mTopSize; // size in pixels of top border
|
|
|
|
BCPixelSize mCornerSubSize; // size of the largest border not in the
|
|
|
|
// dominant plane (for example, if corner is
|
|
|
|
// owned by the segment to its top or bottom,
|
|
|
|
// then the size is the max of the border
|
|
|
|
// sizes of the segments to its left or right.
|
2002-02-19 18:48:28 +03:00
|
|
|
unsigned mLeftOwner: 4; // owner of left border
|
2005-04-07 22:04:38 +04:00
|
|
|
unsigned mTopOwner: 4; // owner of top border
|
2002-02-19 18:48:28 +03:00
|
|
|
unsigned mLeftStart: 1; // set if this is the start of a vertical border segment
|
2005-04-07 22:04:38 +04:00
|
|
|
unsigned mTopStart: 1; // set if this is the start of a horizontal border segment
|
2002-02-19 18:48:28 +03:00
|
|
|
unsigned mCornerSide: 2; // side of the owner of the upper left corner relative to the corner
|
|
|
|
unsigned mCornerBevel: 1; // is the corner beveled (only two segments, perpendicular, not dashed or dotted).
|
|
|
|
};
|
|
|
|
|
|
|
|
// BCCellData entries replace CellData entries in the cell map if the border collapsing model is in
|
|
|
|
// effect. BCData for a row and col entry contains the left and top borders of cell at that row and
|
|
|
|
// col and the corner connecting the two. The right borders of the cells in the last col and the bottom
|
|
|
|
// borders of the last row are stored in separate BCData entries in the cell map.
|
|
|
|
class BCCellData : public CellData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BCCellData(nsTableCellFrame* aOrigCell);
|
|
|
|
~BCCellData();
|
|
|
|
|
|
|
|
BCData mData;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
#define SPAN 0x00000001 // there a row or col span
|
|
|
|
#define ROW_SPAN 0x00000002 // there is a row span
|
|
|
|
#define ROW_SPAN_0 0x00000004 // the row span is 0
|
|
|
|
#define ROW_SPAN_OFFSET 0x0000FFF8 // the row offset to the data containing the original cell
|
2000-02-01 06:23:29 +03:00
|
|
|
#define COL_SPAN 0x00010000 // there is a col span
|
|
|
|
#define COL_SPAN_0 0x00020000 // the col span is 0
|
|
|
|
#define OVERLAP 0x00040000 // there is a row span and col span but no by same cell
|
|
|
|
#define COL_SPAN_OFFSET 0xFFF80000 // the col offset to the data containing the original cell
|
2003-01-19 18:15:22 +03:00
|
|
|
#define ROW_SPAN_SHIFT 3 // num bits to shift to get right justified row span
|
2000-01-13 08:29:38 +03:00
|
|
|
#define COL_SPAN_SHIFT 19 // num bits to shift to get right justified col span
|
|
|
|
|
|
|
|
inline nsTableCellFrame* CellData::GetCellFrame() const
|
|
|
|
{
|
|
|
|
if (SPAN != (SPAN & mBits)) {
|
|
|
|
return mOrigCell;
|
|
|
|
}
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
inline void CellData::Init(nsTableCellFrame* aCellFrame)
|
|
|
|
{
|
|
|
|
mOrigCell = aCellFrame;
|
|
|
|
}
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
inline PRBool CellData::IsOrig() const
|
|
|
|
{
|
2002-02-19 18:48:28 +03:00
|
|
|
return ((nsnull != mOrigCell) && (SPAN != (SPAN & mBits)));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsDead() const
|
|
|
|
{
|
|
|
|
return (0 == mBits);
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsSpan() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsRowSpan() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits)) &&
|
|
|
|
(ROW_SPAN == (ROW_SPAN & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsZeroRowSpan() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits)) &&
|
|
|
|
(ROW_SPAN == (ROW_SPAN & mBits)) &&
|
|
|
|
(ROW_SPAN_0 == (ROW_SPAN_0 & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void CellData::SetZeroRowSpan(PRBool aIsZeroSpan)
|
|
|
|
{
|
|
|
|
if (SPAN == (SPAN & mBits)) {
|
|
|
|
if (aIsZeroSpan) {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits |= ROW_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
else {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits &= ~ROW_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRUint32 CellData::GetRowSpanOffset() const
|
|
|
|
{
|
|
|
|
if ((SPAN == (SPAN & mBits)) && ((ROW_SPAN == (ROW_SPAN & mBits)))) {
|
|
|
|
return (PRUint32)((mBits & ROW_SPAN_OFFSET) >> ROW_SPAN_SHIFT);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void CellData::SetRowSpanOffset(PRUint32 aSpan)
|
|
|
|
{
|
|
|
|
mBits &= ~ROW_SPAN_OFFSET;
|
|
|
|
mBits |= (aSpan << ROW_SPAN_SHIFT);
|
|
|
|
mBits |= SPAN;
|
|
|
|
mBits |= ROW_SPAN;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsColSpan() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits)) &&
|
|
|
|
(COL_SPAN == (COL_SPAN & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsZeroColSpan() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits)) &&
|
|
|
|
(COL_SPAN == (COL_SPAN & mBits)) &&
|
|
|
|
(COL_SPAN_0 == (COL_SPAN_0 & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void CellData::SetZeroColSpan(PRBool aIsZeroSpan)
|
|
|
|
{
|
|
|
|
if (SPAN == (SPAN & mBits)) {
|
|
|
|
if (aIsZeroSpan) {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits |= COL_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
else {
|
2000-02-01 06:23:29 +03:00
|
|
|
mBits &= ~COL_SPAN_0;
|
2000-01-13 08:29:38 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRUint32 CellData::GetColSpanOffset() const
|
|
|
|
{
|
|
|
|
if ((SPAN == (SPAN & mBits)) && ((COL_SPAN == (COL_SPAN & mBits)))) {
|
|
|
|
return (PRUint32)((mBits & COL_SPAN_OFFSET) >> COL_SPAN_SHIFT);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void CellData::SetColSpanOffset(PRUint32 aSpan)
|
|
|
|
{
|
|
|
|
mBits &= ~COL_SPAN_OFFSET;
|
|
|
|
mBits |= (aSpan << COL_SPAN_SHIFT);
|
|
|
|
|
|
|
|
mBits |= SPAN;
|
|
|
|
mBits |= COL_SPAN;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool CellData::IsOverlap() const
|
|
|
|
{
|
|
|
|
return (SPAN == (SPAN & mBits)) && (OVERLAP == (OVERLAP & mBits));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void CellData::SetOverlap(PRBool aOverlap)
|
|
|
|
{
|
|
|
|
if (SPAN == (SPAN & mBits)) {
|
|
|
|
if (aOverlap) {
|
|
|
|
mBits |= OVERLAP;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mBits &= ~OVERLAP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
inline BCData::BCData()
|
|
|
|
{
|
|
|
|
mLeftOwner = mTopOwner = eCellOwner;
|
|
|
|
mLeftStart = mTopStart = 1;
|
|
|
|
mLeftSize = mCornerSide = mCornerSubSize = mTopSize = 0;
|
2005-03-07 00:18:54 +03:00
|
|
|
mCornerBevel = PR_FALSE;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
inline BCData::~BCData()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord BCData::GetLeftEdge(BCBorderOwner& aOwner,
|
|
|
|
PRBool& aStart) const
|
|
|
|
{
|
|
|
|
aOwner = (BCBorderOwner)mLeftOwner;
|
|
|
|
aStart = (PRBool)mLeftStart;
|
|
|
|
|
|
|
|
return (nscoord)mLeftSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void BCData::SetLeftEdge(BCBorderOwner aOwner,
|
|
|
|
nscoord aSize,
|
|
|
|
PRBool aStart)
|
|
|
|
{
|
|
|
|
mLeftOwner = aOwner;
|
|
|
|
mLeftSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
|
|
|
|
mLeftStart = aStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nscoord BCData::GetTopEdge(BCBorderOwner& aOwner,
|
|
|
|
PRBool& aStart) const
|
|
|
|
{
|
|
|
|
aOwner = (BCBorderOwner)mTopOwner;
|
|
|
|
aStart = (PRBool)mTopStart;
|
|
|
|
|
|
|
|
return (nscoord)mTopSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void BCData::SetTopEdge(BCBorderOwner aOwner,
|
|
|
|
nscoord aSize,
|
|
|
|
PRBool aStart)
|
|
|
|
{
|
|
|
|
mTopOwner = aOwner;
|
|
|
|
mTopSize = (aSize > MAX_BORDER_WIDTH) ? MAX_BORDER_WIDTH : aSize;
|
|
|
|
mTopStart = aStart;
|
|
|
|
}
|
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
inline BCPixelSize BCData::GetCorner(PRUint8& aOwnerSide,
|
|
|
|
PRPackedBool& aBevel) const
|
2002-02-19 18:48:28 +03:00
|
|
|
{
|
|
|
|
aOwnerSide = mCornerSide;
|
|
|
|
aBevel = (PRBool)mCornerBevel;
|
2005-04-07 22:04:38 +04:00
|
|
|
return mCornerSubSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
}
|
|
|
|
|
2005-04-07 22:04:38 +04:00
|
|
|
inline void BCData::SetCorner(BCPixelSize aSubSize,
|
2002-02-19 18:48:28 +03:00
|
|
|
PRUint8 aOwnerSide,
|
|
|
|
PRBool aBevel)
|
|
|
|
{
|
2005-04-07 22:04:38 +04:00
|
|
|
mCornerSubSize = aSubSize;
|
2002-02-19 18:48:28 +03:00
|
|
|
mCornerSide = aOwnerSide;
|
|
|
|
mCornerBevel = aBevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool BCData::IsLeftStart() const
|
|
|
|
{
|
|
|
|
return (PRBool)mLeftStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void BCData::SetLeftStart(PRBool aValue)
|
|
|
|
{
|
|
|
|
mLeftStart = aValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRBool BCData::IsTopStart() const
|
|
|
|
{
|
|
|
|
return (PRBool)mTopStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void BCData::SetTopStart(PRBool aValue)
|
|
|
|
{
|
|
|
|
mTopStart = aValue;
|
|
|
|
}
|
|
|
|
|
1998-07-11 04:08:08 +04:00
|
|
|
#endif
|