PLplot  5.11.1
 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 Memory Buffer (default)
295 // plbuf_buffer_grow size_t Memory buffer growth step
296 // plbuf_buffer_size size_t Current size of memory buffer
297 // plbuf_buffer void * Pointer to memory buffer
298 // plbuf_top size_t Offset to the top of used area/start of free area
299 // plbuf_readpos size_t Offset to current position being read
300 //
301 // plbufOwner int Typically set; only zero if current stream is cloned.
302 //
303 //--------------------------------------------------------------------------
304 //
305 // Driver interface (DI)
306 //
307 // difilt PLINT Driver interface filter flag
308 //
309 // dipxmin PLFLT
310 // dipymin PLFLT Min, max relative plot coordinates
311 // dipxmax PLFLT
312 // dipymax PLFLT
313 // dipxax PLFLT Plot window transformation:
314 // dipxb PLFLT x' = dipxax * x + dipxb
315 // dipyay PLFLT
316 // dipyb PLFLT y' = dipyay * y + dipyb
317 //
318 // aspdev PLFLT Original device aspect ratio
319 // aspect PLFLT Page aspect ratio
320 // aspori PLFLT Rotation-induced aspect ratio
321 // caspfactor PLFLT Factor applied to preserve character aspect ratio
322 // freeaspect PLINT Allow aspect ratio to adjust to orientation swaps
323 // when overall aspect ratio is changed.
324 // portrait PLINT Portrait mode (orientation and aspect ratio)
325 // mar PLFLT Page margin (minimum)
326 // jx PLFLT Page justification in x
327 // jy PLFLT Page justification in y
328 //
329 // didxax PLFLT Device window transformation:
330 // didxb PLFLT x' = didxax * x + didxb
331 // didyay PLFLT
332 // didyb PLFLT y' = didyay * y + didyb
333 //
334 // diclpxmi PLINT
335 // diclpxma PLINT Device clip limits
336 // diclpymi PLINT
337 // diclpyma PLINT
338 //
339 // diorot PLFLT Rotation angle (in units of pi/2)
340 // dioxax PLFLT Orientation transformation:
341 // dioxay PLFLT x' = dioxax * x + dioxay * y + dioxb
342 // dioxb PLFLT
343 // dioyax PLFLT y' = dioyax * x + dioyay * y + dioyb
344 // dioyay PLFLT
345 // dioyb PLFLT
346 //
347 // dimxmin PLFLT
348 // dimymin PLFLT Target coordinate system parameters.
349 // dimxmax PLFLT
350 // dimymax PLFLT
351 // dimxpmm PLFLT
352 // dimypmm PLFLT
353 // dimxax PLFLT Map meta to physical coordinates:
354 // dimxb PLFLT x' = dimxax * x + dimxb
355 // dimyay PLFLT
356 // dimyb PLFLT y' = dimyay * y + dimyb
357 //
358 // page_status PLINT Flag to indicate current action
359 //
360 //--------------------------------------------------------------------------
361 //
362 // Fill pattern state information.
363 // patt < 0: Hardware fill, if available (not implemented yet)
364 // patt ==0: Hardware fill, if available, solid
365 // patt > 0: Software fill
366 //
367 // patt Fill pattern number
368 // inclin Array of inclinations in tenths of degree for fill lines
369 // delta Array of spacings in micrometers between fill lines
370 // nps Number of distinct line styles for fills
371 //
372 //--------------------------------------------------------------------------
373 //
374 // Variables used in line drawing
375 //
376 // currx Physical x-coordinate of current point
377 // curry Physical y-coordinate of current point
378 // line_style index of last call to pllsty
379 // mark Array of mark lengths in micrometers for broken lines
380 // space Array of space lengths in micrometers for broken lines
381 // nms Number of elements for current broken line style
382 // timecnt Timer for broken lines
383 // alarm Alarm indicating change of broken line status
384 // pendn Flag indicating if pen is up or down
385 // curel Current element within broken line
386 //
387 //--------------------------------------------------------------------------
388 //
389 // Variables governing character strings
390 //
391 // esc Text string escape character
392 //
393 //--------------------------------------------------------------------------
394 //
395 // Scale factors for characters, symbols, and tick marks.
396 //
397 // scale Scaling factor for chr, sym, maj, min.
398 // chr... Character default height and current (scaled) height
399 // sym... Symbol default height and current (scaled) height
400 // maj... Major tick default height and current (scaled) height
401 // min... Minor tick default height and current (scaled) height
402 //
403 //--------------------------------------------------------------------------
404 //
405 // Variables governing numeric axis label appearance
406 //
407 // setpre Non-zero to set precision using "prec"
408 // precis User-specified precision
409 // xdigmax.. Allowed #digits in axes labels
410 // xdigits.. Actual field widths (returned)
411 // timefmt Format string (for strftime)
412 //
413 //--------------------------------------------------------------------------
414 //
415 // Variables governing physical coordinate system
416 //
417 // vpp.. Viewport boundaries in physical coordinates
418 // spp.. Subpage boundaries in physical coordinates
419 // clp.. Clip boundaries in physical coordinates
420 // phy... Physical device limits in physical coordinates
421 // um. Number of micrometers in a pixel
422 // pmm Number of pixels to a millimeter
423 //
424 //--------------------------------------------------------------------------
425 //
426 // State variables for 3d plots
427 //
428 // base3. World coordinate size of base for 3-d plot
429 // basec. Position of centre of base for 3-d plot
430 // dom... Minimum and maximum values for domain
431 // zzscl Vertical (z) scale for 3-d plot
432 // ran.. Minimum and maximum z values for 3-d plot
433 // c.. Coordinate transformation from 3-d to 2-d
434 //
435 //--------------------------------------------------------------------------
436 //
437 // Variables for keeping track of world coordinate windows on a page.
438 //
439 // nCWindows Number of coordinate windows on current page
440 // windows Array of plCWindow's for current page
441 //
442 //--------------------------------------------------------------------------
443 //
444 // Variables governing subpages and viewports.
445 //
446 // nsub... Number of subpages on physical device
447 // cursub Current subpage
448 // spd... Subpage boundaries in normalized device coordinates
449 // vpd... Viewport boundaries in normalized device coordinates
450 // vpw... Viewport boundaries in world coordinates
451 //
452 //--------------------------------------------------------------------------
453 //
454 // Transformation variables
455 //
456 // wp.... Transformation variables for world to physical conversion
457 // wm.... Transformation variables for world coordinates to mm
458 //
459 //--------------------------------------------------------------------------
460 //
461 // Other variables
462 //
463 // dev_compression Compression level for supporting devices
464 //
465 //--------------------------------------------------------------------------
466 //
467 // Font related variables
468 //
469 // cfont Current font number, replaces global 'font' in plsym.c
470 // This can be latter extended for font shape, series, family and size
471 // fci FCI (font characterization integer)
472 // An FCI is sometimes inserted in the middle of a stream of
473 // unicode glyph indices. Thus to distinguish it from those, the FCI is marked
474 // by 0x8 in the most significant 4 bits. The remaining 7 hex digits
475 // stored in the 32-bit integer characterize 7 different font attributes.
476 // The font attributes are interpreted as follows:
477 // hexdigit => 0 1 2 3 4 5
478 // hexpower Font attribute Possible attribute values
479 // 0 font-family sans-serif serif monospace script symbol |fantasy
480 // 1 font-style upright italic oblique |
481 // 2 font-weight medium bold | bolder light lighter
482 // 3 font-variant normal | small caps
483 //
484 // Everything to the right of the vertical bars is not implemented and is
485 // subject to change. The four font attributes (font-family, font-style,
486 // font-weight, and font-variant are stored in the FCI in the order of
487 // hexpower, the left shift that is applied to the hex digit to place the
488 // hexdigit in the FCI. The hexpower = 3 position is essentially undefined
489 // since there is currently only one hexdigit (0) defined, and similarly
490 // for hexpower = 4-6 so there is room for expansion of this scheme into more
491 // font attributes if required. (hexpower = 7 is reserved for the 0x8 marker
492 // of the FCI.)
493 //
494 //--------------------------------------------------------------------------
495 //
496 // Time related variable
497 //
498 // qsasconfig is a pointer to a struct that keeps track of the details
499 // of the transformation between broken-down and continuous time used
500 // in the qsastime library.
501 //
502 //--------------------------------------------------------------------------
503 //
504 // Variables used in plgradient software fallback to communicate the polygon
505 // to the gradient_define callback used by plshades.
506 //
507 // n_polygon Number of vertex points in the polygon defining the
508 // boundary of the gradient.
509 // x_polygon Pointer to array of x vertex points in the polygon
510 // defining the boundary of the gradient.
511 // y_polygon Pointer to array of y vertex points in the polygon
512 // defining the boundary of the gradient.
513 //--------------------------------------------------------------------------
514 //
515 // Variables used to store gradient information for device drivers.
516 //
517 // xgradient Pointer to array of x coordinates of gradient vector.
518 // ygradient Pointer to array of y coordinates of gradient vector.
519 // ngradient Number of points (two) in gradient vector.
520 //--------------------------------------------------------------------------
521 
522 #define PL_MAX_CMAP1CP 256
523 
524 typedef struct
525 {
526 // Misc control information
527 
528  PLINT ipls, level, verbose, debug, initialized, dev_initialized;
529  //CONSTANT SOVERSION FIX
530  // PLBOOL stream_closed;
531  char *program;
532 
533 // Plot-wide coordinate transform
534 
535  void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer );
537 
538 // Colormaps
539 
540  PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap;
541 
542  PLFLT cmap1_min, cmap1_max;
543 
544  PLColor curcolor, tmpcolor;
547 
549 
550 // Variables governing pen width
551 
552  PLFLT width;
553  PLINT widthset, widthlock;
554 
555 // Variables governing arrow
556  PLFLT *arrow_x;
557  PLFLT *arrow_y;
560 
561 // Driver dispatch table, obsoletes "device" member below.
562 
564 
565 // Variables used for interacting with or by device driver
566 
567  PLINT plbuf_read, plbuf_write;
568  PLINT device, dev_minor, termin, graphx, nopause;
569  PLINT color, colorset;
570  PLINT family, member, finc, fflen, bytemax, famadv;
571  PLINT dev_fill0, dev_fill1, dev_dash, dev_di, dev_flush, dev_swin;
572  PLINT dev_text, dev_xor, dev_clear, dev_fastimg, dev_arc;
573 
574  char DevName[80];
575  FILE *OutFile;
576  char *BaseName, *FileName;
578  PLINT bytecnt, page, linepos;
580 
582  short *dev_x, *dev_y;
583 
584  // variables for plimage()
585 
586  PLINT dev_nptsX, dev_nptsY;
587  short *dev_ix, *dev_iy;
588  unsigned short *dev_z;
589  unsigned short dev_zmin, dev_zmax;
590  PLINT imclxmin, imclxmax, imclymin, imclymax;
591 
592  // end of variables for plimage()
593 
594  void *dev;
595 
596  void *dev_data;
597 
598  void ( *KeyEH )( PLGraphicsIn *gin, void *KeyEH_data,
599  int *exit_eventloop );
600  void *KeyEH_data;
601 
602  void ( *ButtonEH )( PLGraphicsIn *gin, void *ButtonEH_data,
603  int *exit_eventloop );
605 
606  void ( *LocateEH )( PLGraphicsIn *gin, void *LocateEH_data,
607  int *locate_mode );
609 
610  void ( *bop_handler )( void *bop_data, int *skip_driver_bop );
611  void *bop_data;
612 
613  void ( *eop_handler )( void *eop_data, int *skip_driver_eop );
614  void *eop_data;
615 
616  PLFLT xdpi, ydpi;
617  PLINT xlength, ylength;
618  PLINT xoffset, yoffset;
619  PLINT pageset, hack;
620 
621 // Per stream tidy function.
622 
623  void ( *tidy )( void * );
624  void *tidy_data;
625 
626 // Error info
627 
629  char *errmsg;
630 
631 // Stuff used by Xlib driver
632 
633  char *geometry;
634  long window_id;
635  int nopixmap, db, ext_resize_draw;
636 
637 // Stuff used by TK, DP drivers
638 
639  char *server_name, *server_host, *server_port, *user;
640  char *plserver, *plwindow;
641  char *auto_path;
642  char *tk_file; // plserver -file option
643  int bufmax, dp, server_nokill;
644 
645 // Plot buffer settings
646 
650  size_t plbuf_top;
653 
654 // Driver interface (DI)
655 
656  PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma;
657  PLFLT dipxmin, dipymin, dipxmax, dipymax;
658  PLFLT dipxax, dipxb, dipyay, dipyb;
659  PLFLT aspdev, aspect, aspori, caspfactor, mar, jx, jy;
660  PLFLT didxax, didxb, didyay, didyb;
661  PLFLT diorot;
662  PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb;
663  PLFLT dimxax, dimxb, dimyay, dimyb;
664  PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm;
665  PLINT page_status, freeaspect, portrait;
666 
667 // Fill pattern info
668 
669  PLINT patt, inclin[2], delta[2], nps;
670 
671 // Variables used in line drawing
672 
673  PLINT currx, curry;
674  //CONSTANT SOVERSION FIX
675  //PLINT line_style;
676  PLINT mark[10], space[10], nms;
677  PLINT timecnt, alarm, pendn, curel;
678 
679 // Variables governing character strings
680 
681  char esc;
682 
683 // Scale factors for characters, symbols, and tick marks.
684 
685  PLFLT scale;
686  PLFLT chrdef, chrht;
687  PLFLT symdef, symht;
688  PLFLT majdef, majht;
689  PLFLT mindef, minht;
690 
691 // Variables governing numeric axis label appearance
692 
693  PLINT setpre, precis;
694  PLINT xdigmax, ydigmax, zdigmax;
695  PLINT xdigits, ydigits, zdigits;
696  char *timefmt;
697  void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
699 
700 // Variables governing physical coordinate system
701 
702  PLINT vppxmi, vppxma, vppymi, vppyma;
703  PLINT sppxmi, sppxma, sppymi, sppyma;
704  PLINT clpxmi, clpxma, clpymi, clpyma;
705  PLINT phyxmi, phyxma, phyxlen, phyymi, phyyma, phyylen;
706  PLINT umx, umy;
707  PLFLT xpmm, ypmm;
708 
709 // State variables for 3d plots
710 
711  PLFLT base3x, base3y, basecx, basecy;
712  PLFLT domxmi, domxma, domymi, domyma;
713  PLFLT zzscl, ranmi, ranma;
714  PLFLT cxx, cxy, cyx, cyy, cyz, czx, czy, czz;
715 
716 // Variables for keeping track of windows on a page.
717 
718  int nplwin;
720 
721 // Variables governing subpages and viewports.
722 
723  PLINT nsubx, nsuby, cursub;
724  PLFLT spdxmi, spdxma, spdymi, spdyma;
725  PLFLT vpdxmi, vpdxma, vpdymi, vpdyma;
726  PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
727 
728 // Transformation variables
729 
730  PLFLT wpxscl, wpxoff, wpyscl, wpyoff;
731  PLFLT wmxscl, wmxoff, wmyscl, wmyoff;
732  PLFLT wdxscl, wdxoff, wdyscl, wdyoff;
733 
734 // Other variables
735 
737  PLINT cfont;
738 
739  void *FT;
740 
741 // Stuff used by the Tkwin driver for Plframe
743 
744 
745 // Unicode section
746 
747  PLINT dev_unicode;
748 
749  PLINT alt_unicode; // The alternative interface for unicode text rendering.
750 
752 
753  PLINT dev_hrshsym;
754 
755 // Used to keep a hold of a temporary copy of the original character height
756 // which I overload as a quick hack to fix up a bug in freetype an plsym()
757 //
758 
759  PLFLT original_chrdef, original_chrht;
760 
761  //
762  // Pointer to postscript document class used by psttf
763  //
764  void *psdoc;
765 
766  // pointer to a struct that keeps track of the details of the
767  // transformation between broken-down and continuous time used in
768  // the qsastime library.
769 
771 
772  // Gradient section.
774  PLINT ngradient;
775  PLINT *xgradient, *ygradient;
776  // The next three variables define the polygon boundary used
777  // in the software fallback for the gradient.
778  PLINT n_polygon;
779  const PLFLT *x_polygon, *y_polygon;
780 
781  //CONSTANT SOVERSION FIX
783  PLINT line_style;
788  PLINT dev_eofill;
789 
790  // Drawing mode section
791  PLINT dev_modeset;
792 
793  // Calculate bounding-box limits rather than plot box?
795  // Bounding box limits in mm for box including decorations
796  // (inverted tick marks and numerical tick labels if either is
797  // present).
798  PLFLT boxbb_xmin, boxbb_xmax, boxbb_ymin, boxbb_ymax;
799 
800 // Plot metafile variables
801 //
802  char *mf_infile;
803  char *mf_outfile;
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__