зеркало из https://github.com/mozilla/gecko-dev.git
turn off frameborders ala nav4; mouse sensitive to frame borders, but can't yet resize
This commit is contained in:
Родитель
9558775bba
Коммит
8e54395b27
|
@ -518,7 +518,6 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
float t2p = aPresContext.GetTwipsToPixels();
|
float t2p = aPresContext.GetTwipsToPixels();
|
||||||
nsIPresShell *presShell = aPresContext.GetShell();
|
nsIPresShell *presShell = aPresContext.GetShell();
|
||||||
NS_RELEASE(presShell);
|
|
||||||
|
|
||||||
// create, init, set the parent of the view
|
// create, init, set the parent of the view
|
||||||
nsIView* view;
|
nsIView* view;
|
||||||
|
@ -535,6 +534,7 @@ nsHTMLFrameInnerFrame::CreateWebShell(nsIPresContext& aPresContext,
|
||||||
nsRect viewBounds(origin.x, origin.y, aSize.width, aSize.height);
|
nsRect viewBounds(origin.x, origin.y, aSize.width, aSize.height);
|
||||||
|
|
||||||
nsIViewManager* viewMan = presShell->GetViewManager();
|
nsIViewManager* viewMan = presShell->GetViewManager();
|
||||||
|
NS_RELEASE(presShell);
|
||||||
rv = view->Init(viewMan, viewBounds, parView, &kCChildCID);
|
rv = view->Init(viewMan, viewBounds, parView, &kCChildCID);
|
||||||
viewMan->InsertChild(parView, view, 0);
|
viewMan->InsertChild(parView, view, 0);
|
||||||
NS_RELEASE(viewMan);
|
NS_RELEASE(viewMan);
|
||||||
|
|
|
@ -42,6 +42,36 @@
|
||||||
#include "nsIDocumentLoader.h"
|
#include "nsIDocumentLoader.h"
|
||||||
class nsHTMLIFrame;
|
class nsHTMLIFrame;
|
||||||
|
|
||||||
|
/*
|
||||||
|
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||||
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
|
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||||
|
static NS_DEFINE_IID(kIWebFrameIID, NS_IWEBFRAME_IID);
|
||||||
|
static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID);
|
||||||
|
static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID);
|
||||||
|
static NS_DEFINE_IID(kCViewCID, NS_VIEW_CID);
|
||||||
|
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||||
|
static NS_DEFINE_IID(kCDocumentLoaderCID, NS_DOCUMENTLOADER_CID);
|
||||||
|
|
||||||
|
static NS_DEFINE_IID(kIContentViewerContainerIID,
|
||||||
|
NS_ICONTENT_VIEWER_CONTAINER_IID);
|
||||||
|
static NS_DEFINE_IID(kIDocumentLoaderIID, NS_IDOCUMENTLOADER_IID);
|
||||||
|
*/
|
||||||
|
// masks for mEdgeVisibility
|
||||||
|
#define LEFT 0x0001
|
||||||
|
#define RIGHT 0x0002
|
||||||
|
#define TOP 0x0004
|
||||||
|
#define BOTTOM 0x0008
|
||||||
|
#define ALL 0x000F
|
||||||
|
#define NONE 0x0000
|
||||||
|
|
||||||
|
enum nsMouseState {
|
||||||
|
eMouseNone,
|
||||||
|
eMouseEnter,
|
||||||
|
eMouseDown,
|
||||||
|
eMouseUp,
|
||||||
|
eMouseDrag
|
||||||
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* nsHTMLFramesetBorderFrame
|
* nsHTMLFramesetBorderFrame
|
||||||
|
@ -51,6 +81,10 @@ class nsHTMLFramesetBorderFrame : public nsLeafFrame {
|
||||||
public:
|
public:
|
||||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||||
|
|
||||||
|
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||||
|
nsGUIEvent* aEvent,
|
||||||
|
nsEventStatus& aEventStatus);
|
||||||
|
|
||||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||||
nsIRenderingContext& aRenderingContext,
|
nsIRenderingContext& aRenderingContext,
|
||||||
const nsRect& aDirtyRect);
|
const nsRect& aDirtyRect);
|
||||||
|
@ -60,13 +94,19 @@ public:
|
||||||
const nsReflowState& aReflowState,
|
const nsReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
|
PRBool GetVisibility() { return mVisibility; }
|
||||||
|
void SetVisibility(PRBool aVisibility);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParentFrame, PRBool aVertical);
|
nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParentFrame,
|
||||||
|
PRBool aVertical, PRBool aVisible);
|
||||||
virtual ~nsHTMLFramesetBorderFrame();
|
virtual ~nsHTMLFramesetBorderFrame();
|
||||||
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
||||||
const nsReflowState& aReflowState,
|
const nsReflowState& aReflowState,
|
||||||
nsReflowMetrics& aDesiredSize);
|
nsReflowMetrics& aDesiredSize);
|
||||||
PRBool mVertical;
|
PRBool mVertical;
|
||||||
|
PRBool mVisibility;
|
||||||
|
nsMouseState mLastMouseState;
|
||||||
friend class nsHTMLFramesetFrame;
|
friend class nsHTMLFramesetFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,6 +124,7 @@ nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsIContent* aContent, nsIFrame* aParent
|
||||||
mNumCols = 0;
|
mNumCols = 0;
|
||||||
mColSpecs = nsnull;
|
mColSpecs = nsnull;
|
||||||
mColSizes = nsnull;
|
mColSizes = nsnull;
|
||||||
|
mEdgeVisibility = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
|
nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
|
||||||
|
@ -460,6 +501,22 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
||||||
aChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
aChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a duplicate of code in nsHTMLFrame.cpp to eliminate having to break out
|
||||||
|
// a header and include it.
|
||||||
|
PRBool nsHTMLFramesetFrame::GetFrameBorder(nsHTMLTagContent* aContent)
|
||||||
|
{
|
||||||
|
nsHTMLValue value;
|
||||||
|
if (eContentAttr_HasValue == (aContent->GetAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||||
|
if (eHTMLUnit_String == value.GetUnit()) {
|
||||||
|
nsAutoString frameborder;
|
||||||
|
value.GetStringValue(frameborder);
|
||||||
|
if (frameborder.EqualsIgnoreCase("0")) {
|
||||||
|
return PR_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
|
@ -475,6 +532,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
mRowSizes = new nscoord[mNumRows];
|
mRowSizes = new nscoord[mNumRows];
|
||||||
mColSizes = new nscoord[mNumCols];
|
mColSizes = new nscoord[mNumCols];
|
||||||
}
|
}
|
||||||
|
PRInt32 numCells = mNumRows*mNumCols;
|
||||||
|
|
||||||
// XXX check to see if our size actually changes before recomputing
|
// XXX check to see if our size actually changes before recomputing
|
||||||
|
|
||||||
|
@ -495,6 +553,31 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
CalculateRowCol(&aPresContext, width, mNumCols, mColSpecs, mColSizes);
|
CalculateRowCol(&aPresContext, width, mNumCols, mColSpecs, mColSizes);
|
||||||
CalculateRowCol(&aPresContext, height, mNumRows, mRowSpecs, mRowSizes);
|
CalculateRowCol(&aPresContext, height, mNumRows, mRowSpecs, mRowSizes);
|
||||||
|
|
||||||
|
PRBool* verBordersVis; // vertival borders visibility
|
||||||
|
nsHTMLFramesetBorderFrame** verBorders; // vertical borders
|
||||||
|
PRBool* horBordersVis; // horizontal borders visibility
|
||||||
|
nsHTMLFramesetBorderFrame** horBorders; // horizontal borders
|
||||||
|
PRBool* isFrameset; // frameset/frame distinction of children
|
||||||
|
PRBool* hasBorderAttr; // the frameborder attr of non border children
|
||||||
|
if (firstTime) {
|
||||||
|
verBorders = new nsHTMLFramesetBorderFrame*[mNumCols]; // 1 more than number of ver borders
|
||||||
|
verBordersVis = new PRBool[mNumCols];
|
||||||
|
for (int verX = 0; verX < mNumCols; verX++) {
|
||||||
|
verBorders[verX] = nsnull;
|
||||||
|
verBordersVis[verX] = PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
horBorders = new nsHTMLFramesetBorderFrame*[mNumRows]; // 1 more than number of hor borders
|
||||||
|
horBordersVis = new PRBool[mNumRows];
|
||||||
|
for (int horX = 0; horX < mNumRows; horX++) {
|
||||||
|
horBorders[horX] = nsnull;
|
||||||
|
horBordersVis[horX] = PR_FALSE;
|
||||||
|
}
|
||||||
|
isFrameset = new PRBool[numCells];
|
||||||
|
hasBorderAttr = new PRBool[numCells];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// create the children frames; skip content which isn't <frameset> or <frame>
|
// create the children frames; skip content which isn't <frameset> or <frame>
|
||||||
nsIFrame* lastChild = nsnull;
|
nsIFrame* lastChild = nsnull;
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
|
@ -508,6 +591,8 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
}
|
}
|
||||||
nsIAtom* tag = child->GetTag();
|
nsIAtom* tag = child->GetTag();
|
||||||
if ((nsHTMLAtoms::frameset == tag) || (nsHTMLAtoms::frame == tag)) {
|
if ((nsHTMLAtoms::frameset == tag) || (nsHTMLAtoms::frame == tag)) {
|
||||||
|
isFrameset[mChildCount] = (nsHTMLAtoms::frameset == tag);
|
||||||
|
hasBorderAttr[mChildCount] = (nsHTMLAtoms::frameset == tag) ? PR_FALSE : GetFrameBorder(child);
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
nsresult result = nsHTMLBase::CreateFrame(&aPresContext, this, child, nsnull, frame);
|
nsresult result = nsHTMLBase::CreateFrame(&aPresContext, this, child, nsnull, frame);
|
||||||
NS_RELEASE(child);
|
NS_RELEASE(child);
|
||||||
|
@ -528,44 +613,46 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
// reflow the children
|
// reflow the children
|
||||||
PRInt32 lastRow = 0;
|
PRInt32 lastRow = 0;
|
||||||
PRInt32 borderX = mNonBorderChildCount; // index of border children
|
PRInt32 borderChildX = mNonBorderChildCount; // index of border children
|
||||||
nsIFrame* borderFrame = nsnull;
|
nsHTMLFramesetBorderFrame* borderFrame = nsnull;
|
||||||
nsPoint offset(0,0);
|
nsPoint offset(0,0);
|
||||||
|
|
||||||
nsSize size, lastSize;
|
nsSize size, lastSize;
|
||||||
nsIFrame* child = mFirstChild;
|
nsIFrame* child = mFirstChild;
|
||||||
|
|
||||||
for (PRInt32 childX = 0; childX < mNonBorderChildCount; childX++) {
|
for (PRInt32 childX = 0; childX < mNonBorderChildCount; childX++) {
|
||||||
nsPoint cellIndex;
|
nsPoint cellIndex;
|
||||||
GetSizeOfChildAt(childX, size, cellIndex);
|
GetSizeOfChildAt(childX, size, cellIndex);
|
||||||
|
|
||||||
if (lastRow != cellIndex.y) { // changed to next row
|
if (lastRow != cellIndex.y) { // changed to next row
|
||||||
if (firstTime) { // create horizontal border
|
if (firstTime) { // create horizontal border
|
||||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, PR_FALSE);
|
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, PR_FALSE, PR_FALSE);
|
||||||
mChildCount++;
|
mChildCount++;
|
||||||
lastChild->SetNextSibling(borderFrame);
|
lastChild->SetNextSibling(borderFrame);
|
||||||
lastChild = borderFrame;
|
lastChild = borderFrame;
|
||||||
|
horBorders[cellIndex.y-1] = borderFrame;
|
||||||
} else {
|
} else {
|
||||||
ChildAt(borderX, borderFrame);
|
ChildAt(borderChildX, (nsIFrame*&)borderFrame);
|
||||||
borderX++;
|
borderChildX++;
|
||||||
}
|
}
|
||||||
offset.x = 0;
|
offset.x = 0;
|
||||||
offset.y += lastSize.height;
|
offset.y += lastSize.height;
|
||||||
nsSize borderSize(size.width, borderWidth);
|
nsSize borderSize(aDesiredSize.width, borderWidth);
|
||||||
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
||||||
offset.y += borderWidth;
|
offset.y += borderWidth;
|
||||||
} else {
|
} else {
|
||||||
if (cellIndex.x > 0) { // moved to next col
|
if (cellIndex.x > 0) { // moved to next col in same row
|
||||||
if (0 == cellIndex.y) { // in 1st row
|
if (0 == cellIndex.y) { // in 1st row
|
||||||
if (firstTime) { // create vertical border
|
if (firstTime) { // create vertical border
|
||||||
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, PR_TRUE);
|
borderFrame = new nsHTMLFramesetBorderFrame(mContent, this, PR_TRUE, PR_FALSE);
|
||||||
mChildCount++;
|
mChildCount++;
|
||||||
lastChild->SetNextSibling(borderFrame);
|
lastChild->SetNextSibling(borderFrame);
|
||||||
lastChild = borderFrame;
|
lastChild = borderFrame;
|
||||||
|
verBorders[cellIndex.x-1] = borderFrame;
|
||||||
} else {
|
} else {
|
||||||
ChildAt(borderX, borderFrame);
|
ChildAt(borderChildX, (nsIFrame*&)borderFrame);
|
||||||
borderX++;
|
borderChildX++;
|
||||||
}
|
}
|
||||||
nsSize borderSize(borderWidth, size.height);
|
nsSize borderSize(borderWidth, aDesiredSize.height);
|
||||||
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
ReflowPlaceChild(borderFrame, aPresContext, aReflowState, offset, borderSize);
|
||||||
}
|
}
|
||||||
offset.x += borderWidth;
|
offset.x += borderWidth;
|
||||||
|
@ -574,12 +661,63 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
ReflowPlaceChild(child, aPresContext, aReflowState, offset, size);
|
ReflowPlaceChild(child, aPresContext, aReflowState, offset, size);
|
||||||
|
|
||||||
|
if (firstTime) {
|
||||||
|
PRInt32 childVis;
|
||||||
|
if (isFrameset[childX]) {
|
||||||
|
childVis = ((nsHTMLFramesetFrame*)child)->mEdgeVisibility;
|
||||||
|
} else {
|
||||||
|
childVis = (hasBorderAttr[childX]) ? ALL : NONE;
|
||||||
|
}
|
||||||
|
// set the visibility of our edge borders based on children
|
||||||
|
if ((0 == cellIndex.x) && (!(mEdgeVisibility & LEFT))) {
|
||||||
|
mEdgeVisibility |= (LEFT & childVis);
|
||||||
|
}
|
||||||
|
if ((0 == cellIndex.y) && (!(mEdgeVisibility & TOP))) {
|
||||||
|
mEdgeVisibility |= (TOP & childVis);
|
||||||
|
}
|
||||||
|
if ((mNumCols-1 == cellIndex.x) && (!(mEdgeVisibility & RIGHT))) {
|
||||||
|
mEdgeVisibility |= (RIGHT & childVis);
|
||||||
|
}
|
||||||
|
if ((mNumRows-1 == cellIndex.y) && (!(mEdgeVisibility & BOTTOM))) {
|
||||||
|
mEdgeVisibility |= (BOTTOM & childVis);
|
||||||
|
}
|
||||||
|
// set the visibility of borders that the child may affect
|
||||||
|
if (childVis & RIGHT) {
|
||||||
|
verBordersVis[cellIndex.x] = PR_TRUE;
|
||||||
|
}
|
||||||
|
if (childVis & BOTTOM) {
|
||||||
|
horBordersVis[cellIndex.y] = PR_TRUE;
|
||||||
|
}
|
||||||
|
if ((cellIndex.x > 0) && (childVis & LEFT)) {
|
||||||
|
verBordersVis[cellIndex.x-1] = PR_TRUE;
|
||||||
|
}
|
||||||
|
if ((cellIndex.y > 0) && (childVis & TOP)) {
|
||||||
|
horBordersVis[cellIndex.y-1] = PR_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
lastRow = cellIndex.y;
|
lastRow = cellIndex.y;
|
||||||
lastSize = size;
|
lastSize = size;
|
||||||
offset.x += size.width;
|
offset.x += size.width;
|
||||||
child->GetNextSibling(child);
|
child->GetNextSibling(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstTime) {
|
||||||
|
// set the visibility of borders
|
||||||
|
for (int verX = 0; verX < mNumCols-1; verX++) {
|
||||||
|
verBorders[verX]->SetVisibility(verBordersVis[verX]);
|
||||||
|
}
|
||||||
|
for (int horX = 0; horX < mNumRows-1; horX++) {
|
||||||
|
horBorders[horX]->SetVisibility(horBordersVis[horX]);
|
||||||
|
}
|
||||||
|
|
||||||
|
delete[] verBordersVis;
|
||||||
|
delete[] verBorders;
|
||||||
|
delete[] horBordersVis;
|
||||||
|
delete[] horBorders;
|
||||||
|
delete[] isFrameset;
|
||||||
|
delete[] hasBorderAttr;
|
||||||
|
}
|
||||||
|
|
||||||
if (nsnull != aDesiredSize.maxElementSize) {
|
if (nsnull != aDesiredSize.maxElementSize) {
|
||||||
aDesiredSize.maxElementSize->width = aDesiredSize.width;
|
aDesiredSize.maxElementSize->width = aDesiredSize.width;
|
||||||
aDesiredSize.maxElementSize->height = aDesiredSize.height;
|
aDesiredSize.maxElementSize->height = aDesiredSize.height;
|
||||||
|
@ -661,9 +799,11 @@ NS_NewHTMLFrameset(nsIHTMLContent** aInstancePtrResult,
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* nsHTMLFramesetBorderFrame
|
* nsHTMLFramesetBorderFrame
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParent, PRBool aVertical)
|
nsHTMLFramesetBorderFrame::nsHTMLFramesetBorderFrame(nsIContent* aContent, nsIFrame* aParent,
|
||||||
: nsLeafFrame(aContent, aParent), mVertical(aVertical)
|
PRBool aVertical, PRBool aVisibility)
|
||||||
|
: nsLeafFrame(aContent, aParent), mVertical(aVertical), mVisibility(aVisibility)
|
||||||
{
|
{
|
||||||
|
mLastMouseState = eMouseNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHTMLFramesetBorderFrame::~nsHTMLFramesetBorderFrame()
|
nsHTMLFramesetBorderFrame::~nsHTMLFramesetBorderFrame()
|
||||||
|
@ -680,6 +820,12 @@ void nsHTMLFramesetBorderFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||||
aDesiredSize.descent = 0;
|
aDesiredSize.descent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nsHTMLFramesetBorderFrame::SetVisibility(PRBool aVisibility)
|
||||||
|
{
|
||||||
|
mVisibility = aVisibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
nsHTMLFramesetBorderFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
|
@ -705,7 +851,7 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext& aPresContext,
|
||||||
nscoord y1 = (mVertical) ? mRect.height : x0;
|
nscoord y1 = (mVertical) ? mRect.height : x0;
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
nscolor color = NS_RGB(colors[i], colors[i], colors[i]);
|
nscolor color = (mVisibility) ? NS_RGB(colors[i], colors[i], colors[i]) : NS_RGB(255,255,255);
|
||||||
aRenderingContext.SetColor (color);
|
aRenderingContext.SetColor (color);
|
||||||
aRenderingContext.DrawLine (x0, y0, x1, y1);
|
aRenderingContext.DrawLine (x0, y0, x1, y1);
|
||||||
if (mVertical) {
|
if (mVertical) {
|
||||||
|
@ -719,6 +865,60 @@ nsHTMLFramesetBorderFrame::Paint(nsIPresContext& aPresContext,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_METHOD nsHTMLFramesetBorderFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||||
|
nsGUIEvent* aEvent,
|
||||||
|
nsEventStatus& aEventStatus)
|
||||||
|
{
|
||||||
|
aEventStatus = nsEventStatus_eIgnore;
|
||||||
|
nsIWidget* window;
|
||||||
|
switch (aEvent->message) {
|
||||||
|
case NS_MOUSE_ENTER:
|
||||||
|
break;
|
||||||
|
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||||
|
mLastMouseState =
|
||||||
|
(eMouseEnter == mLastMouseState) ? eMouseDown : eMouseNone;
|
||||||
|
break;
|
||||||
|
case NS_MOUSE_MOVE:
|
||||||
|
// this is incomplete and belongs in mouse_enter, but mouse_enter is getting
|
||||||
|
// consumed by someone up the chain
|
||||||
|
// if (eMouseDrag != mLastMouseState) {
|
||||||
|
GetWindow(window);
|
||||||
|
if (window) {
|
||||||
|
nsCursor cursor = (mVertical) ? eCursor_sizeWE : eCursor_sizeNS;
|
||||||
|
window->SetCursor(cursor);
|
||||||
|
NS_RELEASE(window);
|
||||||
|
aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
|
}
|
||||||
|
if (eMouseDown == mLastMouseState) {
|
||||||
|
//((nsInput*)mContent)->SetClickPoint(NS_TO_INT_ROUND(conv * aEvent->point.x),
|
||||||
|
// NS_TO_INT_ROUND(conv * aEvent->point.y));
|
||||||
|
//MouseClicked(&aPresContext);
|
||||||
|
mLastMouseState = eMouseDrag;
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
mLastMouseState = eMouseDrag;
|
||||||
|
break;
|
||||||
|
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||||
|
if (eMouseDrag == mLastMouseState) {
|
||||||
|
//((nsInput*)mContent)->SetClickPoint(NS_TO_INT_ROUND(conv * aEvent->point.x),
|
||||||
|
// NS_TO_INT_ROUND(conv * aEvent->point.y));
|
||||||
|
//MouseClicked(&aPresContext);
|
||||||
|
}
|
||||||
|
mLastMouseState = eMouseUp;
|
||||||
|
break;
|
||||||
|
case NS_MOUSE_EXIT:
|
||||||
|
GetWindow(window);
|
||||||
|
if (window) {
|
||||||
|
window->SetCursor(eCursor_standard);
|
||||||
|
NS_RELEASE(window);
|
||||||
|
aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||||
|
}
|
||||||
|
mLastMouseState = eMouseNone;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsHTMLFramesetBorderFrame::List(FILE* out, PRInt32 aIndent) const
|
NS_IMETHODIMP nsHTMLFramesetBorderFrame::List(FILE* out, PRInt32 aIndent) const
|
||||||
{
|
{
|
||||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); // Indent
|
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); // Indent
|
||||||
|
|
|
@ -84,6 +84,8 @@ protected:
|
||||||
|
|
||||||
PRInt32 GetBorderWidth(nsIPresContext* aPresContext);
|
PRInt32 GetBorderWidth(nsIPresContext* aPresContext);
|
||||||
|
|
||||||
|
PRBool GetFrameBorder(nsHTMLTagContent* aFrameContent);
|
||||||
|
|
||||||
virtual PRIntn GetSkipSides() const;
|
virtual PRIntn GetSkipSides() const;
|
||||||
|
|
||||||
void ParseRowCol(nsIAtom* aAttrType, PRInt32& aNumSpecs, nsFramesetSpec** aSpecs);
|
void ParseRowCol(nsIAtom* aAttrType, PRInt32& aNumSpecs, nsFramesetSpec** aSpecs);
|
||||||
|
@ -103,6 +105,7 @@ protected:
|
||||||
nsFramesetSpec* mColSpecs; // parsed, non-computed dimensions
|
nsFramesetSpec* mColSpecs; // parsed, non-computed dimensions
|
||||||
nscoord* mColSizes; // currently computed col sizes
|
nscoord* mColSizes; // currently computed col sizes
|
||||||
PRInt32 mNonBorderChildCount;
|
PRInt32 mNonBorderChildCount;
|
||||||
|
PRInt32 mEdgeVisibility;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
|
@ -91,7 +91,11 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
|
||||||
///(Selecting something, usually rendered as an IBeam)
|
///(Selecting something, usually rendered as an IBeam)
|
||||||
eCursor_select,
|
eCursor_select,
|
||||||
///(can hyper-link, usually rendered as a human hand)
|
///(can hyper-link, usually rendered as a human hand)
|
||||||
eCursor_hyperlink };
|
eCursor_hyperlink,
|
||||||
|
///(west/east sizing, usually rendered as ->||<-)
|
||||||
|
eCursor_sizeWE,
|
||||||
|
///(north/south sizing, usually rendered as sizeWE rotated 90 degrees)
|
||||||
|
eCursor_sizeNS };
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1063,6 +1063,14 @@ void nsWindow::SetCursor(nsCursor aCursor)
|
||||||
newCursor = ::LoadCursor(NULL, IDC_ARROW);
|
newCursor = ::LoadCursor(NULL, IDC_ARROW);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case eCursor_sizeWE:
|
||||||
|
newCursor = ::LoadCursor(NULL, IDC_SIZEWE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case eCursor_sizeNS:
|
||||||
|
newCursor = ::LoadCursor(NULL, IDC_SIZENS);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
NS_ASSERTION(0, "Invalid cursor type");
|
NS_ASSERTION(0, "Invalid cursor type");
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче