2001-12-12 10:59:31 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#ifndef __NS_SVGPATHGEOMETRYFRAME_H__
|
|
|
|
#define __NS_SVGPATHGEOMETRYFRAME_H__
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "gfxMatrix.h"
|
|
|
|
#include "gfxRect.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsFrame.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#include "nsISVGChildFrame.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "nsLiteralString.h"
|
|
|
|
#include "nsQueryFrame.h"
|
|
|
|
#include "nsRect.h"
|
2006-05-02 19:05:25 +04:00
|
|
|
#include "nsSVGGeometryFrame.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "nsSVGUtils.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2012-03-20 16:15:55 +04:00
|
|
|
class gfxContext;
|
2012-07-20 22:12:29 +04:00
|
|
|
class nsDisplaySVGPathGeometry;
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsIAtom;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresShell;
|
2012-03-02 12:28:59 +04:00
|
|
|
class nsRenderingContext;
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsStyleContext;
|
2006-06-10 00:40:06 +04:00
|
|
|
class nsSVGMarkerFrame;
|
2007-03-21 13:59:01 +03:00
|
|
|
class nsSVGMarkerProperty;
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2012-03-20 16:15:55 +04:00
|
|
|
struct nsPoint;
|
|
|
|
|
2006-05-02 19:05:25 +04:00
|
|
|
typedef nsSVGGeometryFrame nsSVGPathGeometryFrameBase;
|
2001-12-12 10:59:31 +03:00
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase,
|
|
|
|
public nsISVGChildFrame
|
2001-12-12 10:59:31 +03:00
|
|
|
{
|
2007-07-24 13:05:37 +04:00
|
|
|
friend nsIFrame*
|
2009-01-19 21:31:34 +03:00
|
|
|
NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2012-07-20 22:12:29 +04:00
|
|
|
|
|
|
|
friend class nsDisplaySVGPathGeometry;
|
|
|
|
|
2007-07-24 13:05:37 +04:00
|
|
|
protected:
|
2012-05-17 08:05:09 +04:00
|
|
|
nsSVGPathGeometryFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGPathGeometryFrameBase(aContext)
|
|
|
|
{
|
|
|
|
AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
|
|
|
|
}
|
2006-06-21 19:42:28 +04:00
|
|
|
|
2007-07-24 13:05:37 +04:00
|
|
|
public:
|
2013-01-04 08:26:00 +04:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsSVGPathGeometryFrame)
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2001-12-12 10:59:31 +03:00
|
|
|
|
|
|
|
// nsIFrame interface:
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
|
2001-12-12 10:59:31 +03:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aModType);
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2008-10-26 13:11:34 +03:00
|
|
|
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
2005-04-01 23:56:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
2007-01-30 03:06:41 +03:00
|
|
|
* @see nsGkAtoms::svgPathGeometryFrame
|
2005-04-01 23:56:08 +04:00
|
|
|
*/
|
|
|
|
virtual nsIAtom* GetType() const;
|
|
|
|
|
2012-07-30 18:20:58 +04:00
|
|
|
virtual bool IsSVGTransformed(gfxMatrix *aOwnTransforms = nullptr,
|
|
|
|
gfxMatrix *aFromParentTransforms = nullptr) const;
|
2012-05-17 08:05:09 +04:00
|
|
|
|
2005-04-01 23:56:08 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGPathGeometry"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2012-07-20 22:12:29 +04:00
|
|
|
|
2008-04-08 16:51:19 +04:00
|
|
|
// nsSVGGeometryFrame methods
|
2012-08-22 19:56:38 +04:00
|
|
|
gfxMatrix GetCanvasTM(uint32_t aFor);
|
2006-05-02 19:05:25 +04:00
|
|
|
|
2005-04-01 23:56:08 +04:00
|
|
|
protected:
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
// nsISVGChildFrame interface:
|
2012-03-02 12:28:59 +04:00
|
|
|
NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
|
2008-10-20 12:42:03 +04:00
|
|
|
const nsIntRect *aDirtyRect);
|
2012-09-14 20:10:08 +04:00
|
|
|
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
|
|
|
|
virtual void ReflowSVG() MOZ_OVERRIDE;
|
|
|
|
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
|
2012-04-16 12:23:48 +04:00
|
|
|
virtual SVGBBox GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
2012-09-14 20:10:08 +04:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return false; }
|
2006-06-29 02:04:48 +04:00
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
protected:
|
2012-06-25 00:12:40 +04:00
|
|
|
void GeneratePath(gfxContext *aContext, const gfxMatrix &aTransform);
|
2006-06-20 21:01:09 +04:00
|
|
|
|
2006-06-21 19:42:28 +04:00
|
|
|
private:
|
2013-01-13 03:27:53 +04:00
|
|
|
enum { eRenderFill = 1, eRenderStroke = 2 };
|
|
|
|
void Render(nsRenderingContext *aContext, uint32_t aRenderComponents);
|
|
|
|
void PaintMarkers(nsRenderingContext *aContext);
|
2006-06-02 18:26:28 +04:00
|
|
|
|
2008-10-10 17:14:05 +04:00
|
|
|
struct MarkerProperties {
|
|
|
|
nsSVGMarkerProperty* mMarkerStart;
|
|
|
|
nsSVGMarkerProperty* mMarkerMid;
|
|
|
|
nsSVGMarkerProperty* mMarkerEnd;
|
2006-03-01 13:59:36 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool MarkersExist() const {
|
2008-10-10 17:14:05 +04:00
|
|
|
return mMarkerStart || mMarkerMid || mMarkerEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGMarkerFrame *GetMarkerStartFrame();
|
|
|
|
nsSVGMarkerFrame *GetMarkerMidFrame();
|
|
|
|
nsSVGMarkerFrame *GetMarkerEndFrame();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param aFrame should be the first continuation
|
|
|
|
*/
|
|
|
|
static MarkerProperties GetMarkerProperties(nsSVGPathGeometryFrame *aFrame);
|
2001-12-12 10:59:31 +03:00
|
|
|
};
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#endif // __NS_SVGPATHGEOMETRYFRAME_H__
|