2006-05-01 Steve Falkenburg <sfalken@apple.com>
authorsfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 May 2006 22:21:55 +0000 (22:21 +0000)
committersfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 May 2006 22:21:55 +0000 (22:21 +0000)
        Reviewed by eric.

        Spinneret now links against the new separate lib.
        Removed WebFrame, WebView.

        * Spinneret/Spinneret.sln:
        * Spinneret/Spinneret/Spinneret.cpp:
        (SpinneretWebHost::updateLocationBar):
        (_tWinMain):
        * Spinneret/Spinneret/Spinneret.h:
        * Spinneret/Spinneret/Spinneret.vcproj:
        * Spinneret/Spinneret/WebFrame.cpp: Removed.
        * Spinneret/Spinneret/WebFrame.h: Removed.
        * Spinneret/Spinneret/WebView.cpp: Removed.
        * Spinneret/Spinneret/WebView.h: Removed.

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

WebKitTools/ChangeLog
WebKitTools/Spinneret/Spinneret.sln
WebKitTools/Spinneret/Spinneret/Spinneret.cpp
WebKitTools/Spinneret/Spinneret/Spinneret.h
WebKitTools/Spinneret/Spinneret/Spinneret.vcproj
WebKitTools/Spinneret/Spinneret/WebFrame.cpp [deleted file]
WebKitTools/Spinneret/Spinneret/WebFrame.h [deleted file]
WebKitTools/Spinneret/Spinneret/WebView.cpp [deleted file]
WebKitTools/Spinneret/Spinneret/WebView.h [deleted file]

index a00bfbd..8c96140 100644 (file)
@@ -1,3 +1,20 @@
+2006-05-01  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by eric.
+
+        Spinneret now links against the new separate lib.
+        
+        * Spinneret/Spinneret.sln:
+        * Spinneret/Spinneret/Spinneret.cpp:
+        (SpinneretWebHost::updateLocationBar):
+        (_tWinMain):
+        * Spinneret/Spinneret/Spinneret.h:
+        * Spinneret/Spinneret/Spinneret.vcproj:
+        * Spinneret/Spinneret/WebFrame.cpp: Removed.
+        * Spinneret/Spinneret/WebFrame.h: Removed.
+        * Spinneret/Spinneret/WebView.cpp: Removed.
+        * Spinneret/Spinneret/WebView.h: Removed.
+
 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by kdecker
index 1732349..95266a3 100755 (executable)
@@ -3,14 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Spinneret", "Spinneret\Spinneret.vcproj", "{114FCA11-216B-4C8C-957E-30A75AE80443}"\r
        ProjectSection(ProjectDependencies) = postProject\r
