X Windows in UNIX:Graphical User Interface (GUI).
Module 18: X Windows in UNIX
Presently our communication with a computer is largely using a keyboard and a visual feedback from a display unit (VDU). To support human computer interaction (HCI), we need software support. For instance, we need a display in the form of a prompt on the screen. This reassures us on what is being input. This interface is further enhanced with iconic clues which help us launch the applications in place of character input.
In addition, many applications need a support to be able to display the results of a computation in a visual form. These require a software support in the form of drawing support on VDU. This entails support to be able to draw lines, join a set of lines in the form of continuous curve. It is even possible to generate a control panel to regulate the course of a set of operations in an application.
Unix provides the X-graphics library support to both OS and applications. In this chapter, we shall discuss the X-Windows support. For most Linux installations, we have a built-in X11 version library package. We begin with a brief description of what a Graphical User Interface (GUI) is. Later we briefly describe how the X-Windows system evolved.
18.1 Graphical User Interface (GUI)
GUI, as the name suggests, is an artifact that facilitates availing operating system facilities with the aid of widgets. The widgets basically are windows and icons which provide us with a clue to whatever we may be able to do.
One of the first well known GUIs was the Xerox STAR system which allowed users to have icons for a document page folded at a corner. The STAR had a printer icon and the operations were simply “drag and drop". Subsequently, these were adapted for the Apple Macintosh. Now-a-days all PCs and Workstations support a GUI. SunOS, the predecessor of Solaris had developed a GUI for Unix users which allowed users to have multiple terminals. Each open window is a terminal connected to the machine giving an illusion as if you, as a user, are multiply connected with the machine. Essentially, this gives users a capability similar to being connected to the machine from multiple terminals. Basically, it facilitates running many tasks at a time for a user. For instance, one may edit a program file in one window and run it from another window.
18.1.1 X-Window System
The X-Window system was developed in MIT under project Athena in 1984. The X- Window system operates on the basis of a client and server architecture. Further, X facilitates operation over a set of networked computers by defining a protocol. The protocol mechanism replaced function calls to let application draw its image in a window. The application is now the client and drawing the image is assigned to an X-server. The server handles the bit mapped graphics for the client application. In addition, the server also handles all display-related communications from the client. It is quite possible that for a single X-server there are many clients. In other words while handling communications from multiple clients, an X-server can in fact support drawing images for all connected clients. Clearly, this makes it possible to let many applications draw images on the same screen. The clients may be anywhere on a communication network. As almost all manufacturers support X-compliant protocols, we now have a capability to run an application on a machine from one manufacturer and display the image on another machine with a terminal from another manufacturer.
X-Servers and clients: X-servers support bitmapped displays and this happens as soon as a user logs onto a machine. Some systems may require that the user has to initiate the X-server operation by giving a xinit or a xstart command. On my set-up I use a .xinitrc run command file to customize my display terminal.
Usually X-clients are programs that communicate with one or more X-servers.
Window managers: The metaphor of desktop is important for a user. By analogy, a user may choose to activate one of the tasks from many on his desk. The window managers are designed to provide this illusion. In other words, a window manager (WM in short) must provide facilities that can support such desk-oriented operation from the view on the screen.
All operations within a window are supported by a window manager. The window screen is usually in the ratio of 3 × 4, i.e. it may be 600 × 800 pixels in size. It is possible to regulate this size. The write access into the window can be protected in a common desktop environment. If a user has been away and the system switches to the power-save mode then the system may restrict access only to a valid password holder. Alternatively, there may be a provision to lock a screen using the xlock command.
A window manager is a program, an X-client to be precise, which supports communication with keyboard, mouse and provides the basic interface for the user. A user can instruct the system to resize, iconify, delete a window or even magnify a part of the application image on the screen.
Though mostly the window manager runs on the same machine where the display is, it may actually reside on another machine!! The window manager maintains a “focus" which identifies the currently active window. This also helps to identify the application to which the data (or event) is to be communicated from keyboard (or mouse). Window focus may be obtained by clicking or simply by a “mouse-over" event. Window managers
also help to maintain top menu bars, support widgets like the pull-down menus to select an operation or to open a new window, iconify, resize, or delete (close) an existing window. So technically an X-server does no management, it only serves to display what the WM client asks it to display.
Some well known WMs: Some of the well known window managers are listed below:
1. mwm (Motif window manager)
2. twm (Tom's window manager). In tvwm v is for virtual.
3. olwm (Open look window manager ). Sun's Open Look WM.
Hierarchy amongst windows: Practically every window manager supports widgets like menus (pull down and cascaded), dialog boxes with a variety of buttons like check button, radio button, selection from a list, or text input windows with scroll bars and alert windows to receive inputs like o.k. or cancel buttons. Usually, there is a root window and all the widgets are themselves drawn as small windows hierarchically within the parent window.
Comments
Post a Comment