LaurentGomila/SFML — pull request #715 by Mischa-Alff (2014-10-07 15:23:03+00:00)
Title: Clipboard Support

Please don't merge this yet. As of writing this, this PR is for review purposes.

I've added clipboard support to SFML for Windows and Linux (X11). Still working on Android.
This PR also adds a clipboard example (which is primarily for testing, but also serves as a viable example for the usage of the clipboard API).

The API is simple. The user sees it as: `sf::String sf::Window::getClipboard()` and `void sf::Window::setClipboard(const sf::String&)`.

Clipboard support is really important. All of SFML's competitors have it built-in, and using 3rd-party software for it often is buggy or doesn't work. I've added clipboard support because it's not only essential to game development (copy & pasting links to chat or IPs to the server browser, or copying level codes to the clipboard in case you're going for a Gameboy style), but it's also essential to general application development.

For now the API only supports text. Image support is more complicated and not as much of a necessity as text support is.

The X11 implementation is fully ICCCM compliant.

I tried my best to make the code coherent and to comment everything. It was my first time working with X11 (and thus Xproto and xcb), so there may be some issues with it.

This PR uses the XCB patch.