2006-11-01 Oliver Hunt <oliver@apple.com>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Nov 2006 01:41:28 +0000 (01:41 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Nov 2006 01:41:28 +0000 (01:41 +0000)
        Reviewed by Adam.

        Converting more or kcanvas/quartz from Obj-C to C++
        Minor SVG updates
        compatibility fixes

        * WebCore.xcodeproj/project.pbxproj:
        * kcanvas/device/KRenderingPaintServer.h:
        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.cpp: Added.
        (WebCore::KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm: Removed.
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.cpp: Added.
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm: Removed.
        * kcanvas/device/quartz/QuartzSupport.h:
        * ksvg2/css/SVGCSSStyleSelector.cpp:
        * ksvg2/misc/KCanvasRenderingStyle.h:
        * ksvg2/scripts/cssmakeprops:
        * ksvg2/scripts/cssmakevalues:
        * ksvg2/scripts/make_names.pl:
        * ksvg2/svg/SVGAnimateColorElement.cpp:
        * ksvg2/svg/SVGAnimateTransformElement.cpp:
        * ksvg2/svg/SVGAnimationElement.cpp:
        * ksvg2/svg/SVGMaskElement.cpp:
        * ksvg2/svg/SVGPatternElement.cpp:
        * ksvg2/svg/svgpathparser.cpp:
        * platform/Path.cpp:
        * platform/graphics/svg/SVGResourceImage.h:
        * rendering/RenderPath.cpp:
        * rendering/SVGRenderAsText.cpp:

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

21 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/kcanvas/device/KRenderingPaintServer.h
WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.cpp [moved from WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm with 99% similarity]
WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.cpp [moved from WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm with 97% similarity]
WebCore/kcanvas/device/quartz/QuartzSupport.h
WebCore/ksvg2/css/SVGCSSStyleSelector.cpp
WebCore/ksvg2/misc/KCanvasRenderingStyle.h
WebCore/ksvg2/scripts/cssmakeprops
WebCore/ksvg2/scripts/cssmakevalues
WebCore/ksvg2/scripts/make_names.pl
WebCore/ksvg2/svg/SVGAnimateColorElement.cpp
WebCore/ksvg2/svg/SVGAnimateTransformElement.cpp
WebCore/ksvg2/svg/SVGAnimationElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/svgpathparser.cpp
WebCore/platform/Path.cpp
WebCore/platform/graphics/svg/SVGResourceImage.h
WebCore/rendering/RenderPath.cpp
WebCore/rendering/SVGRenderAsText.cpp

index 5fc1d4cb4e64d53e872c1e7f4a6957dee3424a3d..8accc2689c7cac16152740bba0d04c2e34242009 100644 (file)
@@ -1,3 +1,35 @@
+2006-11-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Adam.
+
+        Converting more or kcanvas/quartz from Obj-C to C++
+        Minor SVG updates
+        compatibility fixes
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * kcanvas/device/KRenderingPaintServer.h:
+        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.cpp: Added.
+        (WebCore::KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
+        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm: Removed.
+        * kcanvas/device/quartz/KRenderingPaintServerQuartz.cpp: Added.
+        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm: Removed.
+        * kcanvas/device/quartz/QuartzSupport.h:
+        * ksvg2/css/SVGCSSStyleSelector.cpp:
+        * ksvg2/misc/KCanvasRenderingStyle.h:
+        * ksvg2/scripts/cssmakeprops:
+        * ksvg2/scripts/cssmakevalues:
+        * ksvg2/scripts/make_names.pl:
+        * ksvg2/svg/SVGAnimateColorElement.cpp:
+        * ksvg2/svg/SVGAnimateTransformElement.cpp:
+        * ksvg2/svg/SVGAnimationElement.cpp:
+        * ksvg2/svg/SVGMaskElement.cpp:
+        * ksvg2/svg/SVGPatternElement.cpp:
+        * ksvg2/svg/svgpathparser.cpp:
+        * platform/Path.cpp:
+        * platform/graphics/svg/SVGResourceImage.h:
+        * rendering/RenderPath.cpp:
+        * rendering/SVGRenderAsText.cpp:
+
 2006-11-02  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Adele.
index a7fe12771b8e1a8badc0b41f989941b61e1a396b..e399003350f1192d37ee847f36f74978c50daf65 100644 (file)
                A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */; };
                A88AD3B00952486E001DD196 /* KRenderingDeviceQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */; };
                A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */; };
-               A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */; };
+               A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.cpp */; };
                A88AD3B30952486E001DD196 /* KRenderingPaintServerQuartz.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB74089701F800BA5114 /* KRenderingPaintServerQuartz.h */; };
-               A88AD3B40952486E001DD196 /* KRenderingPaintServerQuartz.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.mm */; };
+               A88AD3B40952486E001DD196 /* KRenderingPaintServerQuartz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.cpp */; };
                A88AD3B50952486E001DD196 /* QuartzSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB76089701F800BA5114 /* QuartzSupport.h */; };
                A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */; };
                A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */; };
                A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasItemQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDeviceQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDeviceQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRenderingPaintServerGradientQuartz.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingPaintServerGradientQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB74089701F800BA5114 /* KRenderingPaintServerQuartz.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingPaintServerQuartz.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRenderingPaintServerQuartz.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingPaintServerQuartz.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB76089701F800BA5114 /* QuartzSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QuartzSupport.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuartzSupport.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasFilters.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                A8C0FB6C089701F800BA5114 /* KCanvasItemQuartz.cpp */,
                                A8C0FB71089701F800BA5114 /* KRenderingDeviceQuartz.h */,
                                A8C0FB72089701F800BA5114 /* KRenderingDeviceQuartz.cpp */,
-                               A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.mm */,
+                               A8C0FB73089701F800BA5114 /* KRenderingPaintServerGradientQuartz.cpp */,
                                A8C0FB74089701F800BA5114 /* KRenderingPaintServerQuartz.h */,
-                               A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.mm */,
+                               A8C0FB75089701F800BA5114 /* KRenderingPaintServerQuartz.cpp */,
                                A8C0FB76089701F800BA5114 /* QuartzSupport.h */,
                                A8C0FB77089701F800BA5114 /* QuartzSupport.cpp */,
                        );
                                A88AD3AB0952486D001DD196 /* KCanvasFilterQuartz.mm in Sources */,
                                A88AD3AD0952486D001DD196 /* KCanvasItemQuartz.cpp in Sources */,
                                A88AD3B10952486E001DD196 /* KRenderingDeviceQuartz.cpp in Sources */,
-                               A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.mm in Sources */,
-                               A88AD3B40952486E001DD196 /* KRenderingPaintServerQuartz.mm in Sources */,
+                               A88AD3B20952486E001DD196 /* KRenderingPaintServerGradientQuartz.cpp in Sources */,
+                               A88AD3B40952486E001DD196 /* KRenderingPaintServerQuartz.cpp in Sources */,
                                A88AD3B60952486E001DD196 /* QuartzSupport.cpp in Sources */,
                                A88AD401095248F0001DD196 /* SVGRenderStyle.cpp in Sources */,
                                A88AD403095248F0001DD196 /* SVGRenderStyleDefs.cpp in Sources */,
index e1136a48d6229e09d57b29e56dc8caaab8048730..4176ccc1c504aa993be8a7f58fcc9c259a793158 100644 (file)
@@ -35,6 +35,10 @@ class RenderPath;
 class RenderStyle;
 class TextStream;
 
