private int[] getAvailablePrimaryTypes() { int[] types = new int[0]; long /*int*/ selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); long /*int*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; } private int[] getAvailableClipboardTypes () {
private int[] getAvailablePrimaryTypes() { int[] types = new int[0]; int /*long*/ selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); int /*long*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; } private int[] getAvailableClipboardTypes () {
private int[] getAvailablePrimaryTypes() { int[] types = new int[0]; int /*long*/ selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); int /*long*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; } private int[] getAvailableClipboardTypes () {
private int[] getAvailableClipboardTypes () { int[] types = new int[0]; long /*int*/ selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); long /*int*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; }
private int[] getAvailableClipboardTypes () { int[] types = new int[0]; int /*long*/ selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); int /*long*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; }
private int[] getAvailableClipboardTypes () { int[] types = new int[0]; int /*long*/ selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, TARGET); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); if (selection_data != 0) { try { int length = OS.gtk_selection_data_get_length(selection_data); int format = OS.gtk_selection_data_get_format(selection_data); int /*long*/ data = OS.gtk_selection_data_get_data(selection_data); if (length != 0) { types = new int[length * 8 / format]; OS.memmove(types, data, length); } } finally { OS.gtk_selection_data_free(selection_data); } } return types; }
for (int i = 0; i < typeIds.length; i++) { if ((clipboards & DND.CLIPBOARD) != 0) { selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, typeIds[i]); selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, typeIds[i]);
for (int i = 0; i < typeIds.length; i++) { if ((clipboards & DND.CLIPBOARD) != 0) { selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, typeIds[i]); selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, typeIds[i]);
for (int i = 0; i < typeIds.length; i++) { if ((clipboards & DND.CLIPBOARD) != 0) { selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, typeIds[i]); selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, typeIds[i]);