Reviewed by Eric.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2006 16:15:59 +0000 (16:15 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2006 16:15:59 +0000 (16:15 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10866
        Code in kcanvas/ should not use Private

        Remove Private classes and tweak coding style.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16393 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
WebCore/ChangeLog
WebCore/kcanvas/RenderPath.cpp
WebCore/kcanvas/RenderPath.h
WebCore/kcanvas/RenderSVGContainer.cpp
WebCore/kcanvas/RenderSVGContainer.h
WebCore/kcanvas/device/KRenderingFillPainter.cpp
WebCore/kcanvas/device/KRenderingFillPainter.h
WebCore/kcanvas/device/KRenderingPaintServerGradient.cpp
WebCore/kcanvas/device/KRenderingPaintServerGradient.h
WebCore/kcanvas/device/KRenderingPaintServerPattern.cpp
WebCore/kcanvas/device/KRenderingPaintServerPattern.h
WebCore/kcanvas/device/KRenderingPaintServerSolid.cpp
WebCore/kcanvas/device/KRenderingPaintServerSolid.h
WebCore/kcanvas/device/KRenderingStrokePainter.cpp
WebCore/kcanvas/device/KRenderingStrokePainter.h

index 88bbe2decabd3ce40d29cfeb61270121425af820..99812e1f4150173bb606b9924f08393698671636 100644 (file)
@@ -1,3 +1,122 @@
+2006-09-16  Rob Buis  <buis@kde.org>
+
+        Reviewed by Eric.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10866
+        Code in kcanvas/ should not use Private
+
+        Remove Private classes and tweak coding style.
+
+        WARNING: NO TEST CASES ADDED OR CHANGED
+
+        * kcanvas/RenderPath.cpp:
+        (WebCore::RenderPath::RenderPath):
+        (WebCore::RenderPath::~RenderPath):
+        (WebCore::RenderPath::localTransform):
+        (WebCore::RenderPath::setLocalTransform):
+        (WebCore::RenderPath::fillContains):
+        (WebCore::RenderPath::relativeBBox):
+        (WebCore::RenderPath::setPath):
+        (WebCore::RenderPath::path):
+        (WebCore::RenderPath::layout):
+        * kcanvas/RenderPath.h:
+        * kcanvas/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::RenderSVGContainer):
+        (WebCore::RenderSVGContainer::~RenderSVGContainer):
+        (WebCore::RenderSVGContainer::drawsContents):
+        (WebCore::RenderSVGContainer::setDrawsContents):
+        (WebCore::RenderSVGContainer::localTransform):
+        (WebCore::RenderSVGContainer::setLocalTransform):
+        (WebCore::RenderSVGContainer::layout):
+        (WebCore::RenderSVGContainer::paint):
+        (WebCore::RenderSVGContainer::setViewport):
+        (WebCore::RenderSVGContainer::viewport):
+        (WebCore::RenderSVGContainer::setViewBox):
+        (WebCore::RenderSVGContainer::viewBox):
+        (WebCore::RenderSVGContainer::setAlign):
+        (WebCore::RenderSVGContainer::align):
+        (WebCore::RenderSVGContainer::fillContains):
+        (WebCore::RenderSVGContainer::strokeContains):
+        (WebCore::RenderSVGContainer::setSlice):
+        (WebCore::RenderSVGContainer::slice):
+        * kcanvas/RenderSVGContainer.h:
+        * kcanvas/device/KRenderingFillPainter.cpp:
+        (WebCore::KRenderingFillPainter::KRenderingFillPainter):
+        (WebCore::KRenderingFillPainter::~KRenderingFillPainter):
+        (WebCore::KRenderingFillPainter::fillRule):
+        (WebCore::KRenderingFillPainter::setFillRule):
+        (WebCore::KRenderingFillPainter::opacity):
+        (WebCore::KRenderingFillPainter::setOpacity):
+        * kcanvas/device/KRenderingFillPainter.h:
+        * kcanvas/device/KRenderingPaintServerGradient.cpp:
+        (WebCore::KRenderingPaintServerGradient::KRenderingPaintServerGradient):
+        (WebCore::KRenderingPaintServerGradient::~KRenderingPaintServerGradient):
+        (WebCore::KRenderingPaintServerGradient::gradientStops):
+        (WebCore::KRenderingPaintServerGradient::setGradientStops):
+        (WebCore::KRenderingPaintServerGradient::spreadMethod):
+        (WebCore::KRenderingPaintServerGradient::setGradientSpreadMethod):
+        (WebCore::KRenderingPaintServerGradient::boundingBoxMode):
+        (WebCore::KRenderingPaintServerGradient::setBoundingBoxMode):
+        (WebCore::KRenderingPaintServerGradient::gradientTransform):
+        (WebCore::KRenderingPaintServerGradient::setGradientTransform):
+        (WebCore::KRenderingPaintServerLinearGradient::KRenderingPaintServerLinearGradient):
+        (WebCore::KRenderingPaintServerLinearGradient::~KRenderingPaintServerLinearGradient):
+        (WebCore::KRenderingPaintServerLinearGradient::gradientStart):
+        (WebCore::KRenderingPaintServerLinearGradient::setGradientStart):
+        (WebCore::KRenderingPaintServerLinearGradient::gradientEnd):
+        (WebCore::KRenderingPaintServerLinearGradient::setGradientEnd):
+        (WebCore::KRenderingPaintServerRadialGradient::KRenderingPaintServerRadialGradient):
+        (WebCore::KRenderingPaintServerRadialGradient::~KRenderingPaintServerRadialGradient):
+        (WebCore::KRenderingPaintServerRadialGradient::gradientCenter):
+        (WebCore::KRenderingPaintServerRadialGradient::setGradientCenter):
+        (WebCore::KRenderingPaintServerRadialGradient::gradientFocal):
+        (WebCore::KRenderingPaintServerRadialGradient::setGradientFocal):
+        (WebCore::KRenderingPaintServerRadialGradient::gradientRadius):
+        (WebCore::KRenderingPaintServerRadialGradient::setGradientRadius):
+        (WebCore::KRenderingPaintServerGradient::listener):
+        (WebCore::KRenderingPaintServerGradient::setListener):
+        * kcanvas/device/KRenderingPaintServerGradient.h:
+        * kcanvas/device/KRenderingPaintServerPattern.cpp:
+        (WebCore::KRenderingPaintServerPattern::KRenderingPaintServerPattern):
+        (WebCore::KRenderingPaintServerPattern::~KRenderingPaintServerPattern):
+        (WebCore::KRenderingPaintServerPattern::setBbox):
+        (WebCore::KRenderingPaintServerPattern::bbox):
+        (WebCore::KRenderingPaintServerPattern::boundingBoxMode):
+        (WebCore::KRenderingPaintServerPattern::setBoundingBoxMode):
+        (WebCore::KRenderingPaintServerPattern::tile):
+        (WebCore::KRenderingPaintServerPattern::setTile):
+        (WebCore::KRenderingPaintServerPattern::patternTransform):
+        (WebCore::KRenderingPaintServerPattern::setPatternTransform):
+        (WebCore::KRenderingPaintServerPattern::listener):
+        (WebCore::KRenderingPaintServerPattern::setListener):
+        * kcanvas/device/KRenderingPaintServerPattern.h:
+        * kcanvas/device/KRenderingPaintServerSolid.cpp:
+        (WebCore::KRenderingPaintServerSolid::KRenderingPaintServerSolid):
+        (WebCore::KRenderingPaintServerSolid::~KRenderingPaintServerSolid):
+        (WebCore::KRenderingPaintServerSolid::color):
+        (WebCore::KRenderingPaintServerSolid::setColor):
+        * kcanvas/device/KRenderingPaintServerSolid.h:
+        * kcanvas/device/KRenderingStrokePainter.cpp:
+        (WebCore::KRenderingStrokePainter::KRenderingStrokePainter):
+        (WebCore::KRenderingStrokePainter::~KRenderingStrokePainter):
+        (WebCore::KRenderingStrokePainter::strokeWidth):
+        (WebCore::KRenderingStrokePainter::setStrokeWidth):
+        (WebCore::KRenderingStrokePainter::strokeMiterLimit):
+        (WebCore::KRenderingStrokePainter::setStrokeMiterLimit):
+        (WebCore::KRenderingStrokePainter::strokeCapStyle):
+        (WebCore::KRenderingStrokePainter::setStrokeCapStyle):
+        (WebCore::KRenderingStrokePainter::strokeJoinStyle):
+        (WebCore::KRenderingStrokePainter::setStrokeJoinStyle):
+        (WebCore::KRenderingStrokePainter::dashOffset):
+        (WebCore::KRenderingStrokePainter::setDashOffset):
+        (WebCore::KRenderingStrokePainter::dashArray):
+        (WebCore::KRenderingStrokePainter::setDashArray):
+        (WebCore::KRenderingStrokePainter::opacity):
+        (WebCore::KRenderingStrokePainter::setOpacity):
+        (WebCore::KRenderingStrokePainter::dirty):
+        (WebCore::KRenderingStrokePainter::setDirty):
+        * kcanvas/device/KRenderingStrokePainter.h:
+
 2006-09-16  Mark Rowe  <opendarwin.org@bdash.net.nz>
 
         Reviewed by Anders.
index c87c49bb133ffcda9d2be8a070090c5ad85b3f0f..05dd294ed3b7701a78a6e8460fd1b4b1c6f05a38 100644 (file)
 
 namespace WebCore {
 
-class RenderPath::Private {
-public:
-    Path path;
-
-    FloatRect fillBBox;
-    FloatRect strokeBbox;
-    AffineTransform matrix;
-    IntRect absoluteBounds;
-};
-
 // RenderPath
 RenderPath::RenderPath(RenderStyle* style, SVGStyledElement* node)
-    : RenderObject(node), d(new Private)
+    : RenderObject(node)
 {
     ASSERT(style != 0);
 }
 
 RenderPath::~RenderPath()
 {
-    delete d;
 }
 
 AffineTransform RenderPath::localTransform() const
 {
-    return d->matrix;
+    return m_matrix;
 }
 
 void RenderPath::setLocalTransform(const AffineTransform &matrix)
 {
-    d->matrix = matrix;
+    m_matrix = matrix;
 }
 
 
@@ -82,7 +71,7 @@ FloatPoint RenderPath::mapAbsolutePointToLocal(const FloatPoint& point) const
 
 bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill) const
 {
-    if (d->path.isEmpty())
+    if (m_path.isEmpty())
         return false;
 
     if (requiresFill && !KSVGPainterFactory::fillPaintServer(style(), this))
@@ -94,30 +83,30 @@ bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill) const
 
 FloatRect RenderPath::relativeBBox(bool includeStroke) const
 {
-    if (d->path.isEmpty())
+    if (m_path.isEmpty())
         return FloatRect();
 
     if (includeStroke) {
-        if (d->strokeBbox.isEmpty())
-            d->strokeBbox = strokeBBox();
-        return d->strokeBbox;
+        if (m_strokeBbox.isEmpty())
+            m_strokeBbox = strokeBBox();
+        return m_strokeBbox;
     }
 
-    if (d->fillBBox.isEmpty())
-        d->fillBBox = path().boundingRect();
-    return d->fillBBox;
+    if (m_fillBBox.isEmpty())
+        m_fillBBox = path().boundingRect();
+    return m_fillBBox;
 }
 
 void RenderPath::setPath(const Path& newPath)
 {
-    d->path = newPath;
-    d->strokeBbox = FloatRect();
-    d->fillBBox = FloatRect();
+    m_path = newPath;
+    m_strokeBbox = FloatRect();
+    m_fillBBox = FloatRect();
 }
 
 const Path& RenderPath::path() const
 {
-    return d->path;
+    return m_path;
 }
 
 void RenderPath::layout()
@@ -129,14 +118,14 @@ void RenderPath::layout()
     IntRect oldBounds;
     bool checkForRepaint = checkForRepaintDuringLayout();
     if (selfNeedsLayout() && checkForRepaint)
-        oldBounds = d->absoluteBounds;
+        oldBounds = m_absoluteBounds;
 
     static_cast<SVGStyledElement*>(element())->notifyAttributeChange();
 
-    d->absoluteBounds = getAbsoluteRepaintRect();
+    m_absoluteBounds = getAbsoluteRepaintRect();
 
-    setWidth(d->absoluteBounds.width());
-    setHeight(d->absoluteBounds.height());
+    setWidth(m_absoluteBounds.width());
+    setHeight(m_absoluteBounds.height());
 
     if (selfNeedsLayout() && checkForRepaint)
         repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
index dbe773daaf72ea52edaaab767b0a8135e9e14836..579cd533c78e3099eccfb672fa54ec7c7c2b9368 100644 (file)
@@ -26,6 +26,7 @@
 #define RenderPath_H
 #ifdef SVG_SUPPORT
 
+#include "AffineTransform.h"
 #include "DeprecatedValueList.h"
 #include "FloatRect.h"
 
@@ -99,8 +100,12 @@ private:
     
     PointerEventsHitRules pointerEventsHitRules();
 
-    class Private;
-    Private *d;
+    Path m_path;
+
+    mutable FloatRect m_fillBBox;
+    mutable FloatRect m_strokeBbox;
+    AffineTransform m_matrix;
+    IntRect m_absoluteBounds;
 };
 
 }
