layout/svg/nsSVGFilterFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/svg/nsSVGFilterFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,104 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef __NS_SVGFILTERFRAME_H__
    1.10 +#define __NS_SVGFILTERFRAME_H__
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "nsFrame.h"
    1.14 +#include "nsQueryFrame.h"
    1.15 +#include "nsSVGContainerFrame.h"
    1.16 +#include "nsSVGUtils.h"
    1.17 +
    1.18 +class nsIAtom;
    1.19 +class nsIContent;
    1.20 +class nsIFrame;
    1.21 +class nsIPresShell;
    1.22 +class nsRenderingContext;
    1.23 +class nsStyleContext;
    1.24 +class nsSVGFilterPaintCallback;
    1.25 +class nsSVGIntegerPair;
    1.26 +class nsSVGLength2;
    1.27 +
    1.28 +struct nsRect;
    1.29 +
    1.30 +namespace mozilla {
    1.31 +namespace dom {
    1.32 +class SVGFilterElement;
    1.33 +}
    1.34 +}
    1.35 +
    1.36 +typedef nsSVGContainerFrame nsSVGFilterFrameBase;
    1.37 +
    1.38 +class nsSVGFilterFrame : public nsSVGFilterFrameBase
    1.39 +{
    1.40 +  friend nsIFrame*
    1.41 +  NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    1.42 +protected:
    1.43 +  nsSVGFilterFrame(nsStyleContext* aContext)
    1.44 +    : nsSVGFilterFrameBase(aContext),
    1.45 +      mLoopFlag(false),
    1.46 +      mNoHRefURI(false)
    1.47 +  {
    1.48 +    AddStateBits(NS_FRAME_IS_NONDISPLAY);
    1.49 +  }
    1.50 +
    1.51 +public:
    1.52 +  NS_DECL_FRAMEARENA_HELPERS
    1.53 +
    1.54 +  // nsIFrame methods:
    1.55 +  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    1.56 +                                const nsRect&           aDirtyRect,
    1.57 +                                const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
    1.58 +
    1.59 +  virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
    1.60 +                                    nsIAtom*        aAttribute,
    1.61 +                                    int32_t         aModType) MOZ_OVERRIDE;
    1.62 +
    1.63 +#ifdef DEBUG
    1.64 +  virtual void Init(nsIContent*      aContent,
    1.65 +                    nsIFrame*        aParent,
    1.66 +                    nsIFrame*        aPrevInFlow) MOZ_OVERRIDE;
    1.67 +#endif
    1.68 +
    1.69 +  /**
    1.70 +   * Get the "type" of the frame
    1.71 +   *
    1.72 +   * @see nsGkAtoms::svgFilterFrame
    1.73 +   */
    1.74 +  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    1.75 +
    1.76 +private:
    1.77 +  // Parse our xlink:href and set up our nsSVGPaintingProperty if we
    1.78 +  // reference another filter and we don't have a property. Return
    1.79 +  // the referenced filter's frame if available, null otherwise.
    1.80 +  class AutoFilterReferencer;
    1.81 +  friend class nsSVGFilterInstance;
    1.82 +  nsSVGFilterFrame* GetReferencedFilter();
    1.83 +  nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
    1.84 +
    1.85 +  // Accessors to lookup filter attributes
    1.86 +  uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
    1.87 +  uint16_t GetEnumValue(uint32_t aIndex)
    1.88 +  {
    1.89 +    return GetEnumValue(aIndex, mContent);
    1.90 +  }
    1.91 +  const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
    1.92 +  const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
    1.93 +  {
    1.94 +    return GetLengthValue(aIndex, mContent);
    1.95 +  }
    1.96 +  const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
    1.97 +  const mozilla::dom::SVGFilterElement *GetFilterContent()
    1.98 +  {
    1.99 +    return GetFilterContent(mContent);
   1.100 +  }
   1.101 +
   1.102 +  // This flag is used to detect loops in xlink:href processing
   1.103 +  bool                              mLoopFlag;
   1.104 +  bool                              mNoHRefURI;
   1.105 +};
   1.106 +
   1.107 +#endif

mercurial