michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim:cindent:ts=2:et:sw=2: michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * This Original Code has been modified by IBM Corporation. Modifications made michael@0: * by IBM described herein are Copyright (c) International Business Machines michael@0: * Corporation, 2000. Modifications to Mozilla code or documentation identified michael@0: * per MPL Section 3.3 michael@0: * michael@0: * Date Modified by Description of modification michael@0: * 04/20/2000 IBM Corp. OS/2 VisualAge build. michael@0: */ michael@0: michael@0: /* part of nsFrameManager, to work around header inclusionordering */ michael@0: michael@0: #ifndef _nsFrameManagerBase_h_ michael@0: #define _nsFrameManagerBase_h_ michael@0: michael@0: #include "pldhash.h" michael@0: michael@0: class nsIPresShell; michael@0: class nsStyleSet; michael@0: class nsIContent; michael@0: class nsPlaceholderFrame; michael@0: class nsIFrame; michael@0: class nsStyleContext; michael@0: class nsIAtom; michael@0: class nsStyleChangeList; michael@0: class nsILayoutHistoryState; michael@0: michael@0: class nsFrameManagerBase michael@0: { michael@0: public: michael@0: nsFrameManagerBase() michael@0: { michael@0: memset(this, '\0', sizeof(nsFrameManagerBase)); michael@0: } michael@0: michael@0: bool IsDestroyingFrames() { return mIsDestroyingFrames; } michael@0: michael@0: /* michael@0: * Gets and sets the root frame (typically the viewport). The lifetime of the michael@0: * root frame is controlled by the frame manager. When the frame manager is michael@0: * destroyed, it destroys the entire frame hierarchy. michael@0: */ michael@0: NS_HIDDEN_(nsIFrame*) GetRootFrame() const { return mRootFrame; } michael@0: NS_HIDDEN_(void) SetRootFrame(nsIFrame* aRootFrame) michael@0: { michael@0: NS_ASSERTION(!mRootFrame, "already have a root frame"); michael@0: mRootFrame = aRootFrame; michael@0: } michael@0: michael@0: static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; } michael@0: michael@0: protected: michael@0: class UndisplayedMap; michael@0: michael@0: // weak link, because the pres shell owns us michael@0: nsIPresShell* mPresShell; michael@0: // the pres shell owns the style set michael@0: nsStyleSet* mStyleSet; michael@0: nsIFrame* mRootFrame; michael@0: PLDHashTable mPlaceholderMap; michael@0: UndisplayedMap* mUndisplayedMap; michael@0: bool mIsDestroyingFrames; // The frame manager is destroying some frame(s). michael@0: michael@0: // The frame tree generation number michael@0: // We use this to avoid unnecessary screenshotting michael@0: // on Android. Unfortunately, this is static to match michael@0: // the single consumer which is also static. Keeping michael@0: // this the same greatly simplifies lifetime issues and michael@0: // makes sure we always using the correct number. michael@0: // A per PresContext generation number is available michael@0: // via nsPresContext::GetDOMGeneration michael@0: static uint32_t sGlobalGenerationNumber; michael@0: }; michael@0: michael@0: #endif