On 11.12.2016 at 17:46 ed_09@... wrote:
> Greg Ercolano schrieb:
>> On 12/09/16 10:45, ed_09@... wrote:
>>> I wonder about the effort to run FLTK on a system without graphic card,
>>> but I really don't have a clue, how this could be realised.
>>
>> What you're describing sounds a lot like X windows?
>
> Yes, I agree. I would like to make all my FLTK software able to work
> like X windows, Fast Light Web Interface. ;o)
>
> It seems to me, a lot of work was spent to FLTK system interfaces,
> classes like Fl_Surface and Fl_Device.
>
> When I look to "31.22 Fl Device Class Reference" it seems to me, that
> all FLTK output goes to Fl_Surface and is connected by Fl_Device to the
> Fl_Graphics_Driver. If I write a Fl_Network_Graphics_Driver, that
> writes the drawing orders to the FLTK X server on remote machine (which
> executes the drawing orders on local hardware), what more would I need
> to start a FLTK software on a headless machine? Some setup of the main
> loop, to insert the remote inputs received from network?
It's not only remote "inputs" if I take this to mean keyboard and mouse.
It's also remote drawing requests (resize, occluding and exposing areas
of the display), and maybe a lot more.
> Also Fl_Device misses functions to set up the window positions and so I
> may need to balance the positions of the remote windows by a local
> window mangager. I think, we had issues like this before, it is a kind
> of porting to a special machine. Maybe someone remembers articles or
> threads regarding to this? Any hints?
I don't remember such articles, and I don't really understand what
exactly you mean. A window manager on the client side should always be
available, and the server would certainly need some kind of "virtual
display", maybe all in one Fl_Surface_* device or something like that.
However, that would also mean (AFAICT) to rewrite the server side to
display everything in the "Fl_Network_Surface (?)" device and so on. I
don't know, it's just too complicated to think about it...
> When not too hard to realise, this would be a very interesting project,
> because a lot of my software works on old XP machines in the basement,
> e.g. burning in lamps. One client for all FLTK software in the web would
> be a powerful thing, even when it does not work with a web browser.
I have implemented a similar project, where the server side of the
project is NOT implemented with FLTK. It does not even run on a server
that would be able to run FLTK (the server currently uses OpenVMS,
porting to Linux is in progress). However, it's a commercial project, so
I can't provide any code. The project was started with the intent to
have a light client that runs on popular hardware and OS's (Windows,
Linux, MacOS), so FLTK was chosen to implement the client side. There
are servers that support several hundred clients at the same time.
To give you a clue how it works: The server has some kind of forms
generator, something you could compare with fluid. The current version
doesn't have a GUI yet, but this may be a future extension (implemented
with FLTK, of course). The forms generator can define windows, buttons,
groups and many more special widgets. The server communicates with the
client over TCP, optional with SSL support. The communication protocol
(over TCP/SSL) is, of course, proprietary, but you can imagine that the
server sends some code like a fluid (.fl) file (forms data), together
with the user data to "fill" the widgets, to the client. The user data
is maintained in a database on the server.
The client is implemented in FLTK. It interprets the "forms" data,
generates FLTK windows and all widgets included in these windows on the
fly (!), and lets the user interact with the windows and widgets. There
are several actions that let the client send data back to the server,
for instance button click, window close and some more events (e.g.
double-click on Fl_Browser items). Everything else like text input,
mouse movement, window resizing etc. is handled locally in the client,
hence it is really fast because no server interaction is needed (no
round trip delay).
Besides the flexible and fast client the advantage is that software
modifications can mostly be done on the server side. Only new (client)
features need a client software update, which is rare.
Well, I don't know if this is helpful for your thoughts. It's really
different than writing a FLTK application on the server and "mirroring"
everything to a client, but maybe you got some hints. Or maybe not ;-)