2004-03-06 04:46:11 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim:cindent:ts=2:et:sw=2:
|
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2004-03-06 04:46:11 +00:00
|
|
|
*
|
|
|
|
* This Original Code has been modified by IBM Corporation. Modifications made
|
|
|
|
* by IBM described herein are Copyright (c) International Business Machines
|
|
|
|
* Corporation, 2000. Modifications to Mozilla code or documentation identified
|
|
|
|
* per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 04/20/2000 IBM Corp. OS/2 VisualAge build.
|
|
|
|
*/
|
|
|
|
|
2006-03-30 05:56:38 +00:00
|
|
|
/* part of nsFrameManager, to work around header inclusionordering */
|
|
|
|
|
2004-03-06 04:46:11 +00:00
|
|
|
#ifndef _nsFrameManagerBase_h_
|
|
|
|
#define _nsFrameManagerBase_h_
|
|
|
|
|
2014-06-12 17:09:31 +00:00
|
|
|
#include "nsDebug.h"
|
2004-03-06 04:46:11 +00:00
|
|
|
#include "pldhash.h"
|
|
|
|
|
2014-06-12 17:09:31 +00:00
|
|
|
class nsIFrame;
|
2004-03-06 04:46:11 +00:00
|
|
|
class nsIPresShell;
|
|
|
|
class nsStyleSet;
|
|
|
|
|
|
|
|
class nsFrameManagerBase
|
|
|
|
{
|
2008-12-12 08:25:16 +00:00
|
|
|
public:
|
2012-02-02 10:06:46 +00:00
|
|
|
nsFrameManagerBase()
|
2014-06-12 19:25:33 +00:00
|
|
|
: mPresShell(nullptr)
|
|
|
|
, mStyleSet(nullptr)
|
|
|
|
, mRootFrame(nullptr)
|
|
|
|
, mUndisplayedMap(nullptr)
|
2014-11-20 18:24:09 +00:00
|
|
|
, mDisplayContentsMap(nullptr)
|
2014-06-12 19:25:33 +00:00
|
|
|
, mIsDestroyingFrames(false)
|
2012-02-02 10:06:46 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsDestroyingFrames() { return mIsDestroyingFrames; }
|
2008-12-12 08:25:16 +00:00
|
|
|
|
2010-03-31 12:48:04 +00:00
|
|
|
/*
|
|
|
|
* Gets and sets the root frame (typically the viewport). The lifetime of the
|
|
|
|
* root frame is controlled by the frame manager. When the frame manager is
|
|
|
|
* destroyed, it destroys the entire frame hierarchy.
|
|
|
|
*/
|
2014-06-02 12:08:21 +00:00
|
|
|
nsIFrame* GetRootFrame() const { return mRootFrame; }
|
|
|
|
void SetRootFrame(nsIFrame* aRootFrame)
|
2010-03-31 12:48:04 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(!mRootFrame, "already have a root frame");
|
|
|
|
mRootFrame = aRootFrame;
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; }
|
2012-07-04 15:42:29 +00:00
|
|
|
|
2004-03-06 04:46:11 +00:00
|
|
|
protected:
|
|
|
|
class UndisplayedMap;
|
|
|
|
|
|
|
|
// weak link, because the pres shell owns us
|
|
|
|
nsIPresShell* mPresShell;
|
|
|
|
// the pres shell owns the style set
|
|
|
|
nsStyleSet* mStyleSet;
|
|
|
|
nsIFrame* mRootFrame;
|
|
|
|
PLDHashTable mPlaceholderMap;
|
|
|
|
UndisplayedMap* mUndisplayedMap;
|
2014-11-20 18:24:09 +00:00
|
|
|
UndisplayedMap* mDisplayContentsMap;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsDestroyingFrames; // The frame manager is destroying some frame(s).
|
2012-07-04 15:42:29 +00:00
|
|
|
|
|
|
|
// The frame tree generation number
|
|
|
|
// We use this to avoid unnecessary screenshotting
|
|
|
|
// on Android. Unfortunately, this is static to match
|
|
|
|
// the single consumer which is also static. Keeping
|
|
|
|
// this the same greatly simplifies lifetime issues and
|
|
|
|
// makes sure we always using the correct number.
|
|
|
|
// A per PresContext generation number is available
|
|
|
|
// via nsPresContext::GetDOMGeneration
|
2012-08-22 15:56:38 +00:00
|
|
|
static uint32_t sGlobalGenerationNumber;
|
2004-03-06 04:46:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|