WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2006 04:32:26 +0000 (04:32 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2006 04:32:26 +0000 (04:32 +0000)
        Reviewed by Adele.

        - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
          eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique

        * platform/mac/WebCoreGraphicsBridge.h: Removed.
        * platform/mac/WebCoreGraphicsBridge.m: Removed.
        * platform/mac/WebCoreSystemInterface.h: Added.
        * platform/mac/WebCoreSystemInterface.mm: Added.

        * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.

        * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
        Sorted files.

        * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.

        * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
        Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
        call wkSetDragImage.

        * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
        Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
        call wkDrawFocusRing.

        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
        Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
        WebGraphicsBridge to do the same thing.

WebKit:

        Reviewed by Adele.

        - WebKit part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
          eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique

        * WebCoreSupport/WebGraphicsBridge.h: Removed.
        * WebCoreSupport/WebGraphicsBridge.m: Removed.
        * WebCoreSupport/WebSystemInterface.h: Added.
        * WebCoreSupport/WebSystemInterface.m: Added.

        * WebKit.xcodeproj/project.pbxproj: Updated for removed and added files.

        * WebCoreSupport/WebImageData.m: Removed unneeded include of WebGraphicsBridge.h.
        * WebCoreSupport/WebImageRenderer.m: Ditto.
        * WebCoreSupport/WebTextRenderer.m: Ditto.

        * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): Guarded all the one-time
        initialization inside a boolean, just in case some things take a little time. Added
        a call to InitWebCoreSystemInterface to the one-time initialization here. Later, we
        will need to add it in some other places if we call code that requires the use of
        WebCoreSystemInterface functions from anywhere that can be invoked before creations
        of the first WebFrameView, but for now there is no need.

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

18 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/FrameMac.mm
WebCore/platform/mac/ClipboardMac.mm
WebCore/platform/mac/GraphicsContextMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h [moved from WebCore/platform/mac/WebCoreGraphicsBridge.m with 65% similarity]
WebCore/platform/mac/WebCoreSystemInterface.mm [moved from WebCore/platform/mac/WebCoreGraphicsBridge.h with 74% similarity]
WebCore/rendering/RenderThemeMac.mm
WebKit/ChangeLog
WebKit/WebCoreSupport/WebGraphicsBridge.m [deleted file]
WebKit/WebCoreSupport/WebImageData.m
WebKit/WebCoreSupport/WebImageRenderer.m
WebKit/WebCoreSupport/WebSystemInterface.h [moved from WebKit/WebCoreSupport/WebGraphicsBridge.h with 86% similarity]
WebKit/WebCoreSupport/WebSystemInterface.m [new file with mode: 0644]
WebKit/WebCoreSupport/WebTextRenderer.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrameView.m

index 6f054dad57bd1bc6dff02d87905ba2b40daea82d..f0c885170ecfb2ab88f0b22eadd1099f499a324b 100644 (file)
@@ -1,3 +1,34 @@
+2006-04-20  Darin Adler  <darin@apple.com>
+
+        Reviewed by Adele.
+
+        - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
+          eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
+
+        * platform/mac/WebCoreGraphicsBridge.h: Removed.
+        * platform/mac/WebCoreGraphicsBridge.m: Removed.
+        * platform/mac/WebCoreSystemInterface.h: Added.
+        * platform/mac/WebCoreSystemInterface.mm: Added.
+
+        * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.
+
+        * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
+        Sorted files.
+
+        * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.
+
+        * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
+        Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
+        call wkSetDragImage.
+
+        * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
+        Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
+        call wkDrawFocusRing.
+
+        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
+        Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
+        WebGraphicsBridge to do the same thing.
+
 2006-04-20  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
index 03f8c0b05e8f1b0e15373727be45d968eadebb8e..8de91cc551db3e52f5a0d499d61d8313ba83cf0e 100644 (file)
 .objc_class_name_DOMText
 .objc_class_name_DOMTreeWalker
 .objc_class_name_DOMUIEvent
-.objc_class_name_WebCoreFrameBridge
-.objc_class_name_WebCorePageBridge
 .objc_class_name_WebCoreCache
 .objc_class_name_WebCoreCookieAdapter
 .objc_class_name_WebCoreEncodings
+.objc_class_name_WebCoreFrameBridge
 .objc_class_name_WebCoreFrameNamespaces
-.objc_class_name_WebCoreGraphicsBridge
 .objc_class_name_WebCoreHistory
 .objc_class_name_WebCoreImageRendererFactory
 .objc_class_name_WebCoreJavaScript
 .objc_class_name_WebCoreKeyGenerator
+.objc_class_name_WebCorePageBridge
 .objc_class_name_WebCoreScriptDebugger
 .objc_class_name_WebCoreSettings
 .objc_class_name_WebCoreTextDecoder
@@ -124,3 +123,6 @@ _WebCoreInitializeEmptyTextStyle
 _WebCoreInitializeFont
 _WebCoreInitializeTextRun
 _WebCorePageCacheStateKey
+_wkDrawBezeledTextFieldCell
+_wkDrawFocusRing
+_wkSetDragImage
index 8560958c882e4bbe18095e12d3dbc847e0db5d5f..40a99c209febe593765a4f464aacab6ddf72cbde 100644 (file)
                93CD4FEC0995FD2A007ECC97 /* PlatformString.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CD4FEB0995FD2A007ECC97 /* PlatformString.h */; };
                93E47C5C09BE2BBB0019C5C1 /* PageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */; };
                93E62D9B0985F41600E1B5E3 /* SystemTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E62D990985F41600E1B5E3 /* SystemTime.h */; };
