00001 // $Id: plstrm.h 11774 2011-06-20 22:09:33Z airwin $ 00002 // 00003 // Contains declarations for PLStream and PLDev structs. 00004 // Also prototypes for stream & device utility functions. 00005 // 00006 // Copyright (C) 2004 Andrew Ross 00007 // Copyright (C) 2004 Andrew Roach 00008 // 00009 // This file is part of PLplot. 00010 // 00011 // PLplot is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Library General Public License as published 00013 // by the Free Software Foundation; either version 2 of the License, or 00014 // (at your option) any later version. 00015 // 00016 // PLplot is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU Library General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Library General Public License 00022 // along with PLplot; if not, write to the Free Software 00023 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00024 // 00025 00026 #include "pdf.h" 00027 00028 #ifndef __PLSTRM_H__ 00029 #define __PLSTRM_H__ 00030 00031 #include "disptab.h" 00032 #include "pldll.h" 00033 #include "qsastime.h" 00034 00035 //-------------------------------------------------------------------------- 00036 // Define the PLDev data structure. 00037 // 00038 // These are all quantities that must be saved on a per-device basis. 00039 // Some drivers (xwin, tk) allocate structures defined internally. 00040 //-------------------------------------------------------------------------- 00041 00042 typedef struct 00043 { 00044 PLFLT pxlx, pxly; 00045 PLINT xold, yold; 00046 00047 PLINT xmin, xmax, xlen; 00048 PLINT ymin, ymax, ylen; 00049 00050 PLINT xmin_dev, xmax_dev, xlen_dev; 00051 PLINT ymin_dev, ymax_dev, ylen_dev; 00052 00053 PLFLT xscale_dev, yscale_dev; 00054 } PLDev; 00055 00056 //-------------------------------------------------------------------------- 00057 // Define the PLStream data structure. 00058 // 00059 // This contains a copy of every variable that is stream dependent, which 00060 // tends to be those which are settable by the user and persist for longer 00061 // than one plot. 00062 // 00063 // Only those quantities listed in the PLStream struct will be preserved 00064 // for an individual stream. Note that the lack of every plplot constant 00065 // means that one should only switch streams at a fairly high level, i.e. 00066 // on the scale of an entire plot. Otherwise intermediate quantities 00067 // will be confused between the streams, possibly resulting in garbage plots. 00068 // This structure may be expanded in time to improve intra-stream independence, 00069 // but it is doubtful streams will ever be fully independent (perhaps 00070 // neither necessary nor desirable? -- time will tell). 00071 // 00072 // There are undoubtably some inconsistencies in the declaration & use of 00073 // the variables below. This is a result of the continuing evolution of 00074 // plplot and the numerous authors involved. Hopefully in time the function 00075 // of all variables can be fully documented and made more consistent. 00076 // 00077 // The quantities in each stream are as follows: 00078 // 00079 //-------------------------------------------------------------------------- 00080 // 00081 // Misc control variables 00082 // 00083 // ipls PLINT Stream number 00084 // level PLINT Initialization level 00085 // program char* Program name 00086 // verbose PLINT Be more verbose than usual 00087 // debug PLINT Generate debugging output 00088 // initialized PLINT Set if the stream has been initialized 00089 // dev_initialized PLINT Set if the device driver has been loaded 00090 // stream_closed PLBOOL Set if the stream was closed or if there 00091 // was some sort of error 00092 // 00093 //-------------------------------------------------------------------------- 00094 // 00095 // Palettes (two of them) 00096 // 00097 // Color map 0 is intended for static objects, such as boxes, lines, points, 00098 // labels, etc. These should be allocated before calling plinit (else you 00099 // get 16 by default, which can be undesirable on some platforms). These 00100 // are then explicitly selected by number (in order of allocation). The 00101 // lowest number is 0, but this is used for the background color, so all 00102 // color drivers start with 1 as the default color. 00103 // 00104 // Color map 1 is for continuous-tone plots, where color is used to 00105 // represent function value or intensity. These are set in a relative way 00106 // only, for increased portability and flexibility. The actual number of 00107 // colors used to represent intensity levels is determined by the driver. 00108 // Note that it is only necessary to specify intensity (on a scale from 0 00109 // to 1) to get an appropriate color. Drivers incapable of fine shading 00110 // will do the best job they can. 00111 // 00112 // A palette selection tool for both palettes is available for the Tk 00113 // driver. Direct writing of RGB values (i.e. banging on the hardware) is 00114 // supported but highly discouraged (colors so written will be affected 00115 // unpredictably by the palette tools). 00116 // 00117 // icol0 PLINT Color map 0 entry, current color (0 <= icol0 <= ncol0) 00118 // ncol0 PLINT Number of colors allocated in color map 0. 00119 // icol1 PLINT Color map 1 entry, current color (0 <= icol1 <= ncol1) 00120 // ncol1 PLINT Number of colors allocated in color map 1. 00121 // ncol1cp PLINT Number of control points in cmap1 allocation (max PL_MAX_CMAP1CP) 00122 // lcol1cp PLFLT Locations of control points in cmap1 [0,1] 00123 // curcmap PLINT Current color map 00124 // curcolor RGB[] Current color 00125 // tmpcolor RGB[] Temporary color storage 00126 // cmap0 RGB[] Color map 0: maximum of ncol0 RGB 8-bit values 00127 // cmap1 RGB[] Color map 1: maximum of ncol1 RGB 8-bit values 00128 // cmap1_min PLFLT Minimum color map 1 color to use in continuous tone plots 00129 // cmap1_max PLFLT Maximum color map 1 color to use in continuous tone plots 00130 // 00131 //-------------------------------------------------------------------------- 00132 // 00133 // Variables governing pen width 00134 // 00135 // width Current pen width 00136 // widthset Set if pen width was specified 00137 // widthlock Set if pen width is locked 00138 // 00139 //-------------------------------------------------------------------------- 00140 // 00141 // Variables governing arrow type 00142 // 00143 // arrow_x x coordinates of points in arrow 00144 // arrow_y y coordinates of points in arrow 00145 // arrow_npts number of points in arrow_x, arrow_y 00146 // arrow_fill whether the arrow should be filled or not 00147 // 00148 //-------------------------------------------------------------------------- 00149 // 00150 // Variables used to pass information between the core and the driver 00151 // 00152 // It would be nice to use the "dev_" prefix uniformly but changing 00153 // all that old code would be quite a lot of work.. 00154 // 00155 // device PLINT Graphics device id number 00156 // dev_minor PLINT Minor device id (for variations on one type) 00157 // color PLINT Set if color is available 00158 // colorset PLINT Set if "color" was set prior to calling plinit 00159 // plbuf_read PLINT Set during a plot buffer redraw 00160 // plbuf_write PLINT Set if driver needs to use the plot buffer 00161 // dev_fill0 PLINT Set if driver can do solid area fills 00162 // dev_gradient PLINT Set if driver can do (linear) gradients 00163 // dev_text PLINT Set if driver want to do it's only text drawing 00164 // dev_unicode PLINT Set if driver wants unicode 00165 // dev_hrshsym PLINT Set for Hershey symbols to be used 00166 // dev_fill1 PLINT Set if driver can do pattern area fills 00167 // dev_dash PLINT Set if driver can do dashed lines 00168 // dev_di PLINT Set if driver wants to handle DI commands 00169 // dev_flush PLINT Set if driver wants to handle flushes itself 00170 // dev_swin PLINT Set if driver wants to handle 'set window' commands 00171 // dev_fastimg PLINT Set if driver has fast image drawing capabilities 00172 // dev_xor PLINT Set if driver supports xor mode. 00173 // dev_clear PLINT Set if driver support clear. 00174 // termin PLINT Set for interactive devices 00175 // graphx PLINT Set if currently in graphics mode 00176 // nopause PLINT Set if we are skipping the pause between frames 00177 // family PLINT Set if familying is enabled 00178 // member PLINT Number of current family member file open 00179 // finc PLINT Number to increment between member files 00180 // fflen PLINT Minimum field length to use in member file number 00181 // bytemax PLINT Number of bytes maximum per member file 00182 // famadv PLINT Set to advance to the next family member 00183 // DevName char* Device name 00184 // OutFile FILE Output file pointer 00185 // BaseName char* Output base name (i.e. family) 00186 // FileName char* Output file name 00187 // output_type int 0 for file, 1 for stream 00188 // bytecnt PLINT Byte count for output stream 00189 // page PLINT Page count for output stream 00190 // linepos PLINT Line count for output stream 00191 // pdfs PDFstrm* PDF stream pointer 00192 // dev_mem_alpha PLINT The user supplied memory buffer supports alpha values 00193 // has_string_length PLINT The driver can calculate the lengths of strings 00194 // string_length PLFLT Set to the length of the current string (in mm) by the driver 00195 // get_string_length PLINT Tells the driver to calculate the length of the string 00196 // but not to render it. 00197 // 00198 // These are used by the escape function (for area fill, etc). 00199 // 00200 // dev_npts PLINT Number of points we are plotting 00201 // dev_x short* Pointer to array of x values 00202 // dev_y short* Pointer to array of x values 00203 // For the case where the boundary of the filled region is 00204 // self-intersecting, use the even-odd fill rule rather than the 00205 // default nonzero fill rule. 00206 // dev_eofill PLINT 00207 // 00208 // For images 00209 // dev_nptsX PLINT Number of points we are plotting in X 00210 // dev_nptsY PLINT Number of points we are plotting in Y 00211 // dev_z ushort* Pointer to array of z values for the color 00212 // dev_zmin, 00213 // dev_zmax ushort Min and max values of z to plot 00214 // 00215 // The following pointer is for drivers that require device-specific 00216 // data. At initialization the driver should malloc the necessary 00217 // space and set pls->dev to point to this area. This way there can 00218 // be multiple streams using the same driver without conflict. 00219 // 00220 // dev void* pointer to device-specific data (malloc'ed) 00221 // 00222 // User-supplied event handlers for use by interactive drivers (e.g. X). 00223 // Can be used to take various actions depending on input. Currently 00224 // only a keyboard event handler is supported. 00225 // 00226 // KeyEH void* Keyboard event handler 00227 // KeyEH_data void* Pointer to client data to pass 00228 // 00229 // ButtonEH void* (Mouse) Button event handler 00230 // ButtonEH_data void* Pointer to client data to pass 00231 // 00232 // bop_handler void* bop handler 00233 // bop_data void* Pointer to client data to pass 00234 // 00235 // eop_handler void* eop handler 00236 // eop_data void* Pointer to client data to pass 00237 // 00238 // Variables used for direct specification of device characteristics 00239 // Not supported by all drivers (or even very many) 00240 // 00241 // xdpi.. PLFLT Device DPI settings in x and y 00242 // xlength.. PLINT Device output lengths in x and y 00243 // xoffset.. PLINT Device offsets from upper left hand corner 00244 // pageset PLINT Set if page dimensions were specified 00245 // hack PLINT Enables driver-specific hack(s) if set 00246 // 00247 //-------------------------------------------------------------------------- 00248 // 00249 // User customization tidy routine. This is called before closing a stream 00250 // to do any program specific cleanup. 00251 // 00252 // tidy void* pointer to cleanup routine 00253 // tidy_data void* pointer to client data to pass 00254 // 00255 //-------------------------------------------------------------------------- 00256 // 00257 // User error control variables. Pass in a pointer for either to be set 00258 // in exceptional conditions. The caller is responsible for clearing the 00259 // error code. 00260 // 00261 // errcode PLINT* pointer to variable to assign error code 00262 // errmsg char* pointer to error message buffer (must be >= 160 bytes) 00263 // 00264 //-------------------------------------------------------------------------- 00265 // 00266 // Stuff used by Xlib driver 00267 // 00268 // geometry char* Window geometry (malloc'ed) 00269 // window_id long X-window window ID 00270 // nopixmap int Set if you want to forbid allocation of pixmaps 00271 // db int Set if you want to double buffer output 00272 // (only pixmap is drawn to directly; it is blitted 00273 // to output window on EOP or an Expose) 00274 // ext_resize_draw int Set if you want to control the redraw caused by a 00275 // window resize by an external agent. 00276 //-------------------------------------------------------------------------- 00277 // 00278 // These are for support of the TK driver. 00279 // 00280 // server_name char* Main window name of server 00281 // server_host char* Name of host to run server on 00282 // server_port char* Port to talk to server on 00283 // user char* Your user name on remote host (for remsh command) 00284 // plserver char* Name of server 00285 // plwindow char* Name of reference server window (malloc'ed) 00286 // tk_file char* File for plserver use with its -file option 00287 // auto_path char* Additional directories to autoload 00288 // bufmax int Number of bytes sent before output buffer is flushed 00289 // dp int Use Tcl-DP for communication, if set 00290 // server_nokill int Don't kill plserver on a ^C if set 00291 // 00292 //-------------------------------------------------------------------------- 00293 // 00294 // Variables for use by the plot buffer 00295 // 00296 // For BUFFERED_FILE 00297 // plbufFile FILE Plot buffer file pointer 00298 // 00299 // For Memory Buffer (default) 00300 // plbuf_buffer_grow size_t Memory buffer growth step 00301 // plbuf_buffer_size size_t Current size of memory buffer 00302 // plbuf_buffer void * Pointer to memory buffer 00303 // plbuf_top size_t Offset to the top of used area/start of free area 00304 // plbuf_readpos size_t Offset to current position being read 00305 // 00306 // plbufOwner int Typically set; only zero if current stream is cloned. 00307 // 00308 //-------------------------------------------------------------------------- 00309 // 00310 // Driver interface (DI) 00311 // 00312 // difilt PLINT Driver interface filter flag 00313 // 00314 // dipxmin PLFLT 00315 // dipymin PLFLT Min, max relative plot coordinates 00316 // dipxmax PLFLT 00317 // dipymax PLFLT 00318 // dipxax PLFLT Plot window transformation: 00319 // dipxb PLFLT x' = dipxax * x + dipxb 00320 // dipyay PLFLT 00321 // dipyb PLFLT y' = dipyay * y + dipyb 00322 // 00323 // aspdev PLFLT Original device aspect ratio 00324 // aspect PLFLT Page aspect ratio 00325 // aspori PLFLT Rotation-induced aspect ratio 00326 // caspfactor PLFLT Factor applied to preserve character aspect ratio 00327 // freeaspect PLINT Allow aspect ratio to adjust to orientation swaps 00328 // when overall aspect ratio is changed. 00329 // portrait PLINT Portrait mode (orientation and aspect ratio) 00330 // mar PLFLT Page margin (minimum) 00331 // jx PLFLT Page justification in x 00332 // jy PLFLT Page justification in y 00333 // 00334 // didxax PLFLT Device window transformation: 00335 // didxb PLFLT x' = didxax * x + didxb 00336 // didyay PLFLT 00337 // didyb PLFLT y' = didyay * y + didyb 00338 // 00339 // diclpxmi PLINT 00340 // diclpxma PLINT Device clip limits 00341 // diclpymi PLINT 00342 // diclpyma PLINT 00343 // 00344 // diorot PLFLT Rotation angle (in units of pi/2) 00345 // dioxax PLFLT Orientation transformation: 00346 // dioxay PLFLT x' = dioxax * x + dioxay * y + dioxb 00347 // dioxb PLFLT 00348 // dioyax PLFLT y' = dioyax * x + dioyay * y + dioyb 00349 // dioyay PLFLT 00350 // dioyb PLFLT 00351 // 00352 // dimxmin PLFLT 00353 // dimymin PLFLT Target coordinate system parameters. 00354 // dimxmax PLFLT 00355 // dimymax PLFLT 00356 // dimxpmm PLFLT 00357 // dimypmm PLFLT 00358 // dimxax PLFLT Map meta to physical coordinates: 00359 // dimxb PLFLT x' = dimxax * x + dimxb 00360 // dimyay PLFLT 00361 // dimyb PLFLT y' = dimyay * y + dimyb 00362 // 00363 // page_status PLINT Flag to indicate current action 00364 // 00365 //-------------------------------------------------------------------------- 00366 // 00367 // Fill pattern state information. 00368 // patt < 0: Hardware fill, if available (not implemented yet) 00369 // patt ==0: Hardware fill, if available, solid 00370 // patt > 0: Software fill 00371 // 00372 // patt Fill pattern number 00373 // inclin Array of inclinations in tenths of degree for fill lines 00374 // delta Array of spacings in micrometers between fill lines 00375 // nps Number of distinct line styles for fills 00376 // 00377 //-------------------------------------------------------------------------- 00378 // 00379 // Variables used in line drawing 00380 // 00381 // currx Physical x-coordinate of current point 00382 // curry Physical y-coordinate of current point 00383 // line_style index of last call to pllsty 00384 // mark Array of mark lengths in micrometers for broken lines 00385 // space Array of space lengths in micrometers for broken lines 00386 // nms Number of elements for current broken line style 00387 // timecnt Timer for broken lines 00388 // alarm Alarm indicating change of broken line status 00389 // pendn Flag indicating if pen is up or down 00390 // curel Current element within broken line 00391 // 00392 //-------------------------------------------------------------------------- 00393 // 00394 // Variables governing character strings 00395 // 00396 // esc Text string escape character 00397 // 00398 //-------------------------------------------------------------------------- 00399 // 00400 // Scale factors for characters, symbols, and tick marks. 00401 // 00402 // scale Scaling factor for chr, sym, maj, min. 00403 // chr... Character default height and current (scaled) height 00404 // sym... Symbol default height and current (scaled) height 00405 // maj... Major tick default height and current (scaled) height 00406 // min... Minor tick default height and current (scaled) height 00407 // 00408 //-------------------------------------------------------------------------- 00409 // 00410 // Variables governing numeric axis label appearance 00411 // 00412 // setpre Non-zero to set precision using "prec" 00413 // precis User-specified precision 00414 // xdigmax.. Allowed #digits in axes labels 00415 // xdigits.. Actual field widths (returned) 00416 // timefmt Format string (for strftime) 00417 // 00418 //-------------------------------------------------------------------------- 00419 // 00420 // Variables governing physical coordinate system 00421 // 00422 // vpp.. Viewport boundaries in physical coordinates 00423 // spp.. Subpage boundaries in physical coordinates 00424 // clp.. Clip boundaries in physical coordinates 00425 // phy... Physical device limits in physical coordinates 00426 // um. Number of micrometers in a pixel 00427 // pmm Number of pixels to a millimeter 00428 // 00429 //-------------------------------------------------------------------------- 00430 // 00431 // State variables for 3d plots 00432 // 00433 // base3. World coordinate size of base for 3-d plot 00434 // basec. Position of centre of base for 3-d plot 00435 // dom... Minimum and maximum values for domain 00436 // zzscl Vertical (z) scale for 3-d plot 00437 // ran.. Minimum and maximum z values for 3-d plot 00438 // c.. Coordinate transformation from 3-d to 2-d 00439 // 00440 //-------------------------------------------------------------------------- 00441 // 00442 // Variables for keeping track of world coordinate windows on a page. 00443 // 00444 // nCWindows Number of coordinate windows on current page 00445 // windows Array of plCWindow's for current page 00446 // 00447 //-------------------------------------------------------------------------- 00448 // 00449 // Variables governing subpages and viewports. 00450 // 00451 // nsub... Number of subpages on physical device 00452 // cursub Current subpage 00453 // spd... Subpage boundaries in normalized device coordinates 00454 // vpd... Viewport boundaries in normalized device coordinates 00455 // vpw... Viewport boundaries in world coordinates 00456 // 00457 //-------------------------------------------------------------------------- 00458 // 00459 // Transformation variables 00460 // 00461 // wp.... Transformation variables for world to physical conversion 00462 // wm.... Transformation variables for world coordinates to mm 00463 // 00464 //-------------------------------------------------------------------------- 00465 // 00466 // Other variables 00467 // 00468 // dev_compression Compression level for supporting devices 00469 // 00470 //-------------------------------------------------------------------------- 00471 // 00472 // Font related variables 00473 // 00474 // cfont Current font number, replaces global 'font' in plsym.c 00475 // This can be latter extended for font shape, series, family and size 00476 // fci FCI (font characterization integer) 00477 // An FCI is sometimes inserted in the middle of a stream of 00478 // unicode glyph indices. Thus to distinguish it from those, the FCI is marked 00479 // by 0x8 in the most significant 4 bits. The remaining 7 hex digits 00480 // stored in the 32-bit integer characterize 7 different font attributes. 00481 // The font attributes are interpreted as follows: 00482 // hexdigit => 0 1 2 3 4 5 00483 // hexpower Font attribute Possible attribute values 00484 // 0 font-family sans-serif serif monospace script symbol |fantasy 00485 // 1 font-style upright italic oblique | 00486 // 2 font-weight medium bold | bolder light lighter 00487 // 3 font-variant normal | small caps 00488 // 00489 // Everything to the right of the vertical bars is not implemented and is 00490 // subject to change. The four font attributes (font-family, font-style, 00491 // font-weight, and font-variant are stored in the FCI in the order of 00492 // hexpower, the left shift that is applied to the hex digit to place the 00493 // hexdigit in the FCI. The hexpower = 3 position is essentially undefined 00494 // since there is currently only one hexdigit (0) defined, and similarly 00495 // for hexpower = 4-6 so there is room for expansion of this scheme into more 00496 // font attributes if required. (hexpower = 7 is reserved for the 0x8 marker 00497 // of the FCI.) 00498 // 00499 //-------------------------------------------------------------------------- 00500 // 00501 // Time related variable 00502 // 00503 // qsasconfig is a pointer to a struct that keeps track of the details 00504 // of the transformation between broken-down and continuous time used 00505 // in the qsastime library. 00506 // 00507 //-------------------------------------------------------------------------- 00508 // 00509 // Variables used in plgradient software fallback to communicate the polygon 00510 // to the gradient_define callback used by plshades. 00511 // 00512 // n_polygon Number of vertex points in the polygon defining the 00513 // boundary of the gradient. 00514 // x_polygon Pointer to array of x vertex points in the polygon 00515 // defining the boundary of the gradient. 00516 // y_polygon Pointer to array of y vertex points in the polygon 00517 // defining the boundary of the gradient. 00518 //-------------------------------------------------------------------------- 00519 // 00520 // Variables used to store gradient information for device drivers. 00521 // 00522 // xgradient Pointer to array of x coordinates of gradient vector. 00523 // ygradient Pointer to array of y coordinates of gradient vector. 00524 // ngradient Number of points (two) in gradient vector. 00525 //-------------------------------------------------------------------------- 00526 00527 #define PL_MAX_CMAP1CP 256 00528 00529 typedef struct 00530 { 00531 // Misc control information 00532 00533 PLINT ipls, level, verbose, debug, initialized, dev_initialized; 00534 //CONSTANT SOVERSION FIX 00535 // PLBOOL stream_closed; 00536 const char *program; 00537 00538 // Plot-wide coordinate transform 00539 00540 void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer ); 00541 PLPointer coordinate_transform_data; 00542 00543 // Colormaps 00544 00545 PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap; 00546 00547 PLFLT cmap1_min, cmap1_max; 00548 00549 PLColor curcolor, tmpcolor; 00550 PLColor *cmap0; 00551 PLColor *cmap1; 00552 00553 PLControlPt cmap1cp[PL_MAX_CMAP1CP]; 00554 00555 // Variables governing pen width 00556 00557 PLINT width; 00558 PLINT widthset, widthlock; 00559 00560 // Variables governing arrow 00561 PLFLT *arrow_x; 00562 PLFLT *arrow_y; 00563 PLINT arrow_npts; 00564 PLINT arrow_fill; 00565 00566 // Driver dispatch table, obsoletes "device" member below. 00567 00568 PLDispatchTable *dispatch_table; 00569 00570 // Variables used for interacting with or by device driver 00571 00572 PLINT plbuf_read, plbuf_write; 00573 PLINT device, dev_minor, termin, graphx, nopause; 00574 PLINT color, colorset; 00575 PLINT family, member, finc, fflen, bytemax, famadv; 00576 PLINT dev_fill0, dev_fill1, dev_dash, dev_di, dev_flush, dev_swin; 00577 PLINT dev_text, dev_xor, dev_clear, dev_fastimg, dev_arc; 00578 00579 char DevName[80]; 00580 FILE *OutFile; 00581 char *BaseName, *FileName; 00582 int output_type; 00583 PLINT bytecnt, page, linepos; 00584 PDFstrm *pdfs; 00585 00586 PLINT dev_npts; 00587 short *dev_x, *dev_y; 00588 00589 // variables for plimage() 00590 00591 PLINT dev_nptsX, dev_nptsY; 00592 short *dev_ix, *dev_iy; 00593 unsigned short *dev_z; 00594 unsigned short dev_zmin, dev_zmax; 00595 PLINT imclxmin, imclxmax, imclymin, imclymax; 00596 00597 // end of variables for plimage() 00598 00599 void *dev; 00600 00601 void ( *KeyEH )( PLGraphicsIn *gin, void *KeyEH_data, 00602 int *exit_eventloop ); 00603 void *KeyEH_data; 00604 00605 void ( *ButtonEH )( PLGraphicsIn *gin, void *ButtonEH_data, 00606 int *exit_eventloop ); 00607 void *ButtonEH_data; 00608 00609 void ( *LocateEH )( PLGraphicsIn *gin, void *LocateEH_data, 00610 int *locate_mode ); 00611 void *LocateEH_data; 00612 00613 void ( *bop_handler )( void *bop_data, int *skip_driver_bop ); 00614 void *bop_data; 00615 00616 void ( *eop_handler )( void *eop_data, int *skip_driver_eop ); 00617 void *eop_data; 00618 00619 PLFLT xdpi, ydpi; 00620 PLINT xlength, ylength; 00621 PLINT xoffset, yoffset; 00622 PLINT pageset, hack; 00623 00624 // Per stream tidy function. 00625 00626 void ( *tidy )( void * ); 00627 void *tidy_data; 00628 00629 // Error info 00630 00631 PLINT *errcode; 00632 char *errmsg; 00633 00634 // Stuff used by Xlib driver 00635 00636 char *geometry; 00637 long window_id; 00638 int nopixmap, db, ext_resize_draw; 00639 00640 // Stuff used by TK, DP drivers 00641 00642 char *server_name, *server_host, *server_port, *user; 00643 char *plserver, *plwindow; 00644 char *auto_path; 00645 char *tk_file; // plserver -file option 00646 int bufmax, dp, server_nokill; 00647 00648 // Plot buffer settings 00649 00650 #ifdef BUFFERED_FILE 00651 FILE *plbufFile; 00652 #else 00653 size_t plbuf_buffer_grow; 00654 size_t plbuf_buffer_size; 00655 void *plbuf_buffer; 00656 size_t plbuf_top; 00657 size_t plbuf_readpos; 00658 #endif 00659 int plbufOwner; 00660 00661 // Driver interface (DI) 00662 00663 PLINT difilt, diclpxmi, diclpxma, diclpymi, diclpyma; 00664 PLFLT dipxmin, dipymin, dipxmax, dipymax; 00665 PLFLT dipxax, dipxb, dipyay, dipyb; 00666 PLFLT aspdev, aspect, aspori, caspfactor, mar, jx, jy; 00667 PLFLT didxax, didxb, didyay, didyb; 00668 PLFLT diorot; 00669 PLFLT dioxax, dioxay, dioxb, dioyax, dioyay, dioyb; 00670 PLFLT dimxax, dimxb, dimyay, dimyb; 00671 PLFLT dimxmin, dimymin, dimxmax, dimymax, dimxpmm, dimypmm; 00672 PLINT page_status, freeaspect, portrait; 00673 00674 // Fill pattern info 00675 00676 PLINT patt, inclin[2], delta[2], nps; 00677 00678 // Variables used in line drawing 00679 00680 PLINT currx, curry; 00681 //CONSTANT SOVERSION FIX 00682 //PLINT line_style; 00683 PLINT mark[10], space[10], nms; 00684 PLINT timecnt, alarm, pendn, curel; 00685 00686 // Variables governing character strings 00687 00688 char esc; 00689 00690 // Scale factors for characters, symbols, and tick marks. 00691 00692 PLFLT scale; 00693 PLFLT chrdef, chrht; 00694 PLFLT symdef, symht; 00695 PLFLT majdef, majht; 00696 PLFLT mindef, minht; 00697 00698 // Variables governing numeric axis label appearance 00699 00700 PLINT setpre, precis; 00701 PLINT xdigmax, ydigmax, zdigmax; 00702 PLINT xdigits, ydigits, zdigits; 00703 char *timefmt; 00704 void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer ); 00705 PLPointer label_data; 00706 00707 // Variables governing physical coordinate system 00708 00709 PLINT vppxmi, vppxma, vppymi, vppyma; 00710 PLINT sppxmi, sppxma, sppymi, sppyma; 00711 PLINT clpxmi, clpxma, clpymi, clpyma; 00712 PLINT phyxmi, phyxma, phyxlen, phyymi, phyyma, phyylen; 00713 PLINT umx, umy; 00714 PLFLT xpmm, ypmm; 00715 00716 // State variables for 3d plots 00717 00718 PLFLT base3x, base3y, basecx, basecy; 00719 PLFLT domxmi, domxma, domymi, domyma; 00720 PLFLT zzscl, ranmi, ranma; 00721 PLFLT cxx, cxy, cyx, cyy, cyz, czx, czy, czz; 00722 00723 // Variables for keeping track of windows on a page. 00724 00725 int nplwin; 00726 PLWindow plwin[PL_MAXWINDOWS]; 00727 00728 // Variables governing subpages and viewports. 00729 00730 PLINT nsubx, nsuby, cursub; 00731 PLFLT spdxmi, spdxma, spdymi, spdyma; 00732 PLFLT vpdxmi, vpdxma, vpdymi, vpdyma; 00733 PLFLT vpwxmi, vpwxma, vpwymi, vpwyma; 00734 00735 // Transformation variables 00736 00737 PLFLT wpxscl, wpxoff, wpyscl, wpyoff; 00738 PLFLT wmxscl, wmxoff, wmyscl, wmyoff; 00739 PLFLT wdxscl, wdxoff, wdyscl, wdyoff; 00740 00741 // Other variables 00742 00743 PLINT dev_compression; 00744 PLINT cfont; 00745 00746 void *FT; 00747 00748 // Stuff used by the Tkwin driver for Plframe 00749 struct PlPlotter *plPlotterPtr; 00750 00751 00752 // Unicode section 00753 00754 PLINT dev_unicode; 00755 00756 PLINT alt_unicode; // The alternative interface for unicode text rendering. 00757 00758 PLUNICODE fci; 00759 00760 PLINT dev_hrshsym; 00761 00762 // Used to keep a hold of a temporary copy of the original character height 00763 // which I overload as a quick hack to fix up a bug in freetype an plsym() 00764 // 00765 00766 PLFLT original_chrdef, original_chrht; 00767 00768 // 00769 // Pointer to postscript document class used by psttf 00770 // 00771 void *psdoc; 00772 00773 // pointer to a struct that keeps track of the details of the 00774 // transformation between broken-down and continuous time used in 00775 // the qsastime library. 00776 00777 QSASConfig *qsasconfig; 00778 00779 // Gradient section. 00780 PLINT dev_gradient; 00781 PLINT ngradient; 00782 PLINT *xgradient, *ygradient; 00783 // The next three variables define the polygon boundary used 00784 // in the software fallback for the gradient. 00785 PLINT n_polygon; 00786 PLFLT *x_polygon, *y_polygon; 00787 00788 //CONSTANT SOVERSION FIX 00789 PLBOOL stream_closed; 00790 PLINT line_style; 00791 PLINT dev_mem_alpha; 00792 PLINT has_string_length; 00793 PLFLT string_length; 00794 PLINT get_string_length; 00795 PLINT dev_eofill; 00796 00797 // Drawing mode section 00798 PLINT dev_modeset; 00799 00800 // Calculate bounding-box limits rather than plot box? 00801 PLBOOL if_boxbb; 00802 // Bounding box limits in mm for box including decorations 00803 // (inverted tick marks and numerical tick labels if either is 00804 // present). 00805 PLFLT boxbb_xmin, boxbb_xmax, boxbb_ymin, boxbb_ymax; 00806 } PLStream; 00807 00808 //-------------------------------------------------------------------------- 00809 // Prototypes for stream & device utility functions. 00810 //-------------------------------------------------------------------------- 00811 00812 #ifdef __cplusplus 00813 extern "C" { 00814 #endif 00815 00816 // Get the current stream pointer 00817 00818 void PLDLLIMPEXP 00819 plgpls( PLStream **p_pls ); 00820 00821 // Initializes device cmap 1 entry by interpolation from pls->cmap1 entries 00822 00823 PLDLLIMPEXP void 00824 plcol_interp( PLStream *pls, PLColor *newcolor, int i, int ncol ); 00825 00826 // Opens file for output, prompting if not set. 00827 00828 PLDLLIMPEXP void 00829 plOpenFile( PLStream *pls ); 00830 00831 // Close output file 00832 00833 PLDLLIMPEXP void 00834 plCloseFile( PLStream *pls ); 00835 00836 // Sets up next file member name (in pls->FileName), but does not open it. 00837 00838 void 00839 plP_getmember( PLStream *pls ); 00840 00841 // Sets up file name & family stem name. 00842 00843 void 00844 plP_sfnam( PLStream *pls, const char *fnam ); 00845 00846 // Initializes family file parameters. 00847 00848 PLDLLIMPEXP void 00849 plFamInit( PLStream *pls ); 00850 00851 // Starts new member file of family file set if necessary. 00852 00853 PLDLLIMPEXP void 00854 plGetFam( PLStream *pls ); 00855 00856 // Rotates physical coordinates if necessary for given orientation. 00857 00858 PLDLLIMPEXP void 00859 plRotPhy( PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax, 00860 PLINT *px, PLINT *py ); 00861 00862 // Allocates a standard PLDev structure for device-specific data 00863 00864 PLDLLIMPEXP PLDev * 00865 plAllocDev( PLStream *pls ); 00866 00867 // Just fills in the PLGraphicsIn with appropriate initial values. 00868 00869 PLDLLIMPEXP void 00870 plGinInit( PLGraphicsIn *gin ); 00871 00872 #ifdef __cplusplus 00873 } 00874 #endif 00875 00876 #endif // __PLSTRM_H__