bug #7032 Changed nsIWidget::Resize(...), nsIWidget::Move(...) to

use PRInt32 instead of PRUInt32. Modified Mac, and Linux to match.
bug #2010 Applied David Barrons patch for MakeSide ins CSSRendering.
nsIWidget - removed GetAbsoluteBounds - Not needed. Can use WidgetToScreen instead.
This commit is contained in:
kmcclusk%netscape.com 1999-07-27 23:26:36 +00:00
Родитель 3aae186860
Коммит 18b946cc00
22 изменённых файлов: 367 добавлений и 482 удалений

Просмотреть файл

@ -203,165 +203,148 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
nsIRenderingContext& aContext,
PRIntn whichSide,
const nsRect& outside, const nsRect& inside,
PRIntn aSkipSides,
PRIntn borderPart, float borderFrac,
nscoord twipsPerPixel)
{
float borderRest = 1.0f - borderFrac;
// XXX QQQ We really should decide to do a bevel based on whether there
// is a side adjacent or not. This could let you join borders across
// block elements (paragraphs).
PRIntn np = 0;
nscoord thickness;
nscoord thickness, outsideEdge, insideEdge, outsideTL, insideTL, outsideBR,
insideBR;
// Initialize the following six nscoord's:
// outsideEdge, insideEdge, outsideTL, insideTL, outsideBR, insideBR
// so that outsideEdge is the x or y of the outside edge, etc., and
// outsideTR is the y or x at the top or right end, etc., e.g.:
//
// outsideEdge --- ----------------------------------------
// \ /
// \ /
// \ /
// insideEdge ------- ----------------------------------
// | | | |
// outsideTL insideTL insideBR outsideBR
//
// if we don't want the bevel, we'll get rid of it later by setting
// outsideXX to insideXX
switch (whichSide) {
case NS_SIDE_TOP:
// the TL points are the left end; the BR points are the right end
outsideEdge = outside.y;
insideEdge = inside.y;
outsideTL = outside.x;
insideTL = inside.x;
insideBR = inside.XMost();
outsideBR = outside.XMost();
break;
case NS_SIDE_BOTTOM:
// the TL points are the left end; the BR points are the right end
outsideEdge = outside.YMost();
insideEdge = inside.YMost();
outsideTL = outside.x;
insideTL = inside.x;
insideBR = inside.XMost();
outsideBR = outside.XMost();
break;
case NS_SIDE_LEFT:
// the TL points are the top end; the BR points are the bottom end
outsideEdge = outside.x;
insideEdge = inside.x;
outsideTL = outside.y;
insideTL = inside.y;
insideBR = inside.YMost();
outsideBR = outside.YMost();
break;
case NS_SIDE_RIGHT:
// the TL points are the top end; the BR points are the bottom end
outsideEdge = outside.XMost();
insideEdge = inside.XMost();
outsideTL = outside.y;
insideTL = inside.y;
insideBR = inside.YMost();
outsideBR = outside.YMost();
break;
}
// Don't draw the bevels if an adjacent side is skipped
if ( (whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_BOTTOM) ) {
// a top or bottom side
if ((1<<NS_SIDE_LEFT) & aSkipSides) {
insideTL = outsideTL;
}
if ((1<<NS_SIDE_RIGHT) & aSkipSides) {
insideBR = outsideBR;
}
} else {
// a right or left side
if ((1<<NS_SIDE_TOP) & aSkipSides) {
insideTL = outsideTL;
}
if ((1<<NS_SIDE_BOTTOM) & aSkipSides) {
insideBR = outsideBR;
}
}
// move things around when only drawing part of the border
if (borderPart == BORDER_INSIDE) {
outsideEdge = nscoord(outsideEdge * borderFrac + insideEdge * borderRest);
outsideTL = nscoord(outsideTL * borderFrac + insideTL * borderRest);
outsideBR = nscoord(outsideBR * borderFrac + insideBR * borderRest);
} else if (borderPart == BORDER_OUTSIDE ) {
insideEdge = nscoord(insideEdge * borderFrac + outsideEdge * borderRest);
insideTL = nscoord(insideTL * borderFrac + outsideTL * borderRest);
insideBR = nscoord(insideBR * borderFrac + outsideBR * borderRest);
}
// Base our thickness check on the segment being less than a pixel and 1/2
twipsPerPixel += twipsPerPixel >> 2;
switch (whichSide) {
case NS_SIDE_TOP:
if (borderPart == BORDER_FULL) {
thickness = inside.y - outside.y;
// find the thickness of the piece being drawn
if ((whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_LEFT)) {
thickness = insideEdge - outsideEdge;
} else {
thickness = outsideEdge - insideEdge;
}
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
}
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
} else {
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
// if returning a line, do it along inside edge for bottom or right borders
// so that it's in the same place as it would be with polygons (why?)
// XXX The previous version of the code shortened the right border too.
if ( !((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL)) &&
((whichSide == NS_SIDE_BOTTOM) || (whichSide == NS_SIDE_RIGHT))) {
outsideEdge = insideEdge;
}
break;
case NS_SIDE_LEFT:
if (borderPart == BORDER_FULL) {
thickness = inside.x - outside.x;
aPoints[np++].MoveTo(outside.x, outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.x, inside.y);
aPoints[np++].MoveTo(inside.x, inside.YMost());
}
aPoints[np++].MoveTo(outside.x, outside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(inside.x, inside.y);
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
} else {
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(outside.x, outside.YMost());
// return the appropriate line or trapezoid
if ((whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_BOTTOM)) {
// top and bottom borders
aPoints[np++].MoveTo(outsideTL,outsideEdge);
aPoints[np++].MoveTo(outsideBR,outsideEdge);
// XXX Making this condition only (thickness >= twipsPerPixel) will
// improve double borders and some cases of groove/ridge,
// but will cause problems with table borders. See last and third
// from last tests in test4.htm
// Doing it this way emulates the old behavior. It might be worth
// fixing.
if ((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL) ) {
aPoints[np++].MoveTo(insideBR,insideEdge);
aPoints[np++].MoveTo(insideTL,insideEdge);
}
break;
case NS_SIDE_BOTTOM:
if (borderPart == BORDER_FULL) {
thickness = outside.YMost() - inside.YMost();
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
aPoints[np++].MoveTo(outside.x, inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), inside.YMost());
}
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
} else {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
// right and left borders
// XXX Ditto above
if ((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL) ) {
aPoints[np++].MoveTo(insideEdge,insideBR);
aPoints[np++].MoveTo(insideEdge,insideTL);
}
break;
case NS_SIDE_RIGHT:
if (borderPart == BORDER_FULL) {
thickness = outside.XMost() - inside.XMost();
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
}
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else {
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(outside.XMost(), outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
}
break;
aPoints[np++].MoveTo(outsideEdge,outsideTL);
aPoints[np++].MoveTo(outsideEdge,outsideBR);
}
return np;
}
@ -373,6 +356,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
const nscolor aBackgroundColor,
const nsRect& borderOutside,
const nsRect& borderInside,
PRIntn aSkipSides,
nscoord twipsPerPixel,
nsRect* aGap)
{
@ -391,7 +375,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
case NS_STYLE_BORDER_STYLE_GROOVE:
case NS_STYLE_BORDER_STYLE_RIDGE:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, aSkipSides,
BORDER_INSIDE, 0.5f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide,
((theStyle == NS_STYLE_BORDER_STYLE_RIDGE) ?
@ -406,7 +390,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
//aContext.FillPolygon (theSide, np);
FillPolygon (aContext, theSide, np, aGap);
}
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_OUTSIDE, 0.5f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_TRUE));
@ -420,7 +404,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_SOLID:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor (borderColor);
if (2 == np) {
@ -433,7 +417,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_DOUBLE:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_INSIDE, 0.333333f, twipsPerPixel);
aContext.SetColor (borderColor);
if (2 == np) {
@ -443,7 +427,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
//aContext.FillPolygon (theSide, np);
FillPolygon (aContext, theSide, np, aGap);
}
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_OUTSIDE, 0.333333f, twipsPerPixel);
if (2 == np) {
//aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y);
@ -456,7 +440,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
case NS_STYLE_BORDER_STYLE_BG_OUTSET:
case NS_STYLE_BORDER_STYLE_BG_INSET:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_FALSE));
@ -470,7 +454,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_OUTSET:
case NS_STYLE_BORDER_STYLE_INSET:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_TRUE));
@ -1444,7 +1428,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_TOP,
aBorderStyle.GetBorderStyle(NS_SIDE_TOP),
sideColor,
bgColor->mBackgroundColor, inside,outside,
bgColor->mBackgroundColor, inside,outside, aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1453,7 +1437,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_LEFT,
aBorderStyle.GetBorderStyle(NS_SIDE_LEFT),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1462,7 +1446,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_BOTTOM,
aBorderStyle.GetBorderStyle(NS_SIDE_BOTTOM),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1471,7 +1455,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_RIGHT,
aBorderStyle.GetBorderStyle(NS_SIDE_RIGHT),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1542,7 +1526,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1564,7 +1548,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside, aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1589,7 +1573,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1621,7 +1605,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}

Просмотреть файл

@ -151,6 +151,7 @@ protected:
nsIRenderingContext& aContext,
PRIntn whichSide,
const nsRect& outside, const nsRect& inside,
PRIntn aSkipSides,
PRIntn borderPart, float borderFrac,
nscoord twipsPerPixel);
@ -161,6 +162,7 @@ protected:
const nscolor aBackgroundColor,
const nsRect& borderOutside,
const nsRect& borderInside,
PRIntn aSkipSides,
nscoord twipsPerPixel,
nsRect* aGap = 0);

Просмотреть файл

@ -545,7 +545,7 @@ nsComboboxControlFrame::GetAbsoluteFramePosition(nsIPresContext& aPresContext,
// Add in the absolute offset of the widget.
nsRect absBounds;
widget->GetAbsoluteBounds(absBounds);
//XXX: Remove this widget->GetAbsoluteBounds(absBounds);
// Convert widget coordinates to twips
aAbsoluteTwipsRect.x += NSIntPixelsToTwips(absBounds.x, p2t);

Просмотреть файл

@ -545,7 +545,7 @@ nsComboboxControlFrame::GetAbsoluteFramePosition(nsIPresContext& aPresContext,
// Add in the absolute offset of the widget.
nsRect absBounds;
widget->GetAbsoluteBounds(absBounds);
//XXX: Remove this widget->GetAbsoluteBounds(absBounds);
// Convert widget coordinates to twips
aAbsoluteTwipsRect.x += NSIntPixelsToTwips(absBounds.x, p2t);

Просмотреть файл

@ -203,165 +203,148 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
nsIRenderingContext& aContext,
PRIntn whichSide,
const nsRect& outside, const nsRect& inside,
PRIntn aSkipSides,
PRIntn borderPart, float borderFrac,
nscoord twipsPerPixel)
{
float borderRest = 1.0f - borderFrac;
// XXX QQQ We really should decide to do a bevel based on whether there
// is a side adjacent or not. This could let you join borders across
// block elements (paragraphs).
PRIntn np = 0;
nscoord thickness;
nscoord thickness, outsideEdge, insideEdge, outsideTL, insideTL, outsideBR,
insideBR;
// Initialize the following six nscoord's:
// outsideEdge, insideEdge, outsideTL, insideTL, outsideBR, insideBR
// so that outsideEdge is the x or y of the outside edge, etc., and
// outsideTR is the y or x at the top or right end, etc., e.g.:
//
// outsideEdge --- ----------------------------------------
// \ /
// \ /
// \ /
// insideEdge ------- ----------------------------------
// | | | |
// outsideTL insideTL insideBR outsideBR
//
// if we don't want the bevel, we'll get rid of it later by setting
// outsideXX to insideXX
switch (whichSide) {
case NS_SIDE_TOP:
// the TL points are the left end; the BR points are the right end
outsideEdge = outside.y;
insideEdge = inside.y;
outsideTL = outside.x;
insideTL = inside.x;
insideBR = inside.XMost();
outsideBR = outside.XMost();
break;
case NS_SIDE_BOTTOM:
// the TL points are the left end; the BR points are the right end
outsideEdge = outside.YMost();
insideEdge = inside.YMost();
outsideTL = outside.x;
insideTL = inside.x;
insideBR = inside.XMost();
outsideBR = outside.XMost();
break;
case NS_SIDE_LEFT:
// the TL points are the top end; the BR points are the bottom end
outsideEdge = outside.x;
insideEdge = inside.x;
outsideTL = outside.y;
insideTL = inside.y;
insideBR = inside.YMost();
outsideBR = outside.YMost();
break;
case NS_SIDE_RIGHT:
// the TL points are the top end; the BR points are the bottom end
outsideEdge = outside.XMost();
insideEdge = inside.XMost();
outsideTL = outside.y;
insideTL = inside.y;
insideBR = inside.YMost();
outsideBR = outside.YMost();
break;
}
// Don't draw the bevels if an adjacent side is skipped
if ( (whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_BOTTOM) ) {
// a top or bottom side
if ((1<<NS_SIDE_LEFT) & aSkipSides) {
insideTL = outsideTL;
}
if ((1<<NS_SIDE_RIGHT) & aSkipSides) {
insideBR = outsideBR;
}
} else {
// a right or left side
if ((1<<NS_SIDE_TOP) & aSkipSides) {
insideTL = outsideTL;
}
if ((1<<NS_SIDE_BOTTOM) & aSkipSides) {
insideBR = outsideBR;
}
}
// move things around when only drawing part of the border
if (borderPart == BORDER_INSIDE) {
outsideEdge = nscoord(outsideEdge * borderFrac + insideEdge * borderRest);
outsideTL = nscoord(outsideTL * borderFrac + insideTL * borderRest);
outsideBR = nscoord(outsideBR * borderFrac + insideBR * borderRest);
} else if (borderPart == BORDER_OUTSIDE ) {
insideEdge = nscoord(insideEdge * borderFrac + outsideEdge * borderRest);
insideTL = nscoord(insideTL * borderFrac + outsideTL * borderRest);
insideBR = nscoord(insideBR * borderFrac + outsideBR * borderRest);
}
// Base our thickness check on the segment being less than a pixel and 1/2
twipsPerPixel += twipsPerPixel >> 2;
switch (whichSide) {
case NS_SIDE_TOP:
if (borderPart == BORDER_FULL) {
thickness = inside.y - outside.y;
// find the thickness of the piece being drawn
if ((whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_LEFT)) {
thickness = insideEdge - outsideEdge;
} else {
thickness = outsideEdge - insideEdge;
}
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
}
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
} else {
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
// if returning a line, do it along inside edge for bottom or right borders
// so that it's in the same place as it would be with polygons (why?)
// XXX The previous version of the code shortened the right border too.
if ( !((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL)) &&
((whichSide == NS_SIDE_BOTTOM) || (whichSide == NS_SIDE_RIGHT))) {
outsideEdge = insideEdge;
}
break;
case NS_SIDE_LEFT:
if (borderPart == BORDER_FULL) {
thickness = inside.x - outside.x;
aPoints[np++].MoveTo(outside.x, outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.x, inside.y);
aPoints[np++].MoveTo(inside.x, inside.YMost());
}
aPoints[np++].MoveTo(outside.x, outside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(inside.x, inside.y);
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
} else {
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(outside.x, outside.YMost());
// return the appropriate line or trapezoid
if ((whichSide == NS_SIDE_TOP) || (whichSide == NS_SIDE_BOTTOM)) {
// top and bottom borders
aPoints[np++].MoveTo(outsideTL,outsideEdge);
aPoints[np++].MoveTo(outsideBR,outsideEdge);
// XXX Making this condition only (thickness >= twipsPerPixel) will
// improve double borders and some cases of groove/ridge,
// but will cause problems with table borders. See last and third
// from last tests in test4.htm
// Doing it this way emulates the old behavior. It might be worth
// fixing.
if ((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL) ) {
aPoints[np++].MoveTo(insideBR,insideEdge);
aPoints[np++].MoveTo(insideTL,insideEdge);
}
break;
case NS_SIDE_BOTTOM:
if (borderPart == BORDER_FULL) {
thickness = outside.YMost() - inside.YMost();
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
aPoints[np++].MoveTo(outside.x, inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), inside.YMost());
}
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
} else {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(nscoord(inside.x * borderFrac +
outside.x * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
// right and left borders
// XXX Ditto above
if ((thickness >= twipsPerPixel) || (borderPart != BORDER_FULL) ) {
aPoints[np++].MoveTo(insideEdge,insideBR);
aPoints[np++].MoveTo(insideEdge,insideTL);
}
break;
case NS_SIDE_RIGHT:
if (borderPart == BORDER_FULL) {
thickness = outside.XMost() - inside.XMost();
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
}
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.y * borderFrac +
inside.y * borderRest));
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +
inside.XMost() * borderRest),
nscoord(outside.YMost() * borderFrac +
inside.YMost() * borderRest));
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else {
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.y * borderFrac +
outside.y * borderRest));
aPoints[np++].MoveTo(outside.XMost(), outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(nscoord(inside.XMost() * borderFrac +
outside.XMost() * borderRest),
nscoord(inside.YMost() * borderFrac +
outside.YMost() * borderRest));
}
break;
aPoints[np++].MoveTo(outsideEdge,outsideTL);
aPoints[np++].MoveTo(outsideEdge,outsideBR);
}
return np;
}
@ -373,6 +356,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
const nscolor aBackgroundColor,
const nsRect& borderOutside,
const nsRect& borderInside,
PRIntn aSkipSides,
nscoord twipsPerPixel,
nsRect* aGap)
{
@ -391,7 +375,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
case NS_STYLE_BORDER_STYLE_GROOVE:
case NS_STYLE_BORDER_STYLE_RIDGE:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside, aSkipSides,
BORDER_INSIDE, 0.5f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide,
((theStyle == NS_STYLE_BORDER_STYLE_RIDGE) ?
@ -406,7 +390,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
//aContext.FillPolygon (theSide, np);
FillPolygon (aContext, theSide, np, aGap);
}
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_OUTSIDE, 0.5f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_TRUE));
@ -420,7 +404,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_SOLID:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor (borderColor);
if (2 == np) {
@ -433,7 +417,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_DOUBLE:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_INSIDE, 0.333333f, twipsPerPixel);
aContext.SetColor (borderColor);
if (2 == np) {
@ -443,7 +427,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
//aContext.FillPolygon (theSide, np);
FillPolygon (aContext, theSide, np, aGap);
}
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_OUTSIDE, 0.333333f, twipsPerPixel);
if (2 == np) {
//aContext.DrawLine (theSide[0].x, theSide[0].y, theSide[1].x, theSide[1].y);
@ -456,7 +440,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
case NS_STYLE_BORDER_STYLE_BG_OUTSET:
case NS_STYLE_BORDER_STYLE_BG_INSET:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_FALSE));
@ -470,7 +454,7 @@ void nsCSSRendering::DrawSide(nsIRenderingContext& aContext,
break;
case NS_STYLE_BORDER_STYLE_OUTSET:
case NS_STYLE_BORDER_STYLE_INSET:
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,
np = MakeSide (theSide, aContext, whichSide, borderOutside, borderInside,aSkipSides,
BORDER_FULL, 1.0f, twipsPerPixel);
aContext.SetColor ( MakeBevelColor (whichSide, theStyle, aBackgroundColor,
theColor, PR_TRUE));
@ -1444,7 +1428,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_TOP,
aBorderStyle.GetBorderStyle(NS_SIDE_TOP),
sideColor,
bgColor->mBackgroundColor, inside,outside,
bgColor->mBackgroundColor, inside,outside, aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1453,7 +1437,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_LEFT,
aBorderStyle.GetBorderStyle(NS_SIDE_LEFT),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1462,7 +1446,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_BOTTOM,
aBorderStyle.GetBorderStyle(NS_SIDE_BOTTOM),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1471,7 +1455,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext,
DrawSide(aRenderingContext, NS_SIDE_RIGHT,
aBorderStyle.GetBorderStyle(NS_SIDE_RIGHT),
sideColor,
bgColor->mBackgroundColor,inside, outside,
bgColor->mBackgroundColor,inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1542,7 +1526,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1564,7 +1548,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside, aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1589,7 +1573,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}
@ -1621,7 +1605,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
borderEdge->mStyle,
borderEdge->mColor,
bgColor->mBackgroundColor,
inside, outside,
inside, outside,aSkipSides,
twipsPerPixel, aGap);
}
}

Просмотреть файл

@ -151,6 +151,7 @@ protected:
nsIRenderingContext& aContext,
PRIntn whichSide,
const nsRect& outside, const nsRect& inside,
PRIntn aSkipSides,
PRIntn borderPart, float borderFrac,
nscoord twipsPerPixel);
@ -161,6 +162,7 @@ protected:
const nscolor aBackgroundColor,
const nsRect& borderOutside,
const nsRect& borderInside,
PRIntn aSkipSides,
nscoord twipsPerPixel,
nsRect* aGap = 0);

Просмотреть файл

@ -1,70 +0,0 @@
<html>
<body>
<form>
<BR>
<P> empty listbox size = 3
<BR>
<select size = 3>
</select>
<P> Side by Side listboxes <P> (left - single select, right - multiselect)
<BR>
<select name=select1 size=2>
<option>option 1</option>
<option>option 2</option>
<option selected>option 3</option>
<option>option 4</option>
<option>option 5</option>
<option>option 6</option>
<option>option 7</option>
<option>option 8</option>
</select>
<select name=select2 size=4 multiple>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
<option>option 4</option>
<option>option 5</option>
</select>
<br>
<P> This listbox should be on a new line with now scrollbars
<BR>
<select name=select3 size=4 multiple>
<option>option 1</option>
<option>option 2</option>
</select>
<BR>
<P> This listbox has a specified width of 500px
<BR>
<select name=select4 style="width:500px;" size=2 multiple>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</select>
<BR>
<P> This listbox has a specified height of 100px
<BR>
<select name=select4 style="height:100px;" size=2 multiple>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</select>
<BR>
<P> This listbox should have 5pixel red inset borders
<P> the first option has orange text.
<P> the second option has yellow text.
<BR>
<select name=select5 style="border: 5px inset red;" size=3 multiple>
<option style="color:orange;">option 2</option>
<option style="color:yellow;">option 1</option>
<option>option 3</option>
<option>option 4</option>
</select>
<BR>
</body>
</body>
</html>

