For our project (OpenLieroX), we needed some platform independent
solutions for these three things (copy&paste, notify user and open
weblinks), whereby it should at least work on major versions of Windows,
Linux and MacOSX. Another requirement was to be independent from any big
framework like GTK or Qt (because we don’t want to include such a
framework only for these small functions).
It was not easy because these three systems handle such things very
different. And it was also not easy because it was hard to find other
projects with implementations of these things.
But finally we managed to collect code from different sources and
implemented the rest ourselves to achieve this, meaning all of the three
features working fine on all systems tested so far.
If somebody is interested, here is the source (licensed under LGPL):
I write because I am still not happy with all solutions (although they
are working really fine right now).
One thing is the ongoing discussion about the MacOSX Carbon framework.
All MacOSX implementations of these three things depend on Carbon and I
was thus not able to compile it for 64bit under MacOSX. And I am
concerned about future versions of MacOSX. Is it true that all
Carbon-dependent applications will not run anymore on OSX 10.6+? Anyway,
does perhaps somebody have a (L)GPL licensed implementation of these
things in Cocoa?
Then, I am not happy about the OpenExternBrowser implementation for
Unix/Linux systems. Currently, it just checks for the environment
variable BROWSER and a number of standard webbrowsers and starts the
first available one. I have seen similar implementations at various
places. But I am not sure myself if there is any default way to do this
at all. It seems that Gnome and KDE doesn’t share a common configuration
about the default browser, so the default browser of KDE could be
different from the one in Gnome. I think Gnome stores this somewhere in
GConf. I don’t know about KDE. And probably other desktop environments
again have different settings. If Gnome is available, on some systems a
binary called ‘gnome-open’ seem to open the link always in the default
browser, therefore this binary is on very top in the list. Then, on
Ubuntu systems I have seen a small wrapper-binary called
‘sensible-browser’ which should also open the link in the default
browser. Therefore, this is the second entry in the list. Following are
Firefox, Konqueror, Mozilla and so on. I really don’t like this solution
that much but I wonder if there is any better way to do this at all.
Another reason for writing is that I wonder if such functions could
perhaps make it into the SDL library itself. I think that are very
useful and general functions everybody could use/need once here and