18 template <>
const char* interface_name<PPB_InputEvent_1_0>() {
19 return PPB_INPUT_EVENT_INTERFACE_1_0;
22 template <>
const char* interface_name<PPB_KeyboardInputEvent_1_2>() {
23 return PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_2;
26 template <>
const char* interface_name<PPB_KeyboardInputEvent_1_0>() {
27 return PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0;
30 template <>
const char* interface_name<PPB_MouseInputEvent_1_1>() {
31 return PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1;
34 template <>
const char* interface_name<PPB_WheelInputEvent_1_0>() {
35 return PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0;
38 template <>
const char* interface_name<PPB_TouchInputEvent_1_0>() {
39 return PPB_TOUCH_INPUT_EVENT_INTERFACE_1_0;
42 template <>
const char* interface_name<PPB_IMEInputEvent_1_0>() {
43 return PPB_IME_INPUT_EVENT_INTERFACE_1_0;
55 if (!has_interface<PPB_InputEvent_1_0>())
57 if (get_interface<PPB_InputEvent_1_0>()->IsInputEvent(input_event_resource)) {
67 if (!has_interface<PPB_InputEvent_1_0>())
68 return PP_INPUTEVENT_TYPE_UNDEFINED;
73 if (!has_interface<PPB_InputEvent_1_0>())
79 if (!has_interface<PPB_InputEvent_1_0>())
91 if (!has_interface<PPB_MouseInputEvent_1_1>())
93 if (get_interface<PPB_MouseInputEvent_1_1>()->IsMouseInputEvent(
101 PP_InputEvent_Type type,
102 PP_TimeTicks time_stamp,
104 PP_InputEvent_MouseButton mouse_button,
105 const Point& mouse_position,
107 const Point& mouse_movement) {
109 if (!has_interface<PPB_MouseInputEvent_1_1>())
112 instance.
pp_instance(), type, time_stamp, modifiers, mouse_button,
117 if (!has_interface<PPB_MouseInputEvent_1_1>())
118 return PP_INPUTEVENT_MOUSEBUTTON_NONE;
123 if (!has_interface<PPB_MouseInputEvent_1_1>())
129 if (!has_interface<PPB_MouseInputEvent_1_1>())
135 if (!has_interface<PPB_MouseInputEvent_1_1>())
147 if (!has_interface<PPB_WheelInputEvent_1_0>())
149 if (get_interface<PPB_WheelInputEvent_1_0>()->IsWheelInputEvent(
157 PP_TimeTicks time_stamp,
161 bool scroll_by_page) {
163 if (!has_interface<PPB_WheelInputEvent_1_0>())
168 PP_FromBool(scroll_by_page)));
172 if (!has_interface<PPB_WheelInputEvent_1_0>())
178 if (!has_interface<PPB_WheelInputEvent_1_0>())
184 if (!has_interface<PPB_WheelInputEvent_1_0>())
196 PP_Bool is_keyboard_event = PP_FALSE;
198 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
200 get_interface<PPB_KeyboardInputEvent_1_2>()->IsKeyboardInputEvent(
202 }
else if (has_interface<PPB_KeyboardInputEvent_1_0>()) {
204 get_interface<PPB_KeyboardInputEvent_1_0>()->IsKeyboardInputEvent(
208 if (PP_ToBool(is_keyboard_event)) {
215 PP_InputEvent_Type type,
216 PP_TimeTicks time_stamp,
219 const Var& character_text) {
220 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
222 instance.
pp_instance(), type, time_stamp, modifiers, key_code,
223 character_text.
pp_var(),
Var().pp_var()));
224 }
else if (has_interface<PPB_KeyboardInputEvent_1_0>()) {
226 instance.
pp_instance(), type, time_stamp, modifiers, key_code,
227 character_text.
pp_var()));
232 PP_InputEvent_Type type,
233 PP_TimeTicks time_stamp,
236 const Var& character_text,
238 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
240 instance.
pp_instance(), type, time_stamp, modifiers, key_code,
242 }
else if (has_interface<PPB_KeyboardInputEvent_1_0>()) {
244 instance.
pp_instance(), type, time_stamp, modifiers, key_code,
245 character_text.
pp_var()));
250 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
251 return get_interface<PPB_KeyboardInputEvent_1_2>()->
GetKeyCode(
253 }
else if (has_interface<PPB_KeyboardInputEvent_1_0>()) {
254 return get_interface<PPB_KeyboardInputEvent_1_0>()->
GetKeyCode(
261 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
265 }
else if (has_interface<PPB_KeyboardInputEvent_1_0>()) {
274 if (has_interface<PPB_KeyboardInputEvent_1_2>()) {
276 get_interface<PPB_KeyboardInputEvent_1_2>()->
GetCode(
287 if (!has_interface<PPB_TouchInputEvent_1_0>())
290 if (get_interface<PPB_TouchInputEvent_1_0>()->IsTouchInputEvent(
298 PP_InputEvent_Type type,
299 PP_TimeTicks time_stamp,
300 uint32_t modifiers) {
302 if (!has_interface<PPB_TouchInputEvent_1_0>())
305 instance.
pp_instance(), type, time_stamp, modifiers));
309 PP_TouchPoint point) {
310 if (!has_interface<PPB_TouchInputEvent_1_0>())
317 if (!has_interface<PPB_TouchInputEvent_1_0>())
325 if (!has_interface<PPB_TouchInputEvent_1_0>())
327 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->
332 uint32_t index)
const {
333 if (!has_interface<PPB_TouchInputEvent_1_0>())
335 return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->
345 if (has_interface<PPB_IMEInputEvent_1_0>()) {
346 if (get_interface<PPB_IMEInputEvent_1_0>()->IsIMEInputEvent(
356 PP_InputEvent_Type type,
357 PP_TimeTicks time_stamp,
359 const std::vector<uint32_t>& segment_offsets,
361 const std::pair<uint32_t, uint32_t>& selection) :
InputEvent() {
362 if (!has_interface<PPB_IMEInputEvent_1_0>())
367 segment_offsets.empty() ? 0u :
368 static_cast<uint32_t
>(segment_offsets.size() - 1),
369 segment_offsets.empty() ? &dummy : &segment_offsets[0],
370 target_segment, selection.first, selection.second));
375 if (has_interface<PPB_IMEInputEvent_1_0>()) {
377 get_interface<PPB_IMEInputEvent_1_0>()->
GetText(
384 if (has_interface<PPB_IMEInputEvent_1_0>()) {
392 if (has_interface<PPB_IMEInputEvent_1_0>()) {
400 if (has_interface<PPB_IMEInputEvent_1_0>()) {
408 if (has_interface<PPB_IMEInputEvent_1_0>()) {
void PassRefFromConstructor(PP_Resource resource)
void AddRefResource(PP_Resource resource)
const PP_Point & pp_point() const
A 2 dimensional point with 0,0 being the upper-left starting coordinate.
const PP_FloatPoint & pp_float_point() const
const PP_Var & pp_var() const
PP_Resource pp_resource() const
Wrapper class for PP_TouchPoint.
A generic type used for passing data types between the module and the page.
PP_Instance pp_instance() const
A reference counted module resource.