I want to stick to some software framebuffer 2d lib rather than write GDI, X11 core graphics calls myself because x11 may be replaced by wayland which doesn't have core graphics routines and win32 GDI is considered outdated while Direct2D is not wide-spread, so i see not much sense in wrapping x11/gdi.
Cairo dll occupies 1.5 megs on disk and adds 3.5 megs in runtime, it's overkill for small GUI apps in my case, but can be negligible for something serious.
Any suggestions?
OpenGL adds some 35 megs ram overhead :) and requires some more advanced framework to write optimum apps, e.g. use texture atlas for graphics resources, hard to map to several native windows, e.g. to write multiple windows apps, like Lazarus where top window has a component palette, a property editor window, a text editor... And is bad for older hardware without shaders, i.e. it makes no sense to target fixed pipeline now, so OpenGL is times more overhead than cairo.
We have a full-featured GTK, but we don't have any lightweight one like FLTK yet. I am against the tendency to write small tweakers (e.g. GUI wrapper for ffmpeg) which consume tons of ram. Take any python-gtk app, it's horribly memory hungry and loads for so long. There's a "tray-icon" widget for monitoring UPS, which is written in java, it's horribly slow to start and eats 100+ megs just to show the battery status but it's the same for win, linux, mac... So I want a tool to write those small yet cross-platform quick to launch gui apps.
I'm also designing the toolkit to easily map to OpenGL backend later. So that we have a software-rendered lightweight 2d toolkit for small to medium apps and an OpenGL-rendered one for multimedia apps...
Your toolkit will draw its own widgets, right?
I would honestly prefer if native widgets were used because in most (if not all) cases these custom drawn toolkits look horrible. If you use native widgets then it also seems a lot easier to create a small dependency-free toolkit but you will need to use whatever each OS provides for widgets, and also getting a consistent layout on all OS' is nearly impossible especially when creating a GUI on Windows and Mac OS X (or so i hear).
As for custom drawn widgets, you will have to figure out a balance between implementing everything yourself or using something like Cairo. I'm not aware of any lightweight 2D graphics libraries. Another issue you should be thinking about when picking libraries is licensing.
Horrible is better than nothing :) Wrapping even some native widgets is huge work. With cairo you cannot statically link a close-source app, it can be an issue for some people because a lightweight app is usually desired to be in a single exe file if win32 is considered.
Taretting x11 we already target macosx, because one can install x11quartz and macports, so custom-drawn allow to cover more platfroms with less effort.
At this point I have to mention "Claro" again: https://github.com/Araq/Claro Claro is platform indepedent and supports GTK, Win32 Mac OS X backends. It's a quite thin wrapper over the native widgets and written in C. There already is a Nimrod wrapper for it: https://github.com/Araq/Nimrod/blob/master/lib/wrappers/claro.nim The examples used to run on Windows and Linux on my machine (I never tested the Mac version) but I haven't touched it in years. The code can be gradually translated to Nimrod. It's always been my plan to make this Nimrod's standard UI library but I lack the time. So here is my call for help!
Albert1: > I know a gui lib is not a game, but I think the following article on scene graphs is still interesting: > http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BScene%20Graphs%20-%20just%20say%20no%5D%5D
Interesting for game developers, yes, but I really don't understand why you're linking this article on a discussion with GUIs.