JavaScriptCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Sep 2006 00:50:41 +0000 (00:50 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Sep 2006 00:50:41 +0000 (00:50 +0000)
        Reviewed by Maciej.

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        Updated to include the right path.
        * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.

WebCore:

        Reviewed by Maciej.

        Some Widget refactoring.

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * bridge/mac/FrameMac.mm:
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::runJavaScriptAlert):
        (WebCore::FrameWin::runJavaScriptConfirm):
        * bridge/win/PageWin.cpp:
        (WebCore::Page::Page):
        (WebCore::rootWindowForFrame):
        * html/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::translate):
        * page/FrameView.cpp:
        (WebCore::FrameView::isFrameView):
        * page/Page.h:
        (WebCore::Page::setInstanceHandle):
        (WebCore::Page::instanceHandle):
        * platform/GraphicsContext.h:
        * platform/ScrollView.h:
        * platform/Widget.h:
        * platform/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::translate):
        (WebCore::GraphicsContext::origin):
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::clearFocus):
        * platform/win/ResourceLoaderWin.cpp:
        (WebCore::initializeOffScreenResourceLoaderWindow):
        * platform/win/ScreenWin.cpp:
        (WebCore::monitorInfo):
        * platform/win/ScrollViewWin.cpp:
        (WebCore::ScrollView::updateContents):
        (WebCore::ScrollView::visibleWidth):
        (WebCore::ScrollView::visibleHeight):
        (WebCore::ScrollView::visibleContentRect):
        (WebCore::ScrollView::viewportToContents):
        (WebCore::ScrollView::contentsToViewport):
        (WebCore::ScrollView::scrollBy):
        (WebCore::ScrollView::updateScrollInfo):
        (WebCore::ScrollView::updateScrollBars):
        * platform/win/SharedTimerWin.cpp:
        (WebCore::initializeOffScreenTimerWindow):
        * platform/win/TemporaryLinkStubs.cpp:
        (FrameView::updateBorder):
        (ScrollView::paint):
        (GraphicsContext::clip):
        * platform/win/WidgetWin.cpp:
        (WebCore::Widget::Widget):
        (WebCore::Widget::parentWindow):
        (WebCore::Widget::setParentWindow):
        (WebCore::Widget::frameGeometry):
        (WebCore::Widget::hasFocus):
        (WebCore::Widget::setFocus):
        (WebCore::Widget::show):
        (WebCore::Widget::hide):
        (WebCore::Widget::setFrameGeometry):

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

24 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/wtf/FastMalloc.h
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/win/FrameWin.cpp
WebCore/bridge/win/PageWin.cpp
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/page/Frame.h
WebCore/page/FrameView.cpp
WebCore/page/Page.h
WebCore/platform/GraphicsContext.h
WebCore/platform/ScrollView.h
WebCore/platform/Widget.h
WebCore/platform/cairo/GraphicsContextCairo.cpp
WebCore/platform/mac/WidgetMac.mm
WebCore/platform/win/ResourceLoaderWin.cpp
WebCore/platform/win/ScreenWin.cpp
WebCore/platform/win/ScrollViewWin.cpp
WebCore/platform/win/SharedTimerWin.cpp
WebCore/platform/win/TemporaryLinkStubs.cpp
WebCore/platform/win/WidgetWin.cpp
WebKit/COM/WebFrame.cpp

index d6687cce3a844a0c1a6d44aa3ccb780d6df3fd6c..e1bd323f0fddbb99b25b365d29c200c3b9d2f3db 100644 (file)
@@ -1,3 +1,11 @@
+2006-09-21  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        Updated to include the right path.
+        * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
+
 2006-09-20  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Dave Hyatt.
index 7f21e1300e6b5561416d762c2943ff2c5e6110bf..e0ac8cd8a1a08aef847276b68ea611999047bb0b 100644 (file)
@@ -26,7 +26,7 @@
                        <Tool
                                Name="VCPreBuildEventTool"
                                Description="Constructing generated files..."
