Re: Clipboard improvements, II

At 04:40 25.05.04, James Henstridge wrote:
On 25/05/2004 6:38 AM, Hans Breuer wrote:

But it still does not support copying image via Clipboard, or di I miss this? I should have been more clear with what I would like to be able to do :

- copy images to clipboard via cross-platform gtk/gdk code (could replace my winclipboard plug-in delivered with Gimp)

- copy vector data to Clipboard (one of the major drawbacks of Dia - at least on windoze - is it's diability to just copy some stuff and paste it into say word)

Under X, the contents of a selection is represented as an array of 8-bit, 16-bit or 32-bit quantities (the last two are provided to allow transfer of 16-bit and 32-bit quantities between clients with different endians).

An image or vector diagram can be represented as binary data, so transferring it as a selection is no more difficult than transferring text. It is just necessary for the two end points to agree on a target name.

To get interoperability with existing apps under Windows, you would need to know the target names that native apps use, and the format they transfer data in. If there was a GtkClipboard API for "copy this pixbuf", then the Windows version would probably want to advertise the data in the appropriate well known forms.

The problem is not to "advertise the data in the appropriate well known forms" (It is already solved by the winclipboard plug-in". Problem is that this kind of stuff is completely missing in the GtkClipboard API.

From a brief look at the OLE clipboard docs on MSDN, it doesn't look like there is that big a difference in how the two act. Mozilla has a cross platform API with implementations for win32 and X clipboard, so it must be possible ...

Yeah, obviously it is possible on win32 - even without OLE. The Clipboard API works with shared memory (i.e. GlobalAlloc see gimp/plug-ins/common/winclipboard.c). But on X it appears to be either so complicated or so unusual to do/want this, that nobody bothers to implement it ...

My point is that Mozilla uses the OLE clipboard, which is quite similar to the X clipboard (advertise supported flavours/targets on copy, delay the rendering of data and transfer until paste). The relevant files implementing Mozilla's Windows clipboard support are here:

Thanks for the pointers - but I still don't get why you insist on showing me how it is done on windoze. My point is that there apparently is no working standard on the X clipboard side. BTW: I've tried to copy an image from Mozilla (Phoenix 0.5) to the windoze clipboard. The only thing I ve got in the Clipboard was the alternate text ...

Doing the same from "the browser which should not be named" and pasting into The Gimp via File/Acquire/From Clipboard (my clipboard plug-in;) simply works.


-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]