X Window System core protocol: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Cn}}
 
(12 intermediate revisions by 12 users not shown)
Line 1:
{{Short description|none}}
[[Image:X11.svg|thumb|100px|The X Window System logo]]
The '''X Window System core protocol'''<ref name="sche-gett">Robert W. Scheifler and James Gettys: ''X Window System: Core and extension protocols, X version 11, releases 6 and 6.1'', Digital Press 1996, {{ISBN|1-55558-148-X}}</ref><ref name="rfc 1013">RFC 1013</ref><ref name="intr">Grant Edwards. [http://www.visi.com/~grante/Xtut/ An Introduction to X11 User Interfaces] {{Webarchive|url=https://web.archive.org/web/20070103060448/http://www.visi.com/~grante/Xtut/ |date=2007-01-03 }}</ref> is the base protocol of the [[X Window System]], which is a [[Computer network|networked]] [[windowing system]] for [[bitmap]] displays used to build [[graphical user interface]]s on [[Unix]], [[Unix-like]], and other [[operating system]]s. The X Window System is based on a [[client–server model]]: a single [[Server (computing)|server]] controls the [[input/output]] hardware, such as the [[Computer screen|screen]], the [[Computer keyboard|keyboard]], and the [[Computer mouse|mouse]]; all application [[Computer program|program]]s act as [[client (computing)|client]]s, interacting with the [[user (computing)|user]] and with the other clients via the server. This interaction is regulated by the X Window System core protocol. Other [[protocol (computing)|protocol]]s related to the X Window System exist, both built at the top of the X Window System core protocol or as separate protocols.
 
In the X Window System core protocol, only four kinds of packets are sent, [[wikt:asynchronously|asynchronously]], over the network: requests, replies, events, and errors. ''Requests'' are sent by a client to the server to ask it to perform some operation (for example, create a new window) and to send back data it holds. ''Replies'' are sent by the server to provide such data. ''Events'' are sent by the server to notify clients of user activity or other occurrences they are interested in. ''Errors'' are packets sent by the server to notify a client of errors occurred during processing of its requests. Requests may generate replies, events, and errors; other than this, the protocol does not mandate a specific order in which packets are sent over the network. Some extensions to the core protocol exist, each one having its own requests, replies, events, and errors.
Line 40 ⟶ 41:
The decorative frame and [[title bar]] (possibly including buttons) that is usually seen around windows are created by the [[window manager]], not by the client that creates the window. The window manager also handles input related to these elements, such as resizing the window when the user clicks and drags the window frame. Clients usually operate on the window they created disregarding the changes operated by the window manager. A change it has to take into account is that [[re-parenting window manager]]s, which almost all modern window managers are, change the parent of top-level windows to a window that is not the root. From the point of view of the core protocol, the window manager is a client, not different from the other applications.
 
Data about a window can be obtained by running the <code>xwininfo</code> program. Passing it the <code>-tree</code> [[command-line]] argument]], this program shows the tree of subwindows of a window, along with their identifiers and geometry data.
 
== Pixmaps and drawables ==
Line 54 ⟶ 55:
Most requests for graphic operations include a ''graphic context'', which is a structure that contains the parameters of the graphic operations. A graphic context includes the foreground color, the background color, the font of text, and other graphic parameters. When requesting a graphic operation, the client includes a graphic context. Not all parameters of the graphic context affect the operation: for example, the font does not affect drawing a line.
 
The core protocol specifies the use of server-side fonts.<ref name="font-faq">{{Cite web|url=http://www.faqs.org/faqs/fonts-faq/part15/|title=comp.fonts FAQ: X11 Info|website=www.faqs.org}}</ref> Such fonts are stored as [[Computer file|file]]s, and the server accesses them either directly via the local [[filesystem]] or via the network from another program called ''font server''. Clients can request the list of fonts available to the server and can request a font to be loaded (if not already) or unloaded (if not used by other clients) by the server. A client can request general information about a font (for example, the font ascent) and the space a specific string takes when drawn with a specific font.{{cn|date=March 2025}}
 
[[Image:Xfontsel.png|thumb|450px|The <code>xfontsel</code> program allows the user to view the glyphs of a font.]]
The names of the fonts are arbitrary strings at the level of the X Window core protocol. The [[X logical font description]] conventions<ref name="logi-font">{{cite web|url=http://www.xfree86.org/current/xlfd.pdf |title=X Logical Font Description Conventions |access-date=2005-12-30 |author=Jim Flowers |author2=Stephen Gildea |year=1994 |format=PDF |work=[[Digital Equipment Corporation]] |publisher=[[X Consortium]] |url-status=dead |archive-url=https://web.archive.org/web/20050328124653/http://www.xfree86.org/current/xlfd.pdf |archive-date=March 28, 2005 }}</ref> specify how fonts should be named according to their attributes. These conventions also specify the values of optional properties that can be attached to fonts.
 
The <code>xlsfonts</code> program prints the list of fonts stored in the server. The <code>xfontsel</code> program shows the glyphs of fonts, and allows the user to select the name of a font for pasting it in another window.
Line 159 ⟶ 160:
 
A part of the X colour system is the X Color Management System (xcms). This system was introduced with X11R6 Release 5 in 1991. This system consists of several additional features in xlib, found in the Xcms* series of functions. This system defines device independent color schemes which can be converted into device dependent RGB systems. The system consists of the xlib Xcms* functions and as well the X Device Color Characterization Convention (XDCCC) which describes how to convert the various device independent colour systems into device dependent RGB colour systems. This system supports the [[CIEXYZ]], [[xyY]], [[CIELUV]] and [[CIELAB]] and as well the [[TekHVC]] colour systems.
[http://insar.stanford.edu/~lharcke/programming/Xcms/] {{Webarchive|url=https://web.archive.org/web/20111005224650/http://insar.stanford.edu/~lharcke/programming/Xcms/ |date=2011-10-05 }}, [http://tronche.com/gui/x/xlib/color/]
 
== Atoms ==
Line 275 ⟶ 276:
Yet another issue where inter-client communication is to some extent relevant is that of [[X session manager|session management]].
 
How a user session starts is another issue that is not covered by the core protocol. Usually, this is done automatically by the [[X display manager (program type)|X display manager]]. The user can however also start a session manually running the [[xinit]] or [[startx]] programs.
 
== See also ==
Line 288 ⟶ 289:
== External links ==
*[http://www.x.org/ X.Org Foundation] (official home page) - [http://xorg.freedesktop.org/wiki/ Mirror] with the ___domain name 'freedesktop.org'.
*[httphttps://xwindow.angelfire.com/ X Window System Internals]
*[http://www.rahul.net/kenton/bib.html Kenton Lee's pages on X Window and Motif] {{Webarchive|url=https://web.archive.org/web/20130520013725/http://www.rahul.net/kenton/bib.html |date=2013-05-20 }}
*[http://www.x.org/releases/current/doc/xproto/x11protocol.html X Window System Protocol, Version 11 (current Release)]
{{XWinSys}}