Commit 8a2a58fd authored by darin's avatar darin

Reviewed by Eric.

        - removed KWQWindowWidget
        - changed most event handling to use references instead of pointers
        - chagned PageMac to no longer be a subclass of Page

        Yes, I know there's no detail in this ChangeLog entry.
        No, I don't plan to make a habit of doing things this way.
        Yes, this will probably break the Windows build again.

        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/BrowserExtensionMac.mm:
        (WebCore::BrowserExtensionMac::createNewWindow):
        * bridge/mac/FrameViewMac.mm:
        * bridge/mac/MacFrame.h:
        * bridge/mac/MacFrame.mm:
        (WebCore::MacFrame::MacFrame):
        (WebCore::MacFrame::~MacFrame):
        (WebCore::MacFrame::wheelEvent):
        (WebCore::MacFrame::keyEvent):
        (WebCore::MacFrame::khtmlMousePressEvent):
        (WebCore::MacFrame::khtmlMouseMoveEvent):
        (WebCore::MacFrame::khtmlMouseReleaseEvent):
        (WebCore::MacFrame::mouseDown):
        (WebCore::MacFrame::mouseDragged):
        (WebCore::MacFrame::mouseUp):
        (WebCore::MacFrame::mouseMoved):
        (WebCore::MacFrame::sendContextMenuEvent):
        (WebCore::MacFrame::setBridge):
        (WebCore::MacFrame::dragSourceMovedTo):
        (WebCore::MacFrame::dragSourceEndedAt):
        (WebCore::MacFrame::dispatchDragSrcEvent):
        * bridge/mac/PageMac.h: Removed.
        * bridge/mac/PageMac.mm: Added.
        (WebCore::Page::Page):
        (WebCore::Page::windowRect):
        (WebCore::Page::setWindowRect):
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge page]):
        (-[WebCoreFrameBridge initializeSettings:]):
        (globalPoint):
        (createMouseEventFromDraggingInfo):
        (-[WebCoreFrameBridge dragOperationForDraggingInfo:]):
        (-[WebCoreFrameBridge dragExitedWithDraggingInfo:]):
        (-[WebCoreFrameBridge concludeDragForDraggingInfo:]):
        (-[WebCoreFrameBridge dragSourceMovedTo:]):
        (-[WebCoreFrameBridge dragSourceEndedAt:operation:]):
        * bridge/mac/WebCoreFrameNamespaces.mm:
        (WebCore::):
        * bridge/mac/WebCorePageBridge.h:
        * bridge/mac/WebCorePageBridge.mm:
        (-[WebCorePageBridge init]):
        * dom/DocumentImpl.cpp:
        (WebCore::DocumentImpl::prepareMouseEvent):
        (WebCore::DocumentImpl::defaultEventHandler):
        * dom/DocumentImpl.h:
        * dom/NodeImpl.cpp:
        (WebCore::NodeImpl::dispatchMouseEvent):
        (WebCore::NodeImpl::dispatchKeyEvent):
        (WebCore::NodeImpl::dispatchWheelEvent):
        * dom/NodeImpl.h:
        * dom/dom2_eventsimpl.cpp:
        (WebCore::KeyboardEventImpl::KeyboardEventImpl):
        * dom/dom2_eventsimpl.h:
        (WebCore::KeyboardEventImpl::keyEvent):
        * khtml/ecma/kjs_window.cpp:
        (KJS::Window::getValueProperty):
        (KJS::WindowFunc::callAsFunction):
        * khtml/html/html_inlineimpl.cpp:
        (WebCore::HTMLAnchorElementImpl::defaultEventHandler):
        * ksvg2/svg/SVGDocumentImpl.cpp:
        * ksvg2/svg/SVGDocumentImpl.h:
        * kwq/KWQWindowWidget.h:
        * kwq/KWQWindowWidget.mm: Removed.
        * page/Frame.cpp:
        (WebCore::Frame::selectClosestWordFromMouseEvent):
        (WebCore::Frame::handleMousePressEventDoubleClick):
        (WebCore::Frame::handleMousePressEventTripleClick):
        (WebCore::Frame::handleMousePressEventSingleClick):
        (WebCore::Frame::khtmlMousePressEvent):
        (WebCore::Frame::handleMouseMoveEventSelection):
        (WebCore::Frame::khtmlMouseMoveEvent):
        (WebCore::Frame::khtmlMouseReleaseEvent):
        (WebCore::Frame::khtmlMouseDoubleClickEvent):
        (WebCore::Frame::passWidgetMouseDownEventToWidget):
        * page/Frame.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::viewportMousePressEvent):
        (WebCore::FrameView::viewportMouseDoubleClickEvent):
        (WebCore::FrameView::viewportMouseMoveEvent):
        (WebCore::FrameView::viewportMouseReleaseEvent):
        (WebCore::FrameView::dispatchDragEvent):
        (WebCore::FrameView::updateDragAndDrop):
        (WebCore::FrameView::cancelDragAndDrop):
        (WebCore::FrameView::performDragAndDrop):
        (WebCore::FrameView::dispatchMouseEvent):
        (WebCore::FrameView::viewportWheelEvent):
        * page/FrameView.h:
        * page/MouseEventWithHitTestResults.h:
        (WebCore::MouseEventWithHitTestResults::MouseEventWithHitTestResults):
        (WebCore::MouseEventWithHitTestResults::event):
        * page/Page.cpp:
        (WebCore::Page::init):
        * page/Page.h:
        (WebCore::Page::bridge):
        * platform/KeyEvent.h:
        (WebCore::KeyEvent::isAutoRepeat):
        * platform/MouseEvent.h:
        (WebCore::MouseEvent::MouseEvent):
        * platform/mac/KeyEventMac.mm:
        (WebCore::KeyEvent::KeyEvent):
        * platform/win/TemporaryLinkStubs.cpp:
        (FrameView::isFrameView):
        * rendering/render_form.cpp:
        (WebCore::RenderFormElement::clicked):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2776d5a9
