Home | History | Annotate | Download | only in rendering
      1 /*
      2  * Copyright (C) 2006 Apple Computer, Inc.
      3  * Copyright (C) 2009 Google, Inc.
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Library General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2 of the License, or (at your option) any later version.
      9  *
     10  * This library is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  * Library General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU Library General Public License
     16  * along with this library; see the file COPYING.LIB.  If not, write to
     17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18  * Boston, MA 02110-1301, USA.
     19  *
     20  */
     21 
     22 #ifndef RenderForeignObject_h
     23 #define RenderForeignObject_h
     24 #if ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT)
     25 
     26 #include "AffineTransform.h"
     27 #include "FloatPoint.h"
     28 #include "RenderSVGBlock.h"
     29 
     30 namespace WebCore {
     31 
     32 class SVGForeignObjectElement;
     33 
     34 class RenderForeignObject : public RenderSVGBlock {
     35 public:
     36     RenderForeignObject(SVGForeignObjectElement*);
     37 
     38     virtual const char* renderName() const { return "RenderForeignObject"; }
     39 
     40     virtual void paint(PaintInfo&, int parentX, int parentY);
     41 
     42     virtual const AffineTransform& localToParentTransform() const;
     43 
     44     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
     45     virtual bool requiresLayer() const { return false; }
     46     virtual void layout();
     47 
     48     virtual FloatRect objectBoundingBox() const;
     49     virtual FloatRect strokeBoundingBox() const { return borderBoxRect(); }
     50     virtual FloatRect repaintRectInLocalCoordinates() const;
     51 
     52     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     53     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     54     virtual bool isSVGForeignObject() const { return true; }
     55 
     56     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const;
     57 
     58  private:
     59     FloatPoint translationForAttributes() const;
     60 
     61     virtual AffineTransform localTransform() const { return m_localTransform; }
     62 
     63     AffineTransform m_localTransform;
     64     mutable AffineTransform m_localToParentTransform;
     65 };
     66 
     67 } // namespace WebCore
     68 
     69 #endif // ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT)
     70 #endif // RenderForeignObject_h
     71