Sign in Join

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

Mailing lists / lazarus / 2013-11

Writing a Lazarus program with its own display, RFB?

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

vfclists .

I want to write a program to provide its own remote display without an X Window server, ie the program has its own display which can be connected to via VNC server. There is a libvncserver/libvnclient project at http://libvncserver.sourceforge.net/ which enables one to do that, but I don't know where to start or even know who all the parts come together.

My main questions are:

1. Is it possible to direct the output of a Lazarus LCL program into such a display system, or perhaps replace the parts where it interacts with X Windows to such a system.

2. If I am willing go with X Windows is it possible to dedicate a single X Window to a program alone, without using an Desktop Manager or Window Manager and link it with VNC, as though it is the program alone that displays on that X Window?

3. Is there some place I can get some more information about this RFB system of display programs if that is the right term?

Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131119/cc486dd2/attachment.html>

Reply by email

Lukasz Sokol
to vfclists .
vfclists . wrote 9 lines
I want to write a program to provide its own remote display without an X Window server, ie the program has its own display which can be connected to via VNC server. There is a libvncserver/libvnclient project at http://libvncserver.sourceforge.net/ which enables one to do that, but I don't know where to start or even know who all the parts come together. My main questions are:

[...]

Show quoted text 5 lines
2. If I am willing go with X Windows is it possible to dedicate a single X Window to a program alone, without using an Desktop Manager or Window Manager and link it with VNC, as though it is the program alone that displays on that X Window?

Check out x11vnc - it can open an existing X screen and provide it for vnc connection - and xinit - lets you open new X screen, with or without a Window Manager.

-L.

-- Frank Church

Reply by email

Mark Morgan Lloyd
to Lukasz Sokol: [...] Check out x11vnc - it can open an existing X screen and provide it for vnc…
Lukasz Sokol wrote
Check out x11vnc - it can open an existing X screen and provide it for vnc connection - and xinit - lets you open new X screen, with or without a Window Manager.

Noting that on unix VNC provides an X server, so if you could tell that to disregard the normal startup and run without a display manager etc. you could then draw onto it directly.

Another alternative would be some variant of FPGUI, wasn't somebody looking at that on top of the svga library?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Schnell
to Michael Schnell: VNC server (in Linux) does provide an X server. So this should not be a problem of…
Michael Schnell wrote 8 lines
On 11/19/2013 01:30 AM, vfclists . wrote: > > I want to write a program to provide its own remote display without > an X Window server, ie the program has its own display which can be > connected to via VNC server. VNC server (in Linux) does provide an X server. So this should not be a problem of Lazarus, but of setting up the runtime environment appropriately.

Second thought:

