aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/xpm/XpmCrPFrData.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/x11iraf/xpm/XpmCrPFrData.c
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vendor/x11iraf/xpm/XpmCrPFrData.c')
-rw-r--r--vendor/x11iraf/xpm/XpmCrPFrData.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/x11iraf/xpm/XpmCrPFrData.c b/vendor/x11iraf/xpm/XpmCrPFrData.c
new file mode 100644
index 00000000..7cac72a9
--- /dev/null
+++ b/vendor/x11iraf/xpm/XpmCrPFrData.c
@@ -0,0 +1,45 @@
+/* Copyright 1990-93 GROUPE BULL -- See license conditions in file COPYRIGHT */
+/*****************************************************************************\
+* XpmCrPFrData.c: *
+* *
+* XPM library *
+* Parse an Xpm array and create the pixmap and possibly its mask *
+* *
+* Developed by Arnaud Le Hors *
+\*****************************************************************************/
+
+#include "xpmP.h"
+
+int
+XpmCreatePixmapFromData(display, d, data, pixmap_return,
+ shapemask_return, attributes)
+ Display *display;
+ Drawable d;
+ char **data;
+ Pixmap *pixmap_return;
+ Pixmap *shapemask_return;
+ XpmAttributes *attributes;
+{
+ XpmImage image;
+ int ErrorStatus;
+
+ /*
+ * create an XpmImage
+ */
+ ErrorStatus = XpmCreateXpmImageFromData(data, &image, attributes);
+ 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);
+}