diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /vendor/x11iraf/xpm/XpmCrPFrBuf.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'vendor/x11iraf/xpm/XpmCrPFrBuf.c')
-rw-r--r-- | vendor/x11iraf/xpm/XpmCrPFrBuf.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/x11iraf/xpm/XpmCrPFrBuf.c b/vendor/x11iraf/xpm/XpmCrPFrBuf.c new file mode 100644 index 00000000..0c765100 --- /dev/null +++ b/vendor/x11iraf/xpm/XpmCrPFrBuf.c @@ -0,0 +1,47 @@ +/* Copyright 1990-93 GROUPE BULL -- See license conditions in file COPYRIGHT */ +/*****************************************************************************\ +* XpmCrPFrBuf.c: * +* * +* XPM library * +* Parse an Xpm buffer and create the pixmap and possibly its mask * +* * +* Developed by Arnaud Le Hors * +\*****************************************************************************/ + +#include "xpmP.h" + +int +XpmCreatePixmapFromBuffer(display, d, buffer, pixmap_return, + shapemask_return, attributes) + Display *display; + Drawable d; + char *buffer; + Pixmap *pixmap_return; + Pixmap *shapemask_return; + XpmAttributes *attributes; +{ + XpmImage image; + int ErrorStatus; + + /* + * create an XpmImage + */ + ErrorStatus = + XpmCreateXpmImageFromBuffer(buffer, &image, attributes, NULL); + + if (ErrorStatus != XpmSuccess) + return (ErrorStatus); + + /* + * then create the pixmaps from it + */ + ErrorStatus = XpmCreatePixmapFromXpmImage(display, d, &image, + pixmap_return, shapemask_return, + attributes); + if (ErrorStatus != XpmSuccess) + XpmFreeAttributes(attributes); + + XpmFreeXpmImage(&image); + + return (ErrorStatus); +} |