Pegasus InfoCorp: Web site design and web software development company

Tk_CanvasPsY (3)

utility procedures for generating Postscript for canvases

SYNOPSIS

    #include <tk.h>
    double
    Tk_CanvasPsY(canvas, canvasY)
    int
    Tk_CanvasPsBitmap(interp, canvas, bitmap, x, y, width, height)
    int
    Tk_CanvasPsColor(interp, canvas, colorPtr)
    int
    Tk_CanvasPsFont(interp, canvas, fontStructPtr)
    Tk_CanvasPsPath(interp, canvas, coordPtr, numPoints)
    int
    Tk_CanvasPsStipple(interp, canvas, bitmap)
    

ARGUMENTS

    "unsigned int" *fontStructPtr Tk_Canvas canvas in A token that identifies a canvas widget for which Postscript is being generated. double canvasY in Y-coordinate in the space of the canvas. Tcl_Interp *interp in/out A Tcl interpreter; Postscript is appended to its result, or the result may be replaced with an error message. Pixmap bitmap in Bitmap to use for generating Postscript. int x in X-coordinate within bitmap of left edge of region to output. int y in Y-coordinate within bitmap of top edge of region to output. "int" width in Width of region of bitmap to output, in pixels. "int" height in Height of region of bitmap to output, in pixels. XColor *colorPtr in Information about color value to set in Postscript. XFontStruct *fontStructPtr in Font for which Postscript is to be generated. double *coordPtr in Pointer to an array of coordinates for one or more points specified in canvas coordinates. The order of values in coordPtr is x1, y1, x2, y2, x3, y3, and so on. int numPoints in Number of points at coordPtr.

DESCRIPTION

    These procedures are called by canvas type managers to carry out common functions related to generating Postscript. Most of the procedures take a canvas argument, which refers to a canvas widget for which Postscript is being generated.

    Tk_CanvasY takes as argument a y-coordinate in the space of a canvas and returns the value that should be used for that point in the Postscript currently being generated for canvas. Y coordinates require transformation because Postscript uses an origin at the lower-left corner whereas X uses an origin at the upper-left corner. Canvas x coordinates can be used directly in Postscript without transformation.

    Tk_CanvasPsBitmap generates Postscript to describe a region of a bitmap. The Postscript is generated in proper image data format for Postscript, i.e., as data between angle brackets, one bit per pixel. The Postscript is appended to interp->result and TCL_OK is returned unless an error occurs, in which case TCL_ERROR is returned and interp->result is overwritten with an error message.

    Tk_CanvasPsColor generates Postscript to set the current color to correspond to its colorPtr argument, taking into account any color map specified in the postscript command. It appends the Postscript to interp->result and returns TCL_OK unless an error occurs, in which case TCL_ERROR is returned and interp->result is overwritten with an error message.

    Tk_CanvasPsFont generates Postscript that sets the current font to match fontStructPtr as closely as possible. Tk_CanvasPsFont takes into account any font map specified in the postscript command, and it does the best it can at mapping X fonts to Postscript fonts. It appends the Postscript to interp->result and returns TCL_OK unless an error occurs, in which case TCL_ERROR is returned and interp->result is overwritten with an error message.

    Tk_CanvasPsPath generates Postscript to set the current path to the set of points given by coordPtr and numPoints. It appends the resulting Postscript to interp->result.

    Tk_CanvasPsStipple generates Postscript that will fill the current path in stippled fashion. It uses bitmap as the stipple pattern and the current Postscript color; ones in the stipple bitmap are drawn in the current color, and zeroes are not drawn at all. The Postscript is appended to interp->result and TCL_OK is returned, unless an error occurs, in which case TCL_ERROR is returned and interp->result is overwritten with an error message.

KEYWORDS

    bitmap, canvas, color, font, path, Postscript, stipple '\" '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" RCS: @(#) $Id: CanvTkwin.3,v 1.2 1998/09/14 18:22:45 stanton Exp $ '\" '\" The definitions below are for supplemental macros used in Tcl/Tk '\" manual entries. '\" '\" .AP type name in/out ?indent? '\" Start paragraph describing an argument to a library procedure. '\" type is type of argument (int, etc.), in/out is either "in", "out", '\" or "in/out" to describe whether procedure reads or modifies arg, '\" and indent is equivalent to second arg of .IP (shouldn't ever be '\" needed; use .AS below instead) '\" '\" .AS ?type? ?name? '\" Give maximum sizes of arguments for setting tab stops. Type and '\" name are examples of largest possible arguments that will be passed '\" to .AP later. If args are omitted, default tab stops are used. '\" '\" .BS '\" Start box enclosure. From here until next .BE, everything will be '\" enclosed in one large box. '\" '\" .BE '\" End of box enclosure. '\" '\" .CS '\" Begin code excerpt. '\" '\" .CE '\" End code excerpt. '\" '\" .VS ?version? ?br? '\" Begin vertical sidebar, for use in marking newly-changed parts '\" of man pages. The first argument is ignored and used for recording '\" the version when the .VS was added, so that the sidebars can be '\" found and removed when they reach a certain age. If another argument '\" is present, then a line break is forced before starting the sidebar. '\" '\" .VE '\" End of vertical sidebar. '\" '\" .DS '\" Begin an indented unfilled display. '\" '\" .DE '\" End of indented unfilled display. '\" '\" .SO '\" Start of list of standard options for a Tk widget. The '\" options follow on successive lines, in four columns separated '\" by tabs. '\" '\" .SE '\" End of list of standard options for a Tk widget. '\" '\" .OP cmdName dbName dbClass '\" Start of description of a specific option. cmdName gives the '\" option's name as specified in the class command, dbName gives '\" the option's name in the option database, and dbClass gives '\" the option's class in the option database. '\" '\" .UL arg1 arg2 '\" Print arg1 underlined, then print arg2 normally. '\" '\" RCS: @(#) $Id: man.macros,v 1.2 1998/09/14 18:39:54 stanton Exp $ '\" '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. t .wh -1.3i ^B ^l \n(.l b '\" # Start an argument description AP !"\\$4"" .TP \\$4 \{\ !"\\$2"" .TP \\n()Cu .TP 15