2006-03-16 Darin Adler <darin@apple.com>
Reviewed by Eric.
- removed KWQWindowWidget
- changed most event handling to use references instead of pointers
- chagned PageMac to no longer be a subclass of Page
Yes, I know there's no detail in this ChangeLog entry.
No, I don't plan to make a habit of doing things this way.
Yes, this will probably break the Windows build again.
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/BrowserExtensionMac.mm:
(WebCore::BrowserExtensionMac::createNewWindow):
* bridge/mac/FrameViewMac.mm:
* bridge/mac/MacFrame.h:
* bridge/mac/MacFrame.mm:
(WebCore::MacFrame::MacFrame):
(WebCore::MacFrame::~MacFrame):
(WebCore::MacFrame::wheelEvent):
(WebCore::MacFrame::keyEvent):
(WebCore::MacFrame::khtmlMousePressEvent):
(WebCore::MacFrame::khtmlMouseMoveEvent):
(WebCore::MacFrame::khtmlMouseReleaseEvent):
(WebCore::MacFrame::mouseDown):
(WebCore::MacFrame::mouseDragged):
(WebCore::MacFrame::mouseUp):
(WebCore::MacFrame::mouseMoved):
(WebCore::MacFrame::sendContextMenuEvent):
(WebCore::MacFrame::setBridge):
(WebCore::MacFrame::dragSourceMovedTo):
(WebCore::MacFrame::dragSourceEndedAt):
(WebCore::MacFrame::dispatchDragSrcEvent):
* bridge/mac/PageMac.h: Removed.
* bridge/mac/PageMac.mm: Added.
(WebCore::Page::Page):
(WebCore::Page::windowRect):
(WebCore::Page::setWindowRect):
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge page]):
(-[WebCoreFrameBridge initializeSettings:]):
(globalPoint):
(createMouseEventFromDraggingInfo):
(-[WebCoreFrameBridge dragOperationForDraggingInfo:]):
(-[WebCoreFrameBridge dragExitedWithDraggingInfo:]):
(-[WebCoreFrameBridge concludeDragForDraggingInfo:]):
(-[WebCoreFrameBridge dragSourceMovedTo:]):
(-[WebCoreFrameBridge dragSourceEndedAt:operation:]):
* bridge/mac/WebCoreFrameNamespaces.mm:
(WebCore::):
* bridge/mac/WebCorePageBridge.h:
* bridge/mac/WebCorePageBridge.mm:
(-[WebCorePageBridge init]):
* dom/DocumentImpl.cpp:
(WebCore::DocumentImpl::prepareMouseEvent):
(WebCore::DocumentImpl::defaultEventHandler):
* dom/DocumentImpl.h:
* dom/NodeImpl.cpp:
(WebCore::NodeImpl::dispatchMouseEvent):
(WebCore::NodeImpl::dispatchKeyEvent):
(WebCore::NodeImpl::dispatchWheelEvent):
* dom/NodeImpl.h:
* dom/dom2_eventsimpl.cpp:
(WebCore::KeyboardEventImpl::KeyboardEventImpl):
* dom/dom2_eventsimpl.h:
(WebCore::KeyboardEventImpl::keyEvent):
* khtml/ecma/kjs_window.cpp:
(KJS::Window::getValueProperty):
(KJS::WindowFunc::callAsFunction):
* khtml/html/html_inlineimpl.cpp:
(WebCore::HTMLAnchorElementImpl::defaultEventHandler):
* ksvg2/svg/SVGDocumentImpl.cpp:
* ksvg2/svg/SVGDocumentImpl.h:
* kwq/KWQWindowWidget.h:
* kwq/KWQWindowWidget.mm: Removed.
* page/Frame.cpp:
(WebCore::Frame::selectClosestWordFromMouseEvent):
(WebCore::Frame::handleMousePressEventDoubleClick):
(WebCore::Frame::handleMousePressEventTripleClick):
(WebCore::Frame::handleMousePressEventSingleClick):
(WebCore::Frame::khtmlMousePressEvent):
(WebCore::Frame::handleMouseMoveEventSelection):
(WebCore::Frame::khtmlMouseMoveEvent):
(WebCore::Frame::khtmlMouseReleaseEvent):
(WebCore::Frame::khtmlMouseDoubleClickEvent):
(WebCore::Frame::passWidgetMouseDownEventToWidget):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::viewportMousePressEvent):
(WebCore::FrameView::viewportMouseDoubleClickEvent):
(WebCore::FrameView::viewportMouseMoveEvent):
(WebCore::FrameView::viewportMouseReleaseEvent):
(WebCore::FrameView::dispatchDragEvent):
(WebCore::FrameView::updateDragAndDrop):
(WebCore::FrameView::cancelDragAndDrop):
(WebCore::FrameView::performDragAndDrop):
(WebCore::FrameView::dispatchMouseEvent):
(WebCore::FrameView::viewportWheelEvent):
* page/FrameView.h:
* page/MouseEventWithHitTestResults.h:
(WebCore::MouseEventWithHitTestResults::MouseEventWithHitTestResults):
(WebCore::MouseEventWithHitTestResults::event):
* page/Page.cpp:
(WebCore::Page::init):
* page/Page.h:
(WebCore::Page::bridge):
* platform/KeyEvent.h:
(WebCore::KeyEvent::isAutoRepeat):
* platform/MouseEvent.h:
(WebCore::MouseEvent::MouseEvent):
* platform/mac/KeyEventMac.mm:
(WebCore::KeyEvent::KeyEvent):
* platform/win/TemporaryLinkStubs.cpp:
(FrameView::isFrameView):
* rendering/render_form.cpp:
(WebCore::RenderFormElement::clicked):
2006-03-16 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
This diff is collapsed.
......@@ -130,7 +130,7 @@ void BrowserExtensionMac::createNewWindow(const KURL& url,
[bridge setScrollbarsVisible:winArgs.scrollBarsVisible];
[bridge setWindowIsResizable:winArgs.resizable];
NSRect windowFrame = [bridge windowFrame];
NSRect windowFrame = [page windowFrame];
NSSize size = { 1, 1 }; // workaround for 4213314
NSSize scaleRect = [[page outerView] convertSize:size toView:nil];
......@@ -162,7 +162,7 @@ void BrowserExtensionMac::createNewWindow(const KURL& url,
windowFrame.origin.y -= heightDelta;
}
[bridge setWindowFrame:windowFrame];
[page setWindowFrame:windowFrame];
[bridge showWindow];
......
......@@ -28,18 +28,12 @@
#import "DocumentImpl.h"
#import "KWQExceptions.h"
#import "KWQWindowWidget.h"
#import "MacFrame.h"
#import "WebCoreFrameBridge.h"
#import "render_object.h"
namespace WebCore {
Widget* FrameView::topLevelWidget() const
{
return Mac(frame())->topLevelWidget();
}
void FrameView::updateBorder()
{
KWQ_BLOCK_EXCEPTIONS;
......@@ -58,9 +52,4 @@ void FrameView::updateDashboardRegions()
}
}
IntPoint FrameView::viewportToGlobal(const IntPoint &p) const
{
return static_cast<KWQWindowWidget*>(topLevelWidget())->viewportToGlobal(p);
}
}
......@@ -30,6 +30,7 @@
#include "IntRect.h"
#include "KWQClipboard.h"
#include "KWQScrollBar.h"
#include "MouseEvent.h"
#include "NodeImpl.h"
#include "WebCoreKeyboardAccess.h"
#include "text_affinity.h"
......@@ -37,7 +38,6 @@
#import <CoreFoundation/CoreFoundation.h>
class KWQWindowWidget;
class NPObject;
namespace KJS {
......@@ -189,7 +189,7 @@ public:
NSImage *selectionImage() const;
NSImage *snapshotDragImage(NodeImpl *node, NSRect *imageRect, NSRect *elementRect) const;
bool dispatchDragSrcEvent(const AtomicString &eventType, const IntPoint &loc) const;
bool dispatchDragSrcEvent(const AtomicString &eventType, const MouseEvent&) const;
NSFont *fontForSelection(bool *hasMultipleFonts) const;
NSDictionary *fontAttributesForSelectionStart() const;
......@@ -216,8 +216,8 @@ public:
bool dragHysteresisExceeded(float dragLocationX, float dragLocationY) const;
bool eventMayStartDrag(NSEvent *) const;
void dragSourceMovedTo(const IntPoint &loc);
void dragSourceEndedAt(const IntPoint &loc, NSDragOperation operation);
void dragSourceMovedTo(const MouseEvent&);
void dragSourceEndedAt(const MouseEvent&, NSDragOperation);
bool mayCut();
bool mayCopy();
......@@ -241,8 +241,6 @@ public:
bool findString(NSString *str, bool forward, bool caseFlag, bool wrapFlag);
KWQWindowWidget *topLevelWidget();
virtual void tokenizerProcessedData();
virtual QString overrideMediaType() const;
......@@ -317,9 +315,9 @@ protected:
virtual void redirectionTimerFired(Timer<Frame>*);
private:
virtual void khtmlMousePressEvent(MouseEventWithHitTestResults *);
virtual void khtmlMouseMoveEvent(MouseEventWithHitTestResults *);
virtual void khtmlMouseReleaseEvent(MouseEventWithHitTestResults *);
virtual void khtmlMousePressEvent(const MouseEventWithHitTestResults&);
virtual void khtmlMouseMoveEvent(const MouseEventWithHitTestResults&);
virtual void khtmlMouseReleaseEvent(const MouseEventWithHitTestResults&);
NSView *mouseDownViewIfStillGood();
......@@ -343,8 +341,7 @@ private:
bool _sendingEventToSubview;
bool _mouseDownMayStartDrag;
bool _mouseDownMayStartSelect;
// in our window's coords
int _mouseDownWinX, _mouseDownWinY;
MouseEvent m_mouseDown;
// in our view's coords
int _mouseDownX, _mouseDownY;
float _mouseDownTimestamp;
......@@ -355,8 +352,6 @@ private:
NSMutableDictionary *_formValuesAboutToBeSubmitted;
ObjCDOMElement *_formAboutToBeSubmitted;
KWQWindowWidget *_windowWidget;
bool _haveUndoRedoOperations;
HashSet<RefPtr<DOMStringImpl> > urlsBridgeKnowsAbout;
......
This diff is collapsed.
......@@ -18,30 +18,35 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef PAGE_MAC_H
#define PAGE_MAC_H
#import "config.h"
#import "Page.h"
#include "Page.h"
#ifdef __OBJC__
@class WebCorePageBridge;
#else
class WebCorePageBridge;
#endif
#import "Frame.h"
#import "IntRect.h"
#import "WebCorePageBridge.h"
namespace WebCore {
class PageMac : public Page {
public:
PageMac(WebCorePageBridge* b) : m_bridge(b) { }
WebCorePageBridge* bridge() const { return m_bridge; }
private:
WebCorePageBridge* m_bridge;
};
static NSRect flipGlobalRect(NSRect rect)
{
rect.origin.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - NSMaxY(rect);
return rect;
}
Page::Page(WebCorePageBridge* bridge)
: m_frameCount(0), m_bridge(bridge)
{
init();
}
IntRect Page::windowRect() const
{
return enclosingIntRect(flipGlobalRect([bridge() windowFrame]));
}
inline PageMac* Mac(Page* page) { return static_cast<PageMac*>(page); }
inline const PageMac* Mac(const Page* page) { return static_cast<const PageMac*>(page); }
void Page::setWindowRect(const IntRect& r)
{
[bridge() setWindowFrame:flipGlobalRect(r)];
}
} // namespace WebCore
#endif // PAGE_H
}
......@@ -511,10 +511,6 @@ typedef enum {
- (BOOL)areScrollbarsVisible;
- (void)setScrollbarsVisible:(BOOL)visible;
- (NSWindow *)window;
- (void)setWindowFrame:(NSRect)frame;
- (NSRect)windowFrame;
- (void)setWindowContentRect:(NSRect)frame;
- (NSRect)windowContentRect;
- (void)setWindowIsResizable:(BOOL)resizable;
- (BOOL)windowIsResizable;
......
......@@ -48,7 +48,7 @@
#import "TextEncoding.h"
#import "MacFrame.h"
#import "NodeImpl.h"
#import "PageMac.h"
#import "Page.h"
#import "SelectionController.h"
#import "WebCorePageBridge.h"
#import "WebCoreSettings.h"
......@@ -478,12 +478,12 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
- (WebCorePageBridge *)page
{
return Mac(m_frame->page())->bridge();
return m_frame->page()->bridge();
}
- (void)initializeSettings: (WebCoreSettings *)settings
- (void)initializeSettings:(WebCoreSettings *)settings
{
m_frame->setSettings ([settings settings]);
m_frame->setSettings([settings settings]);
}
- (void)dealloc
......@@ -2291,6 +2291,19 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
return m_frame ? m_frame->eventMayStartDrag(event) : NO;
}
static IntPoint globalPoint(NSWindow* window, NSPoint windowPoint)
{
NSPoint screenPoint = [window convertBaseToScreen:windowPoint];
return IntPoint((int)screenPoint.x, (int)(NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - screenPoint.y));
}
static MouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id <NSDraggingInfo> info)
{
// FIXME: Fake modifier keys here.
return MouseEvent(IntPoint([info draggingLocation]), globalPoint(window, [info draggingLocation]),
LeftButton, 0, false, false, false, false);
}
- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info
{
NSDragOperation op = NSDragOperationNone;
......@@ -2302,7 +2315,8 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
NSDragOperation srcOp = [info draggingSourceOperationMask];
clipboard->setSourceOperation(srcOp);
if (v->updateDragAndDrop(IntPoint([info draggingLocation]), clipboard.get())) {
MouseEvent event = createMouseEventFromDraggingInfo([self window], info);
if (v->updateDragAndDrop(event, clipboard.get())) {
// *op unchanged if no source op was set
if (!clipboard->destinationOperation(&op)) {
// The element accepted but they didn't pick an operation, so we pick one for them
......@@ -2338,7 +2352,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
KWQClipboard::AccessPolicy policy = m_frame->baseURL().isLocalFile() ? KWQClipboard::Readable : KWQClipboard::TypesReadable;
RefPtr<KWQClipboard> clipboard = new KWQClipboard(true, [info draggingPasteboard], policy);
clipboard->setSourceOperation([info draggingSourceOperationMask]);
v->cancelDragAndDrop(IntPoint([info draggingLocation]), clipboard.get());
v->cancelDragAndDrop(createMouseEventFromDraggingInfo([self window], info), clipboard.get());
clipboard->setAccessPolicy(KWQClipboard::Numb); // invalidate clipboard here for security
}
}
......@@ -2352,7 +2366,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
// Sending an event can result in the destruction of the view and part.
RefPtr<KWQClipboard> clipboard = new KWQClipboard(true, [info draggingPasteboard], KWQClipboard::Readable);
clipboard->setSourceOperation([info draggingSourceOperationMask]);
BOOL result = v->performDragAndDrop(IntPoint([info draggingLocation]), clipboard.get());
BOOL result = v->performDragAndDrop(createMouseEventFromDraggingInfo([self window], info), clipboard.get());
clipboard->setAccessPolicy(KWQClipboard::Numb); // invalidate clipboard here for security
return result;
}
......@@ -2363,14 +2377,20 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
- (void)dragSourceMovedTo:(NSPoint)windowLoc
{
if (m_frame) {
m_frame->dragSourceMovedTo(IntPoint(windowLoc));
// FIXME: Fake modifier keys here.
MouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
LeftButton, 0, false, false, false, false);
m_frame->dragSourceMovedTo(event);
}
}
- (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation
{
if (m_frame) {
m_frame->dragSourceEndedAt(IntPoint(windowLoc), operation);
// FIXME: Fake modifier keys here.
MouseEvent event(IntPoint(windowLoc), globalPoint([self window], windowLoc),
LeftButton, 0, false, false, false, false);
m_frame->dragSourceEndedAt(event, operation);
}
}
......
......@@ -29,7 +29,7 @@
#import "config.h"
#import "WebCoreFrameNamespaces.h"
#import "PageMac.h"
#import "Page.h"
using namespace WebCore;
......@@ -43,7 +43,7 @@ using namespace WebCore;
NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity:set->size()];
HashSet<Page*>::const_iterator end = set->end();
for (HashSet<Page*>::const_iterator it = set->begin(); it != end; ++it) {
[array addObject:Mac(*it)->bridge()];
[array addObject:(*it)->bridge()];
}
NSEnumerator* enumerator = [array objectEnumerator];
[array release];
......
......@@ -65,6 +65,9 @@ class WebCoreFrameBridge;
- (NSView *)outerView;
- (void)setWindowFrame:(NSRect)frame;
- (NSRect)windowFrame;
@end
// This interface definition allows those who hold a WebCorePageBridge * to call all the methods
......
......@@ -27,7 +27,7 @@
#import "WebCorePageBridge.h"
#import "MacFrame.h"
#import "PageMac.h"
#import "Page.h"
#import "WebCoreFrameBridge.h"
#import "Logging.h"
......@@ -69,7 +69,7 @@ static void initializeLoggingChannelsIfNecessary()
initializeLoggingChannelsIfNecessary();
self = [super init];
if (self)
_page = new PageMac(self);
_page = new Page(self);
return self;
}
......
......@@ -1638,10 +1638,10 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con
}
MouseEventWithHitTestResults DocumentImpl::prepareMouseEvent(bool readonly, bool active, bool mouseMove,
int x, int y, MouseEvent* event)
int x, int y, const MouseEvent& event)
{
if (!renderer())
return MouseEventWithHitTestResults();
return MouseEventWithHitTestResults(event, String(), String(), 0);
assert(renderer()->isCanvas());
RenderObject::NodeInfo renderInfo(readonly, active, mouseMove);
......@@ -2221,7 +2221,7 @@ void DocumentImpl::defaultEventHandler(EventImpl *evt)
if (evt->type() == keydownEvent) {
KeyboardEventImpl* kevt = static_cast<KeyboardEventImpl *>(evt);
if (kevt->ctrlKey()) {
KeyEvent* ev = kevt->keyEvent();
const KeyEvent* ev = kevt->keyEvent();
String key = (ev ? ev->unmodifiedText() : kevt->keyIdentifier()).lower();
ElementImpl* elem = getElementByAccessKey(key);
if (elem) {
......
......@@ -334,7 +334,7 @@ public:
void resetVisitedLinkColor();
void resetActiveLinkColor();
MouseEventWithHitTestResults prepareMouseEvent(bool readonly, bool active, bool mouseMove, int x, int y, MouseEvent*);
MouseEventWithHitTestResults prepareMouseEvent(bool readonly, bool active, bool mouseMove, int x, int y, const MouseEvent&);
virtual bool childAllowed(NodeImpl*);
virtual bool childTypeAllowed(NodeType);
......
......@@ -638,7 +638,7 @@ void NodeImpl::dispatchWindowEvent(const AtomicString &eventType, bool canBubble
}
}
bool NodeImpl::dispatchMouseEvent(MouseEvent* _mouse, const AtomicString& eventType,
bool NodeImpl::dispatchMouseEvent(const MouseEvent& _mouse, const AtomicString& eventType,
int clickCount, NodeImpl* relatedTarget)
{
assert(!eventDispatchForbidden());
......@@ -646,11 +646,11 @@ bool NodeImpl::dispatchMouseEvent(MouseEvent* _mouse, const AtomicString& eventT
int clientX = 0;
int clientY = 0;
if (FrameView *view = getDocument()->view())
view->viewportToContents(_mouse->x(), _mouse->y(), clientX, clientY);
view->viewportToContents(_mouse.x(), _mouse.y(), clientX, clientY);
return dispatchMouseEvent(eventType, _mouse->button(), clickCount,
clientX, clientY, _mouse->globalX(), _mouse->globalY(),
_mouse->ctrlKey(), _mouse->altKey(), _mouse->shiftKey(), _mouse->metaKey(),
return dispatchMouseEvent(eventType, _mouse.button(), clickCount,
clientX, clientY, _mouse.globalX(), _mouse.globalY(),
_mouse.ctrlKey(), _mouse.altKey(), _mouse.shiftKey(), _mouse.metaKey(),
false, relatedTarget);
}
......@@ -796,7 +796,7 @@ bool NodeImpl::dispatchSubtreeModifiedEvent(bool sendChildrenChanged)
true,false,0,DOMString(),DOMString(),DOMString(),0),ec,true);
}
bool NodeImpl::dispatchKeyEvent(KeyEvent* key)
bool NodeImpl::dispatchKeyEvent(const KeyEvent& key)
{
assert(!eventDispatchForbidden());
ExceptionCode ec = 0;
......@@ -812,31 +812,31 @@ bool NodeImpl::dispatchKeyEvent(KeyEvent* key)
return r;
}
void NodeImpl::dispatchWheelEvent(WheelEvent *e)
void NodeImpl::dispatchWheelEvent(WheelEvent& e)
{
assert(!eventDispatchForbidden());
if (e->delta() == 0)
if (e.delta() == 0)
return;
DocumentImpl *doc = getDocument();
DocumentImpl* doc = getDocument();
if (!doc)
return;
FrameView *view = getDocument()->view();
FrameView* view = getDocument()->view();
if (!view)
return;
int x;
int y;
view->viewportToContents(e->x(), e->y(), x, y);
view->viewportToContents(e.x(), e.y(), x, y);
RefPtr<WheelEventImpl> we = new WheelEventImpl(e->isHorizontal(), e->delta(),
getDocument()->defaultView(), e->globalX(), e->globalY(), x, y,
e->ctrlKey(), e->altKey(), e->shiftKey(), e->metaKey());
RefPtr<WheelEventImpl> we = new WheelEventImpl(e.isHorizontal(), e.delta(),
getDocument()->defaultView(), e.globalX(), e.globalY(), x, y,
e.ctrlKey(), e.altKey(), e.shiftKey(), e.metaKey());
ExceptionCode ec = 0;
if (!dispatchEvent(we, ec, true))
e->accept();
e.accept();
}
void NodeImpl::handleLocalEvents(EventImpl *evt, bool useCapture)
......
......@@ -267,7 +267,7 @@ public:
bool dispatchGenericEvent(PassRefPtr<EventImpl>, ExceptionCode&, bool tempEvent = false);
bool dispatchHTMLEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
void dispatchWindowEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
bool dispatchMouseEvent(MouseEvent*, const AtomicString& eventType,
bool dispatchMouseEvent(const MouseEvent&, const AtomicString& eventType,
int clickCount = 0, NodeImpl* relatedTarget = 0);
bool dispatchSimulatedMouseEvent(const AtomicString& eventType);
bool dispatchMouseEvent(const AtomicString& eventType, int button, int clickCount,
......@@ -276,8 +276,8 @@ public:
bool isSimulated = false, NodeImpl* relatedTarget = 0);
bool dispatchUIEvent(const AtomicString& eventType, int detail = 0);
bool dispatchSubtreeModifiedEvent(bool childrenChanged = true);
bool dispatchKeyEvent(KeyEvent*);
void dispatchWheelEvent(WheelEvent*);
bool dispatchKeyEvent(const KeyEvent&);
void dispatchWheelEvent(WheelEvent&);
void handleLocalEvents(EventImpl*, bool useCapture);
......
......@@ -442,12 +442,12 @@ KeyboardEventImpl::KeyboardEventImpl()
{
}
KeyboardEventImpl::KeyboardEventImpl(KeyEvent *key, AbstractViewImpl *view)
: UIEventWithKeyStateImpl(key->isKeyUp() ? keyupEvent : key->isAutoRepeat() ? keypressEvent : keydownEvent,
true, true, view, 0, key->ctrlKey(), key->altKey(), key->shiftKey(), key->metaKey())
, m_keyEvent(new KeyEvent(*key))
, m_keyIdentifier(DOMString(key->keyIdentifier()).impl())
, m_keyLocation(key->isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD)
KeyboardEventImpl::KeyboardEventImpl(const KeyEvent& key, AbstractViewImpl *view)
: UIEventWithKeyStateImpl(key.isKeyUp() ? keyupEvent : key.isAutoRepeat() ? keypressEvent : keydownEvent,
true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
, m_keyEvent(new KeyEvent(key))
, m_keyIdentifier(DOMString(key.keyIdentifier()).impl())
, m_keyLocation(key.isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD)
, m_altGraphKey(false)
{
}
......
......@@ -277,7 +277,7 @@ public:
DOM_KEY_LOCATION_NUMPAD = 0x03,
};
KeyboardEventImpl();
KeyboardEventImpl(KeyEvent*, AbstractViewImpl*);
KeyboardEventImpl(const KeyEvent&, AbstractViewImpl*);
KeyboardEventImpl(const AtomicString &type,
bool canBubbleArg,
bool cancelableArg,
......@@ -308,7 +308,7 @@ public:
bool altGraphKey() const { return m_altGraphKey; }
KeyEvent* keyEvent() const { return m_keyEvent; }
const KeyEvent* keyEvent() const { return m_keyEvent; }
int keyCode() const; // key code for keydown and keyup, character for other events
int charCode() const;