View Full Version : TexturePacker port to Linux, fix gtk file chooser.

12-12-2013, 08:51 PM
I port TexturePacker for Linux.
Fixed the "filechooser_impl.h" file, but it's a proposal.

Note: I do not know to use "TexturePacker" then I did not try either yet.


EDIT: fixed "folderbrowserdialog.cpp"

12-12-2013, 10:11 PM
Ah the GTK problem of clanGUI. We had "forgotten / chose to ignore" that problem.

I initially added support for GTK file dialogs in clanGUI a couple of years ago, during the early development of the ClanLib 3.0 branch.

The reason was that other developers created the "GUIEditor" and the "TexturePacker" utilities that worked very nicely on Microsoft Windows, but had a problem on Linux, the lack of a standard file requester in XLib

There were only 2 options.
1) Create a native ClanLib file requester for Linux.
2) Use an external library

Because creating a native file requestor would be a huge task, I opted for option 2.

I picked GTK, because it seems to be the most widely supported library.

I quickly hacked ClanLib to support it, but did not make it configurable.
This was added to configure.ac: CLANLIB_CHECK_LIB(gtk, [`cat $srcdir/Setup/Tests/gtk.cpp`]
If gtk was not found, the configure script aborted.

Some developers did not have GTK headers installed and did not want to use GTK, so ClanLib failed to compile.

The configure.ac line was commented out, and the source code commented out with the message "I_LOVE_AUTOHELL_AND_FIXED_THE_GTK_CHECK" (not by me!)

An additional problem with using GTK is the ClanLib clanGUI apps need to link with GTK libraries, even if the application doesn't use it.

Ideally clanGUI should not link with GTK. Instead it uses dlopen() calls to load the library, only when required.
In the same way as Sources\GL\GLX\opengl_window_provider_glx.cpp loads "libGL.so.1"

So ClanLib clanGUI compiled applications will work on configurations without GTK installed.

I hope that makes sense

- - - Updated - - -

Also I personally don't mind what method we use. If it's easier to make clanGUI have a GTK prerequisite, so be it :)

Just as long as configure.ac detects it's not installed, and just disables clanGUI, and not abort the configure script

12-13-2013, 12:17 AM
Yes, I noticed that something was not right (24 hours without sleep), but I thought it was not so bad :)
Thanks for the clarification.