< prev index next >

modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp

Print this page
rev 10015 : 8137141: Fatal error in Method::build_method_counters when called from libglass.so


  39 #include <com_sun_glass_events_KeyEvent.h>
  40 #include <jni.h>
  41 
  42 #include "glass_general.h"
  43 #include "glass_evloop.h"
  44 #include "glass_dnd.h"
  45 #include "glass_window.h"
  46 #include "glass_screen.h"
  47 
  48 GdkEventFunc process_events_prev;
  49 static void process_events(GdkEvent*, gpointer);
  50 
  51 JNIEnv* mainEnv; // Use only with main loop thread!!!
  52 
  53 extern gboolean disableGrab;
  54 
  55 static gboolean call_runnable (gpointer data)
  56 {
  57     RunnableContext* context = reinterpret_cast<RunnableContext*>(data);
  58 
  59     mainEnv->CallVoidMethod(context->runnable, jRunnableRun, NULL);
  60     LOG_EXCEPTION(mainEnv);
  61     mainEnv->DeleteGlobalRef(context->runnable);






  62     free(context);





  63     return FALSE;
  64 }
  65 
  66 extern "C" {
  67 
  68 /*
  69  * Class:     com_sun_glass_ui_gtk_GtkApplication
  70  * Method:    _isDisplayValid
  71  * Signature: ()Z
  72  */
  73 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_gtk_GtkApplication__1isDisplayValid
  74   (JNIEnv * env, jclass clazz)
  75 {
  76     (void)env;
  77     (void)clazz;
  78 
  79     return is_display_valid();
  80 }
  81 
  82 #pragma GCC diagnostic push




  39 #include <com_sun_glass_events_KeyEvent.h>
  40 #include <jni.h>
  41 
  42 #include "glass_general.h"
  43 #include "glass_evloop.h"
  44 #include "glass_dnd.h"
  45 #include "glass_window.h"
  46 #include "glass_screen.h"
  47 
  48 GdkEventFunc process_events_prev;
  49 static void process_events(GdkEvent*, gpointer);
  50 
  51 JNIEnv* mainEnv; // Use only with main loop thread!!!
  52 
  53 extern gboolean disableGrab;
  54 
  55 static gboolean call_runnable (gpointer data)
  56 {
  57     RunnableContext* context = reinterpret_cast<RunnableContext*>(data);
  58 
  59     JNIEnv *env;
  60     int envStatus = javaVM->GetEnv((void **)&env, JNI_VERSION_1_6);
  61     if (envStatus == JNI_EDETACHED) {
  62         javaVM->AttachCurrentThread((void **)&env, NULL);
  63     }
  64 
  65     env->CallVoidMethod(context->runnable, jRunnableRun, NULL);
  66     LOG_EXCEPTION(env);
  67     env->DeleteGlobalRef(context->runnable);
  68     free(context);
  69 
  70     if (envStatus == JNI_EDETACHED) {
  71         javaVM->DetachCurrentThread();
  72     }
  73 
  74     return FALSE;
  75 }
  76 
  77 extern "C" {
  78 
  79 /*
  80  * Class:     com_sun_glass_ui_gtk_GtkApplication
  81  * Method:    _isDisplayValid
  82  * Signature: ()Z
  83  */
  84 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_gtk_GtkApplication__1isDisplayValid
  85   (JNIEnv * env, jclass clazz)
  86 {
  87     (void)env;
  88     (void)clazz;
  89 
  90     return is_display_valid();
  91 }
  92 
  93 #pragma GCC diagnostic push


< prev index next >