I have this example of Delphi-Windows code:
DrawText(grdIni.Canvas.Handle, PChar(grdIni.Cells[ACol, ARow]), -1, Rect, DT_NOPREFIX or DT_WORDBREAK);
I want it to be cross-platforms. So, I code:
{$If defined (Windows)}
DrawText(grdIni.Canvas.Handle, PChar(grdIni.Cells[ACol, ARow]), -1, Rect, DT_NOPREFIX or DT_WORDBREAK);
{$ElseIf defined (Unix)}
// ???
{$EndIf}
My question is for those who have a great general knowledge of *nix (Debian, MacOS, Arch, ...) and their respective drawing interfaces.
[off topic \on]
What I know: under Windows, things are simple: there is only the GDI, and his successor the GDI+. Under the *nix, apparently, everything works with X11, and there are various drawing APIs over X11: GTK, QT, CARBON, even fpGUI, etc, and LCLIntf Windows.pp (for Windows\GDI).
Of course, things would be easier if there was only one widgetset, but that's the way it is. I know that GNOME and KDE have decided to get together to write, with the best of their ideas, and with the best of their code, a common desktop (probably an API common to the latter), for which they hope it will be the future reference under Linux. But that's a long way.
[off topic \off]
• My first question is: if I code for XFCE (which says that it's a\the minimalist widgeset over X11, based on GTK), does this choice of porting towards *nix increase the chances that an application will work on most *nix?
• And my second question is: how is the best, for coding the GTK Drawtext call, for example? Something like this (knowing the GDI, I admit that I have a bias to find the solution that most closely resembles it, ie with HDC, etc):
TGtk2Widgetset.CreateThemeServices.DrawText(.../...);
I know this message is confusing, but my mind is not clear with the different drawing APIs under *nix.
Any links towards coding examples, with a lot of Linux-GTK calls (and if there's a mix with the Windows-GDI equivalent, it would be ideal), are welcome

.