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 // hack PLINT Enables driver-specific hack(s) if set
243 //
244 //--------------------------------------------------------------------------
245 //
246 // User customization tidy routine. This is called before closing a stream
247 // to do any program specific cleanup.
248 //
249 // tidy void* pointer to cleanup routine
250 // tidy_data void* pointer to client data to pass
251 //
252 //--------------------------------------------------------------------------
253 //
254 // User error control variables. Pass in a pointer for either to be set
255 // in exceptional conditions. The caller is responsible for clearing the
256 // error code.
257 //
258 // errcode PLINT* pointer to variable to assign error code
259 // errmsg char* pointer to error message buffer (must be >= 160 bytes)
260 //
261 //--------------------------------------------------------------------------
262 //
263 // Stuff used by Xlib driver
264 //
265 // geometry char* Window geometry (malloc'ed)
266 // window_id long X-window window ID
267 // nopixmap int Set if you want to forbid allocation of pixmaps
268 // db int Set if you want to double buffer output
269 // (only pixmap is drawn to directly; it is blitted
270 // to output window on EOP or an Expose)
271 // ext_resize_draw int Set if you want to control the redraw caused by a
272 // window resize by an external agent.
273 //--------------------------------------------------------------------------
274 //
275 // These are for support of the TK driver.
276 //
277 // server_name char* Main window name of server
278 // server_host char* Name of host to run server on
279 // server_port char* Port to talk to server on
280 // user char* Your user name on remote host (for remsh command)
281 // plserver char* Name of server
282 // plwindow char* Name of reference server window (malloc'ed)
283 // tk_file char* File for plserver use with its -file option
284 // auto_path char* Additional directories to autoload
285 // bufmax int Number of bytes sent before output buffer is flushed
286 // dp int Use Tcl-DP for communication, if set
287 // server_nokill int Don't kill plserver on a ^C if set
288 //
289 //--------------------------------------------------------------------------
290 //
291 // Variables for use by the plot buffer
292 //
293 // For Memory Buffer (default)
294 // plbuf_buffer_grow size_t Memory buffer growth step
295 // plbuf_buffer_size size_t Current size of memory buffer
296 // plbuf_buffer void * Pointer to memory buffer
297 // plbuf_top size_t Offset to the top of used area/start of free area
298 // plbuf_readpos size_t Offset to current position being read
299 //
300 // plbufOwner int Typically set; only zero if current stream is cloned.
301 //
302 //--------------------------------------------------------------------------
303 //
304 // Driver interface (DI)
305 //
306 // difilt PLINT Driver interface filter flag
307 //
308 // dipxmin PLFLT
309 // dipymin PLFLT Min, max relative plot coordinates
310 // dipxmax PLFLT
311 // dipymax PLFLT
312 // dipxax PLFLT Plot window transformation:
313 // dipxb PLFLT x' = dipxax * x + dipxb
314 // dipyay PLFLT
315 // dipyb PLFLT y' = dipyay * y + dipyb
316 //
317 // aspdev PLFLT Original device aspect ratio
318 // aspect PLFLT Page aspect ratio
319 // aspori PLFLT Rotation-induced aspect ratio
320 // caspfactor PLFLT Factor applied to preserve character aspect ratio
321 // freeaspect PLINT Allow aspect ratio to adjust to orientation swaps
322 // when overall aspect ratio is changed.
323 // portrait PLINT Portrait mode (orientation and aspect ratio)
324 // mar PLFLT Page margin (minimum)
325 // jx PLFLT Page justification in x
326 // jy PLFLT Page justification in y
327 //
328 // didxax PLFLT Device window transformation:
329 // didxb PLFLT x' = didxax * x + didxb
330 // didyay PLFLT
331 // didyb PLFLT y' = didyay * y + didyb
332 //
333 // diclpxmi PLINT
334 // diclpxma PLINT Device clip limits
335 // diclpymi PLINT
336 // diclpyma PLINT
337 //
338 // diorot PLFLT Rotation angle (in units of pi/2)
339 // dioxax PLFLT Orientation transformation:
340 // dioxay PLFLT x' = dioxax * x + dioxay * y + dioxb
341 // dioxb PLFLT
342 // dioyax PLFLT y' = dioyax * x + dioyay * y + dioyb
343 // dioyay PLFLT
344 // dioyb PLFLT
345 //
346 // dimxmin PLFLT
347 // dimymin PLFLT Target coordinate system parameters.
348 // dimxmax PLFLT
349 // dimymax PLFLT
350 // dimxpmm PLFLT
351 // dimypmm PLFLT
352 // dimxax PLFLT Map meta to physical coordinates:
353 // dimxb PLFLT x' = dimxax * x + dimxb
354 // dimyay PLFLT
355 // dimyb PLFLT y' = dimyay * y + dimyb
356 //
357 // page_status PLINT Flag to indicate current action
358 //
359 //--------------------------------------------------------------------------
360 //
361 // Fill pattern state information.
362 // patt < 0: Hardware fill, if available (not implemented yet)
363 // patt ==0: Hardware fill, if available, solid
364 // patt > 0: Software fill
365 //
366 // patt Fill pattern number
367 // inclin Array of inclinations in tenths of degree for fill lines
368 // delta Array of spacings in micrometers between fill lines
369 // nps Number of distinct line styles for fills
370 //
371 //--------------------------------------------------------------------------
372 //
373 // Variables used in line drawing
374 //
375 // currx Physical x-coordinate of current point
376 // curry Physical y-coordinate of current point
377 // line_style index of last call to pllsty
378 // mark Array of mark lengths in micrometers for broken lines
379 // space Array of space lengths in micrometers for broken lines
380 // nms Number of elements for current broken line style
381 // timecnt Timer for broken lines
382 // alarm Alarm indicating change of broken line status
383 // pendn Flag indicating if pen is up or down
384 // curel Current element within broken line
385 //
386 //--------------------------------------------------------------------------
387 //
388 // Variables governing character strings
389 //
390 // esc Text string escape character
391 //
392 //--------------------------------------------------------------------------
393 //
394 // Scale factors for characters, symbols, and tick marks.
395 //
396 // scale Scaling factor for chr, sym, maj, min.
397 // chr... Character default height and current (scaled) height
398 // sym... Symbol default height and current (scaled) height
399 // maj... Major tick default height and current (scaled) height
400 // min... Minor tick default height and current (scaled) height
401 //
402 //--------------------------------------------------------------------------
403 //
404 // Variables governing numeric axis label appearance
405 //
406 // setpre Non-zero to set precision using "prec"
407 // precis User-specified precision
408 // xdigmax.. Allowed #digits in axes labels
409 // xdigits.. Actual field widths (returned)
410 // timefmt Format string (for strftime)
411 //
412 //--------------------------------------------------------------------------
413 //
414 // Variables governing physical coordinate system
415 //
416 // vpp.. Viewport boundaries in physical coordinates
417 // spp.. Subpage boundaries in physical coordinates
418 // clp.. Clip boundaries in physical coordinates
419 // phy... Physical device limits in physical coordinates
420 // um. Number of micrometers in a pixel
421 // pmm Number of pixels to a millimeter
422 //
423 //--------------------------------------------------------------------------
424 //
425 // State variables for 3d plots
426 //
427 // base3. World coordinate size of base for 3-d plot
428 // basec. Position of centre of base for 3-d plot
429 // dom... Minimum and maximum values for domain
430 // zzscl Vertical (z) scale for 3-d plot
431 // ran.. Minimum and maximum z values for 3-d plot
432 // c.. Coordinate transformation from 3-d to 2-d
433 //
434 //--------------------------------------------------------------------------
435 //
436 // Variables for keeping track of world coordinate windows on a page.
437 //
438 // nCWindows Number of coordinate windows on current page
439 // windows Array of plCWindow's for current page
440 //
441 //--------------------------------------------------------------------------
442 //
443 // Variables governing subpages and viewports.
444 //
445 // nsub... Number of subpages on physical device
446 // cursub Current subpage
447 // spd... Subpage boundaries in normalized device coordinates
448 // vpd... Viewport boundaries in normalized device coordinates
449 // vpw... Viewport boundaries in world coordinates
450 //
451 //--------------------------------------------------------------------------
452 //
453 // Transformation variables
454 //
455 // wp.... Transformation variables for world to physical conversion
456 // wm.... Transformation variables for world coordinates to mm
457 //
458 //--------------------------------------------------------------------------
459 //
460 // Other variables
461 //
462 // dev_compression Compression level for supporting devices
463 //
464 //--------------------------------------------------------------------------
465 //
466 // Font related variables
467 //
468 // cfont Current font number, replaces global 'font' in plsym.c
469 // This can be latter extended for font shape, series, family and size
470 // fci FCI (font characterization integer)
471 // An FCI is sometimes inserted in the middle of a stream of
472 // unicode glyph indices. Thus to distinguish it from those, the FCI is marked
473 // by 0x8 in the most significant 4 bits. The remaining 7 hex digits
474 // stored in the 32-bit integer characterize 7 different font attributes.
475 // The font attributes are interpreted as follows:
476 // hexdigit => 0 1 2 3 4 5
477 // hexpower Font attribute Possible attribute values
478 // 0 font-family sans-serif serif monospace script symbol |fantasy
479 // 1 font-style upright italic oblique |
480 // 2 font-weight medium bold | bolder light lighter
481 // 3 font-variant normal | small caps
482 //
483 // Everything to the right of the vertical bars is not implemented and is
484 // subject to change. The four font attributes (font-family, font-style,
485 // font-weight, and font-variant are stored in the FCI in the order of
486 // hexpower, the left shift that is applied to the hex digit to place the
487 // hexdigit in the FCI. The hexpower = 3 position is essentially undefined
488 // since there is currently only one hexdigit (0) defined, and similarly
489 // for hexpower = 4-6 so there is room for expansion of this scheme into more
490 // font attributes if required. (hexpower = 7 is reserved for the 0x8 marker
491 // of the FCI.)
492 //
493 //--------------------------------------------------------------------------
494 //
495 // Time related variable
496 //
497 // qsasconfig is a pointer to a struct that keeps track of the details
498 // of the transformation between broken-down and continuous time used
499 // in the qsastime library.
500 //
501 //--------------------------------------------------------------------------
502 //
503 // Variables used in plgradient software fallback to communicate the polygon
504 // to the gradient_define callback used by plshades.
505 //
506 // n_polygon Number of vertex points in the polygon defining the
507 // boundary of the gradient.
508 // x_polygon Pointer to array of x vertex points in the polygon
509 // defining the boundary of the gradient.
510 // y_polygon Pointer to array of y vertex points in the polygon
511 // defining the boundary of the gradient.
512 //--------------------------------------------------------------------------
513 //
514 // Variables used to store gradient information for device drivers.
515 //
516 // xgradient Pointer to array of x coordinates of gradient vector.
517 // ygradient Pointer to array of y coordinates of gradient vector.
518 // ngradient Number of points (two) in gradient vector.
519 //--------------------------------------------------------------------------
520 
521 #define PL_MAX_CMAP1CP 256
522 
523 typedef struct
524 {
525 // Misc control information
526 
527  PLINT ipls, level, verbose, debug, initialized, dev_initialized;
528  //CONSTANT SOVERSION FIX
529  // PLBOOL stream_closed;
530  char *program;
531 
532 // Plot-wide coordinate transform
533 
534  void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer );
536 
537 // Colormaps
538 
539  PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap;
540 
541  PLFLT cmap1_min, cmap1_max;
542 
543  PLColor curcolor, tmpcolor;
546 
548 
549 // Variables governing pen width
550 
551  PLFLT width;
552  PLINT widthset, widthlock;
553 
554 // Variables governing arrow
555  PLFLT *arrow_x;
556  PLFLT *arrow_y;
559 
560 // Driver dispatch table, obsoletes "device" member below.
561 
563 
564 // Variables used for interacting with or by device driver
565 
566  PLINT plbuf_read, plbuf_write;
567  PLINT device, dev_minor, termin, graphx, nopause;
568  PLINT color, colorset;
569  PLINT family, member, finc, fflen, bytemax, famadv;
570  PLINT dev_fill0, dev_fill1, dev_dash, dev_di, dev_flush, dev_swin;
571  PLINT dev_text, dev_xor, dev_clear, dev_fastimg, dev_arc;
572 
573  char DevName[80];
574  FILE *OutFile;
575  char *BaseName, *FileName;
577  PLINT bytecnt, page, linepos;
579 
581  short *dev_x, *dev_y;
582 
583  // variables for plimage()
584 
585  PLINT dev_nptsX, dev_nptsY;
586  short *dev_ix, *dev_iy;
587  unsigned short *dev_z;
588  unsigned short dev_zmin, dev_zmax;
589  PLINT imclxmin, imclxmax, imclymin, imclymax;
590 
591  // end of variables for plimage()
592 
593  void *dev;
594 
595  void *dev_data;
596 
597  void ( *KeyEH )( PLGraphicsIn *gin, void *KeyEH_data,
598  int *exit_eventloop );
599  void *KeyEH_data;
600 
601  void ( *ButtonEH )( PLGraphicsIn *gin, void *ButtonEH_data,
602  int *exit_eventloop );
604 
605  void ( *LocateEH )( PLGraphicsIn *gin, void *LocateEH_data,
606  int *locate_mode );
608 
609  void ( *bop_handler )( void *bop_data, int *skip_driver_bop );
610  void *bop_data;
611 
612  void ( *eop_handler )( void *eop_data, int *skip_driver_eop );
613  void *eop_data;
614 
615  PLFLT xdpi, ydpi;
616  PLINT xlength, ylength;
617  PLINT xoffset, yoffset;
619 
620 // Per stream tidy function.
621 
622  void ( *tidy )( void * );
623  void *tidy_data;
624 
625 // Error info
626 
628  char *errmsg;
629 
630 // Stuff used by Xlib driver
631 
632  char *geometry;
633  long window_id;
634  int nopixmap, db, ext_resize_draw;
635 
636 // Stuff used by TK, DP drivers
637 
638  char *server_name, *server_host, *server_port, *user;
639  char *plserver, *plwindow;
640  char *auto_path;
641  char *tk_file; // plserver -file option
642  int bufmax, dp, server_nokill;
643 
644 // Plot buffer settings
645 
649  size_t plbuf_top;
652 
653 // Driver interface (DI)
654 
655  PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma;
656  PLFLT dipxmin, dipymin, dipxmax, dipymax;
657  PLFLT dipxax, dipxb, dipyay, dipyb;
658  PLFLT aspdev, aspect, aspori, caspfactor, mar, jx, jy;
659  PLFLT didxax, didxb, didyay, didyb;
660  PLFLT diorot;
661  PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb;
662  PLFLT dimxax, dimxb, dimyay, dimyb;
663  PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm;
664  PLINT page_status, freeaspect, portrait;
665 
666 // Fill pattern info
667 
668  PLINT patt, inclin[2], delta[2], nps;
669 
670 // Variables used in line drawing
671 
672  PLINT currx, curry;
673  //CONSTANT SOVERSION FIX
674  //PLINT line_style;
675  PLINT mark[10], space[10], nms;
676  PLINT timecnt, alarm, pendn, curel;
677 
678 // Variables governing character strings
679 
680  char esc;
681 
682 // Scale factors for characters, symbols, and tick marks.
683 
684  PLFLT scale;
685  PLFLT chrdef, chrht;
686  PLFLT symdef, symht;
687  PLFLT majdef, majht;
688  PLFLT mindef, minht;
689 
690 // Variables governing numeric axis label appearance
691 
692  PLINT setpre, precis;
693  PLINT xdigmax, ydigmax, zdigmax;
694  PLINT xdigits, ydigits, zdigits;
695  char *timefmt;
696  void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer );
698 
699 // Variables governing physical coordinate system
700 
701  PLINT vppxmi, vppxma, vppymi, vppyma;
702  PLINT sppxmi, sppxma, sppymi, sppyma;
703  PLINT clpxmi, clpxma, clpymi, clpyma;
704  PLINT phyxmi, phyxma, phyxlen, phyymi, phyyma, phyylen;
705  PLINT umx, umy;
706  PLFLT xpmm, ypmm;
707 
708 // State variables for 3d plots
709 
710  PLFLT base3x, base3y, basecx, basecy;
711  PLFLT domxmi, domxma, domymi, domyma;
712  PLFLT zzscl, ranmi, ranma;
713  PLFLT cxx, cxy, cyx, cyy, cyz, czx, czy, czz;
714 
715 // Variables for keeping track of windows on a page.
716 
717  int nplwin;
719 
720 // Variables governing subpages and viewports.
721 
722  PLINT nsubx, nsuby, cursub;
723  PLFLT spdxmi, spdxma, spdymi, spdyma;
724  PLFLT vpdxmi, vpdxma, vpdymi, vpdyma;
725  PLFLT vpwxmi, vpwxma, vpwymi, vpwyma;
726 
727 // Transformation variables
728 
729  PLFLT wpxscl, wpxoff, wpyscl, wpyoff;
730  PLFLT wmxscl, wmxoff, wmyscl, wmyoff;
731  PLFLT wdxscl, wdxoff, wdyscl, wdyoff;
732 
733 // Other variables
734 
736  PLINT cfont;
737 
738  void *FT;
739 
740 // Stuff used by the Tkwin driver for Plframe
742 
743 
744 // Unicode section
745 
746  PLINT dev_unicode;
747 
748  PLINT alt_unicode; // The alternative interface for unicode text rendering.
749 
751 
752  PLINT dev_hrshsym;
753 
754 // Used to keep a hold of a temporary copy of the original character height
755 // which I overload as a quick hack to fix up a bug in freetype an plsym()
756 //
757 
758  PLFLT original_chrdef, original_chrht;
759 
760  //
761  // Pointer to postscript document class used by psttf
762  //
763  void *psdoc;
764 
765  // pointer to a struct that keeps track of the details of the
766  // transformation between broken-down and continuous time used in
767  // the qsastime library.
768 
770 
771  // Gradient section.
773  PLINT ngradient;
774  PLINT *xgradient, *ygradient;
775  // The next three variables define the polygon boundary used
776  // in the software fallback for the gradient.
777  PLINT n_polygon;
778  const PLFLT *x_polygon, *y_polygon;
779 
780  //CONSTANT SOVERSION FIX
782  PLINT line_style;
787  PLINT dev_eofill;
788 
789  // Drawing mode section
790  PLINT dev_modeset;
791 
792  // Calculate bounding-box limits rather than plot box?
794  // Bounding box limits in mm for box including decorations
795  // (inverted tick marks and numerical tick labels if either is
796  // present).
797  PLFLT boxbb_xmin, boxbb_xmax, boxbb_ymin, boxbb_ymax;
798 
799 // Plot metafile variables
800 //
801  char *mf_infile;
802  char *mf_outfile;
803 } PLStream;
804 
805 //--------------------------------------------------------------------------
806 // Prototypes for stream & device utility functions.
807 //--------------------------------------------------------------------------
808 
809 #ifdef __cplusplus
810 extern "C" {
811 #endif
812 
813 // Get the current stream pointer
814 
815 void PLDLLIMPEXP
816 plgpls( PLStream **p_pls );
817 
818 // Initializes device cmap 1 entry by interpolation from pls->cmap1 entries
819 
820 PLDLLIMPEXP void
821 plcol_interp( PLStream *pls, PLColor *newcolor, int i, int ncol );
822 
823 // Opens file for output, prompting if not set.
824 
825 PLDLLIMPEXP void
826 plOpenFile( PLStream *pls );
827 
828 // Close output file
829 
830 PLDLLIMPEXP void
831 plCloseFile( PLStream *pls );
832 
833 // Sets up next file member name (in pls->FileName), but does not open it.
834 
835 void
836 plP_getmember( PLStream *pls );
837 
838 // Sets up file name & family stem name.
839 
840 void
841 plP_sfnam( PLStream *pls, const char *fnam );
842 
843 // Initializes family file parameters.
844 
845 PLDLLIMPEXP void
846 plFamInit( PLStream *pls );
847 
848 // Starts new member file of family file set if necessary.
849 
850 PLDLLIMPEXP void
851 plGetFam( PLStream *pls );
852 
853 // Rotates physical coordinates if necessary for given orientation.
854 
855 PLDLLIMPEXP void
857  PLINT *px, PLINT *py );
858 
859 // Allocates a standard PLDev structure for device-specific data
860 
862 plAllocDev( PLStream *pls );
863 
864 // Just fills in the PLGraphicsIn with appropriate initial values.
865 
866 PLDLLIMPEXP void
867 plGinInit( PLGraphicsIn *gin );
868 
869 #ifdef __cplusplus
870 }
871 #endif
872 
873 #endif // __PLSTRM_H__
char * plwindow
Definition: plstrm.h:639
unsigned short * dev_z
Definition: plstrm.h:587
PLPointer coordinate_transform_data
Definition: plstrm.h:535
PLINT ymin_dev
Definition: plstrm.h:49
PLINT xmin_dev
Definition: plstrm.h:48
PLDLLIMPEXP void plcol_interp(PLStream *pls, PLColor *newcolor, int i, int ncol)
Definition: plctrl.c:2520
long window_id
Definition: plstrm.h:633
PLBOOL if_boxbb
Definition: plstrm.h:793
PLFLT ypmm
Definition: plstrm.h:706
PLINT zdigmax
Definition: plstrm.h:693
PLINT hack
Definition: plstrm.h:618
PLINT ncp1
Definition: plstrm.h:539
size_t plbuf_top
Definition: plstrm.h:649
PLINT * ygradient
Definition: plstrm.h:774
PLINT alt_unicode
Definition: plstrm.h:748
unsigned short dev_zmin
Definition: plstrm.h:588
FILE * OutFile
Definition: plstrm.h:574
PLFLT mar
Definition: plstrm.h:658
Definition: pdf.h:49
PLUINT PLUNICODE
Definition: plplot.h:194
short * dev_iy
Definition: plstrm.h:586
PLDLLIMPEXP void plGinInit(PLGraphicsIn *gin)
Definition: plctrl.c:2877
PLDispatchTable * dispatch_table
Definition: plstrm.h:562
char * errmsg
Definition: plstrm.h:628
PLFLT minht
Definition: plstrm.h:688
PLINT cfont
Definition: plstrm.h:736
PLFLT scale
Definition: plstrm.h:684
PLINT dev_npts
Definition: plstrm.h:580
PLINT dev_swin
Definition: plstrm.h:570
PLINT dev_unicode
Definition: plstrm.h:746
QSASConfig * qsasconfig
Definition: plstrm.h:769
PLINT arrow_fill
Definition: plstrm.h:558
PLINT ymin
Definition: plstrm.h:46
PLINT plbuf_write
Definition: plstrm.h:566
PLFLT diorot
Definition: plstrm.h:660
#define PL_MAX_CMAP1CP
Definition: plstrm.h:521
void plP_sfnam(PLStream *pls, const char *fnam)
Definition: plctrl.c:2690
PLFLT dipymin
Definition: plstrm.h:656
tuple xmin
Definition: Plframe.py:907
PLINT dev_nptsY
Definition: plstrm.h:585
PLDLLIMPEXP void plGetFam(PLStream *pls)
Definition: plctrl.c:2770
PLFLT czz
Definition: plstrm.h:713
PLFLT vpdymi
Definition: plstrm.h:724
PLDLLIMPEXP void plOpenFile(PLStream *pls)
Definition: plctrl.c:2561
void * PLPointer
Definition: plplot.h:200
PLFLT dipyb
Definition: plstrm.h:657
PLINT colorset
Definition: plstrm.h:568
PLFLT spdymi
Definition: plstrm.h:723
char * program
Definition: plstrm.h:530
static PLINT ipls
Definition: plcore.h:86
PLINT vppymi
Definition: plstrm.h:701
tuple ymin
Definition: Plframe.py:908
void * psdoc
Definition: plstrm.h:763
PLBOOL stream_closed
Definition: plstrm.h:781
PLFLT vpwymi
Definition: plstrm.h:725
PLColor * cmap1
Definition: plstrm.h:545
PLFLT wdyscl
Definition: plstrm.h:731
PLINT line_style
Definition: plstrm.h:782
char * user
Definition: plstrm.h:638
PDFstrm * pdfs
Definition: plstrm.h:578
PLFLT original_chrht
Definition: plstrm.h:758
int PLINT
Definition: plplot.h:174
void * LocateEH_data
Definition: plstrm.h:607
PLINT PLBOOL
Definition: plplot.h:197
void * eop_data
Definition: plstrm.h:613
def orient
Definition: Plframe.py:513
PLFLT wmyscl
Definition: plstrm.h:730
PLColor tmpcolor
Definition: plstrm.h:543
PLINT portrait
Definition: plstrm.h:664
PLINT timecnt
Definition: plstrm.h:676
int nplwin
Definition: plstrm.h:717
PLINT clpymi
Definition: plstrm.h:703
void * ButtonEH_data
Definition: plstrm.h:603
PLINT termin
Definition: plstrm.h:567
PLINT nsuby
Definition: plstrm.h:722
char * mf_infile
Definition: plstrm.h:801
char esc
Definition: plstrm.h:680
PLINT dev_compression
Definition: plstrm.h:735
PLINT dev_hrshsym
Definition: plstrm.h:752
PLINT ylength
Definition: plstrm.h:616
PLINT curry
Definition: plstrm.h:672
#define PL_MAXWINDOWS
Definition: plplot.h:397
PLINT ngradient
Definition: plstrm.h:773
char * FileName
Definition: plstrm.h:575
Definition: plstrm.h:40
PLFLT wpyscl
Definition: plstrm.h:729
PLFLT majht
Definition: plstrm.h:687
PLDLLIMPEXP void plFamInit(PLStream *pls)
Definition: plctrl.c:2741
PLFLT * arrow_y
Definition: plstrm.h:556
void PLDLLIMPEXP plgpls(PLStream **p_pls)
Definition: plcore.c:3672
PLINT dev_gradient
Definition: plstrm.h:772
PLINT verbose
Definition: plstrm.h:527
PLINT get_string_length
Definition: plstrm.h:786
PLFLT yscale_dev
Definition: plstrm.h:51
PLColor * cmap0
Definition: plstrm.h:544
size_t plbuf_buffer_grow
Definition: plstrm.h:646
char * tk_file
Definition: plstrm.h:641
PLINT dev_xor
Definition: plstrm.h:571
char * auto_path
Definition: plstrm.h:640
PLFLT ydpi
Definition: plstrm.h:615
static PLStream * pls[PL_NSTREAMS]
Definition: plcore.h:88
tuple xmax
Definition: Plframe.py:909
PLFLT dimyb
Definition: plstrm.h:662
static int debug
Definition: pdfutils.c:43
PLFLT boxbb_ymin
Definition: plstrm.h:797
PLINT imclymin
Definition: plstrm.h:589
PLINT n_polygon
Definition: plstrm.h:777
PLINT yoffset
Definition: plstrm.h:617
int nopixmap
Definition: plstrm.h:634
PLFLT cmap1_min
Definition: plstrm.h:541
PLINT member
Definition: plstrm.h:569
PLINT umy
Definition: plstrm.h:705
short * dev_y
Definition: plstrm.h:581
PLINT dev_modeset
Definition: plstrm.h:790
void(* label_func)(PLINT, PLFLT, char *, PLINT, PLPointer)
PLUNICODE fci
Definition: plstrm.h:750
void * KeyEH_data
Definition: plstrm.h:599
void * dev_data
Definition: plstrm.h:595
PLINT phyymi
Definition: plstrm.h:704
float PLFLT
Definition: plplot.h:157
PLFLT chrht
Definition: plstrm.h:685
PLINT page
Definition: plstrm.h:577
PLDLLIMPEXP void plRotPhy(PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax, PLINT *px, PLINT *py)
Definition: plctrl.c:2814
PLINT yold
Definition: plstrm.h:43
void plP_getmember(PLStream *pls)
Definition: plctrl.c:2647
PLINT widthset
Definition: plstrm.h:552
PLFLT dimypmm
Definition: plstrm.h:663
PLFLT zzscl
Definition: plstrm.h:712
PLINT patt
Definition: plstrm.h:668
tuple ymax
Definition: Plframe.py:910
PLINT difilt
Definition: plstrm.h:655
PLPointer label_data
Definition: plstrm.h:697
struct PlPlotter * plPlotterPtr
Definition: plstrm.h:741
void * plbuf_buffer
Definition: plstrm.h:648
PLFLT width
Definition: plstrm.h:551
PLFLT didyb
Definition: plstrm.h:659
int server_nokill
Definition: plstrm.h:642
PLINT dev_mem_alpha
Definition: plstrm.h:783
PLINT zdigits
Definition: plstrm.h:694
PLFLT dioyb
Definition: plstrm.h:661
PLINT * errcode
Definition: plstrm.h:627
#define PLDLLIMPEXP
Definition: pldll.h:49
size_t plbuf_readpos
Definition: plstrm.h:650
PLFLT basecy
Definition: plstrm.h:710
PLFLT pxly
Definition: plstrm.h:42
PLFLT string_length
Definition: plstrm.h:785
char * mf_outfile
Definition: plstrm.h:802
int plbufOwner
Definition: plstrm.h:651
PLFLT symht
Definition: plstrm.h:686
PLINT xmin
Definition: plstrm.h:45
PLDLLIMPEXP PLDev * plAllocDev(PLStream *pls)
Definition: plctrl.c:2856
char * geometry
Definition: plstrm.h:632
char * timefmt
Definition: plstrm.h:695
void * dev
Definition: plstrm.h:593
void * FT
Definition: plstrm.h:738
size_t plbuf_buffer_size
Definition: plstrm.h:647
PLINT sppymi
Definition: plstrm.h:702
int output_type
Definition: plstrm.h:576
void * tidy_data
Definition: plstrm.h:623
PLINT dev_eofill
Definition: plstrm.h:787
PLINT setpre
Definition: plstrm.h:692
PLINT arrow_npts
Definition: plstrm.h:557
PLFLT domymi
Definition: plstrm.h:711
void * bop_data
Definition: plstrm.h:610
const PLFLT * y_polygon
Definition: plstrm.h:778
PLDLLIMPEXP void plCloseFile(PLStream *pls)
Definition: plctrl.c:2625
PLINT has_string_length
Definition: plstrm.h:784
PLFLT * arrow_x
Definition: plstrm.h:555