Interfacing with platform clipboard

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Interfacing with platform clipboard

Andre Schnoor
We need to convert complex objects to/from the OS clipboard in order to
implement copy & paste interoperability with other applications (images,
sound, plain text, formatted text, etc). Mainly Apple OS X and Windows.

I found Screen to have primitives that interface with the platform
clipboard (strings only, though). I understand that different platforms
organize their clipboard differently, which is probably why there is yet
no means to access different "slots" of the clipboard data.

I think I can circumvent this limitation for a while by using manual
conversions to/from String, which is sufficient for "export" of data.
Anyway, in the mid term I'll need to also "import" data from popular
applications whose clipboard format can't be customized.

a) Do some sophisticated clipboard interfacing classes I didn't yet find
already exist?
b) Is there any possibility to get notified when the platform clipboard
changes?

Any suggestion is appreciated.

Andre


Reply | Threaded
Open this post in threaded view
|

AW: Interfacing with platform clipboard

Georg Heeg
André,

For Windows there is a solution available. It is located in a parcel called
UnicodeClipboardSupport. This package adds the functionality to copy
UnicodeStrings using the Windows clipboard. The real access is done in
Screen>getUnicodeExternalSelection.

Certainly this method accesses strings only by asking the clipboard to
provide CF_UNICODETEXT. You can use the same method to access any other type
of object Windows has in its clipboard.

For details you must read MSDN documentation though.

When you have extended the implementation, please share your findings.

Georg

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]]
Gesendet: Freitag, 9. Juni 2006 08:22
An: vwnc-list
Betreff: Interfacing with platform clipboard

We need to convert complex objects to/from the OS clipboard in order to
implement copy & paste interoperability with other applications (images,
sound, plain text, formatted text, etc). Mainly Apple OS X and Windows.

I found Screen to have primitives that interface with the platform
clipboard (strings only, though). I understand that different platforms
organize their clipboard differently, which is probably why there is yet
no means to access different "slots" of the clipboard data.

I think I can circumvent this limitation for a while by using manual
conversions to/from String, which is sufficient for "export" of data.
Anyway, in the mid term I'll need to also "import" data from popular
applications whose clipboard format can't be customized.

a) Do some sophisticated clipboard interfacing classes I didn't yet find
already exist?
b) Is there any possibility to get notified when the platform clipboard
changes?

Any suggestion is appreciated.

Andre



Reply | Threaded
Open this post in threaded view
|

Re: Interfacing with platform clipboard

Karsten Kusche
In reply to this post by Andre Schnoor
Hi Andre,

I can only speak about the MacOS X Clipboard, but I hope this helps you,
too.

You don't have a notification when the clipboard is changed, but there
is a changeCount in NSPasteboard that can be checked as often as you
want to see if the pasteboard changed.

As for the clipboard data: each application specifies all the types of
data it supplies to the clipboard, when something is copied. This
includes text in several kinds (styled text, plain text,...) as well as
picture data (Tiff, PICT, PDF, ...). The data for these types is
supplied by the application only on request.

I guess the same mechanisms apply on Windows, but I'm not sure.

Kind Regards
Karsten


Andre Schnoor schrieb:
 > We need to convert complex objects to/from the OS clipboard in order
to implement copy & paste interoperability with other applications
(images, sound, plain text, formatted text, etc). Mainly Apple OS X and
Windows.
 >
 > I found Screen to have primitives that interface with the platform
clipboard (strings only, though). I understand that different platforms
organize their clipboard differently, which is probably why there is yet
no means to access different "slots" of the clipboard data.
 >
 > I think I can circumvent this limitation for a while by using manual
conversions to/from String, which is sufficient for "export" of data.
Anyway, in the mid term I'll need to also "import" data from popular
applications whose clipboard format can't be customized.
 >
 > a) Do some sophisticated clipboard interfacing classes I didn't yet
find already exist?
 > b) Is there any possibility to get notified when the platform
clipboard changes?
 >
 > Any suggestion is appreciated.
 >
 > Andre
 >
 >
 >
 >