1 / 85

Unix GUI

Unix GUI. Guntis Barzdins Girts Folkmanis. Exception: MacOS X uses a proprietary Aqua windowing system (more efficient than X11). Classic X11. [Guntis-Computer:/usr/X11R6/bin] guntis% ls X luit xbiff xlsclients

clem
Download Presentation

Unix GUI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unix GUI Guntis Barzdins Girts Folkmanis

  2. Exception: MacOS X uses a proprietary Aqua windowing system (more efficient than X11)

  3. Classic X11 [Guntis-Computer:/usr/X11R6/bin] guntis% ls X luit xbiff xlsclients Xmark makedepend xcalc xlsfonts Xnest makeg xclipboard xmag Xprt makepsres xclock xman Xquartz makestrs xcmsdb xmessage Xvfb mergelib xconsole xmh appres mkcfm xcursor-config xmkmf atobm mkdirhier xcutsel xmodmap bdftopcf mkfontdir xditview xon bdftruncate mkfontscale xdm xprop beforelight mkhtmlindex xdpyinfo xrandr bitmap oclock xedit xrdb bmtoa proxymngr xev xrefresh ccmakedep pswrap xeyes xset cleanlinks quartz-wm xfd xsetmode cxpm resize xfindproxy xsetpointer dpsexec revpath xfontsel xsetroot dpsinfo rman xfs xsm dumpkeymap rstart xfsinfo xstdcmap editres rstartd xft-config xterm fc-cache sessreg xfwp xtrapchar fc-list setxkbmap xgamma xtrapin fontconfig-config showfont xgc xtrapinfo freetype-config showrgb xhost xtrapout fslsfonts smproxy xinit xtrapproto fstobdf startx xkbbell xtrapreset gccmakedep sxpm xkbcomp xtrapstats glxgears texteroids xkbevd xvidtune glxinfo twm xkbprint xvinfo iceauth ucs2any xkbvleds xwd ico uxterm xkbwatch xwininfo imake viewres xkill xwud lbxproxy x11perf xload listres x11perfcomp xlogo lndir xauth xlsatoms [Guntis-Computer:/usr/X11R6/bin] guntis% man xwud

  4. Topics • X Windows • X Protocol • Classic X apps • Starting X apps • Window managers • Desktop environments • Desktop applications

  5. X Window • 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 and Linux. • It is largely OS and hardware independent, it is network-transparent, and it supports many different desktops.

  6. 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

  7. X Protocol 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.

  8. X Protocol cont’d The X Protocol is also divided into device dependent and device independent layers.

  9. 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.

  10. Network X Server std system software Client app software User Networked Windowing • X Window designed to allow apps to run on remote machines • Uses client-server model

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

  12. Client-Server Window System Could beWindowManager Client Application Programs Application 1 Application 2 Application n Virtualdisplay 1 Virtualdisplay 2 Virtualdisplay n Server Resourceallocator Device-independent abstraction level Device driver Translates abstraction into reality: one per terminal type Window1 Devices Keyboard Mouse Window2 Windown (After Fig 10.2, Dix, Finlay, Abowd and Beale)

  13. 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

  14. 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

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

  16. Protocol Messages 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.

  17. Protocol Messages Replies • The X server will respond to certain X client requests that require a reply. As noted, not all requests require a reply.

  18. Protocol Messages 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

  19. Protocol Messages 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.

  20. X Windows Protocol Overview X Windows is the predominate windowing system on UNIX computers, developed by the X Consortium, lead by M.I.T. An X server manages the display on the workstation. Clients can connect to server via TCP/IP and perform graphics operations. This makes X Windows much more network capable than Microsoft Windows, for example, which can only be accessed via a local API. X Windows operates over TCP, typically using server port numbers starting with 6000. The X server for a system's first display listens on port 6000; if the system has a second display, its server listens on port 6001; a third display would listen on 6002; etc. The protocol used over this reliable stream connection is essentially request/reply, and it's reputation is as a fat protocol that consumes a lot of bandwidth. Lightweight X (LWX), introduced in X11R6, attempts to reduces X's bandwidth needs to the point where it can be run over dialup modem connections. The X Protocol, documented in a postscript file, defines dozens of messages that can be exchanged between a client and a server. They can generally be classified into four categories: Requests, Replies, Events, and Errors. Typical requests include Draw PolyLine, Draw Text, Create Window, Fill. Replies are matched to particular Requests. Events are asynchronous occurances such as keystrokes and mouse clicks. Errors are matched to particular Requests. If a window is partially or fully obscured by another, overlapping window, the server has two options available to it. The server can allocate additional memory, called backing store, to record to contents of the obscured window. This is purely optional, however. The server can simply ignore the obscured part of the window. Later, when that part of the window becomes visible again, the server sends an Expose event to the client, which must then redraw the affected area. The client, therefore, must be prepared to redraw any part of its windows at any time. Applications do not need to access the X Windows protocol directly. X Windows supports several APIs. The most basic of these is Xlib, which interfaces fairly directly to the underlying network protocol. Most X client applications are linked against Xlib, which allows them to operate on either a local or remote X server, simply by adjusting either an environment variable or a command-line argument. Widgets layer on top of Xlib and provide X Windows with an object-oriented programming model. A widget is an X window capable of handling most of its own protocol interaction. The most popular widget sets are Athena Widgets (aw) and Motif. X Window's security model is all-or-nothing. Either an application can perform any operation on an X desktop, or it can perform none. There is no concept of limiting an application to a single top-level window, for example. Although there is power in this model, such as allowing the window manager to be a normal X client, there are also serious performance implications. A hostile X client could connect to an X server and arrange to capture any screen image, or even to capture keystrokes as a password is being typing in one of the windows. For this reasons, X servers are typically fairly restrictive about which clients they will accept connections from. Two major security models are available. Host-based security (traditionally controlled by the xhost program), permits or denies connections based on their source IP addresses. Authentication (traditionally controlled by the xauth program), requires the connecting program to possess a secret password, typically stored in a UNIX file and subject to standard UNIX access controls. Kerberos-based authentication is also available.

  21. Starting X Windows On a local PC or workstation, you can usually start the X server with the “xinit” (“startx”) command or it may be started automatically by “xdm” (graphical login display). Configuration stored in /etc/XF86Config Usually edited with utility /usr/X11R6/bin/xf86config or /usr/X11R6/bin/xf86cfg

  22. xf86cfg

  23. Configuring X Windows • mouseconfig • Command used to configure a mouse for use by X Windows • xconfigurator • A program that is used to configure video adapter card and monitor information for use by X Windows • redhat-config-xfree86 used in recent Red Hat & in Fedora

  24. Configuring X Windows • Fedora and X Windows configuration • Fedora has greatly improved video & monitor detection • Not included in Fedora (Red Hat only): • SuperProbe • Xf86config • Xconfigurator

  25. Starting X applications To launch an X client from a remote host for display on the local X server, you need to set two things: 1) Permission for the remote host to display X clients on the local machine. xhost +remotehost 2) The target display for the remote application. setenv DISPLAY=server:display [hostname]:displaynumber[.screennumber] not needed, if same host “0” in most cases defaults to “0”

  26. /etc/X11/xinit/xinitrc (xinit)or /home/g/.xsession (xdm) #!/bin/sh # $Id: xinitrc,v 1.2 2003/02/27 19:03:30 jharper Exp $ xrdb -load $HOME/.Xresources xsetroot -solid gray & xclock -g 50x50-0+0 -bw 0 & xterm & # start the window manager exec twm loads resources: default fonts, colours, window sizes last line: replaces shell-script with window manager, will terminate all background processes on exit xinit exceutes this script

  27. Window managers One can use X11 without a window manager. • Typically, one writes a session script which starts an "xterm" at a "-geometry" location. One then starts other X11 clients by giving their "-geometry" explicitly, because there is no window manager The window manager is a special X client that controls the placement and movement of applications, provides title bars and control buttons, menus and taskbars. Some support virtual desktops and very fancy graphics. • When a window manager is running, some of interaction between the X server and its clients is redirected through the window manager. Classic window managers include: • TWM • MWM - Motif Window Manager Nowadays, KDE (kwm) and GNOME (sawfish) are two widely used window managers in Linux.

  28. The Tab Window Manager (TWM)

  29. xterm The most important X application is, rather ironically, the terminal program xterm. Old school xterm:

  30. xterm: The Main Client • You can invoke all UNIX commands and X programs form the UNIX command line available in an xterm window. • xterm can also be used with a scrollbar (-sb), and the number of lines saved can be specified (-sl). • You can position and specify the size and position of a window (-geometry) and its foreground and background color (-fg and -bg). • You can start a program as an icon (-icon) and provide a name (-name) or title (-title).

  31. Some classic X apps xclock – pretty self-explanatory

  32. Some classic X apps xeyes – ok, this is really the most important

  33. xnest

  34. XFree86 “In short, XFree86 is an open source X11-based desktop infrastructure.” – xfree86.org X.org Foundation – sucessor of XFree86 Used in most Linux distributions

  35. Window managers,Widget toolkits,Desktop environments,Desktop applications

  36. X itself provides the back end needed for a GUI. It doesn’t, however, provide an interface itself. Window management functions – e.g. moving or resizing windows – are performed by a window manager, which is itself an X client. These range from the spartan (twm) to the complex and graphically intensive (Enlightenment). There are various different toolkits for creating graphical applications, providing libraries of widgets such as buttons etc. These range from the old and ugly (Motif) to the new and shiny (GTK+, Qt) No two users can be assumed to have the same window manager and different applications can use different toolkits (or even write their own). Therefore, there’s a lack of consistency about the average X desktop – this makes things ugly and can be hard to use. X and the GUI

  37. Why not only a basic X11 environment? • Most X11 applications have important shortcomings: • Application Interoperability is too hard • User Interface is inconsistent and of unequal quality • Modern desktop environment brings the "glue" • Drag & Drop, Session Management, etc... • Consistent "look and feel" • Unified Help System • Easy dialog based desktop configuration • Common application development framework (-> MFC) • Compound document framework (-> OLE) • New exciting possibilities: • Hundreds of new applications (including Office) • Powerful application development environment

  38. Linux GUI Components Graphical Programs (X clients) Desktop Environment Window Manager X Windows Video Adapter Card Hardware

  39. Motif Window manager and Widgets

  40. KDE • KDE is the traditional desktop environment used on Linux systems • K Windows Manager (kwm) • The window manager that works under the KDE Desktop Environment • Qt toolkit • Software toolkit used with the KDE Desktop environment

  41. Linux Developement • Qt Class Library • C++ • Cross Platform • Qt/Windows • Qt/X11 (Linux, Solaris, HPUX, AIX, etc) • Qt/Mac • GPL – Free for non-commercial apps • Qt was used to build KDE • from Trolltech in Norway • www.trolltech.com

  42. Gnome • GNOME Desktop Environment • Default desktop environment in Red Hat Linux • Typically uses the Sawfish Window Manager and the GTK+ toolkit for the C programming language • The GTK+ toolkit was originally developed for the GNU Image Manipulation Program (GIMP) • Ported also to MS Win, MacOS X planned

  43. Bluecurve • Bluecurve • Both a visual theme and a set of modifications to the KDE and GNOME environments • Gives both a common “look & feel” • Smooths out inconsistent behaviors between the different WMs

  44. The KDE Desktop Environment

  45. The Bluecurve + KDE in Fedora

  46. The GNOME Desktop Environment

More Related