Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-03

Xlib and XCB: any plans?

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

I'm attempting to contribute to the CustomDrawn components project for Lazarus.
One of the target platforms is X, and we may take advantage of the X and Xlib units of fpc. However Xorg discourages the usage of Xlib for new developments, and suggests the usage of XCB instead. What's the situation of fpc in respect of XCB?
It would be frustrating to start from scratch with h2pas, to discover that someone else has already done all what's required!

Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde)

Reply by email

Sven Barth
to Giuliano Colla
Giuliano Colla wrote 9 lines
I'm attempting to contribute to the CustomDrawn components project for Lazarus. One of the target platforms is X, and we may take advantage of the X and Xlib units of fpc. However Xorg discourages the usage of Xlib for new developments, and suggests the usage of XCB instead. What's the situation of fpc in respect of XCB? It would be frustrating to start from scratch with h2pas, to discover that someone else has already done all what's required!

I don't know how complete these are, but here
http://code.google.com/p/pasxlibbind/ someone started with XCB bindings (at least I myself needed to do a checkout, because the SVN browse does not work for me...).

Regards,
Sven

Reply by email

Graeme Geldenhuys
to Giuliano Colla: I'm attempting to contribute to the CustomDrawn components project for Lazarus. One of…
Giuliano Colla wrote
Xlib units of fpc. However Xorg discourages the usage of Xlib for new developments, and suggests the usage of XCB instead. What's the situation of fpc in respect of XCB?

Why, when the current XLib already uses XCB. The current XLib implementation is not a "pure" xlib any more, it is more like a wrapper for XCB (at least that is so under Linux). I've wanted to implement a pure XCB backend for fpGUI too, and after doing some research I found about the Xlib wrapper over XCB under Linux.

Just take a look at an fpGUI application compiled with XLib as backend. Note the dependency in libxcb.so in the list, yet I did not use XCB at all in fpGUI.

----------------------------------------
$ ldd docview
linux-gate.so.1 => (0x00e6c000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00131000)
libXft.so.2 => /usr/lib/libXft.so.2 (0x00f16000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x0024e000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x005be000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00110000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x0012a000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x003a8000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00dad000) /lib/ld-linux.so.2 (0x007d6000)
libz.so.1 => /lib/libz.so.1 (0x0092c000)
libexpat.so.1 => /lib/libexpat.so.1 (0x0063f000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x0060d000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x0041e000)

----------------------------------------

I wouldn't waste my time on XCB. XLib is not going to disappear. Plus Wayland is on it's way, which means you would probably have to change to that anyway.

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

zeljko
to Giuliano Colla: I'm attempting to contribute to the CustomDrawn components project for Lazarus. One of…
Giuliano Colla wrote 8 lines
I'm attempting to contribute to the CustomDrawn components project for Lazarus. One of the target platforms is X, and we may take advantage of the X and Xlib units of fpc. However Xorg discourages the usage of Xlib for new developments, and suggests the usage of XCB instead. What's the situation of fpc in respect of XCB? It would be frustrating to start from scratch with h2pas, to discover that someone else has already done all what's required!

And what about older X installations ?

zeljko

Reply by email

Sven Barth
to Graeme Geldenhuys: Why, when the current XLib already uses XCB. The current XLib implementation is not a…
Graeme Geldenhuys wrote
I wouldn't waste my time on XCB. XLib is not going to disappear. Plus Wayland is on it's way, which means you would probably have to change to that anyway.

Wayland is not the same as X11. If one wants the CustomDrawn widgetset (or fpGUI for that matter) to support Wayland natively and not through a X11 server that runs on top of Wayland then one needs to use completely new bindings.
Also even if Wayland is successful it will take some time till the distros supply it (not to mention as default). Also Wayland can currently only be used if the graphics driver supports kernel mode setting which e.g. embedded devices which might be capable of running X11 do not necessarily have. So support for X11 (be it through XLib or XCB) is not a waist of time.

Regards,
Sven

Reply by email

Graeme Geldenhuys
to Sven Barth
Sven Barth wrote 5 lines
Wayland is not the same as X11. If one wants the CustomDrawn widgetset (or fpGUI for that matter) to support Wayland natively and not through a X11 server that runs on top of Wayland then one needs to use completely new bindings.

I thought that is exactly what I said. :-)

