2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-29 03:54:06 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +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-04-29 03:54:06 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +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-04-29 03:54:06 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-25 05:32:19 +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-25 05:32:19 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +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-25 05:32:19 +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 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-25 05:32:19 +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 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-25 05:32:19 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-25 08:47:31 +03:00
|
|
|
|
|
|
|
/* representation of length values in computed style data */
|
|
|
|
|
1998-04-29 03:54:06 +04:00
|
|
|
#ifndef nsStyleCoord_h___
|
|
|
|
#define nsStyleCoord_h___
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsCoord.h"
|
1998-05-13 02:18:42 +04:00
|
|
|
#include "nsCRT.h"
|
2003-01-18 18:58:49 +03:00
|
|
|
#include "nsStyleConsts.h"
|
2001-03-08 05:41:16 +03:00
|
|
|
class nsString;
|
1998-04-29 03:54:06 +04:00
|
|
|
|
|
|
|
enum nsStyleUnit {
|
1998-04-30 23:50:36 +04:00
|
|
|
eStyleUnit_Null = 0, // (no value) value is not specified
|
|
|
|
eStyleUnit_Normal = 1, // (no value)
|
|
|
|
eStyleUnit_Auto = 2, // (no value)
|
2007-05-11 10:01:31 +04:00
|
|
|
eStyleUnit_None = 3, // (no value)
|
1998-04-30 23:50:36 +04:00
|
|
|
eStyleUnit_Percent = 10, // (float) 1.0 == 100%
|
1998-05-13 02:18:42 +04:00
|
|
|
eStyleUnit_Factor = 11, // (float) a multiplier
|
1998-04-30 23:50:36 +04:00
|
|
|
eStyleUnit_Coord = 20, // (nscoord) value is twips
|
|
|
|
eStyleUnit_Integer = 30, // (int) value is simple integer
|
2008-07-16 01:31:36 +04:00
|
|
|
eStyleUnit_Enumerated = 32 // (int) value has enumerated meaning
|
1998-04-29 03:54:06 +04:00
|
|
|
};
|
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
typedef union {
|
|
|
|
PRInt32 mInt; // nscoord is a PRInt32 for now
|
|
|
|
float mFloat;
|
|
|
|
} nsStyleUnion;
|
|
|
|
|
2002-07-30 09:34:55 +04:00
|
|
|
/**
|
|
|
|
* Class that hold a single size specification used by the style
|
|
|
|
* system. The size specification consists of two parts -- a number
|
|
|
|
* and a unit. The number is an integer, a floating point value, an
|
|
|
|
* nscoord, or undefined, and the unit is an nsStyleUnit. Checking
|
|
|
|
* the unit is a must before asking for the value in any particular
|
|
|
|
* form.
|
|
|
|
*/
|
1998-04-29 03:54:06 +04:00
|
|
|
class nsStyleCoord {
|
|
|
|
public:
|
2001-03-08 05:41:16 +03:00
|
|
|
nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null);
|
|
|
|
nsStyleCoord(nscoord aValue);
|
|
|
|
nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit);
|
|
|
|
nsStyleCoord(float aValue, nsStyleUnit aUnit);
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord(const nsStyleCoord& aCopy);
|
|
|
|
inline nsStyleCoord(const nsStyleUnion& aValue, nsStyleUnit aUnit);
|
1998-04-29 03:54:06 +04:00
|
|
|
|
2001-03-08 05:41:16 +03:00
|
|
|
nsStyleCoord& operator=(const nsStyleCoord& aCopy);
|
|
|
|
PRBool operator==(const nsStyleCoord& aOther) const;
|
|
|
|
PRBool operator!=(const nsStyleCoord& aOther) const;
|
1998-04-29 03:54:06 +04:00
|
|
|
|
2007-05-11 10:02:31 +04:00
|
|
|
nsStyleUnit GetUnit(void) const {
|
|
|
|
NS_ASSERTION(mUnit != eStyleUnit_Null, "reading uninitialized value");
|
|
|
|
return mUnit;
|
|
|
|
}
|
1998-04-29 03:54:06 +04:00
|
|
|
nscoord GetCoordValue(void) const;
|
|
|
|
PRInt32 GetIntValue(void) const;
|
1998-04-30 23:50:36 +04:00
|
|
|
float GetPercentValue(void) const;
|
1998-05-13 02:18:42 +04:00
|
|
|
float GetFactorValue(void) const;
|
|
|
|
void GetUnionValue(nsStyleUnion& aValue) const;
|
1998-04-29 03:54:06 +04:00
|
|
|
|
2001-03-08 05:41:16 +03:00
|
|
|
void Reset(void); // sets to null
|
|
|
|
void SetCoordValue(nscoord aValue);
|
|
|
|
void SetIntValue(PRInt32 aValue, nsStyleUnit aUnit);
|
|
|
|
void SetPercentValue(float aValue);
|
|
|
|
void SetFactorValue(float aValue);
|
|
|
|
void SetNormalValue(void);
|
|
|
|
void SetAutoValue(void);
|
2007-05-11 10:01:31 +04:00
|
|
|
void SetNoneValue(void);
|
1998-04-29 03:54:06 +04:00
|
|
|
|
2008-10-01 09:50:52 +04:00
|
|
|
#ifdef DEBUG
|
2001-03-08 05:41:16 +03:00
|
|
|
void AppendToString(nsString& aBuffer) const;
|
|
|
|
void ToString(nsString& aBuffer) const;
|
2008-10-01 09:50:52 +04:00
|
|
|
#endif
|
1998-04-29 03:54:06 +04:00
|
|
|
|
1999-09-02 06:09:07 +04:00
|
|
|
public:
|
1998-05-13 02:18:42 +04:00
|
|
|
nsStyleUnit mUnit;
|
|
|
|
nsStyleUnion mValue;
|
1998-04-29 03:54:06 +04:00
|
|
|
};
|
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
|
2002-07-30 09:34:55 +04:00
|
|
|
/**
|
|
|
|
* Class that represents a set of top/right/bottom/left nsStyleCoords.
|
|
|
|
* This is commonly used to hold the widths of the borders, margins,
|
|
|
|
* or paddings of a box.
|
|
|
|
*/
|
1998-05-13 02:18:42 +04:00
|
|
|
class nsStyleSides {
|
|
|
|
public:
|
2001-03-08 05:41:16 +03:00
|
|
|
nsStyleSides(void);
|
1998-05-13 02:18:42 +04:00
|
|
|
|
|
|
|
// nsStyleSides& operator=(const nsStyleSides& aCopy); // use compiler's version
|
2001-03-08 05:41:16 +03:00
|
|
|
PRBool operator==(const nsStyleSides& aOther) const;
|
1999-07-18 04:13:08 +04:00
|
|
|
PRBool operator!=(const nsStyleSides& aOther) const;
|
1998-05-13 02:18:42 +04:00
|
|
|
|
2003-01-18 18:58:49 +03:00
|
|
|
// aSide is always one of NS_SIDE_* defined in nsStyleConsts.h
|
1998-05-13 02:18:42 +04:00
|
|
|
|
2003-01-18 18:58:49 +03:00
|
|
|
inline nsStyleUnit GetUnit(PRUint8 aSide) const;
|
|
|
|
inline nsStyleUnit GetLeftUnit(void) const;
|
|
|
|
inline nsStyleUnit GetTopUnit(void) const;
|
|
|
|
inline nsStyleUnit GetRightUnit(void) const;
|
|
|
|
inline nsStyleUnit GetBottomUnit(void) const;
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord Get(PRUint8 aSide) const;
|
|
|
|
inline nsStyleCoord GetLeft() const;
|
|
|
|
inline nsStyleCoord GetTop() const;
|
|
|
|
inline nsStyleCoord GetRight() const;
|
|
|
|
inline nsStyleCoord GetBottom() const;
|
1998-05-13 02:18:42 +04:00
|
|
|
|
2001-03-08 05:41:16 +03:00
|
|
|
void Reset(void);
|
2003-01-18 18:58:49 +03:00
|
|
|
|
|
|
|
inline void Set(PRUint8 aSide, const nsStyleCoord& aCoord);
|
|
|
|
inline void SetLeft(const nsStyleCoord& aCoord);
|
|
|
|
inline void SetTop(const nsStyleCoord& aCoord);
|
|
|
|
inline void SetRight(const nsStyleCoord& aCoord);
|
|
|
|
inline void SetBottom(const nsStyleCoord& aCoord);
|
1998-05-13 02:18:42 +04:00
|
|
|
|
2008-10-01 09:50:52 +04:00
|
|
|
#ifdef DEBUG
|
2001-03-08 05:41:16 +03:00
|
|
|
void AppendToString(nsString& aBuffer) const;
|
|
|
|
void ToString(nsString& aBuffer) const;
|
2008-10-01 09:50:52 +04:00
|
|
|
#endif
|
1998-05-13 02:18:42 +04:00
|
|
|
|
|
|
|
protected:
|
2003-01-18 18:58:49 +03:00
|
|
|
PRUint8 mUnits[4];
|
|
|
|
nsStyleUnion mValues[4];
|
1998-05-13 02:18:42 +04:00
|
|
|
};
|
|
|
|
|
2008-10-01 09:50:52 +04:00
|
|
|
/**
|
|
|
|
* Class that represents a set of top-left/top-right/bottom-left/bottom-right
|
|
|
|
* nsStyleCoord pairs. This is used to hold the dimensions of the
|
|
|
|
* corners of a box (for, e.g., border-radius and outline-radius).
|
|
|
|
*/
|
|
|
|
class nsStyleCorners {
|
|
|
|
public:
|
|
|
|
nsStyleCorners(void);
|
|
|
|
|
|
|
|
// use compiler's version
|
|
|
|
//nsStyleCorners& operator=(const nsStyleCorners& aCopy);
|
|
|
|
PRBool operator==(const nsStyleCorners& aOther) const;
|
|
|
|
PRBool operator!=(const nsStyleCorners& aOther) const;
|
|
|
|
|
|
|
|
// aCorner is always one of NS_CORNER_* defined in nsStyleConsts.h
|
|
|
|
inline nsStyleUnit GetUnit(PRUint8 aHalfCorner) const;
|
|
|
|
|
|
|
|
inline nsStyleCoord Get(PRUint8 aHalfCorner) const;
|
|
|
|
|
|
|
|
void Reset(void);
|
|
|
|
|
|
|
|
inline void Set(PRUint8 aHalfCorner, const nsStyleCoord& aCoord);
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void AppendToString(nsString& aBuffer) const;
|
|
|
|
void ToString(nsString& aBuffer) const;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
PRUint8 mUnits[8];
|
|
|
|
nsStyleUnion mValues[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
// -------------------------
|
|
|
|
// nsStyleCoord inlines
|
|
|
|
//
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord::nsStyleCoord(const nsStyleCoord& aCopy)
|
|
|
|
: mUnit(aCopy.mUnit)
|
|
|
|
{
|
|
|
|
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
|
|
|
mValue.mFloat = aCopy.mValue.mFloat;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mValue.mInt = aCopy.mValue.mInt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleCoord::nsStyleCoord(const nsStyleUnion& aValue, nsStyleUnit aUnit)
|
|
|
|
: mUnit(aUnit)
|
|
|
|
{
|
|
|
|
#if PR_BYTES_PER_INT == PR_BYTES_PER_FLOAT
|
|
|
|
mValue.mInt = aValue.mInt;
|
|
|
|
#else
|
|
|
|
memcpy(&mValue, &aValue, sizeof(nsStyleUnion));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
1999-07-18 04:13:08 +04:00
|
|
|
inline PRBool nsStyleCoord::operator!=(const nsStyleCoord& aOther) const
|
|
|
|
{
|
2008-10-01 09:50:52 +04:00
|
|
|
return !((*this) == aOther);
|
1999-07-18 04:13:08 +04:00
|
|
|
}
|
|
|
|
|
1998-04-29 03:54:06 +04:00
|
|
|
inline PRInt32 nsStyleCoord::GetCoordValue(void) const
|
|
|
|
{
|
1998-04-30 23:50:36 +04:00
|
|
|
NS_ASSERTION((mUnit == eStyleUnit_Coord), "not a coord value");
|
|
|
|
if (mUnit == eStyleUnit_Coord) {
|
1998-04-29 03:54:06 +04:00
|
|
|
return mValue.mInt;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline PRInt32 nsStyleCoord::GetIntValue(void) const
|
|
|
|
{
|
2007-05-11 10:00:26 +04:00
|
|
|
NS_ASSERTION((mUnit == eStyleUnit_Enumerated) ||
|
1998-04-30 23:50:36 +04:00
|
|
|
(mUnit == eStyleUnit_Integer), "not an int value");
|
2007-05-11 10:00:26 +04:00
|
|
|
if ((mUnit == eStyleUnit_Enumerated) ||
|
1998-04-30 23:50:36 +04:00
|
|
|
(mUnit == eStyleUnit_Integer)) {
|
1998-04-29 03:54:06 +04:00
|
|
|
return mValue.mInt;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-04-30 23:50:36 +04:00
|
|
|
inline float nsStyleCoord::GetPercentValue(void) const
|
1998-04-29 03:54:06 +04:00
|
|
|
{
|
1998-04-30 23:50:36 +04:00
|
|
|
NS_ASSERTION(mUnit == eStyleUnit_Percent, "not a percent value");
|
1998-04-29 03:54:06 +04:00
|
|
|
if (mUnit == eStyleUnit_Percent) {
|
|
|
|
return mValue.mFloat;
|
|
|
|
}
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
inline float nsStyleCoord::GetFactorValue(void) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mUnit == eStyleUnit_Factor, "not a factor value");
|
|
|
|
if (mUnit == eStyleUnit_Factor) {
|
|
|
|
return mValue.mFloat;
|
|
|
|
}
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleCoord::GetUnionValue(nsStyleUnion& aValue) const
|
|
|
|
{
|
2002-01-12 06:18:55 +03:00
|
|
|
memcpy(&aValue, &mValue, sizeof(nsStyleUnion));
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
1998-04-29 03:54:06 +04:00
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
// -------------------------
|
|
|
|
// nsStyleSides inlines
|
|
|
|
//
|
1999-07-18 04:13:08 +04:00
|
|
|
inline PRBool nsStyleSides::operator!=(const nsStyleSides& aOther) const
|
|
|
|
{
|
2008-10-01 09:50:52 +04:00
|
|
|
return !((*this) == aOther);
|
1999-07-18 04:13:08 +04:00
|
|
|
}
|
|
|
|
|
2003-01-18 18:58:49 +03:00
|
|
|
inline nsStyleUnit nsStyleSides::GetUnit(PRUint8 aSide) const
|
|
|
|
{
|
|
|
|
return (nsStyleUnit)mUnits[aSide];
|
|
|
|
}
|
|
|
|
|
1998-05-13 02:18:42 +04:00
|
|
|
inline nsStyleUnit nsStyleSides::GetLeftUnit(void) const
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
return GetUnit(NS_SIDE_LEFT);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleUnit nsStyleSides::GetTopUnit(void) const
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
return GetUnit(NS_SIDE_TOP);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleUnit nsStyleSides::GetRightUnit(void) const
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
return GetUnit(NS_SIDE_RIGHT);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleUnit nsStyleSides::GetBottomUnit(void) const
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
return GetUnit(NS_SIDE_BOTTOM);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord nsStyleSides::Get(PRUint8 aSide) const
|
1998-05-13 02:18:42 +04:00
|
|
|
{
|
2008-03-06 03:05:26 +03:00
|
|
|
return nsStyleCoord(mValues[aSide], nsStyleUnit(mUnits[aSide]));
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord nsStyleSides::GetLeft() const
|
2003-01-18 18:58:49 +03:00
|
|
|
{
|
2008-03-06 03:05:26 +03:00
|
|
|
return Get(NS_SIDE_LEFT);
|
2003-01-18 18:58:49 +03:00
|
|
|
}
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord nsStyleSides::GetTop() const
|
1998-05-13 02:18:42 +04:00
|
|
|
{
|
2008-03-06 03:05:26 +03:00
|
|
|
return Get(NS_SIDE_TOP);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord nsStyleSides::GetRight() const
|
1998-05-13 02:18:42 +04:00
|
|
|
{
|
2008-03-06 03:05:26 +03:00
|
|
|
return Get(NS_SIDE_RIGHT);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
2008-03-06 03:05:26 +03:00
|
|
|
inline nsStyleCoord nsStyleSides::GetBottom() const
|
1998-05-13 02:18:42 +04:00
|
|
|
{
|
2008-03-06 03:05:26 +03:00
|
|
|
return Get(NS_SIDE_BOTTOM);
|
2003-01-18 18:58:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleSides::Set(PRUint8 aSide, const nsStyleCoord& aCoord)
|
|
|
|
{
|
|
|
|
mUnits[aSide] = aCoord.GetUnit();
|
|
|
|
aCoord.GetUnionValue(mValues[aSide]);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleSides::SetLeft(const nsStyleCoord& aCoord)
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
Set(NS_SIDE_LEFT, aCoord);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleSides::SetTop(const nsStyleCoord& aCoord)
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
Set(NS_SIDE_TOP, aCoord);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleSides::SetRight(const nsStyleCoord& aCoord)
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
Set(NS_SIDE_RIGHT, aCoord);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleSides::SetBottom(const nsStyleCoord& aCoord)
|
|
|
|
{
|
2003-01-18 18:58:49 +03:00
|
|
|
Set(NS_SIDE_BOTTOM, aCoord);
|
1998-05-13 02:18:42 +04:00
|
|
|
}
|
1998-04-29 03:54:06 +04:00
|
|
|
|
2008-10-01 09:50:52 +04:00
|
|
|
// -------------------------
|
|
|
|
// nsStyleCorners inlines
|
|
|
|
//
|
|
|
|
inline PRBool nsStyleCorners::operator!=(const nsStyleCorners& aOther) const
|
|
|
|
{
|
|
|
|
return !((*this) == aOther);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleUnit nsStyleCorners::GetUnit(PRUint8 aCorner) const
|
|
|
|
{
|
|
|
|
return (nsStyleUnit)mUnits[aCorner];
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsStyleCoord nsStyleCorners::Get(PRUint8 aCorner) const
|
|
|
|
{
|
|
|
|
return nsStyleCoord(mValues[aCorner], nsStyleUnit(mUnits[aCorner]));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void nsStyleCorners::Set(PRUint8 aCorner, const nsStyleCoord& aCoord)
|
|
|
|
{
|
|
|
|
mUnits[aCorner] = aCoord.GetUnit();
|
|
|
|
aCoord.GetUnionValue(mValues[aCorner]);
|
|
|
|
}
|
|
|
|
|
1998-04-29 03:54:06 +04:00
|
|
|
#endif /* nsStyleCoord_h___ */
|