
XEvent *xevent = event_xevent(event);
if (xevent->xany.type == Expose && xevent->xexpose.count == 0) {
Display *dpy = (Display *)xv_get(logo_public, XV_DISPLAY);
Window window = (Window)xv_get(logo_public, XV_XID);
int width = (int)xv_get(logo_public, XV_WIDTH);
int height = (int)xv_get(logo_public, XV_HEIGHT);
int x = (width - xlogo32_width)/2;
int y = (height - xlogo32_height)/2;
XCopyPlane(dpy, logo_private->bitmap, window, logo_private->gc,
0, 0, xlogo32_width, xlogo32_height, x, y, 1L);
} else if (xevent->xany.type == ConfigureNotify)
XClearArea(xv_get(logo_public, XV_DISPLAY),
xv_get(logo_public, XV_XID), 0, 0,
xevent->xconfigure.width, xevent->xconfigure.height, True);
}
The ConfigureNotify event is tested to see if the window resized. If it did, the window
needs to be cleared and the logo redrawn in the new center of the window. The window is
cleared using XClearArea() and passing True as the last parameter indicating that an
Expose event should be generated. When the event is delivered, logo_redraw() is
called again, and the logo is redrawn.
25.5.5 The Set Method
After the initialize routines for all the classes have been called, the set method is invoked in
reverse order (from the bottom up). That is, the generic package’s set routine is called last
and the logo’s set routine is called first.
The form of the set routine is:
Xv_opaque
set_func(pkg_public, avlist)
Xv_opaque *pkg_public;
Attr_avl