| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 5 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| 6 | 6 |
| 7 #include "ppapi/shared_impl/var.h" | 7 #include "ppapi/shared_impl/var.h" |
| 8 | 8 |
| 9 using ppapi::thunk::PPB_InputEvent_API; | 9 using ppapi::thunk::PPB_InputEvent_API; |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 PP_Bool PPB_InputEvent_Shared::GetWheelScrollByPage() { | 93 PP_Bool PPB_InputEvent_Shared::GetWheelScrollByPage() { |
| 94 return PP_FromBool(data_.wheel_scroll_by_page); | 94 return PP_FromBool(data_.wheel_scroll_by_page); |
| 95 } | 95 } |
| 96 | 96 |
| 97 uint32_t PPB_InputEvent_Shared::GetKeyCode() { | 97 uint32_t PPB_InputEvent_Shared::GetKeyCode() { |
| 98 return data_.key_code; | 98 return data_.key_code; |
| 99 } | 99 } |
| 100 | 100 |
| 101 uint32_t PPB_InputEvent_Shared::GetUsbScanCode_Dev() { |
| 102 return data_.usb_scan_code; |
| 103 } |
| 104 |
| 101 PP_Var PPB_InputEvent_Shared::GetCharacterText() { | 105 PP_Var PPB_InputEvent_Shared::GetCharacterText() { |
| 102 return StringVar::StringToPPVar(data_.character_text); | 106 return StringVar::StringToPPVar(data_.character_text); |
| 103 } | 107 } |
| 104 | 108 |
| 105 uint32_t PPB_InputEvent_Shared::GetIMESegmentNumber() { | 109 uint32_t PPB_InputEvent_Shared::GetIMESegmentNumber() { |
| 106 if (data_.composition_segment_offsets.empty()) | 110 if (data_.composition_segment_offsets.empty()) |
| 107 return 0; | 111 return 0; |
| 108 return data_.composition_segment_offsets.size() - 1; | 112 return data_.composition_segment_offsets.size() - 1; |
| 109 } | 113 } |
| 110 | 114 |
| 111 uint32_t PPB_InputEvent_Shared::GetIMESegmentOffset(uint32_t index) { | 115 uint32_t PPB_InputEvent_Shared::GetIMESegmentOffset(uint32_t index) { |
| 112 if (index >= data_.composition_segment_offsets.size()) | 116 if (index >= data_.composition_segment_offsets.size()) |
| 113 return 0; | 117 return 0; |
| 114 return data_.composition_segment_offsets[index]; | 118 return data_.composition_segment_offsets[index]; |
| 115 } | 119 } |
| 116 | 120 |
| 117 int32_t PPB_InputEvent_Shared::GetIMETargetSegment() { | 121 int32_t PPB_InputEvent_Shared::GetIMETargetSegment() { |
| 118 return data_.composition_target_segment; | 122 return data_.composition_target_segment; |
| 119 } | 123 } |
| 120 | 124 |
| 121 void PPB_InputEvent_Shared::GetIMESelection(uint32_t* start, uint32_t* end) { | 125 void PPB_InputEvent_Shared::GetIMESelection(uint32_t* start, uint32_t* end) { |
| 122 if (start) | 126 if (start) |
| 123 *start = data_.composition_selection_start; | 127 *start = data_.composition_selection_start; |
| 124 if (end) | 128 if (end) |
| 125 *end = data_.composition_selection_end; | 129 *end = data_.composition_selection_end; |
| 126 } | 130 } |
| 127 | 131 |
| 128 } // namespace ppapi | 132 } // namespace ppapi |
| OLD | NEW |