Просмотреть файл

@ -313,7 +313,7 @@ class nsIWidget : public nsISupports {
* @param aY the new y position expressed in the parent's coordinate system
*
**/
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY) = 0;
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY) = 0;
/**
* Resize this widget.
@ -323,9 +323,9 @@ class nsIWidget : public nsISupports {
* @param aRepaint whether the widget should be repainted
*
*/
NS_IMETHOD Resize(PRUint32 aWidth,
PRUint32 aHeight,
PRBool aRepaint) = 0;
NS_IMETHOD Resize(PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint) = 0;
/**
* Move or resize this widget.
@ -337,11 +337,11 @@ class nsIWidget : public nsISupports {
* @param aRepaint whether the widget should be repainted if the size changes
*
*/
NS_IMETHOD Resize(PRUint32 aX,
PRUint32 aY,
PRUint32 aWidth,
PRUint32 aHeight,
PRBool aRepaint) = 0;
NS_IMETHOD Resize(PRInt32 aX,
PRInt32 aY,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint) = 0;
/**
* Enable or disable this Widget
@ -364,14 +364,7 @@ class nsIWidget : public nsISupports {
*/
NS_IMETHOD GetBounds(nsRect &aRect) = 0;
/**
* Get this widget's absolute outside dimensions,
*
* @param aRect on return it holds the x. y, width and height of this widget
*
*/
NS_IMETHOD GetAbsoluteBounds(nsRect &aRect) = 0;
/**
* Get this widget's client area dimensions, if the window has a 3D border appearance
* this returns the area inside the border, The x and y are always zero

Просмотреть файл

@ -308,7 +308,7 @@ NS_METHOD nsWidget::IsVisible(PRBool &aState)
//
//-------------------------------------------------------------------------
NS_METHOD nsWidget::Move(PRUint32 aX, PRUint32 aY)
NS_METHOD nsWidget::Move(PRInt32 aX, PRInt32 aY)
{
if (mWidget) {
::gtk_layout_move(GTK_LAYOUT(mWidget->parent), mWidget, aX, aY);
@ -316,7 +316,7 @@ NS_METHOD nsWidget::Move(PRUint32 aX, PRUint32 aY)
return NS_OK;
}
NS_METHOD nsWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_METHOD nsWidget::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
#if 0
printf("nsWidget::Resize %s (%p) to %d %d\n",
@ -337,8 +337,8 @@ NS_METHOD nsWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
return NS_OK;
}
NS_METHOD nsWidget::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth,
PRUint32 aHeight, PRBool aRepaint)
NS_METHOD nsWidget::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth,
PRInt32 aHeight, PRBool aRepaint)
{
Resize(aWidth,aHeight,aRepaint);
Move(aX,aY);

Просмотреть файл

@ -87,10 +87,10 @@ class nsWidget : public nsBaseWidget
NS_IMETHOD Show(PRBool state);
NS_IMETHOD IsVisible(PRBool &aState);
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
NS_IMETHOD Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth,
PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth,
PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Enable(PRBool aState);
NS_IMETHOD SetFocus(void);

Просмотреть файл

@ -693,7 +693,17 @@ NS_METHOD nsWindow::ShowMenuBar(PRBool aShow)
return NS_OK;
}
NS_METHOD nsWindow::IsMenuBarVisible(PRBool *aVisible)
{
*aVisible = PR_TRUE;
return NS_ERROR_FAILURE; // todo: (maybe. method isn't actually used yet.)
}
<<<<<<< nsWindow.cpp
NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
=======
NS_METHOD nsWindow::Move(PRUint32 aX, PRUint32 aY)
>>>>>>> 1.135
{
// not implimented for toplevel windows
if (mIsToplevel && mShell)
@ -719,7 +729,7 @@ NS_METHOD nsWindow::Move(PRUint32 aX, PRUint32 aY)
}
NS_METHOD nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_METHOD nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
#if 0
printf("nsWidget::Resize %s (%p) to %d %d\n",
@ -759,8 +769,8 @@ NS_METHOD nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
}
NS_METHOD nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth,
PRUint32 aHeight, PRBool aRepaint)
NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth,
PRInt32 aHeight, PRBool aRepaint)
{
Resize(aWidth,aHeight,aRepaint);
Move(aX,aY);

Просмотреть файл

@ -62,11 +62,16 @@ public:
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
NS_IMETHOD Show(PRBool aShow);
NS_IMETHOD ShowMenuBar(PRBool aShow);
<<<<<<< nsWindow.h
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
=======
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
>>>>>>> 1.45
NS_IMETHOD Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth,
PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth,
PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);

Просмотреть файл

@ -487,7 +487,7 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState)
// Move this window
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMacWindow::Move(PRUint32 aX, PRUint32 aY)
NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY)
{
if (mWindowMadeHere)
{
@ -567,7 +567,7 @@ NS_IMETHODIMP nsMacWindow::Move(PRUint32 aX, PRUint32 aY)
// Resize this window
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMacWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_IMETHODIMP nsMacWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
if (mWindowMadeHere)
{

Просмотреть файл

@ -72,8 +72,8 @@ public:
nsNativeWidget aNativeParent = nsnull);
NS_IMETHOD Show(PRBool aState);
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
virtual PRBool OnPaint(nsPaintEvent &event);
NS_IMETHOD SetTitle(const nsString& aTitle);

Просмотреть файл

@ -563,7 +563,7 @@ NS_METHOD nsTextAreaWidget::GetText(nsString& aTextBuffer, PRUint32 aBufferSize
* @param aRepaint -- indicates if a repaint is needed.
* @return PR_TRUE if the pt is contained in the widget
*/
NS_IMETHODIMP nsTextAreaWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_IMETHODIMP nsTextAreaWidget::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
return Resize(0, 0, aWidth, aHeight, aRepaint);
}
@ -578,7 +578,7 @@ NS_IMETHODIMP nsTextAreaWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool
* @param aW
* @return PR_TRUE
*/
NS_IMETHODIMP nsTextAreaWidget::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_IMETHODIMP nsTextAreaWidget::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
Inherited::Resize(aX, aY, aWidth, aHeight, aRepaint);

