Hi!

On top of my PDF pasting patch from some days ago I added experimental LinkBack [1] support to LyX.

* Concept

The basic concept is that you paste objects from LinkBack enabled application (e.g. OmniGraffle [2]) and LyX will store the PDF representation _and_ the LinkBack data (by appending .linkback to the filename). The latter is the original document format of the so called "LinkBack server application".

If you click on the edit button now in the Graphics dialog the server application is launched by the LinkBack framework and the LinkBack data is sent back to it for editing. After modifying and saving, the updated LinkBack data and the updated PDF is sent back to LyX. LyX will update the files and redisplay the PDF (see P.S.).

* Cross-Platform

The code is restricted to PDFs at the moment and linked to the LinkBack framework. But there is no reason not to do something similar in Windows via its OLE objects. If anybody is interested in such things, it shouldn't be too hard to introduce more abstraction to share code between Mac and Windows.

* Implementation

The Implementation is based on the official Objective-C framework which I wrap in a C++ LinkBackProxy class. This is used in CutAndPaste.cpp (to get the LinkBack data from the clipboard into the foo.pdf.linkback file) and in the EmbeddedFile objects in Buffer::embeddedFiles() (to hold the connection when editing a .linkback graphic, and to handle the updated data).

The LinkBackProxy class has two signals for lost connections and the update notification that the server sent back the modified document. These are connected to the EmbeddedFile objects during editing.

Stefan

P.S.: How do I force a InsetGraphics to re-convert the source files to display on screen? In the file cache code there is some kind of monitoring. Is this supposed to monitor the source file (the PDF in my case)? If yes, it does not work here.

P.P.S.: I am not sure whether the EmbeddedFile class is the right place to add the callbacks to update the files. Another possible place would probably be directly in Buffer. But then this code would also use the EmbeddedFiles member to get the inset for certain files I guess.

[1] http://www.linkbackproject.org/
[2] http://www.omnigroup.com/applications/omnigraffle/


Attachment: 0001-experimental-pdf-paste.patch
Description: Binary data

Attachment: 0003-experimental-Mac-linkback-support-see-http-www.patch
Description: Binary data

Attachment: 0002-ask-for-filename-for-pasted-PDFs-to-save-them.patch
Description: Binary data

Reply via email to