index 6134172fbb610d184a0fa09754867a09339b4130..45cc88001597495aa0dc040657360feae17147f7 100644 (file)
 
 namespace WebCore {
 
-class RenderSVGContainer::Private
-{
-public:
-    Private() : drawsContents(true), slice(false) { }    
-    ~Private() { }
-
-    bool drawsContents : 1;
-    bool slice : 1;
-    AffineTransform matrix;
-    
-    FloatRect viewport;
-    FloatRect viewBox;
-    KCAlign align;
-    IntRect absoluteBounds;
-};
-
 RenderSVGContainer::RenderSVGContainer(SVGStyledElement *node)
-: RenderContainer(node), d(new Private())
+    : RenderContainer(node)
+    , m_drawsContents(true)
+    , m_slice(false)
 {
     setReplaced(true);
 }
 
 RenderSVGContainer::~RenderSVGContainer()
 {
-    delete d;
 }
 
 bool RenderSVGContainer::drawsContents() const
 {
-    return d->drawsContents;
+    return m_drawsContents;
 }
 
 void RenderSVGContainer::setDrawsContents(bool drawsContents)
 {
-    d->drawsContents = drawsContents;
+    m_drawsContents = drawsContents;
 }
 
 AffineTransform RenderSVGContainer::localTransform() const
 {
-    return d->matrix;
+    return m_matrix;
 }
 
-void RenderSVGContainer::setLocalTransform(const AffineTransform &matrix)
+void RenderSVGContainer::setLocalTransform(const AffineTransformmatrix)
 {
-    d->matrix = matrix;
+    m_matrix = matrix;
 }
 
 bool RenderSVGContainer::canHaveChildren() const
@@ -114,7 +99,7 @@ void RenderSVGContainer::layout()
     IntRect oldBounds;
     bool checkForRepaint = checkForRepaintDuringLayout();
     if (selfNeedsLayout() && checkForRepaint)
-        oldBounds = d->absoluteBounds;
+        oldBounds = m_absoluteBounds;
 
     RenderObject* child = firstChild();
     while (child) {
@@ -126,7 +111,7 @@ void RenderSVGContainer::layout()
     calcWidth();
     calcHeight();
 
-    d->absoluteBounds = getAbsoluteRepaintRect();
+    m_absoluteBounds = getAbsoluteRepaintRect();
 
     if (selfNeedsLayout() && checkForRepaint)
         repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
@@ -138,8 +123,8 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
         return;
     
     // No one should be transforming us via these.
-    //ASSERT(d->x == 0);
-    //ASSERT(d->y == 0);
+    //ASSERT(m_x == 0);
+    //ASSERT(m_y == 0);
         
     if (shouldPaintBackgroundOrBorder() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
         paintBoxDecorations(paintInfo, parentX, parentY);
@@ -214,32 +199,32 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int parentX, int parentY)
 
 void RenderSVGContainer::setViewport(const FloatRect& viewport)
 {
-    d->viewport = viewport;
+    m_viewport = viewport;
 }
 
 FloatRect RenderSVGContainer::viewport() const
 {
-   return d->viewport;
+   return m_viewport;
 }
 
 void RenderSVGContainer::setViewBox(const FloatRect& viewBox)
 {
-    d->viewBox = viewBox;
+    m_viewBox = viewBox;
 }
 
 FloatRect RenderSVGContainer::viewBox() const
 {
-    return d->viewBox;
+    return m_viewBox;
 }
 
 void RenderSVGContainer::setAlign(KCAlign align)
 {
-    d->align = align;
+    m_align = align;
 }
 
 KCAlign RenderSVGContainer::align() const
 {
-    return d->align;
+    return m_align;
 }
 
 AffineTransform RenderSVGContainer::viewportTransform() const
@@ -285,7 +270,7 @@ AffineTransform RenderSVGContainer::absoluteTransform() const
     return viewportTransform() * RenderContainer::absoluteTransform();
 }
 
-bool RenderSVGContainer::fillContains(const FloatPoint &p) const
+bool RenderSVGContainer::fillContains(const FloatPointp) const
 {
     RenderObject *current = firstChild();
     while (current != 0) {
@@ -297,7 +282,7 @@ bool RenderSVGContainer::fillContains(const FloatPoint &p) const
     return false;
 }
 
-bool RenderSVGContainer::strokeContains(const FloatPoint &p) const
+bool RenderSVGContainer::strokeContains(const FloatPointp) const
 {
     RenderObject *current = firstChild();
     while (current != 0) {
@@ -325,12 +310,12 @@ FloatRect RenderSVGContainer::relativeBBox(bool includeStroke) const
 
 void RenderSVGContainer::setSlice(bool slice)
 {
-    d->slice = slice;
+    m_slice = slice;
 }
 
 bool RenderSVGContainer::slice() const
 {
-    return d->slice;
+    return m_slice;
 }
 
 AffineTransform RenderSVGContainer::getAspectRatio(const FloatRect& logical, const FloatRect& physical) const
index 501584db39be8a77f163985e15808fa46673e5e9..3b9e355117ebe355422b4d7a0ad891bff5ab58f8 100644 (file)
@@ -98,8 +98,14 @@ private:
     AffineTransform getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
     AffineTransform viewportTransform() const;
 
-    class Private;
-    Private* d;
+    bool m_drawsContents : 1;
+    bool m_slice : 1;
+    AffineTransform m_matrix;
+    
+    FloatRect m_viewport;
+    FloatRect m_viewBox;
+    KCAlign m_align;
+    IntRect m_absoluteBounds;
 };
 
 }
index c83af7a356d2667dd8d455ee82bc0917c8d09fa1..1d62dc08611e5e89cf0311c3facbca9e81a143cb 100644 (file)
 
 namespace WebCore {
 
-class KRenderingFillPainter::Private
-{
-public:
-    Private()
-    {
-        opacity = 1.0;
-        fillRule = RULE_NONZERO;
-    }
-
-    float opacity;
-    WindRule fillRule;
-};
-
-KRenderingFillPainter::KRenderingFillPainter() : d(new Private())
+KRenderingFillPainter::KRenderingFillPainter()
+     : m_opacity(1.0)
+     , m_fillRule(RULE_NONZERO)
 {
 }
 
 KRenderingFillPainter::~KRenderingFillPainter()
 {
-    delete d;
 }
 
 WindRule KRenderingFillPainter::fillRule() const
 {
-    return d->fillRule;
+    return m_fillRule;
 }
 
 void KRenderingFillPainter::setFillRule(WindRule rule)
 {
-    d->fillRule = rule;
+    m_fillRule = rule;
 }
 
 float KRenderingFillPainter::opacity() const
 {
-    return d->opacity;
+    return m_opacity;
 }
 
 void KRenderingFillPainter::setOpacity(float opacity)
 {
-    d->opacity = opacity;
+    m_opacity = opacity;
 }
 
 }
index 941518f9f3ee7e2fce1df2e3d29b2fc2de4c7a77..3ce01019a73f8ff31e6c5873397f1a8c7ab37f2f 100644 (file)
@@ -43,8 +43,9 @@ public:
     void setOpacity(float opacity);
 
 private:
-    class Private;
-    Private *d;
+    float m_opacity;
+    WindRule m_fillRule;
+
 };
 
 }
index 8e008a9ab8bb52bfd6e070c34579ce3583ebf572..402b7e0e4a093f1af7abbe885cf295f6e69f1b98 100644 (file)
@@ -60,31 +60,21 @@ TextStream &operator<<(TextStream &ts, const Vector<KCGradientStop>& l)
 }
 
 // KRenderingPaintServerGradient
-class KRenderingPaintServerGradient::Private
-{
-public:
-    Private() { boundingBoxMode = true; spreadMethod = SPREADMETHOD_PAD; listener = 0; }
-    ~Private() { }
-
-    Vector<KCGradientStop> stops;
-    KCGradientSpreadMethod spreadMethod;
-    bool boundingBoxMode;
-    AffineTransform gradientTransform;
-    KCanvasResourceListener *listener;
-};
-
-KRenderingPaintServerGradient::KRenderingPaintServerGradient() : KRenderingPaintServer(), d(new Private())
+KRenderingPaintServerGradient::KRenderingPaintServerGradient()
+    : KRenderingPaintServer()
+    , m_spreadMethod(SPREADMETHOD_PAD)
+    , m_boundingBoxMode(true)
+    , m_listener(0)
 {
 }
 
 KRenderingPaintServerGradient::~KRenderingPaintServerGradient()
 {
-    delete d;
 }
 
 const Vector<KCGradientStop>& KRenderingPaintServerGradient::gradientStops() const
 {
-    return d->stops;
+    return m_stops;
 }
 
 static inline bool compareStopOffset(const KCGradientStop& first, const KCGradientStop& second)
