2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla SVG project.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is IBM Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef __NS_SVGPAINTSERVERFRAME_H__
|
|
|
|
#define __NS_SVGPAINTSERVERFRAME_H__
|
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-18 03:32:02 -07:00
|
|
|
#include "nsSVGUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class gfxContext;
|
2012-03-20 05:15:55 -07:00
|
|
|
class gfxPattern;
|
|
|
|
class nsStyleContext;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsSVGGeometryFrame;
|
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
struct gfxRect;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
|
|
|
|
|
2008-09-30 17:51:05 -07:00
|
|
|
class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-09-07 02:30:51 -07:00
|
|
|
protected:
|
2012-03-10 11:28:06 -08:00
|
|
|
nsSVGPaintServerFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGPaintServerFrameBase(aContext)
|
|
|
|
{
|
|
|
|
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-07 02:30:51 -07:00
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2010-07-01 09:40:30 -07:00
|
|
|
/**
|
|
|
|
* Constructs a gfxPattern of the paint server rendering.
|
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxPattern>
|
|
|
|
GetPaintServerPattern(nsIFrame *aSource,
|
2012-05-18 01:34:25 -07:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
2010-07-01 09:40:30 -07:00
|
|
|
float aOpacity,
|
|
|
|
const gfxRect *aOverrideBounds = nsnull) = 0;
|
|
|
|
|
|
|
|
/**
|
2007-04-23 02:11:19 -07:00
|
|
|
* Configure paint server prior to rendering
|
2011-10-17 07:59:28 -07:00
|
|
|
* @return false to skip rendering
|
2007-04-23 02:11:19 -07:00
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool SetupPaintServer(gfxContext *aContext,
|
2012-05-18 01:34:25 -07:00
|
|
|
nsSVGGeometryFrame *aSource,
|
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
|
|
|
float aOpacity);
|
2010-07-01 09:40:19 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool IsFrameOfType(PRUint32 aFlags) const
|
2010-07-01 09:40:19 -07:00
|
|
|
{
|
|
|
|
return nsSVGPaintServerFrameBase::IsFrameOfType(aFlags & ~nsIFrame::eSVGPaintServer);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __NS_SVGPAINTSERVERFRAME_H__
|