| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file is autogenerated by | 5 // This file is autogenerated by |
| 6 // base/android/jni_generator/jni_generator.py | 6 // base/android/jni_generator/jni_generator.py |
| 7 // For | 7 // For |
| 8 // android/view/MotionEvent | 8 // android/view/MotionEvent |
| 9 | 9 |
| 10 #ifndef android_view_MotionEvent_JNI | 10 #ifndef android_view_MotionEvent_JNI |
| 11 #define android_view_MotionEvent_JNI | 11 #define android_view_MotionEvent_JNI |
| 12 | 12 |
| 13 #include <jni.h> | 13 #include <jni.h> |
| 14 | 14 |
| 15 #include "base/android/jni_generator/jni_generator_helper.h" | 15 #include "base/android/jni_generator/jni_generator_helper.h" |
| 16 | 16 |
| 17 // Step 1: forward declarations. | 17 // Step 1: forward declarations. |
| 18 namespace { | 18 namespace { |
| 19 const char kMotionEventClassPath[] = "android/view/MotionEvent"; | 19 const char kMotionEventClassPath[] = "android/view/MotionEvent"; |
| 20 // Leaking this jclass as we cannot use LazyInstance from some threads. | 20 // Leaking this jclass as we cannot use LazyInstance from some threads. |
| 21 jclass g_MotionEvent_clazz = NULL; | 21 jclass g_MotionEvent_clazz = NULL; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 namespace JNI_MotionEvent { | 25 namespace JNI_MotionEvent { |
| 26 extern "C"{ |
| 26 | 27 |
| 27 enum Java_MotionEvent_constant_fields { | 28 enum Java_MotionEvent_constant_fields { |
| 28 INVALID_POINTER_ID = -1, | 29 INVALID_POINTER_ID = -1, |
| 29 ACTION_MASK = 255, | 30 ACTION_MASK = 255, |
| 30 ACTION_DOWN = 0, | 31 ACTION_DOWN = 0, |
| 31 ACTION_UP = 1, | 32 ACTION_UP = 1, |
| 32 ACTION_MOVE = 2, | 33 ACTION_MOVE = 2, |
| 33 ACTION_CANCEL = 3, | 34 ACTION_CANCEL = 3, |
| 34 ACTION_OUTSIDE = 4, | 35 ACTION_OUTSIDE = 4, |
| 35 ACTION_POINTER_DOWN = 5, | 36 ACTION_POINTER_DOWN = 5, |
| (...skipping 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2193 env, g_MotionEvent_clazz, | 2194 env, g_MotionEvent_clazz, |
| 2194 "writeToParcel", | 2195 "writeToParcel", |
| 2195 "(Landroid/os/Parcel;I)V", | 2196 "(Landroid/os/Parcel;I)V", |
| 2196 &g_MotionEvent_writeToParcel); | 2197 &g_MotionEvent_writeToParcel); |
| 2197 | 2198 |
| 2198 env->CallVoidMethod(obj, | 2199 env->CallVoidMethod(obj, |
| 2199 method_id, p0, p1); | 2200 method_id, p0, p1); |
| 2200 jni_generator::CheckException(env); | 2201 jni_generator::CheckException(env); |
| 2201 | 2202 |
| 2202 } | 2203 } |
| 2204 }; |
| 2203 | 2205 |
| 2204 // Step 3: RegisterNatives. | 2206 // Step 3: RegisterNatives. |
| 2205 | |
| 2206 static bool RegisterNativesImpl(JNIEnv* env) { | 2207 static bool RegisterNativesImpl(JNIEnv* env) { |
| 2207 g_MotionEvent_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 2208 g_MotionEvent_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
| 2208 base::android::GetClass(env, kMotionEventClassPath).obj())); | 2209 base::android::GetClass(env, kMotionEventClassPath).obj())); |
| 2209 | 2210 |
| 2210 return true; | 2211 return true; |
| 2211 } | 2212 } |
| 2212 | 2213 |
| 2213 } // namespace JNI_MotionEvent | 2214 } // namespace JNI_MotionEvent |
| 2214 | 2215 |
| 2215 #endif // android_view_MotionEvent_JNI | 2216 #endif // android_view_MotionEvent_JNI |
| OLD | NEW |