SFML community forums

General => Feature requests => Topic started by: Boogiwoogie on March 16, 2009, 12:55:54 pm

Title: cross platform clipboard support?
Post by: Boogiwoogie on March 16, 2009, 12:55:54 pm
Hi! This is my first post to smfl-forum, and i put it a feature request right away :D
In my opinion it would be useful to get text from the clipboard easily, e.g. if i use the network code from sfml and set up a server. To test it, i could send my ip via skype or icq to a friend, and he just copy'n'pastes it into the gui.
I dont see any need for other cliboard support other than text. Maybe images, but that would be rather complex to implement?

Hello from Germany,
boogie

ps: keep up the good work! I like nice and not-overloaded libraries :!:
Title: cross platform clipboard support?
Post by: Laurent on March 16, 2009, 01:52:52 pm
I think clipboard support is clearly out of scope for a multimedia library.
Title: cross platform clipboard support?
Post by: Boogiwoogie on March 16, 2009, 02:47:51 pm
Quote from: "Laurent"
I think clipboard support is clearly out of scope for a multimedia library.

good. its been just a suggestion. do you know some lightweight clipboard library, that supports win/lin/mac? i googled along (tho didnt invest too much time on that) but couldnt find something easy to use, that was not java :?

boogie
Title: cross platform clipboard support?
Post by: Tank on March 16, 2009, 03:01:42 pm
Yeah, it's out of scope. But would also be very useful, for example for a situation Boogiwoogie described in the opener. But I  guess it's nothing elemental.
Btw., instead of using IPs, you could get yourself a dynamic DNS name.
Title: cross platform clipboard support?
Post by: nfries88 on April 11, 2009, 08:12:13 pm
Quote from: "Laurent"
I think clipboard support is clearly out of scope for a multimedia library.


Arguably so is threading (except internally as required for seamless cross-platforming) and networking definitely is, yet SFML provides those.

Copying is used in most graphical applications, from text editors to image manipulation programs to video games to web browsers. So I would certainly say it's not at all a bad idea to provide clipboard functionality.
Title: cross platform clipboard support?
Post by: Laurent on April 12, 2009, 11:17:16 am
Quote
Arguably so is threading (except internally as required for seamless cross-platforming) and networking definitely is, yet SFML provides those.

Everything which is in sfml-system is not purely related to multimedia, it's more a core package on top of which every other package is built.
Network perfectly fits in a multimedia library. If a medium is a "storage and transmission tool used to store and deliver information or data" (wikipedia), then network is definitely one ;)

Quote
Copying is used in most graphical applications, from text editors to image manipulation programs to video games to web browsers. So I would certainly say it's not at all a bad idea to provide clipboard functionality.

So as tons of features related to GUI and windowing. But I can't make SFML as rich as Qt or wxWidgets. Even if I wanted to, I couldn't, there are so many things that have to be done before thinking about such things.
Title: cross platform clipboard support?
Post by: Groogy on April 12, 2009, 01:19:49 pm
Quote from: "Laurent"

So as tons of features related to GUI and windowing. But I can't make SFML as rich as Qt or wxWidgets. Even if I wanted to, I couldn't, there are so many things that have to be done before thinking about such things.


And making it into one of those looses the point of being a Multimedia Library turning it into a GUI Library instead.

I see SFML as an Object oriented way to open a window, start OpenGL Rendering contex, receive events and load images/sound, play sound, etc. etc. And it should stay that way. It should only "start" the stuff for us while we ourself have to choose which library we want to use for the interface, physics, or whatever we want to do :P
Title: cross platform clipboard support?
Post by: nfries88 on April 12, 2009, 04:47:52 pm
Quote from: "Laurent"
Quote
Arguably so is threading (except internally as required for seamless cross-platforming) and networking definitely is, yet SFML provides those.

Everything which is in sfml-system is not purely related to multimedia, it's more a core package on top of which every other package is built.
Network perfectly fits in a multimedia library. If a medium is a "storage and transmission tool used to store and deliver information or data" (wikipedia), then network is definitely one ;)

x.x

Quote from: "Laurent"
Quote
Copying is used in most graphical applications, from text editors to image manipulation programs to video games to web browsers. So I would certainly say it's not at all a bad idea to provide clipboard functionality.

So as tons of features related to GUI and windowing. But I can't make SFML as rich as Qt or wxWidgets. Even if I wanted to, I couldn't, there are so many things that have to be done before thinking about such things.

Well I wouldn't want that, either. I like the freedom to develop my own GUI and have it work internally exactly how I want, and without bloat added so that everyone can have the GUI work exactly how they want.

However, clipboard is not really related to GUI at all... I'm not expecting SFML to handle copying and pasting for me, and definitely not how to use information on the clipboard (IE, rendering an image).
Just how to add data to the clipboard and get data from the clipboard, which follows similar semantics on every system and would be a very small addition to the library.

Code: [Select]
std::string text = sf::clipboard::getData();
...
sf::clipboard::addData(text);

It really just needs to be that simple.
Title: cross platform clipboard support?
Post by: Laurent on April 12, 2009, 07:15:47 pm
Quote
x.x

What does this mean ? :lol:

Quote
Just how to add data to the clipboard and get data from the clipboard, which follows similar semantics on every system and would be a very small addition to the library.

Clipboard support is a little more complicated than that. You can have several types of data, which can be text-based or not.
Anyway, it's not the point, I still have too many things to do before thinking about a possible clipboard support.
Title: cross platform clipboard support?
Post by: Core Xii on April 12, 2009, 07:19:52 pm
Quote from: "Laurent"
If a medium is a "storage and transmission tool used to store and deliver information or data" (wikipedia), then network is definitely one ;)


Are you saying clipboard doesn't fit that? It's for storing and delivering information or data as well.
Title: cross platform clipboard support?
Post by: nfries88 on April 12, 2009, 07:30:28 pm
Quote from: "Laurent"
Quote
Just how to add data to the clipboard and get data from the clipboard, which follows similar semantics on every system and would be a very small addition to the library.

Clipboard support is a little more complicated than that. You can have several types of data, which can be text-based or not.
Anyway, it's not the point, I still have too many things to do before thinking about a possible clipboard support.


Well, yes, there's multiple types of data.

I could write clipboard functions for Win32 and Unix/X11, but I don't have Mac OS X so I couldn't test anything for that. You don't need to do it all yourself, but if it wasn't going to be used anyway I wouldn't waste my time on developing it..
Title: cross platform clipboard support?
Post by: nfries88 on October 30, 2010, 09:47:33 pm
Sorry for bumping a rather old topic, but how is clipboard access outside the scope of a multimedia application?

Some media players make use of drag'n'drop for rearranging media library.
Image editing programs make use of clipboard (and sometimes drag'n'drop) for copying images.
Online games frequently make use of text clipboard access for copy/pasting text.

I at least see the merits of exposing a cross-platform clipboard API to multimedia applications, even if you don't.
Title: cross platform clipboard support?
Post by: Nexus on October 31, 2010, 01:58:36 pm
I would also find a clipboard very useful. Even if it only includes text, it makes stuff like GUIs a lot more comfortable.
Title: cross platform clipboard support?
Post by: panithadrum on November 01, 2010, 06:57:08 pm
For clipboard I just include QtCore to my project. It works pretty well
Title: cross platform clipboard support?
Post by: Nexus on November 01, 2010, 07:37:39 pm
Actually, Qt is quite a big dependency for such a small task.

Does anybody know a rather lightweight library which supports clipboards (and maybe a few other features)?
Title: cross platform clipboard support?
Post by: Laurent on November 01, 2010, 07:57:14 pm
QtCore is not that big. It's a single dependency, and its size is not huge.
Title: cross platform clipboard support?
Post by: Silvah on November 01, 2010, 10:36:06 pm
Surely you must be talking about totally different QtCore than Nexus does.
Title: cross platform clipboard support?
Post by: nfries88 on November 02, 2010, 02:31:31 am
QtCore does not appear to contain QClipboard, however. Probably because the clipboard is bound to the windowing system on most systems; and QtCore is for things not dealing with the GUI.
Title: Re: cross platform clipboard support?
Post by: Jaffa on April 30, 2012, 10:35:44 pm
Hey,
is now a clipboard class or something like that planed? I tried to code my own and to do it on WIndows is easy, but Linux and MacOS....   :-\ Also I donĀ“t want to include a extra lib like QT, GTK+, vxxWidget....
Title: Re: cross platform clipboard support?
Post by: Laurent on April 30, 2012, 10:43:12 pm
Quote
is now a clipboard class or something like that planed?
No.
Title: Re: cross platform clipboard support?
Post by: Phanoo on July 19, 2017, 10:41:01 am
don't bother with Laurent he's just lazy. Implementing the clipboard would take less time than arguing in this thread like he did. SDL has it (and is also a "simple multimedia library") so i suggest you just switch to SDL  ;D
Title: Re: cross platform clipboard support?
Post by: korczurekk on July 19, 2017, 10:48:29 am
Yeah, lazy as hell. I mean, just look at his contributions to SFML: https://github.com/SFML/SFML/graphs/contributors (https://github.com/SFML/SFML/graphs/contributors), he has literally done nothing, right?

Btw after you are done with pointing out laurent's laziness, you may want to check out this PR: https://github.com/SFML/SFML/pull/1221 (https://github.com/SFML/SFML/pull/1221).
Title: Re: cross platform clipboard support?
Post by: Rosme on July 19, 2017, 03:08:32 pm
Just consider the fact that this is a 2012 thread. It is not relevant anymore.
Title: Re: cross platform clipboard support?
Post by: Laurent on July 19, 2017, 03:27:32 pm
Please refer to the latest forum thread, which summarizes everything that has been said and done about clipboard support in SFML:
https://en.sfml-dev.org/forums/index.php?topic=21693.0