"Fossies" - the Fresh Open Source Software Archive

Member "ghostview-1.5/gs.interface" (24 Jul 1993, 3806 Bytes) of package /linux/misc/old/ghost/gnu/ghostview/ghostview-1.5.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.  Ghostscript 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.  Ghostscript will use the
   21 attributes of the window to obtain the colormap, screen, and visual to use.
   22 The width and height will be obtained from the pixmap. The remainder of the
   23 information, is gotten from the GHOSTVIEW property on the window.  In this
   24 case, the 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     bpixmap orient llx lly urx ury xdpi ydpi [left bottom top right]
   51 
   52 scanf format: "%d %d %d %d %d %d %f %f %d %d %d %d"
   53 
   54 explanation of parameters:
   55 
   56 	bpixmap: pixmap id of the backing pixmap for the window.  If no
   57 		pixmap is to be used, this parameter should be zero.  This
   58 		parameter must be zero when drawing on a pixmap.
   59 
   60 	orient:	orientation of the page.  The number represents clockwise
   61 		rotation of the paper in degrees.  Permitted values are
   62 		0, 90, 180, 270.
   63 
   64 	llx, lly, urx, ury: Bounding box of the drawable.  The bounding box
   65 		is specified in PostScript points in default user coordinates.
   66 
   67 	xdpi, ydpi: Resolution of window.  (This can be derived from the
   68 		other parameters, but not without roundoff error.  These
   69 		values are included to avoid this error.)
   70 
   71 	left, bottom, top, right: (optional)
   72 		Margins around the window.  The margins extend the imageable
   73 		area beyond the boundaries of the window.  This is primarily
   74 		used for popup zoom windows.  I have encountered several
   75 		instances of PostScript program that position themselves
   76 		with respect to the imageable area.  The margins are specified
   77 		in PostScript points.  If omitted, the margins are assumed to
   78 		be 0.
   79 
   80 Events from ghostscript
   81 
   82 If the final destination is a pixmap, the client will get a property notify
   83 event when ghostscript reads the GHOSTVIEW property causing it to be deleted.
   84 
   85 Ghostscript sends events to the window where it read the GHOSTVIEW property.
   86 These events are of type ClientMessage.  The message_type is set to
   87 either PAGE or DONE.  The first long data value gives the window to be used
   88 to send replies to ghostscript.  The second long data value gives the primary
   89 drawable.  If rendering to a pixmap, it is the primary drawable.  If rendering
   90 to a window, the backing pixmap is the primary drawable.  If no backing pixmap
   91 is employed, then the window is the primary drawable.  This field is necessary
   92 to distinguish multiple ghostscripts rendering to separate pixmaps where the
   93 GHOSTVIEW property was placed on the same window.
   94 
   95 The PAGE message indicates that a "page" has completed.  Ghostscript will
   96 wait until it receives a ClientMessage whose message_type is NEXT before
   97 continuing.
   98 
   99 The DONE message indicates that ghostscript has finished processing.
  100