boolean setData(Object[] data, Transfer[] dataTypes) { return setData(data, dataTypes, DND.CLIPBOARD);
boolean setData(Clipboard owner, Object[] data, Transfer[] dataTypes, int clipboards) { GtkTargetEntry[] entries = new  GtkTargetEntry [0]; int  pTargetsList = 0; try { for (int i = 0; i < dataTypes.length; i++) { Transfer transfer = dataTypes[i]; int[] typeIds = transfer.getTypeIds(); String[] typeNames = transfer.getTypeNames(); for (int j = 0; j < typeIds.length; j++) { GtkTargetEntry	entry = new GtkTargetEntry(); entry.info = typeIds[j]; byte[] buffer = Converter.wcsToMbcs(null, typeNames[j], true); int  pName = OS.g_malloc(buffer.length); OS.memmove(pName, buffer, buffer.length); entry.target = pName; GtkTargetEntry[] tmp = new GtkTargetEntry [entries.length + 1]; System.arraycopy(entries, 0, tmp, 0, entries.length); tmp[entries.length] = entry; entries = tmp; } }  pTargetsList = OS.g_malloc(GtkTargetEntry.sizeof * entries.length); int offset = 0; for (int i = 0; i < entries.length; i++) { OS.memmove(pTargetsList + offset, entries[i], GtkTargetEntry.sizeof); offset += GtkTargetEntry.sizeof; } if ((clipboards & DND.CLIPBOARD) != 0) { if (activeClipboard != null) OS.gtk_clipboard_clear(Clipboard.GTKCLIPBOARD); clipboardData = data; clipboardDataTypes = dataTypes; int getFuncProc = getFunc.getAddress(); int clearFuncProc = clearFunc.getAddress(); if (!OS.gtk_clipboard_set_with_data(Clipboard.GTKCLIPBOARD, pTargetsList, entries.length, getFuncProc, clearFuncProc, 0)) { return false; } activeClipboard = owner; } if ((clipboards & DND.SELECTION_CLIPBOARD) != 0) { if (activePrimaryClipboard != null) OS.gtk_clipboard_clear(Clipboard.GTKPRIMARYCLIPBOARD); primaryClipboardData = data; primaryClipboardDataTypes = dataTypes; int getFuncProc = getFunc.getAddress(); int clearFuncProc = clearFunc.getAddress(); if (!OS.gtk_clipboard_set_with_data(Clipboard.GTKPRIMARYCLIPBOARD, pTargetsList, entries.length, getFuncProc, clearFuncProc, 0)) { return false; } activePrimaryClipboard = owner; } return true; } finally { for (int i = 0; i < entries.length; i++) { GtkTargetEntry entry = entries[i]; if( entry.target != 0) OS.g_free(entry.target); } if (pTargetsList != 0) OS.g_free(pTargetsList); }
boolean setData(Object[] data, Transfer[] dataTypes) {	return setData(data, dataTypes, DND.CLIPBOARD);}