SDL Clipboard API prototype/proposal

Hi all,
There has been off-and-on talk over the years about adding clipboard
support to SDL. I finally got my stuff together, cleaned it up a
little, and just pushed it up into a public repository for everybody
to see and complain about.

The repository is at:
http://www.assembla.com/spaces/SDL_Clipboard

And I have a blog entry detailing some things at:
http://playcontrol.net/ewing/jibberjabber/SDL_ClipboardPrototype.html

My hope is we can get a fully working implementation and a nice clean
API we can all agree on and get the green light for official inclusion
into SDL 1.3. (I will need help porting that as the current code is
based on SDL 1.2.)

Anyway, feedback and enhancements are welcome.

Thanks,
Eric

I navigated to here:

http://www.assembla.com/spaces/SDL_Clipboard/trac_mercurial_tool

Which gave me the “Mercurial URL”

donny at teamspace:~$ hg checkout http://hg.assembla.com/SDL_Clipboard
abort: no repo found!

I’ve only used Mercurial to check out one other project, so I don’t
really know what I’m doing. Any help downloading your work would be
appreciated.

Also:

I believe there is a fix in SDL SVN for reading “upside-down” BMP
files (your patch?)

Also, have you blogged on the implementation details for each
platform’s “clipboard” function? Or is there a source of information
you’d recommend checking out to learn about it? I just want to have
something to help read your code when I get my hands on it.–
http://codebad.com/

Hi Donny,
Thanks for trying to look at this:

donny at teamspace:~$ hg checkout http://hg.assembla.com/SDL_Clipboard
abort: no repo found!

You used the wrong keyword. The keyword is ‘clone’.
hg clone http://hg.assembla.com/SDL_Clipboard

I’ve only used Mercurial to check out one other project, so I don’t
really know what I’m doing. Any help downloading your work would be
appreciated.

You ‘hg clone’ to get an initial copy.

If I push new changes into the main repo and you want to pull them
into yours, you
you will ‘hg pull’ to get changes and ‘hg update’ (or 'hg merge’
depending) to apply the pulled changes into your local copy.

Roughly speaking:
hg clone == svn checkout
hg pull + hg update == svn update

That’s pretty much all there is to it.

Also:

I believe there is a fix in SDL SVN for reading “upside-down” BMP
files (your patch?)

Yes, SDL bug 724 mentioned on both the main Assembla page and my blog
is the bug I filed. I included the fix.

Also, have you blogged on the implementation details for each
platform’s “clipboard” function? Or is there a source of information
you’d recommend checking out to learn about it? I just want to have
something to help read your code when I get my hands on it.

I didn’t say much about the implementation details except that I try
to leverage the native known types on Mac and Windows for text and
BMPs. Mac actually doesn’t have a native clipboard BMP type, but it
has a TIFF type which I then convert. Interesting, Windows has a TIFF
type too I believe, but since SDL natively supports only BMP in the
core, I didn’t use it.

The Mac implementation is all mine. It’s pretty standard Cocoa 101
stuff. Hillegass’s Cocoa book is my favorite reference for this kind
of stuff and I’m sure I took from it.

The other implementations are ripped directly from Sam’s SDL_Scrap
implementation and then modified to meet my requirements. I know I
completely broke the QNX. I don’t trust the X11. The Windows one is
working well enough for me.

Thanks,
Eric