-                               CommandLine="bash build-generated-files.sh &quot;$(ConfigurationName)&quot; &quot;$(WebKitOutputDir)&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(WebkitOutputDir)\bin\dftables_debug.exe&quot; &quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\chartables.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSBase.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSContextRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSObjectRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSStringRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSValueRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JavaScriptCore.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;"
+                               CommandLine="set PATH=%PATH%;%SystemDrive%\cygwin\bin&#x0D;&#x0A;&#x0D;&#x0A;bash build-generated-files.sh &quot;$(ConfigurationName)&quot; &quot;$(WebKitOutputDir)&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(WebkitOutputDir)\bin\dftables_debug.exe&quot; &quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\chartables.c&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSBase.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSContextRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSObjectRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSStringRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JSValueRef.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\API\JavaScriptCore.h&quot; &quot;$(WebKitOutputDir)\include\JavaScriptCore\JavaScriptCore&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCCustomBuildTool"
index 12c4aa2f009be2a3a65cc5721507ebf6d695a6a9..35c16b60630cdb018424ea6b5e675e200207821f 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef KXMLCORE_FAST_MALLOC_H
 #define KXMLCORE_FAST_MALLOC_H
 
+#include "Platform.h"
 #include <stdlib.h>
 #include <new>
 
index d7d1f322259912210e950bd112223318539ea566..57139e1768b7b4fbf090637fa316555b720c3be9 100644 (file)
@@ -1,3 +1,63 @@
+2006-09-21  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej.
+        
+        Some Widget refactoring.
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * bridge/mac/FrameMac.mm:
+        * bridge/win/FrameWin.cpp:
+        (WebCore::FrameWin::runJavaScriptAlert):
+        (WebCore::FrameWin::runJavaScriptConfirm):
+        * bridge/win/PageWin.cpp:
+        (WebCore::Page::Page):
+        (WebCore::rootWindowForFrame):
+        * html/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::translate):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::isFrameView):
+        * page/Page.h:
+        (WebCore::Page::setInstanceHandle):
+        (WebCore::Page::instanceHandle):
+        * platform/GraphicsContext.h:
+        * platform/ScrollView.h:
+        * platform/Widget.h:
+        * platform/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContext::translate):
+        (WebCore::GraphicsContext::origin):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::clearFocus):
+        * platform/win/ResourceLoaderWin.cpp:
+        (WebCore::initializeOffScreenResourceLoaderWindow):
+        * platform/win/ScreenWin.cpp:
+        (WebCore::monitorInfo):
+        * platform/win/ScrollViewWin.cpp:
+        (WebCore::ScrollView::updateContents):
+        (WebCore::ScrollView::visibleWidth):
+        (WebCore::ScrollView::visibleHeight):
+        (WebCore::ScrollView::visibleContentRect):
+        (WebCore::ScrollView::viewportToContents):
+        (WebCore::ScrollView::contentsToViewport):
+        (WebCore::ScrollView::scrollBy):
+        (WebCore::ScrollView::updateScrollInfo):
+        (WebCore::ScrollView::updateScrollBars):
+        * platform/win/SharedTimerWin.cpp:
+        (WebCore::initializeOffScreenTimerWindow):
+        * platform/win/TemporaryLinkStubs.cpp:
+        (FrameView::updateBorder):
+        (ScrollView::paint):
+        (GraphicsContext::clip):
+        * platform/win/WidgetWin.cpp:
+        (WebCore::Widget::Widget):
+        (WebCore::Widget::parentWindow):
+        (WebCore::Widget::setParentWindow):
+        (WebCore::Widget::frameGeometry):
+        (WebCore::Widget::hasFocus):
+        (WebCore::Widget::setFocus):
+        (WebCore::Widget::show):
+        (WebCore::Widget::hide):
+        (WebCore::Widget::setFrameGeometry):
+
 2006-09-22  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Tim H.
index 09b3cc7dcf320d31d41a036b2fcc225636c0054e..79f8cfcc2fc6d6da63aa2bba3be1f7b6fd2aa086 100644 (file)
@@ -24,7 +24,7 @@
                        >
                        <Tool
                                Name="VCPreBuildEventTool"
-                               CommandLine="bash build-generated-files.sh &quot;$(ConfigurationName)&quot; &quot;$(WebKitOutputDir)&quot;&#x0D;&#x0A;"
+                               CommandLine="set PATH=%PATH%;%SystemDrive%\cygwin\bin&#x0D;&#x0A;&#x0D;&#x0A;bash build-generated-files.sh &quot;$(ConfigurationName)&quot; &quot;$(WebKitOutputDir)&quot;&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCCustomBuildTool"
index 8f57cc3701766690f0bab2b38ba5ff3ae379bdd6..13624c21a405a6a2e70a387c7b3f7ec282bbab18 100644 (file)
@@ -146,12 +146,6 @@ static SEL selectorForKeyEvent(const PlatformKeyboardEvent* event)
     return selector;
 }
 
