зеркало из https://github.com/mozilla/pjs.git
AIX's new compiler, xlC5.x, doesn't allow the use of "friend" to declare
a function prototype. So we have to decare the function and then declare it a friend. When Default arguments are used, they need to be specified in the function prototype and NOT in the friend declaration. # 43311 r=dbaron@fas.harvard.edu
This commit is contained in:
Родитель
71be78e5cf
Коммит
02f1ef38dd
|
@ -82,6 +82,8 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
NS_IMETHODIMP NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
||||
|
||||
class nsXULControllers : public nsIControllers
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -56,6 +56,8 @@
|
|||
{ 0x0d871e30, 0x1dd2, 0x11b2, \
|
||||
{ 0x8e, 0xa9, 0x83, 0x17, 0x78, 0xc7, 0x8e, 0x93 }}
|
||||
|
||||
class nsLDAPConnectionLoop;
|
||||
|
||||
class nsLDAPConnection : public nsILDAPConnection,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIDNSListener
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include "baseutils.h"
|
||||
#include "TxObject.h"
|
||||
|
||||
class txListIterator;
|
||||
|
||||
/**
|
||||
* Represents an ordered list of Object pointers. Modeled after a Java 2 List.
|
||||
**/
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include "TxString.h"
|
||||
#include "baseutils.h"
|
||||
|
||||
class StringListIterator;
|
||||
|
||||
class StringList {
|
||||
friend class StringListIterator;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include "nsFrame.h"
|
||||
|
||||
nsresult NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsIFrame** aInstancePtrResult);
|
||||
|
||||
/**
|
||||
* Implementation of a frame that's used as a placeholder for a frame that
|
||||
* has been moved out of the flow
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include "nsFrame.h"
|
||||
|
||||
nsresult NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsIFrame** aInstancePtrResult);
|
||||
|
||||
/**
|
||||
* Implementation of a frame that's used as a placeholder for a frame that
|
||||
* has been moved out of the flow
|
||||
|
|
|
@ -77,14 +77,19 @@ class nsHTMLInfo;
|
|||
#define NS_STATE_EQUAL_SIZE 0x40000000
|
||||
#define NS_STATE_IS_DIRECTION_NORMAL 0x80000000
|
||||
|
||||
nsresult NS_NewBoxFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
class nsBoxFrame : public nsContainerFrame, public nsContainerBox
|
||||
{
|
||||
public:
|
||||
|
||||
friend nsresult NS_NewBoxFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
PRBool aIsRoot,
|
||||
nsIBoxLayout* aLayoutManager);
|
||||
|
||||
// gets the rect inside our border and debug border. If you wish to paint inside a box
|
||||
// call this method to get the rect so you don't draw on the debug border or outer border.
|
||||
|
|
|
@ -102,6 +102,8 @@ public:
|
|||
|
||||
#define SET_COORD(aX, aY, coord, isHorizontal) if (isHorizontal) { aX = (coord); } else { aY = (coord); }
|
||||
|
||||
nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
|
||||
|
||||
class nsSprocketLayout : public nsBoxLayout {
|
||||
|
||||
public:
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
#include "nsBoxLayout.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
|
||||
|
||||
class nsStackLayout : public nsBoxLayout
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
class nsTreeIndentationFrame : public nsFrame {
|
||||
public:
|
||||
friend nsresult NS_NewTreeIndentationFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
|
||||
// nsIHTMLReflow
|
||||
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
nsTreeIndentationFrame();
|
||||
|
||||
protected:
|
||||
virtual ~nsTreeIndentationFrame();
|
||||
|
||||
nscoord mWidth;
|
||||
PRBool mHaveComputedWidth;
|
||||
};
|
|
@ -1,60 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#include "nsBoxFrame.h"
|
||||
|
||||
class nsXULTreeCellFrame : public nsBoxFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewXULTreeCellFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint, // Overridden to capture events
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
protected:
|
||||
nsXULTreeCellFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsXULTreeCellFrame();
|
||||
|
||||
protected: // Data Members
|
||||
|
||||
}; // class nsXULTreeCellFrame
|
|
@ -1,82 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#include "nsBoxFrame.h"
|
||||
#include "nsITreeFrame.h"
|
||||
|
||||
class nsXULTreeOuterGroupFrame;
|
||||
class nsIPresShell;
|
||||
|
||||
class nsXULTreeFrame : public nsBoxFrame, public nsITreeFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewXULTreeFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
// nsITreeFrame
|
||||
NS_IMETHOD EnsureRowIsVisible(PRInt32 aRowIndex);
|
||||
NS_IMETHOD GetNextItem(nsIDOMElement* aStartItem, PRInt32 aDelta, nsIDOMElement** aResult);
|
||||
NS_IMETHOD GetPreviousItem(nsIDOMElement* aStartItem, PRInt32 aDelta, nsIDOMElement** aResult);
|
||||
NS_IMETHOD ScrollToIndex(PRInt32 aRowIndex);
|
||||
NS_IMETHOD ScrollByLines(nsIPresContext* aPresContext, PRInt32 aNumLines);
|
||||
NS_IMETHOD GetItemAtIndex(PRInt32 aIndex, nsIDOMElement** aResult);
|
||||
NS_IMETHOD GetIndexOfItem(nsIPresContext* aPresContext, nsIDOMElement* aElement, PRInt32* aResult);
|
||||
NS_IMETHOD GetNumberOfVisibleRows(PRInt32 *aResult);
|
||||
NS_IMETHOD GetIndexOfFirstVisibleRow(PRInt32 *aResult);
|
||||
NS_IMETHOD GetRowCount(PRInt32* aResult);
|
||||
NS_IMETHOD BeginBatch();
|
||||
NS_IMETHOD EndBatch();
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext, nsIContent* aChild,
|
||||
PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint);
|
||||
|
||||
protected:
|
||||
nsXULTreeFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsXULTreeFrame();
|
||||
|
||||
public:
|
||||
void GetTreeBody(nsXULTreeOuterGroupFrame** aResult);
|
||||
|
||||
protected: // Data Members
|
||||
nsIPresShell* mPresShell;
|
||||
}; // class nsXULTreeFrame
|
|
@ -1,169 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
* Mike Pinkerton (pinkerton@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#ifndef NSXULTREEGROUPFRAME
|
||||
#define NSXULTREEGROUPFRAME
|
||||
|
||||
|
||||
#include "nsBoxFrame.h"
|
||||
#include "nsIXULTreeSlice.h"
|
||||
|
||||
class nsCSSFrameConstructor;
|
||||
class nsXULTreeOuterGroupFrame;
|
||||
class nsTreeItemDragCapturer;
|
||||
|
||||
class nsXULTreeGroupFrame : public nsBoxFrame, public nsIXULTreeSlice
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
friend nsresult NS_NewXULTreeGroupFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
protected:
|
||||
nsXULTreeGroupFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsXULTreeGroupFrame();
|
||||
|
||||
void LocateFrame(nsIFrame* aStartFrame, nsIFrame** aResult);
|
||||
|
||||
public:
|
||||
void InitGroup(nsCSSFrameConstructor* aFC, nsIPresContext* aContext, nsXULTreeOuterGroupFrame* aOuterFrame)
|
||||
{
|
||||
mFrameConstructor = aFC;
|
||||
mPresContext = aContext;
|
||||
mOuterFrame = aOuterFrame;
|
||||
}
|
||||
|
||||
// overridden for d&d setup and feedback
|
||||
NS_IMETHOD Init ( nsIPresContext* aPresContext, nsIContent* aContent,
|
||||
nsIFrame* aParent, nsIStyleContext* aContext, nsIFrame* aPrevInFlow) ;
|
||||
NS_IMETHOD Paint(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags = 0);
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext, nsIContent* aChild,
|
||||
PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint) ;
|
||||
|
||||
nsXULTreeOuterGroupFrame* GetOuterFrame() { return mOuterFrame; };
|
||||
nsIBox* GetFirstTreeBox(PRBool* aCreated = nsnull);
|
||||
nsIBox* GetNextTreeBox(nsIBox* aBox, PRBool* aCreated = nsnull);
|
||||
|
||||
nsIFrame* GetFirstFrame();
|
||||
nsIFrame* GetNextFrame(nsIFrame* aCurrFrame);
|
||||
nsIFrame* GetLastFrame();
|
||||
|
||||
NS_IMETHOD TreeAppendFrames(nsIFrame* aFrameList);
|
||||
|
||||
NS_IMETHOD TreeInsertFrames(nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList);
|
||||
|
||||
NS_IMETHOD Redraw(nsBoxLayoutState& aState,
|
||||
const nsRect* aDamageRect,
|
||||
PRBool aImmediate);
|
||||
|
||||
// Responses to changes
|
||||
void OnContentInserted(nsIPresContext* aPresContext, nsIFrame* aNextSibling, PRInt32 aIndex);
|
||||
void OnContentRemoved(nsIPresContext* aPresContext, nsIFrame* aChildFrame, PRInt32 aIndex, PRInt32& aOnScreenRowCount);
|
||||
|
||||
// nsIXULTreeSlice
|
||||
NS_IMETHOD IsOutermostFrame(PRBool* aResult) { *aResult = PR_FALSE; return NS_OK; };
|
||||
NS_IMETHOD IsGroupFrame(PRBool* aResult) { *aResult = PR_TRUE; return NS_OK; };
|
||||
NS_IMETHOD IsRowFrame(PRBool* aResult) { *aResult = PR_FALSE; return NS_OK; };
|
||||
NS_IMETHOD GetOnScreenRowCount(PRInt32* aCount);
|
||||
|
||||
// nsIBox
|
||||
NS_IMETHOD NeedsRecalc();
|
||||
|
||||
virtual nscoord GetAvailableHeight() { return mAvailableHeight; };
|
||||
void SetAvailableHeight(nscoord aHeight) { mAvailableHeight = aHeight; };
|
||||
|
||||
virtual nscoord GetYPosition() { return 0; };
|
||||
PRBool ContinueReflow(nscoord height);
|
||||
|
||||
void DestroyRows(PRInt32& aRowsToLose);
|
||||
void ReverseDestroyRows(PRInt32& aRowsToLose);
|
||||
void GetFirstRowContent(nsIContent** aResult);
|
||||
|
||||
void SetContentChain(nsISupportsArray* aContentChain);
|
||||
void InitSubContentChain(nsXULTreeGroupFrame* aRowGroupFrame);
|
||||
|
||||
protected:
|
||||
|
||||
// handle drawing the drop feedback
|
||||
void PaintDropFeedback ( nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext,
|
||||
PRBool aPaintSorted ) ;
|
||||
void PaintSortedDropFeedback ( nscolor inColor, nsIRenderingContext& inRenderingContext, float & inP2T ) ;
|
||||
void PaintOnContainerDropFeedback ( nscolor inColor, nsIRenderingContext& inRenderingContext,
|
||||
nsIPresContext* inPresContext, float & inP2T ) ;
|
||||
void PaintInBetweenDropFeedback ( nscolor inColor, nsIRenderingContext& inRenderingContext,
|
||||
nsIPresContext* inPresContext, float & inP2T ) ;
|
||||
|
||||
// helpers for drop feedback
|
||||
PRInt32 FindIndentation ( nsIPresContext* inPresContext, nsIFrame* inStartFrame ) const ;
|
||||
void FindFirstChildTreeItemFrame ( nsIPresContext* inPresContext, nsIFrame** outChild ) const ;
|
||||
PRBool IsOpenContainer ( ) const ;
|
||||
nscolor GetColorFromStyleContext ( nsIPresContext* inPresContext, nsIAtom* inAtom,
|
||||
nscolor inDefaultColor ) ;
|
||||
static void ForceDrawFrame ( nsIPresContext* aPresContext, nsIFrame * aFrame ) ;
|
||||
|
||||
nsCSSFrameConstructor* mFrameConstructor; // We don't own this. (No addref/release allowed, punk.)
|
||||
nsIPresContext* mPresContext;
|
||||
nsXULTreeOuterGroupFrame* mOuterFrame;
|
||||
nscoord mAvailableHeight;
|
||||
nsIFrame* mTopFrame;
|
||||
nsIFrame* mBottomFrame;
|
||||
nsIFrame* mLinkupFrame;
|
||||
nsISupportsArray* mContentChain; // Our content chain
|
||||
PRInt32 mOnScreenRowCount;
|
||||
|
||||
// -- members for drag and drop --
|
||||
|
||||
// our event capturer registered with the content model. See the discussion
|
||||
// in Init() for why this is a weak ref.
|
||||
nsTreeItemDragCapturer* mDragCapturer;
|
||||
|
||||
// only used during drag and drop for drop feedback. These are not
|
||||
// guaranteed to be meaningful when no drop is underway.
|
||||
PRInt32 mYDropLoc;
|
||||
PRPackedBool mDropOnContainer;
|
||||
|
||||
}; // class nsXULTreeGroupFrame
|
||||
|
||||
|
||||
#endif
|
|
@ -1,264 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
* Mike Pinkerton (pinkerton@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#ifndef NSXULTREEOUTERGROUPFRAME
|
||||
#define NSXULTREEOUTERGROUPFRAME
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsBoxLayoutState.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsXULTreeGroupFrame.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsIReflowCallback.h"
|
||||
|
||||
class nsCSSFrameConstructor;
|
||||
class nsDragOverListener;
|
||||
class nsDragAutoScrollTimer;
|
||||
class nsScrollSmoother;
|
||||
|
||||
|
||||
// I want to eventually use a delay so that the user has to hover over
|
||||
// the top or bottom of a tree during a drag to get it to auto-scroll, but
|
||||
// right now Mac can't handle timers during a drag so I'm punting and the
|
||||
// tree will just always scroll when you drag the mouse near the top or
|
||||
// bottom. Leaving the code around so that if we ever get this, we'll be
|
||||
// good (pinkerton)
|
||||
#define USE_TIMER_TO_DELAY_SCROLLING 0
|
||||
|
||||
class nsXULTreeRowGroupInfo {
|
||||
public:
|
||||
PRInt32 mRowCount;
|
||||
nsCOMPtr<nsISupportsArray> mTickArray;
|
||||
nsIContent* mLastChild;
|
||||
|
||||
nsXULTreeRowGroupInfo() :mRowCount(-1),mLastChild(nsnull)
|
||||
{
|
||||
NS_NewISupportsArray(getter_AddRefs(mTickArray));
|
||||
};
|
||||
|
||||
~nsXULTreeRowGroupInfo() { Clear(); };
|
||||
|
||||
void Add(nsIContent* aContent) {
|
||||
mTickArray->AppendElement(aContent);
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
mLastChild = nsnull;
|
||||
mRowCount = -1;
|
||||
mTickArray->Clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------*/
|
||||
|
||||
|
||||
class nsXULTreeOuterGroupFrame : public nsXULTreeGroupFrame, public nsIScrollbarMediator,
|
||||
public nsIReflowCallback /*, public nsITimerCallback */
|
||||
{
|
||||
nsXULTreeOuterGroupFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsXULTreeOuterGroupFrame();
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
friend class nsDragAutoScrollTimer;
|
||||
friend class nsDragOverListener;
|
||||
friend nsresult NS_NewXULTreeOuterGroupFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext* aPresContext, nsIContent* aContent,
|
||||
nsIFrame* aParent, nsIStyleContext* aContext, nsIFrame* aPrevInFlow);
|
||||
|
||||
NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
// nsIReflowCallback
|
||||
NS_IMETHOD ReflowFinished(nsIPresShell* aPresShell, PRBool* aFlushFlag);
|
||||
|
||||
#if USE_TIMER_TO_DELAY_SCROLLING
|
||||
// nsITimerCallback
|
||||
NS_IMETHOD_(void) Notify(nsITimer *timer) ;
|
||||
#endif
|
||||
|
||||
NS_IMETHOD GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
|
||||
NS_IMETHOD NeedsRecalc();
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer);
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext, nsIContent* aChild,
|
||||
PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType, PRInt32 aHint) ;
|
||||
|
||||
NS_IMETHOD IsOutermostFrame(PRBool *aResult) { *aResult = PR_TRUE; return NS_OK; };
|
||||
|
||||
PRInt32 GetRowCount() { if (mRowGroupInfo && (mRowGroupInfo->mRowCount != -1)) return mRowGroupInfo->mRowCount; PRInt32 count = 0;
|
||||
ComputeTotalRowCount(count, mContent); mRowGroupInfo->mRowCount = count; return count; };
|
||||
|
||||
PRInt32 GetRowHeightTwips() {
|
||||
return mRowHeight;
|
||||
}
|
||||
|
||||
void RegenerateRowGroupInfo(PRInt32 aOnscreenCount);
|
||||
|
||||
void SetRowHeight(PRInt32 aRowHeight);
|
||||
|
||||
// returns -1 if not fixed
|
||||
PRInt32 GetFixedRowSize();
|
||||
|
||||
nscoord GetYPosition();
|
||||
nscoord GetAvailableHeight();
|
||||
NS_IMETHOD GetNumberOfVisibleRows(PRInt32 *aResult) {
|
||||
*aResult=(mRowHeight ? GetAvailableHeight() / mRowHeight : 0);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD GetIndexOfFirstVisibleRow(PRInt32 *aResult) {
|
||||
*aResult=mCurrentIndex; return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD GetRowCount(PRInt32* aResult) { *aResult = GetRowCount(); return NS_OK; }
|
||||
|
||||
NS_IMETHOD BeginBatch() { mBatchCount++; mOldIndex = mCurrentIndex; return NS_OK; }
|
||||
NS_IMETHOD EndBatch();
|
||||
|
||||
NS_IMETHOD PositionChanged(PRInt32 aOldIndex, PRInt32& aNewIndex);
|
||||
NS_IMETHOD ScrollbarButtonPressed(PRInt32 aOldIndex, PRInt32 aNewIndex);
|
||||
NS_IMETHOD VisibilityChanged(PRBool aVisible);
|
||||
|
||||
void GetTreeContent(nsIContent** aResult);
|
||||
|
||||
void VerticalScroll(PRInt32 aDelta);
|
||||
|
||||
void ConstructContentChain(nsIContent* aRowContent);
|
||||
void ConstructOldContentChain(nsIContent* aOldRowContent);
|
||||
void CreateOldContentChain(nsIContent* aOldRowContent, nsIContent* topOfChain);
|
||||
|
||||
void FindChildOfCommonContentChainAncestor(nsIContent *startContent, nsIContent **child);
|
||||
|
||||
PRBool IsAncestor(nsIContent *aRowContent, nsIContent *aOldRowContent, nsIContent **firstDescendant);
|
||||
|
||||
void FindPreviousRowContent(PRInt32& aDelta, nsIContent* aUpwardHint,
|
||||
nsIContent* aDownwardHint, nsIContent** aResult);
|
||||
void FindNextRowContent(PRInt32& aDelta, nsIContent* aUpwardHint,
|
||||
nsIContent* aDownwardHint, nsIContent** aResult);
|
||||
void FindRowContentAtIndex(PRInt32& aIndex, nsIContent* aParent,
|
||||
nsIContent** aResult);
|
||||
|
||||
// This method ensures that a row is onscreen. It will scroll the tree widget such
|
||||
// that the row is at the top of the screen (if the row was offscreen to start with).
|
||||
void EnsureRowIsVisible(PRInt32 aRowIndex);
|
||||
|
||||
void ScrollToIndex(PRInt32 aRowIndex, PRBool aForceDestruct=PR_FALSE);
|
||||
|
||||
NS_IMETHOD IndexOfItem(nsIContent* aRoot, nsIContent* aContent,
|
||||
PRBool aDescendIntoRows, // Invariant
|
||||
PRBool aParentIsOpen,
|
||||
PRInt32 *aResult);
|
||||
|
||||
NS_IMETHOD InternalPositionChanged(PRBool aUp, PRInt32 aDelta, PRBool aForceDestruct=PR_FALSE);
|
||||
NS_IMETHOD InternalPositionChangedCallback();
|
||||
|
||||
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
||||
|
||||
PRBool IsTreeSorted ( ) const { return mTreeIsSorted; }
|
||||
PRBool CanDropBetweenRows ( ) const { return mCanDropBetweenRows; }
|
||||
|
||||
void PostReflowCallback();
|
||||
|
||||
PRBool IsBatching() const { return mBatchCount > 0; };
|
||||
|
||||
NS_IMETHOD
|
||||
SizeTo(nsIPresContext* aPresContext, nscoord aWidth, nscoord aHeight);
|
||||
|
||||
nscoord ComputeIntrinsicWidth(nsBoxLayoutState& aBoxLayoutState);
|
||||
|
||||
protected:
|
||||
|
||||
nsScrollSmoother* GetSmoother();
|
||||
|
||||
void ComputeTotalRowCount(PRInt32& aRowCount, nsIContent* aParent);
|
||||
|
||||
// Drag Auto-scrolling
|
||||
nsresult HandleAutoScrollTracking ( const nsPoint & aPoint );
|
||||
PRBool IsInDragScrollRegion ( const nsPoint& inPoint, PRBool* outScrollUp ) ;
|
||||
#if USE_TIMER_TO_DELAY_SCROLLING
|
||||
nsresult StopScrollTracking();
|
||||
#endif
|
||||
|
||||
PRUint32 mBatchCount;
|
||||
nsXULTreeRowGroupInfo* mRowGroupInfo;
|
||||
PRInt32 mRowHeight;
|
||||
nscoord mOnePixel;
|
||||
PRInt32 mCurrentIndex; // Row-based
|
||||
PRInt32 mOldIndex;
|
||||
PRPackedBool mTreeIsSorted;
|
||||
PRPackedBool mCanDropBetweenRows; // is the user allowed to drop between rows
|
||||
|
||||
#if USE_TIMER_TO_DELAY_SCROLLING
|
||||
PRPackedBool mAutoScrollTimerHasFired;
|
||||
PRPackedBool mAutoScrollTimerStarted;
|
||||
nsCOMPtr<nsITimer> mAutoScrollTimer;
|
||||
#endif
|
||||
|
||||
// our auto-scroll event listener registered with the content model. See the discussion
|
||||
// in Init() for why this is a weak ref.
|
||||
nsDragOverListener* mDragOverListener;
|
||||
|
||||
PRPackedBool mRowHeightWasSet;
|
||||
PRPackedBool mReflowCallbackPosted;
|
||||
PRPackedBool mScrolling;
|
||||
PRPackedBool mAdjustScroll;
|
||||
PRInt32 mYPosition;
|
||||
nsScrollSmoother* mScrollSmoother;
|
||||
PRInt32 mTimePerRow;
|
||||
|
||||
nsCOMPtr<nsIAtom> mTreeItemTag;
|
||||
nsCOMPtr<nsIAtom> mTreeRowTag;
|
||||
nsCOMPtr<nsIAtom> mTreeChildrenTag;
|
||||
|
||||
nscoord mStringWidth;
|
||||
|
||||
}; // class nsXULTreeOuterGroupFrame
|
||||
|
||||
#endif
|
|
@ -1,67 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#include "nsIXULTreeSlice.h"
|
||||
#include "nsGridRowLeafFrame.h"
|
||||
|
||||
class nsXULTreeSliceFrame : public nsGridRowLeafFrame, public nsIXULTreeSlice
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
friend nsresult NS_NewXULTreeSliceFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
// nsIXULTreeSlice
|
||||
NS_IMETHOD IsOutermostFrame(PRBool* aResult) { *aResult = PR_FALSE; return NS_OK; };
|
||||
NS_IMETHOD IsGroupFrame(PRBool* aResult) { *aResult = PR_FALSE; return NS_OK; };
|
||||
NS_IMETHOD IsRowFrame(PRBool* aResult) { *aResult = PR_TRUE; return NS_OK; };
|
||||
NS_IMETHOD GetOnScreenRowCount(PRInt32* aCount) { *aCount = 1; return NS_OK; }
|
||||
|
||||
// nsIBox
|
||||
NS_IMETHOD GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize);
|
||||
|
||||
protected:
|
||||
nsXULTreeSliceFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsXULTreeSliceFrame();
|
||||
|
||||
protected: // Data Members
|
||||
|
||||
}; // class nsXULTreeSliceFrame
|
|
@ -1,87 +0,0 @@
|
|||
/* -*- 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
|
||||
*
|
||||
* 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/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#include "nsBoxFrame.h"
|
||||
#include "nsIOutlinerColFrame.h"
|
||||
#include "nsIOutlinerBoxObject.h"
|
||||
|
||||
class nsSupportsHashtable;
|
||||
|
||||
// The actual frame that paints the cells and rows.
|
||||
class nsOutlinerColFrame : public nsBoxFrame, public nsIOutlinerColFrame
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOUTLINERCOLFRAME
|
||||
|
||||
friend nsresult NS_NewOutlinerColFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
NS_IMETHODIMP Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint, // Overridden to capture events
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRInt32 aHint);
|
||||
|
||||
|
||||
protected:
|
||||
nsOutlinerColFrame(nsIPresShell* aPresShell, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
virtual ~nsOutlinerColFrame();
|
||||
|
||||
protected:
|
||||
// Members.
|
||||
|
||||
void EnsureOutliner();
|
||||
void InvalidateColumnCache(nsIPresContext* aPresContext);
|
||||
|
||||
nsCOMPtr<nsIOutlinerBoxObject> mOutliner;
|
||||
}; // class nsOutlinerColFrame
|
|
@ -54,6 +54,8 @@
|
|||
|
||||
class Property;
|
||||
|
||||
nsresult NS_NewOutlinerContentView(nsIOutlinerContentView** aResult);
|
||||
|
||||
class nsOutlinerContentView : public nsIOutlinerView,
|
||||
public nsIOutlinerContentView,
|
||||
public nsIDocumentObserver
|
||||
|
|
|
@ -42,6 +42,11 @@
|
|||
|
||||
class nsSupportsHashtable;
|
||||
|
||||
nsresult NS_NewOutlinerColFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
||||
// The actual frame that paints the cells and rows.
|
||||
class nsOutlinerColFrame : public nsBoxFrame, public nsIOutlinerColFrame
|
||||
{
|
||||
|
@ -51,8 +56,8 @@ public:
|
|||
|
||||
friend nsresult NS_NewOutlinerColFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot = PR_FALSE,
|
||||
nsIBoxLayout* aLayoutManager = nsnull);
|
||||
PRBool aIsRoot,
|
||||
nsIBoxLayout* aLayoutManager);
|
||||
|
||||
NS_IMETHODIMP Init(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
|
||||
class Property;
|
||||
|
||||
nsresult NS_NewOutlinerContentView(nsIOutlinerContentView** aResult);
|
||||
|
||||
class nsOutlinerContentView : public nsIOutlinerView,
|
||||
public nsIOutlinerContentView,
|
||||
public nsIDocumentObserver
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is the Mozilla browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications, Inc. Portions created by Netscape are
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Scott Collins <scc@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef nsWeakReference_h__
|
||||
#define nsWeakReference_h__
|
||||
|
||||
// nsWeakReference.h
|
||||
|
||||
#include "nsIWeakReference.h"
|
||||
|
||||
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
|
||||
{
|
||||
public:
|
||||
nsSupportsWeakReference()
|
||||
: mProxy(0)
|
||||
{
|
||||
// nothing else to do here
|
||||
}
|
||||
|
||||
inline virtual ~nsSupportsWeakReference();
|
||||
|
||||
NS_DECL_NSISUPPORTSWEAKREFERENCE
|
||||
|
||||
private:
|
||||
friend class nsWeakReference;
|
||||
|
||||
void
|
||||
NoticeProxyDestruction()
|
||||
// ...called (only) by an |nsWeakReference| from _its_ dtor.
|
||||
{
|
||||
mProxy = 0;
|
||||
}
|
||||
|
||||
nsWeakReference* mProxy;
|
||||
|
||||
protected:
|
||||
|
||||
inline void ClearWeakReferences();
|
||||
PRBool HasWeakReferences() const {return mProxy != 0;}
|
||||
};
|
||||
|
||||
class NS_COM nsWeakReference : public nsIWeakReference
|
||||
{
|
||||
public:
|
||||
// nsISupports...
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
NS_IMETHOD QueryInterface( const nsIID&, void** );
|
||||
|
||||
// nsIWeakReference...
|
||||
NS_DECL_NSIWEAKREFERENCE
|
||||
|
||||
private:
|
||||
friend class nsSupportsWeakReference;
|
||||
|
||||
nsWeakReference( nsSupportsWeakReference* referent )
|
||||
: mRefCount(0),
|
||||
mReferent(referent)
|
||||
// ...I can only be constructed by an |nsSupportsWeakReference|
|
||||
{
|
||||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual ~nsWeakReference()
|
||||
// ...I will only be destroyed by calling |delete| myself.
|
||||
{
|
||||
if ( mReferent )
|
||||
mReferent->NoticeProxyDestruction();
|
||||
}
|
||||
|
||||
void
|
||||
NoticeReferentDestruction()
|
||||
// ...called (only) by an |nsSupportsWeakReference| from _its_ dtor.
|
||||
{
|
||||
mReferent = 0;
|
||||
}
|
||||
|
||||
nsrefcnt mRefCount;
|
||||
nsSupportsWeakReference* mReferent;
|
||||
};
|
||||
|
||||
inline
|
||||
void
|
||||
nsSupportsWeakReference::ClearWeakReferences()
|
||||
/*
|
||||
Usually being called from |nsSupportsWeakReference::~nsSupportsWeakReference|
|
||||
will be good enough, but you may have a case where you need to call disconnect
|
||||
your weak references in an outer destructor (to prevent some client holding a
|
||||
weak reference from re-entering your destructor).
|
||||
*/
|
||||
{
|
||||
if ( mProxy )
|
||||
{
|
||||
mProxy->NoticeReferentDestruction();
|
||||
mProxy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
nsSupportsWeakReference::~nsSupportsWeakReference()
|
||||
{
|
||||
ClearWeakReferences();
|
||||
}
|
||||
|
||||
#endif
|
|
@ -87,6 +87,8 @@ public:
|
|||
* @update gess4/20/98
|
||||
*/
|
||||
|
||||
class nsDequeIterator;
|
||||
|
||||
class NS_COM nsDeque {
|
||||
friend class nsDequeIterator;
|
||||
public:
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
|
||||
#include "nsIWeakReference.h"
|
||||
|
||||
class nsWeakReference;
|
||||
|
||||
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
|
||||
{
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче