PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plstrm.h
Go to the documentation of this file.
1 // Contains declarations for PLStream and PLDev structs.
2 // Also prototypes for stream & device utility functions.
3 //
4 // Copyright (C) 2004 Andrew Ross
5 // Copyright (C) 2004 Andrew Roach
6 //
7 // This file is part of PLplot.
8 //
9 // PLplot is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Library General Public License as published
11 // by the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // PLplot is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Library General Public License for more details.
18 //
19 // You should have received a copy of the GNU Library General Public License
20 // along with PLplot; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 
24 #include "pdf.h"
25 
26 #ifndef __PLSTRM_H__
27 #define __PLSTRM_H__
28 
29 #include "disptab.h"
30 #include "pldll.h"
31 #include "qsastime.h"
32 
33 //--------------------------------------------------------------------------
34 // Define the PLDev data structure.
35 //
36 // These are all quantities that must be saved on a per-device basis.
37 // Some drivers (xwin, tk) allocate structures defined internally.
38 //--------------------------------------------------------------------------
39 
40 typedef struct
41 {
42  PLFLT pxlx, pxly;
43  PLINT xold, yold;
44 
45  PLINT xmin, xmax, xlen;
46  PLINT ymin, ymax, ylen;
47 
48  PLINT xmin_dev, xmax_dev, xlen_dev;
49  PLINT ymin_dev, ymax_dev, ylen_dev;
50 
51  PLFLT xscale_dev, yscale_dev;
52 } PLDev;
53 
54 //--------------------------------------------------------------------------
55 // Define the PLStream data structure.
56 //
57 // This contains a copy of every variable that is stream dependent, which
58 // tends to be those which are settable by the user and persist for longer
59 // than one plot.
60 //
61 // Only those quantities listed in the PLStream struct will be preserved
62 // for an individual stream. Note that the lack of every plplot constant
63 // means that one should only switch streams at a fairly high level, i.e.
64 // on the scale of an entire plot. Otherwise intermediate quantities
65 // will be confused between the streams, possibly resulting in garbage plots.
66 // This structure may be expanded in time to improve intra-stream independence,
67 // but it is doubtful streams will ever be fully independent (perhaps
68 // neither necessary nor desirable? -- time will tell).
69 //
70 // There are undoubtably some inconsistencies in the declaration & use of
71 // the variables below. This is a result of the continuing evolution of
72 // plplot and the numerous authors involved. Hopefully in time the function
73 // of all variables can be fully documented and made more consistent.
74 //
75 // The quantities in each stream are as follows:
76 //
77 //--------------------------------------------------------------------------
78 //
79 // Misc control variables
80 //
81 // ipls PLINT Stream number
82 // level PLINT Initialization level
83 // program char* Program name
84 // verbose PLINT Be more verbose than usual
85 // debug PLINT Generate debugging output
86 // initialized PLINT Set if the stream has been initialized
87 // dev_initialized PLINT Set if the device driver has been loaded
88 // stream_closed PLBOOL Set if the stream was closed or if there
89 // was some sort of error
90 //
91 //--------------------------------------------------------------------------
92 //
93 // Palettes (two of them)
94 //
95 // Color map 0 is intended for static objects, such as boxes, lines, points,
96 // labels, etc. These should be allocated before calling plinit (else you
97 // get 16 by default, which can be undesirable on some platforms). These
98 // are then explicitly selected by number (in order of allocation). The
99 // lowest number is 0, but this is used for the background color, so all
100 // color drivers start with 1 as the default color.
101 //
102 // Color map 1 is for continuous-tone plots, where color is used to
103 // represent function value or intensity. These are set in a relative way
104 // only, for increased portability and flexibility. The actual number of
105 // colors used to represent intensity levels is determined by the driver.
106 // Note that it is only necessary to specify intensity (on a scale from 0
107 // to 1) to get an appropriate color. Drivers incapable of fine shading
108 // will do the best job they can.
109 //
110 // A palette selection tool for both palettes is available for the Tk
111 // driver. Direct writing of RGB values (i.e. banging on the hardware) is
112 // supported but highly discouraged (colors so written will be affected
113 // unpredictably by the palette tools).
114 //
115 // icol0 PLINT Color map 0 entry, current color (0 <= icol0 <= ncol0)
116 // ncol0 PLINT Number of colors allocated in color map 0.
117 // icol1 PLINT Color map 1 entry, current color (0 <= icol1 <= ncol1)
118 // ncol1 PLINT Number of colors allocated in color map 1.
119 // ncol1cp PLINT Number of control points in cmap1 allocation (max PL_MAX_CMAP1CP)
120 // lcol1cp PLFLT Locations of control points in cmap1 [0,1]
121 // curcmap PLINT Current color map
122 // curcolor RGB[] Current color
123 // tmpcolor RGB[] Temporary color storage
124 // cmap0 RGB[] Color map 0: maximum of ncol0 RGB 8-bit values
125 // cmap1 RGB[] Color map 1: maximum of ncol1 RGB 8-bit values
126 // cmap1_min PLFLT Minimum color map 1 color to use in continuous tone plots
127 // cmap1_max PLFLT Maximum color map 1 color to use in continuous tone plots
128 //
129 //--------------------------------------------------------------------------
130 //
131 // Variables governing pen width
132 //
133 // width Current pen width
134 // widthset Set if pen width was specified
135 // widthlock Set if pen width is locked
136 //
137 //--------------------------------------------------------------------------
138 //
139 // Variables governing arrow type
140 //
141 // arrow_x x coordinates of points in arrow
142 // arrow_y y coordinates of points in arrow
143 // arrow_npts number of points in arrow_x, arrow_y
144 // arrow_fill whether the arrow should be filled or not
145 //
146 //--------------------------------------------------------------------------
147 //
148 // Variables used to pass information between the core and the driver
149 //
150 // It would be nice to use the "dev_" prefix uniformly but changing
151 // all that old code would be quite a lot of work..
152 //
153 // device PLINT Graphics device id number
154 // dev_minor PLINT Minor device id (for variations on one type)
155 // color PLINT Set if color is available
156 // colorset PLINT Set if "color" was set prior to calling plinit
157 // plbuf_read PLINT Set during a plot buffer redraw
158 // plbuf_write PLINT Set if driver needs to use the plot buffer
159 // dev_fill0 PLINT Set if driver can do solid area fills
160 // dev_gradient PLINT Set if driver can do (linear) gradients
161 // dev_text PLINT Set if driver want to do it's only text drawing
162 // dev_unicode PLINT Set if driver wants unicode
163 // dev_hrshsym PLINT Set for Hershey symbols to be used
164 // dev_fill1 PLINT Set if driver can do pattern area fills
165 // dev_dash PLINT Set if driver can do dashed lines
166 // dev_di PLINT Set if driver wants to handle DI commands
167 // dev_flush PLINT Set if driver wants to handle flushes itself
168 // dev_swin PLINT Set if driver wants to handle 'set window' commands
169 // dev_fastimg PLINT Set if driver has fast image drawing capabilities
170 // dev_xor PLINT Set if driver supports xor mode.
171 // dev_clear PLINT Set if driver support clear.
172 // termin PLINT Set for interactive devices
173 // graphx PLINT Set if currently in graphics mode
174 // nopause PLINT Set if we are skipping the pause between frames
175 // family PLINT Set if familying is enabled
176 // member PLINT Number of current family member file open
177 // finc PLINT Number to increment between member files
178 // fflen PLINT Minimum field length to use in member file number
179 // bytemax PLINT Number of bytes maximum per member file
180 // famadv PLINT Set to advance to the next family member
181 // DevName char* Device name
182 // OutFile FILE Output file pointer
183 // BaseName char* Output base name (i.e. family)
184 // FileName char* Output file name
185 // output_type int 0 for file, 1 for stream
186 // bytecnt PLINT Byte count for output stream
187 // page PLINT Page count for output stream
188 // linepos PLINT Line count for output stream
189 // pdfs PDFstrm* PDF stream pointer
190 // dev_mem_alpha PLINT The user supplied memory buffer supports alpha values
191 // has_string_length PLINT The driver can calculate the lengths of strings
192 // string_length PLFLT Set to the length of the current string (in mm) by the driver
193 // get_string_length PLINT Tells the driver to calculate the length of the string
194 // but not to render it.
195 //
196 // These are used by the escape function (for area fill, etc).
197 //
198 // dev_npts PLINT Number of points we are plotting
199 // dev_x short* Pointer to array of x values
200 // dev_y short* Pointer to array of x values
201 // For the case where the boundary of the filled region is
202 // self-intersecting, use the even-odd fill rule rather than the
203 // default nonzero fill rule.
204 // dev_eofill PLINT
205 //
206 // For images
207 // dev_nptsX PLINT Number of points we are plotting in X
208 // dev_nptsY PLINT Number of points we are plotting in Y
209 // dev_z ushort* Pointer to array of z values for the color
210 // dev_zmin,
211 // dev_zmax ushort Min and max values of z to plot
212 //
213 // The following pointer is for drivers that require device-specific
214 // data. At initialization the driver should malloc the necessary
215 // space and set pls->dev to point to this area. This way there can
216 // be multiple streams using the same driver without conflict.
217 //
218 // dev void* pointer to device-specific data (malloc'ed)
219 //
220 // User-supplied event handlers for use by interactive drivers (e.g. X).
221 // Can be used to take various actions depending on input. Currently
222 // only a keyboard event handler is supported.
223 //
224 // KeyEH void* Keyboard event handler
225 // KeyEH_data void* Pointer to client data to pass
226 //
227 // ButtonEH void* (Mouse) Button event handler
228 // ButtonEH_data void* Pointer to client data to pass
229 //
230 // bop_handler void* bop handler
231 // bop_data void* Pointer to client data to pass
232 //
233 // eop_handler void* eop handler
234 // eop_data void* Pointer to client data to pass
235 //
236 // Variables used for direct specification of device characteristics
237 // Not supported by all drivers (or even very many)
238 //
239 // xdpi.. PLFLT Device DPI settings in x and y
240 // xlength.. PLINT Device output lengths in x and y
241 // xoffset.. PLINT Device offsets from upper left hand corner
242 // pageset PLINT Set if page dimensions were specified
243 // hack PLINT Enables driver-specific hack(s) if set
244 //
245 //--------------------------------------------------------------------------
246 //
247 // User customization tidy routine. This is called before closing a stream
248 // to do any program specific cleanup.
249 //
250 // tidy void* pointer to cleanup routine
251 // tidy_data void* pointer to client data to pass
252 //
253 //--------------------------------------------------------------------------
254 //
255 // User error control variables. Pass in a pointer for either to be set
256 // in exceptional conditions. The caller is responsible for clearing the
257 // error code.
258 //
259 // errcode PLINT* pointer to variable to assign error code
260 // errmsg char* pointer to error message buffer (must be >= 160 bytes)
261 //
262 //--------------------------------------------------------------------------
263 //
264 // Stuff used by Xlib driver
265 //
266 // geometry char* Window geometry (malloc'ed)
267 // window_id long X-window window ID
268 // nopixmap int Set if you want to forbid allocation of pixmaps
269 // db int Set if you want to double buffer output
270 // (only pixmap is drawn to directly; it is blitted
271 // to output window on EOP or an Expose)
272 // ext_resize_draw int Set if you want to control the redraw caused by a
273 // window resize by an external agent.
274 //--------------------------------------------------------------------------
275 //
276 // These are for support of the TK driver.
277 //
278 // server_name char* Main window name of server
279 // server_host char* Name of host to run server on
280 // server_port char* Port to talk to server on
281 // user char* Your user name on remote host (for remsh command)
282 // plserver char* Name of server
283 // plwindow char* Name of reference server window (malloc'ed)
284 // tk_file char* File for plserver use with its -file option
285 // auto_path char* Additional directories to autoload
286 // bufmax int Number of bytes sent before output buffer is flushed
287 // dp int Use Tcl-DP for communication, if set
288 // server_nokill int Don't kill plserver on a ^C if set
289 //
290 //--------------------------------------------------------------------------
291 //
292 // Variables for use by the plot buffer
293 //
294 // For BUFFERED_FILE
295 // plbufFile FILE Plot buffer file pointer
296 //
297 // For Memory Buffer (default)
298 // plbuf_buffer_grow size_t Memory buffer growth step
299 // plbuf_buffer_size size_t Current size of memory buffer
300 // plbuf_buffer void * Pointer to memory buffer
301 // plbuf_top size_t Offset to the top of used area/start of free area
302 // plbuf_readpos size_t Offset to current position being read
303 //
304 // plbufOwner int Typically set; only zero if current stream is cloned.
305 //
306 //--------------------------------------------------------------------------
307 //
308 // Driver interface (DI)
309 //
310 // difilt PLINT Driver interface filter flag
311 //
312 // dipxmin PLFLT
313 // dipymin PLFLT Min, max relative plot coordinates
314 // dipxmax PLFLT
315 // dipymax PLFLT
316 // dipxax PLFLT Plot window transformation:
317 // dipxb PLFLT x' = dipxax * x + dipxb
318 // dipyay PLFLT
319 // dipyb PLFLT y' = dipyay * y + dipyb
320 //
321 // aspdev PLFLT Original device aspect ratio
322 // aspect PLFLT Page aspect ratio
323 // aspori PLFLT Rotation-induced aspect ratio
324 // caspfactor PLFLT Factor applied to preserve character aspect ratio
325 // freeaspect PLINT Allow aspect ratio to adjust to orientation swaps
326 // when overall aspect ratio is changed.
327 // portrait PLINT Portrait mode (orientation and aspect ratio)
328 // mar PLFLT Page margin (minimum)
329 // jx PLFLT Page justification in x
330 // jy PLFLT Page justification in y
331 //
332 // didxax PLFLT Device window transformation:
333 // didxb PLFLT x' = didxax * x + didxb
334 // didyay PLFLT
335 // didyb PLFLT y' = didyay * y + didyb
336 //
337 // diclpxmi PLINT
338 // diclpxma PLINT Device clip limits
339 // diclpymi PLINT
340 // diclpyma PLINT
341 //
342 // diorot PLFLT Rotation angle (in units of pi/2)
343 // dioxax PLFLT Orientation transformation:
344 // dioxay PLFLT x' = dioxax * x + dioxay * y + dioxb
345 // dioxb PLFLT
346 // dioyax PLFLT y' = dioyax * x + dioyay * y + dioyb
347 // dioyay PLFLT
348 // dioyb PLFLT
349 //
350 // dimxmin PLFLT
351 // dimymin PLFLT Target coordinate system parameters.
352 // dimxmax PLFLT
353 // dimymax PLFLT
354 // dimxpmm PLFLT
355 // dimypmm PLFLT
356 // dimxax PLFLT Map meta to physical coordinates:
357 // dimxb PLFLT x' = dimxax * x + dimxb
358 // dimyay PLFLT
359 // dimyb PLFLT y' = dimyay * y + dimyb
360 //
361 // page_status PLINT Flag to indicate current action
362 //
363 //--------------------------------------------------------------------------
364 //
365 // Fill pattern state information.
366 // patt < 0: Hardware fill, if available (not implemented yet)
367 // patt ==0: Hardware fill, if available, solid
368 // patt > 0: Software fill
369 //
370 // patt Fill pattern number
371 // inclin Array of inclinations in tenths of degree for fill lines
372 // delta Array of spacings in micrometers between fill lines
373 // nps Number of distinct line styles for fills
374 //
375 //--------------------------------------------------------------------------
376 //
377 // Variables used in line drawing
378 //
379 // currx Physical x-coordinate of current point
380 // curry Physical y-coordinate of current point
381 // line_style index of last call to pllsty
382 // mark Array of mark lengths in micrometers for broken lines
383 // space Array of space lengths in micrometers for broken lines
384 // nms Number of elements for current broken line style
385 // timecnt Timer for broken lines
386 // alarm Alarm indicating change of broken line status
387 // pendn Flag indicating if pen is up or down
388 // curel Current element within broken line
389 //
390 //--------------------------------------------------------------------------
391 //
392 // Variables governing character strings
393 //
394 // esc Text string escape character
395 //
396 //--------------------------------------------------------------------------
397 //
398 // Scale factors for characters, symbols, and tick marks.
399 //
400 // scale Scaling factor for chr, sym, maj, min.
401 // chr... Character default height and current (scaled) height
402 // sym... Symbol default height and current (scaled) height
403 // maj... Major tick default height and current (scaled) height
404 // min... Minor tick default height and current (scaled) height
405 //
406 //--------------------------------------------------------------------------
407 //
408 // Variables governing numeric axis label appearance
409 //
410 // setpre Non-zero to set precision using "prec"
411 // precis User-specified precision
412 // xdigmax.. Allowed #digits in axes labels
413 // xdigits.. Actual field widths (returned)
414 // timefmt Format string (for strftime)
415 //
416 //--------------------------------------------------------------------------
417 //
418 // Variables governing physical coordinate system
419 //
420 // vpp.. Viewport boundaries in physical coordinates
421 // spp.. Subpage boundaries in physical coordinates
422 // clp.. Clip boundaries in physical coordinates
423 // phy... Physical device limits in physical coordinates
424 // um. Number of micrometers in a pixel
425 // pmm Number of pixels to a millimeter
426 //
427 //--------------------------------------------------------------------------
428 //
429 // State variables for 3d plots
430 //
431 // base3. World coordinate size of base for 3-d plot
432 // basec. Position of centre of base for 3-d plot
433 // dom... Minimum and maximum values for domain
434 // zzscl Vertical (z) scale for 3-d plot
435 // ran.. Minimum and maximum z values for 3-d plot
436 // c.. Coordinate transformation from 3-d to 2-d
437 //
438 //--------------------------------------------------------------------------
439 //
440 // Variables for keeping track of world coordinate windows on a page.
441 //
442 // nCWindows Number of coordinate windows on current page
443 // windows Array of plCWindow's for current page
444 //
445 //--------------------------------------------------------------------------
446 //
447 // Variables governing subpages and viewports.
448 //
449 // nsub... Number of subpages on physical device
450 // cursub Current subpage
451 // spd... Subpage boundaries in normalized device coordinates
452 // vpd... Viewport boundaries in normalized device coordinates
453 // vpw... Viewport boundaries in world coordinates
454 //
455 //--------------------------------------------------------------------------
456 //
457 // Transformation variables
458 //
459 // wp.... Transformation variables for world to physical conversion
460 // wm.... Transformation variables for world coordinates to mm
461 //
462 //--------------------------------------------------------------------------
463 //
464 // Other variables
465 //
466 // dev_compression Compression level for supporting devices
467 //
468 //--------------------------------------------------------------------------
469 //
470 // Font related variables
471 //
472 // cfont Current font number, replaces global 'font' in plsym.c
473 // This can be latter extended for font shape, series, family and size
474 // fci FCI (font characterization integer)
475 // An FCI is sometimes inserted in the middle of a stream of
476 // unicode glyph indices. Thus to distinguish it from those, the FCI is marked
477 // by 0x8 in the most significant 4 bits. The remaining 7 hex digits
478 // stored in the 32-bit integer characterize 7 different font attributes.
479 // The font attributes are interpreted as follows:
480 // hexdigit => 0 1 2 3 4 5
481 // hexpower Font attribute Possible attribute values
482 // 0 font-family sans-serif serif monospace script symbol |fantasy
483 // 1 font-style upright italic oblique |
484 // 2 font-weight medium bold | bolder light lighter
485 // 3 font-variant normal | small caps
486 //
487 // Everything to the right of the vertical bars is not implemented and is
488 // subject to change. The four font attributes (font-family, font-style,
489 // font-weight, and font-variant are stored in the FCI in the order of
490 // hexpower, the left shift that is applied to the hex digit to place the
491 // hexdigit in the FCI. The hexpower = 3 position is essentially undefined
492 // since there is currently only one hexdigit (0) defined, and similarly
493 // for hexpower = 4-6 so there is room for expansion of this scheme into more
494 // font attributes if required. (hexpower = 7 is reserved for the 0x8 marker
495 // of the FCI.)
496 //
497 //--------------------------------------------------------------------------
498 //
499 // Time related variable
500 //
501 // qsasconfig is a pointer to a struct that keeps track of the details
502 // of the transformation between broken-down and continuous time used
503 // in the qsastime library.
504 //
505 //--------------------------------------------------------------------------
506 //
507 // Variables used in plgradient software fallback to communicate the polygon
508 // to the gradient_define callback used by plshades.
509 //
510 // n_polygon Number of vertex points in the polygon defining the
511 // boundary of the gradient.
512 // x_polygon Pointer to array of x vertex points in the polygon
513 // defining the boundary of the gradient.
514 // y_polygon Pointer to array of y vertex points in the polygon
515 // defining the boundary of the gradient.
516 //--------------------------------------------------------------------------
517 //
518 // Variables used to store gradient information for device drivers.
519 //
520 // xgradient Pointer to array of x coordinates of gradient vector.
521 // ygradient Pointer to array of y coordinates of gradient vector.
522 // ngradient Number of points (two) in gradient vector.
523 //--------------------------------------------------------------------------
524 
525 #define PL_MAX_CMAP1CP 256
526 
527 typedef struct
528 {
529 // Misc control information
530 
531  PLINT ipls, level, verbose, debug, initialized, dev_initialized;
532  //CONSTANT SOVERSION FIX
533  // PLBOOL stream_closed;
534  char *program;
535 
536 // Plot-wide coordinate transform
537 
538  void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer );
540 
541 // Colormaps
542 
543  PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap;
544 
545  PLFLT cmap1_min, cmap1_max;
546 
547  PLColor curcolor, tmpcolor;
550 
552 
553 // Variables governing pen width
554 
555  PLFLT width;
556  PLINT widthset, widthlock;
557 
558 // Variables governing arrow
559  PLFLT *arrow_x;
560  PLFLT *arrow_y;
563 
564 // Driver dispatch table, obsoletes "device" member below.
565 
567 
568 // Variables used for interacting with or by device driver
569 
570  PLINT plbuf_read, plbuf_write;
571  PLINT device, dev_minor, termin, graphx, nopause;
572  PLINT color, colorset;
573  PLINT family, member, finc, fflen, bytemax, famadv;
574  PLINT dev_fill0, dev_fill1, dev_dash, dev_di, dev_flush, dev_swin;
575  PLINT dev_text, dev_xor, dev_clear, dev_fastimg, dev_arc;
576 
577  char DevName[80];
578  FILE *OutFile;
579  char *BaseName, *FileName;
581  PLINT bytecnt, page, linepos;
583 
585  short *dev_x, *dev_y;
586 
587  // variables for plimage()
588 
589  PLINT dev_nptsX, dev_nptsY;
590  short *dev_ix, *dev_iy;
591  unsigned short *dev_z;
592  unsigned short dev_zmin, dev_zmax;
593  PLINT imclxmin, imclxmax, imclymin, imclymax;
594 
595  // end of variables for plimage()
596 
597  void *dev;
598 
599  void ( *KeyEH )( PLGraphicsIn *gin, void *KeyEH_data,
600  int *exit_eventloop );
601  void *KeyEH_data;
602 
603  void ( *ButtonEH )( PLGraphicsIn *gin, void *ButtonEH_data,
604  int *exit_eventloop );
606 
607  void ( *LocateEH )( PLGraphicsIn *gin, void *LocateEH_data,
608  int *locate_mode );
610 
611  void ( *bop_handler )( void *bop_data, int *skip_driver_bop );
612  void *bop_data;
613 
614  void ( *eop_handler )( void *eop_data, int *skip_driver_eop );
615  void *eop_data;
616 
617  PLFLT xdpi, ydpi;
618  PLINT xlength, ylength;
619  PLINT xoffset, yoffset;
620  PLINT pageset, hack;
621 
622 // Per stream tidy function.
623 
624  void ( *tidy )( void * );
625  void *tidy_data;
626 
627 // Error info
628 
630  char *errmsg;
631 
632 // Stuff used by Xlib driver
633 
634  char *geometry;
635  long window_id;
636  int nopixmap, db, ext_resize_draw;
637 
638 // Stuff used by TK, DP drivers
639 
640  char *server_name, *server_host, *server_port, *user;
641  char *plserver, *plwindow;
642  char *auto_path;
643  char *tk_file; // plserver -file option
644  int bufmax, dp, server_nokill;
645 
646 // Plot buffer settings
647 
648 #ifdef BUFFERED_FILE
649  FILE *plbufFile;
650 #else
654  size_t plbuf_top;
656 #endif
658 
659 // Driver interface (DI)
660 
661  PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma;
662  PLFLT dipxmin, dipymin, dipxmax, dipymax;
663  PLFLT dipxax, dipxb, dipyay, dipyb;
664  PLFLT aspdev, aspect, aspori, caspfactor, mar, jx, jy;
665  PLFLT didxax, didxb, didyay, didyb;
666  PLFLT diorot;
667  PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb;
668  PLFLT dimxax, dimxb, dimyay, dimyb;
669  PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm;
670  PLINT page_status, freeaspect, portrait;
671 
672 // Fill pattern info
673 
674  PLINT patt, inclin[2], delta[2], nps;
675 
676 // Variables used in line drawing
677 
678  PLINT currx, curry;
679  //CONSTANT SOVERSION FIX
680  //PLINT line_style;
681  PLINT mark[10], space[10], nms;
682  PLINT timecnt, alarm, pendn, curel;
683 
684 // Variables governing character strings
685 
686  char esc;
687 
688 // Scale factors for characters, symbols, and tick marks.
689 
690  PLFLT scale;
691  PLFLT chrdef, chrht;
692  PLFLT symdef, symht;
693  PLFLT majdef, majht;
694  PLFLT mindef, minht;
695 
696 // Variables governing numeric axis label appearance
697 
698  PLINT setpre, precis;
699  PLINT xdigmax, ydigmax, zdigmax;
700  PLINT xdigits, ydigits, zdigits;
701  char *timefmt;
702  void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
704 
705 // Variables governing physical coordinate system
706 
707  PLINT vppxmi, vppxma, vppymi, vppyma;
708  PLINT sppxmi, sppxma, sppymi, sppyma;
709  PLINT clpxmi, clpxma, clpymi, clpyma;
710  PLINT phyxmi, phyxma, phyxlen, phyymi, phyyma, phyylen;
711  PLINT umx, umy;
712  PLFLT xpmm, ypmm;
713 
714 // State variables for 3d plots
715 
716  PLFLT base3x, base3y, basecx, basecy;
717  PLFLT domxmi, domxma, domymi, domyma;
718  PLFLT zzscl, ranmi, ranma;
719  PLFLT cxx, cxy, cyx, cyy, cyz, czx, czy, czz;
720 
721 // Variables for keeping track of windows on a page.
722 
723  int nplwin;
725 
726 // Variables governing subpages and viewports.
727 
728  PLINT nsubx, nsuby, cursub;
729  PLFLT spdxmi, spdxma, spdymi, spdyma;
730  PLFLT vpdxmi, vpdxma, vpdymi, vpdyma;
731  PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
732 
733 // Transformation variables
734 
735  PLFLT wpxscl, wpxoff, wpyscl, wpyoff;
736  PLFLT wmxscl, wmxoff, wmyscl, wmyoff;
737  PLFLT wdxscl, wdxoff, wdyscl, wdyoff;
738 
739 // Other variables
740 
742  PLINT cfont;
743 
744  void *FT;
745 
746 // Stuff used by the Tkwin driver for Plframe
748 
749 
750 // Unicode section
751 
752  PLINT dev_unicode;
753 
754  PLINT alt_unicode; // The alternative interface for unicode text rendering.
755 
757 
758  PLINT dev_hrshsym;
759 
760 // Used to keep a hold of a temporary copy of the original character height
761 // which I overload as a quick hack to fix up a bug in freetype an plsym()
762 //
763 
764  PLFLT original_chrdef, original_chrht;
765 
766  //
767  // Pointer to postscript document class used by psttf
768  //
769  void *psdoc;
770 
771  // pointer to a struct that keeps track of the details of the
772  // transformation between broken-down and continuous time used in
773  // the qsastime library.
774 
776 
777  // Gradient section.
779  PLINT ngradient;
780  PLINT *xgradient, *ygradient;
781  // The next three variables define the polygon boundary used
782  // in the software fallback for the gradient.
783  PLINT n_polygon;
784  const PLFLT *x_polygon, *y_polygon;
785 
786  //CONSTANT SOVERSION FIX
788  PLINT line_style;
793  PLINT dev_eofill;
794 
795  // Drawing mode section
796  PLINT dev_modeset;
797 
798  // Calculate bounding-box limits rather than plot box?
800  // Bounding box limits in mm for box including decorations
801  // (inverted tick marks and numerical tick labels if either is
802  // present).
803  PLFLT boxbb_xmin, boxbb_xmax, boxbb_ymin, boxbb_ymax;
804 } PLStream;
805 
806 //--------------------------------------------------------------------------
807 // Prototypes for stream & device utility functions.
808 //--------------------------------------------------------------------------
809 
810 #ifdef __cplusplus
811 extern "C" {
812 #endif
813 
814 // Get the current stream pointer
815 
816 void PLDLLIMPEXP
817 plgpls( PLStream **p_pls );
818 
819 // Initializes device cmap 1 entry by interpolation from pls->cmap1 entries
820 
821 PLDLLIMPEXP void
822 plcol_interp( PLStream *pls, PLColor *newcolor, int i, int ncol );
823 
824 // Opens file for output, prompting if not set.
825 
826 PLDLLIMPEXP void
827 plOpenFile( PLStream *pls );
828 
829 // Close output file
830 
831 PLDLLIMPEXP void
832 plCloseFile( PLStream *pls );
833 
834 // Sets up next file member name (in pls->FileName), but does not open it.
835 
836 void
837 plP_getmember( PLStream *pls );
838 
839 // Sets up file name & family stem name.
840 
841 void
842 plP_sfnam( PLStream *pls, const char *fnam );
843 
844 // Initializes family file parameters.
845 
846 PLDLLIMPEXP void
847 plFamInit( PLStream *pls );
848 
849 // Starts new member file of family file set if necessary.
850 
851 PLDLLIMPEXP void
852 plGetFam( PLStream *pls );
853 
854 // Rotates physical coordinates if necessary for given orientation.
855 
856 PLDLLIMPEXP void
858  PLINT *px, PLINT *py );
859 
860 // Allocates a standard PLDev structure for device-specific data
861 
863 plAllocDev( PLStream *pls );
864 
865 // Just fills in the PLGraphicsIn with appropriate initial values.
866 
867 PLDLLIMPEXP void
868 plGinInit( PLGraphicsIn *gin );
869 
870 #ifdef __cplusplus
871 }
872 #endif
873 
874 #endif // __PLSTRM_H__