+               93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */; };
+               93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */; };
                93EEC1FA09C2877700C515D1 /* DocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EEC1E709C2877700C515D1 /* DocPtr.h */; };
                93EEC1FF09C2877700C515D1 /* CanvasRenderingContext2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC1ED09C2877700C515D1 /* CanvasRenderingContext2D.cpp */; };
                93F199BC08245E59001E9ABC /* WebCoreAXObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */; };
                93F199BD08245E59001E9ABC /* AccessibilityObjectCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 55998A5C052B59CC0017A6C1 /* AccessibilityObjectCache.h */; };
                93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A640F00533BB1F0085E777 /* BlockExceptions.h */; settings = {ATTRIBUTES = (); }; };
-               93F199BF08245E59001E9ABC /* WebCoreGraphicsBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = BE26F15305517DE000BFA0C3 /* WebCoreGraphicsBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3B364705C9D5E200E42902 /* AtomicStringList.h */; };
                93F199D508245E59001E9ABC /* KWQEditCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF7EEA005FF8F0D009717EE /* KWQEditCommand.h */; };
                93F19ADF08245E59001E9ABC /* WebCoreAXObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */; };
                93F19AE008245E59001E9ABC /* AccessibilityObjectCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55998A5D052B59CC0017A6C1 /* AccessibilityObjectCache.mm */; };
                93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65F80697054D9F86008BF776 /* BlockExceptions.mm */; };
-               93F19AE308245E59001E9ABC /* WebCoreGraphicsBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = BE26F15405517DE000BFA0C3 /* WebCoreGraphicsBridge.m */; };
                93F19AE508245E59001E9ABC /* WebCoreKeyGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */; };
                93F19AE608245E59001E9ABC /* KWQKSSLKeyGen.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84B2B24F056BF15F00D2B771 /* KWQKSSLKeyGen.mm */; };
                93F19AF708245E59001E9ABC /* KWQEditCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = BEF7EEA105FF8F0D009717EE /* KWQEditCommand.mm */; };
                93CD4FEB0995FD2A007ECC97 /* PlatformString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformString.h; sourceTree = "<group>"; };
                93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PageMac.mm; sourceTree = "<group>"; };
                93E62D990985F41600E1B5E3 /* SystemTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemTime.h; sourceTree = "<group>"; };
+               93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSystemInterface.mm; sourceTree = "<group>"; };
+               93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreSystemInterface.h; sourceTree = "<group>"; };
                93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseEventWithHitTestResults.cpp; sourceTree = "<group>"; };
                93EEC1E509C2877700C515D1 /* Attr.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Attr.idl; sourceTree = "<group>"; };
                93EEC1E609C2877700C515D1 /* CharacterData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CharacterData.idl; sourceTree = "<group>"; };
                BCFB2F40097A24B500BA703D /* SegmentedString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SegmentedString.h; sourceTree = "<group>"; };
                BCFB2F74097A2E1A00BA703D /* Arena.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Arena.cpp; sourceTree = "<group>"; };
                BCFB2F75097A2E1A00BA703D /* Arena.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Arena.h; sourceTree = "<group>"; };
-               BE26F15305517DE000BFA0C3 /* WebCoreGraphicsBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreGraphicsBridge.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               BE26F15405517DE000BFA0C3 /* WebCoreGraphicsBridge.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreGraphicsBridge.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE855F7F0701E83500239769 /* WebCoreView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE8560510701F91100239769 /* WebCoreView.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE91FC8B06133666005E3790 /* Position.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Position.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                65F80697054D9F86008BF776 /* BlockExceptions.mm */,
                                2D90660B0665D937006B6F1A /* ClipboardMac.h */,
                                2D90660C0665D937006B6F1A /* ClipboardMac.mm */,
-                               F587853502DE375901EA4122 /* WebCoreTextArea.h */,
-                               F587853602DE375901EA4122 /* WebCoreTextArea.mm */,
-                               F587851B02DE375901EA4122 /* WebCoreTextField.h */,
-                               F587851C02DE375901EA4122 /* WebCoreTextField.mm */,
                                6582A14909999D6C00BEEB6D /* ColorMac.mm */,
                                9352087609BD453400F2038D /* CookieJar.mm */,
                                F58784F002DE375901EA4122 /* CursorMac.mm */,
                                6545F67509B830180013006F /* TransferJobMac.mm */,
                                F587854902DE375901EA4122 /* WebCoreCookieAdapter.h */,
                                F587854A02DE375901EA4122 /* WebCoreCookieAdapter.m */,
-                               BE26F15305517DE000BFA0C3 /* WebCoreGraphicsBridge.h */,
-                               BE26F15405517DE000BFA0C3 /* WebCoreGraphicsBridge.m */,
                                F5517DC2031AB56301A80180 /* WebCoreHistory.h */,
                                F5517DC3031AB56301A80180 /* WebCoreHistory.m */,
                                F587854D02DE375901EA4122 /* WebCoreImageRenderer.h */,
                                F587854F02DE375901EA4122 /* WebCoreImageRendererFactory.m */,
                                84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */,
                                84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */,
+                               93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */,
+                               93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */,
+                               F587853502DE375901EA4122 /* WebCoreTextArea.h */,
+                               F587853602DE375901EA4122 /* WebCoreTextArea.mm */,
+                               F587851B02DE375901EA4122 /* WebCoreTextField.h */,
+                               F587851C02DE375901EA4122 /* WebCoreTextField.mm */,
                                F587855102DE375901EA4122 /* WebCoreTextRenderer.h */,
                                F587855202DE375901EA4122 /* WebCoreTextRendererFactory.h */,
                                F587855302DE375901EA4122 /* WebCoreTextRendererFactory.mm */,
                        children = (
                                BCEA4945097F0F770094C9E4 /* BrowserExtensionMac.h */,
                                BCEA4946097F0F770094C9E4 /* BrowserExtensionMac.mm */,
-                               9380F68609A143B2001FDB34 /* FrameViewMac.mm */,
-                               935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
                                65BF023B0974819000C43196 /* FrameMac.h */,
                                65BF023C0974819000C43196 /* FrameMac.mm */,
+                               9380F68609A143B2001FDB34 /* FrameViewMac.mm */,
+                               935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
                                F58784FF02DE375901EA4122 /* JavaAppletWidget.mm */,
                                93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */,
                                F5B2A4FC02E2220F018635CB /* WebCoreCache.h */,
                                93F199BC08245E59001E9ABC /* WebCoreAXObject.h in Headers */,
                                93F199BD08245E59001E9ABC /* AccessibilityObjectCache.h in Headers */,
                                93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */,
-                               93F199BF08245E59001E9ABC /* WebCoreGraphicsBridge.h in Headers */,
                                93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */,
                                93F199CF08245E59001E9ABC /* AtomicStringList.h in Headers */,
                                93F199D508245E59001E9ABC /* KWQEditCommand.h in Headers */,
                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
                                1403BA0F09EB18F900797C7F /* JSDOMWindow.h in Headers */,
                                8116896009F2A4A000772CA0 /* SVGTRefElement.h in Headers */,
+                               93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93F19ADF08245E59001E9ABC /* WebCoreAXObject.mm in Sources */,
                                93F19AE008245E59001E9ABC /* AccessibilityObjectCache.mm in Sources */,
                                93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */,
-                               93F19AE308245E59001E9ABC /* WebCoreGraphicsBridge.m in Sources */,
                                93F19AE508245E59001E9ABC /* WebCoreKeyGenerator.m in Sources */,
                                93F19AE608245E59001E9ABC /* KWQKSSLKeyGen.mm in Sources */,
                                93F19AF708245E59001E9ABC /* KWQEditCommand.mm in Sources */,
                                1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
                                1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
                                8116895F09F2A4A000772CA0 /* SVGTRefElement.cpp in Sources */,
+                               93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index c793b9e82d6c0dd9376c076147ba02e113550d61..e3457491a7af25e1f03ad08dbab8d48008130711 100644 (file)
@@ -58,7 +58,6 @@
 #import "TextIterator.h"
 #import "TransferJob.h"
 #import "WebCoreFrameBridge.h"
-#import "WebCoreGraphicsBridge.h"
 #import "WebCoreViewFactory.h"
 #import "WebDashboardRegion.h"
 #import "csshelper.h"
index dcdd9c9f73b0c58152b88f8072ee5d39a7f7e0fe..7399c68749f6fe89de2db48067307c6a2f0fd4e7 100644 (file)
 #import "config.h"
 #import "ClipboardMac.h"
 
+#import "CachedImage.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
-#import "WebCoreGraphicsBridge.h"
 #import "WebCoreImageRenderer.h"
-#import "CachedImage.h"
-
-#import <AppKit/AppKit.h>
-
-using WebCore::String;
-using WebCore::Node;
+#import "WebCoreSystemInterface.h"
 
 namespace WebCore {
 
@@ -316,7 +311,16 @@ void ClipboardMac::setDragImage(CachedImage* image, Node *node, const IntPoint &
             NSPoint cocoaLoc;
             NSImage* cocoaImage = dragNSImage(&cocoaLoc);
             if (cocoaImage) {
-                [[WebCoreGraphicsBridge sharedBridge] setDraggingImage:cocoaImage at:cocoaLoc];
+                // Dashboard wants to be able to set the drag image during dragging, but Cocoa does not allow this.
+                // Instead we must drop down to the CoreGraphics API.
+                wkSetDragImage(cocoaImage, cocoaLoc);
+
+                // Hack: We must post an event to wake up the NSDragManager, which is sitting in a nextEvent call
+                // up the stack from us because the CoreFoundation drag manager does not use the run loop by itself.
+                // This is the most innocuous event to use, per Kristen Forster.
+                NSEvent* ev = [NSEvent mouseEventWithType:NSMouseMoved location:NSZeroPoint
+                    modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0];
+                [NSApp postEvent:ev atStart:YES];
             }
         }
         // Else either 1) we haven't started dragging yet, so we rely on the part to install this drag image
index 51898c1fdd5b469adb8d0d8a8c04713554904c84..22d4053538844a0d96c9c5914a74300e8320c59d 100644 (file)
 #import "config.h"
 #import "GraphicsContext.h"
 
-#import "Font.h"
+#import "BlockExceptions.h"
 #import "FloatRect.h"
+#import "Font.h"
 #import "FoundationExtras.h"
 #import "IntPointArray.h"
 #import "IntRect.h"
 #import "KRenderingDeviceQuartz.h"
-#import "BlockExceptions.h"
-#import "WebCoreGraphicsBridge.h"
 #import "WebCoreImageRendererFactory.h"
+#import "WebCoreSystemInterface.h"
 #import "WebCoreTextRenderer.h"
 #import "WebCoreTextRendererFactory.h"
 #import "Widget.h"
@@ -582,19 +582,43 @@ void GraphicsContext::drawFocusRing(const Color& color)
 {
     if (paintingDisabled())
         return;
+
     int radius = (focusRingWidth() - 1) / 2;
     int offset = radius + focusRingOffset();
     CGColorRef colorRef = color.isValid() ? cgColor(color) : 0;
-    
+
     CGMutablePathRef focusRingPath = CGPathCreateMutable();
     const Vector<IntRect>& rects = focusRingRects();
     unsigned rectCount = rects.size();
-    
     for (unsigned i = 0; i < rectCount; i++)
         CGPathAddRect(focusRingPath, 0, CGRectInset(rects[i], -offset, -offset));
-    
-    [[WebCoreGraphicsBridge sharedBridge] drawFocusRingWithPath:focusRingPath radius:radius color:colorRef clipRect:m_data->m_focusRingClip];
+
+    CGContextRef context = platformContext();
+
+    // FIXME: This works only inside a NSView's drawRect method. The view must be
+    // focused and this context must be the current NSGraphicsContext.
+    ASSERT(context == [[NSGraphicsContext currentContext] graphicsPort]);
+    NSView* view = [NSView focusView];
+    ASSERT(view);
+
+    const NSRect* drawRects;
+    int count;
+    [view getRectsBeingDrawn:&drawRects count:&count];
+
+    // We have to pass in our own clip rectangles here because a bug in CG
+    // seems to inflate the clip (thus allowing the focus ring to paint
+    // slightly outside the clip).
+    NSRect transformedClipRect = [view convertRect:m_data->m_focusRingClip toView:nil];
+    for (int i = 0; i < count; ++i) {
+        NSRect transformedRect = [view convertRect:drawRects[i] toView:nil];
+        NSRect rectToUse = NSIntersectionRect(transformedRect, transformedClipRect);
+        CGContextBeginPath(context);
+        CGContextAddPath(context, focusRingPath);
+        wkDrawFocusRing(context, *(CGRect *)&rectToUse, colorRef, radius);
+    }
+
     CGColorRelease(colorRef);
+
     CGPathRelease(focusRingPath);
 }
 
similarity index 65%
rename from WebCore/platform/mac/WebCoreGraphicsBridge.m
rename to WebCore/platform/mac/WebCoreSystemInterface.h
index f70762fd0e8b63913c7385f20bb4b424426824a3..9edfc3ce2428ce562153afc30f02d36a681c25da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright 2006 Apple Computer, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import "config.h"
-#import "WebCoreGraphicsBridge.h"
+#ifndef WebCoreSystemInterface_h
+#define WebCoreSystemInterface_h
 
-#import <kxmlcore/Assertions.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-@implementation WebCoreGraphicsBridge
+// In alphabetical order.
 
-static WebCoreGraphicsBridge *sharedBridge;
+extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
+extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
+extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
 
-+ (WebCoreGraphicsBridge *)sharedBridge
-{
-    return sharedBridge;
+#ifdef __cplusplus
 }
+#endif
 
-- (id)init
-{
-    [super init];
-    
-    ASSERT(!sharedBridge);
-    sharedBridge = [self retain];
-    
-    return self;
-}
-
-- (void)drawFocusRingWithPath:(CGPathRef)path radius:(float)radius color:(CGColorRef)color clipRect:(NSRect)rect
-{
-}
-
-- (void)setDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc
-{
-}
-
-- (void)drawBezeledTextFieldCell:(NSRect)rect enabled:(BOOL)active
-{
-}
-
-@end
+#endif
similarity index 74%
rename from WebCore/platform/mac/WebCoreGraphicsBridge.h
rename to WebCore/platform/mac/WebCoreSystemInterface.mm
index 3ff1889156c1e56b77e634ee23c32039230bc3a6..4fef3f44acc36431fb1d3ace30b8069db4a2c648 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright 2006 Apple Computer, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#import <Cocoa/Cocoa.h>
+#import "config.h"
+#import "WebCoreSystemInterface.h"
 
-@interface WebCoreGraphicsBridge : NSObject
-
-+ (WebCoreGraphicsBridge *)sharedBridge;
-- (void)drawFocusRingWithPath:(CGPathRef)path radius:(float)radius color:(CGColorRef)color clipRect:(NSRect)rect;
-- (void)setDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc;
-- (void)drawBezeledTextFieldCell:(NSRect)rect enabled:(BOOL)active;
-
-@end
+void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
+void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
+void (*wkSetDragImage)(NSImage*, NSPoint offset);
index 0efeb25bdadf894af8fcdb0095fce238226b6040..dfc2413ae80cb6bbcc364d44221e685c07487668 100644 (file)
 #import "RenderThemeMac.h"
 
 #import "Document.h"
-#import "FrameView.h"
 #import "FoundationExtras.h"
-#import "cssstyleselector.h"
+#import "FrameView.h"
 #import "RenderCanvas.h"
-#import "WebCoreGraphicsBridge.h"
+#import "WebCoreSystemInterface.h"
+#import "cssstyleselector.h"
 
 // The methods in this file are specific to the Mac OS X platform.
 
@@ -492,8 +492,11 @@ void RenderThemeMac::setButtonCellState(const RenderObject* o, const IntRect& r)
     updateFocusedState(button, o);
 }
 
-bool RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+bool RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo&, const IntRect& r)
 {    
+    // FIXME: Ignores the GraphicsContext in the PaintInfo and always draws into the current
+    // NSGraphicsContext instead.
+
     // Determine the width and height needed for the control and prepare the cell for painting.
     setButtonCellState(o, r);
     
@@ -519,11 +522,11 @@ bool RenderThemeMac::paintButton(RenderObject* o, const RenderObject::PaintInfo&
     return false;
 }
 
-bool RenderThemeMac::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+bool RenderThemeMac::paintTextField(RenderObject* o, const RenderObject::PaintInfo&, const IntRect& r)
 {
-    bool enabled = isEnabled(o) && !isReadOnlyControl(o);
-    [[WebCoreGraphicsBridge sharedBridge] drawBezeledTextFieldCell:NSRect(r) enabled:enabled];
-    
+    // FIXME: Ignores the GraphicsContext in the PaintInfo and always draws into the current
+    // NSGraphicsContext instead.
+    wkDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o));
     return false;
 }
 
