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