2001 01 Know How Berlin, Alternative to X Window System


056BerlinÿÅ‚.qxd 21.11.2000 16:51 Uhr Seite 56
KNOWHOW DISPLAY-SERVER
Berlin - Alternative to the X Window System
DOWN
WITH THE
X-WALL!
TOBIAS HUNGER
Linux users are
getting more and more
spoilt  calls for
features such as font-
anti-aliasing or alpha-
blending are getting
louder all the time. And
at the same time, of
course, the system has
to be high-performance
 the X Window system
can help only to a
limited extent. The
Berlin Project, with its
modular, object-
orientated architecture,
is attempting to make a
new start.
56 LINUX MAGAZINE 4 · 2001
056BerlinÿÅ‚.qxd 21.11.2000 16:51 Uhr Seite 57
DISPLAY-SERVER KNOWHOW
More than a decade has now gone by since the
development of X-Window. It is not least for this
reason that this display system is very robust.
Continual new demands from users can be fulfilled
with the aid of expansions of the X-protocol.
Despite the far-sightedness of its creators though,
the X Window system is gradually coming up
against its limits. 3D applications can only be used
effectively with a complicated GLX/DRI mix.
Smoothed character sets are still awaited. X also
allows only one ToolKit-related configuration. If you
play in a KDE theme, the appearance of the Gimp
does not alter for a long time.
New start
Berlin offers a central configuration of its
appearance. This means that applications present a
consistent "Look and Feel" at all times.
Gaming fanatics will love the rotating and
transparent windows. For programmers the most
interesting feature must surely be the device-
independent graphics output. The best possible quality is Fig. 1: Whether rotated or
enlarged: TrueType- and
always used, regardless of whether a monitor or a printer
Bitmap fonts are improved
is employed for output. As a result, there is no need for the
in quality as the result of
edge smoothing.
print routines necessary for X, or to adapt a program to
different colour depths and screen resolutions.
Goals
Berlin's goal is to create an alternative to X which Fig. 2: Example of
a structured graphic
can cope better with modern hardware and can be
(Left scenegraph,
more easily adapted to new input and output
right result)
devices. The whole system is meant to be modular,
so that the actual server is scaled by the selection of
suitable modules. Thus the same server should run
on both a small PDA and a large 3D graphics
Table 1: History - From Interviews to Berlin
1988 InterViews, Stanford University (Linton, Calder, Vlissides)
InterViews was a fruitful attempt to combine structured graphics and object-orientation.
1994-98 Fresco, X Consortium
Fresco was the successor to InterViews, extending many of its ideas and integrating the
individual libraries into a modular framework. The main focus of the development was a
combination of distributed objects and "distributed graphical embedding". The internal use of
an ORB even accelerated the development of COBRA. The Fresco project no longer exists,
however, Berlin now being used to manage the remaining documents and archive (see later).
1997 GGI Project
The GGI Project was established in order to obtain a general protocol for writing graphics
drivers. By separating the Linux kernel from the programmer interface, it enables access to all
the functions of modern graphics hardware in complete safety.
1997 Berlin Project
By building on GGI, Berlin was an attempt to produce a very easy, powerful windowing system.
Portability was considered important, but speed and efficiency were the biggest priorities.
since 1998 Berlin Project, the second generation
The establishment of standards such as OpenGL, COBRA and Unicode caused a change in the
original Berlin focus, which is now portability and efficient through the use of common
standards. In the search for inspiration we stumbled across Fresco, from which we have now
taken large parts of the source texts. Indeed, the Berlin of today now has more in common
with Fresco than with its own code from before 1998!
4 · 2001 LINUX MAGAZINE 57
056BerlinÿÅ‚.qxd 21.11.2000 16:52 Uhr Seite 58
KNOWHOW DISPLAY-SERVER
workstation. It should also make best use of any the classic 2D look and potentially even as an
available hardware without any changes to its "acoustic user interface" for the visually-impaired.
source text. Berlin is trying, by means of abstract The whole system is being developed under the
interfaces, to develop a system which allows a GNU Library General Public License.
program to be made usable without alterations in
Fig. 3: The interplay of model,
views and controllers both a truly walk-in 3D environment as well as in
Concepts
Berlin is essentially based on two concepts. The first
is that of so-called "structured graphics", where
simple objects such as lines, letters, but also
transformational functions such as rotations or
crops, are amalgamated into more complex objects.
The whole procedure is similar to drafting drawings
in vector graphics programs. Figure 2 shows one
such (simplified) tree structure and the image
created from it. In the example, several glyphs
(graphical representations of letters) and a complex
vector graphic are combined into a hBox. This
element allows all subordinate graphics to be
displayed side by side on a common baseline.
Model-View-Controller ("MVC") is derived from
the programming language Smalltalk and is a
second concept which is central for the
configurability of the user interface. This means that
Fig. 4: The components of Berlin
58 LINUX MAGAZINE 4 · 2001
056BerlinÿÅ‚.qxd 21.11.2000 16:52 Uhr Seite 59
DISPLAY-SERVER KNOWHOW
a program ought to be split into three different A Postscript DrawingKit is planned.
function groups. The Model contains the status of Figure 4 and Table 2 describe individual
the program. That could for example be a number components of Berlin.
of binary states, a variable value in a given interval These exclude DrawingKits (which has already been
or a text. This model is processed by one or more described) the DesktopKit, which contains functions
Controllers. As soon as one of these controllers for control of windows, and the WidgetKit, which
alters the state of the Model, the latter notifies this provides frequently used graphical user interface
alteration to all Views involved. The views thus and display elements of particular importance. Both
represent the graphical appearance of a program of these kits have a similar function in Berlin to the
and the controllers its behaviour. In the interests of various window managers and GUI-ToolKits in X.
configurability by the user, Both should be as
flexible as possible. The actual program functions
Interaction
and data stay in the model, the logistical backbone.
Figure 3 shows how these three components One part of the scenegraph consists of controllers.
interact. Here, the model consists of three numbers, These are graphics objects which can receive,
which represent the red, green and blue parts of a
colour. The colour field in the middle observes this
Table 2: The components of Berlin
model. If that changes, its colour changes
Display Server: How the X-Server represents the graphical interface of a
correspondingly. The controllers here are the slide
client.
controllers. If these are moved, they change the
libBerlin, libWarsaw connect the client or server respectively to the Object
corresponding colour values of the model.
Request Broker (ORB).Both are created by a compiler
fromBerlin's CORBA interfaces.
ORB The CORBA ORB allows communication between client and
..and their realisation
server, regardless of their respective locations in the network.
Berlin uses a so-called scenegraph for display. This is
libPrague contains classes which abstract Berlin from its underlying
a structured graphic stored in the server. Here it is
hardware.This library is intended to allow easy portage of
possible to see the strict separation of the model in
Berlin.
the client and the associated views in the server. In
Console Another abstraction. The console converts events from
the tree-like structure of the scenegraph, each client
external libraries that query the hardware into Berlin events.
is responsible for one part of the tree. The client can
Kits Kits are dynamic loadable modules, which provide
insert, process or delete graphics, thus creating their
respectively defined functions. Configuration of Berlin is
own illustration. These graphics are demanded by
possible by simply exchanging kits during run time.
the client from various modules in the server. The
entire graphical representation of the clients is
found there. Subgraphs (such as a window content)
CORBA
can be affected with the aid of upstream decorator
patterns. These patterns are in fact invisible CORBA (Common Object Request Broker Architecture) is a standard for the
graphics, which affect the appearance of their development of distributed systems. In such systems the entire
dependents. These can be displacement, rotation, functionality of an application is represented by objects. In such an
or a change of fonts or colours. The displacement of architecture, the distinction between client and server becomes blurred.
a window may be caused by its descriptive Client-components can create objects which behave like servers.
decorator pattern being inserted in front of the The flexibility of distributed systems arises from the fact that all
window subgraphs. This causes little or no components possess a defined interface. This interface tells the
communication with the client. The server has all components which services another component provides and how these
the information it needs to redraw the whole can be used. As long as this interface remains unaltered, the
window. implementation of a component can alter fundamentally, without the
Up to this point no assumptions whatsoever other objects involved being aware of this.
have been made about the basic hardware. All With Interface Definition Language (IDL), CORBA provides a standard
details within the scenegraph are abstract. They are mechanism for the definition of such interfaces. IDL is not an
also independent of the pixel co-ordinates and implementation language  only interfaces between objects can be
colour codings of the hardware. For this reason, the defined. Source texts are created next from these definitions in the various
normal application developer no longer needs to programming languages that implement these interfaces. Only now do
worry about colour depths, screen resolutions and they need to be provided with the program logic. Berlin clients in C++,
print support. Berlin adapts the output accurately to Python, Perl and Java have already been realised using these features.
the output device in use, regardless of whether this In addition CORBA offers various services which make it possible to find
is now a monitor, a video wall or a printer. Various an object. It also allows communication between different objects
DrawingKits are used to do this. These run through (including via address space) and even beyond computer limits. This
the scenegraph in a so-called draw traversal and communication is mediated through one or more ORBs (Object Request
thereby create an output that can be processed by Brokers). On the basis of its Object Reference, the ORB can find and contact
the basic hardware. Currently raster and OpenGL the object in the network.
display lists are catered for.
4 · 2001 LINUX MAGAZINE 59
056BerlinÿÅ‚.qxd 21.11.2000 16:52 Uhr Seite 60
KNOWHOW DISPLAY-SERVER
process and if necessary pass on events. So correspond in their function to the X-Protocol. But
controllers are special decorator patterns, which as a rule, communication via CORBA is slower than
alter not the appearance, but the behaviour of their via sockets. This frequently leads to the assumption
dependents. Any graphics you desire can be that Berlin must be slower than the X Window
converted, into a button for example, by adding a system. But since communications between objects
corresponding controller. All controllers are which live in the same address space are depicted in
combined into another graph, the Controlgraph. A C++ as a virtual method call and in Berlin the vast
pick traversal is applied to this, to find the right majority of communication takes place in the
recipient of an event. address space of the server, slower communication
Events in Berlin are kept more abstract than for between client and server is just a bad memory.
example in X in order to be prepared for future Even demo-applications with a high proportion of
input devices. This also makes events easier to communication between client and server are not
synthesise. Used perhaps to simulate a mouse via significantly slower than those with a high
the keyboard or to enable a pen-based input on a proportion of communication in the server.
PDA.
Since controllers are in the server, many events
Kits
can be carried out without any communication
whatsoever with the client. The displacement of The separation of interface and implementation
windows is another example here. The responsible makes little sense if a programmer can only create
controller of the DesktopKit communicates directly elementary objects such as lines, letters or simple
with the transformer of the window. controllers. It makes much more sense to create
CORBA, with all its functions, seems ideal to special objects, so-called Factory-objects. This can
take over this communication between server and make and "wire" complex trees of elementary
client-objects. The Berlin interfaces defined with IDL objects in one go. In Berlin there are several such
Compatibility
Berlin and X have so few common features that the user cannot simply use his normal
applications under Berlin. This is a serious drawback. Who wants to do without his favourite
application? So how can Berlin be adjusted to represent existing programs?
Pixel-Level bridge
The simplest option for achieving X-compatibility is to run an X-server in a window. This
option is technically relatively simple to realise and makes it possible to use all X-applications
Figure 5: X in Berlin in X under Berlin. The drawback is that none of the advantages of Berlin come into play in this
conversion. A conversion of this pixel-level
bridge is already being worked on. Display is
already functioning (see Figure 5), but there is
as yet no passing on of events from Berlin to X.
Widget bridge
In a widget bridge a wrapper library is written
to convert calls to an X-based GUI-ToolKit into
corresponding Berlin structures. Such a bridge
has the advantage that the fundamental
characteristics of Berlin (transformations,
server-side object communication) are largely
retained. However, realisation is very time-
consuming and does not result in any
additional function with respect to the X-
version of the GUI-toolkit.
High-Level-Bridge
Many applications now use GUI description
languages, mostly based on XML, such as
Glade, XUL and Entity. With such a "global
knowledge" about a user interface it may be
that better connections are made between
Berlin and ToolKit widgets, than is usually the
case with the widget bridge.
60 LINUX MAGAZINE 4 · 2001
056BerlinÿÅ‚.qxd 21.11.2000 16:52 Uhr Seite 61
DISPLAY-SERVER KNOWHOW
Getting started...
The g++ version 2.95.2 is a good choice. Earlier versions can
Installing Berlin is not totally simple, as we use a few cause problems under some circumstances. You need to
"incomplete" libraries, which have sometimes not yet bear in mind that the compiler has to cope with
made an entry in the current distributions. For this reason, multithreading (the compiler itself must have been
there are still no Berlin packages in binary format. converted with the option ' enable-threads'). All the more
The libraries needed are, in detail: recent distributions should comply with this requirement.
* libGGI Version 2.0 beta All that is needed now is the source code for Berlin.
* Mesa Version 3.1 (with GGI-Support) or Depending on how adventurous you feel, you can choose
* libArt, from the Gnome-CVS-Tree between "stable" releases or nightly snapshots. It is also
* FreeType Version 2.0 beta 8 possible to check out the CVS Repository. The releases are
* libPNG Version 1.05 split into smaller modules. The packages "Berlin",
* libz Version 1.1.3 "Prague", "Warsaw", "Server" and one of the clients will
All these libraries are really easy to install. Only GGI and be needed for testing.
Mesa with GGI support occasionally cause problems. The You're motoring once you've unpacked the packages. A
associated demos have to run  otherwise Berlin will not simple make is enough. First the user will be asked some
function either! questions. The default answers should usually be
The next thing we need is an ORB. All ORBs with a appropriate in each case. The compilation will then start
language connection to C++ which support the POA and immediately. Installation is not yet foreseen  all programs
provide a name service, are suitable for Berlin. We would can be executed directly from their directories.
advise using omniORB Version 3.0 (or later). So far this is Berlin needs a few environmental variables. These can be
the only one to be "automatically" recognised. With get using
others, manual modification of the Makefile is necessary.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\
The installation of omniORB shouldn't give rise to any
`pwd`/lib
problems. After that the name service has to be configured
export BERLIN_ROOT=`pwd`
and started. For this, the file /etc/omniORB.cfg is required.
In this case, this contains the following lines: Please take note that these commands have to be executed
in the uppermost directory of the Berlin source tree. When
ORBInitialHost C3PO
using shells other than bash, the commands should be
ORBInitialPort 8088
adjusted accordingly.
Please replace "C3PO" with your own computer name. Next, the server can be started with server/server.
When this file has been created, omniNames can be started Depending on whether you are on the console or in X, the
for the first time: screen will either be black, or a black window will appear.
At first, nothing else will happen.
omniNames -start 8088 \
Now a client can be started. This, too, needs both of the
-logdir /var/log/ \
environmental variables mentioned above. The C++ client is
-errlog /var/log/omniorb-errors
started with clients/C++/demo.
A good test of the configuration of the name service is to In the case of problems the Berlin FAQ can be of
call up nameclt list. If this waits for a time-out, then assistance, and in more difficult cases, the mailing lists will
something is wrong. help. Links to both of these can be found on the homepage
Finally, to compile the sources, we need a C++ compiler. of the Berlin project.
factory objects. These are all responsible for a the presentation objects in such a way that their
specified type of objects and are combined into Kits. appearance, as well as their function can be
These kits are the mechanism on which the whole configured.
modularity and configurability of Berlin is based. What looks to the user like a complex product,
The server itself has just one function  to reload kits perhaps a scrollbar, is displayed as a structure in
dynamically. It does not even need to know which Berlin. Elsewhere, objects have defined attributes
interfaces a kit makes available to do this. It is and status variables. Here these are an arrangement
enough that the application program knows. of graphics and controller objects, created with the
aid of one or more factory objects. The creating kit
is the only authority that knows the precise
Widgets and taskets
structure. This is the basis for the selection of
One of the most interesting aspects of drafting user different display methods. By exchanging the
interfaces is the interaction between man and "WidgetKits", a different appearance is achieved.
machine. Over the course of time certain More abstract levels can also be permitted.
metaphors, such as icons, buttons and scrollbars, When one considers the function of a scrollbar, one
have been developed. If the architecture itself notes that it alters a value within given limits. If one
demands a separation of data and presentation only takes these tasks, one reaches the term
(keyword MVC), it can't be that difficult to design "Taskets". When a user wishes to find a list with
4 · 2001 LINUX MAGAZINE 61
056BerlinÿÅ‚.qxd 21.11.2000 16:52 Uhr Seite 62
KNOWHOW DISPLAY-SERVER
given values, he can do this in various ways ranging
from menus, up to radio buttons. All perform this
same task, so implementations can be one and the
same tasket. In addition to the WidgetKit, Berlin
also provides another more abstract "TasketKit"
enabling the user to seek out his preferred selection
method. This can either demand a radio-button
group from the WidgetKit or instead do something
completely different. The imagination has no limits.
A menu is less useful than an acoustic response for
the visually impaired. The application developer has
the option to either impose the appearance of
his/her application, by manipulating elementary
graphics objects, or work as usual with Widgets. He
or she can decide to work with even more abstract
products, such as Taskets.
Berlin is now truly stable and a bit faster than in
previous versions, although there is still a great deal
Development status and
of room for refinement. Nevertheless, Berlin is not
prospects
suitable for end users. Apart from a few demos,
It may appear that the Berlin Project has done little there are still no applications. There isn't even a
in recent months. But there have been a few complete set of Widgets in order to develop these.
changes in the internal structure. First of all, many At present, Berlin should be regarded as more of an
dependencies on other projects have been experimentation field for developing man-machine
The author
dissolved. Berlin no longer needs MesaGGI because interaction.
Tobias Hunger is a student of of the libArtDrawingKit. A new hardware Since the architecture is now in large sections,
computer science at the abstraction layer, the "console" means that even work is now slowly beginning on the implementation
University of Kaiserslautern. the dependency on the GGI of additional widgets. Portage to BSD and other
He also runs a company (General Graphics Interface) has now gone. systems is in the pipeline, together with the
dealing with questions ORB has now become exchangeable. Apart from integration of additional libraries such as SDL and
concerning network and this, the whole architecture is more robust. This is GLUT in Berlin. The developers are hoping that this
computer security. the result of improved memory management. will provide the long awaited "hardware support" for
display. Until now, Berlin has had to manage with just
software rendering. At the same time, portage onto
Info
an SGI Onyx is in the works. The project team
[1] Berlin Homepage http://www.berlin-consortium.org/ members are hoping to be able to try out Berlin in a
[2] Fresco Homepage http://www2.berlin-consortium.org/fresco/ real, walk-in 3D environment on this machine. In
[3] CORBA Information http://www.corba.org/ preparation for this a so-called PrimitiveKit is being
[4] Unicode Standard http://www.unicode.com/ worked on. This will make it possible to insert simple
[5] OpenGL Information http://www.opengl.org/ three-dimensional objects such as spheres and cubes
[6] Die LGPL (GNU Library General Public License) into the scenegraph. Of course, the development of
http://www.gnu.org/copyleft/lgpl.html the so-called canvas widget is not standing still,
[7] GGI-Project Homepage http://www.ggi-project.org either. This could be used to embed an X-Server in
[8] Mesa (free openGL-Implementation) http://www.mesa3d.org/ Berlin. The TextKit is currently still in a revision phase,
[9] libArt http://www.levien.com/libart/ because it still does not provide the bi-directional
[10] FreeType Homepage http://www.freetype.org/ textflow which would be necessary for complete
[11] PNG Homepage http://www.libPNG.org/pub/png/ representation of Unicode symbols.
[12] zlib Homepage http://www.info-zip.org/pub/infozip/zlib/ It is obvious that there is still a great deal to be
[13] omniORB Homepage http://www.uk.research.att.com/omniORB/ done before Berlin is seen as the dreamed-of
[14] Berlin Sourcecode http://www.berlin-consortium.org/install.html alternative to X. The team of the Berlin Project would
be delighted to receive any assistance in further
% development. %
62 LINUX MAGAZINE 4 · 2001


Wyszukiwarka

Podobne podstrony:
2001 01 Know How Commandline Control of Babelfish Translation Service
Sermonti, How Evolution Came to Italy (2001)
Would you like to know how you can play two of the world s
2002 01 Lvm How to Use Logical Volume Management for Hard Disk Storage
Biuletyn IPN 2001 01
NBox know how v5 2 FINAL
1000 Keys to Windows XP PRO
e lerning know how 5 proj
filtry know how
2001 01 Network Security Snort and Nmap
2001 01 Hardware Test Netwinder Officeserver
2001 01 Usb Input Devices
Earthdawn How It Came to Pass
2001 01 Scratch My Itch
Podstawy miks i master (Know How)
2001 01 Zasilacz 10A 10 20V

więcej podobnych podstron