#include "NativeMenubar.h" #include "MethodResultJni.h" #include "rhodes/JNIRhoJS.h" #include "logging/RhoLog.h" #undef DEFAULT_LOGCATEGORY #define DEFAULT_LOGCATEGORY "NativeMenubarJS" typedef rho::CNativeMenubarProxy > ObjectProxy; using namespace rho::apiGenerator; rho::String js_s_NativeMenubar_getMainMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getMainMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_setMainMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setMainMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_getExtraMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getExtraMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_setExtraMenu(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setExtraMenu(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_getMainButton(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getMainButton(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_setMainButton(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setMainButton(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_getExtraButton(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 0) || (argc > 0)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::getExtraButton(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; } rho::String js_s_NativeMenubar_setExtraButton(const rho::String& strObjID, rho::json::CJSONArray& argv, const rho::String& strCallbackID, const rho::String& strJsVmID, const rho::String& strCallbackParam) { RAWTRACE2("%s(id=%s)", __FUNCTION__, strObjID.c_str()); MethodResultJni result(false); if(!result) { result.setError("JNI error: failed to initialize MethodResult java object"); RAWLOG_ERROR("JNI error: failed to initialize MethodResult java object ^^^"); return CMethodResultConvertor().toJSON(result); } int argc = argv.getSize(); if((argc < 1) || (argc > 1)) { result.setArgError("Wrong number of arguments"); RAWLOG_ERROR1("Wrong number of arguments: %d ^^^", argc); return CMethodResultConvertor().toJSON(result); } if(strCallbackID.length() != 0) { result.setCallBack(strCallbackID, strCallbackParam); } ObjectProxy::setExtraButton(argumentsAdapter(argv), result); rho::String res = CMethodResultConvertor().toJSON(result); RAWTRACE(res.c_str()); RAWTRACE2("%s(id=%s) end ^^^", __FUNCTION__, strObjID.c_str()); return res; }