@@ -94,43 +84,43 @@ static inline bool compareStopOffset(const KCGradientStop& first, const KCGradie
 
 void KRenderingPaintServerGradient::setGradientStops(const Vector<KCGradientStop>& stops)
 {
-    d->stops = stops;
-    std::sort(d->stops.begin(), d->stops.end(), compareStopOffset);
+    m_stops = stops;
+    std::sort(m_stops.begin(), m_stops.end(), compareStopOffset);
 } 
 
 void KRenderingPaintServerGradient::setGradientStops(KRenderingPaintServerGradient* server)
 {
-    d->stops = server->gradientStops();
+    m_stops = server->gradientStops();
 }
 
 KCGradientSpreadMethod KRenderingPaintServerGradient::spreadMethod() const
 {
-    return d->spreadMethod;
+    return m_spreadMethod;
 }
 
 void KRenderingPaintServerGradient::setGradientSpreadMethod(const KCGradientSpreadMethod &method)
 {
-    d->spreadMethod = method;
+    m_spreadMethod = method;
 }
 
 bool KRenderingPaintServerGradient::boundingBoxMode() const
 {
-    return d->boundingBoxMode;
+    return m_boundingBoxMode;
 }
 
 void KRenderingPaintServerGradient::setBoundingBoxMode(bool mode)
 {
-    d->boundingBoxMode = mode;
+    m_boundingBoxMode = mode;
 }
 
 AffineTransform KRenderingPaintServerGradient::gradientTransform() const
 {
-    return d->gradientTransform;
+    return m_gradientTransform;
 }
 
 void KRenderingPaintServerGradient::setGradientTransform(const AffineTransform& mat)
 {
-    d->gradientTransform = mat;
+    m_gradientTransform = mat;
 }
 
 TextStream &KRenderingPaintServerGradient::externalRepresentation(TextStream &ts) const
@@ -148,42 +138,33 @@ TextStream &KRenderingPaintServerGradient::externalRepresentation(TextStream &ts
 }
 
 // KRenderingPaintServerLinearGradient
-class KRenderingPaintServerLinearGradient::Private
-{
-public:
-    Private() { }
-    ~Private() { }
-
-    FloatPoint start, end;
-};
-
-KRenderingPaintServerLinearGradient::KRenderingPaintServerLinearGradient() : KRenderingPaintServerGradient(), d(new Private())
+KRenderingPaintServerLinearGradient::KRenderingPaintServerLinearGradient()
+    : KRenderingPaintServerGradient()
 {
 }
 
 KRenderingPaintServerLinearGradient::~KRenderingPaintServerLinearGradient()
 {
-    delete d;
 }
 
 FloatPoint KRenderingPaintServerLinearGradient::gradientStart() const
 {
-    return d->start;
+    return m_start;
 }
 
 void KRenderingPaintServerLinearGradient::setGradientStart(const FloatPoint &start)
 {
-    d->start = start;
+    m_start = start;
 }
 
 FloatPoint KRenderingPaintServerLinearGradient::gradientEnd() const
 {
-    return d->end;
+    return m_end;
 }
 
 void KRenderingPaintServerLinearGradient::setGradientEnd(const FloatPoint &end)
 {
-    d->end = end;
+    m_end = end;
 }
 
 KCPaintServerType KRenderingPaintServerLinearGradient::type() const
@@ -201,53 +182,43 @@ TextStream &KRenderingPaintServerLinearGradient::externalRepresentation(TextStre
 }
 
 // KRenderingPaintServerRadialGradient
-class KRenderingPaintServerRadialGradient::Private
-{
-public:
-    Private() { }
-    ~Private() { }
-
-    float radius;
-    FloatPoint center, focal;
-};
-
-KRenderingPaintServerRadialGradient::KRenderingPaintServerRadialGradient() : KRenderingPaintServerGradient(), d(new Private())
+KRenderingPaintServerRadialGradient::KRenderingPaintServerRadialGradient()
+    : KRenderingPaintServerGradient()
 {
 }
 
 KRenderingPaintServerRadialGradient::~KRenderingPaintServerRadialGradient()
 {
-    delete d;
 }
 
 FloatPoint KRenderingPaintServerRadialGradient::gradientCenter() const
 {
-    return d->center;
+    return m_center;
 }
 
 void KRenderingPaintServerRadialGradient::setGradientCenter(const FloatPoint &center)
 {
-    d->center = center;
+    m_center = center;
 }
 
 FloatPoint KRenderingPaintServerRadialGradient::gradientFocal() const
 {
-    return d->focal;
+    return m_focal;
 }
 
 void KRenderingPaintServerRadialGradient::setGradientFocal(const FloatPoint &focal)
 {
-    d->focal = focal;
+    m_focal = focal;
 }
 
 float KRenderingPaintServerRadialGradient::gradientRadius() const
 {
-    return d->radius;
+    return m_radius;
 }
 
 void KRenderingPaintServerRadialGradient::setGradientRadius(float radius)
 {
-    d->radius = radius;
+    m_radius = radius;
 }
 
 KCPaintServerType KRenderingPaintServerRadialGradient::type() const
@@ -257,12 +228,12 @@ KCPaintServerType KRenderingPaintServerRadialGradient::type() const
 
 KCanvasResourceListener *KRenderingPaintServerGradient::listener() const
 {
-    return d->listener;
+    return m_listener;
 }
 
 void KRenderingPaintServerGradient::setListener(KCanvasResourceListener *listener)
 {
-    d->listener = listener;
+    m_listener = listener;
 }
 
 TextStream &KRenderingPaintServerRadialGradient::externalRepresentation(TextStream &ts) const
index b377efb3b7be377724e02731304f662af27ea520..cbbe323c7f2c2668646cdb24a323faeb682e98d1 100644 (file)
@@ -68,8 +68,11 @@ public:
 
     TextStream &externalRepresentation(TextStream &) const;
 private:
-    class Private;
-    Private *d;
+    Vector<KCGradientStop> m_stops;
+    KCGradientSpreadMethod m_spreadMethod;
+    bool m_boundingBoxMode;
+    AffineTransform m_gradientTransform;
+    KCanvasResourceListener* m_listener;
 };
 
 class KRenderingPaintServerLinearGradient : public KRenderingPaintServerGradient