index 822f40f423b5da19419d7db0831ca3326a827d87..afe2a088c9e82d67d58872a656a7f35f154ac492 100644 (file)
@@ -1,3 +1,28 @@
+2006-04-20  Darin Adler  <darin@apple.com>
+
+        Reviewed by Adele.
+
+        - WebKit part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
+          eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
+
+        * WebCoreSupport/WebGraphicsBridge.h: Removed.
+        * WebCoreSupport/WebGraphicsBridge.m: Removed.
+        * WebCoreSupport/WebSystemInterface.h: Added.
+        * WebCoreSupport/WebSystemInterface.m: Added.
+
+        * WebKit.xcodeproj/project.pbxproj: Updated for removed and added files.
+
+        * WebCoreSupport/WebImageData.m: Removed unneeded include of WebGraphicsBridge.h.
+        * WebCoreSupport/WebImageRenderer.m: Ditto.
+        * WebCoreSupport/WebTextRenderer.m: Ditto.
+
+        * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): Guarded all the one-time
+        initialization inside a boolean, just in case some things take a little time. Added
+        a call to InitWebCoreSystemInterface to the one-time initialization here. Later, we
+        will need to add it in some other places if we call code that requires the use of
+        WebCoreSystemInterface functions from anywhere that can be invoked before creations
+        of the first WebFrameView, but for now there is no need.
+
 2006-04-19  James G. Speth  <speth@end.com>
 
         Reviewed by Timothy.
