[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 14:40:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8fbbf1f0583488a99c092961bffbb4fa933b01f3
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 15 19:16:43 2010 +0000

    Add FindIndicatorWindow class
    https://bugs.webkit.org/show_bug.cgi?id=47731
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    Export symbols needed by the FindIndicator in WebKit2.
    
    * WebCore.exp.in:
    
    WebKit2:
    
    * UIProcess/API/mac/FindIndicatorWindow.h: Added.
    * UIProcess/API/mac/FindIndicatorWindow.mm: Added.
    (-[WebFindIndicatorView _initWithFindIndicator:WebKit::]):
    Initialize the find indicator view.
    
    (-[WebFindIndicatorView drawRect:]):
    Ask the find indicator to draw.
    
    (-[WebFindIndicatorView isFlipped]):
    Return YES.
    
    (WebKit::FindIndicatorWindow::~FindIndicatorWindow):
    Make sure to close the window.
    
    (WebKit::FindIndicatorWindow::setFindIndicator):
    Update the find indicator window.
    
    (WebKit::FindIndicatorWindow::closeWindow):
    Close and release the window.
    
    * UIProcess/API/mac/PageClientImpl.h:
    * UIProcess/API/mac/PageClientImpl.mm:
    (WebKit::PageClientImpl::setFindIndicator):
    Create a find indicator window.
    
    * WebKit2.xcodeproj/project.pbxproj:
    Add new files.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7a91d28..3257982 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-15  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add FindIndicatorWindow class
+        https://bugs.webkit.org/show_bug.cgi?id=47731
+
+        Export symbols needed by the FindIndicator in WebKit2.
+
+        * WebCore.exp.in:
+
 2010-10-15  Leandro Pereira  <leandro at profusion.mobi>
 
         [EFL] Unreviewed. Build fix.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index e2811f6..f46a53a 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -350,6 +350,15 @@ __ZN7WebCore15GraphicsContext20endTransparencyLayerEv
 __ZN7WebCore15GraphicsContext21setCompositeOperationENS_17CompositeOperatorE
 __ZN7WebCore15GraphicsContext22beginTransparencyLayerEf
 __ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
+__ZN7WebCore15GraphicsContext5scaleERKNS_9FloatSizeE
+__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
+__ZN7WebCore4PathD1Ev
+__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
+__ZN7WebCore4PathC1Ev
+__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
+__ZN7WebCore15GraphicsContext8fillPathEv
+__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
+__ZN7WebCore15GraphicsContext7addPathERKNS_4PathE
 __ZN7WebCore15GraphicsContext4saveEv
 __ZN7WebCore15GraphicsContext7restoreEv
 __ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectE
@@ -707,6 +716,7 @@ __ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
 __ZN7WebCore8Document4headEv
 __ZN7WebCore8FormData6createEPKvm
 __ZN7WebCore8FormDataD1Ev
+__ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
 __ZN7WebCore8IntPointC1ERK8_NSPoint
 __ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
 __ZN7WebCore8Settings14setJavaEnabledEb
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2456e39..8a62b66 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,40 @@
 2010-10-15  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Sam Weinig.
+
+        Add FindIndicatorWindow class
+        https://bugs.webkit.org/show_bug.cgi?id=47731
+
+        * UIProcess/API/mac/FindIndicatorWindow.h: Added.
+        * UIProcess/API/mac/FindIndicatorWindow.mm: Added.
+        (-[WebFindIndicatorView _initWithFindIndicator:WebKit::]):
+        Initialize the find indicator view.
+
+        (-[WebFindIndicatorView drawRect:]):
+        Ask the find indicator to draw.
+
+        (-[WebFindIndicatorView isFlipped]):
+        Return YES.
+
+        (WebKit::FindIndicatorWindow::~FindIndicatorWindow):
+        Make sure to close the window.
+
+        (WebKit::FindIndicatorWindow::setFindIndicator):
+        Update the find indicator window.
+
+        (WebKit::FindIndicatorWindow::closeWindow):
+        Close and release the window.
+
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::setFindIndicator):
+        Create a find indicator window.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+2010-10-15  Anders Carlsson  <andersca at apple.com>
+
         Fix build.
 
         * UIProcess/API/qt/qwkpage.cpp:
