1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" RCS: @(#) $Id: CanvPsY.3,v 1.1.1.1 2002-01-16 10:25:47 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH Tk_CanvasPsY 3 4.0 Tk "Tk Library Procedures"
|
11 |
|
|
.BS
|
12 |
|
|
.SH NAME
|
13 |
|
|
Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases
|
14 |
|
|
.SH SYNOPSIS
|
15 |
|
|
.nf
|
16 |
|
|
\fB#include \fR
|
17 |
|
|
.sp
|
18 |
|
|
double
|
19 |
|
|
\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR)
|
20 |
|
|
.sp
|
21 |
|
|
int
|
22 |
|
|
\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR)
|
23 |
|
|
.sp
|
24 |
|
|
int
|
25 |
|
|
\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR)
|
26 |
|
|
.sp
|
27 |
|
|
int
|
28 |
|
|
\fBTk_CanvasPsFont\fR(\fIinterp, canvas, fontStructPtr\fR)
|
29 |
|
|
.sp
|
30 |
|
|
\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR)
|
31 |
|
|
.sp
|
32 |
|
|
int
|
33 |
|
|
\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR)
|
34 |
|
|
.SH ARGUMENTS
|
35 |
|
|
.AS "unsigned int" *fontStructPtr
|
36 |
|
|
.AP Tk_Canvas canvas in
|
37 |
|
|
A token that identifies a canvas widget for which Postscript is
|
38 |
|
|
being generated.
|
39 |
|
|
.AP double canvasY in
|
40 |
|
|
Y-coordinate in the space of the canvas.
|
41 |
|
|
.AP Tcl_Interp *interp in/out
|
42 |
|
|
A Tcl interpreter; Postscript is appended to its result, or the
|
43 |
|
|
result may be replaced with an error message.
|
44 |
|
|
.AP Pixmap bitmap in
|
45 |
|
|
Bitmap to use for generating Postscript.
|
46 |
|
|
.AP int x in
|
47 |
|
|
X-coordinate within \fIbitmap\fR of left edge of region to output.
|
48 |
|
|
.AP int y in
|
49 |
|
|
Y-coordinate within \fIbitmap\fR of top edge of region to output.
|
50 |
|
|
.AP "int" width in
|
51 |
|
|
Width of region of bitmap to output, in pixels.
|
52 |
|
|
.AP "int" height in
|
53 |
|
|
Height of region of bitmap to output, in pixels.
|
54 |
|
|
.AP XColor *colorPtr in
|
55 |
|
|
Information about color value to set in Postscript.
|
56 |
|
|
.AP XFontStruct *fontStructPtr in
|
57 |
|
|
Font for which Postscript is to be generated.
|
58 |
|
|
.AP double *coordPtr in
|
59 |
|
|
Pointer to an array of coordinates for one or more
|
60 |
|
|
points specified in canvas coordinates.
|
61 |
|
|
The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3,
|
62 |
|
|
and so on.
|
63 |
|
|
.AP int numPoints in
|
64 |
|
|
Number of points at \fIcoordPtr\fR.
|
65 |
|
|
.BE
|
66 |
|
|
|
67 |
|
|
.SH DESCRIPTION
|
68 |
|
|
.PP
|
69 |
|
|
These procedures are called by canvas type managers to carry out
|
70 |
|
|
common functions related to generating Postscript.
|
71 |
|
|
Most of the procedures take a \fIcanvas\fR argument, which
|
72 |
|
|
refers to a canvas widget for which Postscript is being
|
73 |
|
|
generated.
|
74 |
|
|
.PP
|
75 |
|
|
\fBTk_CanvasY\fR takes as argument a y-coordinate in the space of
|
76 |
|
|
a canvas and returns the value that should be used for that point
|
77 |
|
|
in the Postscript currently being generated for \fIcanvas\fR.
|
78 |
|
|
Y coordinates require transformation because Postscript uses an
|
79 |
|
|
origin at the lower-left corner whereas X uses an origin at the
|
80 |
|
|
upper-left corner.
|
81 |
|
|
Canvas x coordinates can be used directly in Postscript without
|
82 |
|
|
transformation.
|
83 |
|
|
.PP
|
84 |
|
|
\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region
|
85 |
|
|
of a bitmap.
|
86 |
|
|
The Postscript is generated in proper image data format for Postscript,
|
87 |
|
|
i.e., as data between angle brackets, one bit per pixel.
|
88 |
|
|
The Postscript is appended to \fIinterp->result\fR and TCL_OK is returned
|
89 |
|
|
unless an error occurs, in which case TCL_ERROR is returned and
|
90 |
|
|
\fIinterp->result\fR is overwritten with an error message.
|
91 |
|
|
.PP
|
92 |
|
|
\fBTk_CanvasPsColor\fR generates Postscript to set the current color
|
93 |
|
|
to correspond to its \fIcolorPtr\fR argument, taking into account any
|
94 |
|
|
color map specified in the \fBpostscript\fR command.
|
95 |
|
|
It appends the Postscript to \fIinterp->result\fR and returns
|
96 |
|
|
TCL_OK unless an error occurs, in which case TCL_ERROR is returned and
|
97 |
|
|
\fIinterp->result\fR is overwritten with an error message.
|
98 |
|
|
.PP
|
99 |
|
|
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
|
100 |
|
|
to match \fIfontStructPtr\fR as closely as possible.
|
101 |
|
|
\fBTk_CanvasPsFont\fR takes into account any font map specified
|
102 |
|
|
in the \fBpostscript\fR command, and it does
|
103 |
|
|
the best it can at mapping X fonts to Postscript fonts.
|
104 |
|
|
It appends the Postscript to \fIinterp->result\fR and returns TCL_OK
|
105 |
|
|
unless an error occurs, in which case TCL_ERROR is returned and
|
106 |
|
|
\fIinterp->result\fR is overwritten with an error message.
|
107 |
|
|
.PP
|
108 |
|
|
\fBTk_CanvasPsPath\fR generates Postscript to set the current path
|
109 |
|
|
to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
|
110 |
|
|
It appends the resulting Postscript to \fIinterp->result\fR.
|
111 |
|
|
.PP
|
112 |
|
|
\fBTk_CanvasPsStipple\fR generates Postscript that will fill the
|
113 |
|
|
current path in stippled fashion.
|
114 |
|
|
It uses \fIbitmap\fR as the stipple pattern and the current Postscript
|
115 |
|
|
color; ones in the stipple bitmap are drawn in the current color, and
|
116 |
|
|
zeroes are not drawn at all.
|
117 |
|
|
The Postscript is appended to \fIinterp->result\fR and TCL_OK is
|
118 |
|
|
returned, unless an error occurs, in which case TCL_ERROR is returned and
|
119 |
|
|
\fIinterp->result\fR is overwritten with an error message.
|
120 |
|
|
|
121 |
|
|
.SH KEYWORDS
|
122 |
|
|
bitmap, canvas, color, font, path, Postscript, stipple
|