X Protocol Characteristics

Unlike the rest of the X Window System, the X protocol is independent of implementation and is used to transfer data between computers using the X System.

The X protocol is therefore the basis for the operation of X applications. It defines exactly the messages that can be exchanged between applications running X, and the meaning and expected result from each of these messages.

For example, if an X application wants to draw a window in a specific location of the screen, it has to send a request using the X protocol. The request will specific exactly what window is to be moved, as well as the new location for the window.

The X server will then receive the information using the X protocol. Based on the request parameters, the server will execute the requested command. This way, an application can be run on a remote computer, and the result of the graphical iterations will appear directly on the client screen.

If one is using X applications locally, even then there is are X servers and clients. They are just running on the same machine. Therefore, the X protocol is always present when an X application is running. It performance is fundamental for the operation of the system.

Most of the traditional events on UI programming are send as messages using the X protocol. For example, key presses, mouse clicks, and related events are all communicated between server and client using X protocol.

Finally, for application programmers, the X protocol defines the primitives that are available for the creation of higher level interfaces. The lower level of the X System is defined through the X core library.

The X library talks directly with the X protocol, and provides the most basic functionality for programmers, such as creating windows, moving windows, and drawing simple graphical shapes. Everything else in a graphical system is built from these simple operations.

The knowledge of the X protocol is not strictly required when writing applications in toolkits such as Gtk+ and Qt, but it is useful to have a basic understanding of how it works.

Tags: Windows, X, Unix, Linux, X, programming, Protocol, X
Article created on 2010-08-18 09:55:24

Post a comment