sible, and also to be standard complying. After study-
ing SVG, we made it our choice as we found it ideal
for displaying interfaces, and because it is based on
open standards. The latter guarantees (to some ex-
tent) long term support and usability in browsers that
implement those standards. Almost any major web
browser has SVG support or plans to implement it
in the short term. This eliminates the need of addi-
tional software like Oracle Java, Adobe Flash, Mi-
crosoft Silverlight, etc. All we got left to do was the
communication part.
Investigating the way Linux displays its graphics,
we found out that X11 already catered for remote dis-
play. Both ends of the connection were already there:
the applications already programmed to display their
interfaces remotely and web browsers with features
to display them. However, the communication can-
not be completed without software that translate mes-
sages between X11 and SVG.
Cloud-X makes such translation. It is a web ap-
plication programmed in Java and uses Tomcat Web
Server to provide dynamic web pages to an applica-
tion’s GUI using SVG and AJAX.
3.1 Overview
Figure 2 shows Cloud-X. Recall that: X11 works with
a client/server model, an application is the client, and
when an application requires to display a GUI it sends
a series of X11 commands to an X server. Cloud-
X translates them and writes an SVG file. The file
is created in a web server to make it available to the
web browser which then displays its content. In the
web browser, the user will interact with the GUI and
generate events. Cloud-X translates these events to
X11 events and sends them back to the application.
Application
WidgetToolkit
Xlib
Cloud-X
WebServer
Browser
Screen,
Keyboardand
PointingDevice
RemoteDesktop
Cloud-XServer
UserDevice
X11
HTTP
Figure 2: Cloud-X Architecture.
When only part of a GUI needs to be updated (for
instance edited text or closed subwindows), instead of
sending a completely new SVG file, AJAX is used to
refresh immediately only that part in the user’s web
browser. This is very convenient as the browser only
has to keep track of the currently displayed graphi-
cal objects, leaving to Cloud-X the task of manag-
ing what objects to show, and what objects to hide
or eliminate from memory. Cloud-X is composed of
four modules: the Access Controller, the Resources
Manager, the Events Manager and the Communica-
tion Manager.
3.2 From X Window to SVG and Vice
Versa
Cloud-X will map X Window commands and events
into “equivalent” SVG commandsand events and vice
versa, as outlined shortly. Assume a user connected to
a remoteweb server through a web browser, and about
to click on an icon in order to start running the Emacs
editor on a Linux remote host. The Emacs GUI inter-
face will be displayed within the web browser. (We
are ommitting some details of the communication: the
initial connection to the remote web server, in which
Cloud-X runs, and the communication to show the
first display to the user.) The following events will
take place:
1. Cloud-X opens a secure shell channel with the
remote host where Emacs will run, and starts an
X11-forward session so that the display output of
Emacs will be forwarded to Cloud-X. (Note that
both the web server, Cloud-X and Emacs may run
in the same host.)
2. Emacs (through Xlib) starts the handshake proto-
col with the Cloud-X server, which involves ask-
ing the characteristics of the display and the X
server it is dealing with, e.g.: colours available,
display size, etc.
3. Cloud-X sends the web browser a simple SVG file
for the web browser to start displaying a blank
GUI and thus overlap some processing.
4. Emacs will then display its GUI, which involves
the following. It will first send X11 requests to
create the necessary resources in the X Server, ac-
tually the Cloud-X server. Emacs will then send a
request to show its GUI (XmapWindow). On re-
ceiving this request, Cloud-X will generate a new
SVG file with the GUI and will push it into the
web browser.
5. Among other events, Emacs will request from
X server to be informed of keyboard and mouse
events, for instance, when Ctrl-S is entered. For
each event, Cloud-X will generate a handler func-
tion that is written in an SVG file and that is
pushed into the web browser. When the user inter-
action involves any such event, the relevant han-
dler function will send a message to Cloud-X,
which will translate it into an X11 response to
send to Emacs.
6. Emacs will eventually update part of its GUI (for
example, displaying the
File
menu), sending the
ICSOFT 2011 - 6th International Conference on Software and Data Technologies
236