widget/android/AndroidBridgeUtilities.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 // A collection of macros to simplify getting class and method references from Java.
michael@0 2
michael@0 3 #define initInit() jclass jClass
michael@0 4
michael@0 5 // note that this also sets jClass
michael@0 6 #define getClassGlobalRef(cname) \
michael@0 7 (jClass = AndroidBridge::GetClassGlobalRef(jEnv, cname))
michael@0 8
michael@0 9 #define getField(fname, ftype) \
michael@0 10 AndroidBridge::GetFieldID(jEnv, jClass, fname, ftype)
michael@0 11
michael@0 12 #define getMethod(fname, ftype) \
michael@0 13 AndroidBridge::GetMethodID(jEnv, jClass, fname, ftype)
michael@0 14
michael@0 15 #define getStaticField(fname, ftype) \
michael@0 16 AndroidBridge::GetStaticFieldID(jEnv, jClass, fname, ftype)
michael@0 17
michael@0 18 #define getStaticMethod(fname, ftype) \
michael@0 19 AndroidBridge::GetStaticMethodID(jEnv, jClass, fname, ftype)
michael@0 20
michael@0 21 #ifndef ALOG
michael@0 22 #if defined(DEBUG) || defined(FORCE_ALOG)
michael@0 23 #define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko" , ## args)
michael@0 24 #else
michael@0 25 #define ALOG(args...) ((void)0)
michael@0 26 #endif
michael@0 27 #endif
michael@0 28
michael@0 29 #ifdef DEBUG
michael@0 30 #define ALOG_BRIDGE(args...) ALOG(args)
michael@0 31 #else
michael@0 32 #define ALOG_BRIDGE(args...) ((void)0)
michael@0 33 #endif

mercurial