diff --git a/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h b/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h
new file mode 100644
index 0000000..45acdc7
--- /dev/null
+++ b/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 Apple 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#ifndef FindIndicatorWindow_h
+#define FindIndicatorWindow_h
+
+#import <wtf/Noncopyable.h>
+#import <wtf/PassOwnPtr.h>
+#import <wtf/RefPtr.h>
+#import <wtf/RetainPtr.h>
+
+ at class WKView;
+
+namespace WebKit {
+
+class FindIndicator;
+
+class FindIndicatorWindow {
+    WTF_MAKE_NONCOPYABLE(FindIndicatorWindow);
+
+public:
+    static PassOwnPtr<FindIndicatorWindow> create(WKView *);
+    ~FindIndicatorWindow();
+
+    void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut);
+
+private:
+    explicit FindIndicatorWindow(WKView *);
+    void closeWindow();
+
+    WKView* m_wkView;
+    RefPtr<FindIndicator> m_findIndicator;
+    RetainPtr<NSWindow> m_findIndicatorWindow;
+};
+
+} // namespace WebKit
+
+#endif // FindIndicatorWindow_h
diff --git a/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm b/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm
new file mode 100644
index 0000000..b8bad78
--- /dev/null
+++ b/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2010 Apple 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#include "FindIndicatorWindow.h"
+
+#include "FindIndicator.h"
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+ at interface WebFindIndicatorView : NSView {
+    RefPtr<WebKit::FindIndicator> _findIndicator;
+}
+
+- (id)_initWithFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator;
+ at end
+
+ at implementation WebFindIndicatorView
+
+- (id)_initWithFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator
+{
+    if ((self = [super initWithFrame:NSZeroRect]))
+        _findIndicator = findIndicator;
+
+    return self;
+}
+
+- (void)drawRect:(NSRect)rect
+{
+    GraphicsContext graphicsContext(static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]));
+
+    _findIndicator->draw(graphicsContext, enclosingIntRect(rect));
+}
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+ at end
+
+namespace WebKit {
+
+PassOwnPtr<FindIndicatorWindow> FindIndicatorWindow::create(WKView *wkView)
+{
+    return adoptPtr(new FindIndicatorWindow(wkView));
+}
+
+FindIndicatorWindow::FindIndicatorWindow(WKView *wkView)
+    : m_wkView(wkView)
+{
+}
+
+FindIndicatorWindow::~FindIndicatorWindow()
+{
+    closeWindow();
+}
+
+void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut)
+{
+    if (m_findIndicator == findIndicator)
+        return;
+
+    m_findIndicator = findIndicator;
+
+    // Get rid of the old window.
+    closeWindow();
+
+    if (!m_findIndicator)
+        return;
+
+    NSRect contentRect = m_findIndicator->frameRect();
+    NSSize findIndicatorViewSize = contentRect.size;
+    
+    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
+    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
+
+    NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
+    
+    m_findIndicatorWindow.adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect 
+                                                              styleMask:NSBorderlessWindowMask 
+                                                                backing:NSBackingStoreBuffered
+                                                                  defer:NO]);
+
+    [m_findIndicatorWindow.get() setBackgroundColor:[NSColor clearColor]];
+    [m_findIndicatorWindow.get() setOpaque:NO];
+    [m_findIndicatorWindow.get() setIgnoresMouseEvents:YES];
+
+    RetainPtr<WebFindIndicatorView> findIndicatorView(AdoptNS, [[WebFindIndicatorView alloc] _initWithFindIndicator:m_findIndicator]);
+    [m_findIndicatorWindow.get() setContentView:findIndicatorView.get()];
+
+    [[m_wkView window] addChildWindow:m_findIndicatorWindow.get() ordered:NSWindowAbove];
+    [m_findIndicatorWindow.get() setReleasedWhenClosed:NO];
+}
+
+void FindIndicatorWindow::closeWindow()
+{
+    if (!m_findIndicatorWindow)
+        return;
+
+    [[m_findIndicatorWindow.get() parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
+    [m_findIndicatorWindow.get() close];
+    m_findIndicatorWindow.clear();
+    
+}
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/API/mac/PageClientImpl.h b/WebKit2/UIProcess/API/mac/PageClientImpl.h
index 1d19df2..53262d8 100644
--- a/WebKit2/UIProcess/API/mac/PageClientImpl.h
+++ b/WebKit2/UIProcess/API/mac/PageClientImpl.h
@@ -34,6 +34,8 @@
 
 namespace WebKit {
 
+class FindIndicatorWindow;
+
 // NOTE: This does not use String::operator NSString*() since that function
 // expects to be called on the thread running WebCore.
 NSString* nsStringFromWebCoreString(const String&);
@@ -71,6 +73,7 @@ private:
 
     WKView* m_wkView;
     RetainPtr<WebEditorUndoTargetObjC> m_undoTarget;
+    OwnPtr<FindIndicatorWindow> m_findIndicatorWindow;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/WebKit2/UIProcess/API/mac/PageClientImpl.mm
index 9f01b03..9c474a0 100644
--- a/WebKit2/UIProcess/API/mac/PageClientImpl.mm
+++ b/WebKit2/UIProcess/API/mac/PageClientImpl.mm
@@ -25,6 +25,8 @@
 
 #import "PageClientImpl.h"
 
+#import "FindIndicator.h"
+#import "FindIndicatorWindow.h"
 #import "WKAPICast.h"
 #import "WKStringCF.h"
 #import "WKViewInternal.h"
@@ -225,9 +227,17 @@ void PageClientImpl::didNotHandleKeyEvent(const NativeWebKeyboardEvent&)
 {
 }
 
-void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut)
+void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut)
 {
-    // FIXME: Implement.
+    if (!findIndicator) {
+        m_findIndicatorWindow = 0;
+        return;
+    }
+
+    if (!m_findIndicatorWindow)
+        m_findIndicatorWindow = FindIndicatorWindow::create(m_wkView);
+
+    m_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut);
 }
 
 #if USE(ACCELERATED_COMPOSITING)
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index f406d82..73cb1cc 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -128,6 +128,8 @@
 		1A90C2A412650C60003E44D4 /* FindPageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C2A212650C60003E44D4 /* FindPageOverlay.cpp */; };
 		1A910071126675C4001842F5 /* FindIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* FindIndicator.h */; };
 		1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
+		1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */; };
+		1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
 		1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
 		1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
 		1AA56F2911E92BC80061B882 /* PluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA56F2811E92BC80061B882 /* PluginController.h */; };
@@ -595,6 +597,8 @@
 		1A90C2A212650C60003E44D4 /* FindPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindPageOverlay.cpp; sourceTree = "<group>"; };
 		1A91006F126675C3001842F5 /* FindIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicator.h; sourceTree = "<group>"; };
 		1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = "<group>"; };
+		1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = "<group>"; };
+		1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = "<group>"; };
 		1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -1499,6 +1503,8 @@
 			children = (
 				BC111B4B112F619200337BAB /* PageClientImpl.h */,
 				BC111B4C112F619200337BAB /* PageClientImpl.mm */,
+				1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */,
+				1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */,
 				BC8699B2116AADAA002A925B /* WKView.h */,
 				BC8699B3116AADAA002A925B /* WKView.mm */,
 				BC8699B4116AADAA002A925B /* WKViewInternal.h */,
@@ -2034,6 +2040,7 @@
 				1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
 				1A90C2A312650C60003E44D4 /* FindPageOverlay.h in Headers */,
 				1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
+				1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2341,6 +2348,7 @@
 				1A90C2A412650C60003E44D4 /* FindPageOverlay.cpp in Sources */,
 				C01A260112662F2100C9ED55 /* BackingStoreCG.cpp in Sources */,
 				1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
+				1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list