On Donnerstag, 3. Mai 2007 +0100, Ryo Furue wrote: > Hi all, > > I'm wondering how the clipboard works with Adobe Reader. > When you select a portion of text in Adobe Reader and copy it > to the clipboard, you can paste it to anywhere including emacs, > and kolourpaint. But, when you select graphics, you can't paste > it anywhere, although Adobe Reader says the graphics is copied > to "the clipboard". (kpdf works correctly, by the way.) > I'm using Debian testing. Where did you try pasting to? If you haven't, can you check another GKT+ based program, e.g. Gimp? > So, what does Adobe Reader do incorrectly? or what clipboard > does it use? What clipboard does KDE use? Is there any > standard, which enables KDE, Gnome, and other applications > to share a common clipboard? I could just file a bug report > to Adobe, saying that their clipboard doesn't work on KDE, > but I'm curious. All applications usually use the same clipboard. Unless Adobe did their own clipboard handling, they will even use it the same way any other GTK+ application does. However there can still be unfortunate "misunderstandings" between application: the application which copies something into the clipboard announces in which MIME types it can offer the content and the application which pastes chooses one of them and requests the content formatted according to this MIME type. Sometimes it happens that the pasting application chooses a suboptimal MIME type, e.g. something that suits its needs better but does loose some of the content. Sometimes they just try a couple of known types and use the first that matches, without checking for a more appropriate one. Sometimes the copying application puts too much information into one single MIME type offer, leading to recognition problems on the pasting application's side. If you are interested in investigating, I've written a small test program which dumps the MIME type a Qt program will see on the clipboard. % qmake clipboardtest.pro % make You have to run it from a console window, because it just writes its output to the console. Run it, do the copy operation oin Adobe reader and then click the button in the test program. Should dump a list of MIME types currently offered on the clipboard to the console the test program was started in. Cheers, Kevin -- Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring
#include <qapplication.h> #include <qclipboard.h> #include <qpushbutton.h> class ClipboardDump : public QObject { Q_OBJECT public: ClipboardDump() {} public slots: void dump() { QClipboard* clipboard = QApplication::clipboard(); QMimeSource* source = clipboard->data(); int i = 0; for (; source->format(i) != 0; ++i) { qDebug("format(%d)='%s'", i, source->format(i)); } qDebug("%d formats\n", i); } }; int main(int argc, char** argv) { QApplication app(argc, argv); QPushButton button("Dump", 0); ClipboardDump dump; QObject::connect(&button, SIGNAL(clicked()), &dump, SLOT(dump())); app.setMainWidget(&button); button.show(); app.exec(); } #include "clipboardtest.moc"
TEMPLATE = app CONFIG += qt console TARGET = clipboardtest SOURCES = clipboardtest.cpp
Attachment:
pgpwWp8zCppmC.pgp
Description: PGP signature
___________________________________________________ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.