@@ -89,8 +92,8 @@ public:
 
     TextStream &externalRepresentation(TextStream &) const;
 private:
-    class Private;
-    Private *d;
+    FloatPoint m_start;
+    FloatPoint m_end;
 };
 
 class KRenderingPaintServerRadialGradient : public KRenderingPaintServerGradient
@@ -113,8 +116,9 @@ public:
 
     TextStream &externalRepresentation(TextStream &) const;
 private:
-    class Private;
-    Private *d;
+    float m_radius;
+    FloatPoint m_center;
+    FloatPoint m_focal;
 };
 
 }
index bc42ed52ad4039e0c75f8b98430ac127c94d1633..73098a914a0477beb2b893ec6eb9f5544eb40049 100644 (file)
 
 namespace WebCore {
 
-class KRenderingPaintServerPattern::Private
-{
-public:
-    Private()
-    {
-        tile = 0;
-        useBoundingBoxMode = true;
-        listener = 0;
-    }
-    ~Private() { delete tile; }
-
-    KCanvasImage *tile;
-    AffineTransform patternTransform;
-    FloatRect bbox;
-    bool useBoundingBoxMode;
-    KCanvasResourceListener *listener;
-};
-
-KRenderingPaintServerPattern::KRenderingPaintServerPattern() : KRenderingPaintServer(), d(new Private())
+KRenderingPaintServerPattern::KRenderingPaintServerPattern()
+    : KRenderingPaintServer()
+    , m_tile(0)
+    , m_useBoundingBoxMode(true)
+    , m_listener(0)
 {
 }
 
 KRenderingPaintServerPattern::~KRenderingPaintServerPattern()
 {
-    delete d;
+    delete m_tile;
 }
 
 void KRenderingPaintServerPattern::setBbox(const FloatRect& rect)
 {
-    d->bbox = rect;
+    m_bbox = rect;
 }
 
 FloatRect KRenderingPaintServerPattern::bbox() const
 {
-    return d->bbox;
+    return m_bbox;
 }
 
 bool KRenderingPaintServerPattern::boundingBoxMode() const
 {
-    return d->useBoundingBoxMode;
+    return m_useBoundingBoxMode;
 }
 
 void KRenderingPaintServerPattern::setBoundingBoxMode(bool mode)
 {
-    d->useBoundingBoxMode = mode;
+    m_useBoundingBoxMode = mode;
 }
 
 KCanvasImage *KRenderingPaintServerPattern::tile() const
 {
-    return d->tile;
+    return m_tile;
 }
 
 void KRenderingPaintServerPattern::setTile(KCanvasImage *tile)
 {
-    d->tile = tile;
+    m_tile = tile;
 }
 
 AffineTransform KRenderingPaintServerPattern::patternTransform() const
 {
-    return d->patternTransform;
+    return m_patternTransform;
 }
 
 void KRenderingPaintServerPattern::setPatternTransform(const AffineTransform& mat)
 {
-    d->patternTransform = mat;
+    m_patternTransform = mat;
 }
 
 KCPaintServerType KRenderingPaintServerPattern::type() const
@@ -105,12 +91,12 @@ KCPaintServerType KRenderingPaintServerPattern::type() const
 
 KCanvasResourceListener *KRenderingPaintServerPattern::listener() const
 {
-    return d->listener;
+    return m_listener;
 }
 
 void KRenderingPaintServerPattern::setListener(KCanvasResourceListener *listener)
 {
-    d->listener = listener;
+    m_listener = listener;
 }
 
 TextStream &KRenderingPaintServerPattern::externalRepresentation(TextStream &ts) const
index 430cfb5c97331c3c8b90b9722e4cfa0da853d98f..b28375bdbe82f6cd9d884f9b247cfdef338f4335 100644 (file)
@@ -39,7 +39,7 @@ public:
     virtual KCPaintServerType type() const;
 
     // Pattern bbox
-    void setBbox(const FloatRect &rect);
+    void setBbox(const FloatRectrect);
     FloatRect bbox() const;
     
     // Pattern x,y phase points are relative when in boundingBoxMode
@@ -48,19 +48,23 @@ public:
     void setBoundingBoxMode(bool mode = true);
     
     // 'Pattern' interface
-    KCanvasImage *tile() const;
-    void setTile(KCanvasImage *tile);
+    KCanvasImagetile() const;
+    void setTile(KCanvasImagetile);
 
     AffineTransform patternTransform() const;
     void setPatternTransform(const AffineTransform&);
 
-    KCanvasResourceListener *listener() const;
-    void setListener(KCanvasResourceListener *listener);
-    TextStream &externalRepresentation(TextStream &) const;
+    KCanvasResourceListenerlistener() const;
+    void setListener(KCanvasResourceListenerlistener);
+    TextStream &externalRepresentation(TextStream&) const;
 
 private:
-    class Private;
-    Private *d;
+    KCanvasImage* m_tile;
+    AffineTransform m_patternTransform;
+    FloatRect m_bbox;
+    bool m_useBoundingBoxMode;
+    KCanvasResourceListener* m_listener;
+
 };
 
 }
index 0a3961be3ebde768878822f503a241a1ea9ad5ee..993ab3e3631b8489c15d0930486608412d60adb9 100644 (file)
 
 namespace WebCore {
 
-class KRenderingPaintServerSolid::Private
-{
-public:
-    Private() { }
-    ~Private() { }
-
-    Color color;
-};
-
-KRenderingPaintServerSolid::KRenderingPaintServerSolid() : KRenderingPaintServer(), d(new Private())
+KRenderingPaintServerSolid::KRenderingPaintServerSolid()
+    : KRenderingPaintServer()
 {
 }
 
 KRenderingPaintServerSolid::~KRenderingPaintServerSolid()
 {
-    delete d;
 }
 
 Color KRenderingPaintServerSolid::color() const
 {
-    return d->color;
+    return m_color;
 }
 
 void KRenderingPaintServerSolid::setColor(const Color &color)
 {
-    d->color = color;
+    m_color = color;
 }
 
 KCPaintServerType KRenderingPaintServerSolid::type() const
index 8d5b35e2035712686117947921354c5dbd6e02c7..8496728369477f8f2931a5a062bf810ba29fec7a 100644 (file)
@@ -42,8 +42,7 @@ public:
 
     TextStream &externalRepresentation(TextStream &) const;
 private:
-    class Private;
-    Private *d;
+    Color m_color;
 };
 
 }
