PLplot 5.15.0
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
40typedef 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
523typedef 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
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
549
550// Variables governing pen width
551
553 PLINT widthset, widthlock;
554
555// Variables governing arrow
560
561// Driver dispatch table, obsoletes "device" member below.
562
564
565// Variables used for interacting with or by device driver
566
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 );
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;
620
621// Per stream tidy function.
622
623 void ( *tidy )( void * );
625
626// Error info
627
629 char *errmsg;
630
631// Stuff used by Xlib driver
632
633 char *geometry;
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;
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;
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
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;
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
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
738
739 void *FT;
740
741// Stuff used by the Tkwin driver for Plframe
743
744
745// Unicode section
746
748
749 PLINT alt_unicode; // The alternative interface for unicode text rendering.
750
752
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.
775 PLINT *xgradient, *ygradient;
776 // The next three variables define the polygon boundary used
777 // in the software fallback for the gradient.
779 const PLFLT *x_polygon, *y_polygon;
780
781 //CONSTANT SOVERSION FIX
789
790 // Drawing mode section
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//
804} PLStream;
805
806//--------------------------------------------------------------------------
807// Prototypes for stream & device utility functions.
808//--------------------------------------------------------------------------
809
810#ifdef __cplusplus
811extern "C" {
812#endif
813
814// Get the current stream pointer
815
816void PLDLLIMPEXP
817plgpls( PLStream **p_pls );
818
819// Initializes device cmap 1 entry by interpolation from pls->cmap1 entries
820
821PLDLLIMPEXP void
822plcol_interp( PLStream *pls, PLColor *newcolor, int i, int ncol );
823
824// Opens file for output, prompting if not set.
825
826PLDLLIMPEXP void
828
829// Close output file
830
831PLDLLIMPEXP void
833
834// Sets up next file member name (in pls->FileName), but does not open it.
835
836void
838
839// Sets up file name & family stem name.
840
841void
842plP_sfnam( PLStream *pls, const char *fnam );
843
844// Initializes family file parameters.
845
846PLDLLIMPEXP void
848
849// Starts new member file of family file set if necessary.
850
851PLDLLIMPEXP void
853
854// Rotates physical coordinates if necessary for given orientation.
855
856PLDLLIMPEXP void
857plRotPhy( PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax,
858 PLINT *px, PLINT *py );
859
860// Allocates a standard PLDev structure for device-specific data
861
864
865// Just fills in the PLGraphicsIn with appropriate initial values.
866
867PLDLLIMPEXP void
868plGinInit( PLGraphicsIn *gin );
869
870#ifdef __cplusplus
871}
872#endif
873
874#endif // __PLSTRM_H__
void plbuf_write(PLStream *pls, void *data, size_t bytes)
Definition: plbuf.c:660
void difilt(PLINT *xsc, PLINT *ysc, PLINT npts, PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma)
Definition: plcore.c:1460
static PLStream * pls[PL_NSTREAMS]
Definition: plcore.h:88
static PLINT ipls
Definition: plcore.h:86
#define PLDLLIMPEXP
Definition: pldll.h:49
PLUINT PLUNICODE
Definition: plplot.h:201
float PLFLT
Definition: plplot.h:163
void(* PLTRANSFORM_callback)(PLFLT x, PLFLT y, PLFLT_NC_SCALAR xp, PLFLT_NC_SCALAR yp, PLPointer data)
Definition: plplot.h:257
#define PL_MAXWINDOWS
Definition: plplot.h:448
int PLINT
Definition: plplot.h:181
void * PLPointer
Definition: plplot.h:209
PLINT PLBOOL
Definition: plplot.h:204
void(* PLLABEL_FUNC_callback)(PLINT axis, PLFLT value, PLCHAR_NC_VECTOR label, PLINT length, PLPointer data)
Definition: plplot.h:258
#define PL_MAX_CMAP1CP
Definition: plstrm.h:521
PLDLLIMPEXP void plRotPhy(PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax, PLINT *px, PLINT *py)
Definition: plctrl.c:2824
PLDLLIMPEXP void plFamInit(PLStream *pls)
Definition: plctrl.c:2751
void plP_getmember(PLStream *pls)
Definition: plctrl.c:2657
void PLDLLIMPEXP plgpls(PLStream **p_pls)
Definition: plcore.c:3693
void plP_sfnam(PLStream *pls, const char *fnam)
Definition: plctrl.c:2700
PLDLLIMPEXP void plOpenFile(PLStream *pls)
Definition: plctrl.c:2571
PLDLLIMPEXP void plGinInit(PLGraphicsIn *gin)
Definition: plctrl.c:2887
PLDLLIMPEXP void plCloseFile(PLStream *pls)
Definition: plctrl.c:2635
PLDLLIMPEXP PLDev * plAllocDev(PLStream *pls)
Definition: plctrl.c:2866
PLDLLIMPEXP void plGetFam(PLStream *pls)
Definition: plctrl.c:2780
PLDLLIMPEXP void plcol_interp(PLStream *pls, PLColor *newcolor, int i, int ncol)
Definition: plctrl.c:2530
Definition: pdf.h:50
Definition: plstrm.h:41
PLFLT xscale_dev
Definition: plstrm.h:51
PLFLT pxlx
Definition: plstrm.h:42
PLINT xlen_dev
Definition: plstrm.h:48
PLINT ylen
Definition: plstrm.h:46
PLINT xold
Definition: plstrm.h:43
PLINT xlen
Definition: plstrm.h:45
PLINT ylen_dev
Definition: plstrm.h:49
PLFLT dioxax
Definition: plstrm.h:662
PLFLT * arrow_x
Definition: plstrm.h:556
PLINT dev_compression
Definition: plstrm.h:736
PLFLT vpwxma
Definition: plstrm.h:726
void * ButtonEH_data
Definition: plstrm.h:604
PLINT n_polygon
Definition: plstrm.h:778
PLINT ngradient
Definition: plstrm.h:774
int nplwin
Definition: plstrm.h:718
char * plserver
Definition: plstrm.h:640
size_t plbuf_buffer_grow
Definition: plstrm.h:647
PLFLT original_chrdef
Definition: plstrm.h:759
PLINT curcmap
Definition: plstrm.h:539
void * psdoc
Definition: plstrm.h:764
PLBOOL if_boxbb
Definition: plstrm.h:794
long window_id
Definition: plstrm.h:634
PLLABEL_FUNC_callback label_func
Definition: plstrm.h:697
PLINT dev_arc
Definition: plstrm.h:572
PLFLT symdef
Definition: plstrm.h:687
PLFLT wpxoff
Definition: plstrm.h:730
PLINT bytecnt
Definition: plstrm.h:578
PLFLT dipxax
Definition: plstrm.h:658
PLColor * cmap0
Definition: plstrm.h:544
PLFLT xdpi
Definition: plstrm.h:616
size_t plbuf_top
Definition: plstrm.h:650
size_t plbuf_readpos
Definition: plstrm.h:651
char * errmsg
Definition: plstrm.h:629
PLFLT mindef
Definition: plstrm.h:689
PLFLT dimxmax
Definition: plstrm.h:664
PLINT dev_hrshsym
Definition: plstrm.h:753
void * plbuf_buffer
Definition: plstrm.h:649
void * LocateEH_data
Definition: plstrm.h:608
PLINT dev_npts
Definition: plstrm.h:581
PLFLT dipxmax
Definition: plstrm.h:657
PLINT dev_modeset
Definition: plstrm.h:791
PLFLT domxma
Definition: plstrm.h:712
PLINT debug
Definition: plstrm.h:527
PLINT * errcode
Definition: plstrm.h:628
PLINT color
Definition: plstrm.h:569
PLINT dev_dash
Definition: plstrm.h:571
PLBOOL stream_closed
Definition: plstrm.h:782
PLBOOL cmap1cp_is_rgb
Definition: plstrm.h:548
char esc
Definition: plstrm.h:681
PLINT xoffset
Definition: plstrm.h:618
int db
Definition: plstrm.h:635
PLFLT width
Definition: plstrm.h:552
FILE * OutFile
Definition: plstrm.h:575
char * timefmt
Definition: plstrm.h:696
const PLFLT * x_polygon
Definition: plstrm.h:779
void * dev_data
Definition: plstrm.h:596
short * dev_x
Definition: plstrm.h:582
PLFLT wdxoff
Definition: plstrm.h:732
PLFLT vpdxma
Definition: plstrm.h:725
PLINT dev_gradient
Definition: plstrm.h:773
PLFLT base3x
Definition: plstrm.h:711
PLINT dev_nptsX
Definition: plstrm.h:586
char * geometry
Definition: plstrm.h:633
PLINT dev_unicode
Definition: plstrm.h:747
PLINT arrow_fill
Definition: plstrm.h:559
PLColor curcolor
Definition: plstrm.h:543
PLFLT cxx
Definition: plstrm.h:714
PLINT dev_minor
Definition: plstrm.h:568
PLINT cfont
Definition: plstrm.h:737
char * mf_infile
Definition: plstrm.h:802
PLDispatchTable * dispatch_table
Definition: plstrm.h:563
char * program
Definition: plstrm.h:530
char * tk_file
Definition: plstrm.h:642
PLFLT chrdef
Definition: plstrm.h:686
PLINT widthlock
Definition: plstrm.h:553
void * eop_data
Definition: plstrm.h:614
PLINT * xgradient
Definition: plstrm.h:775
void * tidy_data
Definition: plstrm.h:624
PLINT get_string_length
Definition: plstrm.h:787
short * dev_ix
Definition: plstrm.h:587
PLINT sppxma
Definition: plstrm.h:703
PLINT freeaspect
Definition: plstrm.h:665
unsigned short * dev_z
Definition: plstrm.h:588
struct PlPlotter * plPlotterPtr
Definition: plstrm.h:742
PLINT precis
Definition: plstrm.h:693
unsigned short dev_zmax
Definition: plstrm.h:589
char * BaseName
Definition: plstrm.h:576
PLINT vppxma
Definition: plstrm.h:702
PLFLT aspdev
Definition: plstrm.h:659
PLFLT majdef
Definition: plstrm.h:688
PLFLT didxax
Definition: plstrm.h:660
PLINT phyxlen
Definition: plstrm.h:705
int output_type
Definition: plstrm.h:577
PLINT dev_mem_alpha
Definition: plstrm.h:784
size_t plbuf_buffer_size
Definition: plstrm.h:648
PLINT plbuf_read
Definition: plstrm.h:567
PLINT has_string_length
Definition: plstrm.h:785
PLFLT string_length
Definition: plstrm.h:786
PLINT umx
Definition: plstrm.h:706
PLINT xdigmax
Definition: plstrm.h:694
void * dev
Definition: plstrm.h:594
PLFLT scale
Definition: plstrm.h:685
PLColor * cmap1
Definition: plstrm.h:545
PLINT xlength
Definition: plstrm.h:617
PLFLT * arrow_y
Definition: plstrm.h:557
PLINT clpxma
Definition: plstrm.h:704
PLPointer label_data
Definition: plstrm.h:698
PLINT hack
Definition: plstrm.h:619
PLINT diclpxma
Definition: plstrm.h:656
PLINT arrow_npts
Definition: plstrm.h:558
PLFLT cmap1_max
Definition: plstrm.h:541
char * auto_path
Definition: plstrm.h:641
QSASConfig * qsasconfig
Definition: plstrm.h:770
PLINT alt_unicode
Definition: plstrm.h:749
PLUNICODE fci
Definition: plstrm.h:751
void * bop_data
Definition: plstrm.h:611
PLFLT boxbb_xmax
Definition: plstrm.h:798
PDFstrm * pdfs
Definition: plstrm.h:579
PLINT alarm
Definition: plstrm.h:677
void * FT
Definition: plstrm.h:739
PLINT dev_eofill
Definition: plstrm.h:788
PLINT xdigits
Definition: plstrm.h:695
PLINT imclxmax
Definition: plstrm.h:590
PLFLT dimxax
Definition: plstrm.h:663
PLFLT wmxoff
Definition: plstrm.h:731
PLFLT ranma
Definition: plstrm.h:713
int bufmax
Definition: plstrm.h:643
PLTRANSFORM_callback coordinate_transform
Definition: plstrm.h:534
char * server_host
Definition: plstrm.h:639
PLFLT xpmm
Definition: plstrm.h:707
void * KeyEH_data
Definition: plstrm.h:600
PLINT currx
Definition: plstrm.h:673
PLINT cursub
Definition: plstrm.h:723
PLINT bytemax
Definition: plstrm.h:570
PLPointer coordinate_transform_data
Definition: plstrm.h:535
char * mf_outfile
Definition: plstrm.h:803
PLINT line_style
Definition: plstrm.h:783
PLFLT spdxma
Definition: plstrm.h:724
int plbufOwner
Definition: plstrm.h:652
PLFLT diorot
Definition: plstrm.h:661