/* gtkimage.c
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
int width, height;
GdkPixbuf *pixbuf;
- gdk_threads_enter ();
-
/* Don't use the JCL convert function because it throws an exception
on failure */
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
- {
- gdk_threads_leave ();
- return JNI_FALSE;
- }
+ return JNI_FALSE;
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
if (pixbuf == NULL)
{
(*env)->ReleaseStringUTFChars (env, name, filename);
- gdk_threads_leave ();
return JNI_FALSE;
}
setWidthHeight(env, obj, width, height);
(*env)->ReleaseStringUTFChars (env, name, filename);
- gdk_threads_leave ();
-
return JNI_TRUE;
}
int width;
int height;
- gdk_threads_enter ();
-
src = (*env)->GetByteArrayElements (env, data, NULL);
len = (*env)->GetArrayLength (env, data);
if (pixbuf == NULL)
{
createRawData (env, obj, NULL);
-
- gdk_threads_leave ();
-
return JNI_FALSE;
}
createRawData (env, obj, pixbuf);
setWidthHeight(env, obj, width, height);
- gdk_threads_leave ();
-
return JNI_TRUE;
}
{
int width, heigth;
GdkPixbuf *pixbuf = (GdkPixbuf *) getData (env, obj);
- gdk_threads_enter ();
width = gdk_pixbuf_get_width (pixbuf);
heigth = gdk_pixbuf_get_height (pixbuf);
- gdk_threads_leave ();
setWidthHeight(env, obj, width, heigth);
}
jint *result_array_iter, *dst;
int i,j;
- gdk_threads_enter ();
-
pixbuf = cp_gtk_image_get_pixbuf (env, obj);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
(*env)->ReleaseIntArrayElements (env, result_array, result_array_iter, 0);
- gdk_threads_leave ();
-
return result_array;
}
jint *src_array_iter, *src;
int i;
- gdk_threads_enter ();
-
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
}
(*env)->ReleaseIntArrayElements (env, pixels, src_array_iter, 0);
-
- gdk_threads_leave ();
}
/**
jclass cls;
jfieldID field;
- gdk_threads_enter ();
-
cls = (*env)->GetObjectClass (env, obj);
field = (*env)->GetFieldID (env, cls, "width", "I");
g_assert (field != 0);
else
createRawData (env, obj, gdk_pixmap_new (NULL, width, height,
gdk_rgb_get_visual ()->depth));
-
- gdk_threads_leave ();
}
/**
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkImage_freePixmap(JNIEnv *env, jobject obj)
{
- gdk_threads_enter ();
if (offScreen (env, obj) == JNI_FALSE)
gdk_pixbuf_unref ((GdkPixbuf *)getData (env, obj));
else
g_object_unref ((GdkPixmap *)getData (env, obj));
-
- gdk_threads_leave ();
}
/**
GdkPixbuf *pixbuf;
- gdk_threads_enter ();
-
cls = (*env)->GetObjectClass (env, destination);
field = (*env)->GetFieldID (env, cls, "width", "I");
g_assert (field != 0);
gdk_pixbuf_unref (pixbuf);
createRawData (env, destination, (void *)dst);
-
- gdk_threads_leave ();
}
/**