checkpoint. more UTF8 clipboard stuff.

This commit is contained in:
crs 2002-07-22 18:17:21 +00:00
parent bb966cdd65
commit c4f21ce29b
1 changed files with 14 additions and 14 deletions

View File

@ -151,17 +151,22 @@ CXWindowsClipboard::addSimpleRequest(Window requestor,
type = getTimestampData(data, &format); type = getTimestampData(data, &format);
} }
else { else {
char* name = XGetAtomName(m_display, target);
log((CLOG_INFO "request target: %d %s", target, name));
XFree(name);
IXWindowsClipboardConverter* converter = getConverter(target); IXWindowsClipboardConverter* converter = getConverter(target);
if (converter != NULL) {
log((CLOG_INFO "found converter"));
IClipboard::EFormat clipboardFormat = converter->getFormat(); IClipboard::EFormat clipboardFormat = converter->getFormat();
if (!m_added[clipboardFormat]) { log((CLOG_INFO "clipboard format: %d", clipboardFormat));
type = None; if (m_added[clipboardFormat]) {
} log((CLOG_INFO "added"));
else {
type = converter->getAtom(); type = converter->getAtom();
format = converter->getDataSize(); format = converter->getDataSize();
data = converter->fromIClipboard(m_data[clipboardFormat]); data = converter->fromIClipboard(m_data[clipboardFormat]);
} }
} }
}
if (type != None) { if (type != None) {
// success // success
@ -1152,19 +1157,14 @@ CXWindowsClipboard::getTargetsData(CString& data, int* format) const
data.append(reinterpret_cast<char*>(&atom), sizeof(Atom)); data.append(reinterpret_cast<char*>(&atom), sizeof(Atom));
// add targets we can convert to // add targets we can convert to
// XXX
log((CLOG_INFO "targets"));
for (ConverterList::const_iterator index = m_converters.begin(); for (ConverterList::const_iterator index = m_converters.begin();
index != m_converters.end(); ++index) { index != m_converters.end(); ++index) {
IXWindowsClipboardConverter* converter = *index; IXWindowsClipboardConverter* converter = *index;
// skip formats we don't have // skip formats we don't have
if (!m_added[converter->getFormat()]) { if (m_added[converter->getFormat()]) {
atom = converter->getAtom(); atom = converter->getAtom();
data.append(reinterpret_cast<char*>(&atom), sizeof(Atom)); data.append(reinterpret_cast<char*>(&atom), sizeof(Atom));
char* name = XGetAtomName(m_display, atom);
log((CLOG_INFO " %d %s", atom, name));
XFree(name);
} }
} }