diff --git a/WebKit/WebCoreSupport/WebGraphicsBridge.m b/WebKit/WebCoreSupport/WebGraphicsBridge.m
deleted file mode 100644 (file)
index a2702ab..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "WebGraphicsBridge.h"
-
-#import "WebAssertions.h"
-#import <WebKitSystemInterface.h>
-
-@implementation WebGraphicsBridge
-
-+ (void)createSharedBridge
-{
-    if (![self sharedBridge]) {
-        [[[self alloc] init] release];
-    }
-    ASSERT([[self sharedBridge] isKindOfClass:self]);
-}
-
-+ (WebGraphicsBridge *)sharedBridge;
-{
-    return (WebGraphicsBridge *)[super sharedBridge];
-}
-
-- (void)drawFocusRingWithPath:(CGPathRef)path radius:(float)radius color:(CGColorRef)color clipRect:(NSRect)rect
-{
-    // We have to set an accurate clip ourselves, since CG inflates the clip (thus allowing the focus ring to
-    // paint slightly outside the clip).
-    NSView* view = [NSView focusView];
-    
-    CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
-    NSRect tr = [view convertRect:rect toView:nil];
-    
-    const NSRect *rects;
-    int count;
-    [view getRectsBeingDrawn:&rects count:&count];
-
-    int i;
-    for (i = 0; i < count; ++i) {
-        NSRect transformedRect = [view convertRect:rects[i] toView:nil];
-        NSRect rectToUse = NSIntersectionRect(transformedRect, tr);
-        CGContextBeginPath(context);
-        CGContextAddPath(context, path);
-        WKDrawFocusRing(context, *(CGRect *)&rectToUse, color, radius);
-    }
-}
-
-// Dashboard wants to set the drag image during dragging, but Cocoa does not allow this.
-// Instead we drop down to the CG API.
-- (void)setDraggingImage:(NSImage *)image at:(NSPoint)offset
-{
-    WKSetDragImage(image, offset);
-
-    // Hack: We must post an event to wake up the NSDragManager, which is sitting in a nextEvent call
-    // up the stack from us because the CF drag manager does not use the run loop by itself.
-    // This is the most innocuous event to use, per Kristen.
-    NSEvent *ev = [NSEvent mouseEventWithType:NSMouseMoved location:NSZeroPoint modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0];
-    [NSApp postEvent:ev atStart:YES];
-}
-
-- (void)drawBezeledTextFieldCell:(NSRect)rect enabled:(BOOL)active
-{
-    WKDrawBezeledTextFieldCell(rect, active);
-}
-
-@end
index 6d11fc1088bd6e0ed0efe2f4f3f802a16ac4061f..6b10529a1adc49bf80b71b4df2c3fb6354e74e01 100644 (file)
@@ -29,7 +29,6 @@
 #import "WebImageData.h"
 
 #import "WebAssertions.h"
-#import "WebGraphicsBridge.h"
 #import "WebImageDecoder.h"
 #import "WebImageRenderer.h"
 #import "WebImageRendererFactory.h"
index a07b4087b871e4d00b3de256adc7bd7440ccf3da..3a5ae7fc6c80aa838a0b6ebea4af10c0fa84580f 100644 (file)
@@ -30,7 +30,6 @@
 
 #import <WebCore/WebCoreImageRenderer.h>
 #import <WebKit/WebAssertions.h>
-#import <WebKit/WebGraphicsBridge.h>
 #import <WebKit/WebHTMLView.h>
 #import <WebKit/WebImageData.h>
 #import <WebKit/WebImageRendererFactory.h>
similarity index 86%
rename from WebKit/WebCoreSupport/WebGraphicsBridge.h
rename to WebKit/WebCoreSupport/WebSystemInterface.h
index c0cfc8ee83f591131820917f58baf90ef3344f29..1bde734c235ecbd417688d814aa1795cd7cb9439 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ * Copyright 2006 Apple Computer, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,9 +26,4 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebCore/WebCoreGraphicsBridge.h>
-
-@interface WebGraphicsBridge : WebCoreGraphicsBridge
-+ (void)createSharedBridge;
-+ (WebGraphicsBridge *)sharedBridge;
-@end
+void InitWebCoreSystemInterface(void);
diff --git a/WebKit/WebCoreSupport/WebSystemInterface.m b/WebKit/WebCoreSupport/WebSystemInterface.m
new file mode 100644 (file)
index 0000000..401d0dc
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebSystemInterface.h"
+
+#import <WebCore/WebCoreSystemInterface.h>
+#import <WebKitSystemInterface.h>
+
+#define INIT(function) wk##function = WK##function
+
+void InitWebCoreSystemInterface(void)
+{
+    INIT(DrawBezeledTextFieldCell);
+    INIT(DrawFocusRing);
+    INIT(SetDragImage);
+}
index 3741b8398c2ef2a8f128b41d882ccf033c92b17d..03a6f7140a86baed489fef085a1a854cc519cdad 100644 (file)
@@ -32,7 +32,6 @@
 #import <ApplicationServices/ApplicationServices.h>
 #import <Cocoa/Cocoa.h>
 
-#import <WebKit/WebGraphicsBridge.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebTextRendererFactory.h>
index 297627b1aed9d3760fd117a3456ad94034602d93..041aca37b39529feedf7c644fd73628d161f7015 100644 (file)
                9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ED21B9810528F7AA003299AC /* WebDocumentInternal.h */; };
                939810800824BF01008DF038 /* WebDocumentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 833987810543012D00EE146E /* WebDocumentPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               939810810824BF01008DF038 /* WebGraphicsBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = BE26F18D05517E0800BFA0C3 /* WebGraphicsBridge.h */; };
                939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BECD14290565830A005BB09C /* WebNSDataExtras.h */; };
                939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939810840824BF01008DF038 /* WebNSEventExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BE887BFF056D3A6E009BB3E7 /* WebNSEventExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
                939811110824BF01008DF038 /* WebLRUFileList.m in Sources */ = {isa = PBXBuildFile; fileRef = BE07CEAC047538F000CA289C /* WebLRUFileList.m */; };
                939811120824BF01008DF038 /* WebNSURLExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.m */; };
                939811130824BF01008DF038 /* WebHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = 65DA2608052CC18700A97B31 /* WebHistory.m */; };
-               939811140824BF01008DF038 /* WebGraphicsBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = BE26F18E05517E0800BFA0C3 /* WebGraphicsBridge.m */; };
                939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BECD142A0565830A005BB09C /* WebNSDataExtras.m */; };
                939811160824BF01008DF038 /* WebNSEventExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BE887C00056D3A6E009BB3E7 /* WebNSEventExtras.m */; };
                939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */; };
                9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */; };
                9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D623DD051E791F002F47DD /* libicucore.dylib */; };
                9398112F0824BF01008DF038 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830E81E005853AC000AD0891 /* Security.framework */; };
+               93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.m */; };
+               93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; };
                ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; };
                DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
                DD89682109AA87240097E7F0 /* WebElementDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.m */; };
                93C6F14507920B93002449CD /* WebFrameViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSObjectExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93D623DD051E791F002F47DD /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
+               93EB178C09F88D460091F8FF /* WebSystemInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSystemInterface.m; sourceTree = "<group>"; };
+               93EB178E09F88D510091F8FF /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; };
                9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9CE1F8A002A5C6F30ECA2ACD /* WebImageRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebImageRenderer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9CE1F8A102A5C6F30ECA2ACD /* WebImageRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRenderer.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEAA047538F000CA289C /* WebFileDatabase.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFileDatabase.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEAB047538F000CA289C /* WebLRUFileList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebLRUFileList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEAC047538F000CA289C /* WebLRUFileList.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebLRUFileList.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               BE26F18D05517E0800BFA0C3 /* WebGraphicsBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebGraphicsBridge.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               BE26F18E05517E0800BFA0C3 /* WebGraphicsBridge.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebGraphicsBridge.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSURLExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                9305892A070868B300E79D96 /* WebDashboardRegion.h */,
                                9311022803667CF1008635CE /* WebFileButton.h */,
                                9311022903667CF1008635CE /* WebFileButton.m */,
