2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00: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-13 20:24:54 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either 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"),
|
|
|
|
* 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
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* 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
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsCSSRendering_h___
|
|
|
|
#define nsCSSRendering_h___
|
|
|
|
|
|
|
|
#include "nsIRenderingContext.h"
|
|
|
|
struct nsPoint;
|
2001-10-24 00:01:09 +00:00
|
|
|
class nsIStyleContext;
|
|
|
|
class nsIPresContext;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
class nsCSSRendering {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Render the border for an element using css rendering rules
|
|
|
|
* for borders. aSkipSides is a bitmask of the sides to skip
|
|
|
|
* when rendering. If 0 then no sides are skipped.
|
1998-07-22 02:46:00 +00:00
|
|
|
*
|
1999-01-15 18:25:58 +00:00
|
|
|
* Both aDirtyRect and aBorderArea are in the local coordinate space
|
1998-07-22 02:46:00 +00:00
|
|
|
* of aForFrame
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
1999-11-24 06:03:41 +00:00
|
|
|
static void PaintBorder(nsIPresContext* aPresContext,
|
1998-04-13 20:24:54 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
1999-01-15 18:25:58 +00:00
|
|
|
const nsRect& aBorderArea,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder& aBorderStyle,
|
1999-03-05 19:23:52 +00:00
|
|
|
nsIStyleContext* aStyleContext,
|
1998-10-08 04:38:41 +00:00
|
|
|
PRIntn aSkipSides,
|
1999-09-03 14:12:09 +00:00
|
|
|
nsRect* aGap = 0,
|
|
|
|
nscoord aHardBorderSize = 0,
|
|
|
|
PRBool aShouldIgnoreRounded = PR_FALSE);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1999-08-19 14:22:47 +00:00
|
|
|
/**
|
|
|
|
* Render the outline for an element using css rendering rules
|
|
|
|
* for borders. aSkipSides is a bitmask of the sides to skip
|
|
|
|
* when rendering. If 0 then no sides are skipped.
|
|
|
|
*
|
|
|
|
* Both aDirtyRect and aBorderArea are in the local coordinate space
|
|
|
|
* of aForFrame
|
|
|
|
*/
|
1999-11-24 06:03:41 +00:00
|
|
|
static void PaintOutline(nsIPresContext* aPresContext,
|
1999-08-19 14:22:47 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsRect& aBorderArea,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder& aBorderStyle,
|
|
|
|
const nsStyleOutline& aOutlineStyle,
|
1999-08-19 14:22:47 +00:00
|
|
|
nsIStyleContext* aStyleContext,
|
|
|
|
PRIntn aSkipSides,
|
|
|
|
nsRect* aGap = 0);
|
|
|
|
|
1998-12-17 22:58:51 +00:00
|
|
|
/**
|
|
|
|
* Just like PaintBorder, but takes as input a list of border segments
|
|
|
|
* rather than a single border style. Useful for any object that needs to
|
|
|
|
* draw a border where an edge is not necessarily homogenous.
|
|
|
|
* Render the border for an element using css rendering rules
|
|
|
|
* for borders. aSkipSides is a bitmask of the sides to skip
|
|
|
|
* when rendering. If 0 then no sides are skipped.
|
|
|
|
*
|
1999-01-15 18:25:58 +00:00
|
|
|
* Both aDirtyRect and aBorderArea are in the local coordinate space
|
1998-12-17 22:58:51 +00:00
|
|
|
* of aForFrame
|
|
|
|
*/
|
1999-11-24 06:03:41 +00:00
|
|
|
static void PaintBorderEdges(nsIPresContext* aPresContext,
|
1998-12-17 22:58:51 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
1999-01-15 18:25:58 +00:00
|
|
|
const nsRect& aBorderArea,
|
1998-12-17 22:58:51 +00:00
|
|
|
nsBorderEdges * aBorderEdges,
|
1999-03-05 19:23:52 +00:00
|
|
|
nsIStyleContext* aStyleContext,
|
1998-12-17 22:58:51 +00:00
|
|
|
PRIntn aSkipSides,
|
|
|
|
nsRect* aGap = 0);
|
|
|
|
|
|
|
|
|
2002-01-07 23:46:07 +00:00
|
|
|
/**
|
|
|
|
* Fill in an nsStyleBackground to be used to paint the background for
|
|
|
|
* an element. The nsStyleBackground should first be initialized
|
|
|
|
* using the pres context. This applies the rules for propagating
|
|
|
|
* backgrounds between BODY, the root element, and the canvas.
|
|
|
|
*/
|
|
|
|
static PRBool FindBackground(nsIPresContext* aPresContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsStyleBackground** aBackground,
|
|
|
|
PRBool* aIsCanvas);
|
|
|
|
|
2002-08-11 17:56:15 +00:00
|
|
|
/**
|
|
|
|
* Find a non-transparent background, for various table-related and
|
|
|
|
* HR-related backwards-compatibility hacks. Be very hesitant if
|
|
|
|
* you're considering calling this function -- it's usually not what
|
|
|
|
* you want.
|
|
|
|
*/
|
|
|
|
static const nsStyleBackground*
|
|
|
|
FindNonTransparentBackground(nsIStyleContext* aContext,
|
|
|
|
PRBool aStartAtParent = PR_FALSE);
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* Render the background for an element using css rendering rules
|
|
|
|
* for backgrounds.
|
1998-07-22 05:02:07 +00:00
|
|
|
*
|
1999-01-15 18:25:58 +00:00
|
|
|
* Both aDirtyRect and aBorderArea are in the local coordinate space
|
1998-07-22 05:02:07 +00:00
|
|
|
* of aForFrame
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
1999-11-24 06:03:41 +00:00
|
|
|
static void PaintBackground(nsIPresContext* aPresContext,
|
1998-04-13 20:24:54 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
1999-01-15 18:25:58 +00:00
|
|
|
const nsRect& aBorderArea,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder& aBorder,
|
2002-10-08 10:24:53 +00:00
|
|
|
const nsStylePadding& aPadding,
|
1998-09-26 17:16:56 +00:00
|
|
|
nscoord aDX,
|
2002-02-15 14:48:12 +00:00
|
|
|
nscoord aDY,
|
|
|
|
PRBool aUsePrintSettings=PR_FALSE);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2002-01-07 23:46:07 +00:00
|
|
|
/**
|
|
|
|
* Same as |PaintBackground|, except using the provided style context
|
|
|
|
* (which short-circuits the code that ensures that the root element's
|
|
|
|
* background is drawn on the canvas.
|
|
|
|
*/
|
|
|
|
static void PaintBackgroundWithSC(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsRect& aBorderArea,
|
|
|
|
const nsStyleBackground& aColor,
|
|
|
|
const nsStyleBorder& aBorder,
|
2002-10-08 10:24:53 +00:00
|
|
|
const nsStylePadding& aPadding,
|
2002-01-07 23:46:07 +00:00
|
|
|
nscoord aDX,
|
2002-02-15 14:48:12 +00:00
|
|
|
nscoord aDY,
|
|
|
|
PRBool aUsePrintSettings=PR_FALSE);
|
2003-01-17 09:33:52 +00:00
|
|
|
/**
|
|
|
|
* Called by the presShell when painting is finished, so we can clear our
|
|
|
|
* inline background data cache.
|
|
|
|
*/
|
|
|
|
static void DidPaint();
|
|
|
|
|
2002-01-07 23:46:07 +00:00
|
|
|
|
1998-10-17 00:35:32 +00:00
|
|
|
static void DrawDashedSides(PRIntn startSide,
|
|
|
|
nsIRenderingContext& aContext,
|
1999-10-26 14:34:17 +00:00
|
|
|
const nsRect& aDirtyRect,
|
1998-10-17 00:35:32 +00:00
|
|
|
const PRUint8 borderStyles[],
|
1998-12-07 19:04:39 +00:00
|
|
|
const nscolor borderColors[],
|
|
|
|
const nsRect& borderOutside,
|
|
|
|
const nsRect& borderInside,
|
|
|
|
PRIntn aSkipSides,
|
|
|
|
nsRect* aGap);
|
|
|
|
|
|
|
|
static void DrawDashedSides(PRIntn startSide,
|
|
|
|
nsIRenderingContext& aContext,
|
1999-10-26 14:34:17 +00:00
|
|
|
const nsRect& aDirtyRect,
|
2001-05-31 22:19:43 +00:00
|
|
|
const nsStyleColor* aColorStyle,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder* aBorderStyle,
|
|
|
|
const nsStyleOutline* aOutlineStyle,
|
1999-08-19 14:22:47 +00:00
|
|
|
PRBool aDoOutline,
|
1998-10-17 00:35:32 +00:00
|
|
|
const nsRect& borderOutside,
|
|
|
|
const nsRect& borderInside,
|
|
|
|
PRIntn aSkipSides,
|
|
|
|
nsRect* aGap);
|
|
|
|
|
1998-12-30 06:47:26 +00:00
|
|
|
/** draw the dashed segements of a segmented border */
|
|
|
|
//XXX: boy is it annoying that we have 3 methods to draw dashed sides!
|
|
|
|
// they clearly can be factored.
|
|
|
|
static void DrawDashedSegments(nsIRenderingContext& aContext,
|
|
|
|
const nsRect& aBounds,
|
|
|
|
nsBorderEdges * aBorderEdges,
|
|
|
|
PRIntn aSkipSides,
|
|
|
|
nsRect* aGap);
|
|
|
|
|
2002-02-19 15:48:28 +00:00
|
|
|
// Draw a border segment in the table collapsing border model without beveling corners
|
|
|
|
static void DrawTableBorderSegment(nsIRenderingContext& aContext,
|
|
|
|
PRUint8 aBorderStyle,
|
|
|
|
nscolor aBorderColor,
|
|
|
|
const nsStyleBackground* aBGColor,
|
|
|
|
const nsRect& aBorderRect,
|
|
|
|
float aPixelsToTwips,
|
|
|
|
PRUint8 aStartBevelSide = 0,
|
|
|
|
nscoord aStartBevelOffset = 0,
|
|
|
|
PRUint8 aEndBevelSide = 0,
|
|
|
|
nscoord aEndBevelOffset = 0);
|
2001-05-10 14:19:58 +00:00
|
|
|
/**
|
|
|
|
* transform a color to a color that will show up on a printer if needed
|
|
|
|
* aMapColor - color to evaluate
|
|
|
|
* aIsPrinter - Is this a printing device
|
|
|
|
* return - the transformed color
|
|
|
|
*/
|
|
|
|
static nscolor TransformColor(nscolor aMapColor,PRBool aNoBackGround);
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
protected:
|
1999-04-19 05:27:55 +00:00
|
|
|
/**
|
|
|
|
* Render the border for an element using css rendering rules
|
|
|
|
* for borders. aSkipSides is a bitmask of the sides to skip
|
|
|
|
* when rendering. If 0 then no sides are skipped.
|
|
|
|
* Both aDirtyRect and aBorderArea are in the local coordinate space
|
|
|
|
* of aForFrame
|
|
|
|
*/
|
1999-11-24 06:03:41 +00:00
|
|
|
static void PaintRoundedBorder(nsIPresContext* aPresContext,
|
1999-04-19 05:27:55 +00:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsRect& aBorderArea,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder* aBorderStyle,
|
|
|
|
const nsStyleOutline* aOutlineStyle,
|
1999-04-19 05:27:55 +00:00
|
|
|
nsIStyleContext* aStyleContext,
|
|
|
|
PRIntn aSkipSides,
|
2000-02-01 16:03:13 +00:00
|
|
|
PRInt16 aBorderRadius[4],nsRect* aGap = 0,
|
|
|
|
PRBool aIsOutline=PR_FALSE);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
2000-05-11 03:59:43 +00:00
|
|
|
static void RenderSide(nsFloatPoint aPoints[],nsIRenderingContext& aRenderingContext,
|
2001-02-07 09:57:26 +00:00
|
|
|
const nsStyleBorder* aBorderStyle,const nsStyleOutline* aOutlineStyle,nsIStyleContext* aStyleContext,
|
2000-03-18 14:41:00 +00:00
|
|
|
PRUint8 aSide,nsMargin &aBorThick,nscoord aTwipsPerPixel,
|
|
|
|
PRBool aIsOutline=PR_FALSE);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
2002-10-08 10:24:53 +00:00
|
|
|
static void PaintBackgroundColor(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aBgClipArea,
|
|
|
|
const nsStyleBackground& aColor,
|
|
|
|
const nsStyleBorder& aBorder,
|
|
|
|
const nsStylePadding& aPadding,
|
|
|
|
nscoord aDX,
|
|
|
|
nscoord aDY);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
2002-10-08 10:24:53 +00:00
|
|
|
static void PaintRoundedBackground(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
nsIFrame* aForFrame,
|
|
|
|
const nsRect& aBorderArea,
|
|
|
|
const nsStyleBackground& aColor,
|
|
|
|
const nsStyleBorder& aBorder,
|
|
|
|
nscoord aDX,
|
|
|
|
nscoord aDY,
|
|
|
|
PRInt16 aTheRadius[4]);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style,
|
1999-01-22 22:22:26 +00:00
|
|
|
nscolor aBackgroundColor,
|
1999-03-05 19:23:52 +00:00
|
|
|
nscolor aBorderColor,
|
|
|
|
PRBool aSpecialCase);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
static PRIntn MakeSide(nsPoint aPoints[],
|
|
|
|
nsIRenderingContext& aContext,
|
|
|
|
PRIntn whichSide,
|
1998-06-18 05:43:32 +00:00
|
|
|
const nsRect& outside, const nsRect& inside,
|
1999-07-27 23:26:36 +00:00
|
|
|
PRIntn aSkipSides,
|
1998-06-17 22:14:20 +00:00
|
|
|
PRIntn borderPart, float borderFrac,
|
|
|
|
nscoord twipsPerPixel);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
static void DrawSide(nsIRenderingContext& aContext,
|
|
|
|
PRIntn whichSide,
|
1998-12-07 19:04:39 +00:00
|
|
|
const PRUint8 borderStyle,
|
|
|
|
const nscolor borderColor,
|
1999-03-05 19:23:52 +00:00
|
|
|
const nscolor aBackgroundColor,
|
|
|
|
const nsRect& borderOutside,
|
1998-05-26 20:52:59 +00:00
|
|
|
const nsRect& borderInside,
|
1999-07-27 23:26:36 +00:00
|
|
|
PRIntn aSkipSides,
|
1998-10-08 04:38:41 +00:00
|
|
|
nscoord twipsPerPixel,
|
|
|
|
nsRect* aGap = 0);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-12-07 19:04:39 +00:00
|
|
|
|
2001-12-05 08:35:05 +00:00
|
|
|
static void DrawCompositeSide(nsIRenderingContext& aContext,
|
|
|
|
PRIntn aWhichSide,
|
|
|
|
nsBorderColors* aCompositeColors,
|
|
|
|
const nsRect& aOuterRect,
|
|
|
|
const nsRect& aInnerRect,
|
|
|
|
PRInt16* aBorderRadii,
|
|
|
|
nscoord aTwipsPerPixel,
|
|
|
|
nsRect* aGap);
|
|
|
|
|
1998-10-08 04:38:41 +00:00
|
|
|
static void DrawLine (nsIRenderingContext& aContext,
|
|
|
|
nscoord aX1, nscoord aY1, nscoord aX2, nscoord aY2,
|
|
|
|
nsRect* aGap);
|
|
|
|
|
|
|
|
static void FillPolygon (nsIRenderingContext& aContext,
|
|
|
|
const nsPoint aPoints[],
|
|
|
|
PRInt32 aNumPoints,
|
|
|
|
nsRect* aGap);
|
2001-05-10 14:19:58 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
1999-04-19 05:27:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
/** ---------------------------------------------------
|
|
|
|
* Class QBCurve, a quadratic bezier curve, used to implement the rounded rectangles
|
|
|
|
* @update 3/26/99 dwc
|
|
|
|
*/
|
|
|
|
class QBCurve
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2000-05-11 03:59:43 +00:00
|
|
|
nsFloatPoint mAnc1;
|
|
|
|
nsFloatPoint mCon;
|
|
|
|
nsFloatPoint mAnc2;
|
1999-04-19 05:27:55 +00:00
|
|
|
|
|
|
|
QBCurve() {mAnc1.x=0;mAnc1.y=0;mCon=mAnc2=mAnc1;}
|
2000-05-11 03:59:43 +00:00
|
|
|
void SetControls(nsFloatPoint &aAnc1,nsFloatPoint &aCon,nsFloatPoint &aAnc2) { mAnc1 = aAnc1; mCon = aCon; mAnc2 = aAnc2;}
|
|
|
|
void SetPoints(float a1x,float a1y,float acx,float acy,float a2x,float a2y) {mAnc1.MoveTo(a1x,a1y),mCon.MoveTo(acx,acy),mAnc2.MoveTo(a2x,a2y);}
|
1999-04-21 14:23:49 +00:00
|
|
|
|
|
|
|
/** ---------------------------------------------------
|
|
|
|
* Divide a Quadratic curve into line segments if it is not smaller than a certain size
|
|
|
|
* else it is so small that it can be approximated by 2 lineto calls
|
|
|
|
* @param aRenderingContext -- The RenderingContext to use to draw with
|
|
|
|
* @param aPointArray[] -- A list of points we can put line calls into instead of drawing. If null, lines are drawn
|
|
|
|
* @param aCurInex -- a pointer to an Integer that tells were to put the points into the array, incremented when finished
|
|
|
|
* @update 3/26/99 dwc
|
|
|
|
*/
|
1999-04-19 05:27:55 +00:00
|
|
|
void SubDivide(nsIRenderingContext *aRenderingContext,nsPoint aPointArray[],PRInt32 *aCurIndex);
|
1999-04-21 14:23:49 +00:00
|
|
|
|
|
|
|
/** ---------------------------------------------------
|
|
|
|
* Divide a Quadratic Bezier curve at the mid-point
|
|
|
|
* @update 3/26/99 dwc
|
|
|
|
* @param aCurve1 -- Curve 1 as a result of the division
|
|
|
|
* @param aCurve2 -- Curve 2 as a result of the division
|
|
|
|
*/
|
1999-04-19 05:27:55 +00:00
|
|
|
void MidPointDivide(QBCurve *A,QBCurve *B);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** ---------------------------------------------------
|
|
|
|
* Class RoundedRect, A class to encapsulate all the rounded rect functionality,
|
|
|
|
* which are based on the QBCurve
|
|
|
|
* @update 4/13/99 dwc
|
|
|
|
*/
|
|
|
|
class RoundedRect
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
1999-12-23 20:48:07 +00:00
|
|
|
PRInt32 mRoundness[4];
|
|
|
|
|
1999-08-27 14:37:47 +00:00
|
|
|
PRBool mDoRound;
|
1999-04-19 05:27:55 +00:00
|
|
|
|
2002-03-16 15:25:16 +00:00
|
|
|
PRInt32 mLeft;
|
|
|
|
PRInt32 mRight;
|
|
|
|
PRInt32 mTop;
|
|
|
|
PRInt32 mBottom;
|
1999-04-19 05:27:55 +00:00
|
|
|
|
1999-04-21 14:23:49 +00:00
|
|
|
/**
|
|
|
|
* Construct a rounded rectangle object
|
|
|
|
* @update 4/19/99
|
|
|
|
*/
|
1999-12-23 20:48:07 +00:00
|
|
|
void RoundRect() {mRoundness[0]=0;}
|
1999-04-21 14:23:49 +00:00
|
|
|
|
1999-04-19 05:27:55 +00:00
|
|
|
/**
|
|
|
|
* Set the curves boundaries and then break it up into the curve pieces for rendering
|
|
|
|
* @update 4/13/99 dwc
|
|
|
|
* @param aLeft -- Left side of bounding box
|
|
|
|
* @param aTop -- Top side of bounding box
|
|
|
|
* @param aWidth -- Width of bounding box
|
|
|
|
* @param aHeight -- Height of bounding box
|
|
|
|
* @param aRadius -- radius for the rounding
|
|
|
|
*/
|
1999-12-23 20:48:07 +00:00
|
|
|
void Set(nscoord aLeft,nscoord aTop,PRInt32 aWidth,PRInt32 aHeight,PRInt16 aRadius[4],PRInt16 aNumTwipPerPix);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
1999-04-21 14:23:49 +00:00
|
|
|
* Calculate the inset of a curve based on a border
|
1999-04-19 05:27:55 +00:00
|
|
|
* @update 4/13/99 dwc
|
|
|
|
* @param aLeft -- Left side of bounding box
|
|
|
|
* @param aTop -- Top side of bounding box
|
|
|
|
*/
|
|
|
|
void CalcInsetCurves(QBCurve &aULCurve,QBCurve &aURCurve,QBCurve &aLLCurve,QBCurve &aLRCurve,nsMargin &aBorder);
|
|
|
|
|
|
|
|
/** ---------------------------------------------------
|
|
|
|
* set the passed in curves to the rounded borders of the rectangle
|
|
|
|
* @update 4/13/99 dwc
|
|
|
|
* @param aULCurve -- upperleft curve
|
|
|
|
* @param aURCurve -- upperright curve
|
|
|
|
* @param aLRCurve -- lowerright curve
|
|
|
|
* @param aLLCurve -- lowerleft curve
|
|
|
|
*/
|
1999-04-19 13:37:16 +00:00
|
|
|
void GetRoundedBorders(QBCurve &aULCurve,QBCurve &aURCurve,QBCurve &aLLCurve,QBCurve &aLRCurve);
|
1999-04-19 05:27:55 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#endif /* nsCSSRendering_h___ */
|