-
-bool FrameView::isFrameView() const
-{
-    return true;
-}
-
 FrameMac::FrameMac(Page* page, Element* ownerElement)
     : Frame(page, ownerElement)
     , _bridge(nil)
index ec5bea4a29bd8b5b49b7fc22570fe1b037bcc733..ac0a846a7c4d9829bac1103c410c1f75272bb5fc 100644 (file)
@@ -93,7 +93,7 @@ void FrameWin::runJavaScriptAlert(String const& message)
     text.replace('\\', backslashAsCurrencySymbol());
     UChar nullChar = 0;
     text += String(&nullChar, 1);
-    MessageBox(view()->windowHandle(), text.characters(), L"JavaScript Alert", MB_OK);
+    MessageBox(view()->containingWindow(), text.characters(), L"JavaScript Alert", MB_OK);
 }
 
 bool FrameWin::runJavaScriptConfirm(String const& message)
@@ -102,7 +102,7 @@ bool FrameWin::runJavaScriptConfirm(String const& message)
     text.replace('\\', backslashAsCurrencySymbol());
     UChar nullChar = 0;
     text += String(&nullChar, 1);
-    return MessageBox(view()->windowHandle(), text.characters(), L"JavaScript Alert", MB_OKCANCEL) == IDOK;
+    return MessageBox(view()->containingWindow(), text.characters(), L"JavaScript Alert", MB_OKCANCEL) == IDOK;
 }
 
 // FIXME: This needs to be unified with the keyPress method on FrameMac
index b95169f21e4c56efc5109a05acbabd6f33859e36..4744e880529f374ae5080d04f337b239d6bd17d0 100644 (file)
 
 namespace WebCore {
 
-Page::Page(HWND hwnd)
-: m_windowHandle(hwnd)
-, m_frameCount(0)
-, m_widget(0)
+Page::Page()
+: m_frameCount(0)
 , m_dragCaretController(0, true)
 {
     init();
@@ -48,7 +46,7 @@ static HWND rootWindowForFrame(const Frame* frame)
     FrameView* frameView = frame->view();
     if (!frameView)
         return 0;
-    HWND frameWnd = frameView->windowHandle();
+    HWND frameWnd = frameView->containingWindow();
     if (!frameWnd)
         return 0;
     return GetAncestor(frameWnd, GA_ROOT);
index 481ff338f6263d2d74eb4335ffe3fa6408274b9a..b913b3876ce0bae27820583a4b90fd89db679fa4 100644 (file)
@@ -291,7 +291,7 @@ void CanvasRenderingContext2D::translate(float tx, float ty)
     GraphicsContext* c = drawingContext();
     if (!c)
         return;
-    c->translate(FloatSize(tx, ty));
+    c->translate(tx, ty);
 }
 
 void CanvasRenderingContext2D::setStrokeColor(const String& color)
index 735416082a8955fcb7f279cc56dd32264286f377..41ee0de9162f234af496814309de39610be6c6d3 100644 (file)
@@ -591,6 +591,7 @@ protected:
   virtual void redirectionTimerFired(Timer<Frame>*);
   
   virtual bool isLoadTypeReload() = 0;
+  virtual KURL originalRequestURL() const = 0;
 
 public:
   void loadDone();
@@ -602,7 +603,6 @@ public:
   void reparseConfiguration();
 
 private:
-  virtual KURL originalRequestURL() const = 0;
   void childBegin();
 
   void submitFormAgain();
index 1425a15d72e0d856e1e9edff9b5cc7e9d9b827b9..4e9bc75e96fd555426aa6da613b045a3947587a5 100644 (file)
@@ -202,6 +202,11 @@ FrameView::~FrameView()
     d = 0;
 }
 
