1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/nsFrameManagerBase.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * vim:cindent:ts=2:et:sw=2: 1.6 + * 1.7 + * This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.10 + * 1.11 + * This Original Code has been modified by IBM Corporation. Modifications made 1.12 + * by IBM described herein are Copyright (c) International Business Machines 1.13 + * Corporation, 2000. Modifications to Mozilla code or documentation identified 1.14 + * per MPL Section 3.3 1.15 + * 1.16 + * Date Modified by Description of modification 1.17 + * 04/20/2000 IBM Corp. OS/2 VisualAge build. 1.18 + */ 1.19 + 1.20 +/* part of nsFrameManager, to work around header inclusionordering */ 1.21 + 1.22 +#ifndef _nsFrameManagerBase_h_ 1.23 +#define _nsFrameManagerBase_h_ 1.24 + 1.25 +#include "pldhash.h" 1.26 + 1.27 +class nsIPresShell; 1.28 +class nsStyleSet; 1.29 +class nsIContent; 1.30 +class nsPlaceholderFrame; 1.31 +class nsIFrame; 1.32 +class nsStyleContext; 1.33 +class nsIAtom; 1.34 +class nsStyleChangeList; 1.35 +class nsILayoutHistoryState; 1.36 + 1.37 +class nsFrameManagerBase 1.38 +{ 1.39 +public: 1.40 + nsFrameManagerBase() 1.41 + { 1.42 + memset(this, '\0', sizeof(nsFrameManagerBase)); 1.43 + } 1.44 + 1.45 + bool IsDestroyingFrames() { return mIsDestroyingFrames; } 1.46 + 1.47 + /* 1.48 + * Gets and sets the root frame (typically the viewport). The lifetime of the 1.49 + * root frame is controlled by the frame manager. When the frame manager is 1.50 + * destroyed, it destroys the entire frame hierarchy. 1.51 + */ 1.52 + NS_HIDDEN_(nsIFrame*) GetRootFrame() const { return mRootFrame; } 1.53 + NS_HIDDEN_(void) SetRootFrame(nsIFrame* aRootFrame) 1.54 + { 1.55 + NS_ASSERTION(!mRootFrame, "already have a root frame"); 1.56 + mRootFrame = aRootFrame; 1.57 + } 1.58 + 1.59 + static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; } 1.60 + 1.61 +protected: 1.62 + class UndisplayedMap; 1.63 + 1.64 + // weak link, because the pres shell owns us 1.65 + nsIPresShell* mPresShell; 1.66 + // the pres shell owns the style set 1.67 + nsStyleSet* mStyleSet; 1.68 + nsIFrame* mRootFrame; 1.69 + PLDHashTable mPlaceholderMap; 1.70 + UndisplayedMap* mUndisplayedMap; 1.71 + bool mIsDestroyingFrames; // The frame manager is destroying some frame(s). 1.72 + 1.73 + // The frame tree generation number 1.74 + // We use this to avoid unnecessary screenshotting 1.75 + // on Android. Unfortunately, this is static to match 1.76 + // the single consumer which is also static. Keeping 1.77 + // this the same greatly simplifies lifetime issues and 1.78 + // makes sure we always using the correct number. 1.79 + // A per PresContext generation number is available 1.80 + // via nsPresContext::GetDOMGeneration 1.81 + static uint32_t sGlobalGenerationNumber; 1.82 +}; 1.83 + 1.84 +#endif