summaryrefslogtreecommitdiffstats
path: root/generic/tkImage.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-04-25 01:03:05 (GMT)
committerhobbs <hobbs>2000-04-25 01:03:05 (GMT)
commitd40aff22f926d2c37ce08393f28ac681d6d7e36f (patch)
tree3490d9b24605b3a11fc43e627724e7ac7c0071e1 /generic/tkImage.c
parent64c1028bcc5cdb311c668614ceca41105491bf4c (diff)
downloadtk-d40aff22f926d2c37ce08393f28ac681d6d7e36f.zip
tk-d40aff22f926d2c37ce08393f28ac681d6d7e36f.tar.gz
tk-d40aff22f926d2c37ce08393f28ac681d6d7e36f.tar.bz2
* generic/tkImage.c (Tk_PostscriptImage): added check to create
necessary prolog for photos * generic/tkCanvPs.c: added Tk_PostscriptPhoto that outputs PS for photo images * generic/tkImgPhoto.c: new func ImgPhotoPostscript and added that in as ps proc in tkPhotoImageType. * generic/tkStubInit.c: * generic/tkDecls.h: * generic/tk.decls: added Tk_PostscriptPhoto
Diffstat (limited to 'generic/tkImage.c')
-rw-r--r--generic/tkImage.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/generic/tkImage.c b/generic/tkImage.c
index e54a189..0c763a1 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkImage.c,v 1.5 1999/12/14 06:52:28 hobbs Exp $
+ * RCS: @(#) $Id: tkImage.c,v 1.6 2000/04/25 01:03:06 hobbs Exp $
*/
#include "tkInt.h"
@@ -634,11 +634,31 @@ Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
int width, height; /* Dimensions of region to redraw. */
int prepass;
{
+ Image *imagePtr = (Image *) image;
int result;
XImage *ximage;
Pixmap pmap;
GC newGC;
XGCValues gcValues;
+
+ if (imagePtr->masterPtr->typePtr == NULL) {
+ /*
+ * No master for image, so nothing to display on postscript.
+ */
+ return TCL_OK;
+ }
+
+ /*
+ * Check if an image specific postscript-generation function
+ * exists; otherwise go on with generic code.
+ */
+
+ if (imagePtr->masterPtr->typePtr->postscriptProc != NULL) {
+ return (*imagePtr->masterPtr->typePtr->postscriptProc)(
+ imagePtr->masterPtr->masterData, interp, tkwin, psinfo,
+ x, y, width, height, prepass);
+ }
+
if (prepass) {
return TCL_OK;
}