+bool FrameView::isFrameView() const 
+{ 
+    return true; 
+}
+
 void FrameView::clearPart()
 {
     m_frame = 0;
index 8a3feffcdfc0e3fdfe6bfc25f32c6223ec1a3454..d52e940a90a8fdcad931d7dd772636cc336656e7 100644 (file)
@@ -35,6 +35,7 @@ class WebCorePageBridge;
 
 #if PLATFORM(WIN)
 typedef struct HWND__* HWND;
+typedef struct HINSTANCE__* HINSTANCE;
 #endif
 
 namespace WebCore {
@@ -75,9 +76,11 @@ namespace WebCore {
         WebCorePageBridge* bridge() const { return m_bridge; }
 #endif
 
-#if PLATFORM(WIN_OS)
-        Page(HWND);
-        HWND windowHandle() const { return m_windowHandle; }
+#if PLATFORM(WIN)
+        Page();
+        // The global DLL or application instance used for all windows.
+        static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
+        static HINSTANCE instanceHandle() { return s_instanceHandle; }
 #endif
 
     private:
@@ -85,7 +88,6 @@ namespace WebCore {
 
         RefPtr<Frame> m_mainFrame;
         int m_frameCount;
-        mutable Widget* m_widget;
         String m_groupName;
         mutable SelectionController m_dragCaretController;
 
@@ -93,8 +95,8 @@ namespace WebCore {
         WebCorePageBridge* m_bridge;
 #endif
 
-#if PLATFORM(WIN_OS)
-        HWND m_windowHandle;
+#if PLATFORM(WIN)
+        static HINSTANCE s_instanceHandle;
 #endif
     };
 
index 3e2ce88c3ace326a3852bca6b7cf81aba41c7c10..b46fdb68ddcd3962d5f844c4c99ef0c505de9d7d 100644 (file)
@@ -159,8 +159,9 @@ namespace WebCore {
 
         void scale(const FloatSize&);
         void rotate(float angleInRadians);
-        void translate(const FloatSize&);
-        
+        void translate(int x, int y);
+        IntPoint origin();
+
         void concatCTM(const AffineTransform&);
 
 #ifdef SVG_SUPPORT
index eeb236ccebc8bf65061d34a1d7b0a18df65c647b..fa108b80c8fb9f58c63a6a73c9399f021a622d1d 100644 (file)
@@ -83,13 +83,16 @@ namespace WebCore {
         // (like Windows), we need this method in order to do the scroll ourselves.
         void wheelEvent(PlatformWheelEvent&);
 
-#if __APPLE__
+#if PLATFORM(MAC)
         NSView* getDocumentView() const;
 #endif
 
 #if PLATFORM(WIN)
         ScrollView();
         ~ScrollView();
+
+        virtual void paint(GraphicsContext*, const IntRect&);
+
     private:
         void updateScrollBars();
         IntSize maximumScroll() const;
index 6022a297c08c15abdb38cf1f2cd896d849c068e5..b9a0464756ff832e035b81aad5a122cce8a845b8 100644 (file)
@@ -37,8 +37,7 @@ class NSView;
 #endif
 
 #if PLATFORM(WIN)
-typedef struct HWND__ *HWND;
-typedef struct HINSTANCE__ *HINSTANCE;
+typedef struct HWND__* HWND;
 #endif
 
 #if PLATFORM(GDK)
@@ -92,16 +91,14 @@ namespace WebCore {
 
         virtual void paint(GraphicsContext*, const IntRect&);
 
-        virtual IntRect frameGeometry() const;
         virtual void setFrameGeometry(const IntRect&);
+        virtual IntRect frameGeometry() const;
 
         virtual int baselinePosition(int height) const; // relative to the top of the widget
 
-        virtual IntPoint mapFromGlobal(const IntPoint&) const;
-
         bool hasFocus() const;
-        void setFocus();
-        void clearFocus();
+        virtual void setFocus();
+        virtual void clearFocus();
         virtual bool checksDescendantsForFocus() const;
 
         virtual FocusPolicy focusPolicy() const;
@@ -112,8 +109,8 @@ namespace WebCore {
         void setCursor(const Cursor&);
         Cursor cursor();
 
-        void show();
-        void hide();
+        virtual void show();
+        virtual void hide();
 
         virtual void populate() {}
 
@@ -130,20 +127,23 @@ namespace WebCore {
         virtual bool isFrameView() const;
 
 #if PLATFORM(WIN)
-        Widget(HWND);
-        HWND windowHandle() const;
-        void setWindowHandle(HWND);
-        // The global DLL or application instance used for all WebCore windows.
-        static HINSTANCE instanceHandle;
+        IntRect convertToContainingWindow(const IntRect&) const;
+        IntPoint convertToContainingWindow(const IntPoint&) const;
+        IntPoint convertFromContainingWindow(const IntPoint&) const;
+
+        void setContainingWindow(HWND);
+        HWND containingWindow() const;
+
+        void setParent(Widget*);
+        Widget* parent() const;
 #endif
 
 #if PLATFORM(GDK)
-      Widget(GdkDrawable* drawable);
-      virtual void setDrawable(GdkDrawable* drawable);
-      GdkDrawable* drawable() const;
+        Widget(GdkDrawable* drawable);
+        virtual void setDrawable(GdkDrawable* drawable);
+        GdkDrawable* drawable() const;
 #endif
 
-
 #if PLATFORM(QT)
         QWidget* parentWidget() const;
         virtual void setParentWidget(QWidget*);
@@ -152,7 +152,6 @@ namespace WebCore {
         void setQWidget(QWidget*);
 #endif
 
-
 #if PLATFORM(MAC)
         Widget(NSView* view);
 
index 9d381a15a2f509b23fb58382e7fd6907585388c4..6ab1813f5f2cfa5477d8a28a602493ae924981be 100644 (file)
@@ -446,6 +446,12 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect)
     return result; 
 }
 
+void GraphicsContext::translate(int x, int y)
+{
+    cairo_t* context = m_data->context;
+    cairo_translate(context, x, y);
+}
+
 HDC GraphicsContext::getWindowsContext()
 {
     cairo_surface_t* surface = cairo_get_target(platformContext());
@@ -454,6 +460,14 @@ HDC GraphicsContext::getWindowsContext()
     return hdc;
 }
 
+IntPoint GraphicsContext::origin()
+{
+    cairo_matrix_t matrix;
+    cairo_t* context = m_data->context;
+    cairo_get_matrix(context, &matrix);
+    return IntPoint(matrix.x0, matrix.y0);
+}
+
 void GraphicsContext::releaseWindowsContext()
 {
     cairo_surface_t* surface = cairo_get_target(platformContext());
@@ -462,6 +476,6 @@ void GraphicsContext::releaseWindowsContext()
     cairo_surface_mark_dirty(surface);
 }
 
-}
+} // namespace WebCore
 
 #endif // PLATFORM(CAIRO)
index bf024e143f49a9e9349d7321ff884a609d2399ee..3e133fc48231e8537d47fa4a32c6a8cde99f92c1 100644 (file)
@@ -184,6 +184,7 @@ void Widget::clearFocus()
 {
     if (!hasFocus())
         return;
+    // FIXME: This probably shouldn't be the Widget's responsibility
     FrameMac::clearDocumentFocus(this);
 }
 
index a7b262a2d00ca1a50f50b14a2f24959e1a39886c..a5790ed663c286ae01a84a5e8bb96dd18ab8a96f 100644 (file)
@@ -32,6 +32,7 @@
 #include "DocLoader.h"
 #include "Frame.h"
 #include "Document.h"
+#include "Page.h"
 #include <windows.h>
 #include <wininet.h>
 
@@ -222,12 +223,12 @@ static void initializeOffScreenResourceLoaderWindow()
     memset(&wcex, 0, sizeof(WNDCLASSEX));
     wcex.cbSize = sizeof(WNDCLASSEX);
     wcex.lpfnWndProc    = ResourceLoaderWndProc;
-    wcex.hInstance      = Widget::instanceHandle;
+    wcex.hInstance      = Page::instanceHandle();
     wcex.lpszClassName  = kResourceLoaderWindowClassName;
     RegisterClassEx(&wcex);
 
     transferJobWindowHandle = CreateWindow(kResourceLoaderWindowClassName, 0, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
-        HWND_MESSAGE, 0, Widget::instanceHandle, 0);
+        HWND_MESSAGE, 0, Page::instanceHandle(), 0);
     loadStatusMessage = RegisterWindowMessage(L"com.apple.WebKit.ResourceLoaderLoadStatus");
 }
 
index 0a5cd0f00a6b45a675ef90113a32257cee709125..d4aeea5156a12945df204291fdecc475b691369d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "IntRect.h"
 #include "FloatRect.h"
+#include "Frame.h"
 #include "Page.h"
 #include <windows.h>
 
@@ -45,7 +46,7 @@ FloatRect scalePageRectToScreenCoordinates(const FloatRect& rect, const Page*)
     
 static MONITORINFOEX monitorInfo(const Page* page)
 {
-    HMONITOR monitor = MonitorFromWindow(page->windowHandle(), MONITOR_DEFAULTTOPRIMARY);
+    HMONITOR monitor = MonitorFromWindow(page->mainFrame()->view()->containingWindow(), MONITOR_DEFAULTTOPRIMARY);
     MONITORINFOEX info;
     info.cbSize = sizeof(MONITORINFOEX);
     GetMonitorInfo(monitor, &info);
index 65c72b63c1f4ef42122aeb3bdf66195c18054ca4..2a87b6b718eb406480cc4536ab2e0b8a8d8e6a93 100644 (file)
@@ -70,34 +70,34 @@ void ScrollView::updateContents(const IntRect& updateRect, bool now)
 
     RECT dirtyRect = RECT(adjustedDirtyRect);
 #if PAINT_FLASHING_DEBUG
-    HDC dc = GetDC(windowHandle());
+    HDC dc = GetDC(containingWindow());
     FillRect(dc, &dirtyRect, (HBRUSH)GetStockObject(BLACK_BRUSH));
-    ReleaseDC(windowHandle(), dc);
+    ReleaseDC(containingWindow(), dc);
 #endif
 
-    InvalidateRect(windowHandle(), &dirtyRect, true);
+    InvalidateRect(containingWindow(), &dirtyRect, true);
     if (now)
-        UpdateWindow(windowHandle());
+        UpdateWindow(containingWindow());
 }
 
 int ScrollView::visibleWidth() const
 {
     RECT bounds;
-    GetClientRect(windowHandle(), &bounds);
+    GetClientRect(containingWindow(), &bounds);
     return (bounds.right - bounds.left);
 }
 
 int ScrollView::visibleHeight() const
 {
     RECT bounds;
-    GetClientRect(windowHandle(), &bounds);
+    GetClientRect(containingWindow(), &bounds);
     return (bounds.bottom - bounds.top);
 }
 
 FloatRect ScrollView::visibleContentRect() const
 {
     RECT bounds;
-    GetClientRect(windowHandle(), &bounds);
+    GetClientRect(containingWindow(), &bounds);
     FloatRect contentRect = bounds;
     contentRect.move(m_data->scrollOffset);
     return contentRect;
@@ -142,14 +142,14 @@ int ScrollView::contentsHeight() const
 IntPoint ScrollView::viewportToContents(const IntPoint& contentsPoint)
 {
     POINT point = contentsPoint;
-    MapWindowPoints(GetAncestor(windowHandle(), GA_ROOT), windowHandle(), &point, 1);
+    MapWindowPoints(GetAncestor(containingWindow(), GA_ROOT), containingWindow(), &point, 1);
     return IntPoint(point) + scrollOffset();
 }
 
 IntPoint ScrollView::contentsToViewport(const IntPoint& viewportPoint)
 {
     POINT point = viewportPoint - scrollOffset();
-    MapWindowPoints(windowHandle(), GetAncestor(windowHandle(), GA_ROOT), &point, 1);
+    MapWindowPoints(containingWindow(), GetAncestor(containingWindow(), GA_ROOT), &point, 1);
     return point;
 }
 
@@ -181,9 +181,9 @@ void ScrollView::scrollBy(int dx, int dy)
             return;
         if (!m_data->hasStaticBackground)
             // FIXME: This could be made more efficient by passing a valid clip rect for only the document content.
-            ScrollWindowEx(windowHandle(), -scrollDelta.width(), -scrollDelta.height(), 0, 0, 0, 0, SW_INVALIDATE);
+            ScrollWindowEx(containingWindow(), -scrollDelta.width(), -scrollDelta.height(), 0, 0, 0, 0, SW_INVALIDATE);
         else
-            InvalidateRect(windowHandle(), 0, true);
+            InvalidateRect(containingWindow(), 0, true);
     }
 }
 
@@ -240,8 +240,8 @@ int ScrollView::updateScrollInfo(short type, int current, int max, int pageSize)
     si.nMax   = max;
     si.nPage  = pageSize;
     si.nPos   = current;
-    SetScrollInfo(windowHandle(), type, &si, TRUE);
-    GetScrollInfo(windowHandle(), type, &si);
+    SetScrollInfo(containingWindow(), type, &si, TRUE);
+    GetScrollInfo(containingWindow(), type, &si);
     return si.nPos;
 }
 
@@ -256,9 +256,9 @@ void ScrollView::updateScrollBars()
                 updateScrollInfo(SB_VERT, scroll.height(), contentsHeight() - 1, height()));
 
     if (m_data->hScrollBarMode != ScrollBarAuto || m_data->suppressScrollBars)
-        ShowScrollBar(windowHandle(), SB_HORZ, (m_data->hScrollBarMode != ScrollBarAlwaysOff) && !m_data->suppressScrollBars);
+        ShowScrollBar(containingWindow(), SB_HORZ, (m_data->hScrollBarMode != ScrollBarAlwaysOff) && !m_data->suppressScrollBars);
     if (m_data->vScrollBarMode != ScrollBarAuto || m_data->suppressScrollBars)
-        ShowScrollBar(windowHandle(), SB_VERT, (m_data->vScrollBarMode != ScrollBarAlwaysOff) && !m_data->suppressScrollBars);
+        ShowScrollBar(containingWindow(), SB_VERT, (m_data->vScrollBarMode != ScrollBarAlwaysOff) && !m_data->suppressScrollBars);
 }
 
 }
