JNIEnv * AfficheBlock::getCurrentEnv() { JNIEnv * curEnv = NULL; jint res=this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL); if (res != JNI_OK) { throw GiwsException::JniException(getCurrentEnv()); } return curEnv; }
// Constructors XlFontManager::XlFontManager(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ jobjectArray_getInstalledFontsNameID=NULL; jintgetSizeInstalledFontsNameID=NULL; jintgetSizeAvailableFontsNameID=NULL; jobjectArray_getAvailableFontsNameID=NULL; jbooleanisAvailableFontNamejstringjava_lang_StringID=NULL; jintaddFontjstringjava_lang_StringID=NULL; jintchangeFontjintintjstringjava_lang_StringID=NULL; jintchangeFontWithPropertyjintintjstringjava_lang_StringjbooleanbooleanjbooleanbooleanID=NULL; voidresetXlFontManagerID=NULL; jintaddFontFromFilenamejstringjava_lang_StringID=NULL; jintchangeFontFromFilenamejintintjstringjava_lang_StringID=NULL; }
//return guid of next EDT on specified worker's workpile ocrGuid_t hcDumpNextEdt(ocrWorker_t *worker, u32 *size){ ocrPolicyDomain_t *pd = worker->pd; ocrSchedulerObject_t *schedObj; ocrSchedulerObjectDeq_t *deqObj; ocrSchedulerObjectWst_t *wstObj; ocrTask_t *curTask = NULL; schedObj = (ocrSchedulerObject_t *)pd->schedulers[0]->rootObj; wstObj = (ocrSchedulerObjectWst_t *)schedObj; deqObj = (ocrSchedulerObjectDeq_t *)wstObj->deques[worker->id]; u32 tail = (deqObj->deque->tail%INIT_DEQUE_CAPACITY); u32 deqSize = deqObj->deque->size(deqObj->deque); if(deqSize > 0){ PD_MSG_STACK(msg); getCurrentEnv(NULL, NULL, NULL, &msg); ocrFatGuid_t fguid; // See BUG #928 on GUIDs #if GUID_BIT_COUNT == 64 fguid.guid.guid = deqObj->deque->data[tail-1]; #elif GUID_BIT_COUNT == 128 fguid.guid.lower = deqObj->deque->data[tail-1]; fguid.guid.upper = 0x0; #endif fguid.metaDataPtr = NULL; #define PD_MSG (&msg) #define PD_TYPE PD_MSG_GUID_INFO msg.type = PD_MSG_GUID_INFO | PD_MSG_REQUEST | PD_MSG_REQ_RESPONSE; PD_MSG_FIELD_IO(guid.guid) = fguid.guid; PD_MSG_FIELD_IO(guid.metaDataPtr) = fguid.metaDataPtr; PD_MSG_FIELD_I(properties) = RMETA_GUIDPROP | KIND_GUIDPROP; RESULT_PROPAGATE(pd->fcts.processMessage(pd, &msg, true)); ocrGuidKind msgKind = PD_MSG_FIELD_O(kind); curTask = (ocrTask_t *)PD_MSG_FIELD_IO(guid.metaDataPtr); #undef PD_MSG #undef PD_TYPE if(msgKind != OCR_GUID_EDT){ return NULL_GUID; }else if(curTask != NULL){ //One queried task per worker (next EDT guid) *size = 1; return curTask->guid; } }else{ //One queried task per worker (next EDT guid) *size = 1; return NULL_GUID; } return NULL_GUID; }
CubemapImage::~CubemapImage() { if (mJava != NULL) { std::lock_guard<std::mutex> lock(mUpdateLock); JNIEnv *env = getCurrentEnv(mJava); clearData(env); } }
// Constructors Xcos::Xcos(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidxcosjstringjava_lang_Stringjstringjava_lang_StringID=NULL; voidwarnCellByUIDjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_StringID=NULL; voidcloseXcosFromScilabID=NULL; jintxcosDiagramToScilabjstringjava_lang_StringID=NULL; voidxcosDiagramOpenjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidxcosDiagramClosejobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidaddToolsMenujstringjava_lang_Stringjstringjava_lang_StringID=NULL; voidupdateBlockjstringjava_lang_StringID=NULL; voidxcosSimulationStartedID=NULL; }
// Constructors SwingView::SwingView(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct = "<init>"; const std::string param = "()V"; jvm = jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if (constructObject == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if (localInstance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if (this->instance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidsetHeadlessjbooleanbooleanID = NULL; jbooleanisHeadlessID = NULL; }
// Constructors ScilabVariablesRefresh::ScilabVariablesRefresh(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct = "<init>"; const std::string param = "()V"; jvm = jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if (constructObject == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if (localInstance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if (this->instance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ jobjectArray_getAllListenedVariablesID = NULL; jintgetScilabVariablesRefreshIdID = NULL; }
// Constructors Palette::Palette(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidloadPaljstringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidloadPaljstringjava_lang_StringID=NULL; voidaddCategoryjobjectArray_java_lang_Stringjava_lang_StringjbooleanbooleanID=NULL; voidremovejobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidenablejobjectArray_java_lang_Stringjava_lang_StringjbooleanbooleanID=NULL; voidmovejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidgeneratePaletteIconjstringjava_lang_StringID=NULL; voidgenerateAllImagesjobjectArray_java_lang_Stringjava_lang_StringID=NULL; }
JOGLConstant::JOGLConstant(JavaVM * jvm_, jobject JObj) { jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); jclass localClass = curEnv->GetObjectClass(JObj); this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(JObj) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* Methods ID set to NULL */ jintget_GL_RGBAID=NULL; jintget_GL_RGBID=NULL; jintget_GL_CURRENT_RASTER_POSITION_VALIDID=NULL; jintget_GL_CURRENT_RASTER_POSITIONID=NULL; jintget_GL_CURRENT_RASTER_COLORID=NULL; jintget_GL_SRC_ALPHAID=NULL; jintget_GL_ONE_MINUS_SRC_ALPHAID=NULL; jintget_GL_ONEID=NULL; jintget_GL_ZEROID=NULL; jintget_GL_COLOR_INDEXID=NULL; jintget_GL_POINT_TOKENID=NULL; jintget_GL_LINE_TOKENID=NULL; jintget_GL_LINE_RESET_TOKENID=NULL; jintget_GL_POLYGON_TOKENID=NULL; jintget_GL_BITMAP_TOKENID=NULL; jintget_GL_DRAW_PIXEL_TOKENID=NULL; jintget_GL_COPY_PIXEL_TOKENID=NULL; jintget_GL_PASS_THROUGH_TOKENID=NULL; jintget_GL_FEEDBACKID=NULL; jintget_GL_COLOR_CLEAR_VALUEID=NULL; jintget_GL_INDEX_CLEAR_VALUEID=NULL; jintget_GL_RENDERID=NULL; jintget_GL_VIEWPORTID=NULL; jintget_GL_BLENDID=NULL; jintget_GL_BLEND_SRCID=NULL; jintget_GL_BLEND_DSTID=NULL; jintget_GL_3D_COLORID=NULL; jintget_GL_FLOATID=NULL; jintget_GL_UNSIGNED_BYTEID=NULL; jintget_GL_POINTSID=NULL; jintget_GL_POLYGON_OFFSET_FACTORID=NULL; jintget_GL_POLYGON_OFFSET_UNITSID=NULL; jintget_GL_LINE_STIPPLE_PATTERNID=NULL; jintget_GL_LINE_STIPPLE_REPEATID=NULL; }
// Constructors SciDocMain::SciDocMain(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidbuildDocumentationjstringjava_lang_StringID=NULL; jbooleansetOutputDirectoryjstringjava_lang_StringID=NULL; voidsetWorkingLanguagejstringjava_lang_StringID=NULL; voidsetExportFormatjstringjava_lang_StringID=NULL; voidsetIsToolboxjbooleanbooleanID=NULL; jstringprocessjstringjava_lang_Stringjstringjava_lang_StringID=NULL; voidgenerateJavahelpjstringjava_lang_Stringjstringjava_lang_StringID=NULL; }
// Constructors Jxgetmouse::Jxgetmouse(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidxgetmouseID=NULL; voidxgetmousejbooleanbooleanjbooleanbooleanID=NULL; jintgetMouseButtonNumberID=NULL; jstringgetWindowsIDID=NULL; jdoublegetXCoordinateID=NULL; jdoublegetYCoordinateID=NULL; }
// Constructors LookAndFeelManager::LookAndFeelManager(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ jbooleanisSupportedLookAndFeeljstringjava_lang_StringID=NULL; jstringgetCurrentLookAndFeelID=NULL; jbooleansetLookAndFeeljstringjava_lang_StringID=NULL; jbooleansetSystemLookAndFeelID=NULL; jobjectArray_getInstalledLookAndFeelsID=NULL; jintnumbersOfInstalledLookAndFeelsID=NULL; }
// Constructors SciNotes::SciNotes(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ voidscinotesID=NULL; voidscinotesjstringjava_lang_StringID=NULL; voidscinotesjstringjava_lang_Stringjintintjstringjava_lang_StringID=NULL; voidscinotesjstringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voidcloseSciNotesFromScilabID=NULL; }
void XlFontManager::resetXlFontManager (){ JNIEnv * curEnv = getCurrentEnv(); if (voidresetXlFontManagerID==NULL) { /* Use the cache */ voidresetXlFontManagerID = curEnv->GetMethodID(this->instanceClass, "resetXlFontManager", "()V" ) ; if (voidresetXlFontManagerID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "resetXlFontManager"); } } curEnv->CallVoidMethod( this->instance, voidresetXlFontManagerID ); }
// Constructors DatatipCreate::DatatipCreate(JavaVM * jvm_) { jmethodID constructObject = NULL ; jobject localInstance ; jclass localClass ; const std::string construct="<init>"; const std::string param="()V"; jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); localClass = curEnv->FindClass( this->className().c_str() ) ; if (localClass == NULL) { throw GiwsException::JniClassNotFoundException(curEnv, this->className()); } this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); /* localClass is not needed anymore */ curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ; if(constructObject == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ; if(localInstance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(localInstance) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* localInstance not needed anymore */ curEnv->DeleteLocalRef(localInstance); /* Methods ID set to NULL */ jintcreateDatatipProgramCoordjintintjdoubleArray_doubledoubleID=NULL; jintcreateDatatipProgramIndexjintintjintintID=NULL; voiddatatipSetInterpjintintjbooleanbooleanID=NULL; }
void SciDocMain::setIsToolbox (bool isToolbox){ JNIEnv * curEnv = getCurrentEnv(); if (voidsetIsToolboxjbooleanbooleanID==NULL) { /* Use the cache */ voidsetIsToolboxjbooleanbooleanID = curEnv->GetMethodID(this->instanceClass, "setIsToolbox", "(Z)V" ) ; if (voidsetIsToolboxjbooleanbooleanID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "setIsToolbox"); } } jboolean isToolbox_ = (static_cast<bool>(isToolbox) ? JNI_TRUE : JNI_FALSE); curEnv->CallVoidMethod( this->instance, voidsetIsToolboxjbooleanbooleanID ,isToolbox_); }
int LookAndFeelManager::numbersOfInstalledLookAndFeels (){ JNIEnv * curEnv = getCurrentEnv(); if (jintnumbersOfInstalledLookAndFeelsID==NULL) { /* Use the cache */ jintnumbersOfInstalledLookAndFeelsID = curEnv->GetMethodID(this->instanceClass, "numbersOfInstalledLookAndFeels", "()I" ) ; if (jintnumbersOfInstalledLookAndFeelsID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "numbersOfInstalledLookAndFeels"); } } jint res = static_cast<jint>( curEnv->CallIntMethod( this->instance, jintnumbersOfInstalledLookAndFeelsID )); return res; }
bool LookAndFeelManager::setSystemLookAndFeel (){ JNIEnv * curEnv = getCurrentEnv(); if (jbooleansetSystemLookAndFeelID==NULL) { /* Use the cache */ jbooleansetSystemLookAndFeelID = curEnv->GetMethodID(this->instanceClass, "setSystemLookAndFeel", "()Z" ) ; if (jbooleansetSystemLookAndFeelID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "setSystemLookAndFeel"); } } jboolean res = static_cast<jboolean>( curEnv->CallBooleanMethod( this->instance, jbooleansetSystemLookAndFeelID )); return (res == JNI_TRUE); }
int UIElementMapper::getMaxId (){ JNIEnv * curEnv = getCurrentEnv(); if (jintgetMaxIdID==NULL) { /* Use the cache */ jintgetMaxIdID = curEnv->GetMethodID(this->instanceClass, "getMaxId", "()I" ) ; if (jintgetMaxIdID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "getMaxId"); } } jint res = static_cast<jint>( curEnv->CallIntMethod( this->instance, jintgetMaxIdID )); return res; }
/** * The computation worker routine that asks work to the scheduler */ static void workerLoop(ocrWorker_t * worker) { ocrPolicyDomain_t *pd = worker->pd; PD_MSG_STACK(msg); getCurrentEnv(NULL, NULL, NULL, &msg); while(worker->fcts.isRunning(worker)) { DPRINTF(DEBUG_LVL_VVERB, "XE %"PRIx64" REQUESTING WORK\n", pd->myLocation); #if 1 //This is disabled until we move TAKE heuristic in CE policy domain to inside scheduler #define PD_MSG (&msg) #define PD_TYPE PD_MSG_SCHED_GET_WORK msg.type = PD_MSG_SCHED_GET_WORK | PD_MSG_REQUEST | PD_MSG_REQ_RESPONSE; PD_MSG_FIELD_IO(schedArgs).kind = OCR_SCHED_WORK_EDT_USER; PD_MSG_FIELD_IO(schedArgs).OCR_SCHED_ARG_FIELD(OCR_SCHED_WORK_EDT_USER).edt.guid = NULL_GUID; PD_MSG_FIELD_IO(schedArgs).OCR_SCHED_ARG_FIELD(OCR_SCHED_WORK_EDT_USER).edt.metaDataPtr = NULL; PD_MSG_FIELD_I(properties) = 0; if(pd->fcts.processMessage(pd, &msg, true) == 0) { // We got a response ocrFatGuid_t taskGuid = PD_MSG_FIELD_IO(schedArgs).OCR_SCHED_ARG_FIELD(OCR_SCHED_WORK_EDT_USER).edt; if(!(ocrGuidIsNull(taskGuid.guid))) { DPRINTF(DEBUG_LVL_VVERB, "XE %"PRIx64" EXECUTING TASK "GUIDF"\n", pd->myLocation, GUIDA(taskGuid.guid)); // Task sanity checks ASSERT(taskGuid.metaDataPtr != NULL); worker->curTask = (ocrTask_t*)taskGuid.metaDataPtr; u32 factoryId = PD_MSG_FIELD_O(factoryId); pd->taskFactories[factoryId]->fcts.execute(worker->curTask); #undef PD_TYPE #define PD_TYPE PD_MSG_SCHED_NOTIFY getCurrentEnv(NULL, NULL, NULL, &msg); msg.type = PD_MSG_SCHED_NOTIFY | PD_MSG_REQUEST; PD_MSG_FIELD_IO(schedArgs).kind = OCR_SCHED_NOTIFY_EDT_DONE; PD_MSG_FIELD_IO(schedArgs).OCR_SCHED_ARG_FIELD(OCR_SCHED_NOTIFY_EDT_DONE).guid.guid = taskGuid.guid; PD_MSG_FIELD_IO(schedArgs).OCR_SCHED_ARG_FIELD(OCR_SCHED_NOTIFY_EDT_DONE).guid.metaDataPtr = taskGuid.metaDataPtr; RESULT_ASSERT(pd->fcts.processMessage(pd, &msg, false), ==, 0); // Important for this to be the last worker->curTask = NULL; } else {
int XlFontManager::getSizeAvailableFontsName (){ JNIEnv * curEnv = getCurrentEnv(); if (jintgetSizeAvailableFontsNameID==NULL) { /* Use the cache */ jintgetSizeAvailableFontsNameID = curEnv->GetMethodID(this->instanceClass, "getSizeAvailableFontsName", "()I" ) ; if (jintgetSizeAvailableFontsNameID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "getSizeAvailableFontsName"); } } jint res = static_cast<jint>( curEnv->CallIntMethod( this->instance, jintgetSizeAvailableFontsNameID )); return res; }
Juigetfile::Juigetfile(JavaVM * jvm_, jobject JObj) { jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); jclass localClass = curEnv->GetObjectClass(JObj); this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(JObj) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* Methods ID set to NULL */ voiduigetfileID=NULL; voiduigetfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voiduigetfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_StringID=NULL; voiduigetfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID=NULL; voiduigetfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringjbooleanbooleanID=NULL; voiduiputfileID=NULL; voiduiputfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID=NULL; voiduiputfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_StringID=NULL; voiduiputfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID=NULL; voiduiputfilejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringjbooleanbooleanID=NULL; jstringgetTitleBoxID=NULL; jobjectArray_getMaskID=NULL; jobjectArray_getMaskDescriptionID=NULL; jstringgetInitialDirectoryID=NULL; jintgetSelectionSizeID=NULL; jobjectArray_getSelectionID=NULL; jobjectArray_getSelectionFileNamesID=NULL; jbooleanisMultipleSelectionID=NULL; jstringgetSelectionPathNameID=NULL; jintgetFilterIndexID=NULL; jstringgetMenuCallbackID=NULL; voiduigetdirID=NULL; voiduigetdirjstringjava_lang_StringID=NULL; voiduigetdirjstringjava_lang_Stringjstringjava_lang_StringID=NULL; }
char* BuildDocObject::process (char const* sourceDoc, char const* styleSheet){ JNIEnv * curEnv = getCurrentEnv(); if (jstringprocessjstringjava_lang_Stringjstringjava_lang_StringID==NULL) { /* Use the cache */ jstringprocessjstringjava_lang_Stringjstringjava_lang_StringID = curEnv->GetMethodID(this->instanceClass, "process", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" ) ; if (jstringprocessjstringjava_lang_Stringjstringjava_lang_StringID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "process"); } } jstring sourceDoc_ = curEnv->NewStringUTF( sourceDoc ); if (sourceDoc != NULL && sourceDoc_ == NULL) { throw GiwsException::JniBadAllocException(curEnv); } jstring styleSheet_ = curEnv->NewStringUTF( styleSheet ); if (styleSheet != NULL && styleSheet_ == NULL) { throw GiwsException::JniBadAllocException(curEnv); } jstring res = static_cast<jstring>( curEnv->CallObjectMethod( this->instance, jstringprocessjstringjava_lang_Stringjstringjava_lang_StringID ,sourceDoc_, styleSheet_)); if (curEnv->ExceptionCheck()) { throw GiwsException::JniCallMethodException(curEnv); }if (res != NULL) { const char *tempString = curEnv->GetStringUTFChars(res, 0); char * myStringBuffer = new char[strlen(tempString) + 1]; strcpy(myStringBuffer, tempString); curEnv->ReleaseStringUTFChars(res, tempString); curEnv->DeleteLocalRef(res); curEnv->DeleteLocalRef(sourceDoc_); curEnv->DeleteLocalRef(styleSheet_); return myStringBuffer; } else { curEnv->DeleteLocalRef(res); return NULL; } }
void SciDocMain::buildDocumentation (char const* type){ JNIEnv * curEnv = getCurrentEnv(); if (voidbuildDocumentationjstringjava_lang_StringID==NULL) { /* Use the cache */ voidbuildDocumentationjstringjava_lang_StringID = curEnv->GetMethodID(this->instanceClass, "buildDocumentation", "(Ljava/lang/String;)V" ) ; if (voidbuildDocumentationjstringjava_lang_StringID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "buildDocumentation"); } } jstring type_ = curEnv->NewStringUTF( type ); if (type != NULL && type_ == NULL) { throw GiwsException::JniBadAllocException(curEnv); } curEnv->CallVoidMethod( this->instance, voidbuildDocumentationjstringjava_lang_StringID ,type_); curEnv->DeleteLocalRef(type_); }
void BuildDocObject::setExportFormat (char const* format){ JNIEnv * curEnv = getCurrentEnv(); if (voidsetExportFormatjstringjava_lang_StringID==NULL) { /* Use the cache */ voidsetExportFormatjstringjava_lang_StringID = curEnv->GetMethodID(this->instanceClass, "setExportFormat", "(Ljava/lang/String;)V" ) ; if (voidsetExportFormatjstringjava_lang_StringID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "setExportFormat"); } } jstring format_ = curEnv->NewStringUTF( format ); if (format != NULL && format_ == NULL) { throw GiwsException::JniBadAllocException(curEnv); } curEnv->CallVoidMethod( this->instance, voidsetExportFormatjstringjava_lang_StringID ,format_); curEnv->DeleteLocalRef(format_); }
void BuildDocObject::setWorkingLanguage (char const* language){ JNIEnv * curEnv = getCurrentEnv(); if (voidsetWorkingLanguagejstringjava_lang_StringID==NULL) { /* Use the cache */ voidsetWorkingLanguagejstringjava_lang_StringID = curEnv->GetMethodID(this->instanceClass, "setWorkingLanguage", "(Ljava/lang/String;)V" ) ; if (voidsetWorkingLanguagejstringjava_lang_StringID == NULL) { throw GiwsException::JniMethodNotFoundException(curEnv, "setWorkingLanguage"); } } jstring language_ = curEnv->NewStringUTF( language ); if (language != NULL && language_ == NULL) { throw GiwsException::JniBadAllocException(curEnv); } curEnv->CallVoidMethod( this->instance, voidsetWorkingLanguagejstringjava_lang_StringID ,language_); curEnv->DeleteLocalRef(language_); }
DatatipOrientation::DatatipOrientation(JavaVM * jvm_, jobject JObj) { jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); jclass localClass = curEnv->GetObjectClass(JObj); this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(JObj) ; if(this->instance == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* Methods ID set to NULL */ voiddatatipSetOrientationjintintjstringjava_lang_StringjintintID=NULL; }
u8 ocrAffinityCount(ocrAffinityKind kind, u64 * count) { START_PROFILE(api_ocrAffinityCount) ocrPolicyDomain_t * pd = NULL; getCurrentEnv(&pd, NULL, NULL, NULL); // If no platformModel, we know nothing so just say that we are the only one if(pd->platformModel == NULL) { *count = 1; RETURN_PROFILE(0); } if (kind == AFFINITY_PD) { //BUG #606/#VV4 Neighbors/affinities: this is assuming each PD knows about every other PDs //Need to revisit that when we have a better idea of what affinities are *count = (pd->neighborCount + 1); } else if ((kind == AFFINITY_PD_MASTER) || (kind == AFFINITY_CURRENT) || (kind == AFFINITY_GUID)) { // Change this implementation if 'AFFINITY_CURRENT' cardinality can be > 1 *count = 1; } else { ASSERT(false && "Unknown affinity kind"); } RETURN_PROFILE(0); }
ScilabClassLoader::ScilabClassLoader(JavaVM * jvm_, jobject JObj) { jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); jclass localClass = curEnv->GetObjectClass(JObj); this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(JObj) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* Methods ID set to NULL */ jintloadJavaClassjstringjava_lang_StringjbooleanbooleanID=NULL; }
ScilabOperations::ScilabOperations(JavaVM * jvm_, jobject JObj) { jvm=jvm_; JNIEnv * curEnv = getCurrentEnv(); jclass localClass = curEnv->GetObjectClass(JObj); this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass)); curEnv->DeleteLocalRef(localClass); if (this->instanceClass == NULL) { throw GiwsException::JniObjectCreationException(curEnv, this->className()); } this->instance = curEnv->NewGlobalRef(JObj) ; if(this->instance == NULL){ throw GiwsException::JniObjectCreationException(curEnv, this->className()); } /* Methods ID set to NULL */ jintaddjintintjintintID=NULL; }