There are input and ouput queues or buffers. Communications between clients and the window manager takes place through properties and events. A request to the window manager to change the size, shape, position or colormap of a window is only a hint; the client must ask the window manager what it actually did and that the window or change has actually been drawn yet. X Protocol Packets ------------------ request : to server (not all requests have replies, but may only specify a drawing change); a request with a reply is a round-trip request (and can be slow) reply : from server error : from server when previous request is invalid event : info about a device action or a side effect of a previous request Flush the connection (queue or buffer): --------------------------------------- XNextEvent() : must send requests in case they are cause of next event *Query*() : immediate reply *Fetch*() : immediate reply *Get*() : immediate reply XFlush() XSync() Resources --------- Have usually an integer ID number (avoiding pointers). Examples: windows, fonts, pixmap, colormap, cursor, graphics context Properties ---------- Properties have a string name (usually all caps with underscores between words) and a numerical identifier call an atom (which is unique for each property, for a given server as long as that server has not been reset). atom=XInternAtom(char *poperty_name); Some atoms are predifined, and hence do not need XInternAtom(), and start with XA_... A group of related clients or an extension may define new properties and atoms. To uniquely define a property both the window ID and the atom are needed. Windows ------- XCreateWindow() XCreateSimpleWindow() Each window has a: 1) unique ID number 2) position of its origin relative to its parents corner (inside parents border) 3) width and height (does not include border width) 4) stacking order (lowest [drawn first] to highest [drawn last]) called its configuration. The width, heait and position are called the window geometry. A window also has depth and visual which determine its color characteristics. depth : number of bits/pixel or planes visual : specifies way pixel values are translated to color (a colormap does color lookup of pixel value, RGB) All graphic calculations are performed on pixel values. A window has a class of either: InputOutput InputOnly There is no OuputOnly class since all windows must receive events. Each window has a set of attributes, which control many aspects of the appearance and response of the window: 1) what color or pattern is used for border and background 2) how are partial window contents relocated during resizing 3) when are contents of window saved automatically as they become covered and then exposed 4) which event types are received, and which are thrown away (i.e. not passed on to ancestor windows) 5) should this window be allowed to be displayed, moved, or resized without notifying the window manager 6) which colormap is used to interpret pixel values 7) what cursor should be displayed when the pointer is in the window The children of the root window are special, because they are the top-level windows of each application and they are managed by the window manager. Window Stacking Order and Visibility ------------------------------------ XMapWindow() XUnmapWindow() XMapSubwindows() XUnmapSubwindows() XMapRaised() XCirculateSubwindows() XConfigureWindow() XRestackWindows() Drawables: a Window or pixmap ----------------------------- XCreatePixmap() : returns uninitialized pixmap XCopyArea() XCopyPlane() Graphics Context (GC) --------------------- A server resource containing info needed by a graphics primitive to draw a particular graphic. Includes: line width, colors, fill patterns. Each GC has an ID. XQueryBestTile()