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
25.10.0.3 The image package declaration
The package is initialized in the following way:
Xv_pkg image_pkg = {
"Image", /* package name */
ATTR_PKG_IMAGE, /* package ID */
sizeof(Image_public), /* size of the public struct */
SERVER_IMAGE, /* subclassed from the server image */
image_init,
image_set,
image_get,
image_destroy,
image_find
};
25.10.1 The Image Initialize Method
The task of the initialize routine for the image class is primarily to initialize the private data
of the image object and to create and/or add to the linked list of the private data types. The
routine is defined as follows:
image_init(owner, image_public, avlist)
Xv_Screen owner;
Image_public *image_public;
Attr_avlist avlist; /* ignored here */
{
Attr_attribute *attrs;
Image_private *image_private = xv_alloc(Image_private);
Image_private *list; /* linked list of image instances */
Xv_Screen screen = owner? owner : xv_default_screen;
if (!image_private || !screen)
return XV_ERROR;
/* link the public to the private and vice-versa */
image_public->private_data = (Xv_opaque)image_private;
image_private->public_self = (Xv_opaque)image_public;
for (attrs = avlist; *attrs; attrs = attr_next(attrs))
if (attrs[0] == SERVER_IMAGE_BITMAP_FILE)
/* you might also want to check that image_private->filename is NULL*/
image_private->filename =
strcpy(malloc(strlen(attrs[1 ])+1), attrs[1 ]);
image_private->next = (Image_private *)NULL;
image_private->screen
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