Chapter Eleven The X Window System. 2 Lesson A Starting and Navigating an X Window System.
X-WindowsP.K.K.Thambi The X Window System Module 5.
-
Upload
oscar-simpson -
Category
Documents
-
view
227 -
download
8
Transcript of X-WindowsP.K.K.Thambi The X Window System Module 5.
![Page 1: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/1.jpg)
X-WindowsP.K.K.Thambi
The X Window System
Module 5
![Page 2: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/2.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 3: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/3.jpg)
X-WindowsP.K.K.Thambi
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
![Page 4: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/4.jpg)
X-WindowsP.K.K.Thambi
X-window Screen
![Page 5: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/5.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 6: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/6.jpg)
X-WindowsP.K.K.Thambi
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)
![Page 7: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/7.jpg)
X-WindowsP.K.K.Thambi
X Protocol
Based on TCP/IP stackThe 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.
![Page 8: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/8.jpg)
X-WindowsP.K.K.Thambi
X Protocol cont’d
The X Protocol is also divided into device dependent and device independent layers.
![Page 9: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/9.jpg)
X-WindowsP.K.K.Thambi
X architecture
The client-server nature of the X Protocol allows a single X server to support many clients (applications) on several hosts.
![Page 10: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/10.jpg)
X-WindowsP.K.K.Thambi
Client-Server Window System
Application 1 Application 2 Application nClient ApplicationPrograms
Virtualdisplay 1
Virtualdisplay n
Resourceallocator
Devicedriver
Window2 Window
n
Window1
MouseKeyboard
(After Fig 10.2, Dix, Finlay, Abowd and Beale)
Virtualdisplay 2
Server
Devices
Device-independent abstraction level
Translates abstraction into reality:one per terminal type
Could beWindowManager
![Page 11: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/11.jpg)
X-WindowsP.K.K.Thambi
X Server Design Device Dependent Layer
– It is this layer that is responsible for localizing the X server to the native 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.
![Page 12: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/12.jpg)
X-WindowsP.K.K.Thambi
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
![Page 13: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/13.jpg)
X-WindowsP.K.K.Thambi
X Client
• sends requests to the server. • receives events from server. • receives errors from the server
![Page 14: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/14.jpg)
X-WindowsP.K.K.Thambi
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
![Page 15: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/15.jpg)
X-WindowsP.K.K.Thambi
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
![Page 16: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/16.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 17: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/17.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 18: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/18.jpg)
X-WindowsP.K.K.Thambi
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
![Page 19: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/19.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 20: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/20.jpg)
X-WindowsP.K.K.Thambi
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.
![Page 21: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/21.jpg)
X-WindowsP.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
![Page 22: X-WindowsP.K.K.Thambi The X Window System Module 5.](https://reader036.fdocuments.net/reader036/viewer/2022062517/56649f345503460f94c5214a/html5/thumbnails/22.jpg)
X-WindowsP.K.K.Thambi
Structure of an X application
X application
X toolkit
Xt intrinsic
Xlib
X protocol
X Server
Device- dependent Layer
X protocol
Network Interface
User