Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873