Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "input" |
| 18 | #include <utils/Log.h> |
| 19 | |
| 20 | #include <android/input.h> |
| 21 | #include <ui/Input.h> |
| 22 | #include <ui/InputTransport.h> |
Jeff Brown | 4fe6c3e | 2010-09-13 23:17:30 -0700 | [diff] [blame] | 23 | #include <utils/Looper.h> |
Jeff Brown | 6d0fec2 | 2010-07-23 21:28:06 -0700 | [diff] [blame] | 24 | #include <utils/RefBase.h> |
| 25 | #include <utils/Vector.h> |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 26 | |
Dianne Hackborn | d76b67c | 2010-07-13 17:48:30 -0700 | [diff] [blame] | 27 | #include <android_runtime/android_app_NativeActivity.h> |
| 28 | |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 29 | #include <poll.h> |
Jeff Brown | 6d0fec2 | 2010-07-23 21:28:06 -0700 | [diff] [blame] | 30 | #include <errno.h> |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 31 | |
| 32 | using android::InputEvent; |
| 33 | using android::KeyEvent; |
| 34 | using android::MotionEvent; |
Jeff Brown | 6d0fec2 | 2010-07-23 21:28:06 -0700 | [diff] [blame] | 35 | using android::InputDeviceInfo; |
Jeff Brown | 6d0fec2 | 2010-07-23 21:28:06 -0700 | [diff] [blame] | 36 | using android::sp; |
| 37 | using android::Vector; |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 38 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 39 | int32_t AInputEvent_getType(const AInputEvent* event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 40 | return static_cast<const InputEvent*>(event)->getType(); |
| 41 | } |
| 42 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 43 | int32_t AInputEvent_getDeviceId(const AInputEvent* event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 44 | return static_cast<const InputEvent*>(event)->getDeviceId(); |
| 45 | } |
| 46 | |
Jeff Brown | c5ed591 | 2010-07-14 18:48:53 -0700 | [diff] [blame] | 47 | int32_t AInputEvent_getSource(const AInputEvent* event) { |
| 48 | return static_cast<const InputEvent*>(event)->getSource(); |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 49 | } |
| 50 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 51 | int32_t AKeyEvent_getAction(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 52 | return static_cast<const KeyEvent*>(key_event)->getAction(); |
| 53 | } |
| 54 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 55 | int32_t AKeyEvent_getFlags(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 56 | return static_cast<const KeyEvent*>(key_event)->getFlags(); |
| 57 | } |
| 58 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 59 | int32_t AKeyEvent_getKeyCode(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 60 | return static_cast<const KeyEvent*>(key_event)->getKeyCode(); |
| 61 | } |
| 62 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 63 | int32_t AKeyEvent_getScanCode(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 64 | return static_cast<const KeyEvent*>(key_event)->getScanCode(); |
| 65 | } |
| 66 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 67 | int32_t AKeyEvent_getMetaState(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 68 | return static_cast<const KeyEvent*>(key_event)->getMetaState(); |
| 69 | } |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 70 | int32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 71 | return static_cast<const KeyEvent*>(key_event)->getRepeatCount(); |
| 72 | } |
| 73 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 74 | int64_t AKeyEvent_getDownTime(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 75 | return static_cast<const KeyEvent*>(key_event)->getDownTime(); |
| 76 | } |
| 77 | |
Jeff Brown | c5ed591 | 2010-07-14 18:48:53 -0700 | [diff] [blame] | 78 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 79 | int64_t AKeyEvent_getEventTime(const AInputEvent* key_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 80 | return static_cast<const KeyEvent*>(key_event)->getEventTime(); |
| 81 | } |
| 82 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 83 | int32_t AMotionEvent_getAction(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 84 | return static_cast<const MotionEvent*>(motion_event)->getAction(); |
| 85 | } |
| 86 | |
Jeff Brown | 85a3176 | 2010-09-01 17:01:00 -0700 | [diff] [blame] | 87 | int32_t AMotionEvent_getFlags(const AInputEvent* motion_event) { |
| 88 | return static_cast<const MotionEvent*>(motion_event)->getFlags(); |
| 89 | } |
| 90 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 91 | int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 92 | return static_cast<const MotionEvent*>(motion_event)->getMetaState(); |
| 93 | } |
| 94 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 95 | int32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 96 | return reinterpret_cast<const MotionEvent*>(motion_event)->getEdgeFlags(); |
| 97 | } |
| 98 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 99 | int64_t AMotionEvent_getDownTime(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 100 | return static_cast<const MotionEvent*>(motion_event)->getDownTime(); |
| 101 | } |
| 102 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 103 | int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 104 | return static_cast<const MotionEvent*>(motion_event)->getEventTime(); |
| 105 | } |
| 106 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 107 | float AMotionEvent_getXOffset(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 108 | return static_cast<const MotionEvent*>(motion_event)->getXOffset(); |
| 109 | } |
| 110 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 111 | float AMotionEvent_getYOffset(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 112 | return static_cast<const MotionEvent*>(motion_event)->getYOffset(); |
| 113 | } |
| 114 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 115 | float AMotionEvent_getXPrecision(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 116 | return static_cast<const MotionEvent*>(motion_event)->getXPrecision(); |
| 117 | } |
| 118 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 119 | float AMotionEvent_getYPrecision(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 120 | return static_cast<const MotionEvent*>(motion_event)->getYPrecision(); |
| 121 | } |
| 122 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 123 | size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 124 | return static_cast<const MotionEvent*>(motion_event)->getPointerCount(); |
| 125 | } |
| 126 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 127 | int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 128 | return static_cast<const MotionEvent*>(motion_event)->getPointerId(pointer_index); |
| 129 | } |
| 130 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 131 | float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 132 | return static_cast<const MotionEvent*>(motion_event)->getRawX(pointer_index); |
| 133 | } |
| 134 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 135 | float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 136 | return static_cast<const MotionEvent*>(motion_event)->getRawY(pointer_index); |
| 137 | } |
| 138 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 139 | float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 140 | return static_cast<const MotionEvent*>(motion_event)->getX(pointer_index); |
| 141 | } |
| 142 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 143 | float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 144 | return static_cast<const MotionEvent*>(motion_event)->getY(pointer_index); |
| 145 | } |
| 146 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 147 | float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 148 | return static_cast<const MotionEvent*>(motion_event)->getPressure(pointer_index); |
| 149 | } |
| 150 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 151 | float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 152 | return static_cast<const MotionEvent*>(motion_event)->getSize(pointer_index); |
| 153 | } |
| 154 | |
Jeff Brown | c5ed591 | 2010-07-14 18:48:53 -0700 | [diff] [blame] | 155 | float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) { |
| 156 | return static_cast<const MotionEvent*>(motion_event)->getTouchMajor(pointer_index); |
| 157 | } |
| 158 | |
| 159 | float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) { |
| 160 | return static_cast<const MotionEvent*>(motion_event)->getTouchMinor(pointer_index); |
| 161 | } |
| 162 | |
| 163 | float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) { |
| 164 | return static_cast<const MotionEvent*>(motion_event)->getToolMajor(pointer_index); |
| 165 | } |
| 166 | |
| 167 | float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) { |
| 168 | return static_cast<const MotionEvent*>(motion_event)->getToolMinor(pointer_index); |
| 169 | } |
| 170 | |
| 171 | float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) { |
| 172 | return static_cast<const MotionEvent*>(motion_event)->getOrientation(pointer_index); |
| 173 | } |
| 174 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 175 | size_t AMotionEvent_getHistorySize(const AInputEvent* motion_event) { |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 176 | return static_cast<const MotionEvent*>(motion_event)->getHistorySize(); |
| 177 | } |
| 178 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 179 | int64_t AMotionEvent_getHistoricalEventTime(AInputEvent* motion_event, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 180 | size_t history_index) { |
| 181 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalEventTime( |
| 182 | history_index); |
| 183 | } |
| 184 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 185 | float AMotionEvent_getHistoricalRawX(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 186 | size_t history_index) { |
| 187 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalRawX( |
| 188 | pointer_index, history_index); |
| 189 | } |
| 190 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 191 | float AMotionEvent_getHistoricalRawY(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 192 | size_t history_index) { |
| 193 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalRawY( |
| 194 | pointer_index, history_index); |
| 195 | } |
| 196 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 197 | float AMotionEvent_getHistoricalX(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 198 | size_t history_index) { |
| 199 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalX( |
| 200 | pointer_index, history_index); |
| 201 | } |
| 202 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 203 | float AMotionEvent_getHistoricalY(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 204 | size_t history_index) { |
| 205 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalY( |
| 206 | pointer_index, history_index); |
| 207 | } |
| 208 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 209 | float AMotionEvent_getHistoricalPressure(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 210 | size_t history_index) { |
| 211 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalPressure( |
| 212 | pointer_index, history_index); |
| 213 | } |
| 214 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 215 | float AMotionEvent_getHistoricalSize(AInputEvent* motion_event, size_t pointer_index, |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 216 | size_t history_index) { |
| 217 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalSize( |
| 218 | pointer_index, history_index); |
| 219 | } |
| 220 | |
Jeff Brown | c5ed591 | 2010-07-14 18:48:53 -0700 | [diff] [blame] | 221 | float AMotionEvent_getHistoricalTouchMajor(AInputEvent* motion_event, size_t pointer_index, |
| 222 | size_t history_index) { |
| 223 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalTouchMajor( |
| 224 | pointer_index, history_index); |
| 225 | } |
| 226 | |
| 227 | float AMotionEvent_getHistoricalTouchMinor(AInputEvent* motion_event, size_t pointer_index, |
| 228 | size_t history_index) { |
| 229 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalTouchMinor( |
| 230 | pointer_index, history_index); |
| 231 | } |
| 232 | |
| 233 | float AMotionEvent_getHistoricalToolMajor(AInputEvent* motion_event, size_t pointer_index, |
| 234 | size_t history_index) { |
| 235 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalToolMajor( |
| 236 | pointer_index, history_index); |
| 237 | } |
| 238 | |
| 239 | float AMotionEvent_getHistoricalToolMinor(AInputEvent* motion_event, size_t pointer_index, |
| 240 | size_t history_index) { |
| 241 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalToolMinor( |
| 242 | pointer_index, history_index); |
| 243 | } |
| 244 | |
| 245 | float AMotionEvent_getHistoricalOrientation(AInputEvent* motion_event, size_t pointer_index, |
| 246 | size_t history_index) { |
| 247 | return static_cast<const MotionEvent*>(motion_event)->getHistoricalOrientation( |
| 248 | pointer_index, history_index); |
| 249 | } |
| 250 | |
| 251 | |
Dianne Hackborn | 6826741 | 2010-07-02 18:52:01 -0700 | [diff] [blame] | 252 | void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, |
Jeff Brown | 4fe6c3e | 2010-09-13 23:17:30 -0700 | [diff] [blame] | 253 | int ident, ALooper_callbackFunc callback, void* data) { |
Dianne Hackborn | 42c03e5 | 2010-09-07 15:28:30 -0700 | [diff] [blame] | 254 | queue->attachLooper(looper, ident, callback, data); |
Dianne Hackborn | 6826741 | 2010-07-02 18:52:01 -0700 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | void AInputQueue_detachLooper(AInputQueue* queue) { |
Dianne Hackborn | d76b67c | 2010-07-13 17:48:30 -0700 | [diff] [blame] | 258 | queue->detachLooper(); |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 259 | } |
| 260 | |
Dianne Hackborn | 2c6081c | 2010-07-15 17:44:53 -0700 | [diff] [blame] | 261 | int32_t AInputQueue_hasEvents(AInputQueue* queue) { |
Dianne Hackborn | d76b67c | 2010-07-13 17:48:30 -0700 | [diff] [blame] | 262 | return queue->hasEvents(); |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Dianne Hackborn | 2e9f93e | 2010-06-28 15:27:30 -0700 | [diff] [blame] | 265 | int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent) { |
Dianne Hackborn | d76b67c | 2010-07-13 17:48:30 -0700 | [diff] [blame] | 266 | return queue->getEvent(outEvent); |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Dianne Hackborn | 2c6081c | 2010-07-15 17:44:53 -0700 | [diff] [blame] | 269 | int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event) { |
| 270 | return queue->preDispatchEvent(event) ? 1 : 0; |
| 271 | } |
| 272 | |
Dianne Hackborn | d76b67c | 2010-07-13 17:48:30 -0700 | [diff] [blame] | 273 | void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled) { |
Jeff Brown | 3915bb8 | 2010-11-05 15:02:16 -0700 | [diff] [blame] | 274 | queue->finishEvent(event, handled != 0, false); |
Dianne Hackborn | a95e4cb | 2010-06-18 18:09:33 -0700 | [diff] [blame] | 275 | } |