OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 if (event.isAutoRepeat()) | 616 if (event.isAutoRepeat()) |
617 modifiers |= WebInputEvent::IsAutoRepeat; | 617 modifiers |= WebInputEvent::IsAutoRepeat; |
618 if (event.isKeypad()) | 618 if (event.isKeypad()) |
619 modifiers |= WebInputEvent::IsKeyPad; | 619 modifiers |= WebInputEvent::IsKeyPad; |
620 isSystemKey = event.isSystemKey(); | 620 isSystemKey = event.isSystemKey(); |
621 nativeKeyCode = event.nativeVirtualKeyCode(); | 621 nativeKeyCode = event.nativeVirtualKeyCode(); |
622 | 622 |
623 windowsKeyCode = windowsKeyCodeWithoutLocation(event.windowsVirtualKeyCode()
); | 623 windowsKeyCode = windowsKeyCodeWithoutLocation(event.windowsVirtualKeyCode()
); |
624 modifiers |= locationModifiersFromWindowsKeyCode(event.windowsVirtualKeyCode
()); | 624 modifiers |= locationModifiersFromWindowsKeyCode(event.windowsVirtualKeyCode
()); |
625 | 625 |
626 memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textL
engthCap), event.text().length())); | 626 memcpy(text, event.text().characters(), std::min(static_cast<unsigned>(textL
engthCap), event.text().length()) * sizeof(UChar)); |
627 memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_
cast<unsigned>(textLengthCap), event.unmodifiedText().length())); | 627 memcpy(unmodifiedText, event.unmodifiedText().characters(), std::min(static_
cast<unsigned>(textLengthCap), event.unmodifiedText().length()) * sizeof(UChar))
; |
628 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_
cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length())); | 628 memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(static_
cast<unsigned>(keyIdentifierLengthCap), event.keyIdentifier().length())); |
629 } | 629 } |
630 | 630 |
631 static void addTouchPoints(const Widget* widget, const AtomicString& touchType,
TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con
st WebCore::RenderObject* renderObject) | 631 static void addTouchPoints(const Widget* widget, const AtomicString& touchType,
TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, con
st WebCore::RenderObject* renderObject) |
632 { | 632 { |
633 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>
(WebTouchEvent::touchesLengthCap)); | 633 unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>
(WebTouchEvent::touchesLengthCap)); |
634 for (unsigned i = 0; i < numberOfTouches; ++i) { | 634 for (unsigned i = 0; i < numberOfTouches; ++i) { |
635 const Touch* touch = touches->item(i); | 635 const Touch* touch = touches->item(i); |
636 | 636 |
637 WebTouchPoint point; | 637 WebTouchPoint point; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 modifiers = getWebInputModifiers(event); | 693 modifiers = getWebInputModifiers(event); |
694 | 694 |
695 globalX = event.screenX(); | 695 globalX = event.screenX(); |
696 globalY = event.screenY(); | 696 globalY = event.screenY(); |
697 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); | 697 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); |
698 x = localPoint.x(); | 698 x = localPoint.x(); |
699 y = localPoint.y(); | 699 y = localPoint.y(); |
700 } | 700 } |
701 | 701 |
702 } // namespace WebKit | 702 } // namespace WebKit |
OLD | NEW |