// send back a list of supported conversion targets
if (*target == targetsAtom) {
if (!(array = (Atom *)XtMalloc(sizeof(Atom)*2))) {
return False;
}
array[0] = CompoundTextAtom; // support both compound_text and
array[1] = XA_STRING; // string
*value = (XtPointer)array;
*type = XA_ATOM;
*format = 32;
*length = 2;
return True;
// Convert to compound_text
} else if (*target == CompoundTextAtom) {
XTextProperty tpr;
*value = currentSelection->getCString();
// from multi-byte to compound_text
XmbTextListToTextProperty (XtDisplay(widget), (char**)value, 1,
XCompoundTextStyle, &tpr);
*value = tpr.value;
*length = tpr.nitems;
*type = CompoundTextAtom;
*format = 8; // 8-bit elements
return True;
// Convert to string
} else if (*target == XA_STRING) {
*value = XtNewString(currentSelection->getCString());
*length = currentSelection->getLength();
*type = XA_STRING;
*format = 8; // 8-bit elements
return True;
}