-                               BE26F18D05517E0800BFA0C3 /* WebGraphicsBridge.h */,
-                               BE26F18E05517E0800BFA0C3 /* WebGraphicsBridge.m */,
                                514C4C2A075E7DE500B89CAD /* WebImageDecodeItem.h */,
                                514C4C2B075E7DE500B89CAD /* WebImageDecodeItem.m */,
                                514C4C2C075E7DE500B89CAD /* WebImageDecoder.h */,
                                84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
                                F5E0E10802BC45F8018635CA /* WebSubresourceLoader.h */,
                                F5E0E10902BC45F8018635CA /* WebSubresourceLoader.m */,
+                               93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
+                               93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
                                F5B36B410281DF55018635CB /* WebTextRenderer.h */,
                                F5B36B420281DF55018635CB /* WebTextRenderer.m */,
                                F5B36B450281DF9C018635CB /* WebTextRendererFactory.h */,
                                9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */,
                                9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */,
                                939810800824BF01008DF038 /* WebDocumentPrivate.h in Headers */,
-                               939810810824BF01008DF038 /* WebGraphicsBridge.h in Headers */,
                                939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */,
                                939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */,
                                939810840824BF01008DF038 /* WebNSEventExtras.h in Headers */,
                                DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */,
                                226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */,
                                650F74E409E488F70020118A /* WebUnarchivingState.h in Headers */,
+                               93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                939811110824BF01008DF038 /* WebLRUFileList.m in Sources */,
                                939811120824BF01008DF038 /* WebNSURLExtras.m in Sources */,
                                939811130824BF01008DF038 /* WebHistory.m in Sources */,
-                               939811140824BF01008DF038 /* WebGraphicsBridge.m in Sources */,
                                939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */,
                                939811160824BF01008DF038 /* WebNSEventExtras.m in Sources */,
                                939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */,
                                DD89682109AA87240097E7F0 /* WebElementDictionary.m in Sources */,
                                226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */,
                                650F74E509E488F70020118A /* WebUnarchivingState.m in Sources */,
+                               93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 842220cf2cd46ce4fe752c9c8b4ac50c64e453fa..a3bca2f47e174eee98f192d2b3711bf115bcb1f4 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit/WebFrameView.h>
-
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebClipView.h>
-#import <WebKit/WebCookieAdapter.h>
-#import <WebKit/WebDataSource.h>
-#import <WebKit/WebDocument.h>
-#import <WebKit/WebDynamicScrollBarsView.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFrameViewInternal.h>
-#import <WebKit/WebFrameViewPrivate.h>
-#import <WebKit/WebHTMLViewPrivate.h>
-#import <WebKit/WebGraphicsBridge.h>
-#import <WebKit/WebImageRenderer.h>
-#import <WebKit/WebImageRendererFactory.h>
-#import <WebKit/WebImageView.h>
-#import <WebKit/WebKeyGenerator.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebKitStatisticsPrivate.h>
-#import <WebKit/WebNSObjectExtras.h>
-#import <WebKit/WebNSPasteboardExtras.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebPDFView.h>
-#import <WebKit/WebTextRendererFactory.h>
-#import <WebKit/WebTextView.h>
-#import <WebKit/WebViewFactory.h>
-#import <WebKit/WebViewInternal.h>
-#import <WebKit/WebViewPrivate.h>
-#import <WebKit/WebAssertions.h>
+#import "WebFrameView.h"
+
+#import "WebAssertions.h"
+#import "WebClipView.h"
+#import "WebCookieAdapter.h"
+#import "WebDataSource.h"
+#import "WebDocument.h"
+#import "WebDynamicScrollBarsView.h"
+#import "WebFrame.h"
+#import "WebFrameBridge.h"
+#import "WebFrameViewInternal.h"
+#import "WebFrameViewPrivate.h"
+#import "WebHTMLViewPrivate.h"
+#import "WebImageRenderer.h"
+#import "WebImageRendererFactory.h"
+#import "WebImageView.h"
+#import "WebKeyGenerator.h"
+#import "WebKitErrorsPrivate.h"
+#import "WebKitStatisticsPrivate.h"
+#import "WebNSObjectExtras.h"
+#import "WebNSPasteboardExtras.h"
+#import "WebNSViewExtras.h"
+#import "WebPDFView.h"
+#import "WebSystemInterface.h"
+#import "WebTextRendererFactory.h"
+#import "WebTextView.h"
+#import "WebViewFactory.h"
+#import "WebViewInternal.h"
+#import "WebViewPrivate.h"
 
 #import <WebCore/WebCoreFrameView.h>
 #import <WebCore/WebCoreView.h>
@@ -125,14 +125,12 @@ enum {
         return NO;
         
     // Only draw a border for frames that request a border and the frame does
-    // not contain a frameset.  Additionally we should (post-panther) not draw
+    // not contain a frameset.  Additionally we should (some day) not draw
     // a border (left, right, top or bottom) if the frame edge abutts the window frame.
     NSView *docV = [self documentView];
-    if ([docV isKindOfClass:[WebHTMLView class]]){
-        if ([[(WebHTMLView *)docV _bridge] isFrameSet]){
+    if ([docV isKindOfClass:[WebHTMLView class]])
+        if ([[(WebHTMLView *)docV _bridge] isFrameSet])
             return NO;
-        }
-    }
     return YES;
 }
 
