"Fossies" - the Fresh Open Source Software Archive

Member "ghostview-1.4.1/gs.interface" (19 Jan 1992, 4101 Bytes) of package /linux/misc/old/ghost/gnu/ghostview/ghostview-1.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 Ghostview interface to ghostscript
    3 
    4 When the GHOSTVIEW environment variable is set, ghostscript draws on
    5 an existing drawable rather than creating its own window.  Ghostscript
    6 can be directed to draw on either a window or a pixmap.
    7 
    8 Drawing on a Window
    9 
   10 The GHOSTVIEW environment variable contains the window id of the target
   11 window.  The window id is an integer.  Ghostview will use the attributes
   12 of the window to obtain the width, height, colormap, screen, and visual of
   13 the window. The remainder of the information is gotten from the GHOSTVIEW
   14 property on that window.
   15 
   16 
   17 Drawing on a Pixmap
   18 
   19 The GHOSTVIEW environment variable contains a window id and a pixmap id.
   20 They are integers separated by white space.  Ghostview will use the attributes
   21 of the window to obtain the colormap, screen, and visual to use.  The
   22 remainder of the information, including the width and height of the pixmap,
   23 is gotten from the GHOSTVIEW property on the window.  In this case, the
   24 property is deleted when read.
   25 
   26 The GHOSTVIEW environment variable
   27 
   28 parameters:	window-id [pixmap-id]
   29 
   30 scanf format:	"%d %d"
   31 
   32 explanation of parameters:
   33 
   34 	window-id: tells ghostscript where to
   35 		    - read the GHOSTVIEW property
   36 		    - send events
   37 		    If pixmap-id is not present,
   38 		    ghostscript will draw on this window.
   39 
   40 	pixmap-id: If present, tells ghostscript that a pixmap will be used
   41 		    as the final destination for drawing.  The window will
   42 		    not be touched for drawing purposes.
   43 
   44 The GHOSTVIEW property
   45 
   46 type:	STRING
   47 
   48 parameters:
   49 
   50     Drawing on a window:
   51     bpixmap orient llx lly urx ury xdpi ydpi [left bottom top right]
   52 
   53     Drawing on a pixmap:
   54     bpixmap orient llx lly urx ury xdpi ydpi left bottom top right width height
   55 
   56 scanf format: "%d %d %d %d %d %d %f %f %d %d %d %d %d %d"
   57 
   58 explanation of parameters:
   59 
   60 	bpixmap: pixmap id of the backing pixmap for the window.  If no
   61 		pixmap is to be used, this parameter should be zero.  This
   62 		parameter must be zero when drawing on a pixmap.
   63 
   64 	orient:	orientation of the page.  The number represents clockwise
   65 		rotation of the paper in degrees.  Permitted values are
   66 		0, 90, 180, 270.
   67 
   68 	llx, lly, urx, ury: Bounding box of the drawable.  The bounding box
   69 		is specified in PostScript points in default user coordinates.
   70 
   71 	xdpi, ydpi: Resolution of window.  (This can be derived from the
   72 		other parameters, but not without roundoff error.  These
   73 		values are included to avoid this error.)
   74 
   75 	left, bottom, top, right: (optional when drawing on a window)
   76 		Margins around the window.  The margins extend the imageable
   77 		area beyond the boundaries of the window.  This is primarily
   78 		used for popup zoom windows.  I have encountered several
   79 		instances of PostScript program that position themselves
   80 		with respect to the imageable area.  The margins are specified
   81 		in PostScript points.  If omitted, the margins are assumed to
   82 		be 0.
   83 
   84 	width, height: (Only specified when drawing on Pixmap)
   85 		The width and height of the pixmap.  (Too bad that we can't
   86 		just query the server.)
   87 
   88 Events from ghostscript
   89 
   90 If the final destination is a pixmap, the client will get a property notify
   91 event when ghostscript reads the GHOSTVIEW property causing it to be deleted.
   92 
   93 Ghostscript sends events to the window where it read the GHOSTVIEW property.
   94 These events are of type ClientMessage.  The message_type is set to
   95 either PAGE or DONE.  The first long data value gives the window to be used
   96 to send replies to ghostscript.  The second long data value gives the primary
   97 drawable.  If rendering to a pixmap, it is the primary drawable.  If rendering
   98 to a window, the backing pixmap is the primary drawable.  If no backing pixmap
   99 is employed, then the window is the primary drawable.  This field is necessary
  100 to distinguish multiple ghostscripts rendering to separate pixmaps where the
  101 GHOSTVIEW property was placed on the same window.
  102 
  103 The PAGE message indicates that a "page" has completed.  Ghostscript will
  104 wait until it receives a ClientMessage whose message_type is NEXT before
  105 continuing.
  106 
  107 The DONE message indicates that ghostscript has finished processing.
  108