Also even if Wayland is successful it will take some time till the distros supply it (not to mention as default).

True, but Wayland seems to be the most promising X11 alternative - and there has been many attempts over the years. Also if or when Wayland arrives, X11 should still be supported, and your current Xlib implementation of your toolkit wouldn't magically disappear. So you have time to spare.

Then again, GTK, QT and some other GUI toolkits are already making good progress with there Wayland support. Ubuntu is also going to push Wayland support hard, and Fedora has also shown positive interest in Wayland. That's to big Linux distros already.

But I wouldn't remove Xlib support in fpGUI any time soon. Why? Because even if Wayland is a 100% success story, it is ONLY for Linux (it currently takes advantage of Linux-only features). I still want fpGUI to support the *BSD systems, Solaris etc.

Again, I wouldn't bother with a XCB specific binding. The gains are just too little, and as I already showed, the current XLib implementations (and least on Linux) are already wrappers around XCB.

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Giuliano Colla
to Graeme Geldenhuys

Il 05/03/2012 11:36, Graeme Geldenhuys ha scritto:

Show quoted text 31 lines
On 5 March 2012 11:05, Sven Barth wrote: > Wayland is not the same as X11. If one wants the CustomDrawn widgetset (or > fpGUI for that matter) to support Wayland natively and not through a X11 > server that runs on top of Wayland then one needs to use completely new > bindings. I thought that is exactly what I said. :-) > Also even if Wayland is successful it will take some time till the distros > supply it (not to mention as default). True, but Wayland seems to be the most promising X11 alternative - and there has been many attempts over the years. Also if or when Wayland arrives, X11 should still be supported, and your current Xlib implementation of your toolkit wouldn't magically disappear. So you have time to spare. Then again, GTK, QT and some other GUI toolkits are already making good progress with there Wayland support. Ubuntu is also going to push Wayland support hard, and Fedora has also shown positive interest in Wayland. That's to big Linux distros already. But I wouldn't remove Xlib support in fpGUI any time soon. Why? Because even if Wayland is a 100% success story, it is ONLY for Linux (it currently takes advantage of Linux-only features). I still want fpGUI to support the *BSD systems, Solaris etc. Again, I wouldn't bother with a XCB specific binding. The gains are just too little, and as I already showed, the current XLib implementations (and least on Linux) are already wrappers around XCB.

Many thanks to both of you. Now the picture is more clear.

Giuliano

Reply by email

ik
to Sven Barth: I don't know how complete these are, but here http://code.google.com/p/pasxlibbind/…
Sven Barth wrote 16 lines
On 04.03.2012 18:42, Giuliano Colla wrote: > > I'm attempting to contribute to the CustomDrawn components project for > Lazarus. > One of the target platforms is X, and we may take advantage of the X and > Xlib units of fpc. However Xorg discourages the usage of Xlib for new > developments, and suggests the usage of XCB instead. What's the > situation of fpc in respect of XCB? > It would be frustrating to start from scratch with h2pas, to discover > that someone else has already done all what's required! > I don't know how complete these are, but here http://code.google.com/p/pasxlibbind/ someone started with XCB bindings (at least I myself needed to do a checkout, because the SVN browse does not work for me...).

I'ts not :(
I left it long time ago. But you are more then welcome to take over :)

Show quoted text 7 lines
Regards, Sven _______________________________________________ fpc-devel maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Sven Barth
to Graeme Geldenhuys: I thought that is exactly what I said. :-) True, but Wayland seems to be the most…
Graeme Geldenhuys wrote 8 lines
On 5 March 2012 11:05, Sven Barth wrote: > > Wayland is not the same as X11. If one wants the CustomDrawn widgetset (or > fpGUI for that matter) to support Wayland natively and not through a X11 > server that runs on top of Wayland then one needs to use completely new > bindings. I thought that is exactly what I said. :-)

Your mail sounded a bit like "Wayland will come, so don't waste your time!". It seems that I've misinterpreted your tone though ;)

But I wouldn't remove Xlib support in fpGUI any time soon. Why? Because even if Wayland is a 100% success story, it is ONLY for Linux (it currently takes advantage of Linux-only features). I still want fpGUI to support the *BSD systems, Solaris etc.

Exactly. X11 still has it's purpose. Maybe not on Linux in the future, but on other systems...

Regards,
Sven

Reply by email