Просмотреть файл

@ -67,8 +67,8 @@ public:
NS_IMETHOD GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel);
NS_IMETHOD SetCaretPosition(PRUint32 aPosition);
NS_IMETHOD GetCaretPosition(PRUint32& aPosition);
NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRUint32 aX, PRUint32 aY,PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
virtual PRBool OnPaint(nsPaintEvent & aEvent);

Просмотреть файл

@ -525,7 +525,7 @@ NS_IMETHODIMP nsWindow::GetBounds(nsRect &aRect)
// Move this component
// aX and aY are in the parent widget coordinate system
//-------------------------------------------------------------------------
NS_IMETHODIMP nsWindow::Move(PRUint32 aX, PRUint32 aY)
NS_IMETHODIMP nsWindow::Move(PRInt32 aX, PRInt32 aY)
{
if ((mBounds.x != aX) || (mBounds.y != aY))
{
@ -551,7 +551,7 @@ NS_IMETHODIMP nsWindow::Move(PRUint32 aX, PRUint32 aY)
// Resize this component
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
if ((mBounds.width != aWidth) || (mBounds.height != aHeight))
{
@ -577,7 +577,7 @@ NS_IMETHODIMP nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepain
// Resize this component
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_IMETHODIMP nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
nsWindow::Move(aX, aY);
nsWindow::Resize(aWidth, aHeight, aRepaint);

Просмотреть файл

@ -84,9 +84,9 @@ public:
NS_IMETHOD Show(PRBool aState);
NS_IMETHOD IsVisible(PRBool & aState);
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRUint32 aX, PRUint32 aY,PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint);
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD Enable(PRBool bState);
NS_IMETHOD SetFocus(void);

Просмотреть файл

@ -659,6 +659,10 @@ nsresult nsWindow::StandardWindowCreate(nsIWidget *aParent,
extendedStyle = WS_EX_TOPMOST;
style = WS_POPUP;
mBorderlessParent = parent;
// Get the top most level window to use as the parent
while (::GetParent(parent)) {
parent = ::GetParent(parent);
}
}
if (aInitData->mBorderStyle != eBorderStyle_all) {
@ -882,7 +886,7 @@ NS_METHOD nsWindow::IsVisible(PRBool & bState)
// Move this component
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Move(PRUint32 aX, PRUint32 aY)
NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
{
// When moving a borderless top-level window the window
// must be placed relative to its parent. WIN32 wants to
@ -931,8 +935,10 @@ NS_METHOD nsWindow::Move(PRUint32 aX, PRUint32 aY)
// Resize this component
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
NS_METHOD nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
{
NS_ASSERTION((aWidth >=0 ) , "Negative width passed to nsWindow::Resize");
NS_ASSERTION((aHeight >=0 ), "Negative height passed to nsWindow::Resize");
// Set cached value for lightweight and printing
mBounds.width = aWidth;
mBounds.height = aHeight;
@ -970,12 +976,15 @@ NS_METHOD nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
// Resize this component
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Resize(PRUint32 aX,
PRUint32 aY,
PRUint32 aWidth,
PRUint32 aHeight,
NS_METHOD nsWindow::Resize(PRInt32 aX,
PRInt32 aY,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint)
{
NS_ASSERTION((aWidth >=0 ), "Negative width passed to nsWindow::Resize");
NS_ASSERTION((aHeight >=0 ), "Negative height passed to nsWindow::Resize");
// Set cached value for lightweight and printing
mBounds.x = aX;
mBounds.y = aY;
@ -1082,28 +1091,6 @@ NS_METHOD nsWindow::GetBounds(nsRect &aRect)
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the bounding rectangle in screen coordinates
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::GetAbsoluteBounds(nsRect &aRect)
{
if (mWnd) {
RECT r;
VERIFY(::GetWindowRect(mWnd, &r));
// assign size
aRect.width = r.right - r.left;
aRect.height = r.bottom - r.top;
aRect.x = r.left;
aRect.y = r.top;
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get this component dimension

Просмотреть файл

@ -87,18 +87,17 @@ public:
HWND mBorderlessParent;
NS_IMETHOD CaptureMouse(PRBool aCapture);
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
NS_IMETHOD Resize(PRUint32 aWidth,
PRUint32 aHeight,
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Resize(PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint);
NS_IMETHOD Resize(PRUint32 aX,
PRUint32 aY,
PRUint32 aWidth,
PRUint32 aHeight,
NS_IMETHOD Resize(PRInt32 aX,
PRInt32 aY,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint);
NS_IMETHOD Enable(PRBool bState);
NS_IMETHOD SetFocus(void);
NS_IMETHOD GetAbsoluteBounds(nsRect &aRect);
NS_IMETHOD GetBounds(nsRect &aRect);
NS_IMETHOD GetClientBounds(nsRect &aRect);
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);

Просмотреть файл

@ -650,16 +650,6 @@ NS_METHOD nsBaseWidget::GetBounds(nsRect &aRect)
return NS_OK;
}
/**
* This implementation of nsWindow MUST be overridden.
*
**/
NS_METHOD nsBaseWidget::GetAbsoluteBounds(nsRect &aRect)
{
return NS_ERROR_FAILURE;
}
/**
* If the implementation of nsWindow supports borders this method MUST be overridden

Просмотреть файл

@ -55,7 +55,6 @@ public:
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aWidgetInitData) { return NS_OK;}
// nsIWidget interface
NS_IMETHOD GetAbsoluteBounds(nsRect &aRect);
NS_IMETHOD CaptureMouse(PRBool aCapture);
NS_IMETHOD GetClientData(void*& aClientData);
NS_IMETHOD SetClientData(void* aClientData);