Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of GROUPE BULL shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from GROUPE BULL.
"int XpmCreateXpmImageFromData(char **" data ", XpmImage *" image , "XpmInfo *" info );
"int XpmCreateXpmImageFromBuffer(char *" buffer ", XpmImage *" image , "XpmInfo *" info );
"int XpmCreateXpmImageFromImage(Display *" display , "XImage *" image ", XImage *" shapeimage , "XpmImage *" xpmimage ", XpmAttributes *" attributes );
"int XpmCreateXpmImageFromPixmap(Display *" display , "Pixmap *" pixmap ", Pixmap *" shapemask , "XpmImage *" xpmimage ", XpmAttributes *" attributes );
To create an XpmImage from an XPM buffer, use XpmCreateXpmImageFromBuffer (). The XpmCreateXpmImageFromBuffer () function reads the given buffer to fill in the given XpmImage structure. If the buffer does not contain valid XPM data, it returns XpmFileInvalid . If insufficient working storage is allocated, it returns XpmNoMemory . On success it returns XpmSuccess . If the passed XpmInfo structure pointer is not NULL, XpmCreateXpmImageFromBuffer () looks for the following attributes: XpmReturnComments and XpmReturnExtensions, and sets possibly the XpmHotspot attribute when returning. As specified in the table (page 28), if the data related to the attributes XpmReturnComments and XpmReturnExtensions cannot be returned as requested because of insufficient memory storage, XpmCreateXpmImageFromBuffer () will change the valuemask to mention this and will try to continue. So the caller should check on this before accessing requested data.
Note: The valuemask of the passed XpmInfo structure must be set to some valid value, at least zero, otherwise unpredictable errors can occur.
To create an XpmImage from an XPM data, use XpmCreateXpmImageFromData (). XpmCreateXpmImageFromData () fills in the given XpmImage structure from the given data. If the data does not contain valid XPM data, it returns XpmFileInvalid . If insufficient working storage is allocated, it returns XpmNoMemory . On success it returns XpmSuccess. If the passed XpmInfo structure pointer is not NULL, XpmCreateXpmImageFromData () looks for the following attributes: XpmReturnExtensions, and sets possibly the XpmHotspot attribute when returning. As specified in the table (page 28), if the data related to the attribute XpmReturnExtensions cannot be returned as requested because of insufficient memory storage, XpmCreateXpmImageFromData () will change the valuemask to mention this and will try to continue. So the caller should check on this before accessing requested data.
Note: The valuemask of the passed XpmInfo structure must be set to some valid value, at least zero, otherwise unpredictable errors can occur.
To create an XpmImage from an XImage, use XpmCreateXpmImageFromImage (). From the given X images and XpmAttributes if not NULL, XpmCreateXpmImageFromImage () creates an XpmImage following the same mechanism as XpmWriteFileFromImage (__libmansuffix__).
To create an XpmImage from a Pixmap, use XpmCreateXpmImageFromPixmap (). From the given pixmaps and XpmAttributes if not NULL, XpmCreateXpmImageFromPixmap () gets the related XImages by calling XGetImage, then it gives them to XpmCreateXpmImageFromImage () to create an XpmImage which is returned to xpmimage . Finally it destroys the created X images using XDestroyImage (__libmansuffix__).