1998-04-14 00:24:54 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
#ifndef nsFrame_h___
|
|
|
|
#define nsFrame_h___
|
|
|
|
|
|
|
|
#include "nsIFrame.h"
|
1998-10-01 08:46:11 +04:00
|
|
|
#include "nsIHTMLReflow.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsRect.h"
|
1998-11-19 20:22:29 +03:00
|
|
|
#include "nsString.h"
|
1998-05-20 20:24:36 +04:00
|
|
|
#include "prlog.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
/**
|
|
|
|
* nsFrame logging constants. We redefine the nspr
|
|
|
|
* PRLogModuleInfo.level field to be a bitfield. Each bit controls a
|
|
|
|
* specific type of logging. Each logging operation has associated
|
|
|
|
* inline methods defined below.
|
|
|
|
*/
|
|
|
|
#define NS_FRAME_TRACE_CALLS 0x1
|
|
|
|
#define NS_FRAME_TRACE_PUSH_PULL 0x2
|
|
|
|
#define NS_FRAME_TRACE_CHILD_REFLOW 0x4
|
1998-06-25 20:33:10 +04:00
|
|
|
#define NS_FRAME_TRACE_NEW_FRAMES 0x8
|
1998-05-20 20:24:36 +04:00
|
|
|
|
|
|
|
#define NS_FRAME_LOG_TEST(_lm,_bit) (PRIntn((_lm)->level) & (_bit))
|
|
|
|
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
#define NS_FRAME_LOG(_bit,_args) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
|
|
|
PR_LogPrint _args; \
|
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
#else
|
|
|
|
#define NS_FRAME_LOG(_bit,_args)
|
|
|
|
#endif
|
|
|
|
|
1998-06-25 20:33:10 +04:00
|
|
|
// XXX Need to rework this so that logging is free when it's off
|
1998-05-20 20:24:36 +04:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
#define NS_FRAME_TRACE_IN(_method) Trace(_method, PR_TRUE)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#define NS_FRAME_TRACE_OUT(_method) Trace(_method, PR_FALSE)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
|
|
|
// XXX remove me
|
|
|
|
#define NS_FRAME_TRACE_MSG(_bit,_args) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
|
|
|
TraceMsg _args; \
|
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
|
|
|
#define NS_FRAME_TRACE(_bit,_args) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
if (NS_FRAME_LOG_TEST(nsIFrame::GetLogModuleInfo(),_bit)) { \
|
|
|
|
TraceMsg _args; \
|
|
|
|
} \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#define NS_FRAME_TRACE_REFLOW_IN(_method) Trace(_method, PR_TRUE)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status) \
|
|
|
|
Trace(_method, PR_FALSE, _status)
|
1998-06-25 20:33:10 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#else
|
1998-07-08 02:07:35 +04:00
|
|
|
#define NS_FRAME_TRACE(_bits,_args)
|
1998-05-20 20:24:36 +04:00
|
|
|
#define NS_FRAME_TRACE_IN(_method)
|
|
|
|
#define NS_FRAME_TRACE_OUT(_method)
|
1998-06-25 20:33:10 +04:00
|
|
|
#define NS_FRAME_TRACE_MSG(_bits,_args)
|
1998-05-20 20:24:36 +04:00
|
|
|
#define NS_FRAME_TRACE_REFLOW_IN(_method)
|
|
|
|
#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status)
|
|
|
|
#endif
|
|
|
|
|
1999-06-11 01:08:17 +04:00
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
//----------------------------------------------------------------------
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-10-17 00:09:32 +04:00
|
|
|
/**
|
|
|
|
* Implementation of a simple frame that's not splittable and has no
|
|
|
|
* child frames.
|
|
|
|
*
|
|
|
|
* Sets the NS_FRAME_SYNCHRONIZE_FRAME_AND_VIEW bit, so the default
|
|
|
|
* behavior is to keep the frame and view position and size in sync.
|
|
|
|
*/
|
1998-10-01 08:46:11 +04:00
|
|
|
class nsFrame : public nsIFrame, public nsIHTMLReflow
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Create a new "empty" frame that maps a given piece of content into a
|
|
|
|
* 0,0 area.
|
|
|
|
*/
|
1998-12-03 09:31:43 +03:00
|
|
|
friend nsresult NS_NewEmptyFrame(nsIFrame** aInstancePtrResult);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
// Overloaded new operator. Initializes the memory to 0
|
1999-02-26 23:02:06 +03:00
|
|
|
NS_DECL_ZEROING_OPERATOR_NEW
|
1999-02-26 20:05:20 +03:00
|
|
|
|
1998-06-06 01:06:24 +04:00
|
|
|
// nsISupports
|
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-06-02 09:28:11 +04:00
|
|
|
// nsIFrame
|
1998-12-03 09:31:43 +03:00
|
|
|
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
|
|
|
nsIContent* aContent,
|
1999-01-14 08:16:23 +03:00
|
|
|
nsIFrame* aParent,
|
1999-02-25 06:27:57 +03:00
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* asPrevInFlow);
|
1998-11-10 09:05:32 +03:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
1999-01-15 04:29:15 +03:00
|
|
|
NS_IMETHOD AppendFrames(nsIPresContext& aPresContext,
|
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList);
|
|
|
|
NS_IMETHOD InsertFrames(nsIPresContext& aPresContext,
|
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
|
|
|
NS_IMETHOD RemoveFrame(nsIPresContext& aPresContext,
|
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame);
|
1999-07-22 08:32:31 +04:00
|
|
|
NS_IMETHOD ReplaceFrame(nsIPresContext& aPresContext,
|
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame,
|
|
|
|
nsIFrame* aNewFrame);
|
1999-07-22 06:24:52 +04:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext& aPresContext);
|
1999-02-10 03:42:56 +03:00
|
|
|
NS_IMETHOD GetContent(nsIContent** aContent) const;
|
|
|
|
NS_IMETHOD GetStyleContext(nsIStyleContext** aStyleContext) const;
|
1998-06-06 01:06:24 +04:00
|
|
|
NS_IMETHOD SetStyleContext(nsIPresContext* aPresContext,
|
|
|
|
nsIStyleContext* aContext);
|
|
|
|
NS_IMETHOD GetStyleData(nsStyleStructID aSID,
|
|
|
|
const nsStyleStruct*& aStyleStruct) const;
|
1999-09-04 03:35:14 +04:00
|
|
|
NS_IMETHOD GetAdditionalStyleContext(PRInt32 aIndex,
|
|
|
|
nsIStyleContext** aStyleContext) const;
|
|
|
|
NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex,
|
|
|
|
nsIStyleContext* aStyleContext);
|
1999-02-10 04:36:30 +03:00
|
|
|
NS_IMETHOD GetParent(nsIFrame** aParent) const;
|
1999-01-14 08:16:23 +03:00
|
|
|
NS_IMETHOD SetParent(const nsIFrame* aParent);
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD GetRect(nsRect& aRect) const;
|
|
|
|
NS_IMETHOD GetOrigin(nsPoint& aPoint) const;
|
|
|
|
NS_IMETHOD GetSize(nsSize& aSize) const;
|
|
|
|
NS_IMETHOD SetRect(const nsRect& aRect);
|
|
|
|
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
|
|
|
|
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
|
1999-02-10 05:25:01 +03:00
|
|
|
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex, nsIAtom** aListName) const;
|
|
|
|
NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame** aFirstChild) const;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
1998-12-18 18:54:23 +03:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer);
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
|
|
|
nsGUIEvent* aEvent,
|
|
|
|
nsEventStatus& aEventStatus);
|
1998-11-18 08:25:26 +03:00
|
|
|
NS_IMETHOD GetCursor(nsIPresContext& aPresContext,
|
|
|
|
nsPoint& aPoint,
|
|
|
|
PRInt32& aCursor);
|
|
|
|
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
|
|
|
|
nsIFrame** aFrame);
|
1999-02-12 03:02:31 +03:00
|
|
|
|
|
|
|
NS_IMETHOD GetPointFromOffset(nsIPresContext* inPresContext,
|
|
|
|
nsIRenderingContext* inRendContext,
|
|
|
|
PRInt32 inOffset,
|
|
|
|
nsPoint* outPoint);
|
|
|
|
|
|
|
|
NS_IMETHOD GetChildFrameContainingOffset(PRInt32 inContentOffset,
|
1999-09-11 04:18:02 +04:00
|
|
|
PRBool inHint,
|
1999-02-12 03:02:31 +03:00
|
|
|
PRInt32* outFrameContentOffset,
|
|
|
|
nsIFrame* *outChildFrame);
|
|
|
|
|
1999-10-13 05:15:26 +04:00
|
|
|
static nsresult GetNextPrevLineFromeBlockFrame(nsPeekOffsetStruct *aPos,
|
1999-07-15 22:19:03 +04:00
|
|
|
nsIFrame *aBlockFrame,
|
|
|
|
PRInt32 aLineStart,
|
1999-10-13 05:15:26 +04:00
|
|
|
PRInt8 aOutSideLimit
|
1999-07-15 22:19:03 +04:00
|
|
|
);
|
|
|
|
|
1999-02-10 07:17:06 +03:00
|
|
|
NS_IMETHOD GetFrameState(nsFrameState* aResult);
|
1998-05-14 04:47:32 +04:00
|
|
|
NS_IMETHOD SetFrameState(nsFrameState aNewState);
|
1998-09-24 05:50:16 +04:00
|
|
|
|
1998-09-30 03:44:25 +04:00
|
|
|
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
|
1998-05-08 08:45:37 +04:00
|
|
|
nsIContent* aChild,
|
|
|
|
nsISupports* aSubContent);
|
1998-09-30 03:44:25 +04:00
|
|
|
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
1998-09-18 23:53:27 +04:00
|
|
|
nsIContent* aChild,
|
1999-10-16 03:16:45 +04:00
|
|
|
PRInt32 aNameSpaceID,
|
1998-09-30 03:44:25 +04:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aHint);
|
1999-09-10 09:52:23 +04:00
|
|
|
NS_IMETHOD ContentStateChanged(nsIPresContext* aPresContext,
|
|
|
|
nsIContent* aChild,
|
|
|
|
PRInt32 aHint);
|
1998-05-22 08:54:11 +04:00
|
|
|
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
1999-02-24 07:48:08 +03:00
|
|
|
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetPrevInFlow(nsIFrame*);
|
1999-02-24 07:48:08 +03:00
|
|
|
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetNextInFlow(nsIFrame*);
|
|
|
|
NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame);
|
|
|
|
NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame);
|
|
|
|
NS_IMETHOD RemoveFromFlow();
|
|
|
|
NS_IMETHOD BreakFromPrevFlow();
|
|
|
|
NS_IMETHOD BreakFromNextFlow();
|
1999-02-10 08:38:18 +03:00
|
|
|
NS_IMETHOD GetView(nsIView** aView) const;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetView(nsIView* aView);
|
1999-02-10 08:38:18 +03:00
|
|
|
NS_IMETHOD GetParentWithView(nsIFrame** aParent) const;
|
|
|
|
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView** aView) const;
|
|
|
|
NS_IMETHOD GetWindow(nsIWidget**) const;
|
1999-02-10 07:17:06 +03:00
|
|
|
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
1998-05-14 02:38:09 +04:00
|
|
|
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
|
1999-02-10 09:13:38 +03:00
|
|
|
NS_IMETHOD GetNextSibling(nsIFrame** aNextSibling) const;
|
1998-04-17 05:41:24 +04:00
|
|
|
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
|
1998-09-06 00:57:57 +04:00
|
|
|
NS_IMETHOD Scrolled(nsIView *aView);
|
1999-01-16 03:00:50 +03:00
|
|
|
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
|
1998-11-19 20:22:29 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
|
|
|
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent);
|
1999-08-31 07:09:40 +04:00
|
|
|
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
1998-06-06 01:06:24 +04:00
|
|
|
NS_IMETHOD VerifyTree() const;
|
1999-05-20 04:52:00 +04:00
|
|
|
NS_IMETHOD SetSelected(nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread);
|
1999-04-26 08:02:04 +04:00
|
|
|
NS_IMETHOD GetSelected(PRBool *aSelected) const;
|
1999-09-10 22:29:37 +04:00
|
|
|
NS_IMETHOD PeekOffset(nsPeekOffsetStruct *aPos) ;
|
1999-02-02 03:23:40 +03:00
|
|
|
|
1999-01-22 21:58:14 +03:00
|
|
|
NS_IMETHOD GetOffsets(PRInt32 &aStart, PRInt32 &aEnd) const;
|
1999-02-18 06:25:23 +03:00
|
|
|
|
1998-10-01 08:46:11 +04:00
|
|
|
// nsIHTMLReflow
|
|
|
|
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
|
1998-10-02 08:10:00 +04:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
1998-10-01 08:46:11 +04:00
|
|
|
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
|
|
|
nsDidReflowStatus aStatus);
|
1998-10-10 03:46:02 +04:00
|
|
|
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
|
1998-10-27 19:51:21 +03:00
|
|
|
NS_IMETHOD AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace);
|
1999-04-20 04:26:32 +04:00
|
|
|
NS_IMETHOD TrimTrailingWhiteSpace(nsIPresContext* aPresContext,
|
1998-10-27 19:51:21 +03:00
|
|
|
nsIRenderingContext& aRC,
|
|
|
|
nscoord& aDeltaWidth);
|
1998-10-01 08:46:11 +04:00
|
|
|
|
1998-10-08 22:21:32 +04:00
|
|
|
// Selection Methods
|
1999-02-18 06:25:23 +03:00
|
|
|
// XXX Doc me... (in nsIFrame.h puhleeze)
|
1998-10-08 22:21:32 +04:00
|
|
|
// XXX If these are selection specific, then the name should imply selection
|
|
|
|
// rather than generic event processing, e.g., SelectionHandlePress...
|
1998-08-28 19:58:37 +04:00
|
|
|
NS_IMETHOD HandlePress(nsIPresContext& aPresContext,
|
1998-10-08 22:21:32 +04:00
|
|
|
nsGUIEvent * aEvent,
|
|
|
|
nsEventStatus& aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
1999-05-17 04:21:18 +04:00
|
|
|
NS_IMETHOD HandleMultiplePress(nsIPresContext& aPresContext,
|
|
|
|
nsGUIEvent * aEvent,
|
|
|
|
nsEventStatus& aEventStatus);
|
|
|
|
|
1998-08-28 19:58:37 +04:00
|
|
|
NS_IMETHOD HandleDrag(nsIPresContext& aPresContext,
|
1998-10-08 22:21:32 +04:00
|
|
|
nsGUIEvent * aEvent,
|
|
|
|
nsEventStatus& aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
|
|
|
NS_IMETHOD HandleRelease(nsIPresContext& aPresContext,
|
1998-10-08 22:21:32 +04:00
|
|
|
nsGUIEvent * aEvent,
|
|
|
|
nsEventStatus& aEventStatus);
|
1998-08-28 19:58:37 +04:00
|
|
|
|
1999-09-30 00:04:05 +04:00
|
|
|
NS_IMETHOD GetContentAndOffsetsFromPoint(nsIPresContext& aCX,
|
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsIContent ** aNewContent,
|
|
|
|
PRInt32& aContentOffset,
|
1999-10-13 05:15:26 +04:00
|
|
|
PRInt32& aContentOffsetEnd,
|
|
|
|
PRBool& aBeginFrameContent);
|
1999-09-30 00:04:05 +04:00
|
|
|
|
|
|
|
|
1998-06-06 01:06:24 +04:00
|
|
|
//--------------------------------------------------
|
|
|
|
// Additional methods
|
1998-06-04 02:49:45 +04:00
|
|
|
|
1998-06-02 09:28:11 +04:00
|
|
|
// Invalidate part of the frame by asking the view manager to repaint.
|
|
|
|
// aDamageRect is in the frame's local coordinate space
|
1998-09-25 03:56:15 +04:00
|
|
|
void Invalidate(const nsRect& aDamageRect,
|
|
|
|
PRBool aImmediate = PR_FALSE) const;
|
1998-06-02 09:28:11 +04:00
|
|
|
|
1998-10-09 00:35:16 +04:00
|
|
|
// Helper function to return the index in parent of the frame's content
|
|
|
|
// object. Returns -1 on error or if the frame doesn't have a content object
|
|
|
|
static PRInt32 ContentIndexInContainer(const nsIFrame* aFrame);
|
|
|
|
|
1999-08-28 01:48:06 +04:00
|
|
|
// Helper function that tests if the frame tree is too deep; if it
|
|
|
|
// is it marks the frame as "unflowable" and zeros out the metrics
|
|
|
|
// and returns PR_TRUE. Otherwise, the frame is unmarked
|
|
|
|
// "unflowable" and the metrics are not touched and PR_FALSE is
|
|
|
|
// returned.
|
|
|
|
PRBool IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
|
|
|
|
nsHTMLReflowMetrics& aMetrics);
|
|
|
|
|
1999-09-30 00:04:05 +04:00
|
|
|
virtual nsresult GetClosestViewForFrame(nsIFrame *aFrame, nsIView **aView);
|
|
|
|
|
1998-05-20 20:24:36 +04:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
/**
|
|
|
|
* Tracing method that writes a method enter/exit routine to the
|
|
|
|
* nspr log using the nsIFrame log module. The tracing is only
|
|
|
|
* done when the NS_FRAME_TRACE_CALLS bit is set in the log module's
|
|
|
|
* level field.
|
|
|
|
*/
|
|
|
|
void Trace(const char* aMethod, PRBool aEnter);
|
|
|
|
void Trace(const char* aMethod, PRBool aEnter, nsReflowStatus aStatus);
|
|
|
|
void TraceMsg(const char* fmt, ...);
|
1999-07-24 06:37:06 +04:00
|
|
|
|
|
|
|
// Helper function that verifies that each frame in the list has the
|
|
|
|
// NS_FRAME_IS_DIRTY bit set
|
|
|
|
static void VerifyDirtyBitSet(nsIFrame* aFrameList);
|
1998-05-20 20:24:36 +04:00
|
|
|
#endif
|
|
|
|
|
1998-11-19 20:22:29 +03:00
|
|
|
void ListTag(FILE* out) const {
|
1998-12-12 22:20:10 +03:00
|
|
|
ListTag(out, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ListTag(FILE* out, const nsIFrame* aFrame) {
|
1998-11-19 20:22:29 +03:00
|
|
|
nsAutoString tmp;
|
1998-12-12 22:20:10 +03:00
|
|
|
aFrame->GetFrameName(tmp);
|
1998-11-19 20:22:29 +03:00
|
|
|
fputs(tmp, out);
|
1998-12-12 22:20:10 +03:00
|
|
|
fprintf(out, "@%p", aFrame);
|
1998-11-19 20:22:29 +03:00
|
|
|
}
|
|
|
|
|
1998-12-05 19:03:07 +03:00
|
|
|
static void IndentBy(FILE* out, PRInt32 aIndent) {
|
|
|
|
while (--aIndent >= 0) fputs(" ", out);
|
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
protected:
|
1998-12-05 19:03:07 +03:00
|
|
|
// Protected constructor and destructor
|
|
|
|
nsFrame();
|
|
|
|
virtual ~nsFrame();
|
|
|
|
|
1998-08-04 03:39:16 +04:00
|
|
|
PRBool DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurnOn = PR_FALSE);
|
1998-05-08 22:33:42 +04:00
|
|
|
|
|
|
|
// Style post processing hook
|
1998-05-27 03:13:26 +04:00
|
|
|
NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext);
|
1998-05-08 22:33:42 +04:00
|
|
|
|
1998-11-19 20:22:29 +03:00
|
|
|
/**
|
|
|
|
* Dump out the "base classes" regression data. This should dump
|
|
|
|
* out the interior data, not the "frame" XML container. And it
|
|
|
|
* should call the base classes same named method before doing
|
|
|
|
* anything specific in a derived class. This means that derived
|
|
|
|
* classes need not override DumpRegressionData unless they need
|
|
|
|
* some custom behavior that requires changing how the outer "frame"
|
|
|
|
* XML container is dumped.
|
|
|
|
*/
|
|
|
|
virtual void DumpBaseRegressionData(FILE* out, PRInt32 aIndent);
|
|
|
|
|
|
|
|
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
|
|
|
|
|
1998-11-19 20:55:22 +03:00
|
|
|
static void XMLQuote(nsString& aString);
|
|
|
|
|
1999-06-02 03:04:13 +04:00
|
|
|
virtual PRBool ParentDisablesSelection() const;
|
|
|
|
|
1999-04-10 21:32:22 +04:00
|
|
|
// Set the clip rect into the rendering-context after applying CSS's
|
|
|
|
// clip property. This method assumes that the caller has checked
|
|
|
|
// that the clip property applies to its situation.
|
|
|
|
void SetClipRect(nsIRenderingContext& aRenderingContext);
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
nsRect mRect;
|
|
|
|
nsIContent* mContent;
|
|
|
|
nsIStyleContext* mStyleContext;
|
1999-01-14 08:16:23 +03:00
|
|
|
nsIFrame* mParent;
|
1998-04-14 00:24:54 +04:00
|
|
|
nsIFrame* mNextSibling; // singly linked list of frames
|
1998-05-14 04:47:32 +04:00
|
|
|
nsFrameState mState;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-05-08 22:33:42 +04:00
|
|
|
|
|
|
|
// Selection data is valid only from the Mouse Press to the Mouse Release
|
|
|
|
///////////////////////////////////
|
|
|
|
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
private:
|
|
|
|
nsIView* mView; // must use accessor member functions
|
1998-12-07 06:43:02 +03:00
|
|
|
protected:
|
1998-04-14 00:24:54 +04:00
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsFrame_h___ */
|