Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: cross platform clipboard support?  (Read 16687 times)

0 Members and 1 Guest are viewing this topic.

Boogiwoogie

  • Newbie
  • *
  • Posts: 19
    • View Profile
cross platform clipboard support?
« 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 :!:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
cross platform clipboard support?
« Reply #1 on: March 16, 2009, 01:52:52 pm »
I think clipboard support is clearly out of scope for a multimedia library.
Laurent Gomila - SFML developer

Boogiwoogie

  • Newbie
  • *
  • Posts: 19
    • View Profile
cross platform clipboard support?
« Reply #2 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

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
cross platform clipboard support?
« Reply #3 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.

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
cross platform clipboard support?
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
cross platform clipboard support?
« Reply #5 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.
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
cross platform clipboard support?
« Reply #6 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
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
cross platform clipboard support?
« Reply #7 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
cross platform clipboard support?
« Reply #8 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.
Laurent Gomila - SFML developer

Core Xii

  • Jr. Member
  • **
  • Posts: 54
    • MSN Messenger - corexii@gmail.com
    • AOL Instant Messenger - Core+Xii
    • View Profile
cross platform clipboard support?
« Reply #9 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.

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
cross platform clipboard support?
« Reply #10 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..

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
cross platform clipboard support?
« Reply #11 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
cross platform clipboard support?
« Reply #12 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
cross platform clipboard support?
« Reply #13 on: November 01, 2010, 06:57:08 pm »
For clipboard I just include QtCore to my project. It works pretty well

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
cross platform clipboard support?
« Reply #14 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)?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: