12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFT8N to 8N + 7 with the least significant bit in the byte representing key 8N.10.9. Exposure EventsThe X protocol does not guarantee to preserve the contents of window regions when the windowsare obscured or reconfigured. Some implementations may preserve the contents of windows.Other implementations are free to destroy the contents of windows when exposed. X expectsclient applications to assume the responsibility for restoring the contents of an exposed windowregion. (An exposed window region describes a formerly obscured window whose regionbecomes visible.) Therefore, the X server sends Expose events describing the window and theregion of the window that has been exposed. A naive client application usually redraws the entirewindow. A more sophisticated client application redraws only the exposed region.10.9.1. Expose EventsThe X server can report Expose events to clients wanting information about when the contents ofwindow regions have been lost. The circumstances in which the X server generates Exposeevents are not as definite as those for other events. However, the X server never generatesExpose events on windows whose class you specified as InputOnly. The X server can generateExpose events when no valid contents are available for regions of a window and either theregions are visible, the regions are viewable and the server is (perhaps newly) maintaining backingstore on the window, orthe window isnot viewable but the server is (perhaps newly) honoringthe window’s backing-store attribute of Always or WhenMapped. The regions decompose intoan (arbitrary) set of rectangles, and an Expose event is generated for each rectangle. For anygiven window, the X server guarantees to report contiguously all of the regions exposed by someaction that causes Expose events, such as raising a window.To receive Expose events, set the ExposureMask bit in the event-mask attribute of the window.The structure for this event type contains:typedef struct {int type; /* Expose */unsigned long serial; /* # of last request processed by server */Bool send_event; /* true if this came from a SendEvent request */Display *display; /* Display the event was read from */Window window;int x, y;int width, height;int count; /* if nonzero, at least this many more */}XExposeEvent;The window member is set to the exposed (damaged) window. The x and y members are set tothe coordinates relative to the window’s origin and indicate the upper-left corner of the rectangle.The width and height members are set to the size (extent) of the rectangle. The count member isset to the number of Expose events that are to follow. Ifcount is zero, no more Expose eventsfollow for this window. However, if count is nonzero, at least that number of Expose events (andpossibly more) follow for this window. Simple applications that do not want to optimize redisplayby distinguishing between subareas of its window can just ignore all Expose events withnonzero counts and perform full redisplays on events with zero counts.215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!