home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
src
/
xpm
/
XpmCrIFData.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-07-29
|
2KB
|
53 lines
/* Copyright 1990-92 GROUPE BULL -- See license conditions in file COPYRIGHT */
/*****************************************************************************\
* XpmCrIFData.c: *
* *
* XPM library *
* Parse an Xpm array and create the image and possibly its mask *
* *
* Developed by Arnaud Le Hors *
\*****************************************************************************/
#include "xpmP.h"
int
XpmCreateImageFromData(display, data, image_return,
shapeimage_return, attributes)
Display *display;
char **data;
XImage **image_return;
XImage **shapeimage_return;
XpmAttributes *attributes;
{
xpmData mdata;
int ErrorStatus;
xpmInternAttrib attrib;
/*
* initialize return values
*/
if (image_return)
*image_return = NULL;
if (shapeimage_return)
*shapeimage_return = NULL;
xpmOpenArray(data, &mdata);
xpmInitInternAttrib(&attrib);
ErrorStatus = xpmParseData(&mdata, &attrib, attributes);
if (ErrorStatus == XpmSuccess)
ErrorStatus = xpmCreateImage(display, &attrib, image_return,
shapeimage_return, attributes);
if (ErrorStatus >= 0)
xpmSetAttributes(&attrib, attributes);
else if (attributes)
XpmFreeAttributes(attributes);
xpmFreeInternAttrib(&attrib);
XpmDataClose(&mdata);
return (ErrorStatus);
}