index 582394e6336a42ffae62a233cd026befe77dca65..72e22a73f12a2a7c696d5202805bf5c0471a6d7c 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "SharedTimer.h"
 
+#include "Page.h"
 #include "SystemTime.h"
 #include "Widget.h"
 #include <wtf/Assertions.h>
@@ -58,12 +59,12 @@ static void initializeOffScreenTimerWindow()
     memset(&wcex, 0, sizeof(WNDCLASSEX));
     wcex.cbSize = sizeof(WNDCLASSEX);
     wcex.lpfnWndProc    = TimerWindowWndProc;
-    wcex.hInstance      = Widget::instanceHandle;
+    wcex.hInstance      = Page::instanceHandle();
     wcex.lpszClassName  = kTimerWindowClassName;
     RegisterClassEx(&wcex);
 
     timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, Widget::instanceHandle, 0);
+       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, Page::instanceHandle(), 0);
     timerFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.TimerFired");
 }
 
index 3bd53af55834aee4bac767f3a64aa21a4c2ad5d0..acbf650dfbf63804ba0d1323e008a2408b193ff6 100644 (file)
@@ -47,6 +47,7 @@
 #include "PlatformScrollBar.h"
 #include "ScrollBar.h"
 #include "JavaAppletWidget.h"
+#include "Page.h"
 #include "Path.h"
 #include "PlatformMouseEvent.h"
 #include "CookieJar.h"
