OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // names to their methods will be done by calling bindToJavaScript() (define
d | 252 // names to their methods will be done by calling bindToJavaScript() (define
d |
253 // by CppBoundClass, the parent to EventSender). | 253 // by CppBoundClass, the parent to EventSender). |
254 bindMethod("addTouchPoint", &EventSender::addTouchPoint); | 254 bindMethod("addTouchPoint", &EventSender::addTouchPoint); |
255 bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles); | 255 bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles); |
256 bindMethod("cancelTouchPoint", &EventSender::cancelTouchPoint); | 256 bindMethod("cancelTouchPoint", &EventSender::cancelTouchPoint); |
257 bindMethod("clearKillRing", &EventSender::clearKillRing); | 257 bindMethod("clearKillRing", &EventSender::clearKillRing); |
258 bindMethod("clearTouchPoints", &EventSender::clearTouchPoints); | 258 bindMethod("clearTouchPoints", &EventSender::clearTouchPoints); |
259 bindMethod("contextClick", &EventSender::contextClick); | 259 bindMethod("contextClick", &EventSender::contextClick); |
260 bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy)
; | 260 bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy)
; |
261 bindMethod("dispatchMessage", &EventSender::dispatchMessage); | 261 bindMethod("dispatchMessage", &EventSender::dispatchMessage); |
| 262 bindMethod("dumpFilenameBeingDragged", &EventSender::dumpFilenameBeingDragge
d); |
262 bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging)
; | 263 bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging)
; |
263 bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsTo
Element); | 264 bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsTo
Element); |
264 bindMethod("keyDown", &EventSender::keyDown); | 265 bindMethod("keyDown", &EventSender::keyDown); |
265 bindMethod("leapForward", &EventSender::leapForward); | 266 bindMethod("leapForward", &EventSender::leapForward); |
266 bindMethod("mouseDown", &EventSender::mouseDown); | 267 bindMethod("mouseDown", &EventSender::mouseDown); |
267 bindMethod("mouseMoveTo", &EventSender::mouseMoveTo); | 268 bindMethod("mouseMoveTo", &EventSender::mouseMoveTo); |
268 bindMethod("mouseScrollBy", &EventSender::mouseScrollBy); | 269 bindMethod("mouseScrollBy", &EventSender::mouseScrollBy); |
269 bindMethod("mouseUp", &EventSender::mouseUp); | 270 bindMethod("mouseUp", &EventSender::mouseUp); |
270 bindMethod("releaseTouchPoint", &EventSender::releaseTouchPoint); | 271 bindMethod("releaseTouchPoint", &EventSender::releaseTouchPoint); |
271 bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousCl
ick); | 272 bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousCl
ick); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 WebPoint clientPoint(event.x, event.y); | 338 WebPoint clientPoint(event.x, event.y); |
338 WebPoint screenPoint(event.globalX, event.globalY); | 339 WebPoint screenPoint(event.globalX, event.globalY); |
339 currentDragData = dragData; | 340 currentDragData = dragData; |
340 currentDragEffectsAllowed = mask; | 341 currentDragEffectsAllowed = mask; |
341 currentDragEffect = webview()->dragTargetDragEnter(dragData, clientPoint, sc
reenPoint, currentDragEffectsAllowed); | 342 currentDragEffect = webview()->dragTargetDragEnter(dragData, clientPoint, sc
reenPoint, currentDragEffectsAllowed); |
342 | 343 |
343 // Finish processing events. | 344 // Finish processing events. |
344 replaySavedEvents(); | 345 replaySavedEvents(); |
345 } | 346 } |
346 | 347 |
| 348 void EventSender::dumpFilenameBeingDragged(const CppArgumentList&, CppVariant*) |
| 349 { |
| 350 printf("Filename being dragged: %s\n", currentDragData.fileContentFilename()
.utf8().data()); |
| 351 } |
| 352 |
347 WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode) | 353 WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode) |
348 { | 354 { |
349 if (!buttonCode) | 355 if (!buttonCode) |
350 return WebMouseEvent::ButtonLeft; | 356 return WebMouseEvent::ButtonLeft; |
351 if (buttonCode == 2) | 357 if (buttonCode == 2) |
352 return WebMouseEvent::ButtonRight; | 358 return WebMouseEvent::ButtonRight; |
353 return WebMouseEvent::ButtonMiddle; | 359 return WebMouseEvent::ButtonMiddle; |
354 } | 360 } |
355 | 361 |
356 int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments) | 362 int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments) |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 | 1010 |
1005 void EventSender::fireKeyboardEventsToElement(const CppArgumentList&, CppVariant
* result) | 1011 void EventSender::fireKeyboardEventsToElement(const CppArgumentList&, CppVariant
* result) |
1006 { | 1012 { |
1007 result->setNull(); | 1013 result->setNull(); |
1008 } | 1014 } |
1009 | 1015 |
1010 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) | 1016 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) |
1011 { | 1017 { |
1012 result->setNull(); | 1018 result->setNull(); |
1013 } | 1019 } |
OLD | NEW |