index 9846920f82e7d3ae4ba28cb49e9cc0172490c329..664d08d6d8a3dacdb74c355b550774cb0aa4cd25 100644 (file)
 
 namespace WebCore {
 
-class KRenderingStrokePainter::Private
-{
-public:
-    Private()
-    {
-        dirty = true;
-        opacity = 1.0;
-        miterLimit = 4;
-        dashOffset = 0.0;
-        strokeWidth = 1.0;
-        capStyle = CAP_BUTT;
-        joinStyle = JOIN_MITER;
-    }
-
-    bool dirty;
-    float opacity;
-
-    float strokeWidth;
-    unsigned int miterLimit;
-
-    KCCapStyle capStyle;
-    KCJoinStyle joinStyle;
-
-    float dashOffset;
-    KCDashArray dashArray;
-};
-
-KRenderingStrokePainter::KRenderingStrokePainter() : d(new Private())
+KRenderingStrokePainter::KRenderingStrokePainter()
+    : m_dirty(true)
+    , m_opacity(1.0)
+    , m_strokeWidth(1.0)
+    , m_miterLimit(4)
+    , m_capStyle(CAP_BUTT)
+    , m_joinStyle(JOIN_MITER)
+    , m_dashOffset(0.0)
 {
 }
 
 KRenderingStrokePainter::~KRenderingStrokePainter()
 {
-    delete d;
 }
 
 float KRenderingStrokePainter::strokeWidth() const
 {
-    return d->strokeWidth;
+    return m_strokeWidth;
 }
 
 void KRenderingStrokePainter::setStrokeWidth(float width)
 {
     setDirty();
-    d->strokeWidth = width;
+    m_strokeWidth = width;
 }
 
 unsigned int KRenderingStrokePainter::strokeMiterLimit() const
 {
-    return d->miterLimit;
+    return m_miterLimit;
 }
 
 void KRenderingStrokePainter::setStrokeMiterLimit(unsigned int limit)
 {
     setDirty();
-    d->miterLimit = limit;
+    m_miterLimit = limit;
 }
 
 KCCapStyle KRenderingStrokePainter::strokeCapStyle() const
 {
-    return d->capStyle;
+    return m_capStyle;
 }
 
 void KRenderingStrokePainter::setStrokeCapStyle(KCCapStyle style)
 {
     setDirty();
-    d->capStyle = style;
+    m_capStyle = style;
 }
 
 KCJoinStyle KRenderingStrokePainter::strokeJoinStyle() const
 {
-    return d->joinStyle;
+    return m_joinStyle;
 }
 
 void KRenderingStrokePainter::setStrokeJoinStyle(KCJoinStyle style)
 {
     setDirty();
-    d->joinStyle = style;
+    m_joinStyle = style;
 }
 
 float KRenderingStrokePainter::dashOffset() const
 {
-    return d->dashOffset;
+    return m_dashOffset;
 }
 
 void KRenderingStrokePainter::setDashOffset(float offset)
 {
     setDirty();
-    d->dashOffset = offset;
+    m_dashOffset = offset;
 }
 
-KCDashArray &KRenderingStrokePainter::dashArray() const
+KCDashArrayKRenderingStrokePainter::dashArray() const
 {
-    return d->dashArray;
+    return m_dashArray;
 }
 
-void KRenderingStrokePainter::setDashArray(const KCDashArray &dashArray)
+void KRenderingStrokePainter::setDashArray(const KCDashArraydashArray)
 {
     setDirty();
-    d->dashArray = dashArray;
+    m_dashArray = dashArray;
 }
 
 float KRenderingStrokePainter::opacity() const
 {
-    return d->opacity;
+    return m_opacity;
 }
 
 void KRenderingStrokePainter::setOpacity(float opacity)
 {
     setDirty();
-    d->opacity = opacity;
+    m_opacity = opacity;
 }
 
 bool KRenderingStrokePainter::dirty() const
 {
-    return d->dirty;
+    return m_dirty;
 }
 
 void KRenderingStrokePainter::setDirty(bool dirty)
 {
-    d->dirty = dirty;
+    m_dirty = dirty;
 }
 
 }
index c2bd5797ff65220ac3d6651cda2fb41e72bc895f..7a874607d553a4d48b8a596fe77f9bfe900808ea 100644 (file)
@@ -52,8 +52,8 @@ public:
     float dashOffset() const;
     void setDashOffset(float offset);
 
-    KCDashArray &dashArray() const;
-    void setDashArray(const KCDashArray &dashArray);
+    KCDashArraydashArray() const;
+    void setDashArray(const KCDashArraydashArray);
 
     float opacity() const;
     void setOpacity(float opacity);
@@ -63,8 +63,17 @@ public:
     void setDirty(bool dirty = true);
 
 private:
-    class Private;
-    Private *d;
+    bool m_dirty;
+    float m_opacity;
+
+    float m_strokeWidth;
+    unsigned int m_miterLimit;
+
+    KCCapStyle m_capStyle;
+    KCJoinStyle m_joinStyle;
+
+    float m_dashOffset;
+    mutable KCDashArray m_dashArray;
 };
 
 }