int xDisplay = OS.XtDisplay (shellHandle); if (xDisplay == 0) return new String[0]; int[] types = getAvailableTypes(xDisplay, clipboardAtom); int[] primaryTypes = getAvailableTypes(xDisplay, primaryAtom);
ClipboardProxy proxy = ClipboardProxy._getInstance(display); int[] types = proxy.getAvailableTypes(DND.CLIPBOARD); int[] primaryTypes = proxy.getAvailableTypes(DND.SELECTION_CLIPBOARD);
public String[] getAvailableTypeNames() {	checkWidget();	int xDisplay = OS.XtDisplay (shellHandle);	if (xDisplay == 0) return new String[0];	int[] types = getAvailableTypes(xDisplay, clipboardAtom);	int[] primaryTypes = getAvailableTypes(xDisplay, primaryAtom);	String[] names = new String[types.length + primaryTypes.length];	int index = 0;	for (int i = 0; i < types.length; i++) {		int ptr = OS.XmGetAtomName(xDisplay, types[i]);		int length = OS.strlen(ptr);		byte[] nameBuf = new byte[length];		OS.memmove(nameBuf, ptr, length);		OS.XtFree(ptr);		/* Use the character encoding for the default locale */		String name = new String(Converter.mbcsToWcs(null, nameBuf));		names[index++] = "CLIPBOARD "+name;	}	for (int i = 0; i < primaryTypes.length; i++) {		int ptr = OS.XmGetAtomName(xDisplay, primaryTypes[i]);		int length = OS.strlen(ptr);		byte[] nameBuf = new byte[length];		OS.memmove(nameBuf, ptr, length);		OS.XtFree(ptr);		/* Use the character encoding for the default locale */		String name = new String(Converter.mbcsToWcs(null, nameBuf));		names[index++] = "PRIMARY "+name;	}	return names;}