OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/android/view_client.h" |
| 6 |
| 7 namespace ui { |
| 8 |
| 9 MotionEventData::MotionEventData(float dip_scale, |
| 10 jobject jevent, |
| 11 long time, |
| 12 int action, |
| 13 int pointer_count, |
| 14 int history_size, |
| 15 int action_index, |
| 16 float pos_x0, |
| 17 float pos_y0, |
| 18 float pos_x1, |
| 19 float pos_y1, |
| 20 int pointer_id_0, |
| 21 int pointer_id_1, |
| 22 float touch_major_0, |
| 23 float touch_major_1, |
| 24 float touch_minor_0, |
| 25 float touch_minor_1, |
| 26 float orientation_0, |
| 27 float orientation_1, |
| 28 float tilt_0, |
| 29 float tilt_1, |
| 30 float raw_pos_x, |
| 31 float raw_pos_y, |
| 32 int tool_type_0, |
| 33 int tool_type_1, |
| 34 int button_state, |
| 35 int meta_state, |
| 36 bool is_touch_handle_event) : |
| 37 dip_scale_(dip_scale), |
| 38 jevent_(jevent), |
| 39 time_(time), |
| 40 action_(action), |
| 41 pointer_count_(pointer_count), |
| 42 history_size_(history_size), |
| 43 action_index_(action_index), |
| 44 pos_x0_(pos_x0), |
| 45 pos_y0_(pos_y0), |
| 46 pos_x1_(pos_x1), |
| 47 pos_y1_(pos_y1), |
| 48 pointer_id_0_(pointer_id_0), |
| 49 pointer_id_1_(pointer_id_1), |
| 50 touch_major_0_(touch_major_0), |
| 51 touch_major_1_(touch_major_1), |
| 52 touch_minor_0_(touch_minor_0), |
| 53 touch_minor_1_(touch_minor_1), |
| 54 orientation_0_(orientation_0), |
| 55 orientation_1_(orientation_1), |
| 56 tilt_0_(tilt_0), |
| 57 tilt_1_(tilt_1), |
| 58 raw_pos_x_(raw_pos_x), |
| 59 raw_pos_y_(raw_pos_y), |
| 60 tool_type_0_(tool_type_0), |
| 61 tool_type_1_(tool_type_1), |
| 62 button_state_(button_state), |
| 63 meta_state_(meta_state), |
| 64 is_touch_handle_event_(is_touch_handle_event) {} |
| 65 |
| 66 MotionEventData::MotionEventData(const MotionEventData& other) : |
| 67 dip_scale_(other.dip_scale_), |
| 68 jevent_(other.jevent_), |
| 69 time_(other.time_), |
| 70 action_(other.action_), |
| 71 pointer_count_(other.pointer_count_), |
| 72 history_size_(other.history_size_), |
| 73 action_index_(other.action_index_), |
| 74 pos_x0_(other.pos_x0_), |
| 75 pos_y0_(other.pos_y0_), |
| 76 pos_x1_(other.pos_x1_), |
| 77 pos_y1_(other.pos_y1_), |
| 78 pointer_id_0_(other.pointer_id_0_), |
| 79 pointer_id_1_(other.pointer_id_1_), |
| 80 touch_major_0_(other.touch_major_0_), |
| 81 touch_major_1_(other.touch_major_1_), |
| 82 touch_minor_0_(other.touch_minor_0_), |
| 83 touch_minor_1_(other.touch_minor_1_), |
| 84 orientation_0_(other.orientation_0_), |
| 85 orientation_1_(other.orientation_1_), |
| 86 tilt_0_(other.tilt_0_), |
| 87 tilt_1_(other.tilt_1_), |
| 88 raw_pos_x_(other.raw_pos_x_), |
| 89 raw_pos_y_(other.raw_pos_y_), |
| 90 tool_type_0_(other.tool_type_0_), |
| 91 tool_type_1_(other.tool_type_1_), |
| 92 button_state_(other.button_state_), |
| 93 meta_state_(other.meta_state_), |
| 94 is_touch_handle_event_(other.is_touch_handle_event_) {} |
| 95 |
| 96 MotionEventData MotionEventData::Offset(float delta_x, float delta_y) const { |
| 97 return MotionEventData(dip_scale_, |
| 98 jevent_, |
| 99 time_, |
| 100 action_, |
| 101 pointer_count_, |
| 102 history_size_, |
| 103 action_index_, |
| 104 pos_x0_ + delta_x, |
| 105 pos_y0_ + delta_y, |
| 106 pos_x1_ + delta_x, |
| 107 pos_y1_ + delta_y, |
| 108 pointer_id_0_, |
| 109 pointer_id_1_, |
| 110 touch_major_0_, |
| 111 touch_major_1_, |
| 112 touch_minor_0_, |
| 113 touch_minor_1_, |
| 114 orientation_0_, |
| 115 orientation_1_, |
| 116 tilt_0_, |
| 117 tilt_1_, |
| 118 raw_pos_x_, |
| 119 raw_pos_y_, |
| 120 tool_type_0_, |
| 121 tool_type_1_, |
| 122 button_state_, |
| 123 meta_state_, |
| 124 is_touch_handle_event_); |
| 125 } |
| 126 |
| 127 bool ViewClient::OnTouchEvent(const MotionEventData& event) { return false; } |
| 128 |
| 129 } // namespace ui |
OLD | NEW |