@@ -142,9 +140,8 @@ enum {
     // The border drawn by WebFrameView is 1 pixel on the left and right,
     // two pixels on top and bottom.  Shrink the scroll view to accomodate
     // the border.
-    if ([self _shouldDrawBorder]) {
+    if ([self _shouldDrawBorder])
         scrollViewFrame = NSInsetRect (scrollViewFrame, 1, 2);
-    }
     [_private->frameScrollView setFrame:scrollViewFrame];
 }
 
@@ -163,7 +160,7 @@ enum {
     return [_private->webFrame webView];
 }
 
-- (void)_setMarginWidth: (int)w
+- (void)_setMarginWidth:(int)w
 {
     _private->marginWidth = w;
 }
@@ -173,7 +170,7 @@ enum {
     return _private->marginWidth;
 }
 
-- (void)_setMarginHeight: (int)h
+- (void)_setMarginHeight:(int)h
 {
     _private->marginHeight = h;
 }
@@ -187,15 +184,15 @@ enum {
 {
     WebDynamicScrollBarsView *sv = (WebDynamicScrollBarsView *)[self _scrollView];
     
-    [sv setSuppressLayout: YES];
+    [sv setSuppressLayout:YES];
     
     // Always start out with arrow.  New docView can then change as needed, but doesn't have to
     // clean up after the previous docView.  Also TextView will set cursor when added to view
     // tree, so must do this before setDocumentView:.
     [sv setDocumentCursor:[NSCursor arrowCursor]];
 
-    [sv setDocumentView: view];
-    [sv setSuppressLayout: NO];
+    [sv setDocumentView:view];
+    [sv setSuppressLayout:NO];
 }
 
 -(NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource
@@ -303,30 +300,34 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 
 @implementation WebFrameView
 
-- initWithFrame: (NSRect) frame
+- initWithFrame:(NSRect)frame
 {
-    self = [super initWithFrame: frame];
+    self = [super initWithFrame:frame];
     if (!self)
         return nil;
  
-    [WebViewFactory createSharedFactory];
-    [WebTextRendererFactory createSharedFactory];
-    [WebImageRendererFactory createSharedFactory];
-    [WebCookieAdapter createSharedAdapter];
-    [WebGraphicsBridge createSharedBridge];
-    [WebKeyGenerator createSharedGenerator];
+    static bool didFirstTimeInitialization;
+    if (!didFirstTimeInitialization) {
+        didFirstTimeInitialization = true;
+        InitWebCoreSystemInterface();
+        [WebViewFactory createSharedFactory];
+        [WebTextRendererFactory createSharedFactory];
+        [WebImageRendererFactory createSharedFactory];
+        [WebCookieAdapter createSharedAdapter];
+        [WebKeyGenerator createSharedGenerator];
+    }
     
     _private = [[WebFrameViewPrivate alloc] init];
 
-    WebDynamicScrollBarsView *scrollView  = [[WebDynamicScrollBarsView alloc] initWithFrame: NSMakeRect(0,0,frame.size.width,frame.size.height)];
+    WebDynamicScrollBarsView *scrollView  = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0,0,frame.size.width,frame.size.height)];
     _private->frameScrollView = scrollView;
-    [scrollView setContentView: [[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]];
-    [scrollView setDrawsBackground: NO];
-    [scrollView setHasVerticalScroller: NO];
-    [scrollView setHasHorizontalScroller: NO];
-    [scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
+    [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]];
+    [scrollView setDrawsBackground:NO];
+    [scrollView setHasVerticalScroller:NO];
+    [scrollView setHasHorizontalScroller:NO];
+    [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
     [scrollView setLineScroll:40.0];
-    [self addSubview: scrollView];
+    [self addSubview:scrollView];
     // don't call our overridden version here; we need to make the standard NSView link between us
     // and our subview so that previousKeyView and previousValidKeyView work as expected. This works
     // together with our becomeFirstResponder and setNextKeyView overrides.
@@ -361,9 +362,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return _private->webFrame;
 }
 
-- (void)setAllowsScrolling: (BOOL)flag
+- (void)setAllowsScrolling:(BOOL)flag
 {
-    [(WebDynamicScrollBarsView *)[self _scrollView] setAllowsScrolling: flag];
+    [(WebDynamicScrollBarsView *)[self _scrollView] setAllowsScrolling:flag];
 }
 
 - (BOOL)allowsScrolling
@@ -537,7 +538,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     [[self _webView] goForward];
 }
 
-- (BOOL)_scrollVerticallyBy: (float)delta
+- (BOOL)_scrollVerticallyBy:(float)delta
 {
     // This method uses the secret method _scrollTo on NSClipView.
     // It does that because it needs to know definitively whether scrolling was
@@ -549,7 +550,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return [[self _contentView] _scrollTo:&point];
 }
 
-- (BOOL)_scrollHorizontallyBy: (float)delta
+- (BOOL)_scrollHorizontallyBy:(float)delta
 {
     NSPoint point = [[self _contentView] bounds].origin;
     point.x += delta;