Sie sind auf Seite 1von 27

The X Window System

X Window System
The X Window system was developed as part of Project Athena at MIT. In 1987, X Version 11 is released. X is now controlled and maintained by the Open Group. The X Windows System, also referred to as X or X11, is the standard graphical engine for Unix , Linux and Sun workstations. It is largely OS and hardware independent, it is network-transparent, and it supports many different desktops. X Window was designed as a client/server architecture.

The application is the "X client," and the software that accepts keyboard and mouse input and renders the images on screen is called the "X server." Communications between X clients and the X server is via the X protocol. Since the user's machine handles user input and output, the X server always runs in the client machine. Applications (X clients) generally run in the server; however, they can also run in the client machine. For example, all applications in Linux desktops are X clients running in the same machine as the X server.

The Graphic User Interface in X


X Window uses a bit-mapped display where each pixel can be manipulated individually. The entire display is known as the root window, and individual applications are displayed as windows on this root window. X is started with the startx or xinit commands. X can also be invoked during system startup

X-window Screen

Client / Server Architecture


Separate programs that talks together for a specific aim. Server will be the program that supplies the services and the client is who make the requests.

X Window Clients and Servers


Although you can easily use the X Window system to run programs stored on your local computer, you can also run applications over the network X Window uses a client/server model in which a program can run on one computer but display its output on another The desktop system from which you run a program is called the X server, the system that hosts and executes the program is called the X client (this is opposite of normal networking)

X architecture
The client-server nature of the X Protocol allows a single X server to support many clients (applications) on several hosts.

Client-Server Window System


Client Application Programs
Application 1 Application 2 Application n

Could be Window Manager

Virtual display 1

Virtual display 2

Virtual display n

Server
Device-independent abstraction level Translates abstraction into reality: one per terminal type

Resource allocator Device driver

Devices

Keyboard Mouse

Window 1 Window 2 Window

(After Fig 10.2, Dix, Finlay, Abowd and Beale)

X Server Design
Device Dependent Layer It is this layer that is responsible for localizing the X server to the environment, be it Windows NT or Solaris. This layer swaps bytes of data from machines with differing byte ordering. Byte ordering (MSB and LSB) is noted in each X request. This layer hides the architectural differences in hardware and operating systems. Maintains device driver dependencies for keyboard, mouse and video.

X Server
The X server therefore: displays drawing requests on the screen. replies to information requests. reports an error in a request. Manages the keyboard, mouse and display device. Multiplexes keyboard and mouse input onto the network (or via local IPC) to the respective X clients. (X events) creates, maps and destroys windows. writes and draws in windows

X Client
sends requests to the server. receives events from server. receives errors from the server

Window Managers
Window managers are X client programs that control the way other X clients are positioned, resized, or moved. Window managers can also provide title bars to windows, keyboard focus by keyboard or mouse, and user-specified key and mouse button bindings. Window managers work with a collection of different X clients, wrapping around the program, making it look a certain way and appear on the screen in a particular Place.

Window Managers
A variety of window managers are included with Red Hat Linux: twm Tab Window Manager very low memory requirements fvwm2 3D look with low memory requirements sawfish The default window manager for the GNOME desktop environment wmaker Window Maker is a full-featured GNU window manager Enlightenment The next big thing? These window managers can be run as individual X clients to gain a better sense of their differences.

Desktop Environments
A desktop environment brings together assorted X clients that can be run together using similar methods, utilizing a common development environment GNOME is the default desktop environment for Red Hat Linux KDE, another desktop environment, uses a different toolkit called Qt. When you start X using the startx command, a pre-specified desktop environment is utilized. To change the default desktop environment used when X starts, open a terminal and type the switchdesk command. This brings up a graphical utility that allows you to select the desktop environment or window manager to use the next time X starts.

X Protocol
Based on TCP/IP stack The X Protocol provides a client-server architecture at the application level:
The X client is the processing part of the application and often runs on a remote machine.

The X server is the display and interaction system.

X Protocol
This is an agreement between X Clients and X Servers In this protocol, data is exchanged in an asynchronous manner over two way communication path that enables transmission of a stream of bytes So X Protocol, can be considered as the machine language of X Window system.

It interprets bits to graphics

X Protocol
The X Protocol is also divided into device dependent and device independent layers.

X Protocol
X client communicate with X server using the X protocol. Data is exchanged in an asynchronous manner over a two-way communication path that enables transmission of a stream of 8 bit bytes. X protocol is the machine language for the X Window system

X Protocol messages
Requests client sends requests to the server (e.g. create window)
Replies server response to client requests Events server forwards events (such as mouse clicks or keyboard entry) to the client Errors server reports errors to the client

Protocol Messages - Requests


Requests X clients make requests to the X server for a certain action to take place. i.e.: Create Window To enhance performance, the X client normally does not expect nor wait for a response. The request is typically left to the reliable network layer to deliver.

Protocol Messages - Replies


Replies The X Server will respond to certain X client requests that require a reply. As noted, not all requests require a reply.

Protocol Messages - Events


Events The X server will forward to the X client an event that the application is expecting. This could include keyboard or mouse input. To minimize network traffic, only expected events are sent to X clients.

X events are 32 bytes

Protocol Messages - Errors


Errors The X server will report errors in requests to the X client. Errors are like an event but are handled differently. X errors are the same size as events to simplify their handling. They are sent to the error handling routine of the X client.

Xlib: The Assemble language of X


A set of C library of X window system Xlib gives you access to the X protocol through more than 300 utility routines. It is the The Assemble language of X Window System. It is the assembly language of X Windows

X-Windows

P.K.K.Thambi

X Toolkit: The High level language of X


XToolkit Intrinsic (Xt Intrinsic) an object- oriented approach to implement the basic building blocks called widgets High level language Dont have a function to display menu So another set of routines X Toolkit Intrinsics (Xt Intrinsics) . An object oriented approach to widgets. Another tool kit is Motif from Open Software Foundation

Structure of an X application
X application X toolkit

Xt intrinsic

Xlib

X protocol

Network Interface

X protocol

X Server

Device- dependent Layer

User

Das könnte Ihnen auch gefallen