old-www/HOWTO/XWindow-Overview-HOWTO/arch-overview.html

180 lines
4.4 KiB
HTML

<HTML
><HEAD
><TITLE
>The X Window System Architecture: overview</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="X Window System Architecture Overview HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Introduction"
HREF="introduction.html"><LINK
REL="NEXT"
TITLE="Window Managers"
HREF="window-managers.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>X Window System Architecture Overview HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="introduction.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="window-managers.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="ARCH-OVERVIEW"
>3. The X Window System Architecture: overview</A
></H1
><P
>X was designed with a client-server architecture. The
applications themselves are the clients; they communicate with the
server and issue requests, also receiving information from the server.</P
><P
>The X server maintains exclusive control of the display and
services requests from the clients. At this point, the advantages of
using this model are pretty clear. Applications (clients) only need to
know how to communicate with the server, and need not be concerned
with the details of talking to the actual graphics display device. At
the most basic level, a client tells the server stuff like "draw a
line from here to here", or "render this string of text, using this
font, at this position on-screen".</P
><P
>This would be no different from just using a graphics library to
write our application. However the X model goes a step further. It
doesn't constrain the client being in the same computer as the server.
The protocol used to communicate between clients and server can work
over a network, or actually, any "inter-process communication
mechanism that provides a reliable octet stream". Of course, the
preferred way to do this is by using the TCP/IP protocols. As we can
see, the X model is really powerful; the classical example of this is
running a processor-intensive application on a Cray computer, a
database monitor on a Solaris server, an e-mail application on a small
BSD mail server, and a visualization program on an SGI server, and
then displaying all those on my Linux workstation's screen.</P
><P
>So far we've seen that the X server is the one handling the
actual graphics display. Also, since it's the X server which runs on
the physical, actual computer the user is working on, it's the X
server's responsibility to perform all actual interactions with the
user. This includes reading the mouse and keyboard. All this
information is relayed to the client, which of course will have to
react to it.</P
><P
>X provides a library, aptly called Xlib, which handles all
low-level client-server communication tasks. It sounds obvious that,
then, the client has to invoke functions contained within Xlib to get
work done.</P
><P
>At this point everything seems to be working fine. We have a
server in charge of visual output and data input, client applications,
and a way for them to communicate between each other. In picturing a
hypothetical interaction between a client and a server, the client
could ask the server to assign a rectangular area on the screen. Being
the client, I'm not concerned with where i'm being displayed on the
screen. I just tell the server "give me an area X by Y pixels in
size", and then call functions to perform actions like "draw a line
from here to there", "tell me whether the user is moving the mouse in
my screen area" and so on.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="introduction.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="window-managers.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Introduction</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Window Managers</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>