-               {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}\r
-               {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
+               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D} = {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JavaScriptCore", "..\..\JavaScriptCore\JavaScriptCore.vcproj\JavaScriptCore\JavaScriptCore.vcproj", "{011D10F1-B656-4A1B-A0C3-3842F02122C5}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCore", "..\..\WebCore\WebCore.vcproj\WebCore\WebCore.vcproj", "{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}"\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitWin", "..\..\WebKitWin\WebKitWin.vcproj\WebKitWin\WebKitWin.vcproj", "{ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
+               {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -29,6 +34,10 @@ Global
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Debug|Win32.Build.0 = Debug|Win32\r
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.ActiveCfg = Release|Win32\r
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.Build.0 = Release|Win32\r
+               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Debug|Win32.Build.0 = Debug|Win32\r
+               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Release|Win32.ActiveCfg = Release|Win32\r
+               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Release|Win32.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index 5a393ed..4468dc2 100755 (executable)
@@ -27,7 +27,6 @@
 #include "Spinneret.h"
 #include "WebView.h"
 #include "WebFrame.h"
-#include "unicode/uclean.h"
 
 #include <commctrl.h>
 
@@ -42,6 +41,7 @@ HWND hMainWnd;
 HWND hURLBarWnd;
 long DefEditProc;
 WebView* gWebView = 0;
+WebHost* gWebHost = 0;
 TCHAR szTitle[MAX_LOADSTRING];                    // The title bar text
 TCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name
 
@@ -52,7 +52,7 @@ LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
 INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK    MyEditProc(HWND, UINT, WPARAM, LPARAM);
 
-void updateLocationBar(const char* URL)
+void SpinneretWebHost::updateLocationBar(const char* URL)
 {
     SendMessageA(hURLBarWnd, (UINT)WM_SETTEXT, 0, (LPARAM)URL);
 }
@@ -108,7 +108,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
     SetWindowLong(hURLBarWnd, GWL_WNDPROC,(long)MyEditProc);
     SetFocus(hURLBarWnd);
 
-    gWebView = WebView::createWebView(hInstance, hMainWnd);
+    gWebHost = new SpinneretWebHost();
+    gWebView = WebView::createWebView(hInstance, hMainWnd, gWebHost);
     resizeSubViews();
     ShowWindow(gWebView->windowHandle(), nCmdShow);
     UpdateWindow(gWebView->windowHandle());
@@ -127,7 +128,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
 
     delete gWebView;
 #ifdef _CRTDBG_MAP_ALLOC
-    u_cleanup();
     _CrtDumpMemoryLeaks();
 #endif
 
index 090ad4a..ecbbaa3 100755 (executable)
 #pragma once
 
 #include "resource.h"
+#include "WebHost.h"
 
-void updateLocationBar(const char* URL);
+using namespace WebKit;
+
+class SpinneretWebHost : public WebHost
+{
+public:
+    virtual void updateLocationBar(const char* URL);
+};
index 15f5ecc..4779ac2 100755 (executable)
@@ -40,7 +40,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\kxmlcore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;"\r
+                               AdditionalIncludeDirectories="$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"\r
                                MinimalRebuild="true"\r
                                ExceptionHandling="0"\r
@@ -63,7 +63,6 @@
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
-                               AdditionalDependencies="comctl32.lib wininet.lib &quot;$(ProjectDir)\..\..\..\iconv\lib\iconv.lib&quot; &quot;$(ProjectDir)\..\..\..\libxml\lib\libxml2.lib&quot; &quot;$(ProjectDir)\..\..\..\libxslt\lib\libxslt.lib&quot; &quot;$(ProjectDir)\..\..\..\icu\lib\icuuc.lib&quot;"\r
                                LinkIncremental="2"\r
                                AdditionalLibraryDirectories=""\r
                                GenerateDebugInformation="true"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\kxmlcore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;"\r
+                               AdditionalIncludeDirectories="$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"\r
                                ExceptionHandling="0"\r
                                RuntimeLibrary="2"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="&quot;$(ProjectDir)\..\..\..\iconv\lib\iconv.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\libxml\lib\libxml2.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\libxslt\lib\libxslt.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\icu\lib\icuuc.lib&quot;&#x0D;&#x0A;"\r
-                               AdditionalDependencies="comctl32.lib wininet.lib &quot;$(ProjectDir)\..\..\..\iconv\lib\iconv.lib&quot; &quot;$(ProjectDir)\..\..\..\libxml\lib\libxml2.lib&quot; &quot;$(ProjectDir)\..\..\..\libxslt\lib\libxslt.lib&quot; &quot;$(ProjectDir)\..\..\..\icu\lib\icuuc.lib&quot;"\r
                                LinkIncremental="1"\r
                                AdditionalLibraryDirectories="&quot;$(ProjectDir)\..\..\..\&quot;"\r
                                GenerateDebugInformation="true"\r
                                        />\r
                                </FileConfiguration>\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\WebFrame.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\WebView.cpp"\r
-                               >\r
-                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Header Files"\r
                                RelativePath=".\stdafx.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\WebFrame.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\WebView.h"\r
-                               >\r
-                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="Resource Files"\r
diff --git a/WebKitTools/Spinneret/Spinneret/WebFrame.cpp b/WebKitTools/Spinneret/Spinneret/WebFrame.cpp
deleted file mode 100755 (executable)
index b923566..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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 "stdafx.h"
-#include "config.h"
-
-#include "WebFrame.h"
-#include "WebView.h"
-#include "Spinneret.h"
-
-#include "Document.h"
-#include "FrameView.h"
-#include "FrameWin.h"
-#include "GraphicsContext.h"
-#include "Page.h"
-#include "render_frames.h"
-#include "cairo.h"
-#include "cairo-win32.h"
-#include "TransferJob.h"
-
-#include <io.h>
-#include <fcntl.h>
-#include <direct.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class WebFrame::WebFramePrivate {
-public:
-    WebFramePrivate() { }
-    ~WebFramePrivate() { }
-
-    RefPtr<Frame> frame;
-    RefPtr<FrameView> frameView;
-    WebView* webView;
-};
-
-WebFrame::WebFrame(char* name, WebView* view)
-: d(new WebFrame::WebFramePrivate)
-{
-    d->webView = view;
-    Page* page = new Page();
-    Frame* frame = new FrameWin(page, 0, this);
-    d->frame = frame;
-    frame->deref(); // Frames are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
-    page->setMainFrame(frame);
-    FrameView* frameView = new FrameView(frame);
-    d->frameView = frameView;
-    frameView->deref(); // FrameViews are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
-    d->frame->setView(frameView);
-    d->frameView->setWindowHandle(view->windowHandle());
-}
-
-WebFrame::~WebFrame()
-{
-    delete d->frame->page();
-    delete d;
-}
-
-void WebFrame::loadFilePath(char* path)
-{
-    char URL[2048];
-    strcpy(URL, "file://localhost/");
-    strncat(URL, path, 2020);
-
-    d->frame->didOpenURL(URL);
-    d->frame->begin(URL);
-    HANDLE fileHandle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-     
-    bool result = false;
-    DWORD bytesRead = 0;
-    
-    do {
-      const int bufferSize = 8193;
-      char buffer[bufferSize];
-      result = ReadFile(fileHandle, &buffer, bufferSize - 1, &bytesRead, NULL); 
-      buffer[bytesRead] = '\0';
-      d->frame->write(buffer);
-      // Check for end of file. 
-    } while (result && bytesRead);
-
-    CloseHandle(fileHandle);
-    
-    d->frame->end();
-}
-
-void WebFrame::loadHTMLString(char *html, char *baseURL)
-{
-    d->frame->begin();
-    d->frame->write(html);
-    d->frame->end();
-}
-
-void WebFrame::openURL(const DeprecatedString& str)
-{
-   updateLocationBar(str.ascii());
-   loadURL(str.ascii());
-}
-
-void WebFrame::submitForm(const String& method, const KURL& url, const FormData* submitFormData)
-{
-    // FIXME: This is a dumb implementation, doesn't handle subframes, etc.
-    d->frame->didOpenURL(url);
-    d->frame->begin(url);
-    TransferJob* job;
-    if (method == "GET" || !submitFormData)
-        job = new TransferJob(this, method, url);
-    else
-        job = new TransferJob(this, method, url, *submitFormData);
-    job->start(d->frame->document()->docLoader());
-}
-
-void WebFrame::loadURL(const char* URL)
-{
-    d->frame->didOpenURL(URL);
-    d->frame->begin(URL);
-    WebCore::TransferJob* job = new TransferJob(this, "GET", URL);
-    job->start(d->frame->document()->docLoader());
-}
-    
-void WebFrame::receivedData(WebCore::TransferJob*, const char* data, int length)
-{
-    d->frame->write(data, length);
-}
-
-void WebFrame::receivedAllData(WebCore::TransferJob* job, WebCore::PlatformData)
-{
-    d->frame->end();
-}
-
-void WebFrame::paint()
-{
-    d->frameView->layout();
-
-    PAINTSTRUCT ps;
-    HDC hdc = BeginPaint(d->webView->windowHandle(), &ps);
-    cairo_surface_t* finalSurface = cairo_win32_surface_create(hdc);
-    cairo_surface_t* surface = cairo_surface_create_similar(finalSurface,
-                                                            CAIRO_CONTENT_COLOR_ALPHA,
-                                                            ps.rcPaint.right, ps.rcPaint.bottom);
-
-    cairo_t* context = cairo_create(surface);
-    GraphicsContext gc(context);
-    
-    IntRect documentDirtyRect = ps.rcPaint;
-    documentDirtyRect.move(d->frameView->contentsX(), d->frameView->contentsY());
-
-    // FIXME: We have to set the transform using both cairo and GDI until we use cairo for text.
-    HDC surfaceDC = cairo_win32_surface_get_dc(surface);
-    SaveDC(surfaceDC);
-    OffsetViewportOrgEx(surfaceDC, -d->frameView->contentsX(), -d->frameView->contentsY(), 0);
-    cairo_translate(context, -d->frameView->contentsX(), -d->frameView->contentsY());
-    d->frame->paint(&gc, documentDirtyRect);
-    RestoreDC(surfaceDC, -1);
-
-    cairo_destroy(context);
-    context = cairo_create(finalSurface);
-    cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
-    cairo_set_source_surface(context, surface, 0, 0);
-    cairo_rectangle(context, 0, 0, ps.rcPaint.right, ps.rcPaint.bottom);
-    cairo_fill(context);
-    cairo_destroy(context);
-
-    cairo_surface_destroy(surface);
-    cairo_surface_destroy(finalSurface);
-
-    EndPaint(d->webView->windowHandle(), &ps);
-}
-
-WebCore::Frame* WebFrame::impl()
-{
-    return d->frame.get();
-}
-
-}
-
diff --git a/WebKitTools/Spinneret/Spinneret/WebFrame.h b/WebKitTools/Spinneret/Spinneret/WebFrame.h
deleted file mode 100755 (executable)
index ea8543a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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 "config.h"
-#include "TransferJobClient.h"
-#include "FrameWin.h"
-
-class KURL;
-
-namespace WebCore {
-    class FormData;
-    class Frame;
-    class FrameView;
-    class String;
-    class TransferJob;
-}
-
-namespace WebKit {
-
-    class WebView;
-
-    class WebFrame : public WebCore::TransferJobClient, public WebCore::FrameWinClient {
-    public:
-    WebFrame(char* name, WebView*);
-    ~WebFrame();
-
-    void loadFilePath(char*);
-    void loadHTMLString(char* html, char* baseURL = 0);
-
-    virtual void openURL(const DeprecatedString&);
-    virtual void submitForm(const WebCore::String& method, const KURL&, const WebCore::FormData*);
-
-    void loadURL(const char*);
-    
-    virtual void receivedData(WebCore::TransferJob*, const char*, int);
-    virtual void receivedAllData(WebCore::TransferJob*, WebCore::PlatformData);
-
-    void paint();
-
-    WebCore::Frame* impl();
-
-    private:
-        class WebFramePrivate;
-        WebFramePrivate *d;
-    };
-}
diff --git a/WebKitTools/Spinneret/Spinneret/WebView.cpp b/WebKitTools/Spinneret/Spinneret/WebView.cpp
deleted file mode 100755 (executable)
index 778c45e..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Copyright (C) 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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 "stdafx.h"
-#include "config.h"
-
-#include "WebFrame.h"
-
-#include "Document.h"
-#include "FrameView.h"
-#include "IntRect.h"
-#include "PlatformKeyboardEvent.h"
-#include "PlatformMouseEvent.h"
-#include "Resource.h"
-#include "SelectionController.h"
-#include "TypingCommand.h"
-#include "WebView.h"
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class WebView::WebViewPrivate {
-public:
-    WebViewPrivate() {}
-    ~WebViewPrivate()
-    {
-        delete mainFrame;
-    }
-
-    WebFrame* mainFrame;
-    HWND windowHandle;
-};
-
-const LPCWSTR kWebViewWindowClassName = L"WebViewWindowClass";
-static bool nextCharIsInputText = false;
-
-LRESULT CALLBACK WebViewWndProc(HWND, UINT, WPARAM, LPARAM);
-
-static ATOM registerWebViewWithInstance(HINSTANCE hInstance)
-{
-    static bool haveRegisteredWindowClass = false;
-    if (haveRegisteredWindowClass)
-        return true;
-
-    WNDCLASSEX wcex;
-
-    wcex.cbSize = sizeof(WNDCLASSEX);
-
-    wcex.style          = CS_DBLCLKS;
-    wcex.lpfnWndProc    = WebViewWndProc;
-    wcex.cbClsExtra     = 0;
-    wcex.cbWndExtra     = 4; // 4 bytes for the WebView pointer
-    wcex.hInstance      = hInstance;
-    wcex.hIcon          = 0;
-    wcex.hCursor        = LoadCursor(0, IDC_ARROW);
-    wcex.hbrBackground  = 0;
-    wcex.lpszMenuName   = 0;
-    wcex.lpszClassName  = kWebViewWindowClassName;
-    wcex.hIconSm        = 0;
-
-    return RegisterClassEx(&wcex);
-}
-
-// FIXME: This should eventually just use the DLL instance, I think.
-WebView* WebView::createWebView(HINSTANCE hInstance, HWND parent)
-{
-    // Save away our instace handle for WebCore to use.
-    Widget::instanceHandle = hInstance;
-
-    registerWebViewWithInstance(hInstance);
-
-    HWND hWnd = CreateWindow(kWebViewWindowClassName, 0, WS_CHILD | WS_HSCROLL | WS_VSCROLL,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, parent, 0, hInstance, 0);
-
-    if (!hWnd)
-        return 0;
-
-    WebView* newWebView = new WebView(hWnd);
-    SetWindowLongPtr(hWnd, 0, (LONG)newWebView);
-    return newWebView;
-}
-
-WebView::WebView(HWND hWnd)
-{
-    d = new WebViewPrivate();
-    d->windowHandle = hWnd;
-    d->mainFrame = new WebFrame("dummy", this);
-    d->mainFrame->loadHTMLString("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.opendarwin.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>");
-}
-
-WebView::~WebView()
-{
-    delete d;
-}
-
-HWND WebView::windowHandle()
-{
-    return d->windowHandle;
-}
-
-WebFrame* WebView::mainFrame()
-{
-    return d->mainFrame;
-}
-
-void WebView::mouseMoved(WPARAM wParam, LPARAM lParam)
-{
-    PlatformMouseEvent mouseEvent(windowHandle(), wParam, lParam, 0);
-    d->mainFrame->impl()->view()->handleMouseMoveEvent(mouseEvent);
-}
-
-void WebView::mouseDown(WPARAM wParam, LPARAM lParam)
-{
-    PlatformMouseEvent mouseEvent(windowHandle(), wParam, lParam, 1);
-    d->mainFrame->impl()->view()->handleMousePressEvent(mouseEvent);
-}
-
-void WebView::mouseUp(WPARAM wParam, LPARAM lParam)
-{
-    PlatformMouseEvent mouseEvent(windowHandle(), wParam, lParam, 1);
-    d->mainFrame->impl()->view()->handleMouseReleaseEvent(mouseEvent);
-}
-
-void WebView::mouseDoubleClick(WPARAM wParam, LPARAM lParam)
-{
-    PlatformMouseEvent mouseEvent(windowHandle(), wParam, lParam, 2);
-    d->mainFrame->impl()->view()->handleMouseReleaseEvent(mouseEvent);
-}
-
-bool WebView::keyPress(WPARAM wParam, LPARAM lParam)
-{
-    PlatformKeyboardEvent keyEvent(windowHandle(), wParam, lParam);
-
-    FrameWin* frame = static_cast<FrameWin*>(d->mainFrame->impl());
-    bool handled = frame->keyPress(keyEvent);
-    if (!handled && !keyEvent.isKeyUp()) {
-        Node* start = frame->selection().start().node();
-        if (start && start->isContentEditable()) {
-            switch(keyEvent.WindowsKeyCode()) {
-            case VK_BACK:
-                TypingCommand::deleteKeyPressed(frame->document());
-                break;
-            case VK_DELETE:
-                TypingCommand::forwardDeleteKeyPressed(frame->document());
-                break;
-            case VK_LEFT:
-                frame->selection().modify(SelectionController::MOVE, SelectionController::LEFT, CharacterGranularity);
-                break;
-            case VK_RIGHT:
-                frame->selection().modify(SelectionController::MOVE, SelectionController::RIGHT, CharacterGranularity);
-                break;
-            case VK_UP:
-                frame->selection().modify(SelectionController::MOVE, SelectionController::BACKWARD, ParagraphGranularity);
-                break;
-            case VK_DOWN:
-                frame->selection().modify(SelectionController::MOVE, SelectionController::FORWARD, ParagraphGranularity);
-                break;
-            default:
-                nextCharIsInputText = true;
-            }
-            handled = true;
-        }
-    }
-    return handled;
-}
-
-#define LINE_SCROLL_SIZE 30
-
-static int calculateScrollDelta(WPARAM wParam, int oldPosition, int pageSize)
-{
-    switch (LOWORD(wParam)) {
-        case SB_PAGEUP: 
-            return -(pageSize - LINE_SCROLL_SIZE); 
-         case SB_PAGEDOWN: 
-            return (pageSize - LINE_SCROLL_SIZE); 
-        case SB_LINEUP: 
-            return -LINE_SCROLL_SIZE;
-        case SB_LINEDOWN: 
-            return LINE_SCROLL_SIZE;
-        case SB_THUMBPOSITION: 
-        case SB_THUMBTRACK:
-            return HIWORD(wParam) - oldPosition; 
-    }
-    return 0;
-}
-
-static int scrollMessageForKey(WPARAM keyCode)
-{
-    switch (keyCode) {
-    case VK_UP:
-        return SB_LINEUP;
-    case VK_PRIOR: 
-        return SB_PAGEUP;
-    case VK_NEXT:
-        return SB_PAGEDOWN;
-    case VK_DOWN:
-        return SB_LINEDOWN;
-    case VK_HOME:
-        return SB_TOP;
-    case VK_END:
-        return SB_BOTTOM;
-    case VK_SPACE:
-        return (GetKeyState(VK_SHIFT) & 0x8000) ? SB_PAGEUP : SB_PAGEDOWN;
-    }
-    return -1;
-}
-
-LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
-    int wmId, wmEvent;
-    WebView* webview = (WebView*)GetWindowLongPtr(hWnd, 0);
-    switch (message)
-    {
-    case WM_PAINT:
-        webview->mainFrame()->paint();
-        break;
-    case WM_DESTROY:
-        // Do nothing?
-        break;
-    case WM_MOUSEMOVE:
-        webview->mouseMoved(wParam, lParam);
-        break;
-    case WM_LBUTTONDOWN:
-        // Make ourselves the focused window before doing anything else
-        // FIXME: I'm not sure if this is the "right" way to do this
-        // but w/o this call, we never become focused since we don't allow
-        // the default handling of mouse events.
-        SetFocus(hWnd);
-    case WM_MBUTTONDOWN:
-    case WM_RBUTTONDOWN:
-        webview->mouseDown(wParam, lParam);
-        break;
-    case WM_LBUTTONUP:
-    case WM_MBUTTONUP:
-    case WM_RBUTTONUP:
-        webview->mouseUp(wParam, lParam);
-        break;
-    case WM_LBUTTONDBLCLK:
-    case WM_MBUTTONDBLCLK:
-    case WM_RBUTTONDBLCLK:
-        webview->mouseDoubleClick(wParam, lParam);
-        break;
-    case WM_HSCROLL: {
-        ScrollView* view = webview->mainFrame()->impl()->view();
-        view->scrollBy(calculateScrollDelta(wParam, view->contentsX(), view->visibleWidth()), 0);
-        webview->mainFrame()->impl()->sendScrollEvent();
-        break;
-    }
-    case WM_VSCROLL: {
-        ScrollView* view = webview->mainFrame()->impl()->view();
-        view->scrollBy(0, calculateScrollDelta(wParam, view->contentsY(), view->visibleHeight()));
-        webview->mainFrame()->impl()->sendScrollEvent();
-        break;
-    }
-    case WM_KEYDOWN: {
-        // FIXME: First we should send key events up through the DOM
-        // to form controls, etc.  If they are not handled, we fall
-        // through to the top level webview and do things like scrolling
-        if (webview->keyPress(wParam, lParam))
-            break;
-        WORD wScrollNotify = scrollMessageForKey(wParam);
-        if (wScrollNotify != -1)
-            SendMessage(hWnd, WM_VSCROLL, MAKELONG(wScrollNotify, 0), 0L);
-        break;
-    }
-    case WM_CHAR: {
-        // FIXME: We need to use WM_UNICHAR to support international text.
-        if (nextCharIsInputText) {
-            TypingCommand::insertText(webview->mainFrame()->impl()->document(), QChar(wParam), false);
-            nextCharIsInputText = false;
-        }
-        break;
-    }
-    case WM_KEYUP: {
-        webview->keyPress(wParam, lParam);
-        break;
-    }
-    case WM_SIZE:
-        if (!webview)
-            break;
-        webview->mainFrame()->impl()->sendResizeEvent();
-        break;
-    case WM_SETFOCUS:
-        webview->mainFrame()->impl()->setWindowHasFocus(true);
-        webview->mainFrame()->impl()->setDisplaysWithFocusAttributes(true);
-        break;
-    case WM_KILLFOCUS:
-        webview->mainFrame()->impl()->setWindowHasFocus(false);
-        webview->mainFrame()->impl()->setDisplaysWithFocusAttributes(false);
-        break;
-    default:
-        return DefWindowProc(hWnd, message, wParam, lParam);
-    }
-    return 0;
-}
-
-};
diff --git a/WebKitTools/Spinneret/Spinneret/WebView.h b/WebKitTools/Spinneret/Spinneret/WebView.h
deleted file mode 100755 (executable)
index 8a583a0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
- * 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 WebView_H
-#define WebView_H
-
-#include <windows.h>
-
-namespace WebKit {
-
-    class WebFrame;
-    
-    class WebView {
-    public:
-        static WebView* createWebView(HINSTANCE, HWND parent = 0);
-
-        ~WebView();
-
-        void drawRect(const PAINTSTRUCT&);
-
-        void mouseMoved(WPARAM, LPARAM);
-        void mouseDown(WPARAM, LPARAM);
-        void mouseUp(WPARAM, LPARAM);
-        void mouseDoubleClick(WPARAM, LPARAM);
-        bool keyPress(WPARAM, LPARAM);
-
-        WebFrame* mainFrame();
-
-        HWND windowHandle();
-    private:
-        WebView(HWND);
-        
-        class WebViewPrivate;
-        WebViewPrivate* d;
-    };
-}
-
-#endif