use of org.luaj.vm2.LuaFunction in project LuaViewSDK by alibaba.
the class DebugLib method onCall.
public void onCall(LuaFunction f) {
LuaThread t = globals.running;
callstack().onCall(f);
if (t.inhook)
return;
if (t.hookcall && t.hookfunc != null)
callHook(CALL, NIL);
}
use of org.luaj.vm2.LuaFunction in project LuaViewSDK by alibaba.
the class HttpMethodMapper method get.
/**
* get请求
*
* @param http
* @param varargs
* @return
*/
public LuaValue get(U http, Varargs varargs) {
final String url = LuaUtil.getString(varargs, 2);
final LuaTable params = LuaUtil.getTable(varargs, 3, 2);
final LuaFunction callback = LuaUtil.getFunction(varargs, 4, 3, 2);
return http.get(url, params, callback);
}
use of org.luaj.vm2.LuaFunction in project LuaViewSDK by alibaba.
the class UIImageViewMethodMapper method setImage.
public LuaValue setImage(U view, Varargs varargs) {
if (varargs.isstring(2)) {
final String url = varargs.optjstring(2, null);
final LuaFunction callback = varargs.optfunction(3, null);
return view.setImageUrl(url, callback);
} else if (varargs.arg(2) instanceof UDData) {
//data
final UDData data = (UDData) varargs.arg(2);
return view.setImageBitmap(data != null ? data.bytes() : null);
}
return view;
}
Aggregations