+#ifdef PS_SOLID
+#undef PS_SOLID
+#endif
+
 // Enumerations
 enum KCPaintServerType {
     // Painting mode
similarity index 99%
rename from WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm
rename to WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.cpp
index 4bc59619c9e134424104c6b0b9a1ab60c207c9cd..1784e2722bebdb832c5d374efc5afa283b66200c 100644 (file)
@@ -151,9 +151,6 @@ void KRenderingPaintServerGradientQuartz::updateQuartzGradientCache(const KRende
     if (!m_stopsCache)
         updateQuartzGradientStopsCache(server->gradientStops());
     
-    if (!m_stopsCount)
-        NSLog(@"Warning, no gradient stops, gradient (%p) will be all black!", this);
-    
     if (m_shadingCache)
         CGShadingRelease(m_shadingCache);
     if (server->type() == PS_RADIAL_GRADIENT) {
similarity index 97%
rename from WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.mm
rename to WebCore/kcanvas/device/quartz/KRenderingPaintServerQuartz.cpp
index fb6844ab9758c1deb9e4402153c3b09271007ed0..57c1462aaacb0843c5ddd5077934a31653b4baca 100644 (file)
 #include "config.h"
 
 #ifdef SVG_SUPPORT
-#import "SVGResourceImage.h"
-#import "KRenderingPaintServerQuartz.h"
-#import "RenderPath.h"
-#import "QuartzSupport.h"
-#import "KRenderingDeviceQuartz.h"
+#include "SVGResourceImage.h"
+#include "KRenderingPaintServerQuartz.h"
+#include "RenderPath.h"
+#include "QuartzSupport.h"
+#include "KRenderingDeviceQuartz.h"
 
-#import "KCanvasRenderingStyle.h"
-#import "KRenderingPaintServer.h"
-#import "KRenderingDevice.h"
+#include "KCanvasRenderingStyle.h"
+#include "KRenderingPaintServer.h"
+#include "KRenderingDevice.h"
 
-#import "Logging.h"
+#include "Logging.h"
 
 namespace WebCore {
 
index d057fc230c994ae37a4cd48d4c074251cb5850c7..f5d43ef192099bb534438ff9831a8da83d8c52e4 100644 (file)
@@ -28,6 +28,7 @@
 
 #ifdef SVG_SUPPORT
 
+#include <ApplicationServices/ApplicationServices.h>
 #include "GraphicsTypes.h"
 
 namespace WebCore {
index d5636d20d071df6584f63bf1bfc5606ba6981fb5..83b53f840ef3ecdf1c201c6aa597a42e88f2c625 100644 (file)
@@ -44,6 +44,7 @@
 #include "ksvgcssproperties.h"
 #include <stdlib.h>
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 #define HANDLE_INHERIT(prop, Prop) \
 if (isInherit) \
index 17514e692c53ee9d43755e7246a07c7a17ef6ee5..b3683bd87fe2166e1bd7ceeb7a8f3aa7787a5869 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <wtf/Vector.h>
 
+#include "QuartzSupport.h"
+
 namespace WebCore {
 
 // Special types
index 559910c745deb6527acc44c1eadbe5c7984082fa..eabf45e4745857305ae4d6e06dd4c944671b59e7 100755 (executable)
@@ -42,7 +42,7 @@ open HEADER, ">$fileh" or die "Can't open $fileh\n";
 open OUT, ">$filegperf" or die "Can't open $filegperf\n";
 
 print OUT "%{\n/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n#include \"$fileh\"\n%}\n";
-print OUT "struct css_prop {\n    int name;\n    int id;\n};\n\n";
+print OUT "struct css_prop {\n    const char* name;\n    int id;\n};\n\n";
 print OUT "static const struct css_prop *find${ns}Prop (register const char *str, register unsigned int len);\n\n%%\n";
 
 print HEADER "/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSPROPERTIES_H\n#define ${nsFull}_CSSPROPERTIES_H\n\n";
@@ -107,7 +107,7 @@ print HEADER "}\n";
 print HEADER "\n#endif\n";
 close HEADER;
 
-my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -P -G -D -E -C -o -t -k '*' -Nfind${ns}Prop -Hhash_prop -Wwordlist_prop -Qspool_prop -s 3 $filegperf > $filec");
+my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -G -D -E -C -o -t -k '*' -Nfind${ns}Prop -Hhash_prop -Wwordlist_prop -D -s 3 $filegperf > $filec");
 if ($result) {
   unlink "$filec";
   exit $result;
@@ -124,14 +124,16 @@ system("/bin/sh", "-c", "perl -pi -e \"s/lookup/lookupProp/g\" $filec");
 # read the hash mappings (is there a better way?)
 my %hmap = ();
 open(IN, "< $filec");
+my $i = 0;
 while(<IN>) {
        my $lookFor = "CSS_PROP_";
        if ($nsFull ne "KDOM") {
                $lookFor = $ns . $lookFor;
        }
 
-       if (/spool_prop_str(\d+), ${lookFor}([\w_]+)/) {
-               $hmap{$amap{$2}} = $1;
+       if (/"[\w-]+", ${lookFor}([\w_]+)/) {
+               $hmap{$amap{$1}} = $i;
+               $i += 1;
        }
 }
 close(IN);  
@@ -161,7 +163,7 @@ if ($nsFull ne "KDOM") {
 print OUT "    65535\n};\n\n";
 print OUT "const char *getSVGCSSPropertyName(unsigned short id)\n{\n";
 print OUT "    if (!id || id > $lookFor) return \"\";\n";
-print OUT "    return spool_prop + wordlist_prop[propList[id]].name;\n";
+print OUT "    return wordlist_prop[propList[id]].name;\n";
 print OUT "}\n";
 print OUT "\nint getSVGCSSPropertyID(const char *tagStr, int len)\n";
 print OUT "{\n";
index 7ee9145b9ab8a4f1e2d763528ab1a4351b263138..a0c4c05c54c14bd25dba305517860308a2156574 100755 (executable)
@@ -42,7 +42,7 @@ open HEADER, ">$fileh" or die "Can't open $fileh\n";
 open OUT, ">$filegperf" or die "Can't open $filegperf\n";
 
 print OUT "%{\n/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n#include \"$fileh\"\n%}\n";
-print OUT "struct css_val {\n    int name;\n    int id;\n};\n\n";
+print OUT "struct css_val {\n    const char* name;\n    int id;\n};\n\n";
 print OUT "static const struct css_val *find${ns}Val (register const char *str, register unsigned int len);\n\n%%\n";
 
 print HEADER "/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSVALUES_H\n#define ${nsFull}_CSSVALUES_H\n\n";
@@ -108,7 +108,7 @@ print HEADER "}\n";
 print HEADER "\n#endif\n";
 close HEADER;
 
-my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -P -G -D -E -C -o -t -k '*' -Nfind${ns}Val -Hhash_val -Wwordlist_val -Qspool_val -s 3 $filegperf > $filec");
+my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -G -D -E -C -o -t -k '*' -Nfind${ns}Val -Hhash_val -Wwordlist_val -D -s 3 $filegperf > $filec");
 if ($result) {
   unlink "$filec";
   exit $result;
@@ -125,14 +125,16 @@ system("/bin/sh", "-c", "perl -pi -e \"s/lookup/lookupVal/g\" $filec");
 # read the hash mappings (is there a better way?)
 my %hmap = ();
 open(IN, "< $filec");
+my $i = 0;
 while(<IN>) {
        my $lookFor = "CSS_VAL_";
        if ($nsFull ne "KDOM") {
                $lookFor = $ns . $lookFor;
        }
 
-       if (/spool_val_str(\d+), ${lookFor}([\w_]+)/) {
-               $hmap{$amap{$2}} = $1;
+       if (/"[\w-]+", ${lookFor}([\w_]+)/) {
+               $hmap{$amap{$1}} = $i;
+               $i += 1;
        }
 }
 close(IN);  
@@ -162,7 +164,7 @@ if ($nsFull ne "KDOM") {
 print OUT "    65535\n};\n\n";
 print OUT "const char *getSVGCSSValueID(unsigned short id)\n{\n";
 print OUT "    if (!id || id > $lookFor) return \"\";\n";
-print OUT "    return spool_val + wordlist_val[valList[id]].name;\n";
+print OUT "    return wordlist_val[valList[id]].name;\n";
 print OUT "}\n";
 print OUT "\nint getSVGCSSValueID(const char *tagStr, int len)\n";
 print OUT "{\n";
index d811b0b1920a38588f05a306e95fe03a8fe639f8..d7cd8d70b649032cc9c9ff3cef41a77559e3a745 100755 (executable)
@@ -71,8 +71,8 @@ my $factoryBasePath = "$outputDir/${namespace}ElementFactory";
 printNamesHeaderFile("$namesBasePath.h");
 printNamesCppFile("$namesBasePath.cpp");
 if ($printFactory) {
-       printFactoryCppFile("$factoryBasePath.cpp");
-       printFactoryHeaderFile("$factoryBasePath.h");
+    printFactoryCppFile("$factoryBasePath.cpp");
+    printFactoryHeaderFile("$factoryBasePath.h");
 }
 
 
@@ -80,85 +80,87 @@ if ($printFactory) {
 
 sub readNames
 {
-       my $namesFile = shift;
-       
-       die "Failed to open file: $namesFile" unless open(NAMES, "<", $namesFile);
-       my @names = ();
-       while (<NAMES>) {
-               next if (m/#/);
-               s/-/_/g;
-               chomp $_;
-               push @names, $_;
-       }       
-       close(NAMES);
-       
-       die "Failed to read names from file: $namesFile" unless (scalar(@names));
-       
-       return @names
+    my $namesFile = shift;
+    
+    die "Failed to open file: $namesFile" unless open(NAMES, "<", $namesFile);
+    my @names = ();
+    while (<NAMES>) {
+        next if (m/#/);
+        s/-/_/g;
+        chomp $_;
+        push @names, $_;
+    }    
+    close(NAMES);
+    
+    die "Failed to read names from file: $namesFile" unless (scalar(@names));
+    
+    return @names
 }
 
 sub printMacros
 {
-       my @names = @_;
-       for my $name (@names) {
-               print "    macro($name) \\\n";
-       }
+    my @names = @_;
+    for my $name (@names) {
+        print "    macro($name) \\\n";
+    }
 }
 
 sub printConstructors
 {
-       my @names = @_;
-       for my $name (@names) {
-               my $upperCase = upperCaseName($name);
-       
-               print "${namespace}Element *${name}Constructor(Document *doc, bool createdByParser)\n";
-               print "{\n";
-               print "    return new ${namespace}${upperCase}Element(${name}Tag, doc);\n";
-               print "}\n\n";
-       }
+    my @names = @_;
+    print "#ifdef SVG_SUPPORT\n";
+    for my $name (@names) {
+        my $upperCase = upperCaseName($name);
+    
+        print "${namespace}Element *${name}Constructor(Document *doc, bool createdByParser)\n";
+        print "{\n";
+        print "    return new ${namespace}${upperCase}Element(${name}Tag, doc);\n";
+        print "}\n\n";
+    }
+    print "#endif\n";
 }
 
 sub printFunctionInits
 {
-       my @names = @_;
-       for my $name (@names) {
-               print "    gFunctionMap->set(${name}Tag.localName().impl(), ${name}Constructor);\n";
-       }
+    my @names = @_;
+    for my $name (@names) {
+        print "    gFunctionMap->set(${name}Tag.localName().impl(), ${name}Constructor);\n";
+    }
 }
 
 sub svgCapitalizationHacks
 {
-       my $name = shift;
-       
-       if ($name =~ /^fe(.+)$/) {
-               $name = "FE" . ucfirst $1;
-       }
-       $name =~ s/kern/Kern/;
-       $name =~ s/mpath/MPath/;
-       $name =~ s/svg/SVG/;
-       $name =~ s/tref/TRef/;
-       $name =~ s/tspan/TSpan/;
-       $name =~ s/uri/URI/;
-       
-       return $name;
+    my $name = shift;
+    
+    if ($name =~ /^fe(.+)$/) {
+        $name = "FE" . ucfirst $1;
+    }
+    $name =~ s/kern/Kern/;
+    $name =~ s/mpath/MPath/;
+    $name =~ s/svg/SVG/;
+    $name =~ s/tref/TRef/;
+    $name =~ s/tspan/TSpan/;
+    $name =~ s/uri/URI/;
+    
+    return $name;
 }
 
 sub upperCaseName
 {
-       my $name = shift;
-       
-       $name = svgCapitalizationHacks($name) if ($namespace eq "SVG");
-       
-       while ($name =~ /^(.*?)_(.*)/) {
-               $name = $1 . ucfirst $2;
-       }
-       
-       return ucfirst $name;
+    my $name = shift;
+    
+    $name = svgCapitalizationHacks($name) if ($namespace eq "SVG");
+    
+    while ($name =~ /^(.*?)_(.*)/) {
+        $name = $1 . ucfirst $2;
+    }
+    
+    return ucfirst $name;
 }
 
 sub printLicenseHeader
 {
-       print "/*
+    print "/*
  * THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT.
  *
  *
@@ -192,61 +194,61 @@ sub printLicenseHeader
 
 sub printNamesHeaderFile
 {
-       my $headerPath = shift;
-       redirectSTDOUT($headerPath);
-       
-       printLicenseHeader();
-       print "#ifndef DOM_${namespace}NAMES_H\n";
-       print "#define DOM_${namespace}NAMES_H\n\n";
-       print "#include \"QualifiedName.h\"\n\n";
-       
-       print "namespace $cppNamespace { namespace ${namespace}Names {\n\n";
-       
-       if (scalar(@tags)) {
-               print"#define DOM_${namespace}NAMES_FOR_EACH_TAG(macro) \\\n";
-               printMacros(@tags);
-               print"// end of macro\n\n";
-       }
-       if (scalar(@attrs)) {
-               print "#define DOM_${namespace}NAMES_FOR_EACH_ATTR(macro) \\\n";
-               printMacros(@attrs);
-               print "// end of macro\n\n";
-       }
-       
-       my $lowerNamespace = lc($namespacePrefix);
-       print "#ifndef DOM_${namespace}NAMES_HIDE_GLOBALS\n";
+    my $headerPath = shift;
+    redirectSTDOUT($headerPath);
+    
+    printLicenseHeader();
+    print "#ifndef DOM_${namespace}NAMES_H\n";
+    print "#define DOM_${namespace}NAMES_H\n\n";
+    print "#include \"QualifiedName.h\"\n\n";
+    
+    print "namespace $cppNamespace { namespace ${namespace}Names {\n\n";
+    
+    if (scalar(@tags)) {
+        print"#define DOM_${namespace}NAMES_FOR_EACH_TAG(macro) \\\n";
+        printMacros(@tags);
+        print"// end of macro\n\n";
+    }
+    if (scalar(@attrs)) {
+        print "#define DOM_${namespace}NAMES_FOR_EACH_ATTR(macro) \\\n";
+        printMacros(@attrs);
+        print "// end of macro\n\n";
+    }
+    
+    my $lowerNamespace = lc($namespacePrefix);
+    print "#ifndef DOM_${namespace}NAMES_HIDE_GLOBALS\n";
     print "// Namespace\n";
     print "extern const WebCore::AtomicString ${lowerNamespace}NamespaceURI;\n\n";
 
-       if (scalar(@tags)) {
-       print "// Tags\n";
-               print "#define DOM_NAMES_DEFINE_TAG_GLOBAL(name) extern const WebCore::QualifiedName name##Tag;\n";
-               print "DOM_${namespace}NAMES_FOR_EACH_TAG(DOM_NAMES_DEFINE_TAG_GLOBAL)\n";
-               print "#undef DOM_NAMES_DEFINE_TAG_GLOBAL\n\n";
+    if (scalar(@tags)) {
+        print "// Tags\n";
+        print "#define DOM_NAMES_DEFINE_TAG_GLOBAL(name) extern const WebCore::QualifiedName name##Tag;\n";
+        print "DOM_${namespace}NAMES_FOR_EACH_TAG(DOM_NAMES_DEFINE_TAG_GLOBAL)\n";
+        print "#undef DOM_NAMES_DEFINE_TAG_GLOBAL\n\n";
     }
-       
-       if (scalar(@attrs)) {
-               print "// Attributes\n";
-               print "#define DOM_NAMES_DEFINE_ATTR_GLOBAL(name) extern const WebCore::QualifiedName name##Attr;\n";
-               print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DOM_NAMES_DEFINE_ATTR_GLOBAL)\n";
-               print "#undef DOM_NAMES_DEFINE_ATTR_GLOBAL\n\n";
+    
+    if (scalar(@attrs)) {
+        print "// Attributes\n";
+        print "#define DOM_NAMES_DEFINE_ATTR_GLOBAL(name) extern const WebCore::QualifiedName name##Attr;\n";
+        print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DOM_NAMES_DEFINE_ATTR_GLOBAL)\n";
+        print "#undef DOM_NAMES_DEFINE_ATTR_GLOBAL\n\n";
     }
-       print "#endif\n\n";
-       print "void init();\n\n";
-       print "} }\n\n";
-       print "#endif\n\n";
-       
-       restoreSTDOUT();
+    print "#endif\n\n";
+    print "void init();\n\n";
+    print "} }\n\n";
+    print "#endif\n\n";
+    
+    restoreSTDOUT();
 }
 
 sub printNamesCppFile
 {
-       my $cppPath = shift;
-       redirectSTDOUT($cppPath);
-       
-       printLicenseHeader();
-       
-       my $lowerNamespace = lc($namespacePrefix);
+    my $cppPath = shift;
+    redirectSTDOUT($cppPath);
+    
+    printLicenseHeader();
+    
+    my $lowerNamespace = lc($namespacePrefix);
 
 print "#include \"config.h\"\n";
 
@@ -266,15 +268,15 @@ using namespace WebCore;
 DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI, \"$namespaceURI\")
 ";
 
-       if (scalar(@tags)) {
-               print "#define DEFINE_TAG_GLOBAL(name) DEFINE_GLOBAL(QualifiedName, name##Tag, nullAtom, #name, ${lowerNamespace}NamespaceURI)\n";
-               print "DOM_${namespace}NAMES_FOR_EACH_TAG(DEFINE_TAG_GLOBAL)\n\n";
-       }
+    if (scalar(@tags)) {
+        print "#define DEFINE_TAG_GLOBAL(name) DEFINE_GLOBAL(QualifiedName, name##Tag, nullAtom, #name, ${lowerNamespace}NamespaceURI)\n";
+        print "DOM_${namespace}NAMES_FOR_EACH_TAG(DEFINE_TAG_GLOBAL)\n\n";
+    }
 
-       if (scalar(@attrs)) {
-               print "#define DEFINE_ATTR_GLOBAL(name) DEFINE_GLOBAL(QualifiedName, name##Attr, nullAtom, #name, nullAtom)\n";
-               print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DEFINE_ATTR_GLOBAL)\n\n";
-       }
+    if (scalar(@attrs)) {
+        print "#define DEFINE_ATTR_GLOBAL(name) DEFINE_GLOBAL(QualifiedName, name##Attr, nullAtom, #name, nullAtom)\n";
+        print "DOM_${namespace}NAMES_FOR_EACH_ATTR(DEFINE_ATTR_GLOBAL)\n\n";
+    }
 
 print "void init()
 {
@@ -287,74 +289,74 @@ print "void init()
     
     AtomicString::init();
 ";
-       
+    
     print("    AtomicString ${lowerNamespace}NS(\"$namespaceURI\");\n\n");
 
     print("    // Namespace\n");
     print("    new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowerNamespace}NS);\n\n");
     if (scalar(@tags)) {
-       my $tagsNamespace = $tagsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
-               printDefinitions(\@tags, "tags", $tagsNamespace);
-       }
-       if (scalar(@attrs)) {
-       my $attrsNamespace = $attrsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
-               printDefinitions(\@attrs, "attributes", $attrsNamespace);
-       }
-
-       print "}\n\n} }\n\n";
-       restoreSTDOUT();
+        my $tagsNamespace = $tagsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
+        printDefinitions(\@tags, "tags", $tagsNamespace);
+    }
+    if (scalar(@attrs)) {
+        my $attrsNamespace = $attrsNullNamespace ? "nullAtom" : "${lowerNamespace}NS";
+        printDefinitions(\@attrs, "attributes", $attrsNamespace);
+    }
+
+    print "}\n\n} }\n\n";
+    restoreSTDOUT();
 }
 
 sub printElementIncludes
 {
-       my @names = @_;
-       for my $name (@names) {
-               my $upperCase = upperCaseName($name);
-               print "#include \"${namespace}${upperCase}Element.h\"\n";
-       }
+    my @names = @_;
+    for my $name (@names) {
+        my $upperCase = upperCaseName($name);
+        print "#include \"${namespace}${upperCase}Element.h\"\n";
+    }
 }
 
 sub printDefinitions
 {
-       my ($namesRef, $type, $namespaceURI) = @_;
-       my $singularType = substr($type, 0, -1);
-       my $shortType = substr($singularType, 0, 4);
-       my $shortCamelType = ucfirst($shortType);
-       my $shortUpperType = uc($shortType);
-       
-       print "    // " . ucfirst($type) . "\n";
-       print "    #define DEFINE_${shortUpperType}_STRING(name) const char *name##${shortCamelType}String = #name;\n";
-       print "    DOM_${namespace}NAMES_FOR_EACH_${shortUpperType}(DEFINE_${shortUpperType}_STRING)\n\n";
-       for my $name (@$namesRef) {
-               if ($name =~ /_/) {
-                       my $realName = $name;
-                       $realName =~ s/_/-/g;
-                       print "    ${name}${shortCamelType}String = \"$realName\";\n";
-               }
-       }
-       print "\n    #define INITIALIZE_${shortUpperType}_GLOBAL(name) new ((void*)&name##${shortCamelType}) QualifiedName(nullAtom, name##${shortCamelType}String, $namespaceURI);\n";
-       print "    DOM_${namespace}NAMES_FOR_EACH_${shortUpperType}(INITIALIZE_${shortUpperType}_GLOBAL)\n\n";
+    my ($namesRef, $type, $namespaceURI) = @_;
+    my $singularType = substr($type, 0, -1);
+    my $shortType = substr($singularType, 0, 4);
+    my $shortCamelType = ucfirst($shortType);
+    my $shortUpperType = uc($shortType);
+    
+    print "    // " . ucfirst($type) . "\n";
+    print "    #define DEFINE_${shortUpperType}_STRING(name) const char *name##${shortCamelType}String = #name;\n";
+    print "    DOM_${namespace}NAMES_FOR_EACH_${shortUpperType}(DEFINE_${shortUpperType}_STRING)\n\n";
+    for my $name (@$namesRef) {
+        if ($name =~ /_/) {
+            my $realName = $name;
+            $realName =~ s/_/-/g;
+            print "    ${name}${shortCamelType}String = \"$realName\";\n";
+        }
+    }
+    print "\n    #define INITIALIZE_${shortUpperType}_GLOBAL(name) new ((void*)&name##${shortCamelType}) QualifiedName(nullAtom, name##${shortCamelType}String, $namespaceURI);\n";
+    print "    DOM_${namespace}NAMES_FOR_EACH_${shortUpperType}(INITIALIZE_${shortUpperType}_GLOBAL)\n\n";
 }
 
 my $savedSTDOUT;
 
 sub redirectSTDOUT
 {
-       my $filepath = shift;
-       print "Writing $filepath...\n";
-       open $savedSTDOUT, ">&STDOUT" or die "Can't save STDOUT";
-       open(STDOUT, ">", $filepath) or die "Failed to open file: $filepath";
+    my $filepath = shift;
+    print "Writing $filepath...\n";
+    open $savedSTDOUT, ">&STDOUT" or die "Can't save STDOUT";
+    open(STDOUT, ">", $filepath) or die "Failed to open file: $filepath";
 }
 
 sub restoreSTDOUT
 {
-       open STDOUT, ">&", $savedSTDOUT or die "Can't restor STDOUT: \$oldout: $!";
+    open STDOUT, ">&", $savedSTDOUT or die "Can't restor STDOUT: \$oldout: $!";
 }
 
 sub printFactoryCppFile
 {
-       my $cppPath = shift;
-       redirectSTDOUT($cppPath);
+    my $cppPath = shift;
+    redirectSTDOUT($cppPath);
 
 printLicenseHeader();
 
@@ -386,6 +388,7 @@ END
 printConstructors(@tags);
 
 print <<END
+#ifdef SVG_SUPPORT
 static inline void createFunctionMapIfNecessary()
 {
     if (gFunctionMap)
@@ -401,9 +404,11 @@ printFunctionInits(@tags);
 
 print <<END
 }
+#endif
 
 ${namespace}Element *${namespace}ElementFactory::create${namespace}Element(const QualifiedName& qName, Document* doc, bool createdByParser)
 {
+#ifdef SVG_SUPPORT
     if (!doc)
         return 0; // Do not allow elements to ever be made without having a doc.
 
@@ -413,6 +418,9 @@ ${namespace}Element *${namespace}ElementFactory::create${namespace}Element(const
         return func(doc, createdByParser);
     
     return new ${namespace}Element(qName, doc);
+#else
+    return 0;
+#endif
 }
 
 } // namespace
@@ -420,15 +428,15 @@ ${namespace}Element *${namespace}ElementFactory::create${namespace}Element(const
 END
 ;
 
-       restoreSTDOUT();
+    restoreSTDOUT();
 }
 
 sub printFactoryHeaderFile
 {
-       my $headerPath = shift;
-       redirectSTDOUT($headerPath);
+    my $headerPath = shift;
+    redirectSTDOUT($headerPath);
 
-       printLicenseHeader();
+    printLicenseHeader();
 
 print "#ifndef ${namespace}ELEMENTFACTORY_H\n";
 print "#define ${namespace}ELEMENTFACTORY_H\n\n";
@@ -459,5 +467,5 @@ namespace ${cppNamespace}
 
 ";
 
-       restoreSTDOUT();
+    restoreSTDOUT();
 }
index 26d19db0f18f023a49d11858fe680891a328aeb7..47e8e4452eedf14711f006d988ad4c51d554cb21 100644 (file)
@@ -30,6 +30,7 @@
 #include "SVGColor.h"
 #include "SVGSVGElement.h"
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
index ca9bd60c1caf7b35c57f82ad99a74d2c524a4a09..eaec7a145c792b477d93ae5d51bc62fe8ff3df99 100644 (file)
@@ -32,6 +32,7 @@
 #include "SVGTransform.h"
 #include "SVGTransformList.h"
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
index 11e7c4acc558f3fd305c191930f97d8ee75ad5ab..3d0a9a2f4ffa7b9e493c318b42c43d053ee0028a 100644 (file)
@@ -37,6 +37,7 @@
 #include <float.h>
 #include <math.h>
 #include <wtf/Vector.h>
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
index af0c730c4d58f01bc279c4b099ebe5befe3bd6ec..badf821d59c58723df67b7399d92e81931fe7eaf 100644 (file)
@@ -35,6 +35,7 @@
 #include "cssstyleselector.h"
 #include <wtf/OwnPtr.h>
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
index 904d747e3a7946af67e75ea2db355e638c3595ee..dca82a4d6abddd0202a5a88f259f90cfdcfd3c1b 100644 (file)
@@ -40,6 +40,7 @@
 #include "SVGUnitTypes.h"
 #include <math.h>
 #include <wtf/OwnPtr.h>
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
index 3fc69b6aa07d2bd621db296efc54215ffd87176b..f4067e76eb8d4ce18e52a7b3ec319e61d925a9b1 100644 (file)
@@ -23,6 +23,7 @@
 #include "svgpathparser.h"
 #include "DeprecatedString.h"
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
index a1f373f68f2fad642979cfb3d4179b8db26912c9..45171d0f898e256de72d3e9b355f804452cb6da5 100644 (file)
@@ -31,6 +31,7 @@
 #include "FloatPoint.h"
 #include "FloatRect.h"
 #include <math.h>
+#include <wtf/MathExtras.h>
 
 const double QUARTER = 0.552; // approximation of control point positions on a bezier
                       // to simulate a quarter of a circle.
index e957068b7b6120c47e04719e83a0da0d3225bb82..59dd6c023943aee82d2a69a438543e7b9302d8a3 100644 (file)
@@ -29,7 +29,7 @@
 #include "IntSize.h"
 #include "SVGResource.h"
 
-#if PLATFORM(MAC)
+#if PLATFORM(CG)
 typedef struct CGContext *CGContextRef;
 typedef struct CGLayer *CGLayerRef;
 #endif
@@ -43,7 +43,7 @@ namespace WebCore {
     public:
         SVGResourceImage();
 
-#if PLATFORM(MAC)
+#if PLATFORM(CG)
     virtual ~SVGResourceImage();
 #endif
 
@@ -53,7 +53,7 @@ namespace WebCore {
 
         IntSize size() const;
 
-#if PLATFORM(MAC)
+#if PLATFORM(CG)
         CGLayerRef cgLayer();
         void setCGLayer(CGLayerRef layer);
     
index b6cb9dee58212a083f3d17d4785888cdd19e40e6..3684ef763389b6216d2cce0e26f25cca9e18bfc1 100644 (file)
@@ -36,6 +36,7 @@
 #include "KRenderingDevice.h"
 #include "SVGStyledElement.h"
 #include <wtf/OwnPtr.h>
+#include <wtf/MathExtras.h>
 
 namespace WebCore {
 
index 5a9900babae4ff435fef5afd283ed46128d948dd..0ddc1812ffc358ab73bf600aa4a1082cb6b3fc88 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "config.h"
 #ifdef SVG_SUPPORT
-#include "KCanvasTreeDebug.h"
-
 #include "SVGResourceClipper.h"
 #include "GraphicsTypes.h"
 #include "HTMLNames.h"