@@ -77,7 +78,6 @@ using namespace WebCore;
 } while (0)
 
 void FrameView::updateBorder() { notImplemented(); }
-bool FrameView::isFrameView() const { notImplemented(); return 0; }
 
 Widget::FocusPolicy PopUpButton::focusPolicy() const { notImplemented(); return NoFocus; }
 void PopUpButton::populate() { notImplemented(); }
@@ -259,6 +259,8 @@ void CheckCacheObjectStatus(DocLoader*, CachedResource*) { }
 
 }
 
+HINSTANCE Page::s_instanceHandle = 0;
+
 void Widget::setEnabled(bool) { }
 void Widget::paint(GraphicsContext*,IntRect const&) { }
 void Widget::setIsSelected(bool) { }
@@ -267,6 +269,7 @@ void ScrollView::addChild(Widget*,int,int) { }
 void ScrollView::removeChild(Widget*) { }
 void ScrollView::scrollPointRecursively(int x, int y) { }
 bool ScrollView::inWindow() const { return true; }
+void ScrollView::paint(GraphicsContext*, const IntRect&) { };
 void ScrollView::wheelEvent(PlatformWheelEvent&) { }
 
 void GraphicsContext::setShadow(IntSize const&,int,Color const&) { }
@@ -282,7 +285,6 @@ void GraphicsContext::setMiterLimit(float) { }
 void GraphicsContext::setAlpha(float) { }
 void GraphicsContext::setCompositeOperation(CompositeOperator) { }
 void GraphicsContext::clip(const Path&) { }
