LCOV - code coverage report
Current view: directory - layout/svg/base/src - nsSVGOuterSVGFrame.h (source / functions) Found Hit Coverage
Test: app.info Lines: 5 0 0.0 %
Date: 2012-06-02 Functions: 3 0 0.0 %

       1                 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2                 : /* ***** BEGIN LICENSE BLOCK *****
       3                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       4                 :  *
       5                 :  * The contents of this file are subject to the Mozilla Public License Version
       6                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       7                 :  * the License. You may obtain a copy of the License at
       8                 :  * http://www.mozilla.org/MPL/
       9                 :  *
      10                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      11                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      12                 :  * for the specific language governing rights and limitations under the
      13                 :  * License.
      14                 :  *
      15                 :  * The Original Code is the Mozilla SVG project.
      16                 :  *
      17                 :  * The Initial Developer of the Original Code is
      18                 :  * Crocodile Clips Ltd..
      19                 :  * Portions created by the Initial Developer are Copyright (C) 2001
      20                 :  * the Initial Developer. All Rights Reserved.
      21                 :  *
      22                 :  * Contributor(s):
      23                 :  *   Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
      24                 :  *
      25                 :  * Alternatively, the contents of this file may be used under the terms of
      26                 :  * either of the GNU General Public License Version 2 or later (the "GPL"),
      27                 :  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      28                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      29                 :  * of those above. If you wish to allow use of your version of this file only
      30                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      31                 :  * use your version of this file under the terms of the MPL, indicate your
      32                 :  * decision by deleting the provisions above and replace them with the notice
      33                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      34                 :  * the provisions above, a recipient may use your version of this file under
      35                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      36                 :  *
      37                 :  * ***** END LICENSE BLOCK ***** */
      38                 : 
      39                 : #ifndef __NS_SVGOUTERSVGFRAME_H__
      40                 : #define __NS_SVGOUTERSVGFRAME_H__
      41                 : 
      42                 : #include "nsSVGContainerFrame.h"
      43                 : #include "nsISVGSVGFrame.h"
      44                 : #include "nsIDOMSVGPoint.h"
      45                 : #include "nsIDOMSVGNumber.h"
      46                 : #include "gfxMatrix.h"
      47                 : 
      48                 : class nsSVGForeignObjectFrame;
      49                 : 
      50                 : ////////////////////////////////////////////////////////////////////////
      51                 : // nsSVGOuterSVGFrame class
      52                 : 
      53                 : typedef nsSVGDisplayContainerFrame nsSVGOuterSVGFrameBase;
      54                 : 
      55                 : class nsSVGOuterSVGFrame : public nsSVGOuterSVGFrameBase,
      56                 :                            public nsISVGSVGFrame
      57                 : {
      58                 :   friend nsIFrame*
      59                 :   NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
      60                 : protected:
      61                 :   nsSVGOuterSVGFrame(nsStyleContext* aContext);
      62                 : 
      63                 : public:
      64                 :   NS_DECL_QUERYFRAME
      65                 :   NS_DECL_FRAMEARENA_HELPERS
      66                 : 
      67                 : #ifdef DEBUG
      68               0 :   ~nsSVGOuterSVGFrame() {
      69               0 :     NS_ASSERTION(mForeignObjectHash.Count() == 0,
      70                 :                  "foreignObject(s) still registered!");
      71               0 :   }
      72                 : #endif
      73                 : 
      74                 :   // nsIFrame:
      75                 :   virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
      76                 :   virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
      77                 : 
      78                 :   virtual IntrinsicSize GetIntrinsicSize();
      79                 :   virtual nsSize  GetIntrinsicRatio();
      80                 : 
      81                 :   virtual nsSize ComputeSize(nsRenderingContext *aRenderingContext,
      82                 :                              nsSize aCBSize, nscoord aAvailableWidth,
      83                 :                              nsSize aMargin, nsSize aBorder, nsSize aPadding,
      84                 :                              bool aShrinkWrap);
      85                 : 
      86                 :   NS_IMETHOD Reflow(nsPresContext*          aPresContext,
      87                 :                     nsHTMLReflowMetrics&     aDesiredSize,
      88                 :                     const nsHTMLReflowState& aReflowState,
      89                 :                     nsReflowStatus&          aStatus);
      90                 : 
      91                 :   NS_IMETHOD  DidReflow(nsPresContext*   aPresContext,
      92                 :                         const nsHTMLReflowState*  aReflowState,
      93                 :                         nsDidReflowStatus aStatus);
      94                 : 
      95                 :   NS_IMETHOD BuildDisplayList(nsDisplayListBuilder*   aBuilder,
      96                 :                               const nsRect&           aDirtyRect,
      97                 :                               const nsDisplayListSet& aLists);
      98                 : 
      99                 :   NS_IMETHOD Init(nsIContent*      aContent,
     100                 :                   nsIFrame*        aParent,
     101                 :                   nsIFrame*        aPrevInFlow);
     102                 : 
     103                 :   virtual nsSplittableType GetSplittableType() const;
     104                 : 
     105                 :   /**
     106                 :    * Get the "type" of the frame
     107                 :    *
     108                 :    * @see nsGkAtoms::svgOuterSVGFrame
     109                 :    */
     110                 :   virtual nsIAtom* GetType() const;
     111                 : 
     112                 :   void Paint(const nsDisplayListBuilder* aBuilder,
     113                 :              nsRenderingContext* aContext,
     114                 :              const nsRect& aDirtyRect, nsPoint aPt);
     115                 : 
     116                 : #ifdef DEBUG
     117               0 :   NS_IMETHOD GetFrameName(nsAString& aResult) const
     118                 :   {
     119               0 :     return MakeFrameName(NS_LITERAL_STRING("SVGOuterSVG"), aResult);
     120                 :   }
     121                 : #endif
     122                 : 
     123                 :   NS_IMETHOD  AttributeChanged(PRInt32         aNameSpaceID,
     124                 :                                nsIAtom*        aAttribute,
     125                 :                                PRInt32         aModType);
     126                 : 
     127                 :   // nsISVGSVGFrame interface:
     128                 :   virtual void SuspendRedraw();
     129                 :   virtual void UnsuspendRedraw();
     130                 :   virtual void NotifyViewportChange();
     131                 : 
     132                 :   // nsSVGContainerFrame methods:
     133                 :   virtual gfxMatrix GetCanvasTM();
     134                 : 
     135                 :   /* Methods to allow descendant nsSVGForeignObjectFrame frames to register and
     136                 :    * unregister themselves with their nearest nsSVGOuterSVGFrame ancestor so
     137                 :    * they can be reflowed. The methods return true on success or false on
     138                 :    * failure.
     139                 :    */
     140                 :   void RegisterForeignObject(nsSVGForeignObjectFrame* aFrame);
     141                 :   void UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame);
     142                 : 
     143                 : #ifdef XP_MACOSX
     144                 :   bool BitmapFallbackEnabled() const {
     145                 :     return mEnableBitmapFallback;
     146                 :   }
     147                 :   void SetBitmapFallbackEnabled(bool aVal) {
     148                 :     NS_NOTREACHED("don't think me need this any more"); // comment in bug 732429 if we do
     149                 :     mEnableBitmapFallback = aVal;
     150                 :   }
     151                 : #endif
     152                 : 
     153                 : protected:
     154                 : 
     155                 :   /* Returns true if our content is the document element and our document is
     156                 :    * embedded in an HTML 'object', 'embed' or 'applet' element. Set
     157                 :    * aEmbeddingFrame to obtain the nsIFrame for the embedding HTML element.
     158                 :    */
     159                 :   bool IsRootOfReplacedElementSubDoc(nsIFrame **aEmbeddingFrame = nsnull);
     160                 : 
     161                 :   /* Returns true if our content is the document element and our document is
     162                 :    * being used as an image.
     163                 :    */
     164                 :   bool IsRootOfImage();
     165                 : 
     166                 :   // A hash-set containing our nsSVGForeignObjectFrame descendants. Note we use
     167                 :   // a hash-set to avoid the O(N^2) behavior we'd get tearing down an SVG frame
     168                 :   // subtree if we were to use a list (see bug 381285 comment 20).
     169                 :   nsTHashtable<nsVoidPtrHashKey> mForeignObjectHash;
     170                 : 
     171                 :   nsAutoPtr<gfxMatrix> mCanvasTM;
     172                 : 
     173                 :   PRUint32 mRedrawSuspendCount;
     174                 :   float mFullZoom;
     175                 : 
     176                 :   bool mViewportInitialized;
     177                 : #ifdef XP_MACOSX
     178                 :   bool mEnableBitmapFallback;
     179                 : #endif
     180                 :   bool mIsRootContent;
     181                 : };
     182                 : 
     183                 : #endif

Generated by: LCOV version 1.7