/[classpath]/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c
ViewVC logotype

Diff of /classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mark, Mon Aug 22 10:36:15 2005 UTC revision 1.2 by mark, Sat Sep 3 23:43:12 2005 UTC
# Line 64  clipboard_targets_received (GtkClipboard Line 64  clipboard_targets_received (GtkClipboard
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;
# Line 270  Java_gnu_java_awt_peer_gtk_GtkSelection_ Line 273  Java_gnu_java_awt_peer_gtk_GtkSelection_
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;
# Line 290  clipboard_uris_received (GtkClipboard *c Line 297  clipboard_uris_received (GtkClipboard *c
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;
# Line 326  clipboard_uris_received (GtkClipboard *c Line 338  clipboard_uris_received (GtkClipboard *c
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)
# Line 343  Java_gnu_java_awt_peer_gtk_GtkSelection_ Line 357  Java_gnu_java_awt_peer_gtk_GtkSelection_
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);
# Line 351  Java_gnu_java_awt_peer_gtk_GtkSelection_ Line 366  Java_gnu_java_awt_peer_gtk_GtkSelection_
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;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26