Commit 561154fb authored by eseidel's avatar eseidel

2006-03-17 Eric Seidel <eseidel@apple.com>

        Reviewed by adele.

        Fix win32 build.
        Add PageWin class.
        Add previously forgotten KeyEventWin class.
        Pass MouseEvent() instead of 0 in a couple places to make compiler happy.

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * bridge/win/BrowserExtensionWin.h:
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::urlSelected):
        (WebCore::FrameWin::keyPress):
        * bridge/win/FrameWin.h:
        * bridge/win/PageWin.cpp: Added.
        (WebCore::rootWindowForFrame):
        (WebCore::Page::windowRect):
        (WebCore::Page::setWindowRect):
        * page/FrameView.cpp:
        (WebCore::FrameView::updateDragAndDrop):
        (WebCore::FrameView::hoverTimerFired):
        * page/Page.h:
        (WebCore::Page::mainFrame):
        * platform/win/KeyEventWin.cpp: Added.
        (WebCore::KeyEvent::KeyEvent):
        * platform/win/TemporaryLinkStubs.cpp:
        (WebCore::findNextWordFromIndex):
        (FrameWin::passMouseDownEventToWidget):
        (FrameWin::scheduleClose):
        (BrowserExtensionWin::createNewWindow):
        (WebCore::findWordBoundary):
        (FrameWin::registerCommandForUndo):
        (FrameWin::markMisspellingsInAdjacentWords):
        (FrameWin::respondToChangedContents):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a5e443c
