widget/android/AndroidBridgeUtilities.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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