widget/android/AndroidBridgeUtilities.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial