< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c

Print this page




  70 static void gtk3_remove_state(GtkWidget *widget, GtkStateType state) {
  71     GtkStateType old_state = fp_gtk_widget_get_state(widget);
  72     fp_gtk_widget_set_state(widget, old_state & ~state);
  73 }
  74 
  75 /* This is a workaround for the bug:
  76  * http://sourceware.org/bugzilla/show_bug.cgi?id=1814
  77  * (dlsym/dlopen clears dlerror state)
  78  * This bug is specific to Linux, but there is no harm in
  79  * applying this workaround on Solaris as well.
  80  */
  81 static void* dl_symbol(const char* name)
  82 {
  83     void* result = dlsym(gtk3_libhandle, name);
  84     if (!result)
  85         longjmp(j, NO_SYMBOL_EXCEPTION);
  86 
  87     return result;
  88 }
  89 
  90 gboolean gtk3_check(const char* lib_name, int flags)
  91 {
  92     if (gtk3_libhandle != NULL) {
  93         /* We've already successfully opened the GTK libs, so return true. */
  94         return TRUE;
  95     } else {
  96         return dlopen(lib_name, flags) != NULL;
  97     }
  98 }
  99 
 100 #define ADD_SUPPORTED_ACTION(actionStr)                                        \
 101 do {                                                                           \
 102     jfieldID fld_action = (*env)->GetStaticFieldID(env, cls_action, actionStr, \
 103                                                  "Ljava/awt/Desktop$Action;"); \
 104     if (!(*env)->ExceptionCheck(env)) {                                        \
 105         jobject action = (*env)->GetStaticObjectField(env, cls_action,         \
 106                                                                   fld_action); \
 107         (*env)->CallBooleanMethod(env, supportedActions, mid_arrayListAdd,     \
 108                                                                       action); \
 109     } else {                                                                   \
 110         (*env)->ExceptionClear(env);                                           \
 111     }                                                                          \
 112 } while(0);
 113 
 114 
 115 static void update_supported_actions(JNIEnv *env) {
 116     GVfs * (*fp_g_vfs_get_default) (void);




  70 static void gtk3_remove_state(GtkWidget *widget, GtkStateType state) {
  71     GtkStateType old_state = fp_gtk_widget_get_state(widget);
  72     fp_gtk_widget_set_state(widget, old_state & ~state);
  73 }
  74 
  75 /* This is a workaround for the bug:
  76  * http://sourceware.org/bugzilla/show_bug.cgi?id=1814
  77  * (dlsym/dlopen clears dlerror state)
  78  * This bug is specific to Linux, but there is no harm in
  79  * applying this workaround on Solaris as well.
  80  */
  81 static void* dl_symbol(const char* name)
  82 {
  83     void* result = dlsym(gtk3_libhandle, name);
  84     if (!result)
  85         longjmp(j, NO_SYMBOL_EXCEPTION);
  86 
  87     return result;
  88 }
  89 
  90 gboolean gtk3_check(const char* lib_name)
  91 {
  92     if (gtk3_libhandle != NULL) {
  93         /* We've already successfully opened the GTK libs, so return true. */
  94         return TRUE;
  95     } else {
  96         return dlopen(lib_name, RTLD_LAZY | RTLD_LOCAL) != NULL;
  97     }
  98 }
  99 
 100 #define ADD_SUPPORTED_ACTION(actionStr)                                        \
 101 do {                                                                           \
 102     jfieldID fld_action = (*env)->GetStaticFieldID(env, cls_action, actionStr, \
 103                                                  "Ljava/awt/Desktop$Action;"); \
 104     if (!(*env)->ExceptionCheck(env)) {                                        \
 105         jobject action = (*env)->GetStaticObjectField(env, cls_action,         \
 106                                                                   fld_action); \
 107         (*env)->CallBooleanMethod(env, supportedActions, mid_arrayListAdd,     \
 108                                                                       action); \
 109     } else {                                                                   \
 110         (*env)->ExceptionClear(env);                                           \
 111     }                                                                          \
 112 } while(0);
 113 
 114 
 115 static void update_supported_actions(JNIEnv *env) {
 116     GVfs * (*fp_g_vfs_get_default) (void);


< prev index next >