Lines Matching refs:common

26 static common::Source getSource(uint32_t source) {  in getSource()
27 static_assert(static_cast<common::Source>(AINPUT_SOURCE_UNKNOWN) == common::Source::UNKNOWN, in getSource()
29 static_assert(static_cast<common::Source>(AINPUT_SOURCE_KEYBOARD) == common::Source::KEYBOARD, in getSource()
31 static_assert(static_cast<common::Source>(AINPUT_SOURCE_DPAD) == common::Source::DPAD, in getSource()
33 static_assert(static_cast<common::Source>(AINPUT_SOURCE_GAMEPAD) == common::Source::GAMEPAD, in getSource()
35 static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCHSCREEN) == in getSource()
36 common::Source::TOUCHSCREEN, in getSource()
38 static_assert(static_cast<common::Source>(AINPUT_SOURCE_MOUSE) == common::Source::MOUSE, in getSource()
40 static_assert(static_cast<common::Source>(AINPUT_SOURCE_STYLUS) == common::Source::STYLUS, in getSource()
42 static_assert(static_cast<common::Source>(AINPUT_SOURCE_BLUETOOTH_STYLUS) == in getSource()
43 common::Source::BLUETOOTH_STYLUS, in getSource()
45 static_assert(static_cast<common::Source>(AINPUT_SOURCE_TRACKBALL) == common::Source::TRACKBALL, in getSource()
47 static_assert(static_cast<common::Source>(AINPUT_SOURCE_MOUSE_RELATIVE) == in getSource()
48 common::Source::MOUSE_RELATIVE, in getSource()
50 static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCHPAD) == common::Source::TOUCHPAD, in getSource()
52 static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCH_NAVIGATION) == in getSource()
53 common::Source::TOUCH_NAVIGATION, in getSource()
55 static_assert(static_cast<common::Source>(AINPUT_SOURCE_JOYSTICK) == common::Source::JOYSTICK, in getSource()
57 static_assert(static_cast<common::Source>(AINPUT_SOURCE_ROTARY_ENCODER) == in getSource()
58 common::Source::ROTARY_ENCODER, in getSource()
60 static_assert(static_cast<common::Source>(AINPUT_SOURCE_HDMI) == common::Source::HDMI); in getSource()
61 static_assert(static_cast<common::Source>(AINPUT_SOURCE_SENSOR) == common::Source::SENSOR); in getSource()
62 static_assert(static_cast<common::Source>(AINPUT_SOURCE_ANY) == common::Source::ANY, in getSource()
64 return static_cast<common::Source>(source); in getSource()
67 static common::Action getAction(int32_t actionMasked) { in getAction()
68 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_DOWN) == common::Action::DOWN, in getAction()
70 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_UP) == common::Action::UP, in getAction()
72 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_MOVE) == common::Action::MOVE, in getAction()
74 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_CANCEL) == in getAction()
75 common::Action::CANCEL, in getAction()
77 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_OUTSIDE) == in getAction()
78 common::Action::OUTSIDE, in getAction()
80 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_POINTER_DOWN) == in getAction()
81 common::Action::POINTER_DOWN, in getAction()
83 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_POINTER_UP) == in getAction()
84 common::Action::POINTER_UP, in getAction()
86 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_MOVE) == in getAction()
87 common::Action::HOVER_MOVE, in getAction()
89 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_SCROLL) == in getAction()
90 common::Action::SCROLL, in getAction()
92 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_ENTER) == in getAction()
93 common::Action::HOVER_ENTER, in getAction()
95 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_EXIT) == in getAction()
96 common::Action::HOVER_EXIT, in getAction()
98 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_BUTTON_PRESS) == in getAction()
99 common::Action::BUTTON_PRESS, in getAction()
101 static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_BUTTON_RELEASE) == in getAction()
102 common::Action::BUTTON_RELEASE, in getAction()
104 return static_cast<common::Action>(actionMasked); in getAction()
107 static common::Button getActionButton(int32_t actionButton) { in getActionButton()
108 static_assert(static_cast<common::Button>(0) == common::Button::NONE, "BUTTON_NONE mismatch"); in getActionButton()
109 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_PRIMARY) == in getActionButton()
110 common::Button::PRIMARY, in getActionButton()
112 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_SECONDARY) == in getActionButton()
113 common::Button::SECONDARY, in getActionButton()
115 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_TERTIARY) == in getActionButton()
116 common::Button::TERTIARY, in getActionButton()
118 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_BACK) == common::Button::BACK, in getActionButton()
120 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_FORWARD) == in getActionButton()
121 common::Button::FORWARD, in getActionButton()
123 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_STYLUS_PRIMARY) == in getActionButton()
124 common::Button::STYLUS_PRIMARY, in getActionButton()
126 static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_STYLUS_SECONDARY) == in getActionButton()
127 common::Button::STYLUS_SECONDARY, in getActionButton()
129 return static_cast<common::Button>(actionButton); in getActionButton()
132 static common::Flag getFlags(int32_t flags) { in getFlags()
133 static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED) == in getFlags()
134 common::Flag::WINDOW_IS_OBSCURED); in getFlags()
135 static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_IS_GENERATED_GESTURE) == in getFlags()
136 common::Flag::IS_GENERATED_GESTURE); in getFlags()
137 static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_TAINTED) == common::Flag::TAINTED); in getFlags()
138 return static_cast<common::Flag>(flags); in getFlags()
141 static common::PolicyFlag getPolicyFlags(int32_t flags) { in getPolicyFlags()
142 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_WAKE) == common::PolicyFlag::WAKE); in getPolicyFlags()
143 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_VIRTUAL) == in getPolicyFlags()
144 common::PolicyFlag::VIRTUAL); in getPolicyFlags()
145 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_FUNCTION) == in getPolicyFlags()
146 common::PolicyFlag::FUNCTION); in getPolicyFlags()
147 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_GESTURE) == in getPolicyFlags()
148 common::PolicyFlag::GESTURE); in getPolicyFlags()
149 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_INJECTED) == in getPolicyFlags()
150 common::PolicyFlag::INJECTED); in getPolicyFlags()
151 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_TRUSTED) == in getPolicyFlags()
152 common::PolicyFlag::TRUSTED); in getPolicyFlags()
153 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_FILTERED) == in getPolicyFlags()
154 common::PolicyFlag::FILTERED); in getPolicyFlags()
155 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_DISABLE_KEY_REPEAT) == in getPolicyFlags()
156 common::PolicyFlag::DISABLE_KEY_REPEAT); in getPolicyFlags()
157 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_INTERACTIVE) == in getPolicyFlags()
158 common::PolicyFlag::INTERACTIVE); in getPolicyFlags()
159 static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_PASS_TO_USER) == in getPolicyFlags()
160 common::PolicyFlag::PASS_TO_USER); in getPolicyFlags()
161 return static_cast<common::PolicyFlag>(flags); in getPolicyFlags()
164 static common::EdgeFlag getEdgeFlags(int32_t flags) { in getEdgeFlags()
165 static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_NONE) == in getEdgeFlags()
166 common::EdgeFlag::NONE); in getEdgeFlags()
167 static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_TOP) == in getEdgeFlags()
168 common::EdgeFlag::TOP); in getEdgeFlags()
169 static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_BOTTOM) == in getEdgeFlags()
170 common::EdgeFlag::BOTTOM); in getEdgeFlags()
171 static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_LEFT) == in getEdgeFlags()
172 common::EdgeFlag::LEFT); in getEdgeFlags()
173 static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_RIGHT) == in getEdgeFlags()
174 common::EdgeFlag::RIGHT); in getEdgeFlags()
175 return static_cast<common::EdgeFlag>(flags); in getEdgeFlags()
178 static common::Meta getMetastate(int32_t state) { in getMetastate()
179 static_assert(static_cast<common::Meta>(AMETA_NONE) == common::Meta::NONE); in getMetastate()
180 static_assert(static_cast<common::Meta>(AMETA_ALT_ON) == common::Meta::ALT_ON); in getMetastate()
181 static_assert(static_cast<common::Meta>(AMETA_ALT_LEFT_ON) == common::Meta::ALT_LEFT_ON); in getMetastate()
182 static_assert(static_cast<common::Meta>(AMETA_ALT_RIGHT_ON) == common::Meta::ALT_RIGHT_ON); in getMetastate()
183 static_assert(static_cast<common::Meta>(AMETA_SHIFT_ON) == common::Meta::SHIFT_ON); in getMetastate()
184 static_assert(static_cast<common::Meta>(AMETA_SHIFT_LEFT_ON) == common::Meta::SHIFT_LEFT_ON); in getMetastate()
185 static_assert(static_cast<common::Meta>(AMETA_SHIFT_RIGHT_ON) == common::Meta::SHIFT_RIGHT_ON); in getMetastate()
186 static_assert(static_cast<common::Meta>(AMETA_SYM_ON) == common::Meta::SYM_ON); in getMetastate()
187 static_assert(static_cast<common::Meta>(AMETA_FUNCTION_ON) == common::Meta::FUNCTION_ON); in getMetastate()
188 static_assert(static_cast<common::Meta>(AMETA_CTRL_ON) == common::Meta::CTRL_ON); in getMetastate()
189 static_assert(static_cast<common::Meta>(AMETA_CTRL_LEFT_ON) == common::Meta::CTRL_LEFT_ON); in getMetastate()
190 static_assert(static_cast<common::Meta>(AMETA_CTRL_RIGHT_ON) == common::Meta::CTRL_RIGHT_ON); in getMetastate()
191 static_assert(static_cast<common::Meta>(AMETA_META_ON) == common::Meta::META_ON); in getMetastate()
192 static_assert(static_cast<common::Meta>(AMETA_META_LEFT_ON) == common::Meta::META_LEFT_ON); in getMetastate()
193 static_assert(static_cast<common::Meta>(AMETA_META_RIGHT_ON) == common::Meta::META_RIGHT_ON); in getMetastate()
194 static_assert(static_cast<common::Meta>(AMETA_CAPS_LOCK_ON) == common::Meta::CAPS_LOCK_ON); in getMetastate()
195 static_assert(static_cast<common::Meta>(AMETA_NUM_LOCK_ON) == common::Meta::NUM_LOCK_ON); in getMetastate()
196 static_assert(static_cast<common::Meta>(AMETA_SCROLL_LOCK_ON) == common::Meta::SCROLL_LOCK_ON); in getMetastate()
197 return static_cast<common::Meta>(state); in getMetastate()
200 static common::Button getButtonState(int32_t buttonState) { in getButtonState()
203 return static_cast<common::Button>(buttonState); in getButtonState()
206 static common::ToolType getToolType(ToolType toolType) { in getToolType()
207 static_assert(static_cast<common::ToolType>(ToolType::UNKNOWN) == common::ToolType::UNKNOWN); in getToolType()
208 static_assert(static_cast<common::ToolType>(ToolType::FINGER) == common::ToolType::FINGER); in getToolType()
209 static_assert(static_cast<common::ToolType>(ToolType::STYLUS) == common::ToolType::STYLUS); in getToolType()
210 static_assert(static_cast<common::ToolType>(ToolType::MOUSE) == common::ToolType::MOUSE); in getToolType()
211 static_assert(static_cast<common::ToolType>(ToolType::ERASER) == common::ToolType::ERASER); in getToolType()
212 return static_cast<common::ToolType>(toolType); in getToolType()
216 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_X) == common::Axis::X);
217 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_Y) == common::Axis::Y);
218 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_PRESSURE) == common::Axis::PRESSURE);
219 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_SIZE) == common::Axis::SIZE);
220 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOUCH_MAJOR) ==
221 common::Axis::TOUCH_MAJOR);
222 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOUCH_MINOR) ==
223 common::Axis::TOUCH_MINOR);
224 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOOL_MAJOR) == common::Axis::TOOL_MAJOR);
225 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOOL_MINOR) == common::Axis::TOOL_MINOR);
226 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_ORIENTATION) ==
227 common::Axis::ORIENTATION);
228 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_VSCROLL) == common::Axis::VSCROLL);
229 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HSCROLL) == common::Axis::HSCROLL);
230 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_Z) == common::Axis::Z);
231 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RX) == common::Axis::RX);
232 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RY) == common::Axis::RY);
233 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RZ) == common::Axis::RZ);
234 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HAT_X) == common::Axis::HAT_X);
235 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HAT_Y) == common::Axis::HAT_Y);
236 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_LTRIGGER) == common::Axis::LTRIGGER);
237 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RTRIGGER) == common::Axis::RTRIGGER);
238 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_THROTTLE) == common::Axis::THROTTLE);
239 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RUDDER) == common::Axis::RUDDER);
240 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_WHEEL) == common::Axis::WHEEL);
241 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GAS) == common::Axis::GAS);
242 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_BRAKE) == common::Axis::BRAKE);
243 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_DISTANCE) == common::Axis::DISTANCE);
244 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TILT) == common::Axis::TILT);
245 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_SCROLL) == common::Axis::SCROLL);
246 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RELATIVE_X) == common::Axis::RELATIVE_X);
247 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RELATIVE_Y) == common::Axis::RELATIVE_Y);
248 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_1) == common::Axis::GENERIC_1);
249 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_2) == common::Axis::GENERIC_2);
250 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_3) == common::Axis::GENERIC_3);
251 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_4) == common::Axis::GENERIC_4);
252 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_5) == common::Axis::GENERIC_5);
253 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_6) == common::Axis::GENERIC_6);
254 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_7) == common::Axis::GENERIC_7);
255 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_8) == common::Axis::GENERIC_8);
256 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_9) == common::Axis::GENERIC_9);
257 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_10) == common::Axis::GENERIC_10);
258 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_11) == common::Axis::GENERIC_11);
259 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_12) == common::Axis::GENERIC_12);
260 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_13) == common::Axis::GENERIC_13);
261 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_14) == common::Axis::GENERIC_14);
262 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_15) == common::Axis::GENERIC_15);
263 static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_16) == common::Axis::GENERIC_16);
268 static_assert(static_cast<common::Axis>(AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE) ==
269 static_cast<common::Axis>(AMOTION_EVENT_AXIS_GESTURE_SWIPE_FINGER_COUNT));
271 static common::VideoFrame getHalVideoFrame(const TouchVideoFrame& frame) { in getHalVideoFrame()
272 common::VideoFrame out; in getHalVideoFrame()
283 static std::vector<common::VideoFrame> convertVideoFrames( in convertVideoFrames()
285 std::vector<common::VideoFrame> out; in convertVideoFrames()
293 std::vector<common::PointerProperties>& outPointerProperties, in getHalPropertiesAndCoords()
294 std::vector<common::PointerCoords>& outPointerCoords) { in getHalPropertiesAndCoords()
298 common::PointerProperties properties; in getHalPropertiesAndCoords()
303 common::PointerCoords coords; in getHalPropertiesAndCoords()
313 common::MotionEvent notifyMotionArgsToHalMotionEvent(const NotifyMotionArgs& args) { in notifyMotionArgsToHalMotionEvent()
314 common::MotionEvent event; in notifyMotionArgsToHalMotionEvent()
332 std::vector<common::PointerProperties> pointerProperties; in notifyMotionArgsToHalMotionEvent()
333 std::vector<common::PointerCoords> pointerCoords; in notifyMotionArgsToHalMotionEvent()