1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
// Copyright (C) 1999-2014
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"
// copied from tkInt.h
#ifndef MODULE_SCOPE
# ifdef __cplusplus
# define MODULE_SCOPE extern "C"
# else
# define MODULE_SCOPE extern
# endif
#endif
// copied from tkCanvPs.c
#include <tk-private/generic/tkCanvas.h>
typedef struct TkPostscriptInfo {
int x, y, width, height; /* Area to print, in canvas pixel
* coordinates. */
int x2, y2; /* x+width and y+height. */
char *pageXString; /* String value of "-pagex" option or NULL. */
char *pageYString; /* String value of "-pagey" option or NULL. */
double pageX, pageY; /* Postscript coordinates (in points)
* corresponding to pageXString and
* pageYString. Don't forget that y-values
* grow upwards for Postscript! */
char *pageWidthString; /* Printed width of output. */
char *pageHeightString; /* Printed height of output. */
double scale; /* Scale factor for conversion: each pixel
* maps into this many points. */
Tk_Anchor pageAnchor; /* How to anchor bbox on Postscript page. */
int rotate; /* Non-zero means output should be rotated on
* page (landscape mode). */
char *fontVar; /* If non-NULL, gives name of global variable
* containing font mapping information.
* Malloc'ed. */
char *colorVar; /* If non-NULL, give name of global variable
* containing color mapping information.
* Malloc'ed. */
char *colorMode; /* Mode for handling colors: "monochrome",
* "gray", or "color". Malloc'ed. */
int colorLevel; /* Numeric value corresponding to colorMode: 0
* for mono, 1 for gray, 2 for color. */
char *fileName; /* Name of file in which to write Postscript;
* NULL means return Postscript info as
* result. Malloc'ed. */
char *channelName; /* If -channel is specified, the name of the
* channel to use. */
Tcl_Channel chan; /* Open channel corresponding to fileName. */
Tcl_HashTable fontTable; /* Hash table containing names of all font
* families used in output. The hash table
* values are not used. */
int prepass; /* Non-zero means that we're currently in the
* pre-pass that collects font information, so
* the Postscript generated isn't relevant. */
int prolog; /* Non-zero means output should contain the
* standard prolog in the header. Generated in
* library/mkpsenc.tcl, stored in the variable
* ::tk::ps_preamable [sic]. */
Tk_Window tkwin; /* Window to get font pixel/point transform
* from. */
} TkPostscriptInfo;
|