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,15 +151,20 @@ 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);
IClipboard::EFormat clipboardFormat = converter->getFormat(); if (converter != NULL) {
if (!m_added[clipboardFormat]) { log((CLOG_INFO "found converter"));
type = None; IClipboard::EFormat clipboardFormat = converter->getFormat();
} log((CLOG_INFO "clipboard format: %d", clipboardFormat));
else { if (m_added[clipboardFormat]) {
type = converter->getAtom(); log((CLOG_INFO "added"));
format = converter->getDataSize(); type = converter->getAtom();
data = converter->fromIClipboard(m_data[clipboardFormat]); format = converter->getDataSize();
data = converter->fromIClipboard(m_data[clipboardFormat]);
}
} }
} }
@ -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);
} }
} }