64 |
if (target_data != NULL && target_data->length > 0) |
if (target_data != NULL && target_data->length > 0) |
65 |
{ |
{ |
66 |
include_text = gtk_selection_data_targets_include_text (target_data); |
include_text = gtk_selection_data_targets_include_text (target_data); |
67 |
|
|
68 |
|
#if GTK_MINOR_VERSION > 4 |
69 |
include_image = gtk_selection_data_targets_include_image (target_data, |
include_image = gtk_selection_data_targets_include_image (target_data, |
70 |
TRUE); |
TRUE); |
71 |
|
#endif |
72 |
if (gtk_selection_data_get_targets (target_data, &targets, &targets_len)) |
if (gtk_selection_data_get_targets (target_data, &targets, &targets_len)) |
73 |
{ |
{ |
74 |
int i; |
int i; |
273 |
return; |
return; |
274 |
} |
} |
275 |
|
|
276 |
|
#if GTK_MINOR_VERSION > 4 |
277 |
gdk_threads_enter (); |
gdk_threads_enter (); |
278 |
gtk_clipboard_request_image (cp_gtk_clipboard, |
gtk_clipboard_request_image (cp_gtk_clipboard, |
279 |
clipboard_image_received, |
clipboard_image_received, |
280 |
(gpointer) selection_obj); |
(gpointer) selection_obj); |
281 |
gdk_threads_leave (); |
gdk_threads_leave (); |
282 |
|
#else |
283 |
|
clipboard_image_received (cp_gtk_clipboard, NULL, (gpointer) selection_obj); |
284 |
|
#endif |
285 |
} |
} |
286 |
|
|
287 |
static jmethodID urisAvailableID; |
static jmethodID urisAvailableID; |
297 |
jobject selection_obj = (jobject) selection; |
jobject selection_obj = (jobject) selection; |
298 |
JNIEnv *env = cp_gtk_gdk_env (); |
JNIEnv *env = cp_gtk_gdk_env (); |
299 |
|
|
300 |
|
#if GTK_MINOR_VERSION > 4 |
301 |
if (uri_data != NULL) |
if (uri_data != NULL) |
302 |
uris = gtk_selection_data_get_uris (uri_data); |
uris = gtk_selection_data_get_uris (uri_data); |
303 |
|
#else |
304 |
|
if (uri_data != NULL) |
305 |
|
uris = NULL; |
306 |
|
#endif |
307 |
|
|
308 |
if (uris != NULL) |
if (uris != NULL) |
309 |
{ |
{ |
310 |
int len, i; |
int len, i; |
338 |
JNIEXPORT void JNICALL |
JNIEXPORT void JNICALL |
339 |
Java_gnu_java_awt_peer_gtk_GtkSelection_requestURIs (JNIEnv *env, jobject obj) |
Java_gnu_java_awt_peer_gtk_GtkSelection_requestURIs (JNIEnv *env, jobject obj) |
340 |
{ |
{ |
341 |
|
#if GTK_MINOR_VERSION > 4 |
342 |
GdkAtom uri_atom; |
GdkAtom uri_atom; |
343 |
|
#endif |
344 |
jobject selection_obj; |
jobject selection_obj; |
345 |
selection_obj = (*env)->NewGlobalRef(env, obj); |
selection_obj = (*env)->NewGlobalRef(env, obj); |
346 |
if (selection_obj == NULL) |
if (selection_obj == NULL) |
357 |
return; |
return; |
358 |
} |
} |
359 |
|
|
360 |
|
#if GTK_MINOR_VERSION > 4 |
361 |
/* There is no real request_uris so we have to make one ourselves. */ |
/* There is no real request_uris so we have to make one ourselves. */ |
362 |
gdk_threads_enter (); |
gdk_threads_enter (); |
363 |
uri_atom = gdk_atom_intern ("text/uri-list", FALSE); |
uri_atom = gdk_atom_intern ("text/uri-list", FALSE); |
366 |
clipboard_uris_received, |
clipboard_uris_received, |
367 |
(gpointer) selection_obj); |
(gpointer) selection_obj); |
368 |
gdk_threads_leave (); |
gdk_threads_leave (); |
369 |
|
#else |
370 |
|
clipboard_uris_received (cp_gtk_clipboard, NULL, (gpointer) selection_obj); |
371 |
|
#endif |
372 |
} |
} |
373 |
|
|
374 |
static jmethodID bytesAvailableID; |
static jmethodID bytesAvailableID; |