-void GraphicsContext::translate(const FloatSize&) { }
 void GraphicsContext::rotate(float) { }
 void GraphicsContext::scale(const FloatSize&) { }
 
index 5b16aef601ef5014e85221a6ec0e29b4327d821c..3dcb55b445b996dde3ad6cd6916456d12264221b 100644 (file)
 
 namespace WebCore {
 
-HINSTANCE Widget::instanceHandle = 0;
-
 class WidgetPrivate
 {
 public:
-    HWND windowHandle;
+    HWND containingWindow;
     Font font;
     WidgetClient* client;
 };
@@ -48,29 +46,23 @@ public:
 Widget::Widget()
     : data(new WidgetPrivate)
 {
-    data->windowHandle = 0;
+    data->containingWindow = 0;
     data->client = 0;
 }
 
-Widget::Widget(HWND hWnd)
-    : data(new WidgetPrivate)
-{
-    data->windowHandle = hWnd;
-}
-
 Widget::~Widget() 
 {
     delete data;
 }
 
-HWND Widget::windowHandle() const
+HWND Widget::containingWindow() const
 {
-    return data->windowHandle;
+    return data->containingWindow;
 }
 
-void Widget::setWindowHandle(HWND hWnd)
+void Widget::setContainingWindow(HWND hWnd)
 {
-    data->windowHandle = hWnd;
+    data->containingWindow = hWnd;
 }
 
 void Widget::setClient(WidgetClient* c)
@@ -86,9 +78,9 @@ WidgetClient* Widget::client() const
 IntRect Widget::frameGeometry() const
 {
     RECT frame;
-    if (GetWindowRect(data->windowHandle, &frame)) {
-        if (HWND parent = GetParent(data->windowHandle))
-            MapWindowPoints(NULL, parent, (LPPOINT)&frame, 2);
+    if (GetWindowRect(data->containingWindow, &frame)) {
+        if (HWND containingWindow = GetParent(data->containingWindow))
+            MapWindowPoints(NULL, containingWindow, (LPPOINT)&frame, 2);
         return frame;
     }
     
@@ -97,12 +89,12 @@ IntRect Widget::frameGeometry() const
 
 bool Widget::hasFocus() const
 {
-    return (data->windowHandle == GetForegroundWindow());
+    return (data->containingWindow == GetForegroundWindow());
 }
 
 void Widget::setFocus()
 {
-    SetFocus(data->windowHandle);
+    SetFocus(data->containingWindow);
 }
 
 void Widget::clearFocus()
@@ -132,24 +124,17 @@ void Widget::setCursor(const Cursor& cursor)
 
 void Widget::show()
 {
-    ShowWindow(data->windowHandle, SW_SHOWNA);
+    ShowWindow(data->containingWindow, SW_SHOWNA);
 }
 
 void Widget::hide()
 {
-    ShowWindow(data->windowHandle, SW_HIDE);
+    ShowWindow(data->containingWindow, SW_HIDE);
 }
 
 void Widget::setFrameGeometry(const IntRect &rect)
 {
-    MoveWindow(data->windowHandle, rect.x(), rect.y(), rect.width(), rect.height(), false);
-}
-
-IntPoint Widget::mapFromGlobal(const IntPoint &p) const
-{
-    POINT point = p;
-    ScreenToClient(data->windowHandle, &point);
-    return point;
+    MoveWindow(data->containingWindow, rect.x(), rect.y(), rect.width(), rect.height(), false);
 }
 
 }
index de7830e05e3735e20533590ca20f7a45ec8cc3f2..c4e4534fc1bee7bcee6e7897f033d1e7a9eded87 100644 (file)
@@ -133,7 +133,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::initWithName(
     if (FAILED(hr))
         return hr;
 
-    Page* page = new Page(windowHandle);
+    Page* page = new Page();
     Frame* frame = new FrameWin(page, 0, this);
 
     // FIXME: This is one-time initialization, but it gets the value of the setting from the
@@ -151,7 +151,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::initWithName(
     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(windowHandle);
+    d->frameView->setContainingWindow(windowHandle);
 
     return S_OK;
 }