[SDL] SDL Clipboard API: Recommendations based on research

Nathaniel J Fries nfries88 at yahoo.com
Tue Jul 20 05:52:13 PDT 2010


Sam Lantinga wrote:
> There's also a cross-platform difference between X11 and Windows and
> Mac OS X: On Windows and Mac OS X you can inexpensively generate an
> event when the clipboard contents changes.  As far as I can tell on
> X11 you have to do a fairly expensive poll to achieve the same result.
> 
> Anyway, FYI...
> 


I was not suggesting that at all.
When you paste from an X11 clipboard, you must request the contents from the selection.
The selection's contents are then sent to you through an X11 event.
This event is the "SDL_ClipEvent" in my original suggestion.
I thought I had made this clear in #3 of "What I've found..." at the beginning of my suggestion.

Following the same train of thought, the "SDL_WaitClipData" would simply wait until the requested event was received. Not until there was actually data on the clipboard.

And yes, storing images would be complicated. On Win32, you must convert it to a HBITMAP. On OS X, you have options. I don't know about how it's done on X11, but I imagine you could find out by looking at GIMP or Mozilla Firefox source code for X11.

------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100720/54b86126/attachment-0008.htm>


More information about the SDL mailing list