This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] - rework expression conversion
- Loading branch information
Showing
26 changed files
with
294 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include "lang.hpp" | ||
|
||
namespace mbgl { | ||
namespace android { | ||
namespace java { | ||
namespace lang { | ||
|
||
// Float | ||
|
||
jni::Object<Float> Float::valueOf(JNIEnv &env, jfloat value) { | ||
static auto method = javaClass.GetStaticMethod<jni::Object<Float> (jni::jfloat)>(env, "valueOf"); | ||
return javaClass.Call(env, method, value); | ||
} | ||
|
||
void Float::registerNative(jni::JNIEnv &env) { | ||
// Lookup the class | ||
javaClass = *jni::Class<Float>::Find(env).NewGlobalRef(env).release(); | ||
} | ||
|
||
jni::Class<Float> Float::javaClass; | ||
|
||
// Long | ||
|
||
jni::Object<Long> Long::valueOf(JNIEnv &env, jlong value) { | ||
static auto method = javaClass.GetStaticMethod<jni::Object<Long> (jni::jlong)>(env, "valueOf"); | ||
return javaClass.Call(env, method, value); | ||
} | ||
|
||
void Long::registerNative(jni::JNIEnv &env) { | ||
// Lookup the class | ||
javaClass = *jni::Class<Long>::Find(env).NewGlobalRef(env).release(); | ||
} | ||
|
||
jni::Class<Long> Long::javaClass; | ||
|
||
// Double | ||
|
||
jni::Object<Double> Double::valueOf(JNIEnv &env, jdouble value) { | ||
static auto method = javaClass.GetStaticMethod<jni::Object<Double> (jni::jdouble)>(env, "valueOf"); | ||
return javaClass.Call(env, method, value); | ||
} | ||
|
||
void Double::registerNative(jni::JNIEnv &env) { | ||
// Lookup the class | ||
javaClass = *jni::Class<Double>::Find(env).NewGlobalRef(env).release(); | ||
} | ||
|
||
jni::Class<Double> Double::javaClass; | ||
|
||
// Boolean | ||
|
||
jni::Object<Boolean> Boolean::valueOf(JNIEnv &env, jboolean value) { | ||
static auto method = javaClass.GetStaticMethod<jni::Object<Boolean> (jni::jboolean)>(env, "valueOf"); | ||
return javaClass.Call(env, method, value); | ||
} | ||
|
||
void Boolean::registerNative(jni::JNIEnv &env) { | ||
// Lookup the class | ||
javaClass = *jni::Class<Boolean>::Find(env).NewGlobalRef(env).release(); | ||
} | ||
|
||
jni::Class<Boolean> Boolean::javaClass; | ||
|
||
// Number | ||
|
||
void Number::registerNative(jni::JNIEnv &env) { | ||
// Lookup the class | ||
javaClass = *jni::Class<Number>::Find(env).NewGlobalRef(env).release(); | ||
} | ||
|
||
jni::Class<Number> Number::javaClass; | ||
|
||
} // namespace lang | ||
} // namespace java | ||
} // namespace android | ||
} // namespace mbgl |
Oops, something went wrong.