PLplot  5.10.0
plstrm.h
Go to the documentation of this file.
00001 //      Contains declarations for PLStream and PLDev structs.
00002 //      Also prototypes for stream & device utility functions.
00003 //
00004 //  Copyright (C) 2004  Andrew Ross
00005 //  Copyright (C) 2004  Andrew Roach
00006 //
00007 //  This file is part of PLplot.
00008 //
00009 //  PLplot is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU Library General Public License as published
00011 //  by the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  PLplot is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //  GNU Library General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Library General Public License
00020 //  along with PLplot; if not, write to the Free Software
00021 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00022 //
00023 
00024 #include "pdf.h"
00025 
00026 #ifndef __PLSTRM_H__
00027 #define __PLSTRM_H__
00028 
00029 #include "disptab.h"
00030 #include "pldll.h"
00031 #include "qsastime.h"
00032 
00033 //--------------------------------------------------------------------------
00034 // Define the PLDev data structure.
00035 //
00036 // These are all quantities that must be saved on a per-device basis.
00037 // Some drivers (xwin, tk) allocate structures defined internally.
00038 //--------------------------------------------------------------------------
00039 
00040 typedef struct
00041 {
00042     PLFLT pxlx, pxly;
00043     PLINT xold, yold;
00044 
00045     PLINT xmin, xmax, xlen;
00046     PLINT ymin, ymax, ylen;
00047 
00048     PLINT xmin_dev, xmax_dev, xlen_dev;
00049     PLINT ymin_dev, ymax_dev, ylen_dev;
00050 
00051     PLFLT xscale_dev, yscale_dev;
00052 } PLDev;
00053 
00054 //--------------------------------------------------------------------------
00055 // Define the PLStream data structure.
00056 //
00057 // This contains a copy of every variable that is stream dependent, which
00058 // tends to be those which are settable by the user and persist for longer
00059 // than one plot.
00060 //
00061 // Only those quantities listed in the PLStream struct will be preserved
00062 // for an individual stream.  Note that the lack of every plplot constant
00063 // means that one should only switch streams at a fairly high level, i.e.
00064 // on the scale of an entire plot.  Otherwise intermediate quantities
00065 // will be confused between the streams, possibly resulting in garbage plots.
00066 // This structure may be expanded in time to improve intra-stream independence,
00067 // but it is doubtful streams will ever be fully independent (perhaps
00068 // neither necessary nor desirable? -- time will tell).
00069 //
00070 // There are undoubtably some inconsistencies in the declaration & use of
00071 // the variables below.  This is a result of the continuing evolution of
00072 // plplot and the numerous authors involved.  Hopefully in time the function
00073 // of all variables can be fully documented and made more consistent.
00074 //
00075 // The quantities in each stream are as follows:
00076 //
00077 //--------------------------------------------------------------------------
00078 //
00079 // Misc control variables
00080 //
00081 // ipls         PLINT   Stream number
00082 // level        PLINT   Initialization level
00083 // program      char*   Program name
00084 // verbose      PLINT   Be more verbose than usual
00085 // debug        PLINT   Generate debugging output
00086 // initialized  PLINT   Set if the stream has been initialized
00087 // dev_initialized PLINT Set if the device driver has been loaded
00088 // stream_closed PLBOOL  Set if the stream was closed or if there
00089 //                       was some sort of error
00090 //
00091 //--------------------------------------------------------------------------
00092 //
00093 // Palettes (two of them)
00094 //
00095 // Color map 0 is intended for static objects, such as boxes, lines, points,
00096 // labels, etc.  These should be allocated before calling plinit (else you
00097 // get 16 by default, which can be undesirable on some platforms).  These
00098 // are then explicitly selected by number (in order of allocation).  The
00099 // lowest number is 0, but this is used for the background color, so all
00100 // color drivers start with 1 as the default color.
00101 //
00102 // Color map 1 is for continuous-tone plots, where color is used to
00103 // represent function value or intensity.  These are set in a relative way
00104 // only, for increased portability and flexibility.  The actual number of
00105 // colors used to represent intensity levels is determined by the driver.
00106 // Note that it is only necessary to specify intensity (on a scale from 0
00107 // to 1) to get an appropriate color.  Drivers incapable of fine shading
00108 // will do the best job they can.
00109 //
00110 // A palette selection tool for both palettes is available for the Tk
00111 // driver.  Direct writing of RGB values (i.e.  banging on the hardware) is
00112 // supported but highly discouraged (colors so written will be affected
00113 // unpredictably by the palette tools).
00114 //
00115 // icol0        PLINT   Color map 0 entry, current color (0 <= icol0 <= ncol0)
00116 // ncol0        PLINT   Number of colors allocated in color map 0.
00117 // icol1        PLINT   Color map 1 entry, current color (0 <= icol1 <= ncol1)
00118 // ncol1        PLINT   Number of colors allocated in color map 1.
00119 // ncol1cp      PLINT   Number of control points in cmap1 allocation (max PL_MAX_CMAP1CP)
00120 // lcol1cp      PLFLT   Locations of control points in cmap1 [0,1]
00121 // curcmap      PLINT   Current color map
00122 // curcolor     RGB[]   Current color
00123 // tmpcolor     RGB[]   Temporary color storage
00124 // cmap0        RGB[]   Color map 0: maximum of ncol0 RGB 8-bit values
00125 // cmap1        RGB[]   Color map 1: maximum of ncol1 RGB 8-bit values
00126 // cmap1_min    PLFLT   Minimum color map 1 color to use in continuous tone plots
00127 // cmap1_max    PLFLT   Maximum color map 1 color to use in continuous tone plots
00128 //
00129 //--------------------------------------------------------------------------
00130 //
00131 // Variables governing pen width
00132 //
00133 // width        Current pen width
00134 // widthset     Set if pen width was specified
00135 // widthlock    Set if pen width is locked
00136 //
00137 //--------------------------------------------------------------------------
00138 //
00139 // Variables governing arrow type
00140 //
00141 // arrow_x      x coordinates of points in arrow
00142 // arrow_y      y coordinates of points in arrow
00143 // arrow_npts   number of points in arrow_x, arrow_y
00144 // arrow_fill   whether the arrow should be filled or not
00145 //
00146 //--------------------------------------------------------------------------
00147 //
00148 // Variables used to pass information between the core and the driver
00149 //
00150 // It would be nice to use the "dev_" prefix uniformly but changing
00151 // all that old code would be quite a lot of work..
00152 //
00153 // device       PLINT   Graphics device id number
00154 // dev_minor    PLINT   Minor device id (for variations on one type)
00155 // color        PLINT   Set if color is available
00156 // colorset     PLINT   Set if "color" was set prior to calling plinit
00157 // plbuf_read   PLINT   Set during a plot buffer redraw
00158 // plbuf_write  PLINT   Set if driver needs to use the plot buffer
00159 // dev_fill0    PLINT   Set if driver can do solid area fills
00160 // dev_gradient PLINT   Set if driver can do (linear) gradients
00161 // dev_text     PLINT   Set if driver want to do it's only text drawing
00162 // dev_unicode  PLINT   Set if driver wants unicode
00163 // dev_hrshsym  PLINT   Set for Hershey symbols to be used
00164 // dev_fill1    PLINT   Set if driver can do pattern area fills
00165 // dev_dash     PLINT   Set if driver can do dashed lines
00166 // dev_di       PLINT   Set if driver wants to handle DI commands
00167 // dev_flush    PLINT   Set if driver wants to handle flushes itself
00168 // dev_swin     PLINT   Set if driver wants to handle 'set window' commands
00169 // dev_fastimg  PLINT   Set if driver has fast image drawing capabilities
00170 // dev_xor      PLINT   Set if driver supports xor mode.
00171 // dev_clear    PLINT   Set if driver support clear.
00172 // termin       PLINT   Set for interactive devices
00173 // graphx       PLINT   Set if currently in graphics mode
00174 // nopause      PLINT   Set if we are skipping the pause between frames
00175 // family       PLINT   Set if familying is enabled
00176 // member       PLINT   Number of current family member file open
00177 // finc         PLINT   Number to increment between member files
00178 // fflen        PLINT   Minimum field length to use in member file number
00179 // bytemax      PLINT   Number of bytes maximum per member file
00180 // famadv       PLINT   Set to advance to the next family member
00181 // DevName      char*   Device name
00182 // OutFile      FILE    Output file pointer
00183 // BaseName     char*   Output base name (i.e. family)
00184 // FileName     char*   Output file name
00185 // output_type  int     0 for file, 1 for stream
00186 // bytecnt      PLINT   Byte count for output stream
00187 // page         PLINT   Page count for output stream
00188 // linepos      PLINT   Line count for output stream
00189 // pdfs         PDFstrm* PDF stream pointer
00190 // dev_mem_alpha     PLINT  The user supplied memory buffer supports alpha values
00191 // has_string_length PLINT  The driver can calculate the lengths of strings
00192 // string_length     PLFLT  Set to the length of the current string (in mm) by the driver
00193 // get_string_length PLINT  Tells the driver to calculate the length of the string
00194 //                             but not to render it.
00195 //
00196 // These are used by the escape function (for area fill, etc).
00197 //
00198 // dev_npts     PLINT   Number of points we are plotting
00199 // dev_x        short*  Pointer to array of x values
00200 // dev_y        short*  Pointer to array of x values
00201 // For the case where the boundary of the filled region is
00202 // self-intersecting, use the even-odd fill rule rather than the
00203 // default nonzero fill rule.
00204 // dev_eofill   PLINT
00205 //
00206 // For images
00207 // dev_nptsX    PLINT   Number of points we are plotting in X
00208 // dev_nptsY    PLINT   Number of points we are plotting in Y
00209 // dev_z        ushort* Pointer to array of z values for the color
00210 // dev_zmin,
00211 // dev_zmax     ushort  Min and max values of z to plot
00212 //
00213 // The following pointer is for drivers that require device-specific
00214 // data.  At initialization the driver should malloc the necessary
00215 // space and set pls->dev to point to this area.  This way there can
00216 // be multiple streams using the same driver without conflict.
00217 //
00218 // dev          void*   pointer to device-specific data (malloc'ed)
00219 //
00220 // User-supplied event handlers for use by interactive drivers (e.g. X).
00221 // Can be used to take various actions depending on input.  Currently
00222 // only a keyboard event handler is supported.
00223 //
00224 // KeyEH        void*   Keyboard event handler
00225 // KeyEH_data   void*   Pointer to client data to pass
00226 //
00227 // ButtonEH     void*   (Mouse) Button event handler
00228 // ButtonEH_data void*  Pointer to client data to pass
00229 //
00230 // bop_handler  void*   bop handler
00231 // bop_data     void*   Pointer to client data to pass
00232 //
00233 // eop_handler  void*   eop handler
00234 // eop_data     void*   Pointer to client data to pass
00235 //
00236 // Variables used for direct specification of device characteristics
00237 // Not supported by all drivers (or even very many)
00238 //
00239 // xdpi..       PLFLT   Device DPI settings in x and y
00240 // xlength..    PLINT   Device output lengths in x and y
00241 // xoffset..    PLINT   Device offsets from upper left hand corner
00242 // pageset      PLINT   Set if page dimensions were specified
00243 // hack         PLINT   Enables driver-specific hack(s) if set
00244 //
00245 //--------------------------------------------------------------------------
00246 //
00247 // User customization tidy routine.  This is called before closing a stream
00248 // to do any program specific cleanup.
00249 //
00250 // tidy         void*   pointer to cleanup routine
00251 // tidy_data    void*   pointer to client data to pass
00252 //
00253 //--------------------------------------------------------------------------
00254 //
00255 // User error control variables.  Pass in a pointer for either to be set
00256 // in exceptional conditions.  The caller is responsible for clearing the
00257 // error code.
00258 //
00259 // errcode      PLINT*  pointer to variable to assign error code
00260 // errmsg       char*   pointer to error message buffer (must be >= 160 bytes)
00261 //
00262 //--------------------------------------------------------------------------
00263 //
00264 // Stuff used by Xlib driver
00265 //
00266 // geometry     char*   Window geometry (malloc'ed)
00267 // window_id    long    X-window window ID
00268 // nopixmap     int     Set if you want to forbid allocation of pixmaps
00269 // db           int     Set if you want to double buffer output
00270 //                      (only pixmap is drawn to directly; it is blitted
00271 //                      to output window on EOP or an Expose)
00272 // ext_resize_draw int  Set if you want to control the redraw caused by a
00273 //                      window resize by an external agent.
00274 //--------------------------------------------------------------------------
00275 //
00276 // These are for support of the TK driver.
00277 //
00278 // server_name  char*   Main window name of server
00279 // server_host  char*   Name of host to run server on
00280 // server_port  char*   Port to talk to server on
00281 // user         char*   Your user name on remote host (for remsh command)
00282 // plserver     char*   Name of server
00283 // plwindow     char*   Name of reference server window (malloc'ed)
00284 // tk_file      char*   File for plserver use with its -file option
00285 // auto_path    char*   Additional directories to autoload
00286 // bufmax       int     Number of bytes sent before output buffer is flushed
00287 // dp           int     Use Tcl-DP for communication, if set
00288 // server_nokill int    Don't kill plserver on a ^C if set
00289 //
00290 //--------------------------------------------------------------------------
00291 //
00292 // Variables for use by the plot buffer
00293 //
00294 // For BUFFERED_FILE
00295 // plbufFile    FILE    Plot buffer file pointer
00296 //
00297 // For Memory Buffer (default)
00298 // plbuf_buffer_grow    size_t          Memory buffer growth step
00299 // plbuf_buffer_size    size_t          Current size of memory buffer
00300 // plbuf_buffer                 void *          Pointer to memory buffer
00301 // plbuf_top                    size_t          Offset to the top of used area/start of free area
00302 // plbuf_readpos                size_t          Offset to current position being read
00303 //
00304 // plbufOwner   int     Typically set; only zero if current stream is cloned.
00305 //
00306 //--------------------------------------------------------------------------
00307 //
00308 // Driver interface (DI)
00309 //
00310 // difilt       PLINT   Driver interface filter flag
00311 //
00312 // dipxmin      PLFLT
00313 // dipymin      PLFLT   Min, max relative plot coordinates
00314 // dipxmax      PLFLT
00315 // dipymax      PLFLT
00316 // dipxax       PLFLT   Plot window transformation:
00317 // dipxb        PLFLT     x' = dipxax * x + dipxb
00318 // dipyay       PLFLT
00319 // dipyb        PLFLT     y' = dipyay * y + dipyb
00320 //
00321 // aspdev       PLFLT   Original device aspect ratio
00322 // aspect       PLFLT   Page aspect ratio
00323 // aspori       PLFLT   Rotation-induced aspect ratio
00324 // caspfactor   PLFLT   Factor applied to preserve character aspect ratio
00325 // freeaspect   PLINT   Allow aspect ratio to adjust to orientation swaps
00326 //                      when overall aspect ratio is changed.
00327 // portrait     PLINT   Portrait mode (orientation and aspect ratio)
00328 // mar          PLFLT   Page margin (minimum)
00329 // jx           PLFLT   Page justification in x
00330 // jy           PLFLT   Page justification in y
00331 //
00332 // didxax       PLFLT   Device window transformation:
00333 // didxb        PLFLT     x' = didxax * x + didxb
00334 // didyay       PLFLT
00335 // didyb        PLFLT     y' = didyay * y + didyb
00336 //
00337 // diclpxmi     PLINT
00338 // diclpxma     PLINT   Device clip limits
00339 // diclpymi     PLINT
00340 // diclpyma     PLINT
00341 //
00342 // diorot       PLFLT   Rotation angle (in units of pi/2)
00343 // dioxax       PLFLT   Orientation transformation:
00344 // dioxay       PLFLT     x' = dioxax * x + dioxay * y + dioxb
00345 // dioxb        PLFLT
00346 // dioyax       PLFLT     y' = dioyax * x + dioyay * y + dioyb
00347 // dioyay       PLFLT
00348 // dioyb        PLFLT
00349 //
00350 // dimxmin      PLFLT
00351 // dimymin      PLFLT   Target coordinate system parameters.
00352 // dimxmax      PLFLT
00353 // dimymax      PLFLT
00354 // dimxpmm      PLFLT
00355 // dimypmm      PLFLT
00356 // dimxax       PLFLT   Map meta to physical coordinates:
00357 // dimxb        PLFLT     x' = dimxax * x + dimxb
00358 // dimyay       PLFLT
00359 // dimyb        PLFLT     y' = dimyay * y + dimyb
00360 //
00361 // page_status  PLINT   Flag to indicate current action
00362 //
00363 //--------------------------------------------------------------------------
00364 //
00365 // Fill pattern state information.
00366 // patt < 0: Hardware fill, if available (not implemented yet)
00367 // patt ==0: Hardware fill, if available, solid
00368 // patt > 0: Software fill
00369 //
00370 // patt         Fill pattern number
00371 // inclin       Array of inclinations in tenths of degree for fill lines
00372 // delta        Array of spacings in micrometers between fill lines
00373 // nps          Number of distinct line styles for fills
00374 //
00375 //--------------------------------------------------------------------------
00376 //
00377 // Variables used in line drawing
00378 //
00379 // currx        Physical x-coordinate of current point
00380 // curry        Physical y-coordinate of current point
00381 // line_style   index of last call to pllsty
00382 // mark         Array of mark lengths in micrometers for broken lines
00383 // space        Array of space lengths in micrometers for broken lines
00384 // nms          Number of elements for current broken line style
00385 // timecnt      Timer for broken lines
00386 // alarm        Alarm indicating change of broken line status
00387 // pendn        Flag indicating if pen is up or down
00388 // curel        Current element within broken line
00389 //
00390 //--------------------------------------------------------------------------
00391 //
00392 // Variables governing character strings
00393 //
00394 // esc          Text string escape character
00395 //
00396 //--------------------------------------------------------------------------
00397 //
00398 // Scale factors for characters, symbols, and tick marks.
00399 //
00400 // scale        Scaling factor for chr, sym, maj, min.
00401 // chr...       Character default height and current (scaled) height
00402 // sym...       Symbol    default height and current (scaled) height
00403 // maj...       Major tick default height and current (scaled) height
00404 // min...       Minor tick default height and current (scaled) height
00405 //
00406 //--------------------------------------------------------------------------
00407 //
00408 // Variables governing numeric axis label appearance
00409 //
00410 // setpre       Non-zero to set precision using "prec"
00411 // precis       User-specified precision
00412 // xdigmax..    Allowed #digits in axes labels
00413 // xdigits..    Actual field widths (returned)
00414 // timefmt      Format string (for strftime)
00415 //
00416 //--------------------------------------------------------------------------
00417 //
00418 // Variables governing physical coordinate system
00419 //
00420 // vpp..        Viewport boundaries in physical coordinates
00421 // spp..        Subpage  boundaries in physical coordinates
00422 // clp..        Clip     boundaries in physical coordinates
00423 // phy...       Physical device limits in physical coordinates
00424 // um.          Number of micrometers in a pixel
00425 // pmm          Number of pixels to a millimeter
00426 //
00427 //--------------------------------------------------------------------------
00428 //
00429 // State variables for 3d plots
00430 //
00431 // base3.       World coordinate size of base for 3-d plot
00432 // basec.       Position of centre of base for 3-d plot
00433 // dom...       Minimum and maximum values for domain
00434 // zzscl        Vertical (z) scale for 3-d plot
00435 // ran..        Minimum and maximum z values for 3-d plot
00436 // c..          Coordinate transformation from 3-d to 2-d
00437 //
00438 //--------------------------------------------------------------------------
00439 //
00440 // Variables for keeping track of world coordinate windows on a page.
00441 //
00442 // nCWindows    Number of coordinate windows on current page
00443 // windows      Array of plCWindow's for current page
00444 //
00445 //--------------------------------------------------------------------------
00446 //
00447 // Variables governing subpages and viewports.
00448 //
00449 // nsub...      Number of subpages on physical device
00450 // cursub       Current subpage
00451 // spd...       Subpage  boundaries in normalized device coordinates
00452 // vpd...       Viewport boundaries in normalized device coordinates
00453 // vpw...       Viewport boundaries in world coordinates
00454 //
00455 //--------------------------------------------------------------------------
00456 //
00457 // Transformation variables
00458 //
00459 // wp....       Transformation variables for world  to physical conversion
00460 // wm....       Transformation variables for world coordinates to mm
00461 //
00462 //--------------------------------------------------------------------------
00463 //
00464 // Other variables
00465 //
00466 // dev_compression Compression level for supporting devices
00467 //
00468 //--------------------------------------------------------------------------
00469 //
00470 // Font related variables
00471 //
00472 // cfont           Current font number, replaces global 'font' in plsym.c
00473 //                 This can be latter extended for font shape, series, family and size
00474 // fci             FCI (font characterization integer)
00475 // An FCI is sometimes inserted in the middle of a stream of
00476 // unicode glyph indices.  Thus to distinguish it from those, the FCI is marked
00477 // by 0x8 in the most significant 4 bits.  The remaining 7 hex digits
00478 // stored in the 32-bit integer characterize 7 different font attributes.
00479 // The font attributes are interpreted as follows:
00480 // hexdigit =>                    0        1          2        3       4        5
00481 // hexpower   Font attribute               Possible attribute values
00482 //    0       font-family     sans-serif  serif    monospace  script  symbol |fantasy
00483 //    1       font-style        upright   italic    oblique |
00484 //    2       font-weight       medium     bold  |   bolder    light  lighter
00485 //    3       font-variant      normal | small caps
00486 //
00487 // Everything to the right of the vertical bars is not implemented and is
00488 // subject to change.  The four font attributes (font-family, font-style,
00489 // font-weight, and font-variant are stored in the FCI in the order of
00490 // hexpower, the left shift that is applied to the hex digit to place the
00491 // hexdigit in the FCI.  The hexpower = 3 position is essentially undefined
00492 // since there is currently only one hexdigit (0) defined, and similarly
00493 // for hexpower = 4-6 so there is room for expansion of this scheme into more
00494 // font attributes if required.  (hexpower = 7 is reserved for the 0x8 marker
00495 // of the FCI.)
00496 //
00497 //--------------------------------------------------------------------------
00498 //
00499 // Time related variable
00500 //
00501 // qsasconfig is a pointer to a struct that keeps track of the details
00502 // of the transformation between broken-down and continuous time used
00503 // in the qsastime library.
00504 //
00505 //--------------------------------------------------------------------------
00506 //
00507 // Variables used in plgradient software fallback to communicate the polygon
00508 // to the gradient_define callback used by plshades.
00509 //
00510 // n_polygon       Number of vertex points in the polygon defining the
00511 //                 boundary of the gradient.
00512 // x_polygon       Pointer to array of x vertex points in the polygon
00513 //                 defining the boundary of the gradient.
00514 // y_polygon       Pointer to array of y vertex points in the polygon
00515 //                 defining the boundary of the gradient.
00516 //--------------------------------------------------------------------------
00517 //
00518 // Variables used to store gradient information for device drivers.
00519 //
00520 // xgradient       Pointer to array of x coordinates of gradient vector.
00521 // ygradient       Pointer to array of y coordinates of gradient vector.
00522 // ngradient       Number of points (two) in gradient vector.
00523 //--------------------------------------------------------------------------
00524 
00525 #define PL_MAX_CMAP1CP    256
00526 
00527 typedef struct
00528 {
00529 // Misc control information
00530 
00531     PLINT ipls, level, verbose, debug, initialized, dev_initialized;
00532     //CONSTANT SOVERSION FIX
00533     //    PLBOOL     stream_closed;
00534     char  *program;
00535 
00536 // Plot-wide coordinate transform
00537 
00538     void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer );
00539     PLPointer coordinate_transform_data;
00540 
00541 // Colormaps
00542 
00543     PLINT       icol0, ncol0, icol1, ncol1, ncp1, curcmap;
00544 
00545     PLFLT       cmap1_min, cmap1_max;
00546 
00547     PLColor     curcolor, tmpcolor;
00548     PLColor     *cmap0;
00549     PLColor     *cmap1;
00550 
00551     PLControlPt cmap1cp[PL_MAX_CMAP1CP];
00552 
00553 // Variables governing pen width
00554 
00555     PLFLT width;
00556     PLINT widthset, widthlock;
00557 
00558 // Variables governing arrow
00559     PLFLT *arrow_x;
00560     PLFLT *arrow_y;
00561     PLINT arrow_npts;
00562     PLINT arrow_fill;
00563 
00564 // Driver dispatch table, obsoletes "device" member below.
00565 
00566     PLDispatchTable *dispatch_table;
00567 
00568 // Variables used for interacting with or by device driver
00569 
00570     PLINT   plbuf_read, plbuf_write;
00571     PLINT   device, dev_minor, termin, graphx, nopause;
00572     PLINT   color, colorset;
00573     PLINT   family, member, finc, fflen, bytemax, famadv;
00574     PLINT   dev_fill0, dev_fill1, dev_dash, dev_di, dev_flush, dev_swin;
00575     PLINT   dev_text, dev_xor, dev_clear, dev_fastimg, dev_arc;
00576 
00577     char    DevName[80];
00578     FILE    *OutFile;
00579     char    *BaseName, *FileName;
00580     int     output_type;
00581     PLINT   bytecnt, page, linepos;
00582     PDFstrm *pdfs;
00583 
00584     PLINT   dev_npts;
00585     short   *dev_x, *dev_y;
00586 
00587     // variables for plimage()
00588 
00589     PLINT          dev_nptsX, dev_nptsY;
00590     short          *dev_ix, *dev_iy;
00591     unsigned short *dev_z;
00592     unsigned short dev_zmin, dev_zmax;
00593     PLINT          imclxmin, imclxmax, imclymin, imclymax;
00594 
00595     // end of variables for plimage()
00596 
00597     void *dev;
00598 
00599     void ( *KeyEH )( PLGraphicsIn *gin, void *KeyEH_data,
00600                      int *exit_eventloop );
00601     void *KeyEH_data;
00602 
00603     void ( *ButtonEH )( PLGraphicsIn *gin, void *ButtonEH_data,
00604                         int *exit_eventloop );
00605     void *ButtonEH_data;
00606 
00607     void ( *LocateEH )( PLGraphicsIn *gin, void *LocateEH_data,
00608                         int *locate_mode );
00609     void  *LocateEH_data;
00610 
00611     void ( *bop_handler )( void *bop_data, int *skip_driver_bop );
00612     void  *bop_data;
00613 
00614     void ( *eop_handler )( void *eop_data, int *skip_driver_eop );
00615     void  *eop_data;
00616 
00617     PLFLT xdpi, ydpi;
00618     PLINT xlength, ylength;
00619     PLINT xoffset, yoffset;
00620     PLINT pageset, hack;
00621 
00622 // Per stream tidy function.
00623 
00624     void ( *tidy )( void * );
00625     void *tidy_data;
00626 
00627 // Error info
00628 
00629     PLINT *errcode;
00630     char  *errmsg;
00631 
00632 // Stuff used by Xlib driver
00633 
00634     char *geometry;
00635     long window_id;
00636     int  nopixmap, db, ext_resize_draw;
00637 
00638 // Stuff used by TK, DP drivers
00639 
00640     char *server_name, *server_host, *server_port, *user;
00641     char *plserver, *plwindow;
00642     char *auto_path;
00643     char *tk_file;  // plserver -file option
00644     int  bufmax, dp, server_nokill;
00645 
00646 // Plot buffer settings
00647 
00648 #ifdef BUFFERED_FILE
00649     FILE   *plbufFile;
00650 #else
00651     size_t plbuf_buffer_grow;
00652     size_t plbuf_buffer_size;
00653     void   *plbuf_buffer;
00654     size_t plbuf_top;
00655     size_t plbuf_readpos;
00656 #endif
00657     int    plbufOwner;
00658 
00659 // Driver interface (DI)
00660 
00661     PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma;
00662     PLFLT dipxmin, dipymin, dipxmax, dipymax;
00663     PLFLT dipxax, dipxb, dipyay, dipyb;
00664     PLFLT aspdev, aspect, aspori, caspfactor, mar, jx, jy;
00665     PLFLT didxax, didxb, didyay, didyb;
00666     PLFLT diorot;
00667     PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb;
00668     PLFLT dimxax, dimxb, dimyay, dimyb;
00669     PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm;
00670     PLINT page_status, freeaspect, portrait;
00671 
00672 // Fill pattern info
00673 
00674     PLINT patt, inclin[2], delta[2], nps;
00675 
00676 // Variables used in line drawing
00677 
00678     PLINT currx, curry;
00679     //CONSTANT SOVERSION FIX
00680     //PLINT line_style;
00681     PLINT mark[10], space[10], nms;
00682     PLINT timecnt, alarm, pendn, curel;
00683 
00684 // Variables governing character strings
00685 
00686     char esc;
00687 
00688 // Scale factors for characters, symbols, and tick marks.
00689 
00690     PLFLT scale;
00691     PLFLT chrdef, chrht;
00692     PLFLT symdef, symht;
00693     PLFLT majdef, majht;
00694     PLFLT mindef, minht;
00695 
00696 // Variables governing numeric axis label appearance
00697 
00698     PLINT     setpre, precis;
00699     PLINT     xdigmax, ydigmax, zdigmax;
00700     PLINT     xdigits, ydigits, zdigits;
00701     char      *timefmt;
00702     void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
00703     PLPointer label_data;
00704 
00705 // Variables governing physical coordinate system
00706 
00707     PLINT vppxmi, vppxma, vppymi, vppyma;
00708     PLINT sppxmi, sppxma, sppymi, sppyma;
00709     PLINT clpxmi, clpxma, clpymi, clpyma;
00710     PLINT phyxmi, phyxma, phyxlen, phyymi, phyyma, phyylen;
00711     PLINT umx, umy;
00712     PLFLT xpmm, ypmm;
00713 
00714 // State variables for 3d plots
00715 
00716     PLFLT base3x, base3y, basecx, basecy;
00717     PLFLT domxmi, domxma, domymi, domyma;
00718     PLFLT zzscl, ranmi, ranma;
00719     PLFLT cxx, cxy, cyx, cyy, cyz, czx, czy, czz;
00720 
00721 // Variables for keeping track of windows on a page.
00722 
00723     int      nplwin;
00724     PLWindow plwin[PL_MAXWINDOWS];
00725 
00726 // Variables governing subpages and viewports.
00727 
00728     PLINT nsubx, nsuby, cursub;
00729     PLFLT spdxmi, spdxma, spdymi, spdyma;
00730     PLFLT vpdxmi, vpdxma, vpdymi, vpdyma;
00731     PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
00732 
00733 // Transformation variables
00734 
00735     PLFLT wpxscl, wpxoff, wpyscl, wpyoff;
00736     PLFLT wmxscl, wmxoff, wmyscl, wmyoff;
00737     PLFLT wdxscl, wdxoff, wdyscl, wdyoff;
00738 
00739 // Other variables
00740 
00741     PLINT            dev_compression;
00742     PLINT            cfont;
00743 
00744     void             *FT;
00745 
00746 // Stuff used by the Tkwin driver for Plframe
00747     struct PlPlotter *plPlotterPtr;
00748 
00749 
00750 // Unicode section
00751 
00752     PLINT     dev_unicode;
00753 
00754     PLINT     alt_unicode; // The alternative interface for unicode text rendering.
00755 
00756     PLUNICODE fci;
00757 
00758     PLINT     dev_hrshsym;
00759 
00760 // Used to keep a hold of a temporary copy of the original character height
00761 // which I overload as a quick hack to fix up a bug in freetype an plsym()
00762 //
00763 
00764     PLFLT original_chrdef, original_chrht;
00765 
00766     //
00767     // Pointer to postscript document class used by psttf
00768     //
00769     void *psdoc;
00770 
00771     // pointer to a struct that keeps track of the details of the
00772     // transformation between broken-down and continuous time used in
00773     // the qsastime library.
00774 
00775     QSASConfig  *qsasconfig;
00776 
00777     // Gradient section.
00778     PLINT       dev_gradient;
00779     PLINT       ngradient;
00780     PLINT       *xgradient, *ygradient;
00781     // The next three variables define the polygon boundary used
00782     // in the software fallback for the gradient.
00783     PLINT       n_polygon;
00784     const PLFLT *x_polygon, *y_polygon;
00785 
00786     //CONSTANT SOVERSION FIX
00787     PLBOOL      stream_closed;
00788     PLINT       line_style;
00789     PLINT       dev_mem_alpha;
00790     PLINT       has_string_length;
00791     PLFLT       string_length;
00792     PLINT       get_string_length;
00793     PLINT       dev_eofill;
00794 
00795     // Drawing mode section
00796     PLINT       dev_modeset;
00797 
00798     // Calculate bounding-box limits rather than plot box?
00799     PLBOOL      if_boxbb;
00800     // Bounding box limits in mm for box including decorations
00801     // (inverted tick marks and numerical tick labels if either is
00802     // present).
00803     PLFLT boxbb_xmin, boxbb_xmax, boxbb_ymin, boxbb_ymax;
00804 } PLStream;
00805 
00806 //--------------------------------------------------------------------------
00807 // Prototypes for stream & device utility functions.
00808 //--------------------------------------------------------------------------
00809 
00810 #ifdef __cplusplus
00811 extern "C" {
00812 #endif
00813 
00814 // Get the current stream pointer
00815 
00816 void PLDLLIMPEXP
00817 plgpls( PLStream **p_pls );
00818 
00819 // Initializes device cmap 1 entry by interpolation from pls->cmap1 entries
00820 
00821 PLDLLIMPEXP void
00822 plcol_interp( PLStream *pls, PLColor *newcolor, int i, int ncol );
00823 
00824 // Opens file for output, prompting if not set.
00825 
00826 PLDLLIMPEXP void
00827 plOpenFile( PLStream *pls );
00828 
00829 // Close output file
00830 
00831 PLDLLIMPEXP void
00832 plCloseFile( PLStream *pls );
00833 
00834 // Sets up next file member name (in pls->FileName), but does not open it.
00835 
00836 void
00837 plP_getmember( PLStream *pls );
00838 
00839 // Sets up file name & family stem name.
00840 
00841 void
00842 plP_sfnam( PLStream *pls, const char *fnam );
00843 
00844 // Initializes family file parameters.
00845 
00846 PLDLLIMPEXP void
00847 plFamInit( PLStream *pls );
00848 
00849 // Starts new member file of family file set if necessary.
00850 
00851 PLDLLIMPEXP void
00852 plGetFam( PLStream *pls );
00853 
00854 // Rotates physical coordinates if necessary for given orientation.
00855 
00856 PLDLLIMPEXP void
00857 plRotPhy( PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax,
00858           PLINT *px, PLINT *py );
00859 
00860 // Allocates a standard PLDev structure for device-specific data
00861 
00862 PLDLLIMPEXP PLDev *
00863 plAllocDev( PLStream *pls );
00864 
00865 // Just fills in the PLGraphicsIn with appropriate initial values.
00866 
00867 PLDLLIMPEXP void
00868 plGinInit( PLGraphicsIn *gin );
00869 
00870 #ifdef __cplusplus
00871 }
00872 #endif
00873 
00874 #endif  // __PLSTRM_H__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines