Commit 7d8d9656 authored by hyatt's avatar hyatt

Refactor Cairo and CoreGraphics to use platform ifdefs. This patch

        separates the graphics engines from their respective platforms and replaces
        #ifdef PLATFORM(MAC) and PLATFORM(WIN) with PLATFORM(CG) and PLATFORM(CAIRO).

        Reviewed by darin

        * WebCore.xcodeproj/project.pbxproj:
        * platform/AffineTransform.h:
        * platform/Color.h:
        * platform/Cursor.h:
        * platform/FloatPoint.h:
        * platform/FloatRect.h:
        * platform/FloatSize.h:
        * platform/Font.h:
        * platform/FontData.h:
        * platform/GlyphBuffer.h:
        (WebCore::GlyphBuffer::glyphAt):
        (WebCore::GlyphBuffer::advanceAt):
        (WebCore::GlyphBuffer::add):
        * platform/GraphicsContext.h:
        * platform/Image.h:
        * platform/ImageSource.h:
        * platform/IntPoint.h:
        * platform/IntRect.h:
        * platform/IntSize.h:
        * platform/ResourceLoader.h:
        * platform/ResourceLoaderClient.h:
        * platform/Widget.h:
        * platform/cairo/GraphicsContextCairo.cpp:
        * platform/cairo/ImageCairo.cpp:
        * platform/cairo/ImageSourceCairo.cpp:
        * platform/cg/AffineTransformCG.cpp:
        * platform/cg/FloatPointCG.cpp: Added.
        * platform/cg/FloatRectCG.cpp: Added.
        * platform/cg/FloatSizeCG.cpp: Added.
        * platform/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::GraphicsContext):
        (WebCore::GraphicsContext::~GraphicsContext):
        (WebCore::GraphicsContext::setFocusRingClip):
        (WebCore::GraphicsContext::clearFocusRingClip):
        (WebCore::GraphicsContext::platformContext):
        (WebCore::GraphicsContext::drawRect):
        (WebCore::GraphicsContext::drawLine):
        * platform/cg/GraphicsContextPlatformPrivate.h: Added.
        (WebCore::GraphicsContextPlatformPrivate:::m_cgContext):
        (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
        * platform/cg/ImageCG.cpp: Added.
        (WebCore::Image::drawTiled):
        * platform/cg/ImageSourceCG.cpp: Added.
        * platform/cg/IntPointCG.cpp: Added.
        * platform/cg/IntRectCG.cpp: Added.
        * platform/cg/IntSizeCG.cpp: Added.
        * platform/cg/PDFDocumentImage.cpp: Added.
        (WebCore::PDFDocumentImage::adjustCTM):
        * platform/cg/PDFDocumentImage.h: Added.
        * platform/cg/PathCG.cpp:
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        * platform/image-decoders/gif/GIFImageReader.cpp:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        * platform/image-decoders/xbm/XBMImageDecoder.cpp:
        * platform/mac/FloatPointMac.mm:
        * platform/mac/FloatRectMac.mm:
        * platform/mac/FloatSizeMac.mm:
        * platform/mac/GraphicsContextMac.mm:
        * platform/mac/ImageMac.mm:
        * platform/mac/ImageSourceMac.cpp: Removed.
        * platform/mac/IntPointMac.mm:
        * platform/mac/IntRectMac.mm:
        * platform/mac/IntSizeMac.mm:
        * platform/mac/PDFDocumentImage.h: Removed.
        * platform/mac/PDFDocumentImage.mm: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fa10db1b
2006-08-23 David Hyatt <hyatt@apple.com>
Refactor Cairo and CoreGraphics to use platform ifdefs. This patch
separates the graphics engines from their respective platforms and replaces
#ifdef PLATFORM(MAC) and PLATFORM(WIN) with PLATFORM(CG) and PLATFORM(CAIRO).
Reviewed by darin
* WebCore.xcodeproj/project.pbxproj:
* platform/AffineTransform.h:
* platform/Color.h:
* platform/Cursor.h:
* platform/FloatPoint.h:
* platform/FloatRect.h:
* platform/FloatSize.h:
* platform/Font.h:
* platform/FontData.h:
* platform/GlyphBuffer.h:
(WebCore::GlyphBuffer::glyphAt):
(WebCore::GlyphBuffer::advanceAt):
(WebCore::GlyphBuffer::add):
* platform/GraphicsContext.h:
* platform/Image.h:
* platform/ImageSource.h:
* platform/IntPoint.h:
* platform/IntRect.h:
* platform/IntSize.h:
* platform/ResourceLoader.h:
* platform/ResourceLoaderClient.h:
* platform/Widget.h:
* platform/cairo/GraphicsContextCairo.cpp:
* platform/cairo/ImageCairo.cpp:
* platform/cairo/ImageSourceCairo.cpp:
* platform/cg/AffineTransformCG.cpp:
* platform/cg/FloatPointCG.cpp: Added.
* platform/cg/FloatRectCG.cpp: Added.
* platform/cg/FloatSizeCG.cpp: Added.
* platform/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::~GraphicsContext):
(WebCore::GraphicsContext::setFocusRingClip):
(WebCore::GraphicsContext::clearFocusRingClip):
(WebCore::GraphicsContext::platformContext):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
* platform/cg/GraphicsContextPlatformPrivate.h: Added.
(WebCore::GraphicsContextPlatformPrivate:::m_cgContext):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
* platform/cg/ImageCG.cpp: Added.
(WebCore::Image::drawTiled):
* platform/cg/ImageSourceCG.cpp: Added.
* platform/cg/IntPointCG.cpp: Added.
* platform/cg/IntRectCG.cpp: Added.
* platform/cg/IntSizeCG.cpp: Added.
* platform/cg/PDFDocumentImage.cpp: Added.
(WebCore::PDFDocumentImage::adjustCTM):
* platform/cg/PDFDocumentImage.h: Added.
* platform/cg/PathCG.cpp:
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
* platform/image-decoders/gif/GIFImageReader.cpp:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
* platform/image-decoders/png/PNGImageDecoder.cpp:
* platform/image-decoders/xbm/XBMImageDecoder.cpp:
* platform/mac/FloatPointMac.mm:
* platform/mac/FloatRectMac.mm:
* platform/mac/FloatSizeMac.mm:
* platform/mac/GraphicsContextMac.mm:
* platform/mac/ImageMac.mm:
* platform/mac/ImageSourceMac.cpp: Removed.
* platform/mac/IntPointMac.mm:
* platform/mac/IntRectMac.mm:
* platform/mac/IntSizeMac.mm:
* platform/mac/PDFDocumentImage.h: Removed.
* platform/mac/PDFDocumentImage.mm: Removed.
2006-08-23 David Hyatt <hyatt@apple.com>
Remove the ifdef for platform scrollbars vs. engine scrollbars until
......
......@@ -264,12 +264,9 @@
6582A15909999D6D00BEEB6D /* FloatRectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14B09999D6C00BEEB6D /* FloatRectMac.mm */; };
6582A15A09999D6D00BEEB6D /* FloatSizeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14C09999D6C00BEEB6D /* FloatSizeMac.mm */; };
6582A15B09999D6D00BEEB6D /* ImageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14D09999D6C00BEEB6D /* ImageMac.mm */; };
6582A15C09999D6D00BEEB6D /* ImageSourceMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14E09999D6D00BEEB6D /* ImageSourceMac.cpp */; };
6582A15D09999D6D00BEEB6D /* IntPointMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A14F09999D6D00BEEB6D /* IntPointMac.mm */; };
6582A15E09999D6D00BEEB6D /* IntRectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15009999D6D00BEEB6D /* IntRectMac.mm */; };
6582A15F09999D6D00BEEB6D /* IntSizeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15109999D6D00BEEB6D /* IntSizeMac.mm */; };
6582A16009999D6D00BEEB6D /* PDFDocumentImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6582A15209999D6D00BEEB6D /* PDFDocumentImage.h */; };
6582A16109999D6D00BEEB6D /* PDFDocumentImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15309999D6D00BEEB6D /* PDFDocumentImage.mm */; };
6582A16209999D6D00BEEB6D /* ScreenMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15409999D6D00BEEB6D /* ScreenMac.mm */; };
6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */; };
6582A17809999EA000BEEB6D /* DeprecatedStringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */; };
......@@ -1452,6 +1449,18 @@
BC73E3190978AFFC00EDFF8A /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3180978AFFB00EDFF8A /* IntPoint.h */; };
BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3900978CED700EDFF8A /* FloatPoint.cpp */; };
BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; };
BC837C720A9D0D1A006B186A /* FloatPointCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C670A9D0D1A006B186A /* FloatPointCG.cpp */; };
BC837C730A9D0D1A006B186A /* FloatRectCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C680A9D0D1A006B186A /* FloatRectCG.cpp */; };
BC837C740A9D0D1A006B186A /* FloatSizeCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C690A9D0D1A006B186A /* FloatSizeCG.cpp */; };
BC837C750A9D0D1A006B186A /* ImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C6A0A9D0D1A006B186A /* ImageCG.cpp */; };
BC837C760A9D0D1A006B186A /* ImageCG.cpp.orig in Resources */ = {isa = PBXBuildFile; fileRef = BC837C6B0A9D0D1A006B186A /* ImageCG.cpp.orig */; };
BC837C770A9D0D1A006B186A /* ImageSourceCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C6C0A9D0D1A006B186A /* ImageSourceCG.cpp */; };
BC837C780A9D0D1A006B186A /* IntPointCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C6D0A9D0D1A006B186A /* IntPointCG.cpp */; };
BC837C790A9D0D1A006B186A /* IntRectCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C6E0A9D0D1A006B186A /* IntRectCG.cpp */; };
BC837C7A0A9D0D1A006B186A /* IntSizeCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C6F0A9D0D1A006B186A /* IntSizeCG.cpp */; };
BC837C7B0A9D0D1A006B186A /* PDFDocumentImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC837C700A9D0D1A006B186A /* PDFDocumentImage.cpp */; };
BC837C7C0A9D0D1A006B186A /* PDFDocumentImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC837C710A9D0D1A006B186A /* PDFDocumentImage.h */; };
BC837CB60A9D10FE006B186A /* GraphicsContextPlatformPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC837CB50A9D10FE006B186A /* GraphicsContextPlatformPrivate.h */; };
BC92F1DD0A40AEA300AC0746 /* DeprecatedSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC92F1DB0A40AEA300AC0746 /* DeprecatedSlider.cpp */; };
BC92F1DE0A40AEA300AC0746 /* DeprecatedSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = BC92F1DC0A40AEA300AC0746 /* DeprecatedSlider.h */; };
BC9C328B09933A6E001D6924 /* ImageAnimationObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9C328A09933A6D001D6924 /* ImageAnimationObserver.h */; };
......@@ -1603,6 +1612,23 @@
FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
/* End PBXBuildFile section */
/* Begin PBXBuildStyle section */
BC837C570A9D0AA0006B186A /* Development */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = NO;
};
name = Development;
};
BC837C580A9D0AA0006B186A /* Deployment */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = YES;
};
name = Deployment;
};
/* End PBXBuildStyle section */
/* Begin PBXContainerItemProxy section */
DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
......@@ -1943,12 +1969,9 @@
6582A14B09999D6C00BEEB6D /* FloatRectMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FloatRectMac.mm; sourceTree = "<group>"; };
6582A14C09999D6C00BEEB6D /* FloatSizeMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FloatSizeMac.mm; sourceTree = "<group>"; };
6582A14D09999D6C00BEEB6D /* ImageMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageMac.mm; sourceTree = "<group>"; };
6582A14E09999D6D00BEEB6D /* ImageSourceMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageSourceMac.cpp; sourceTree = "<group>"; };
6582A14F09999D6D00BEEB6D /* IntPointMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntPointMac.mm; sourceTree = "<group>"; };
6582A15009999D6D00BEEB6D /* IntRectMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntRectMac.mm; sourceTree = "<group>"; };
6582A15109999D6D00BEEB6D /* IntSizeMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = IntSizeMac.mm; sourceTree = "<group>"; };
6582A15209999D6D00BEEB6D /* PDFDocumentImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PDFDocumentImage.h; sourceTree = "<group>"; };
6582A15309999D6D00BEEB6D /* PDFDocumentImage.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PDFDocumentImage.mm; sourceTree = "<group>"; };
6582A15409999D6D00BEEB6D /* ScreenMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ScreenMac.mm; sourceTree = "<group>"; };
6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SystemTimeMac.cpp; sourceTree = "<group>"; };
6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedStringMac.mm; sourceTree = "<group>"; };
......@@ -3221,6 +3244,18 @@
BC73E3910978CED700EDFF8A /* FloatPoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FloatPoint.h; sourceTree = "<group>"; };
BC7B2AF80450824100A8000F /* ScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBar.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC7B2AF90450824100A8000F /* PlatformScrollBarMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformScrollBarMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC837C670A9D0D1A006B186A /* FloatPointCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatPointCG.cpp; sourceTree = "<group>"; };
BC837C680A9D0D1A006B186A /* FloatRectCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRectCG.cpp; sourceTree = "<group>"; };
BC837C690A9D0D1A006B186A /* FloatSizeCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FloatSizeCG.cpp; sourceTree = "<group>"; };
BC837C6A0A9D0D1A006B186A /* ImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageCG.cpp; sourceTree = "<group>"; };
BC837C6B0A9D0D1A006B186A /* ImageCG.cpp.orig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ImageCG.cpp.orig; sourceTree = "<group>"; };
BC837C6C0A9D0D1A006B186A /* ImageSourceCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageSourceCG.cpp; sourceTree = "<group>"; };
BC837C6D0A9D0D1A006B186A /* IntPointCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntPointCG.cpp; sourceTree = "<group>"; };
BC837C6E0A9D0D1A006B186A /* IntRectCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntRectCG.cpp; sourceTree = "<group>"; };
BC837C6F0A9D0D1A006B186A /* IntSizeCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntSizeCG.cpp; sourceTree = "<group>"; };
BC837C700A9D0D1A006B186A /* PDFDocumentImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PDFDocumentImage.cpp; sourceTree = "<group>"; };
BC837C710A9D0D1A006B186A /* PDFDocumentImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PDFDocumentImage.h; sourceTree = "<group>"; };
BC837CB50A9D10FE006B186A /* GraphicsContextPlatformPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GraphicsContextPlatformPrivate.h; sourceTree = "<group>"; };
BC86FB8D061F5C23006BB822 /* Slider.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Slider.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC86FB8E061F5C23006BB822 /* SliderMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SliderMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC92F1DB0A40AEA300AC0746 /* DeprecatedSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedSlider.cpp; sourceTree = "<group>"; };
......@@ -3843,7 +3878,6 @@
BC6DB4D30A1AFEEF00E5CD14 /* GlyphMapMac.cpp */,
935367E809AF77EF00D35CD6 /* GraphicsContextMac.mm */,
6582A14D09999D6C00BEEB6D /* ImageMac.mm */,
6582A14E09999D6D00BEEB6D /* ImageSourceMac.cpp */,
6582A14F09999D6D00BEEB6D /* IntPointMac.mm */,
6582A15009999D6D00BEEB6D /* IntRectMac.mm */,
6582A15109999D6D00BEEB6D /* IntSizeMac.mm */,
......@@ -3853,8 +3887,6 @@
F587851402DE375901EA4122 /* ListBoxMac.mm */,
935207BF09BD412000F2038D /* LocalizedStringsMac.mm */,
65F5382409B2B57500F3DC4A /* mac-encodings.txt */,
6582A15209999D6D00BEEB6D /* PDFDocumentImage.h */,
6582A15309999D6D00BEEB6D /* PDFDocumentImage.mm */,
935C476F09AC4D7300A6AAB4 /* PlatformMouseEventMac.mm */,
A82398A709B3ACF500B60641 /* PlugInInfoStoreMac.mm */,
F58784D202DE375901EA4122 /* PopUpButtonMac.mm */,
......@@ -3985,8 +4017,20 @@
isa = PBXGroup;
children = (
93CF35A90A6169F700543E52 /* AffineTransformCG.cpp */,
BC837C670A9D0D1A006B186A /* FloatPointCG.cpp */,
BC837C680A9D0D1A006B186A /* FloatRectCG.cpp */,
BC837C690A9D0D1A006B186A /* FloatSizeCG.cpp */,
936BDD1C0A031AEB004DF4AB /* GraphicsContextCG.cpp */,
BC837C6A0A9D0D1A006B186A /* ImageCG.cpp */,
BC837C6B0A9D0D1A006B186A /* ImageCG.cpp.orig */,
BC837C6C0A9D0D1A006B186A /* ImageSourceCG.cpp */,
BC837C6D0A9D0D1A006B186A /* IntPointCG.cpp */,
BC837C6E0A9D0D1A006B186A /* IntRectCG.cpp */,
BC837C6F0A9D0D1A006B186A /* IntSizeCG.cpp */,
93032CC709AEC34300F82A18 /* PathCG.cpp */,
BC837CB50A9D10FE006B186A /* GraphicsContextPlatformPrivate.h */,
BC837C700A9D0D1A006B186A /* PDFDocumentImage.cpp */,
BC837C710A9D0D1A006B186A /* PDFDocumentImage.h */,
);
path = cg;
sourceTree = "<group>";
......@@ -5970,7 +6014,6 @@
93CD4FEC0995FD2A007ECC97 /* PlatformString.h in Headers */,
BC6B7ECF0998AC7F0052867B /* ImageSource.h in Headers */,
6582A14009999CD600BEEB6D /* DeprecatedString.h in Headers */,
6582A16009999D6D00BEEB6D /* PDFDocumentImage.h in Headers */,
A7638A8B09958EA50007E14F /* WKDisplacementMapFilter.h in Headers */,
A7638A970995965D0007E14F /* SVGFEDisplacementMapElement.h in Headers */,
93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */,
......@@ -6404,6 +6447,8 @@
657429170A9C2D0B00C52C97 /* IconDataCache.h in Headers */,
657429180A9C2D0B00C52C97 /* SQLStatement.h in Headers */,
657429190A9C2D0B00C52C97 /* SQLTransaction.h in Headers */,
BC837C7C0A9D0D1A006B186A /* PDFDocumentImage.h in Headers */,
BC837CB60A9D10FE006B186A /* GraphicsContextPlatformPrivate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -6437,6 +6482,12 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
buildSettings = {
};
buildStyles = (
BC837C570A9D0AA0006B186A /* Development */,
BC837C580A9D0AA0006B186A /* Deployment */,
);
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -6496,6 +6547,7 @@
1CD441900A4CE76F00A007AB /* northWestSouthEastResizeCursor.tiff in Resources */,
1A750D880A90E394000FF215 /* NodeIterator.idl in Resources */,
5115095C0A9CE04700901013 /* urlIcon.tiff in Resources */,
BC837C760A9D0D1A006B186A /* ImageCG.cpp.orig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -6865,11 +6917,9 @@
6582A15909999D6D00BEEB6D /* FloatRectMac.mm in Sources */,
6582A15A09999D6D00BEEB6D /* FloatSizeMac.mm in Sources */,
6582A15B09999D6D00BEEB6D /* ImageMac.mm in Sources */,
6582A15C09999D6D00BEEB6D /* ImageSourceMac.cpp in Sources */,
6582A15D09999D6D00BEEB6D /* IntPointMac.mm in Sources */,
6582A15E09999D6D00BEEB6D /* IntRectMac.mm in Sources */,
6582A15F09999D6D00BEEB6D /* IntSizeMac.mm in Sources */,
6582A16109999D6D00BEEB6D /* PDFDocumentImage.mm in Sources */,
6582A16209999D6D00BEEB6D /* ScreenMac.mm in Sources */,
6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */,
6582A17809999EA000BEEB6D /* DeprecatedStringMac.mm in Sources */,
......@@ -7276,6 +7326,15 @@
1A750DD40A90E729000FF215 /* JSNodeIteratorCustom.cpp in Sources */,
1A750E340A90F89F000FF215 /* JSTreeWalkerCustom.cpp in Sources */,
5186C0560A9C21470034FE94 /* IconDataCache.cpp in Sources */,
BC837C720A9D0D1A006B186A /* FloatPointCG.cpp in Sources */,
BC837C730A9D0D1A006B186A /* FloatRectCG.cpp in Sources */,
BC837C740A9D0D1A006B186A /* FloatSizeCG.cpp in Sources */,
BC837C750A9D0D1A006B186A /* ImageCG.cpp in Sources */,
BC837C770A9D0D1A006B186A /* ImageSourceCG.cpp in Sources */,
BC837C780A9D0D1A006B186A /* IntPointCG.cpp in Sources */,
BC837C790A9D0D1A006B186A /* IntRectCG.cpp in Sources */,
BC837C7A0A9D0D1A006B186A /* IntSizeCG.cpp in Sources */,
BC837C7B0A9D0D1A006B186A /* PDFDocumentImage.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -26,7 +26,9 @@
#ifndef AffineTransform_h
#define AffineTransform_h
#if __APPLE__
#include "config.h"
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
#elif PLATFORM(QT)
#include <QMatrix>
......@@ -41,7 +43,7 @@ class AffineTransform {
public:
AffineTransform();
AffineTransform(double a, double b, double c, double d, double tx, double ty);
#if __APPLE__
#if PLATFORM(CG)
AffineTransform(CGAffineTransform transform);
#elif PLATFORM(QT)
AffineTransform(const QMatrix &matrix);
......@@ -72,7 +74,7 @@ public:
bool isInvertible() const;
AffineTransform invert() const;
#if __APPLE__
#if PLATFORM(CG)
operator CGAffineTransform() const;
#elif PLATFORM(QT)
operator QMatrix() const;
......@@ -83,7 +85,7 @@ public:
AffineTransform operator*(const AffineTransform&);
private:
#if __APPLE__
#if PLATFORM(CG)
CGAffineTransform m_transform;
#elif PLATFORM(QT)
QMatrix m_transform;
......
......@@ -28,17 +28,17 @@
#include <wtf/Platform.h>
#if __APPLE__
#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSColor;
#else
class NSColor;
#endif
#endif
#if PLATFORM(CG)
typedef struct CGColor* CGColorRef;
#endif // __APPLE__
#endif
#if PLATFORM(QT)
class QColor;
......@@ -119,8 +119,11 @@ inline bool operator!=(const Color& a, const Color& b)
Color focusRingColor();
void setFocusRingColorChangeFunction(void (*)());
#if __APPLE__
#if PLATFORM(MAC)
NSColor* nsColor(const Color&);
#endif
#if PLATFORM(CG)
CGColorRef cgColor(const Color&);
#endif
......
......@@ -36,7 +36,7 @@
#include <QCursor>
#endif
#ifdef __APPLE__
#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSCursor;
#else
......@@ -50,7 +50,7 @@ namespace WebCore {
#if PLATFORM(WIN)
typedef HCURSOR PlatformCursor;
#elif defined(__APPLE__)
#elif PLATFORM(MAC)
typedef NSCursor* PlatformCursor;
#elif PLATFORM(GDK)
typedef GdkCursor* PlatformCursor;
......
......@@ -30,16 +30,16 @@
#include "FloatSize.h"
#include <wtf/Platform.h>
#if __APPLE__
#if PLATFORM(CG)
typedef struct CGPoint CGPoint;
#endif
#if PLATFORM(MAC)
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
typedef struct CGPoint NSPoint;
#else
typedef struct _NSPoint NSPoint;
#endif
#endif
#if PLATFORM(QT)
......@@ -63,18 +63,16 @@ public:
void setY(float y) { m_y = y; }
void move(float dx, float dy) { m_x += dx; m_y += dy; }
#if __APPLE__
#if PLATFORM(CG)
FloatPoint(const CGPoint&);
operator CGPoint() const;
#endif
#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
#if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
FloatPoint(const NSPoint&);
operator NSPoint() const;
#endif
#endif
#if PLATFORM(QT)
FloatPoint(const QPointF&);
operator QPointF() const;
......
......@@ -29,17 +29,17 @@
#include "FloatPoint.h"
#if __APPLE__
#if PLATFORM(CG)
typedef struct CGRect CGRect;
#endif
#if PLATFORM(MAC)
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
typedef struct CGRect NSRect;
#else
typedef struct _NSRect NSRect;
#endif
#endif // __APPLE__
#endif
#if PLATFORM(QT)
class QRectF;
......@@ -99,17 +99,17 @@ public:
void inflate(float d) { inflateX(d); inflateY(d); }
void scale(float s);
#if __APPLE__
#if PLATFORM(CG)
FloatRect(const CGRect&);
operator CGRect() const;
#endif
#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
#if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
FloatRect(const NSRect&);
operator NSRect() const;
#endif
#elif PLATFORM(QT)
#if PLATFORM(QT)
FloatRect(const QRectF&);
operator QRectF() const;
#endif
......
......@@ -27,16 +27,16 @@
#ifndef FloatSize_h
#define FloatSize_h
#if __APPLE__
#if PLATFORM(CG)
typedef struct CGSize CGSize;
#endif
#if PLATFORM(MAC)
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
typedef struct CGSize NSSize;
#else
typedef struct _NSSize NSSize;
#endif
#endif
namespace WebCore {
......@@ -63,18 +63,16 @@ public:
m_height > other.m_height ? m_height : other.m_height);
}
#if __APPLE__
#if PLATFORM(CG)
explicit FloatSize(const CGSize&); // don't do this implicitly since it's lossy
operator CGSize() const;
#endif
#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
#if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
explicit FloatSize(const NSSize &); // don't do this implicitly since it's lossy
operator NSSize() const;
#endif
#endif
private:
float m_width, m_height;
};
......
......@@ -116,7 +116,7 @@ class Font {
public:
Font();
Font(const FontDescription&, short letterSpacing, short wordSpacing);
#if __APPLE__
#if PLATFORM(MAC)
Font(const FontPlatformData& fontPlatformData); // This constructor is only used by Mac-specific code that already has a native font.
#endif
~Font();
......@@ -168,7 +168,7 @@ public:
unsigned weight() const { return m_fontDescription.weight(); }
bool bold() const { return m_fontDescription.bold(); }
#if __APPLE__
#if PLATFORM(MAC)
NSFont* getNSFont() const { return primaryFont()->getNSFont(); }
#endif
......
......@@ -68,7 +68,7 @@ public:
GlyphData glyphDataForCharacter(UChar32 c) const { return m_characterToGlyphMap.glyphDataForCharacter(c, this); }
void setGlyphDataForCharacter(UChar32 c, Glyph glyph, const FontData* fontData) const { m_characterToGlyphMap.setGlyphDataForCharacter(c, glyph, fontData); }
#if __APPLE__
#if PLATFORM(MAC)
NSFont* getNSFont() const { return m_font.font; }
#endif
......@@ -103,7 +103,7 @@ public:
mutable FontData* m_smallCapsFontData;
#if __APPLE__
#if PLATFORM(MAC)
void* m_styleGroup;
float m_syntheticBoldOffset;
mutable ATSUStyle m_ATSUStyle;
......
......@@ -34,9 +34,9 @@
#define MAX_GLYPH_EXPANSION 4
#define GLYPH_BUFFER_SIZE 2048
#if __APPLE__
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
#elif PLATFORM(WIN) || PLATFORM(GDK)
#elif PLATFORM(CAIRO)
#include <cairo.h>
#include "FloatSize.h"
#elif PLATFORM(QT)
......@@ -50,10 +50,10 @@ namespace WebCore
typedef unsigned short Glyph;
class FontData;
#if __APPLE__
#if PLATFORM(CG)
typedef Glyph GlyphBufferGlyph;
typedef CGSize GlyphBufferAdvance;
#elif PLATFORM(WIN) || PLATFORM(GDK)
#elif PLATFORM(CAIRO)
typedef cairo_glyph_t GlyphBufferGlyph;
typedef FloatSize GlyphBufferAdvance;
#elif PLATFORM(QT)
......@@ -98,18 +98,18 @@ public:
Glyph glyphAt(int index) const
{
#if __APPLE__ || PLATFORM(QT)
#if PLATFORM(CG) || PLATFORM(QT)
return m_glyphs[index];
#elif PLATFORM(WIN) || PLATFORM(GDK)
#elif PLATFORM(CAIRO)
return m_glyphs[index].index;
#endif
}
float advanceAt(int index) const
{
#if __APPLE__
#if PLATFORM(CG)
return m_advances[index].width;
#elif PLATFORM(WIN) || PLATFORM(GDK) || PLATFORM(QT)
#elif PLATFORM(CAIRO) || PLATFORM(QT)
return m_advances[index].width();
#endif
}
......@@ -117,13 +117,13 @@ public:
void add(Glyph glyph, const FontData* font, float width)
{
m_fontData.append(font);
#if __APPLE__
#if PLATFORM(CG)
m_glyphs.append(glyph);
CGSize advance;
advance.width = width;
advance.height = 0;
m_advances.append(advance);
#elif PLATFORM(WIN) || PLATFORM(GDK)
#elif PLATFORM(CAIRO)
cairo_glyph_t cairoGlyph;
cairoGlyph.index = glyph;
cairoGlyph.y = 0;
......
......@@ -36,13 +36,9 @@
#include <wtf/Noncopyable.h>
#include <wtf/Platform.h>
// FIXME: how should Cairo figure into the platform macros?
#if __APPLE__
#if PLATFORM(CG)
typedef struct CGContext PlatformGraphicsContext;
#elif PLATFORM(WIN)
typedef struct HDC__* HDC;
typedef struct _cairo PlatformGraphicsContext;
#elif PLATFORM(GDK)
#elif PLATFORM(CAIRO)
typedef struct _cairo PlatformGraphicsContext;
#elif PLATFORM(QT)
class QPainter;
......@@ -51,6 +47,10 @@ typedef QPainter PlatformGraphicsContext;
typedef void PlatformGraphicsContext;
#endif
#if PLATFORM(WIN)
typedef struct HDC__* HDC;
#endif
namespace WebCore {
const int cMisspellingLineThickness = 3;
......
......@@ -33,7 +33,7 @@
#include "IntSize.h"
#include "FloatSize.h"
#if __APPLE__
#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSImage;
#else
......@@ -132,7 +132,7 @@ public:
enum TileRule { StretchTile, RoundTile, RepeatTile };
#if __APPLE__
#if PLATFORM(MAC)
// Accessors for native image formats.
CGImageRef getCGImageRef();
NSImage* getNSImage();
......@@ -189,7 +189,7 @@ private:
int m_repetitionCount; // How many total animation loops we should do.
int m_repetitionsComplete; // How many repetitions we've finished.
#if __APPLE__
#if PLATFORM(MAC)
mutable NSImage* m_nsImage; // A cached NSImage of frame 0. Only built lazily if someone actually queries for one.
mutable CFDataRef m_tiffRep; // Cached TIFF rep for frame 0. Only built lazily if someone queries for one.
PDFDocumentImage* m_PDFDoc;
......
......@@ -29,11 +29,11 @@
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
#if __APPLE__