You of course can do a program that opens a TCP/IP server socket and uses the (supposedly decently documented) VNC protocol on same. I understand this is rather easy if you just want to provide a rectangle of pixels (independent from the program's GUI) and have it displayed by the VNC client on a PC.

If you want to remote the GUI of the Program without a trace of an X-Server (thus without using the VNC-Server product, but via a TCP/IP socket of your program itself), this might be possible by enhancing the "CustomDrawn" Widget Type appropriate. But supposedly this is a lot of work to do.

-Michael

Reply by email

Lukasz Sokol
to Mark Morgan Lloyd: Noting that on unix VNC provides an X server, so if you could tell that to disregard the…
Mark Morgan Lloyd wrote 9 lines
Lukasz Sokol wrote: > Check out x11vnc - it can open an existing X screen and provide it > for vnc connection - and xinit - lets you open new X screen, with > or without a Window Manager. Noting that on unix VNC provides an X server, so if you could tell that to disregard the normal startup and run without a display manager etc. you could then draw onto it directly.

AFAIK it requires special X invocation to start it, or additional vnc server program (or for the matter, a special build of X server, in Debian a separate package...) started if the session exists already - x11vnc does it for you (why would a program like Vino have to exist if this is achievable with just X ?)

Additionally x11vnc / vnc X server deals with encryption so if you work it over the Internet it's useful (and in a local network it's not like it isn't useful either - otherwise e.g. all the keystrokes are sent in open text)

Another alternative would be some variant of FPGUI, wasn't somebody looking at that on top of the svga library?

-L.

Reply by email

Mark Morgan Lloyd
to Lukasz Sokol: AFAIK it requires special X invocation to start it, or additional vnc server program (or…
Lukasz Sokol wrote 14 lines
On 19/11/13 09:48, Mark Morgan Lloyd wrote: > Lukasz Sokol wrote: > >> Check out x11vnc - it can open an existing X screen and provide it >> for vnc connection - and xinit - lets you open new X screen, with >> or without a Window Manager. > Noting that on unix VNC provides an X server, so if you could tell > that to disregard the normal startup and run without a display > manager etc. you could then draw onto it directly. AFAIK it requires special X invocation to start it, or additional vnc server program (or for the matter, a special build of X server, in Debian a separate package...) started if the session exists already - x11vnc does it for you (why would a program like Vino have to exist if this is achievable with just X ?)

Standard VNC is /completely/ separate from the standard X server on any given system, except that some variant has the capability of "scraping" a pre-existing window for support purposes. I normally start up multiple copies in /etc/inittab, specifying what socket each is listening on; at that point any activity on the console X server (or even the absence of a console X server) is completely irrelevant.

So the issue isn't starting VNC and keeping it separate from the console's X session, but is one of making sure that VNC doesn't fire up the default display/window managers.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Schnell
to Felipe Monteiro de Carvalho: You could implement it as a new backend for LCL-CustomDrawn:…
Felipe Monteiro de Carvalho wrote
You could implement it as a new backend for LCL-CustomDrawn: http://wiki.freepascal.org/Custom_Drawn_Interface

Looking at this page triggers long-wanted stuff:

- a HTML backend that is able to be attached via HTTP (directly or via e.g. fastGCI or Microsoft IIS/ISAPI)
- a "remote" backend that implements a propriety bi-directional byte-stream protocol that on the other site of the pipe can be attached by a Lazarus program serving as a "Custom-Drawn-Viewer"

Is something like this planned in the foreseeable future ?

Maybe one of these in effect is what the OP wants and "VNC" was just a variant that could be considered.

-Michael

Reply by email

vfclists .
to vfclists .: I want to write a program to provide its own remote display without an X Window server,…
vfclists . wrote 24 lines
I want to write a program to provide its own remote display without an X Window server, ie the program has its own display which can be connected to via VNC server. There is a libvncserver/libvnclient project at http://libvncserver.sourceforge.net/ which enables one to do that, but I don't know where to start or even know who all the parts come together. My main questions are: 1. Is it possible to direct the output of a Lazarus LCL program into such a display system, or perhaps replace the parts where it interacts with X Windows to such a system. 2. If I am willing go with X Windows is it possible to dedicate a single X Window to a program alone, without using an Desktop Manager or Window Manager and link it with VNC, as though it is the program alone that displays on that X Window? 3. Is there some place I can get some more information about this RFB system of display programs if that is the right term? -- Frank Church=======================

Thanks for the suggestions. By editing out most of the lines in ~/.vnc/xstartup I have been able to make some progress

#!/bin/sh

# xrdb $HOME/.Xresources
# xsetroot -solid grey
# x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
~/program/program &
#x-window-manager &
# Fix to make GNOME work
#export XKL_XMODMAP_DISABLE=1
# /etc/X11/Xsession

I commented out everything except the command to run the program and I get a shaded gray screen with my program, but without the headers and menu which I suspect are placed there by the window manager.

I have also noticed XTightvnc and its parameters in the process list and it looks to me that they are key to getting the results I need. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131120/6373ec0c/attachment-0001.html>

Reply by email

Michael Schnell
to vfclists .
vfclists . wrote
Thanks for the suggestions. By editing out most of the lines in ~/.vnc/xstartup I have been able to make some progress

What progress exactly ?

Still I don't know what you are up to:
- remoting your Lazarus program's GUI in _some_ way (VNC is just one convenient option)
- remoting your Lazarus program's GUI (VNC is a must. Because of what reason ??? )
- have you program create a graphical object independent from it's Lazarus GUI, and have a remote PC view this object via VNC.

??
-Michael

Reply by email

vfclists .
to Michael Schnell
Michael Schnell wrote 25 lines
On 11/20/2013 02:32 AM, vfclists . wrote: > Thanks for the suggestions. By editing out most of the lines in > ~/.vnc/xstartup I have been able to make some progress > What progress exactly ? Still I don't know what you are up to: - remoting your Lazarus program's GUI in _some_ way (VNC is just one convenient option) - remoting your Lazarus program's GUI (VNC is a must. Because of what reason ??? ) - have you program create a graphical object independent from it's Lazarus GUI, and have a remote PC view this object via VNC. ?? -Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

My question was to see if the third option is possible with Lazarus, ie whether it is possible to get Lazarus screen output to be targetted at a VNC compatible system, but I think that is outside my knowledge and skill level. So the option I have settled for is the first.

Squeak and Pharo for instance have their own RFB system which runs independently of a VNC server, so a VNC client can connect to them. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131120/4ca5bbd2/attachment.html>

Reply by email

Michael Schnell
to vfclists .
vfclists . wrote 5 lines
My question was to see if the third option is possible with Lazarus, ie whether it is possible to get Lazarus screen output to be targetted at a VNC compatible system,

??? Handling the " Lazarus screen output" is just the contrary of "the third option".

but I think that is outside my knowledge and skill level.

In fact the third option is the easiest to do (unless you find something already functional for another option).

So the option I have settled for is the first.

This _is_ in fact already functional, in multiple ways of desktop remoting, including native X11 via TCP/IP, NX, VNC, Windows Remote Desktop, ... (and has nothing to do with Lazarus itself or the program you are doing at all).

-Michael

Reply by email

Danny Weldon
Show quoted text 25 lines
---------- Forwarded message ---------- From: Michael Schnell To: Lazarus mailing list Cc: Date: Wed, 20 Nov 2013 14:52:27 +0100 Subject: Re: [Lazarus] Writing a Lazarus program with its own display, RFB? On 11/20/2013 01:29 PM, vfclists . wrote: > > > > My question was to see if the third option is possible with Lazarus, ie whether it is possible to get Lazarus screen output to be targetted at a VNC compatible system, ??? Handling the " Lazarus screen output" is just the contrary of "the third option". > but I think that is outside my knowledge and skill level. In fact the third option is the easiest to do (unless you find something already functional for another option). > So the option I have settled for is the first. This _is_ in fact already functional, in multiple ways of desktop remoting, including native X11 via TCP/IP, NX, VNC, Windows Remote Desktop, ... (and has nothing to do with Lazarus itself or the program you are doing at all). -Michael

I came across this really cool way to embed a vnc session on a web page using flash:

http://flashlight-vnc.sourceforge.net/

So it is an easy way to get lazarus apps running on a web page if that helps.

Regards Danny

Reply by email