2006-03-17 Eric Seidel <eseidel@apple.com>
Reviewed by adele.
Fix win32 build.
Add PageWin class.
Add previously forgotten KeyEventWin class.
Pass MouseEvent() instead of 0 in a couple places to make compiler happy.
* WebCore.vcproj/WebCore/WebCore.vcproj:
* bridge/win/BrowserExtensionWin.h:
* bridge/win/FrameWin.cpp:
(WebCore::FrameWin::urlSelected):
(WebCore::FrameWin::keyPress):
* bridge/win/FrameWin.h:
* bridge/win/PageWin.cpp: Added.
(WebCore::rootWindowForFrame):
(WebCore::Page::windowRect):
(WebCore::Page::setWindowRect):
* page/FrameView.cpp:
(WebCore::FrameView::updateDragAndDrop):
(WebCore::FrameView::hoverTimerFired):
* page/Page.h:
(WebCore::Page::mainFrame):
* platform/win/KeyEventWin.cpp: Added.
(WebCore::KeyEvent::KeyEvent):
* platform/win/TemporaryLinkStubs.cpp:
(WebCore::findNextWordFromIndex):
(FrameWin::passMouseDownEventToWidget):
(FrameWin::scheduleClose):
(BrowserExtensionWin::createNewWindow):
(WebCore::findWordBoundary):
(FrameWin::registerCommandForUndo):
(FrameWin::markMisspellingsInAdjacentWords):
(FrameWin::respondToChangedContents):
2006-03-17 David Hyatt <hyatt@apple.com>
Fix pixel test regression in fast/table/overflowHidden.html. There was
......@@ -2453,6 +2453,10 @@
RelativePath="..\..\bridge\win\FrameWin.h"
>
</File>
<File
RelativePath="..\..\bridge\win\PageWin.cpp"
>
</File>
</Filter>
</Filter>
<Filter
......
......@@ -35,13 +35,13 @@ public:
BrowserExtensionWin(Frame*);
virtual void openURLRequest(const KURL &,
const URLArgs &args = URLArgs());
const ResourceRequest &args = ResourceRequest());
virtual void openURLNotify();
virtual void createNewWindow(const KURL &url,
const URLArgs &urlArgs = URLArgs());
const ResourceRequest &ResourceRequest = ResourceRequest());
virtual void createNewWindow(const KURL& url,
const URLArgs& urlArgs,
const ResourceRequest& ResourceRequest,
const WindowArgs& winArgs,
Frame*& part);
......
......@@ -58,7 +58,7 @@ FrameWin::~FrameWin()
{
}
void FrameWin::urlSelected(const KURL& url, const URLArgs&)
void FrameWin::urlSelected(const KURL& url, const ResourceRequest&)
{
if (m_client)
m_client->openURL(url.url());
......@@ -88,7 +88,7 @@ bool FrameWin::runJavaScriptConfirm(String const& message)
}
// FIXME: This needs to be unified with the keyPress method on MacFrame
bool FrameWin::keyPress(KeyEvent* keyEvent)
bool FrameWin::keyPress(const KeyEvent& keyEvent)
{
bool result;
// Check for cases where we are too early for events -- possible unmatched key up
......@@ -106,7 +106,7 @@ bool FrameWin::keyPress(KeyEvent* keyEvent)
return false;
}
if (!keyEvent->isKeyUp())
if (!keyEvent.isKeyUp())
prepareForUserAction();
result = !node->dispatchKeyEvent(keyEvent);
......
......@@ -43,9 +43,9 @@ public:
~FrameWin();
virtual bool openURL(const KURL&);
virtual void openURLRequest(const KURL&, const URLArgs&);
virtual void submitForm(const KURL&, const URLArgs&);
virtual void urlSelected(const KURL&, const URLArgs&);
virtual void openURLRequest(const KURL&, const ResourceRequest&);
virtual void submitForm(const KURL&, const ResourceRequest&);
virtual void urlSelected(const KURL&, const ResourceRequest&);
virtual void setTitle(const String&);
......@@ -119,7 +119,7 @@ public:
virtual bool canUndo() const;
virtual void print();
bool keyPress(KeyEvent*);
bool keyPress(const KeyEvent&);
private:
virtual bool passMouseDownEventToWidget(Widget*);
......
/*
* 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 "Page.h"
#include "Frame.h"
#include "FrameView.h"
#include "IntRect.h"
#include <windows.h>
namespace WebCore {
static HWND rootWindowForFrame(const Frame* frame)
{
if (!frame)
return 0;
FrameView* frameView = frame->view();
if (!frameView)
return 0;
HWND frameWnd = frameView->windowHandle();
if (!frameWnd)
return 0;
return GetAncestor(frameWnd, GA_ROOT);
}
IntRect Page::windowRect() const
{
HWND windowHandle = rootWindowForFrame(mainFrame());
if (!windowHandle)
return IntRect();
RECT rect;
GetWindowRect(windowHandle, &rect);
return rect;
}
void Page::setWindowRect(const IntRect& r)
{
HWND windowHandle = rootWindowForFrame(mainFrame());
if (!windowHandle)
return;
MoveWindow(windowHandle, r.x(), r.y(), r.width(), r.height(), true);
}
}
......@@ -687,7 +687,7 @@ bool FrameView::updateDragAndDrop(const MouseEvent& event, ClipboardImpl* clipbo
bool accept = false;
int xm, ym;
viewportToContents(event.x(), event.y(), xm, ym);
MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(true, false, false, xm, ym, 0);
MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(true, false, false, xm, ym, MouseEvent());
// Drag events should never go to text nodes (following IE, and proper mouseover/out dispatch)
NodeImpl* newTarget = mev.innerNode();
......@@ -1051,7 +1051,7 @@ void FrameView::layoutTimerFired(Timer<FrameView>*)
void FrameView::hoverTimerFired(Timer<FrameView>*)
{
d->hoverTimer.stop();
m_frame->document()->prepareMouseEvent(false, false, true, d->prevMouseX, d->prevMouseY, 0);
m_frame->document()->prepareMouseEvent(false, false, true, d->prevMouseX, d->prevMouseY, MouseEvent());
}
void FrameView::scheduleRelayout()
......
......@@ -46,7 +46,7 @@ namespace WebCore {
~Page();
void setMainFrame(PassRefPtr<Frame> mainFrame);
Frame* mainFrame() { return m_mainFrame.get(); }
Frame* mainFrame() const { return m_mainFrame.get(); }
IntRect windowRect() const;
void setWindowRect(const IntRect&);
......
/*
* 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 "KeyEvent.h"
#include <windows.h>
#define REPEAT_COUNT_MASK 0x0000FFFF
#define NEW_DOWN_STATE_MASK 0x80000000
#define PREVIOUS_DOWN_STATE_MASK 0x40000000
#define ALT_KEY_DOWN_MASK 0x20000000
#define HIGH_BIT_MASK_SHORT 0x8000
namespace WebCore {
KeyEvent::KeyEvent(HWND hWnd, WPARAM wParam, LPARAM lParam)
: m_text(QChar(wParam))
, m_unmodifiedText(QChar(wParam))
, m_keyIdentifier(QString().sprintf("U+%06X", toupper(wParam)))
, m_isKeyUp(!(lParam & NEW_DOWN_STATE_MASK))
, m_autoRepeat(lParam & REPEAT_COUNT_MASK)
, m_WindowsKeyCode(wParam)
, m_isKeypad(false) // FIXME
, m_shiftKey(GetAsyncKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT)
, m_ctrlKey(GetAsyncKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT)
, m_altKey(lParam & ALT_KEY_DOWN_MASK)
, m_metaKey(lParam & ALT_KEY_DOWN_MASK) // FIXME: Is this right?
{
if (!m_shiftKey)
m_text = String(QChar(tolower(wParam)));
}
}
......@@ -40,7 +40,6 @@ using namespace WebCore;
static void notImplemented() { puts("Not yet implemented"); _CrtDbgBreak(); }
IntPoint FrameView::viewportToGlobal(IntPoint const&) const { notImplemented(); return IntPoint(); }
void FrameView::updateBorder() { notImplemented(); }
bool FrameView::isFrameView() const { notImplemented(); return 0; }
......@@ -139,11 +138,9 @@ String WebCore::searchableIndexIntroduction() { notImplemented(); return String(
int WebCore::findNextSentenceFromIndex(QChar const*,int,int,bool) { notImplemented(); return 0; }
void WebCore::findSentenceBoundary(QChar const*,int,int,int*,int*) { notImplemented(); }
int WebCore::findNextWordFromIndex(QChar const*,int,int,bool) { notImplemented(); return 0; }
void WebCore::findWordBoundary(QChar const*,int,int,int*,int*) { notImplemented(); }
Array<char> KWQServeSynchronousRequest(Loader*,DocLoader*,TransferJob*,KURL&,QString&) { notImplemented(); return 0; }
void FrameWin::respondToChangedContents() { notImplemented(); }
void FrameWin::unfocusWindow() { notImplemented(); }
bool FrameWin::locationbarVisible() { notImplemented(); return 0; }
void FrameWin::issueRedoCommand(void) { notImplemented(); }
......@@ -157,16 +154,14 @@ bool FrameWin::openURL(KURL const&) { notImplemented(); return 0; }
void FrameWin::print() { notImplemented(); }
KJS::Bindings::Instance* FrameWin::getAppletInstanceForWidget(Widget*) { notImplemented(); return 0; }
bool FrameWin::passMouseDownEventToWidget(Widget*) { notImplemented(); return 0; }
void FrameWin::registerCommandForUndo(WebCore::EditCommandPtr const&) { notImplemented(); }
void FrameWin::issueCutCommand() { notImplemented(); }
void FrameWin::issueCopyCommand() { notImplemented(); }
void FrameWin::openURLRequest(KURL const&,struct WebCore::URLArgs const&) { notImplemented(); }
void FrameWin::openURLRequest(KURL const&,struct WebCore::ResourceRequest const&) { notImplemented(); }
bool FrameWin::passWheelEventToChildWidget(NodeImpl*) { notImplemented(); return 0; }
void FrameWin::issueUndoCommand() { notImplemented(); }
QString FrameWin::mimeTypeForFileName(QString const&) const { notImplemented(); return QString(); }
void FrameWin::issuePasteCommand() { notImplemented(); }
void FrameWin::scheduleClose() { notImplemented(); }
void FrameWin::markMisspellingsInAdjacentWords(WebCore::VisiblePosition const&) { notImplemented(); }
void FrameWin::markMisspellings(WebCore::SelectionController const&) { notImplemented(); }
bool FrameWin::menubarVisible() { notImplemented(); return 0; }
bool FrameWin::personalbarVisible() { notImplemented(); return 0; }
......@@ -179,14 +174,14 @@ bool FrameWin::canGoBackOrForward(int) const { notImplemented(); return 0; }
void FrameWin::issuePasteAndMatchStyleCommand() { notImplemented(); }
Plugin* FrameWin::createPlugin(KURL const&,QStringList const&,QStringList const&,QString const&) { notImplemented(); return 0; }
void BrowserExtensionWin::openURLRequest(KURL const&,struct WebCore::URLArgs const&) { notImplemented(); }
void BrowserExtensionWin::openURLRequest(KURL const&,struct WebCore::ResourceRequest const&) { notImplemented(); }
bool BrowserExtensionWin::canRunModal() { notImplemented(); return 0; }
void BrowserExtensionWin::openURLNotify() { notImplemented(); }
void BrowserExtensionWin::createNewWindow(KURL const&,struct WebCore::URLArgs const&,struct WebCore::WindowArgs const&,Frame*&) { notImplemented(); }
void BrowserExtensionWin::createNewWindow(KURL const&,struct WebCore::ResourceRequest const&,struct WebCore::WindowArgs const&,Frame*&) { notImplemented(); }
bool BrowserExtensionWin::canRunModalNow() { notImplemented(); return 0; }
void BrowserExtensionWin::runModal() { notImplemented(); }
void BrowserExtensionWin::goBackOrForward(int) { notImplemented(); }
void BrowserExtensionWin::createNewWindow(KURL const&,struct WebCore::URLArgs const&) { notImplemented(); }
void BrowserExtensionWin::createNewWindow(KURL const&,struct WebCore::ResourceRequest const&) { notImplemented(); }
void RenderCanvasImage::setNeedsImageUpdate() { notImplemented(); }
......@@ -203,6 +198,8 @@ String WebCore::inputElementAltText() { return QString(); }
String WebCore::resetButtonDefaultLabel() { return "Reset"; }
String WebCore::defaultLanguage() { return "en"; }
void WebCore::findWordBoundary(QChar const* str,int len,int position,int* start, int* end) {*start=position; *end=position; }
void WebCore::setCookies(KURL const&,KURL const&,String const&) { }
String WebCore::cookies(KURL const&) { return String(); }
bool WebCore::cookiesEnabled() { return false; }
......@@ -229,11 +226,14 @@ void FrameWin::respondToChangedSelection(WebCore::SelectionController const&,boo
static int frameNumber = 0;
Frame* FrameWin::createFrame(KURL const&,QString const&,RenderPart*,String const&) { return 0; }
void FrameWin::saveDocumentState(void) { }
void FrameWin::registerCommandForUndo(WebCore::EditCommandPtr const&) { }
void FrameWin::clearUndoRedoOperations(void) { }
QString FrameWin::incomingReferrer() const { return QString(); }
void FrameWin::clearRecordedFormValues() { }
void FrameWin::recordFormValue(QString const&,QString const&,WebCore::HTMLFormElementImpl*) { }
void FrameWin::submitForm(KURL const&,struct WebCore::URLArgs const&) { }
void FrameWin::submitForm(KURL const&,struct WebCore::ResourceRequest const&) { }
void FrameWin::markMisspellingsInAdjacentWords(WebCore::VisiblePosition const&) { }
void FrameWin::respondToChangedContents() { }
BrowserExtensionWin::BrowserExtensionWin(WebCore::Frame*) { }
void BrowserExtensionWin::setTypedIconURL(KURL const&,QString const&) { }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment