| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // like Valgrind will complain about uninitialized memory usage when | 52 // like Valgrind will complain about uninitialized memory usage when |
| 53 // transferring these classes over the wire. | 53 // transferring these classes over the wire. |
| 54 | 54 |
| 55 #pragma pack(push, 4) | 55 #pragma pack(push, 4) |
| 56 | 56 |
| 57 // WebInputEvent -------------------------------------------------------------- | 57 // WebInputEvent -------------------------------------------------------------- |
| 58 | 58 |
| 59 class WebInputEvent { | 59 class WebInputEvent { |
| 60 public: | 60 public: |
| 61 WebInputEvent(unsigned sizeParam = sizeof(WebInputEvent)) | 61 WebInputEvent(unsigned sizeParam = sizeof(WebInputEvent)) |
| 62 : timeStampSeconds(0.0) | 62 { |
| 63 , size(sizeParam) | 63 memset(this, 0, sizeParam); |
| 64 , type(Undefined) | 64 timeStampSeconds = 0.0; |
| 65 , modifiers(0) { } | 65 size = sizeParam; |
| 66 type = Undefined; |
| 67 modifiers = 0; |
| 68 } |
| 66 | 69 |
| 67 // When we use an input method (or an input method editor), we receive | 70 // When we use an input method (or an input method editor), we receive |
| 68 // two events for a keypress. The former event is a keydown, which | 71 // two events for a keypress. The former event is a keydown, which |
| 69 // provides a keycode, and the latter is a textinput, which provides | 72 // provides a keycode, and the latter is a textinput, which provides |
| 70 // a character processed by an input method. (The mapping from a | 73 // a character processed by an input method. (The mapping from a |
| 71 // keycode to a character code is not trivial for non-English | 74 // keycode to a character code is not trivial for non-English |
| 72 // keyboards.) | 75 // keyboards.) |
| 73 // To support input methods, Safari sends keydown events to WebKit for | 76 // To support input methods, Safari sends keydown events to WebKit for |
| 74 // filtering. WebKit sends filtered keydown events back to Safari, | 77 // filtering. WebKit sends filtered keydown events back to Safari, |
| 75 // which sends them to input methods. | 78 // which sends them to input methods. |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 , targetTouchesLength(0) | 481 , targetTouchesLength(0) |
| 479 { | 482 { |
| 480 } | 483 } |
| 481 }; | 484 }; |
| 482 | 485 |
| 483 #pragma pack(pop) | 486 #pragma pack(pop) |
| 484 | 487 |
| 485 } // namespace WebKit | 488 } // namespace WebKit |
| 486 | 489 |
| 487 #endif | 490 #endif |
| OLD | NEW |