1 /* This file is part of the GNU plotutils package. Copyright (C) 1995, 2 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software 3 Foundation, Inc. 4 5 The GNU plotutils package is free software. You may redistribute it 6 and/or modify it under the terms of the GNU General Public License as 7 published by the Free Software foundation; either version 2, or (at your 8 option) any later version. 9 10 The GNU plotutils package is distributed in the hope that it will be 11 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 General Public License for more details. 14 15 You should have received a copy of the GNU General Public License along 16 with the GNU plotutils package; see the file COPYING. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, 18 Boston, MA 02110-1301, USA. */ 19 20 /* This is the chief include file for GNU libplot/libplotter. It 21 supplements the include files ../include/sys-defines.h, 22 ../include/plot.h and ../include/plotter.h. plot.h is libplot-specific, 23 but plotter.h is included both in libplot and libplotter. plotter.h 24 defines what a Plotter object is (a struct for libplot, but a class for 25 libplotter). */ 26 27 /* This file contains many #defines and declarations of data structures. 28 More importantly, it contains declarations of all the Plotter methods. 29 They are declared differently, depending on whether we are compiling 30 libplot (signalled if NOT_LIBPLOTTER is #defined) or libplotter. 31 32 In libplot, the plotter operations are implemented as global functions 33 that are members of the Plotter struct. They are set up differently for 34 the different types of Plotter; for example, the `openpl' slot in the 35 struct contains the method _pl_g_openpl for generic [i.e. base] 36 Plotters, the method _pl_m_openpl for MetaPlotters, etc. The files 37 ?_defplot.c contain the initializations that are used for the different 38 types of Plotter. In this file, if NOT_LIBPLOTTER is defined then each 39 of these many methods is declared as a global function. 40 41 In libplotter, the different types of Plotter are implemented as 42 distinct classes, which are derived from the generic [i.e. base] Plotter 43 class. This file contains a great many #defines that are appropriate to 44 that situation. For example, _pl_m_openpl is #defined to be 45 MetaPlotter::openpl if NOT_LIBPLOTTER is not defined. The MetaPlotter 46 class, like all other Plotter classes, is defined in plotter.h. */ 47 48 49 /*************************************************************************/ 50 /* INCLUDE FILES */ 51 /*************************************************************************/ 52 53 /* 1. OUR OWN INCLUDE FILE */ 54 55 /* Determine which of libplot/libplotter this is. */ 56 #ifndef LIBPLOTTER 57 #define NOT_LIBPLOTTER 58 #endif 59 60 /* Always include plotter.h. (If NOT_LIBPLOTTER is defined, it's a C-style 61 header file, declaring the Plotter struct, rather than a declaration 62 file for the Plotter class.) */ 63 #include "plotter.h" 64 65 /* 2. INCLUDE FILES FOR THE X WINDOW SYSTEM */ 66 67 #ifndef X_DISPLAY_MISSING 68 #include <X11/Xatom.h> 69 #include <X11/Xlib.h> /* included also in plotter.h */ 70 #include <X11/Intrinsic.h> 71 #include <X11/Shell.h> 72 #include <X11/StringDefs.h> 73 #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H 74 #include <X11/extensions/multibuf.h> 75 #endif 76 #ifdef HAVE_X11_EXTENSIONS_XDBE_H 77 #include <X11/extensions/Xdbe.h> 78 #endif 79 #ifdef USE_MOTIF 80 #include <Xm/Label.h> 81 #else 82 #include <X11/Xaw/Label.h> 83 #endif 84 #endif /* not X_DISPLAY_MISSING */ 85 86 87 /*************************************************************************/ 88 /* DEFINITIONS RELATED TO OUR FONT DATABASE (g_fontdb.c and g_fontd2.c) */ 89 /*************************************************************************/ 90 91 /* The types of font we support. The final type (`other') is a catchall, 92 currently used for any user-specified font, with a name not contained in 93 our font database, that can be retrieved from an X server. */ 94 #define PL_F_HERSHEY 0 95 #define PL_F_POSTSCRIPT 1 96 #define PL_F_PCL 2 97 #define PL_F_STICK 3 98 #define PL_F_OTHER 4 99 100 /* PL_NUM_PS_FONTS and PL_NUM_PCL_FONTS should agree with the number of 101 fonts of those two types found in g_fontdb.c/g_fontd2.c. These are also 102 defined in plotter.h. */ 103 #define PL_NUM_PS_FONTS 35 104 #define PL_NUM_PCL_FONTS 45 105 106 /* Default fonts, of each type. Any Plotter has a `default_font_type' 107 field, and the appropriate values are copied into the Plotter drawing 108 state when the Plotter is first opened (see g_savestate.c). The 109 typeface and font indices index into the tables in 110 g_fontdb.c/g_fontd2.c. PL_DEFAULT_HERSHEY_FONT is also used as a backup 111 by some Plotters if no scalable (or anamorphically transformed, etc.) 112 font can be retrieved; see e.g. f_retrieve.c and x_retrieve.c. */ 113 114 #define PL_DEFAULT_HERSHEY_FONT "HersheySerif" 115 #define PL_DEFAULT_HERSHEY_TYPEFACE_INDEX 0 116 #define PL_DEFAULT_HERSHEY_FONT_INDEX 1 117 118 #define PL_DEFAULT_POSTSCRIPT_FONT "Helvetica" 119 #define PL_DEFAULT_POSTSCRIPT_TYPEFACE_INDEX 0 120 #define PL_DEFAULT_POSTSCRIPT_FONT_INDEX 1 121 122 #define PL_DEFAULT_PCL_FONT "Univers" 123 #define PL_DEFAULT_PCL_TYPEFACE_INDEX 0 124 #define PL_DEFAULT_PCL_FONT_INDEX 1 125 126 #define PL_DEFAULT_STICK_FONT "Stick" 127 #define PL_DEFAULT_STICK_TYPEFACE_INDEX 3 128 #define PL_DEFAULT_STICK_FONT_INDEX 1 129 130 /* HERSHEY FONTS */ 131 132 /* our information about each of the 22 Hershey vector fonts in g_fontdb.c, 133 and the typefaces they belong to */ 134 struct plHersheyFontInfoStruct 135 { 136 const char *name; /* font name */ 137 const char *othername; /* an alias (for backward compatibility) */ 138 const char *orig_name; /* Allen Hershey's original name for it */ 139 short chars[256]; /* array of vector glyphs */ 140 int typeface_index; /* default typeface for the font */ 141 int font_index; /* which font within typeface this is */ 142 bool obliquing; /* whether to apply obliquing */ 143 bool iso8859_1; /* whether font encoding is iso8859-1 */ 144 bool visible; /* whether font is visible, i.e. not internal*/ 145 }; 146 147 extern const struct plHersheyFontInfoStruct _pl_g_hershey_font_info[]; 148 149 /* This numbering should agree with the numbering of Hershey fonts in the 150 _pl_g_hershey_font_info[] array in g_fontdb.c. */ 151 #define PL_HERSHEY_SERIF 0 152 #define PL_HERSHEY_SERIF_ITALIC 1 153 #define PL_HERSHEY_SERIF_BOLD 2 154 #define PL_HERSHEY_CYRILLIC 4 155 #define PL_HERSHEY_HIRAGANA 6 /* hidden font */ 156 #define PL_HERSHEY_KATAKANA 7 /* hidden font */ 157 #define PL_HERSHEY_EUC 8 158 #define PL_HERSHEY_GOTHIC_GERMAN 16 159 #define PL_HERSHEY_SERIF_SYMBOL 18 160 161 /* accented character information (used in constructing Hershey ISO-Latin-1 162 accented characters, see table in g_fontdb.c) */ 163 struct plHersheyAccentedCharInfoStruct 164 { 165 unsigned char composite, character, accent; 166 }; 167 168 extern const struct plHersheyAccentedCharInfoStruct _pl_g_hershey_accented_char_info[]; 169 170 /* types of accent, for a composite character in a Hershey font */ 171 #define ACC0 (16384 + 0) /* superimpose on character */ 172 #define ACC1 (16384 + 1) /* elevate by 7 Hershey units */ 173 #define ACC2 (16384 + 2) /* same, also shift right by 2 units */ 174 175 /* a flag in a Hershey glyph number indicating a `small Kana' */ 176 #define KS 8192 /* i.e. 0x200 */ 177 178 /* HERSHEY VECTOR GLYPHS */ 179 180 /* arrays of Hershey vector glyphs in g_her_glyph.c */ 181 extern const char * const _pl_g_occidental_hershey_glyphs[]; 182 extern const char * const _pl_g_oriental_hershey_glyphs[]; 183 184 /* position of `undefined character' symbol (a bundle of horizontal lines) 185 in the Hershey _pl_g_occidental_hershey_glyphs[] array */ 186 #define UNDE 4023 187 188 /* POSTSCRIPT FONTS */ 189 190 /* our information about each of the 35 standard PS fonts in g_fontdb.c, 191 and the typefaces they belong to */ 192 struct plPSFontInfoStruct 193 { 194 const char *ps_name; /* the postscript font name */ 195 const char *ps_name_alt; /* alternative PS font name, if non-NULL */ 196 const char *ps_name_alt2; /* 2nd alternative PS font name, if non-NULL */ 197 const char *x_name; /* the X Windows font name */ 198 const char *x_name_alt; /* alternative X Windows font name */ 199 const char *x_name_alt2; /* 2nd alternative X Windows font name */ 200 const char *x_name_alt3; /* 3rd alternative X Windows font name */ 201 const char *css_family; /* CSS font family */ 202 const char *css_generic_family; /* CSS generic font family */ 203 const char *css_style; /* CSS font style */ 204 const char *css_weight; /* CSS font weight */ 205 const char *css_stretch; /* CSS font stretch */ 206 const char *css_panose; /* CSS font Panose */ 207 int pcl_typeface; /* the PCL typeface number */ 208 int hpgl_spacing; /* 0=fixed width, 1=variable */ 209 int hpgl_posture; /* 0=upright, 1=italic, etc. */ 210 int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ 211 int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ 212 int font_ascent; /* the font's ascent (from bounding box) */ 213 int font_descent; /* the font's descent (from bounding box) */ 214 int font_cap_height; /* the font's cap height */ 215 int font_x_height; /* the font's x height */ 216 short width[256]; /* per-character width information */ 217 short offset[256]; /* per-character left edge information */ 218 int typeface_index; /* default typeface for the font */ 219 int font_index; /* which font within typeface this is */ 220 int fig_id; /* Fig's font id */ 221 bool iso8859_1; /* whether font encoding is iso8859-1 */ 222 }; 223 224 extern const struct plPSFontInfoStruct _pl_g_ps_font_info[]; 225 226 /* PCL FONTS */ 227 228 /* our information about each of the 45 PCL fonts in g_fontdb.c, and the 229 typefaces they belong to. (The `substitute_ps_name' field is present 230 only to support the Tidbits-is-Wingdings botch.) */ 231 struct plPCLFontInfoStruct 232 { 233 const char *ps_name; /* the postscript font name */ 234 const char *ps_name_alt; /* alternative PS font name, if non-NULL */ 235 const char *substitute_ps_name; /* replacement name (for use in a PS file) */ 236 const char *x_name; /* the X Windows font name */ 237 const char *css_family; /* CSS font family */ 238 const char *css_generic_family; /* CSS generic font family */ 239 const char *css_style; /* CSS font style */ 240 const char *css_weight; /* CSS font weight */ 241 const char *css_stretch; /* CSS font stretch */ 242 const char *css_panose; /* CSS font Panose */ 243 int pcl_typeface; /* the PCL typeface number */ 244 int hpgl_spacing; /* 0=fixed width, 1=variable */ 245 int hpgl_posture; /* 0=upright, 1=italic, etc. */ 246 int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ 247 int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ 248 int font_ascent; /* the font's ascent (from bounding box) */ 249 int font_descent; /* the font's descent (from bounding box) */ 250 int font_cap_height; /* the font's cap height */ 251 int font_x_height; /* the font's x height */ 252 short width[256]; /* per-character width information */ 253 short offset[256]; /* per-character left edge information */ 254 int typeface_index; /* default typeface for the font */ 255 int font_index; /* which font within typeface this is */ 256 bool iso8859_1; /* whether font encoding is iso8859-1 */ 257 }; 258 259 extern const struct plPCLFontInfoStruct _pl_g_pcl_font_info[]; 260 261 /* STICK FONTS */ 262 263 /* our information about each of the Stick fonts (i.e., vector fonts 264 resident in HP's devices) listed in g_fontdb.c, and the typefaces they 265 belong to */ 266 struct plStickFontInfoStruct 267 { 268 const char *ps_name; /* the postscript font name */ 269 bool basic; /* basic stick font (supp. on all devices)? */ 270 int pcl_typeface; /* the PCL typeface number */ 271 int hpgl_spacing; /* 0=fixed width, 1=variable */ 272 int hpgl_posture; /* 0=upright, 1=italic, etc. */ 273 int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ 274 int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1 */ 275 int font_ascent; /* the font's ascent (from bounding box) */ 276 int font_descent; /* the font's descent (from bounding box) */ 277 int raster_width_lower; /* width of abstract raster (lower half) */ 278 int raster_height_lower; /* height of abstract raster (lower half) */ 279 int raster_width_upper; /* width of abstract raster (upper half) */ 280 int raster_height_upper; /* height of abstract raster (upper half) */ 281 int hpgl_charset_lower; /* old HP character set number (lower half) */ 282 int hpgl_charset_upper; /* old HP character set number (upper half) */ 283 int kerning_table_lower; /* number of a kerning table (lower half) */ 284 int kerning_table_upper; /* number of a kerning table (upper half) */ 285 char width[256]; /* per-character width information */ 286 int offset; /* left edge (applies to all chars) */ 287 int typeface_index; /* default typeface for the font */ 288 int font_index; /* which font within typeface this is */ 289 bool obliquing; /* whether to apply obliquing */ 290 bool iso8859_1; /* encoding is iso8859-1? (after reencoding) */ 291 }; 292 293 extern const struct plStickFontInfoStruct _pl_g_stick_font_info[]; 294 295 /* Device-resident kerning data (`spacing table' in HP documentation), 296 indexed by `right edge character class' and `left edge character class', 297 i.e., `row class' and `column class'. There are three such spacing 298 tables, shared among old-style HP character sets of size 128, and hence 299 among our Stick fonts. See the article by L. W. Hennessee et al. in the 300 Nov. 1981 issue of the Hewlett-Packard Journal. */ 301 struct plStickCharSpacingTableStruct 302 { 303 int rows, cols; 304 const short *kerns; 305 }; 306 307 extern const struct plStickCharSpacingTableStruct _pl_g_stick_spacing_tables[]; 308 309 /* Kerning tables for 128-character halves of our Stick fonts. A kerning 310 table for the lower or upper half of one of our 256-character fonts 311 specifies a spacing table (see above), and maps each character in the 312 half-font to the appropriate row and column class. */ 313 struct plStickFontSpacingTableStruct 314 { 315 int spacing_table; 316 char row[128], col[128]; /* we use char's as very short int's */ 317 }; 318 319 extern const struct plStickFontSpacingTableStruct _pl_g_stick_kerning_tables[]; 320 321 /* TYPEFACES */ 322 323 /* typeface information, applicable to all four sorts of font in our font 324 database (Hershey, PS, PCL, Stick) */ 325 326 #define PL_MAX_FONTS_PER_TYPEFACE 10 327 328 struct plTypefaceInfoStruct 329 { 330 int numfonts; 331 int fonts[PL_MAX_FONTS_PER_TYPEFACE]; 332 }; 333 334 extern const struct plTypefaceInfoStruct _pl_g_hershey_typeface_info[]; 335 extern const struct plTypefaceInfoStruct _pl_g_ps_typeface_info[]; 336 extern const struct plTypefaceInfoStruct _pl_g_pcl_typeface_info[]; 337 extern const struct plTypefaceInfoStruct _pl_g_stick_typeface_info[]; 338 339 340 /***********************************************************************/ 341 /* GENERAL DEFINITIONS, TYPEDEFS, & EXTERNAL VARIABLES */ 342 /***********************************************************************/ 343 344 /* miscellaneous data types */ 345 346 typedef plPoint plVector; 347 typedef plIntPoint plIntVector; 348 349 /* Initializations for default values of Plotter data members, performed 350 when space() is first called. Latter doesn't apply to Plotters whose 351 device models have type DISP_DEVICE_COORS_INTEGER_LIBXMI; the default 352 for such Plotters is to use zero-width (i.e. Bresenham) lines. See 353 g_space.c. */ 354 #define PL_DEFAULT_FONT_SIZE_AS_FRACTION_OF_DISPLAY_SIZE (1.0/50.0) 355 #define PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE (1.0/850.0) 356 357 /* horizontal justification types for labels (our numbering) */ 358 #define PL_NUM_HORIZ_JUST_TYPES 3 359 #define PL_JUST_LEFT 0 360 #define PL_JUST_CENTER 1 361 #define PL_JUST_RIGHT 2 362 363 /* vertical justification types for labels (our numbering) */ 364 #define PL_NUM_VERT_JUST_TYPES 5 365 #define PL_JUST_TOP 0 366 #define PL_JUST_HALF 1 367 #define PL_JUST_BASE 2 368 #define PL_JUST_BOTTOM 3 369 #define PL_JUST_CAP 4 370 371 /* fill rules (our numbering) */ 372 #define PL_NUM_FILL_RULES 2 373 #define PL_FILL_ODD_WINDING 0 /* i.e. `even-odd' fill */ 374 #define PL_FILL_NONZERO_WINDING 1 375 376 /* canonical line types, or styles (our numbering, used to index the dash 377 patterns in g_dash2.c) */ 378 #define PL_NUM_LINE_TYPES 7 379 #define PL_L_SOLID 0 380 #define PL_L_DOTTED 1 381 #define PL_L_DOTDASHED 2 382 #define PL_L_SHORTDASHED 3 383 #define PL_L_LONGDASHED 4 384 #define PL_L_DOTDOTDASHED 5 385 #define PL_L_DOTDOTDOTDASHED 6 386 387 /* maximum length of dash array for our canonical line styles (see line 388 style database in g_dash2.c; for example "dotted" corresponds to 389 length-2 dash array [ 1 3 ] ) */ 390 #define PL_MAX_DASH_ARRAY_LEN 8 391 392 typedef struct 393 { 394 const char *name; /* user-level name (e.g. "dotted") */ 395 int type; /* internal number (e.g. PL_L_DOTTED) */ 396 int dash_array_len; /* length of dash array for this style */ 397 int dash_array[PL_MAX_DASH_ARRAY_LEN]; /* dash array for this style */ 398 } plLineStyle; 399 400 extern const plLineStyle _pl_g_line_styles[PL_NUM_LINE_TYPES]; 401 402 /* when using a canonical line style, numbers appearing in the dash array, 403 specifying dash/gap distances, mean multiples of the line width, except 404 the following floor is put on the line width */ 405 #define PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE (1.0/576.0) 406 407 /* cap and join types (our internal numbering) */ 408 409 #define PL_NUM_JOIN_TYPES 4 410 #define PL_JOIN_MITER 0 411 #define PL_JOIN_ROUND 1 412 #define PL_JOIN_BEVEL 2 413 #define PL_JOIN_TRIANGULAR 3 414 415 #define PL_NUM_CAP_TYPES 4 416 #define PL_CAP_BUTT 0 417 #define PL_CAP_ROUND 1 418 #define PL_CAP_PROJECT 2 419 #define PL_CAP_TRIANGULAR 3 420 421 /* A Plotter type is first classified according to its `display device 422 model', i.e., according to whether the display device to which the user 423 frame is mapped is physical or virtual. 424 425 A `physical' display device is one for which the viewport is located on 426 a page of known type and size (e.g. "letter", "a4"). I.e. the Plotter 427 with a physical display device is one for which the PAGESIZE parameter 428 is meaningful. A Plotter with a `virtual' display device is one for 429 which it normally is not: the viewport size that the Plotter uses may be 430 fixed (as is the case for a CGM Plotter), or set in a Plotter-dependent 431 way (e.g. via the BITMAPSIZE parameter). */ 432 433 enum { DISP_MODEL_PHYSICAL, DISP_MODEL_VIRTUAL }; 434 435 /* Any Plotter is also classified according to the coordinate type it uses 436 when writing output (i.e. when writing to its display device, if it has 437 one). A Plotter may use real coordinates (e.g., a generic, Metafile, PS 438 or AI Plotter). A Plotter may also use integer coordinates. There are 439 two subtypes of the latter: one in which a bitmap is produced using 440 libxmi or compatible scan-conversion routines (e.g., Bitmap, PNM, PNG, 441 GIF, X, X Drawable Plotters), and one in which graphics with integer 442 coordinates are drawn by other means (e.g., Fig, HPGL, PCL, ReGIS, and 443 Tektronix Plotters). The only significant distinction is that in vector 444 graphics drawn with libxmi, zero-width lines are visible: by convention, 445 zero-width lines are interpreted as Bresenham lines. */ 446 447 enum { DISP_DEVICE_COORS_REAL, DISP_DEVICE_COORS_INTEGER_LIBXMI, DISP_DEVICE_COORS_INTEGER_NON_LIBXMI }; 448 449 /* The user->device coordinate transformation */ 450 451 /* X, Y Device: transform user coordinates to device coordinates */ 452 #define XD(x,y) XD_INTERNAL((x),(y),_plotter->drawstate->transform.m) 453 #define YD(x,y) YD_INTERNAL((x),(y),_plotter->drawstate->transform.m) 454 455 #ifdef __GNUC__ 456 #define XD_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[4] + _x * _m[0] + _y * _m[2]; _retval; }) 457 #define YD_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[5] + _x * _m[1] + _y * _m[3]; _retval; }) 458 #else 459 #define XD_INTERNAL(x,y,m) ((m)[4] + (x) * (m)[0] + (y) * (m)[2]) 460 #define YD_INTERNAL(x,y,m) ((m)[5] + (x) * (m)[1] + (y) * (m)[3]) 461 #endif 462 463 /* X,Y Device Vector: transform user vector to device vector */ 464 #define XDV(x,y) XDV_INTERNAL((x),(y),_plotter->drawstate->transform.m) 465 #define YDV(x,y) YDV_INTERNAL((x),(y),_plotter->drawstate->transform.m) 466 467 #ifdef __GNUC__ 468 #define XDV_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[0] * _x + _m[2] * _y; _retval; }) 469 #define YDV_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[1] * _x + _m[3] * _y; _retval; }) 470 #else 471 #define XDV_INTERNAL(x,y,m) ((m)[0] * (x) + (m)[2] * (y)) 472 #define YDV_INTERNAL(x,y,m) ((m)[1] * (x) + (m)[3] * (y)) 473 #endif 474 475 /* X, Y User Vector: transform device vector back to user vector 476 (used by X11 driver only) */ 477 #ifdef __GNUC__ 478 #define XUV(x,y) ({double _x = (x), _y = (y), *m = _plotter->drawstate->transform.m; double _retval = (m[3] * _x - m[2] * _y) / (m[0] * m[3] - m[1] * m[2]); _retval; }) 479 #define YUV(x,y) ({double _x = (x), _y = (y), *m = _plotter->drawstate->transform.m; double _retval = (- m[1] * _x + m[0] * _y) / (m[0] * m[3] - m[1] * m[2]); _retval; }) 480 #else 481 #define XUV(x,y) ((_plotter->drawstate->transform.m[3] * (x) - _plotter->drawstate->transform.m[2] * (y)) / (_plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2])) 482 #define YUV(x,y) ((- _plotter->drawstate->transform.m[1] * (x) + _plotter->drawstate->transform.m[0] * (y)) / (_plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2])) 483 #endif 484 485 486 /*************************************************************************/ 487 /* MISC. DEFS on POLYLINES and PATHS(relevant to all or most display devices)*/ 488 /*************************************************************************/ 489 490 /* Default value for libplot's miter limit (see comments in g_miter.c). 491 This is the same as the value used by X11: it chops off all mitered line 492 joins if the join angle is less than 11 degrees. */ 493 #define PL_DEFAULT_MITER_LIMIT 10.4334305246 494 495 /* Default length an unfilled path (stored in the path buffer's segment 496 list) is allowed to grow to, before it is flushed out by an automatic 497 invocation of endpath(). (We don't flush filled paths, since they need 498 to be preserved as discrete objects if filling is to be performed 499 properly). */ 500 #define PL_MAX_UNFILLED_PATH_LENGTH 500 501 #define PL_MAX_UNFILLED_PATH_LENGTH_STRING "500" 502 503 504 /************************************************************************/ 505 /* DEFINITIONS & EXTERNALS SPECIFIC TO INDIVIDUAL DEVICE DRIVERS */ 506 /************************************************************************/ 507 508 /************************************************************************/ 509 /* Metafile device driver */ 510 /************************************************************************/ 511 512 /* string with which to begin each metafile, must begin with '#' to permit 513 parsing by our plot filters */ 514 #define PL_PLOT_MAGIC "#PLOT" 515 516 /* bit fields for specifying, via a mask, which libplot attributes should 517 be updated (see m_attribs.c) */ 518 #define PL_ATTR_POSITION (1<<0) 519 #define PL_ATTR_TRANSFORMATION_MATRIX (1<<1) 520 #define PL_ATTR_PEN_COLOR (1<<2) 521 #define PL_ATTR_FILL_COLOR (1<<3) 522 #define PL_ATTR_BG_COLOR (1<<4) 523 #define PL_ATTR_PEN_TYPE (1<<5) 524 #define PL_ATTR_FILL_TYPE (1<<6) 525 #define PL_ATTR_LINE_STYLE (1<<7) /* line mode and/or dash array */ 526 #define PL_ATTR_LINE_WIDTH (1<<8) 527 #define PL_ATTR_FILL_RULE (1<<9) 528 #define PL_ATTR_JOIN_STYLE (1<<10) 529 #define PL_ATTR_CAP_STYLE (1<<11) 530 #define PL_ATTR_MITER_LIMIT (1<<12) 531 #define PL_ATTR_ORIENTATION (1<<13) 532 #define PL_ATTR_FONT_NAME (1<<14) 533 #define PL_ATTR_FONT_SIZE (1<<15) 534 #define PL_ATTR_TEXT_ANGLE (1<<16) 535 536 /************************************************************************/ 537 /* ReGIS (remote graphics instruction set) device driver */ 538 /************************************************************************/ 539 540 /* For a ReGIS device we clip to the rectangular physical display 541 [0..767]x[0..479], not to the square libplot graphics display 542 [144..623]x[0..479], which is specified in r_defplot.c. Note: ReGIS 543 uses a flipped-y convention. */ 544 545 #define REGIS_DEVICE_X_MIN 0 546 #define REGIS_DEVICE_X_MAX 767 547 #define REGIS_DEVICE_Y_MIN 0 548 #define REGIS_DEVICE_Y_MAX 479 549 550 #define REGIS_CLIP_FUZZ 0.0000001 551 #define REGIS_DEVICE_X_MIN_CLIP (REGIS_DEVICE_X_MIN - 0.5 + REGIS_CLIP_FUZZ) 552 #define REGIS_DEVICE_X_MAX_CLIP (REGIS_DEVICE_X_MAX + 0.5 - REGIS_CLIP_FUZZ) 553 #define REGIS_DEVICE_Y_MIN_CLIP (REGIS_DEVICE_Y_MIN - 0.5 + REGIS_CLIP_FUZZ) 554 #define REGIS_DEVICE_Y_MAX_CLIP (REGIS_DEVICE_Y_MAX + 0.5 - REGIS_CLIP_FUZZ) 555 556 557 /************************************************************************/ 558 /* Tektronix device driver */ 559 /************************************************************************/ 560 561 /* For a Tektronix device we clip to the rectangular physical display 562 [0..4095]x[0..3119], not to the square libplot graphics display 563 [488..3607]x[0..3119], which is specified in t_defplot.c. Note: 564 Tektronix displays do not use a flipped-y convention. */ 565 566 #define TEK_DEVICE_X_MIN 0 567 #define TEK_DEVICE_X_MAX 4095 568 #define TEK_DEVICE_Y_MIN 0 569 #define TEK_DEVICE_Y_MAX 3119 570 571 #define TEK_CLIP_FUZZ 0.0000001 572 #define TEK_DEVICE_X_MIN_CLIP (TEK_DEVICE_X_MIN - 0.5 + TEK_CLIP_FUZZ) 573 #define TEK_DEVICE_X_MAX_CLIP (TEK_DEVICE_X_MAX + 0.5 - TEK_CLIP_FUZZ) 574 #define TEK_DEVICE_Y_MIN_CLIP (TEK_DEVICE_Y_MIN - 0.5 + TEK_CLIP_FUZZ) 575 #define TEK_DEVICE_Y_MAX_CLIP (TEK_DEVICE_Y_MAX + 0.5 - TEK_CLIP_FUZZ) 576 577 /* Tektronix modes (our private numbering, values are not important but 578 order is, see t_tek_md.c) */ 579 #define TEK_MODE_ALPHA 0 580 #define TEK_MODE_PLOT 1 581 #define TEK_MODE_POINT 2 582 #define TEK_MODE_INCREMENTAL 3 /* currently not used */ 583 584 /* Tektronix display types (generic / Tek emulation in MS-DOS kermit / Tek 585 emulation in `xterm -t') */ 586 #define TEK_DPY_GENERIC 0 587 #define TEK_DPY_KERMIT 1 588 #define TEK_DPY_XTERM 2 589 590 /* colors supported by MS-DOS kermit Tek emulation, see t_color2.c */ 591 592 #define TEK_NUM_ANSI_SYS_COLORS 16 593 extern const plColor _pl_t_kermit_stdcolors[TEK_NUM_ANSI_SYS_COLORS]; 594 extern const char * const _pl_t_kermit_fgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS]; 595 extern const char * const _pl_t_kermit_bgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS]; 596 /* must agree with the ordering in t_color2.c */ 597 #define TEK_ANSI_SYS_BLACK 0 598 #define TEK_ANSI_SYS_GRAY30 8 599 #define TEK_ANSI_SYS_GRAY55 7 600 #define TEK_ANSI_SYS_WHITE 15 601 602 603 /************************************************************************/ 604 /* HP-GL device driver */ 605 /************************************************************************/ 606 607 /* An HPGLPlotter plots using virtual device coordinates: not the native 608 device coordinates, but rather scaled coordinates in which the graphics 609 display is [0,10000]x[0,10000]. To arrange this, in the initialization 610 code in h_defplot.c we move the HP-GL `scaling points' to the lower left 611 and upper right corners of our graphics display, and use the HP-GL `SC' 612 instruction to set up a scaled set of coordinates. */ 613 #define HPGL_SCALED_DEVICE_LEFT 0 614 #define HPGL_SCALED_DEVICE_RIGHT 10000 615 #define HPGL_SCALED_DEVICE_BOTTOM 0 616 #define HPGL_SCALED_DEVICE_TOP 10000 617 618 #define HPGL_UNITS_PER_INCH 1016 /* 1 HP-GL unit = 1/40 mm */ 619 620 /* HP-GL line attribute types (HP-GL numbering; see h_attribs.c) */ 621 #define HPGL_L_SOLID (-100) /* no numeric parameter at all */ 622 #define HPGL_L_DOTTED 1 623 #define HPGL_L_DOTDASHED 5 624 #define HPGL_L_SHORTDASHED 2 625 #define HPGL_L_LONGDASHED 3 626 #define HPGL_L_DOTDOTDASHED 6 627 #define HPGL_L_DOTDOTDOTDASHED (-10) /* pseudo */ 628 629 #define HPGL_JOIN_MITER 1 /* miter length is clamped by miter limit */ 630 #define HPGL_JOIN_MITER_BEVEL 2 /* miter or bevel, based on miter limit */ 631 #define HPGL_JOIN_TRIANGULAR 3 632 #define HPGL_JOIN_ROUND 4 633 #define HPGL_JOIN_BEVEL 5 634 635 #define HPGL_CAP_BUTT 1 636 #define HPGL_CAP_PROJECT 2 637 #define HPGL_CAP_TRIANGULAR 3 638 #define HPGL_CAP_ROUND 4 639 640 /* HP-GL/2 pen types, i.e. screening types: the type of area fill to be 641 applied to wide pen strokes. (HP-GL/2 numbering, as used in the `SV' 642 [screened vectors] instruction. Screened vectors are supported only on 643 HP-GL/2 devices that are not pen plotters.) */ 644 #define HPGL_PEN_SOLID 0 645 #define HPGL_PEN_SHADED 1 646 #define HPGL_PEN_PREDEFINED_CROSSHATCH 21 /* imported from PCL or RTL */ 647 648 /* HP-GL and HP-GL/2 fill types. (Their numbering, as used in the `FT' 649 instruction.) */ 650 #define HPGL_FILL_SOLID_BI 1 651 #define HPGL_FILL_SOLID_UNI 2 652 #define HPGL_FILL_PARALLEL_LINES 3 653 #define HPGL_FILL_CROSSHATCHED_LINES 4 654 #define HPGL_FILL_SHADED 10 655 #define HPGL_FILL_PREDEFINED_CROSSHATCH 21 /* imported from PCL or RTL */ 656 657 /* HP-GL/2 character rendering types, as used in the `CF' [character fill 658 mode] instruction. By default the current pen is used for edging, and 659 for filling too, if filling is requested. Some fill types [set with the 660 `FT' command'] include color information, in which case the current pen 661 is not used for filling. Types 0,1,2 allow specification of an edge pen 662 which may be different from the present pen. (At least for type 0, 663 specifying edge pen 0 seems to turn off edging. For types 1 and 3, edge 664 pen 0 may request white edging [on color devices].) Note that there are 665 three kinds of font: bitmap, stick, and outline, which are treated 666 slightly differently: bitmap and stick chars are filled, not edged, so 667 edging doesn't apply to them. */ 668 669 /* Default rendering is type 0, with edge pen 0, which as just mentioned 670 turns off edging. */ 671 672 #define HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE 0 673 #define HPGL_CHAR_EDGE 1 /* bitmap, stick chars are filled instead */ 674 #define HPGL_CHAR_FILL 2 /* i.e. with current fill type */ 675 #define HPGL_CHAR_FILL_AND_EDGE 3 /* i.e. with current fill type */ 676 677 /* HP-GL object types (our numbering), which we use when passing an 678 argument to an HPGLPlotter's internal _h_set_pen_color() method, letting 679 it know the type of object that will be drawn. Passing the libplot pen 680 color down to the HP-GL/2 level, prior to drawing a label rather than a 681 path, may involve changing the character rendition type. */ 682 #define HPGL_OBJECT_PATH 0 683 #define HPGL_OBJECT_LABEL 1 684 685 /* Nominal pen width in native HP-GL units (so this is 0.3mm). Used by our 686 HP7550B-style cross-hatching algorithm, which we employ when emulating 687 shading (if HPGL_VERSION is 1 or 1.5, i.e. if there's no true shading). */ 688 #define HPGL_NOMINAL_PEN_WIDTH 12 689 690 /* default values for HPGL_PENS environment variable, for HP-GL[/2]; this 691 lists available pens and their positions in carousel */ 692 #define HPGL_DEFAULT_PEN_STRING "1=black" 693 #define HPGL2_DEFAULT_PEN_STRING "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan" 694 695 /* PCL 5 font information: symbol set, i.e. encoding */ 696 #define PCL_ISO_8859_1 14 697 #define PCL_ROMAN_8 277 698 699 /* PCL typeface number for default HP-GL/2 typeface */ 700 #define PCL_STICK_TYPEFACE 48 701 702 /* Old (pre-HP-GL/2) 7-bit HP-GL character sets */ 703 #define HPGL_CHARSET_ASCII 0 704 #define HPGL_CHARSET_ROMAN_EXTENSIONS 7 705 706 /* The nominal HP-GL/2 fontsize we use for drawing a label (for fixed-width 707 and proportional fonts, respectively). We retrieve fonts in the size 708 specified by whichever of the two following parameters is relevant, and 709 then rescale it as needed before drawing the label. */ 710 #define HPGL2_NOMINAL_CHARS_PER_INCH 8.0 711 #define HPGL2_NOMINAL_POINT_SIZE 18 712 713 /* Spacing characteristic of the PCL and Stick fonts, in HP-GL/2 */ 714 #define HPGL2_FIXED_SPACING 0 715 #define HPGL2_PROPORTIONAL_SPACING 1 716 717 718 /************************************************************************/ 719 /* xfig device driver */ 720 /************************************************************************/ 721 722 /* Standard Fig unit size in v. 3.0+ */ 723 #define FIG_UNITS_PER_INCH 1200 724 725 /* device units <-> printer's points; number of points per inch == 72 */ 726 #define FIG_UNITS_TO_POINTS(size) ((size)*72.0/FIG_UNITS_PER_INCH) 727 #define POINTS_TO_FIG_UNITS(size) ((size)*((double)FIG_UNITS_PER_INCH)/72.0) 728 729 /* xfig specifies line widths in `Fig display units' rather than `Fig units' 730 (there are 80 of the former per inch). */ 731 #define FIG_UNITS_TO_FIG_DISPLAY_UNITS(width) ((width)*80.0/FIG_UNITS_PER_INCH) 732 733 /* For historical reasons, xfig scales the fonts down by a factor 734 FONT_SCALING, i.e., (80.0)/(72.0). So we have to premultiply font sizes 735 by the same factor. The current release of xfig unfortunately can't 736 handle font sizes that aren't integers, so it rounds them. Ah well. */ 737 #define FIG_FONT_SCALING ((80.0)/(72.0)) 738 739 /* Fig supported line styles. DOTTED and DASHED line styles are specified 740 by (respectively) the length of the gap between successive dots, and the 741 length of each dash (equal to the length of the gap between successive 742 dashes, except in the DASHDOTTED case). */ 743 #define FIG_L_DEFAULT (-1) 744 #define FIG_L_SOLID 0 745 #define FIG_L_DASHED 1 746 #define FIG_L_DOTTED 2 747 #define FIG_L_DASHDOTTED 3 748 #define FIG_L_DASHDOUBLEDOTTED 4 749 #define FIG_L_DASHTRIPLEDOTTED 5 750 751 /* Fig's line styles, indexed into by internal line type number 752 (PL_L_SOLID/PL_L_DOTTED/ 753 PL_L_DOTDASHED/PL_L_SHORTDASHED/PL_L_LONGDASHED. */ 754 extern const int _pl_f_fig_line_style[PL_NUM_LINE_TYPES]; 755 756 #define FIG_JOIN_MITER 0 757 #define FIG_JOIN_ROUND 1 758 #define FIG_JOIN_BEVEL 2 759 760 #define FIG_CAP_BUTT 0 761 #define FIG_CAP_ROUND 1 762 #define FIG_CAP_PROJECT 2 763 764 /* Fig join and cap styles, see f_path.c, indexed by our internal join and 765 cap type numbers (miter/rd./bevel/triangular and 766 butt/rd./project/triangular) */ 767 extern const int _pl_f_fig_join_style[PL_NUM_JOIN_TYPES]; 768 extern const int _pl_f_fig_cap_style[PL_NUM_CAP_TYPES]; 769 770 /* these constants for Fig colors are hardcoded in xfig */ 771 772 #define FIG_STD_COLOR_MIN 0 /* see f_color2.c for colors 0,...,31 */ 773 #define FIG_C_BLACK 0 /* i.e. #0 in table in f_color2.c */ 774 #define FIG_C_WHITE 7 /* i.e. #7 in table */ 775 #define FIG_NUM_STD_COLORS 32 776 #define FIG_USER_COLOR_MIN 32 777 extern const plColor _pl_f_fig_stdcolors[FIG_NUM_STD_COLORS]; 778 779 /* xfig's depth attribute ranges from 0 to FIG_MAXDEPTH. */ 780 #define FIG_MAXDEPTH 999 781 782 /* depth of the first object we'll draw (we make it a bit less than 783 FIG_MAXDEPTH, since the user may wish to edit the drawing with xfig to 784 include deeper, i.e. obscured objects) */ 785 #define FIG_INITIAL_DEPTH 989 786 787 788 /************************************************************************/ 789 /* CGM device driver */ 790 /************************************************************************/ 791 792 /* CGM output file `profiles', which are increasingly general (our 793 numbering). The most restrictive is the WebCGM profile. We increment 794 the profile number appropriately whenever anything noncompliant is 795 seen. */ 796 797 #define CGM_PROFILE_WEB 0 798 #define CGM_PROFILE_MODEL 1 799 #define CGM_PROFILE_NONE 2 800 801 /* Possible encodings of the CGM output file (our numbering). Only the 802 first (binary) is allowed by the WebCGM profile. */ 803 804 #define CGM_ENCODING_BINARY 0 /* default */ 805 #define CGM_ENCODING_CHARACTER 1 /* not supported by libplot */ 806 #define CGM_ENCODING_CLEAR_TEXT 2 807 808 /* In the binary encoding, how many bytes we use to represent an integer 809 parameter of a CGM command. This determines the range over which 810 integers (e.g., point coordinates) can vary, and hence the granularity 811 of our quantization to integer coordinates in the output file. This 812 value should not be greater than the number of bytes used in the system 813 representation for an integer (see comments in c_emit.c). 814 815 Don't change this value unless you know what you're doing. Some old 816 [buggy] CGM interpreters can't handle any value except 2, or possibly 4. 817 The old RALCGM viewer/translator partially breaks on a value of 3 or 4. 818 (It can display binary-encoded CGM files that use the value of `3', but 819 when it translates such files to the clear text encoding, it produces a 820 bogus [zero] value for the metric scaling factor.) */ 821 822 #define CGM_BINARY_BYTES_PER_INTEGER 2 823 824 /* In the binary encoding, how many bytes we use to represent an RGB color 825 component. In this is 1, then 24-bit color will be used; if 2, then 826 48-bit color will be used. Valid values are 1, 2, 3, 4, but our 827 code in c_color.c assumes that the value is 1 or 2. */ 828 829 #define CGM_BINARY_BYTES_PER_COLOR_COMPONENT 2 830 831 /* In the binary encoding, how many bytes we use to represent a string 832 parameter of a CGM command. (See c_emit.c.) In the binary encoding, a 833 string <= 254 bytes in length is represented literally, preceded by a 834 1-byte count. Any string > 254 bytes in length is partitioned: after 835 the initial byte, there are one or more partitions. Each partition 836 contains an initial byte, and then up to CGM_STRING_PARTITION_SIZE bytes 837 of the string. According to the CGM spec, CGM_STRING_PARTITION_SIZE 838 could be as large as 32767. However, since we don't wish to overrun our 839 output buffer, we keep it fairly small (see comment in g_outbuf.c). */ 840 841 #define CGM_STRING_PARTITION_SIZE 2000 842 #define CGM_BINARY_BYTES_PER_STRING(len) \ 843 ((len) <= 254 ? (1 + (len)) : \ 844 (1 + (len) + 2 * (1 + ((len) - 1) / CGM_STRING_PARTITION_SIZE))) 845 846 /* CGM's element classes (CGM numbering) */ 847 #define CGM_DELIMITER_ELEMENT 0 848 #define CGM_METAFILE_DESCRIPTOR_ELEMENT 1 849 #define CGM_PICTURE_DESCRIPTOR_ELEMENT 2 850 #define CGM_CONTROL_ELEMENT 3 851 #define CGM_GRAPHICAL_PRIMITIVE_ELEMENT 4 852 #define CGM_ATTRIBUTE_ELEMENT 5 853 #define CGM_ESCAPE_ELEMENT 6 /* not used by libplot */ 854 #define CGM_EXTERNAL_ELEMENT 7 /* not used by libplot */ 855 #define CGM_SEGMENT_ELEMENT 8 /* not used by libplot */ 856 857 /* tags for CGM data types within a CGM SDR (structured data record) */ 858 #define CGM_SDR_DATATYPE_SDR 1 859 #define CGM_SDR_DATATYPE_COLOR_INDEX 2 860 #define CGM_SDR_DATATYPE_COLOR_DIRECT 3 861 #define CGM_SDR_DATATYPE_ENUM 5 862 #define CGM_SDR_DATATYPE_INTEGER 6 863 #define CGM_SDR_DATATYPE_INDEX 11 864 #define CGM_SDR_DATATYPE_REAL 12 865 #define CGM_SDR_DATATYPE_STRING 13 866 #define CGM_SDR_DATATYPE_STRING_FIXED 14 867 #define CGM_SDR_DATATYPE_VDC 16 868 #define CGM_SDR_DATATYPE_UNSIGNED_INTEGER_8BIT 18 869 #define CGM_SDR_DATATYPE_COLOR_LIST 21 870 871 /* CGM font properties, from the CGM spec. (Value of each of these font 872 props is an SDR, comprising a single datum of `index' type, except for 873 the FAMILY prop, for which the datum is a string, and the DESIGN_GROUP 874 prop, for which the SDR comprises three 8-bit unsigned integers.) */ 875 #define CGM_FONT_PROP_INDEX 1 876 #define CGM_FONT_PROP_FAMILY 4 877 #define CGM_FONT_PROP_POSTURE 5 878 #define CGM_FONT_PROP_WEIGHT 6 879 #define CGM_FONT_PROP_WIDTH 7 880 #define CGM_FONT_PROP_DESIGN_GROUP 13 881 #define CGM_FONT_PROP_STRUCTURE 14 882 883 /* CGM line/edge types (CGM numbering; for custom dash arrays defined by 884 linedash(), negative values are used) */ 885 #define CGM_L_SOLID 1 886 #define CGM_L_DASHED 2 887 #define CGM_L_DOTTED 3 888 #define CGM_L_DOTDASHED 4 889 #define CGM_L_DOTDOTDASHED 5 890 891 /* CGM interior styles (CGM numbering) */ 892 #define CGM_INT_STYLE_HOLLOW 0 893 #define CGM_INT_STYLE_SOLID 1 894 #define CGM_INT_STYLE_PATTERN 2 895 #define CGM_INT_STYLE_HATCH 3 896 #define CGM_INT_STYLE_EMPTY 4 897 #define CGM_INT_STYLE_GEOMETRIC_PATTERN 5 898 #define CGM_INT_STYLE_INTERPOLATED 6 899 900 /* CGM line/edge join styles (CGM numbering) */ 901 #define CGM_JOIN_UNSPEC 1 902 #define CGM_JOIN_MITER 2 903 #define CGM_JOIN_ROUND 3 904 #define CGM_JOIN_BEVEL 4 905 906 /* CGM line/edge cap styles (CGM numbering) */ 907 #define CGM_CAP_UNSPEC 1 908 #define CGM_CAP_BUTT 2 909 #define CGM_CAP_ROUND 3 910 #define CGM_CAP_PROJECTING 4 911 #define CGM_CAP_TRIANGULAR 5 912 913 /* CGM line/edge dash cap styles (CGM numbering) */ 914 #define CGM_DASH_CAP_UNSPEC 1 915 #define CGM_DASH_CAP_BUTT 2 916 #define CGM_DASH_CAP_MATCH 3 917 918 /* CGM marker types (CGM numbering) */ 919 #define CGM_M_DOT 1 920 #define CGM_M_PLUS 2 921 #define CGM_M_ASTERISK 3 922 #define CGM_M_CIRCLE 4 923 #define CGM_M_CROSS 5 924 925 /* CGM object types (our numbering) */ 926 #define CGM_OBJECT_OPEN 0 927 #define CGM_OBJECT_CLOSED 1 928 #define CGM_OBJECT_MARKER 2 929 #define CGM_OBJECT_TEXT 3 930 #define CGM_OBJECT_OTHER 4 931 932 /* CGM horizontal justification types for labels (CGM numbering) */ 933 #define CGM_ALIGN_NORMAL_HORIZONTAL 0 934 #define CGM_ALIGN_LEFT 1 935 #define CGM_ALIGN_CENTER 2 936 #define CGM_ALIGN_RIGHT 3 937 938 /* CGM vertical justification types for labels (CGM numbering) */ 939 #define CGM_ALIGN_NORMAL_VERTICAL 0 940 #define CGM_ALIGN_TOP 1 941 #define CGM_ALIGN_CAP 2 942 #define CGM_ALIGN_HALF 3 943 #define CGM_ALIGN_BASE 4 944 #define CGM_ALIGN_BOTTOM 5 945 946 /* CGM `restricted text' types (CGM numbering) */ 947 #define CGM_RESTRICTED_TEXT_TYPE_BASIC 1 948 #define CGM_RESTRICTED_TEXT_TYPE_BOXED_CAP 2 949 950 /* mappings from internal PS font number to CGM font id, as used in output 951 file; see g_fontdb.c */ 952 extern const int _pl_g_ps_font_to_cgm_font_id[PL_NUM_PS_FONTS]; 953 extern const int _pl_g_cgm_font_id_to_ps_font[PL_NUM_PS_FONTS]; 954 955 /* structure used to store the CGM properties for a font; see g_fontdb.c */ 956 typedef struct 957 { 958 const char *family; 959 const char *extra_style; 960 const char *style; 961 int posture; /* 1=upright, 2=oblique, 4=italic */ 962 int weight; /* 4=semilight, 5=normal, 6=semibold, 7=bold */ 963 int proportionate_width; /* 3=condensed, 5=medium */ 964 int design_group[3]; 965 int structure; /* 1=filled, 2=outline */ 966 } plCGMFontProperties; 967 968 extern const plCGMFontProperties _pl_g_cgm_font_properties[PL_NUM_PS_FONTS]; 969 970 /* structure used to store a user-defined line type; see g_attribs.c */ 971 typedef struct plCGMCustomLineTypeStruct 972 { 973 int *dashes; 974 int dash_array_len; 975 struct plCGMCustomLineTypeStruct *next; 976 } plCGMCustomLineType; 977 978 /* maximum number of line types a user can define, and the maximum dash 979 array length a user can specify per line type, without violating the 980 WebCGM or Model CGM profiles */ 981 #define CGM_MAX_CUSTOM_LINE_TYPES 16 982 #define CGM_PL_MAX_DASH_ARRAY_LENGTH 8 983 984 985 /************************************************************************/ 986 /* Postscript/idraw device driver */ 987 /************************************************************************/ 988 989 /* minimum desired resolution in device frame (i.e. in printer's points) */ 990 #define PS_MIN_RESOLUTION 0.05 991 992 /* em size (in printer's points) for a font in which a `point' could appear 993 as a symbol */ 994 #define PS_SIZE_OF_POINT 0.5 995 996 /* PS line join and line cap styles */ 997 998 #define PS_LINE_JOIN_MITER 0 999 #define PS_LINE_JOIN_ROUND 1 1000 #define PS_LINE_JOIN_BEVEL 2 1001 1002 #define PS_LINE_CAP_BUTT 0 1003 #define PS_LINE_CAP_ROUND 1 1004 #define PS_LINE_CAP_PROJECT 2 1005 1006 /* information on colors known to idraw, see p_color2.c */ 1007 1008 #define PS_NUM_IDRAW_STD_COLORS 12 1009 extern const plColor _pl_p_idraw_stdcolors[PS_NUM_IDRAW_STD_COLORS]; 1010 extern const char * const _pl_p_idraw_stdcolornames[PS_NUM_IDRAW_STD_COLORS]; 1011 1012 /* information on shadings known to idraw, see p_color2.c */ 1013 1014 #define PS_NUM_IDRAW_STD_SHADINGS 5 1015 extern const double _pl_p_idraw_stdshadings[PS_NUM_IDRAW_STD_SHADINGS]; 1016 1017 1018 /************************************************************************/ 1019 /* Adobe Illustrator device driver */ 1020 /************************************************************************/ 1021 1022 /* types of Illustrator file format that an Illustrator Plotter can emit */ 1023 #define AI_VERSION_3 0 1024 #define AI_VERSION_5 1 1025 1026 /* em size (in printer's points) for a font in which a `point' could appear 1027 as a symbol */ 1028 #define AI_SIZE_OF_POINT 0.5 1029 1030 /* AI line join and line cap styles (same as for PS) */ 1031 1032 #define AI_LINE_JOIN_MITER 0 1033 #define AI_LINE_JOIN_ROUND 1 1034 #define AI_LINE_JOIN_BEVEL 2 1035 1036 #define AI_LINE_CAP_BUTT 0 1037 #define AI_LINE_CAP_ROUND 1 1038 #define AI_LINE_CAP_PROJECT 2 1039 1040 /* AI fill rule types (in AI version 5 and later) */ 1041 #define AI_FILL_NONZERO_WINDING 0 1042 #define AI_FILL_ODD_WINDING 1 1043 1044 1045 /************************************************************************/ 1046 /* XDrawable and X device drivers */ 1047 /************************************************************************/ 1048 1049 #ifndef X_DISPLAY_MISSING 1050 1051 /* X11 colormap types (XDrawable Plotters use only the first of these) */ 1052 #define X_CMAP_ORIG 0 1053 #define X_CMAP_NEW 1 1054 #define X_CMAP_BAD 2 /* colormap full, can't allocate new colors */ 1055 1056 /* sixteen-bit restriction on X11 protocol parameters */ 1057 #define X_OOB_UNSIGNED(x) ((x) > (int)0xffff) 1058 #define X_OOB_INT(x) ((x) > (int)0x7fff || (x) < (int)(-0x8000)) 1059 1060 /* double buffering types, used in XDrawablePlotter `x_double_buffering' 1061 data member */ 1062 #define X_DBL_BUF_NONE 0 1063 #define X_DBL_BUF_BY_HAND 1 1064 #define X_DBL_BUF_MBX 2 /* X11 MBX extension */ 1065 #define X_DBL_BUF_DBE 3 /* X11 DBE extension */ 1066 1067 /* numbering of our X GC's (graphics contexts); this is the numbering we 1068 use when passing an argument to _x_set_attributes() indicating which GC 1069 should be altered */ 1070 #define X_GC_FOR_DRAWING 0 1071 #define X_GC_FOR_FILLING 1 1072 #define X_GC_FOR_ERASING 2 1073 1074 #endif /* not X_DISPLAY_MISSING */ 1075 1076 1077 /***********************************************************************/ 1078 /* DRAWING STATE */ 1079 /***********************************************************************/ 1080 1081 /* Default drawing state, defined in g_defstate.c. This is used for 1082 initialization of the first state on the drawing state stack that every 1083 Plotter maintains; see g_savestate.c. */ 1084 extern const plDrawState _default_drawstate; 1085 1086 /*************************************************************************/ 1087 /* PLOTTER OBJECTS (structs for libplot, class instances for libplotter) */ 1088 /*************************************************************************/ 1089 1090 /* "_plotters" is a sparse array containing pointers to all Plotter 1091 instances, of size "_plotters_len". In libplot, they're globals, but in 1092 in libplotter, they're static data members of the base Plotter class. 1093 In both libraries, they're defined in g_defplot.c. 1094 1095 Similarly, "_xplotters" is a sparse array containing pointers to all 1096 XPlotters instances, of size "_xplotters_len". In libplot, they're 1097 globals, but in libplotter, they're static data members of the XPlotter 1098 class. In both libraries, they're defined in y_defplot.c. */ 1099 1100 #ifndef LIBPLOTTER 1101 extern Plotter **_plotters; 1102 extern int _plotters_len; 1103 #define XPlotter Plotter /* crock, needed by code in y_defplot.c */ 1104 extern XPlotter **_xplotters; 1105 extern int _xplotters_len; 1106 #else 1107 #define _plotters Plotter::_plotters 1108 #define _plotters_len Plotter::_plotters_len 1109 #define _xplotters XPlotter::_xplotters 1110 #define _xplotters_len XPlotter::_xplotters_len 1111 #endif 1112 1113 #ifndef LIBPLOTTER 1114 /* In libplot, these are the initializations of the function-pointer parts 1115 of the different types of Plotter. They are copied to the Plotter at 1116 creation time (in apinewc.c, which is libplot-specific). */ 1117 extern const Plotter _pl_g_default_plotter, _pl_b_default_plotter, _pl_m_default_plotter, _pl_r_default_plotter, _pl_t_default_plotter, _pl_h_default_plotter, _pl_q_default_plotter, _pl_f_default_plotter, _pl_c_default_plotter, _pl_p_default_plotter, _pl_a_default_plotter, _pl_s_default_plotter, _pl_i_default_plotter, _pl_n_default_plotter, _pl_z_default_plotter, _pl_x_default_plotter, _pl_y_default_plotter; 1118 1119 /* Similarly, in libplot this is the initialization of the function-pointer 1120 part of any PlotterParams object. */ 1121 extern const PlotterParams _default_plotter_params; 1122 #endif /* not LIBPLOTTER */ 1123 1124 /* The array used for storing the names of recognized Plotter parameters, 1125 and their default values. (See g_params2.c.) */ 1126 struct plParamRecord 1127 { 1128 const char *parameter; /* parameter name */ 1129 void * default_value; /* default value (applies if string-valued) */ 1130 bool is_string; /* whether or not value must be a string */ 1131 }; 1132 1133 extern const struct plParamRecord _known_params[NUM_PLOTTER_PARAMETERS]; 1134 1135 /* A pointer to a distinguished (global) PlotterParams object, used by the 1136 old C and C++ bindings. The function parampl() sets parameters in this 1137 object. (This is one reason why the old bindings are non-thread-safe. 1138 The new bindings allow the programmer to instantiate and use more than a 1139 single PlotterParams object, so they are thread-safe.) In libplotter, 1140 this pointer is declared as a static member of the Plotter class. */ 1141 #ifndef LIBPLOTTER 1142 extern PlotterParams *_old_api_global_plotter_params; 1143 #else 1144 #define _old_api_global_plotter_params Plotter::_old_api_global_plotter_params 1145 #endif 1146 1147 1148 /**************************************************************************/ 1149 /* PROTOTYPES ETC. for libplot and libplotter */ 1150 /**************************************************************************/ 1151 1152 /* Miscellaneous internal functions that aren't Plotter class methods, so 1153 they're declared the same for both libplot and libplotter. */ 1154 1155 /* wrappers for malloc and friends */ 1156 extern void * _pl_xcalloc (size_t nmemb, size_t size); 1157 extern void * _pl_xmalloc (size_t size); 1158 extern void * _pl_xrealloc (void * p, size_t size); 1159 1160 /* misc. utility functions, mostly geometry-related */ 1161 1162 extern plPoint _truecenter (plPoint p0, plPoint p1, plPoint pc); 1163 extern plVector *_vscale (plVector *v, double newlen); 1164 extern double _angle_of_arc (plPoint p0, plPoint p1, plPoint pc); 1165 extern double _matrix_norm (const double m[6]); 1166 extern double _xatan2 (double y, double x); 1167 extern int _clip_line (double *x0_p, double *y0_p, double *x1_p, double *y1_p, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip); 1168 extern int _codestring_len (const unsigned short *codestring); 1169 extern int _grayscale_approx (int red, int green, int blue); 1170 extern void _matrix_product (const double m[6], const double n[6], double product[6]); 1171 extern void _matrix_inverse (const double m[6], double inverse[6]); 1172 extern void _matrix_sing_vals (const double m[6], double *min_sing_val, double *max_sing_val); 1173 extern void _set_common_mi_attributes (plDrawState *drawstate, void * ptr); 1174 extern void * _get_default_plot_param (const char *parameter); 1175 1176 /* plPlotterData methods */ 1177 /* lowest-level output routines used by Plotters */ 1178 extern void _write_byte (const plPlotterData *data, unsigned char c); 1179 extern void _write_bytes (const plPlotterData *data, int n, const unsigned char *c); 1180 extern void _write_string (const plPlotterData *data, const char *s); 1181 /* other plPlotterData methods */ 1182 extern bool _compute_ndc_to_device_map (plPlotterData *data); 1183 extern void _set_page_type (plPlotterData *data); 1184 extern void * _get_plot_param (const plPlotterData *data, const char *parameter); 1185 1186 /* plPath methods (see g_subpaths.c) */ 1187 extern plPath * _flatten_path (const plPath *path); 1188 extern plPath * _new_plPath (void); 1189 extern plPath ** _merge_paths (const plPath **paths, int num_paths); 1190 extern void _add_arc (plPath *path, plPoint pc, plPoint p1); 1191 extern void _add_arc_as_bezier3 (plPath *path, plPoint pc, plPoint p1); 1192 extern void _add_arc_as_lines (plPath *path, plPoint pc, plPoint p1); 1193 extern void _add_bezier2 (plPath *path, plPoint pc, plPoint p); 1194 extern void _add_bezier2_as_lines (plPath *path, plPoint pc, plPoint p); 1195 extern void _add_bezier3 (plPath *path, plPoint pc, plPoint pd, plPoint p); 1196 extern void _add_bezier3_as_lines (plPath *path, plPoint pc, plPoint pd, plPoint p); 1197 extern void _add_box (plPath *path, plPoint p0, plPoint p1, bool clockwise); 1198 extern void _add_box_as_lines (plPath *path, plPoint p0, plPoint p1, bool clockwise); 1199 extern void _add_circle (plPath *path, plPoint pc, double radius, bool clockwise); 1200 extern void _add_circle_as_bezier3s (plPath *path, plPoint pc, double radius, bool clockwise); 1201 extern void _add_circle_as_ellarcs (plPath *path, plPoint pc, double radius, bool clockwise); 1202 extern void _add_circle_as_lines (plPath *path, plPoint pc, double radius, bool clockwise); 1203 extern void _add_ellarc (plPath *path, plPoint pc, plPoint p1); 1204 extern void _add_ellarc_as_bezier3 (plPath *path, plPoint pc, plPoint p1); 1205 extern void _add_ellarc_as_lines (plPath *path, plPoint pc, plPoint p1); 1206 extern void _add_ellipse (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); 1207 extern void _add_ellipse_as_bezier3s (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); 1208 extern void _add_ellipse_as_ellarcs (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); 1209 extern void _add_ellipse_as_lines (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); 1210 extern void _add_line (plPath *path, plPoint p); 1211 extern void _add_moveto (plPath *path, plPoint p); 1212 extern void _delete_plPath (plPath *path); 1213 extern void _reset_plPath (plPath *path); 1214 1215 /* plOutbuf methods (see g_outbuf.c) */ 1216 extern plOutbuf * _new_outbuf (void); 1217 extern void _bbox_of_outbuf (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax); 1218 extern void _bbox_of_outbufs (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax); 1219 extern void _delete_outbuf (plOutbuf *outbuf); 1220 extern void _freeze_outbuf (plOutbuf *outbuf); 1221 extern void _reset_outbuf (plOutbuf *outbuf); 1222 extern void _update_bbox (plOutbuf *bufp, double x, double y); 1223 extern void _update_buffer (plOutbuf *outbuf); 1224 extern void _update_buffer_by_added_bytes (plOutbuf *outbuf, int additional); 1225 1226 /* functions that update a device-frame bounding box for a page, as stored 1227 in a plOutbuf */ 1228 extern void _set_bezier2_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double device_line_width, double m[6]); 1229 extern void _set_bezier3_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double device_line_width, double m[6]); 1230 extern void _set_ellipse_bbox (plOutbuf *bufp, double x, double y, double rx, double ry, double costheta, double sintheta, double linewidth, double m[6]); 1231 extern void _set_line_end_bbox (plOutbuf *bufp, double x, double y, double xother, double yother, double linewidth, int capstyle, double m[6]); 1232 extern void _set_line_join_bbox (plOutbuf *bufp, double xleft, double yleft, double x, double y, double xright, double yright, double linewidth, int joinstyle, double miterlimit, double m[6]); 1233 1234 /* CGMPlotter-related functions, which write a CGM command, or an argument 1235 of same, alternatively to a plOutbuf or to a string (see c_emit.c) */ 1236 extern void _cgm_emit_command_header (plOutbuf *outbuf, int cgm_encoding, int element_class, int id, int data_len, int *byte_count, const char *op_code); 1237 extern void _cgm_emit_color_component (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); 1238 extern void _cgm_emit_enum (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count, const char *text_string); 1239 extern void _cgm_emit_index (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count); 1240 extern void _cgm_emit_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count); 1241 extern void _cgm_emit_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int y, int data_len, int *data_byte_count, int *byte_count); 1242 extern void _cgm_emit_points (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const int *x, const int *y, int npoints, int data_len, int *data_byte_count, int *byte_count); 1243 extern void _cgm_emit_real_fixed_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count); 1244 extern void _cgm_emit_real_floating_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count); 1245 extern void _cgm_emit_string (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const char *s, int string_length, bool use_double_quotes, int data_len, int *data_byte_count, int *byte_count); 1246 extern void _cgm_emit_unsigned_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); 1247 extern void _cgm_emit_unsigned_integer_8bit (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); 1248 extern void _cgm_emit_command_terminator (plOutbuf *outbuf, int cgm_encoding, int *byte_count); 1249 1250 /* SVGPlotter-related functions */ 1251 extern const char * _libplot_color_to_svg_color (plColor color_48, char charbuf[8]); 1252 1253 /* plColorNameCache methods */ 1254 extern bool _string_to_color (const char *name, plColor *color_p, plColorNameCache *color_name_cache); 1255 extern plColorNameCache * _create_color_name_cache (void); 1256 extern void _delete_color_name_cache (plColorNameCache *color_cache); 1257 1258 /* Renaming of the global symbols in the libxmi scan conversion library, 1259 which we include in libplot/libplotter as a rendering module. We 1260 prepend each name with "_pl". Doing this keeps the user-level namespace 1261 clean, and allows an application to link with both libplot/libplotter 1262 and a separate version of libxmi. */ 1263 1264 /* libxmi API functions */ 1265 1266 #define miClearPaintedSet _pl_miClearPaintedSet 1267 #define miCopyCanvas _pl_miCopyCanvas 1268 #define miCopyGC _pl_miCopyGC 1269 #define miCopyPaintedSetToCanvas _pl_miCopyPaintedSetToCanvas 1270 #define miDeleteCanvas _pl_miDeleteCanvas 1271 #define miDeleteEllipseCache _pl_miDeleteEllipseCache 1272 #define miDeleteGC _pl_miDeleteGC 1273 #define miDeletePaintedSet _pl_miDeletePaintedSet 1274 #define miDrawArcs_r _pl_miDrawArcs_r 1275 #define miDrawLines _pl_miDrawLines 1276 #define miDrawPoints _pl_miDrawPoints 1277 #define miDrawRectangles _pl_miDrawRectangles 1278 #define miFillArcs _pl_miFillArcs 1279 #define miFillPolygon _pl_miFillPolygon 1280 #define miFillRectangles _pl_miFillRectangles 1281 #define miNewCanvas _pl_miNewCanvas 1282 #define miNewEllipseCache _pl_miNewEllipseCache 1283 #define miNewGC _pl_miNewGC 1284 #define miNewPaintedSet _pl_miNewPaintedSet 1285 #define miSetCanvasStipple _pl_miSetCanvasStipple 1286 #define miSetCanvasTexture _pl_miSetCanvasTexture 1287 #define miSetGCAttrib _pl_miSetGCAttrib 1288 #define miSetGCAttribs _pl_miSetGCAttribs 1289 #define miSetGCDashes _pl_miSetGCDashes 1290 #define miSetGCMiterLimit _pl_miSetGCMiterLimit 1291 #define miSetGCPixels _pl_miSetGCPixels 1292 #define miSetPixelMerge2 _pl_miSetPixelMerge2 1293 #define miSetPixelMerge3 _pl_miSetPixelMerge3 1294 1295 /* an external libxmi symbol */ 1296 #define mi_libxmi_ver _pl_mi_libxmi_ver 1297 1298 /* internal libxmi functions (which incidentally in libxmi are given an 1299 initial underscore, in much the same way) */ 1300 #define mi_xmalloc _pl_mi_xmalloc 1301 #define mi_xcalloc _pl_mi_xcalloc 1302 #define mi_xrealloc _pl_mi_xrealloc 1303 #define miAddSpansToPaintedSet _pl_miAddSpansToPaintedSet 1304 #define miDrawArcs_r_internal _pl_miDrawArcs_r_internal 1305 #define miDrawArcs_internal _pl_miDrawArcs_internal 1306 #define miDrawLines_internal _pl_miDrawLines_internal 1307 #define miDrawRectangles_internal _pl_miDrawRectangles_internal 1308 #define miPolyArc_r _pl_miPolyArc_r 1309 #define miPolyArc _pl_miPolyArc 1310 #define miFillArcs_internal _pl_miFillArcs_internal 1311 #define miFillRectangles_internal _pl_miFillRectangles_internal 1312 #define miFillSppPoly _pl_miFillSppPoly 1313 #define miFillPolygon_internal _pl_miFillPolygon_internal 1314 #define miFillConvexPoly _pl_miFillConvexPoly 1315 #define miFillGeneralPoly _pl_miFillGeneralPoly 1316 #define miDrawPoints_internal _pl_miDrawPoints_internal 1317 #define miCreateETandAET _pl_miCreateETandAET 1318 #define miloadAET _pl_miloadAET 1319 #define micomputeWAET _pl_micomputeWAET 1320 #define miInsertionSort _pl_miInsertionSort 1321 #define miFreeStorage _pl_miFreeStorage 1322 #define miQuickSortSpansY _pl_miQuickSortSpansY 1323 #define miUniquifyPaintedSet _pl_miUniquifyPaintedSet 1324 #define miWideDash _pl_miWideDash 1325 #define miStepDash _pl_miStepDash 1326 #define miWideLine _pl_miWideLine 1327 #define miZeroPolyArc_r _pl_miZeroPolyArc_r 1328 #define miZeroPolyArc _pl_miZeroPolyArc 1329 #define miZeroLine _pl_miZeroLine 1330 #define miZeroDash _pl_miZeroDash 1331 1332 /* Don't include unneeded non-reentrant libxmi functions, such as the 1333 function miPolyArc(). We use the reentrant version miPolyArc_r() 1334 instead, to avoid static data. */ 1335 #define NO_NONREENTRANT_POLYARC_SUPPORT 1336 1337 /* Internal functions that aren't Plotter class methods, but which need to 1338 be renamed in libplotter. */ 1339 #ifdef LIBPLOTTER 1340 #define pl_libplot_warning_handler pl_libplotter_warning_handler 1341 #define pl_libplot_error_handler pl_libplotter_error_handler 1342 #endif 1343 1344 /* Declarations of forwarding functions used in libplot (not libplotter). */ 1345 1346 /* These support the derivation of classes such as the PNMPlotter and the 1347 PNGPlotter classes from the BitmapPlotter class, the derivation of the 1348 PCLPlotter class from the HPGLPlotter class, and the derivation of the 1349 XPlotter class from the XDrawablePlotter class. */ 1350 1351 #ifndef LIBPLOTTER 1352 extern int _maybe_output_image (Plotter *_plotter); 1353 extern void _maybe_switch_to_hpgl (Plotter *_plotter); 1354 extern void _maybe_switch_from_hpgl (Plotter *_plotter); 1355 #ifndef X_DISPLAY_MISSING 1356 extern void _maybe_get_new_colormap (Plotter *_plotter); 1357 extern void _maybe_handle_x_events (Plotter *_plotter); 1358 #endif /* not X_DISPLAY_MISSING */ 1359 #endif /* not LIBPLOTTER */ 1360 1361 /* Declarations of the Plotter methods and the device-specific versions of 1362 same. The initial letter indicates the Plotter class specificity: 1363 g=generic (i.e. base Plotter class), b=bitmap, m=metafile, t=Tektronix, 1364 r=ReGIS, h=HP-GL/2 and PCL 5, f=xfig, c=CGM, p=PS, a=Adobe Illustrator, 1365 s=SVG, i=GIF, n=PNM (i.e. PBM/PGM/PPM), z=PNG, x=X11 Drawable, y=X11. 1366 1367 In libplot, these are declarations of global functions. But in 1368 libplotter, we use #define and the double colon notation to make them 1369 function members of the appropriate Plotter classes. 1370 1371 The declarations-for-libplot are encapsulated within 1372 ___BEGIN_DECLS...___END_DECLS pairs, which do nothing if a C compiler is 1373 used to compile libplot. If on the other hand libplot is compiled by a 1374 C++ compiler, which is easy to arrange by doing `CC=g++ ./configure', 1375 then this will require each libplot function to have C linkage rather 1376 than C++ linkage. Libplot functions should have C linkage, of course 1377 (cf. libplot's external header file plot.h). */ 1378 1379 #ifndef LIBPLOTTER 1380 /* support C++ */ 1381 #ifdef ___BEGIN_DECLS 1382 #undef ___BEGIN_DECLS 1383 #endif 1384 #ifdef ___END_DECLS 1385 #undef ___END_DECLS 1386 #endif 1387 #ifdef __cplusplus 1388 # define ___BEGIN_DECLS extern "C" { 1389 # define ___END_DECLS } 1390 #else 1391 # define ___BEGIN_DECLS /* empty */ 1392 # define ___END_DECLS /* empty */ 1393 #endif 1394 #endif /* not LIBPLOTTER */ 1395 1396 #ifndef LIBPLOTTER 1397 /* Plotter public methods, for libplot */ 1398 #define _API_alabel pl_alabel_r 1399 #define _API_arc pl_arc_r 1400 #define _API_arcrel pl_arcrel_r 1401 #define _API_bezier2 pl_bezier2_r 1402 #define _API_bezier2rel pl_bezier2rel_r 1403 #define _API_bezier3 pl_bezier3_r 1404 #define _API_bezier3rel pl_bezier3rel_r 1405 #define _API_bgcolor pl_bgcolor_r 1406 #define _API_bgcolorname pl_bgcolorname_r 1407 #define _API_box pl_box_r 1408 #define _API_boxrel pl_boxrel_r 1409 #define _API_capmod pl_capmod_r 1410 #define _API_circle pl_circle_r 1411 #define _API_circlerel pl_circlerel_r 1412 #define _API_closepath pl_closepath_r 1413 #define _API_closepl pl_closepl_r 1414 #define _API_color pl_color_r 1415 #define _API_colorname pl_colorname_r 1416 #define _API_cont pl_cont_r 1417 #define _API_contrel pl_contrel_r 1418 #define _API_ellarc pl_ellarc_r 1419 #define _API_ellarcrel pl_ellarcrel_r 1420 #define _API_ellipse pl_ellipse_r 1421 #define _API_ellipserel pl_ellipserel_r 1422 #define _API_endpath pl_endpath_r 1423 #define _API_endsubpath pl_endsubpath_r 1424 #define _API_erase pl_erase_r 1425 #define _API_farc pl_farc_r 1426 #define _API_farcrel pl_farcrel_r 1427 #define _API_fbezier2 pl_fbezier2_r 1428 #define _API_fbezier2rel pl_fbezier2rel_r 1429 #define _API_fbezier3 pl_fbezier3_r 1430 #define _API_fbezier3rel pl_fbezier3rel_r 1431 #define _API_fbox pl_fbox_r 1432 #define _API_fboxrel pl_fboxrel_r 1433 #define _API_fcircle pl_fcircle_r 1434 #define _API_fcirclerel pl_fcirclerel_r 1435 #define _API_fconcat pl_fconcat_r 1436 #define _API_fcont pl_fcont_r 1437 #define _API_fcontrel pl_fcontrel_r 1438 #define _API_fellarc pl_fellarc_r 1439 #define _API_fellarcrel pl_fellarcrel_r 1440 #define _API_fellipse pl_fellipse_r 1441 #define _API_fellipserel pl_fellipserel_r 1442 #define _API_ffontname pl_ffontname_r 1443 #define _API_ffontsize pl_ffontsize_r 1444 #define _API_fillcolor pl_fillcolor_r 1445 #define _API_fillcolorname pl_fillcolorname_r 1446 #define _API_fillmod pl_fillmod_r 1447 #define _API_filltype pl_filltype_r 1448 #define _API_flabelwidth pl_flabelwidth_r 1449 #define _API_fline pl_fline_r 1450 #define _API_flinedash pl_flinedash_r 1451 #define _API_flinerel pl_flinerel_r 1452 #define _API_flinewidth pl_flinewidth_r 1453 #define _API_flushpl pl_flushpl_r 1454 #define _API_fmarker pl_fmarker_r 1455 #define _API_fmarkerrel pl_fmarkerrel_r 1456 #define _API_fmiterlimit pl_fmiterlimit_r 1457 #define _API_fmove pl_fmove_r 1458 #define _API_fmoverel pl_fmoverel_r 1459 #define _API_fontname pl_fontname_r 1460 #define _API_fontsize pl_fontsize_r 1461 #define _API_fpoint pl_fpoint_r 1462 #define _API_fpointrel pl_fpointrel_r 1463 #define _API_frotate pl_frotate_r 1464 #define _API_fscale pl_fscale_r 1465 #define _API_fsetmatrix pl_fsetmatrix_r 1466 #define _API_fspace pl_fspace_r 1467 #define _API_fspace2 pl_fspace2_r 1468 #define _API_ftextangle pl_ftextangle_r 1469 #define _API_ftranslate pl_ftranslate_r 1470 #define _API_havecap pl_havecap_r 1471 #define _API_joinmod pl_joinmod_r 1472 #define _API_label pl_label_r 1473 #define _API_labelwidth pl_labelwidth_r 1474 #define _API_line pl_line_r 1475 #define _API_linedash pl_linedash_r 1476 #define _API_linemod pl_linemod_r 1477 #define _API_linerel pl_linerel_r 1478 #define _API_linewidth pl_linewidth_r 1479 #define _API_marker pl_marker_r 1480 #define _API_markerrel pl_markerrel_r 1481 #define _API_move pl_move_r 1482 #define _API_moverel pl_moverel_r 1483 #define _API_openpl pl_openpl_r 1484 #define _API_orientation pl_orientation_r 1485 #define _API_outfile pl_outfile_r /* OBSOLESCENT */ 1486 #define _API_pencolor pl_pencolor_r 1487 #define _API_pencolorname pl_pencolorname_r 1488 #define _API_pentype pl_pentype_r 1489 #define _API_point pl_point_r 1490 #define _API_pointrel pl_pointrel_r 1491 #define _API_restorestate pl_restorestate_r 1492 #define _API_savestate pl_savestate_r 1493 #define _API_space pl_space_r 1494 #define _API_space2 pl_space2_r 1495 #define _API_textangle pl_textangle_r 1496 ___BEGIN_DECLS 1497 extern FILE* _API_outfile (Plotter *_plotter, FILE* newstream);/* OBSOLESCENT */ 1498 extern double _API_ffontname (Plotter *_plotter, const char *s); 1499 extern double _API_ffontsize (Plotter *_plotter, double size); 1500 extern double _API_flabelwidth (Plotter *_plotter, const char *s); 1501 extern double _API_ftextangle (Plotter *_plotter, double angle); 1502 extern int _API_alabel (Plotter *_plotter, int x_justify, int y_justify, const char *s); 1503 extern int _API_arc (Plotter *_plotter, int xc, int yc, int x0, int y0, int x1, int y1); 1504 extern int _API_arcrel (Plotter *_plotter, int dxc, int dyc, int dx0, int dy0, int dx1, int dy1); 1505 extern int _API_bezier2 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2); 1506 extern int _API_bezier2rel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1, int dx2, int dy2); 1507 extern int _API_bezier3 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); 1508 extern int _API_bezier3rel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); 1509 extern int _API_bgcolor (Plotter *_plotter, int red, int green, int blue); 1510 extern int _API_bgcolorname (Plotter *_plotter, const char *name); 1511 extern int _API_box (Plotter *_plotter, int x0, int y0, int x1, int y1); 1512 extern int _API_boxrel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1); 1513 extern int _API_capmod (Plotter *_plotter, const char *s); 1514 extern int _API_circle (Plotter *_plotter, int x, int y, int r); 1515 extern int _API_circlerel (Plotter *_plotter, int dx, int dy, int r); 1516 extern int _API_closepath (Plotter *_plotter); 1517 extern int _API_closepl (Plotter *_plotter); 1518 extern int _API_color (Plotter *_plotter, int red, int green, int blue); 1519 extern int _API_colorname (Plotter *_plotter, const char *name); 1520 extern int _API_cont (Plotter *_plotter, int x, int y); 1521 extern int _API_contrel (Plotter *_plotter, int x, int y); 1522 extern int _API_ellarc (Plotter *_plotter, int xc, int yc, int x0, int y0, int x1, int y1); 1523 extern int _API_ellarcrel (Plotter *_plotter, int dxc, int dyc, int dx0, int dy0, int dx1, int dy1); 1524 extern int _API_ellipse (Plotter *_plotter, int x, int y, int rx, int ry, int angle); 1525 extern int _API_ellipserel (Plotter *_plotter, int dx, int dy, int rx, int ry, int angle); 1526 extern int _API_endpath (Plotter *_plotter); 1527 extern int _API_endsubpath (Plotter *_plotter); 1528 extern int _API_erase (Plotter *_plotter); 1529 extern int _API_farc (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); 1530 extern int _API_farcrel (Plotter *_plotter, double dxc, double dyc, double dx0, double dy0, double dx1, double dy1); 1531 extern int _API_fbezier2 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2); 1532 extern int _API_fbezier2rel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1, double dx2, double dy2); 1533 extern int _API_fbezier3 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3); 1534 extern int _API_fbezier3rel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); 1535 extern int _API_fbox (Plotter *_plotter, double x0, double y0, double x1, double y1); 1536 extern int _API_fboxrel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1); 1537 extern int _API_fcircle (Plotter *_plotter, double x, double y, double r); 1538 extern int _API_fcirclerel (Plotter *_plotter, double dx, double dy, double r); 1539 extern int _API_fconcat (Plotter *_plotter, double m0, double m1, double m2, double m3, double m4, double m5); 1540 extern int _API_fcont (Plotter *_plotter, double x, double y); 1541 extern int _API_fcontrel (Plotter *_plotter, double x, double y); 1542 extern int _API_fellarc (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); 1543 extern int _API_fellarcrel (Plotter *_plotter, double dxc, double dyc, double dx0, double dy0, double dx1, double dy1); 1544 extern int _API_fellipse (Plotter *_plotter, double x, double y, double rx, double ry, double angle); 1545 extern int _API_fellipserel (Plotter *_plotter, double dx, double dy, double rx, double ry, double angle); 1546 extern int _API_fillcolor (Plotter *_plotter, int red, int green, int blue); 1547 extern int _API_fillcolorname (Plotter *_plotter, const char *name); 1548 extern int _API_fillmod (Plotter *_plotter, const char *s); 1549 extern int _API_filltype (Plotter *_plotter, int level); 1550 extern int _API_fline (Plotter *_plotter, double x0, double y0, double x1, double y1); 1551 extern int _API_flinedash (Plotter *_plotter, int n, const double *dashes, double offset); 1552 extern int _API_flinerel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1); 1553 extern int _API_flinewidth (Plotter *_plotter, double size); 1554 extern int _API_flushpl (Plotter *_plotter); 1555 extern int _API_fmarker (Plotter *_plotter, double x, double y, int type, double size); 1556 extern int _API_fmarkerrel (Plotter *_plotter, double dx, double dy, int type, double size); 1557 extern int _API_fmiterlimit (Plotter *_plotter, double limit); 1558 extern int _API_fmove (Plotter *_plotter, double x, double y); 1559 extern int _API_fmoverel (Plotter *_plotter, double x, double y); 1560 extern int _API_fontname (Plotter *_plotter, const char *s); 1561 extern int _API_fontsize (Plotter *_plotter, int size); 1562 extern int _API_fpoint (Plotter *_plotter, double x, double y); 1563 extern int _API_fpointrel (Plotter *_plotter, double dx, double dy); 1564 extern int _API_frotate (Plotter *_plotter, double theta); 1565 extern int _API_fscale (Plotter *_plotter, double x, double y); 1566 extern int _API_fsetmatrix (Plotter *_plotter, double m0, double m1, double m2, double m3, double m4, double m5); 1567 extern int _API_fspace (Plotter *_plotter, double x0, double y0, double x1, double y1); 1568 extern int _API_fspace2 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2); 1569 extern int _API_ftranslate (Plotter *_plotter, double x, double y); 1570 extern int _API_havecap (Plotter *_plotter, const char *s); 1571 extern int _API_joinmod (Plotter *_plotter, const char *s); 1572 extern int _API_label (Plotter *_plotter, const char *s); 1573 extern int _API_labelwidth (Plotter *_plotter, const char *s); 1574 extern int _API_line (Plotter *_plotter, int x0, int y0, int x1, int y1); 1575 extern int _API_linedash (Plotter *_plotter, int n, const int *dashes, int offset); 1576 extern int _API_linemod (Plotter *_plotter, const char *s); 1577 extern int _API_linerel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1); 1578 extern int _API_linewidth (Plotter *_plotter, int size); 1579 extern int _API_marker (Plotter *_plotter, int x, int y, int type, int size); 1580 extern int _API_markerrel (Plotter *_plotter, int dx, int dy, int type, int size); 1581 extern int _API_move (Plotter *_plotter, int x, int y); 1582 extern int _API_moverel (Plotter *_plotter, int x, int y); 1583 extern int _API_openpl (Plotter *_plotter); 1584 extern int _API_orientation (Plotter *_plotter, int direction); 1585 extern int _API_pencolor (Plotter *_plotter, int red, int green, int blue); 1586 extern int _API_pencolorname (Plotter *_plotter, const char *name); 1587 extern int _API_pentype (Plotter *_plotter, int level); 1588 extern int _API_point (Plotter *_plotter, int x, int y); 1589 extern int _API_pointrel (Plotter *_plotter, int dx, int dy); 1590 extern int _API_restorestate (Plotter *_plotter); 1591 extern int _API_savestate (Plotter *_plotter); 1592 extern int _API_space (Plotter *_plotter, int x0, int y0, int x1, int y1); 1593 extern int _API_space2 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2); 1594 extern int _API_textangle (Plotter *_plotter, int angle); 1595 /* Plotter protected methods, for libplot */ 1596 extern bool _pl_g_begin_page (Plotter *_plotter); 1597 extern bool _pl_g_end_page (Plotter *_plotter); 1598 extern bool _pl_g_erase_page (Plotter *_plotter); 1599 extern bool _pl_g_flush_output (Plotter *_plotter); 1600 extern bool _pl_g_paint_marker (Plotter *_plotter, int type, double size); 1601 extern bool _pl_g_paint_paths (Plotter *_plotter); 1602 extern bool _pl_g_path_is_flushable (Plotter *_plotter); 1603 extern bool _pl_g_retrieve_font (Plotter *_plotter); 1604 extern double _pl_g_get_text_width (Plotter *_plotter, const unsigned char *s); 1605 extern double _pl_g_paint_text_string (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); 1606 extern void _pl_g_error (Plotter *_plotter, const char *msg); 1607 extern void _pl_g_initialize (Plotter *_plotter); 1608 extern void _pl_g_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); 1609 extern void _pl_g_paint_path (Plotter *_plotter); 1610 extern void _pl_g_paint_point (Plotter *_plotter); 1611 extern void _pl_g_paint_text_string_with_escapes (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); 1612 extern void _pl_g_pop_state (Plotter *_plotter); 1613 extern void _pl_g_push_state (Plotter *_plotter); 1614 extern void _pl_g_terminate (Plotter *_plotter); 1615 extern void _pl_g_warning (Plotter *_plotter, const char *msg); 1616 /* undocumented public methods that provide access to the font tables 1617 within libplot/libplotter; for libplot */ 1618 extern void * _pl_get_hershey_font_info (Plotter *_plotter); 1619 extern void * _pl_get_ps_font_info (Plotter *_plotter); 1620 extern void * _pl_get_pcl_font_info (Plotter *_plotter); 1621 extern void * _pl_get_stick_font_info (Plotter *_plotter); 1622 /* private functions related to the drawing of text strings in Hershey 1623 fonts (defined in g_alab_her.c); for libplot */ 1624 extern double _pl_g_alabel_hershey (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); 1625 extern double _pl_g_flabelwidth_hershey (Plotter *_plotter, const unsigned char *s); 1626 extern void _pl_g_draw_hershey_glyph (Plotter *_plotter, int num, double charsize, int type, bool oblique); 1627 extern void _pl_g_draw_hershey_penup_stroke (Plotter *_plotter, double dx, double dy, double charsize, bool oblique); 1628 extern void _pl_g_draw_hershey_string (Plotter *_plotter, const unsigned short *string); 1629 extern void _pl_g_draw_hershey_stroke (Plotter *_plotter, bool pendown, double deltax, double deltay); 1630 /* other private Plotter functions (a mixed bag), for libplot */ 1631 extern double _pl_g_render_non_hershey_string (Plotter *_plotter, const char *s, bool do_render, int x_justify, int y_justify); 1632 extern double _pl_g_render_simple_string (Plotter *_plotter, const unsigned char *s, bool do_render, int h_just, int v_just); 1633 extern unsigned short * _pl_g_controlify (Plotter *_plotter, const unsigned char *); 1634 extern void _pl_g_copy_params_to_plotter (Plotter *_plotter, const PlotterParams *params); 1635 extern void _pl_g_create_first_drawing_state (Plotter *_plotter); 1636 extern void _pl_g_delete_first_drawing_state (Plotter *_plotter); 1637 extern void _pl_g_free_params_in_plotter (Plotter *_plotter); 1638 extern void _pl_g_maybe_replace_arc (Plotter *_plotter); 1639 extern void _pl_g_set_font (Plotter *_plotter); 1640 /* other protected Plotter functions (a mixed bag), for libplot */ 1641 extern void _pl_g_flush_plotter_outstreams (Plotter *_plotter); 1642 ___END_DECLS 1643 #else /* LIBPLOTTER */ 1644 /* static Plotter public method (libplotter only) */ 1645 #define parampl Plotter::parampl 1646 /* Plotter public methods, for libplotter */ 1647 #define _API_alabel Plotter::alabel 1648 #define _API_arc Plotter::arc 1649 #define _API_arcrel Plotter::arcrel 1650 #define _API_bezier2 Plotter::bezier2 1651 #define _API_bezier2rel Plotter::bezier2rel 1652 #define _API_bezier3 Plotter::bezier3 1653 #define _API_bezier3rel Plotter::bezier3rel 1654 #define _API_bgcolor Plotter::bgcolor 1655 #define _API_bgcolorname Plotter::bgcolorname 1656 #define _API_box Plotter::box 1657 #define _API_boxrel Plotter::boxrel 1658 #define _API_capmod Plotter::capmod 1659 #define _API_circle Plotter::circle 1660 #define _API_circlerel Plotter::circlerel 1661 #define _API_closepath Plotter::closepath 1662 #define _API_closepl Plotter::closepl 1663 #define _API_color Plotter::color 1664 #define _API_colorname Plotter::colorname 1665 #define _API_cont Plotter::cont 1666 #define _API_contrel Plotter::contrel 1667 #define _API_ellarc Plotter::ellarc 1668 #define _API_ellarcrel Plotter::ellarcrel 1669 #define _API_ellipse Plotter::ellipse 1670 #define _API_ellipserel Plotter::ellipserel 1671 #define _API_endpath Plotter::endpath 1672 #define _API_endsubpath Plotter::endsubpath 1673 #define _API_erase Plotter::erase 1674 #define _API_farc Plotter::farc 1675 #define _API_farcrel Plotter::farcrel 1676 #define _API_fbezier2 Plotter::fbezier2 1677 #define _API_fbezier2rel Plotter::fbezier2rel 1678 #define _API_fbezier3 Plotter::fbezier3 1679 #define _API_fbezier3rel Plotter::fbezier3rel 1680 #define _API_fbox Plotter::fbox 1681 #define _API_fboxrel Plotter::fboxrel 1682 #define _API_fcircle Plotter::fcircle 1683 #define _API_fcirclerel Plotter::fcirclerel 1684 #define _API_fconcat Plotter::fconcat 1685 #define _API_fcont Plotter::fcont 1686 #define _API_fcontrel Plotter::fcontrel 1687 #define _API_fellarc Plotter::fellarc 1688 #define _API_fellarcrel Plotter::fellarcrel 1689 #define _API_fellipse Plotter::fellipse 1690 #define _API_fellipserel Plotter::fellipserel 1691 #define _API_ffontname Plotter::ffontname 1692 #define _API_ffontsize Plotter::ffontsize 1693 #define _API_fillcolor Plotter::fillcolor 1694 #define _API_fillcolorname Plotter::fillcolorname 1695 #define _API_fillmod Plotter::fillmod 1696 #define _API_filltype Plotter::filltype 1697 #define _API_flabelwidth Plotter::flabelwidth 1698 #define _API_fline Plotter::fline 1699 #define _API_flinedash Plotter::flinedash 1700 #define _API_flinerel Plotter::flinerel 1701 #define _API_flinewidth Plotter::flinewidth 1702 #define _API_flushpl Plotter::flushpl 1703 #define _API_fmarker Plotter::fmarker 1704 #define _API_fmarkerrel Plotter::fmarkerrel 1705 #define _API_fmiterlimit Plotter::fmiterlimit 1706 #define _API_fmove Plotter::fmove 1707 #define _API_fmoverel Plotter::fmoverel 1708 #define _API_fontname Plotter::fontname 1709 #define _API_fontsize Plotter::fontsize 1710 #define _API_fpoint Plotter::fpoint 1711 #define _API_fpointrel Plotter::fpointrel 1712 #define _API_frotate Plotter::frotate 1713 #define _API_fscale Plotter::fscale 1714 #define _API_fsetmatrix Plotter::fsetmatrix 1715 #define _API_fspace Plotter::fspace 1716 #define _API_fspace2 Plotter::fspace2 1717 #define _API_ftextangle Plotter::ftextangle 1718 #define _API_ftranslate Plotter::ftranslate 1719 #define _API_havecap Plotter::havecap 1720 #define _API_joinmod Plotter::joinmod 1721 #define _API_label Plotter::label 1722 #define _API_labelwidth Plotter::labelwidth 1723 #define _API_line Plotter::line 1724 #define _API_linedash Plotter::linedash 1725 #define _API_linemod Plotter::linemod 1726 #define _API_linerel Plotter::linerel 1727 #define _API_linewidth Plotter::linewidth 1728 #define _API_marker Plotter::marker 1729 #define _API_markerrel Plotter::markerrel 1730 #define _API_move Plotter::move 1731 #define _API_moverel Plotter::moverel 1732 #define _API_openpl Plotter::openpl 1733 #define _API_orientation Plotter::orientation 1734 #define _API_outfile Plotter::outfile /* OBSOLESCENT */ 1735 #define _API_pencolor Plotter::pencolor 1736 #define _API_pencolorname Plotter::pencolorname 1737 #define _API_pentype Plotter::pentype 1738 #define _API_point Plotter::point 1739 #define _API_pointrel Plotter::pointrel 1740 #define _API_restorestate Plotter::restorestate 1741 #define _API_savestate Plotter::savestate 1742 #define _API_space Plotter::space 1743 #define _API_space2 Plotter::space2 1744 #define _API_textangle Plotter::textangle 1745 /* Plotter protected methods, for libplotter */ 1746 #define _pl_g_begin_page Plotter::begin_page 1747 #define _pl_g_end_page Plotter::end_page 1748 #define _pl_g_erase_page Plotter::erase_page 1749 #define _pl_g_error Plotter::error 1750 #define _pl_g_paint_text_string_with_escapes Plotter::paint_text_string_with_escapes 1751 #define _pl_g_paint_text_string Plotter::paint_text_string 1752 #define _pl_g_get_text_width Plotter::get_text_width 1753 #define _pl_g_flush_output Plotter::flush_output 1754 #define _pl_g_initialize Plotter::initialize 1755 #define _pl_g_path_is_flushable Plotter::path_is_flushable 1756 #define _pl_g_maybe_prepaint_segments Plotter::maybe_prepaint_segments 1757 #define _pl_g_paint_marker Plotter::paint_marker 1758 #define _pl_g_paint_path Plotter::paint_path 1759 #define _pl_g_paint_paths Plotter::paint_paths 1760 #define _pl_g_paint_point Plotter::paint_point 1761 #define _pl_g_pop_state Plotter::pop_state 1762 #define _pl_g_push_state Plotter::push_state 1763 #define _pl_g_retrieve_font Plotter::retrieve_font 1764 #define _pl_g_terminate Plotter::terminate 1765 #define _pl_g_warning Plotter::warning 1766 /* undocumented public methods that provide access to the font tables 1767 within libplot/libplotter; for libplotter */ 1768 #define _pl_get_hershey_font_info Plotter::_get_hershey_font_info 1769 #define _pl_get_ps_font_info Plotter::_get_ps_font_info 1770 #define _pl_get_pcl_font_info Plotter::_get_pcl_font_info 1771 #define _pl_get_stick_font_info Plotter::_get_stick_font_info 1772 /* private functions related to the drawing of text strings in Hershey 1773 fonts (defined in g_alab_her.c), for libplotter */ 1774 #define _pl_g_alabel_hershey Plotter::_g_alabel_hershey 1775 #define _pl_g_draw_hershey_glyph Plotter::_g_draw_hershey_glyph 1776 #define _pl_g_draw_hershey_penup_stroke Plotter::_g_draw_hershey_penup_stroke 1777 #define _pl_g_draw_hershey_string Plotter::_g_draw_hershey_string 1778 #define _pl_g_draw_hershey_stroke Plotter::_g_draw_hershey_stroke 1779 #define _pl_g_flabelwidth_hershey Plotter::_g_flabelwidth_hershey 1780 /* other private functions (a mixed bag), for libplotter */ 1781 #define _pl_g_controlify Plotter::_g_controlify 1782 #define _pl_g_copy_params_to_plotter Plotter::_g_copy_params_to_plotter 1783 #define _pl_g_create_first_drawing_state Plotter::_g_create_first_drawing_state 1784 #define _pl_g_delete_first_drawing_state Plotter::_g_delete_first_drawing_state 1785 #define _pl_g_free_params_in_plotter Plotter::_g_free_params_in_plotter 1786 #define _pl_g_maybe_replace_arc Plotter::_g_maybe_replace_arc 1787 #define _pl_g_render_non_hershey_string Plotter::_g_render_non_hershey_string 1788 #define _pl_g_render_simple_string Plotter::_g_render_simple_string 1789 #define _pl_g_set_font Plotter::_g_set_font 1790 /* other protected functions (a mixed bag), for libplotter */ 1791 #define _pl_g_flush_plotter_outstreams Plotter::_flush_plotter_outstreams 1792 #endif /* LIBPLOTTER */ 1793 1794 #ifndef LIBPLOTTER 1795 ___BEGIN_DECLS 1796 /* MetaPlotter protected methods, for libplot */ 1797 extern bool _pl_m_begin_page (Plotter *_plotter); 1798 extern bool _pl_m_end_page (Plotter *_plotter); 1799 extern bool _pl_m_erase_page (Plotter *_plotter); 1800 extern bool _pl_m_paint_marker (Plotter *_plotter, int type, double size); 1801 extern bool _pl_m_paint_paths (Plotter *_plotter); 1802 extern bool _pl_m_path_is_flushable (Plotter *_plotter); 1803 extern void _pl_m_initialize (Plotter *_plotter); 1804 extern void _pl_m_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); 1805 extern void _pl_m_paint_path (Plotter *_plotter); 1806 extern void _pl_m_paint_point (Plotter *_plotter); 1807 extern void _pl_m_paint_text_string_with_escapes (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 1808 extern void _pl_m_terminate (Plotter *_plotter); 1809 /* MetaPlotter-specific internal functions, for libplot */ 1810 extern void _pl_m_emit_integer (Plotter *_plotter, int x); 1811 extern void _pl_m_emit_float (Plotter *_plotter, double x); 1812 extern void _pl_m_emit_op_code (Plotter *_plotter, int c); 1813 extern void _pl_m_emit_string (Plotter *_plotter, const char *s); 1814 extern void _pl_m_emit_terminator (Plotter *_plotter); 1815 extern void _pl_m_paint_path_internal (Plotter *_plotter, const plPath *path); 1816 extern void _pl_m_set_attributes (Plotter *_plotter, unsigned int mask); 1817 ___END_DECLS 1818 #else /* LIBPLOTTER */ 1819 /* MetaPlotter protected methods, for libplotter */ 1820 #define _pl_m_begin_page MetaPlotter::begin_page 1821 #define _pl_m_end_page MetaPlotter::end_page 1822 #define _pl_m_erase_page MetaPlotter::erase_page 1823 #define _pl_m_paint_text_string_with_escapes MetaPlotter::paint_text_string_with_escapes 1824 #define _pl_m_initialize MetaPlotter::initialize 1825 #define _pl_m_path_is_flushable MetaPlotter::path_is_flushable 1826 #define _pl_m_maybe_prepaint_segments MetaPlotter::maybe_prepaint_segments 1827 #define _pl_m_paint_marker MetaPlotter::paint_marker 1828 #define _pl_m_paint_path MetaPlotter::paint_path 1829 #define _pl_m_paint_paths MetaPlotter::paint_paths 1830 #define _pl_m_paint_point MetaPlotter::paint_point 1831 #define _pl_m_terminate MetaPlotter::terminate 1832 /* MetaPlotter-specific internal functions, for libplotter */ 1833 #define _pl_m_emit_integer MetaPlotter::_m_emit_integer 1834 #define _pl_m_emit_float MetaPlotter::_m_emit_float 1835 #define _pl_m_emit_op_code MetaPlotter::_m_emit_op_code 1836 #define _pl_m_emit_string MetaPlotter::_m_emit_string 1837 #define _pl_m_emit_terminator MetaPlotter::_m_emit_terminator 1838 #define _pl_m_paint_path_internal MetaPlotter::_m_paint_path_internal 1839 #define _pl_m_set_attributes MetaPlotter::_m_set_attributes 1840 #endif /* LIBPLOTTER */ 1841 1842 #ifndef LIBPLOTTER 1843 ___BEGIN_DECLS 1844 /* BitmapPlotter protected methods, for libplot */ 1845 extern bool _pl_b_begin_page (Plotter *_plotter); 1846 extern bool _pl_b_end_page (Plotter *_plotter); 1847 extern bool _pl_b_erase_page (Plotter *_plotter); 1848 extern bool _pl_b_paint_paths (Plotter *_plotter); 1849 extern void _pl_b_initialize (Plotter *_plotter); 1850 extern void _pl_b_paint_path (Plotter *_plotter); 1851 extern void _pl_b_paint_point (Plotter *_plotter); 1852 extern void _pl_b_terminate (Plotter *_plotter); 1853 /* BitmapPlotter internal functions, for libplot (overridden in subclasses) */ 1854 extern int _pl_b_maybe_output_image (Plotter *_plotter); 1855 /* other BitmapPlotter internal functions, for libplot */ 1856 extern void _pl_b_delete_image (Plotter *_plotter); 1857 extern void _pl_b_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 1858 extern void _pl_b_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 1859 extern void _pl_b_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); 1860 extern void _pl_b_new_image (Plotter *_plotter); 1861 ___END_DECLS 1862 #else /* LIBPLOTTER */ 1863 /* BitmapPlotter protected methods, for libplotter */ 1864 #define _pl_b_begin_page BitmapPlotter::begin_page 1865 #define _pl_b_end_page BitmapPlotter::end_page 1866 #define _pl_b_erase_page BitmapPlotter::erase_page 1867 #define _pl_b_initialize BitmapPlotter::initialize 1868 #define _pl_b_paint_path BitmapPlotter::paint_path 1869 #define _pl_b_paint_paths BitmapPlotter::paint_paths 1870 #define _pl_b_paint_point BitmapPlotter::paint_point 1871 #define _pl_b_terminate BitmapPlotter::terminate 1872 /* BitmapPlotter internal functions (overriden in subclasses) */ 1873 #define _pl_b_maybe_output_image BitmapPlotter::_maybe_output_image 1874 /* other BitmapPlotter internal functions, for libplotter */ 1875 #define _pl_b_delete_image BitmapPlotter::_b_delete_image 1876 #define _pl_b_draw_elliptic_arc BitmapPlotter::_b_draw_elliptic_arc 1877 #define _pl_b_draw_elliptic_arc_2 BitmapPlotter::_b_draw_elliptic_arc_2 1878 #define _pl_b_draw_elliptic_arc_internal BitmapPlotter::_b_draw_elliptic_arc_internal 1879 #define _pl_b_new_image BitmapPlotter::_b_new_image 1880 #endif /* LIBPLOTTER */ 1881 1882 #ifndef LIBPLOTTER 1883 ___BEGIN_DECLS 1884 /* TekPlotter protected methods, for libplot */ 1885 extern bool _pl_t_begin_page (Plotter *_plotter); 1886 extern bool _pl_t_end_page (Plotter *_plotter); 1887 extern bool _pl_t_erase_page (Plotter *_plotter); 1888 extern bool _pl_t_path_is_flushable (Plotter *_plotter); 1889 extern void _pl_t_initialize (Plotter *_plotter); 1890 extern void _pl_t_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); 1891 extern void _pl_t_paint_point (Plotter *_plotter); 1892 extern void _pl_t_terminate (Plotter *_plotter); 1893 /* TekPlotter internal functions, for libplot */ 1894 extern void _pl_t_set_attributes (Plotter *_plotter); 1895 extern void _pl_t_set_bg_color (Plotter *_plotter); 1896 extern void _pl_t_set_pen_color (Plotter *_plotter); 1897 extern void _pl_t_tek_mode (Plotter *_plotter, int newmode); 1898 extern void _pl_t_tek_move (Plotter *_plotter, int xx, int yy); 1899 extern void _pl_t_tek_vector_compressed (Plotter *_plotter, int xx, int yy, int oldxx, int oldyy, bool force); 1900 extern void _pl_t_tek_vector (Plotter *_plotter, int xx, int yy); 1901 ___END_DECLS 1902 #else /* LIBPLOTTER */ 1903 /* TekPlotter protected methods, for libplotter */ 1904 #define _pl_t_begin_page TekPlotter::begin_page 1905 #define _pl_t_end_page TekPlotter::end_page 1906 #define _pl_t_erase_page TekPlotter::erase_page 1907 #define _pl_t_initialize TekPlotter::initialize 1908 #define _pl_t_path_is_flushable TekPlotter::path_is_flushable 1909 #define _pl_t_maybe_prepaint_segments TekPlotter::maybe_prepaint_segments 1910 #define _pl_t_paint_point TekPlotter::paint_point 1911 #define _pl_t_terminate TekPlotter::terminate 1912 /* TekPlotter internal functions, for libplotter */ 1913 #define _pl_t_set_attributes TekPlotter::_t_set_attributes 1914 #define _pl_t_set_bg_color TekPlotter::_t_set_bg_color 1915 #define _pl_t_set_pen_color TekPlotter::_t_set_pen_color 1916 #define _pl_t_tek_mode TekPlotter::_t_tek_mode 1917 #define _pl_t_tek_move TekPlotter::_t_tek_move 1918 #define _pl_t_tek_vector TekPlotter::_t_tek_vector 1919 #define _pl_t_tek_vector_compressed TekPlotter::_t_tek_vector_compressed 1920 #endif /* LIBPLOTTER */ 1921 1922 #ifndef LIBPLOTTER 1923 ___BEGIN_DECLS 1924 /* ReGISPlotter protected methods, for libplot */ 1925 extern bool _pl_r_begin_page (Plotter *_plotter); 1926 extern bool _pl_r_end_page (Plotter *_plotter); 1927 extern bool _pl_r_erase_page (Plotter *_plotter); 1928 extern bool _pl_r_paint_paths (Plotter *_plotter); 1929 extern bool _pl_r_path_is_flushable (Plotter *_plotter); 1930 extern void _pl_r_initialize (Plotter *_plotter); 1931 extern void _pl_r_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); 1932 extern void _pl_r_paint_path (Plotter *_plotter); 1933 extern void _pl_r_paint_point (Plotter *_plotter); 1934 extern void _pl_r_terminate (Plotter *_plotter); 1935 /* ReGISPlotter internal functions, for libplot */ 1936 extern void _pl_r_regis_move (Plotter *_plotter, int xx, int yy); 1937 extern void _pl_r_set_attributes (Plotter *_plotter); 1938 extern void _pl_r_set_bg_color (Plotter *_plotter); 1939 extern void _pl_r_set_fill_color (Plotter *_plotter); 1940 extern void _pl_r_set_pen_color (Plotter *_plotter); 1941 ___END_DECLS 1942 #else /* LIBPLOTTER */ 1943 /* ReGISPlotter protected methods, for libplotter */ 1944 #define _pl_r_begin_page ReGISPlotter::begin_page 1945 #define _pl_r_end_page ReGISPlotter::end_page 1946 #define _pl_r_erase_page ReGISPlotter::erase_page 1947 #define _pl_r_initialize ReGISPlotter::initialize 1948 #define _pl_r_path_is_flushable ReGISPlotter::path_is_flushable 1949 #define _pl_r_maybe_prepaint_segments ReGISPlotter::maybe_prepaint_segments 1950 #define _pl_r_paint_path ReGISPlotter::paint_path 1951 #define _pl_r_paint_paths ReGISPlotter::paint_paths 1952 #define _pl_r_paint_point ReGISPlotter::paint_point 1953 #define _pl_r_terminate ReGISPlotter::terminate 1954 /* ReGISPlotter internal functions, for libplotter */ 1955 #define _pl_r_regis_move ReGISPlotter::_r_regis_move 1956 #define _pl_r_set_attributes ReGISPlotter::_r_set_attributes 1957 #define _pl_r_set_bg_color ReGISPlotter::_r_set_bg_color 1958 #define _pl_r_set_fill_color ReGISPlotter::_r_set_fill_color 1959 #define _pl_r_set_pen_color ReGISPlotter::_r_set_pen_color 1960 #endif /* LIBPLOTTER */ 1961 1962 #ifndef LIBPLOTTER 1963 ___BEGIN_DECLS 1964 /* HPGLPlotter/PCLPlotter protected methods, for libplot */ 1965 extern bool _pl_h_begin_page (Plotter *_plotter); 1966 extern bool _pl_h_end_page (Plotter *_plotter); 1967 extern bool _pl_h_erase_page (Plotter *_plotter); 1968 extern bool _pl_h_paint_paths (Plotter *_plotter); 1969 extern double _pl_h_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 1970 extern void _pl_h_paint_point (Plotter *_plotter); 1971 extern void _pl_h_paint_path (Plotter *_plotter); 1972 /* HPGLPlotter protected methods, for libplot */ 1973 extern void _pl_h_initialize (Plotter *_plotter); 1974 extern void _pl_h_terminate (Plotter *_plotter); 1975 /* PCLPlotter protected methods, for libplot */ 1976 extern void _pl_q_initialize (Plotter *_plotter); 1977 extern void _pl_q_terminate (Plotter *_plotter); 1978 /* HPGLPlotter/PCLPlotter internal functions, for libplot */ 1979 extern bool _pl_h_hpgl2_maybe_update_font (Plotter *_plotter); 1980 extern bool _pl_h_hpgl_maybe_update_font (Plotter *_plotter); 1981 extern bool _pl_h_parse_pen_string (Plotter *_plotter, const char *pen_s); 1982 extern int _pl_h_hpgl_pseudocolor (Plotter *_plotter, int red, int green, int blue, bool restrict_white); 1983 extern void _pl_h_hpgl_shaded_pseudocolor (Plotter *_plotter, int red, int green, int blue, int *pen, double *shading); 1984 extern void _pl_h_set_attributes (Plotter *_plotter); 1985 extern void _pl_h_set_fill_color (Plotter *_plotter, bool force_pen_color); 1986 extern void _pl_h_set_font (Plotter *_plotter); 1987 extern void _pl_h_set_hpgl_fill_type (Plotter *_plotter, int fill_type, double option1, double option2); 1988 extern void _pl_h_set_hpgl_pen (Plotter *_plotter, int pen); 1989 extern void _pl_h_set_hpgl_pen_type (Plotter *_plotter, int pen_type, double option1, double option2); 1990 extern void _pl_h_set_pen_color (Plotter *_plotter, int hpgl_object_type); 1991 extern void _pl_h_set_position (Plotter *_plotter); 1992 /* HPGLPlotter functions (overridden in PCLPlotter class), for libplotter */ 1993 extern void _pl_h_maybe_switch_to_hpgl (Plotter *_plotter); 1994 extern void _pl_h_maybe_switch_from_hpgl (Plotter *_plotter); 1995 /* PCLPlotter functions (overriding the above), for libplotter */ 1996 extern void _pl_q_maybe_switch_to_hpgl (Plotter *_plotter); 1997 extern void _pl_q_maybe_switch_from_hpgl (Plotter *_plotter); 1998 ___END_DECLS 1999 #else /* LIBPLOTTER */ 2000 /* HPGLPlotter/PCLPlotter protected methods, for libplotter */ 2001 #define _pl_h_begin_page HPGLPlotter::begin_page 2002 #define _pl_h_end_page HPGLPlotter::end_page 2003 #define _pl_h_erase_page HPGLPlotter::erase_page 2004 #define _pl_h_paint_text_string HPGLPlotter::paint_text_string 2005 #define _pl_h_paint_path HPGLPlotter::paint_path 2006 #define _pl_h_paint_paths HPGLPlotter::paint_paths 2007 #define _pl_h_paint_point HPGLPlotter::paint_point 2008 /* HPGLPlotter protected methods, for libplotter */ 2009 #define _pl_h_initialize HPGLPlotter::initialize 2010 #define _pl_h_terminate HPGLPlotter::terminate 2011 /* PCLPlotter protected methods, for libplotter */ 2012 #define _pl_q_initialize PCLPlotter::initialize 2013 #define _pl_q_terminate PCLPlotter::terminate 2014 /* HPGLPlotter/PCLPlotter internal functions, for libplotter */ 2015 #define _pl_h_hpgl2_maybe_update_font HPGLPlotter::_h_hpgl2_maybe_update_font 2016 #define _pl_h_hpgl_maybe_update_font HPGLPlotter::_h_hpgl_maybe_update_font 2017 #define _pl_h_hpgl_pseudocolor HPGLPlotter::_h_hpgl_pseudocolor 2018 #define _pl_h_hpgl_shaded_pseudocolor HPGLPlotter::_h_hpgl_shaded_pseudocolor 2019 #define _pl_h_parse_pen_string HPGLPlotter::_h_parse_pen_string 2020 #define _pl_h_set_attributes HPGLPlotter::_h_set_attributes 2021 #define _pl_h_set_fill_color HPGLPlotter::_h_set_fill_color 2022 #define _pl_h_set_font HPGLPlotter::_h_set_font 2023 #define _pl_h_set_hpgl_fill_type HPGLPlotter::_h_set_hpgl_fill_type 2024 #define _pl_h_set_hpgl_pen HPGLPlotter::_h_set_hpgl_pen 2025 #define _pl_h_set_hpgl_pen_type HPGLPlotter::_h_set_hpgl_pen_type 2026 #define _pl_h_set_pen_color HPGLPlotter::_h_set_pen_color 2027 #define _pl_h_set_position HPGLPlotter::_h_set_position 2028 /* HPGLPlotter functions (overridden in PCLPlotter class), for libplotter */ 2029 #define _pl_h_maybe_switch_to_hpgl HPGLPlotter::_maybe_switch_to_hpgl 2030 #define _pl_h_maybe_switch_from_hpgl HPGLPlotter::_maybe_switch_from_hpgl 2031 /* PCLPlotter functions (overriding the above), for libplotter */ 2032 #define _pl_q_maybe_switch_to_hpgl PCLPlotter::_maybe_switch_to_hpgl 2033 #define _pl_q_maybe_switch_from_hpgl PCLPlotter::_maybe_switch_from_hpgl 2034 #endif /* LIBPLOTTER */ 2035 2036 #ifndef LIBPLOTTER 2037 ___BEGIN_DECLS 2038 /* FigPlotter protected methods, for libplot */ 2039 extern bool _pl_f_begin_page (Plotter *_plotter); 2040 extern bool _pl_f_end_page (Plotter *_plotter); 2041 extern bool _pl_f_erase_page (Plotter *_plotter); 2042 extern bool _pl_f_paint_paths (Plotter *_plotter); 2043 extern bool _pl_f_retrieve_font (Plotter *_plotter); 2044 extern double _pl_f_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2045 extern void _pl_f_initialize (Plotter *_plotter); 2046 extern void _pl_f_paint_path (Plotter *_plotter); 2047 extern void _pl_f_paint_point (Plotter *_plotter); 2048 extern void _pl_f_terminate (Plotter *_plotter); 2049 /* FigPlotter internal functions, for libplot */ 2050 extern int _pl_f_fig_color (Plotter *_plotter, int red, int green, int blue); 2051 extern void _pl_f_compute_line_style (Plotter *_plotter, int *style, double *spacing); 2052 extern void _pl_f_draw_arc_internal (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); 2053 extern void _pl_f_draw_box_internal (Plotter *_plotter, plPoint p0, plPoint p1); 2054 extern void _pl_f_draw_ellipse_internal (Plotter *_plotter, double x, double y, double rx, double ry, double angle, int subtype); 2055 extern void _pl_f_set_fill_color (Plotter *_plotter); 2056 extern void _pl_f_set_pen_color (Plotter *_plotter); 2057 ___END_DECLS 2058 #else /* LIBPLOTTER */ 2059 /* FigPlotter protected methods, for libplotter */ 2060 #define _pl_f_begin_page FigPlotter::begin_page 2061 #define _pl_f_end_page FigPlotter::end_page 2062 #define _pl_f_erase_page FigPlotter::erase_page 2063 #define _pl_f_paint_text_string FigPlotter::paint_text_string 2064 #define _pl_f_initialize FigPlotter::initialize 2065 #define _pl_f_paint_path FigPlotter::paint_path 2066 #define _pl_f_paint_paths FigPlotter::paint_paths 2067 #define _pl_f_paint_point FigPlotter::paint_point 2068 #define _pl_f_retrieve_font FigPlotter::retrieve_font 2069 #define _pl_f_terminate FigPlotter::terminate 2070 /* FigPlotter internal functions, for libplotter */ 2071 #define _pl_f_compute_line_style FigPlotter::_f_compute_line_style 2072 #define _pl_f_draw_arc_internal FigPlotter::_f_draw_arc_internal 2073 #define _pl_f_draw_box_internal FigPlotter::_f_draw_box_internal 2074 #define _pl_f_draw_ellipse_internal FigPlotter::_f_draw_ellipse_internal 2075 #define _pl_f_fig_color FigPlotter::_f_fig_color 2076 #define _pl_f_set_fill_color FigPlotter::_f_set_fill_color 2077 #define _pl_f_set_pen_color FigPlotter::_f_set_pen_color 2078 #endif /* LIBPLOTTER */ 2079 2080 #ifndef LIBPLOTTER 2081 ___BEGIN_DECLS 2082 /* CGMPlotter protected methods, for libplot */ 2083 extern bool _pl_c_begin_page (Plotter *_plotter); 2084 extern bool _pl_c_end_page (Plotter *_plotter); 2085 extern bool _pl_c_erase_page (Plotter *_plotter); 2086 extern bool _pl_c_paint_marker (Plotter *_plotter, int type, double size); 2087 extern bool _pl_c_paint_paths (Plotter *_plotter); 2088 extern double _pl_c_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2089 extern void _pl_c_initialize (Plotter *_plotter); 2090 extern void _pl_c_paint_path (Plotter *_plotter); 2091 extern void _pl_c_paint_point (Plotter *_plotter); 2092 extern void _pl_c_terminate (Plotter *_plotter); 2093 /* CGMPlotter internal functions, for libplot */ 2094 extern void _pl_c_set_attributes (Plotter *_plotter, int cgm_object_type); 2095 extern void _pl_c_set_bg_color (Plotter *_plotter); 2096 extern void _pl_c_set_fill_color (Plotter *_plotter, int cgm_object_type); 2097 extern void _pl_c_set_pen_color (Plotter *_plotter, int cgm_object_type); 2098 ___END_DECLS 2099 #else /* LIBPLOTTER */ 2100 /* CGMPlotter protected methods, for libplotter */ 2101 #define _pl_c_begin_page CGMPlotter::begin_page 2102 #define _pl_c_end_page CGMPlotter::end_page 2103 #define _pl_c_erase_page CGMPlotter::erase_page 2104 #define _pl_c_paint_text_string CGMPlotter::paint_text_string 2105 #define _pl_c_initialize CGMPlotter::initialize 2106 #define _pl_c_paint_marker CGMPlotter::paint_marker 2107 #define _pl_c_paint_path CGMPlotter::paint_path 2108 #define _pl_c_paint_paths CGMPlotter::paint_paths 2109 #define _pl_c_paint_point CGMPlotter::paint_point 2110 #define _pl_c_terminate CGMPlotter::terminate 2111 /* CGMPlotter internal functions, for libplotter */ 2112 #define _pl_c_set_attributes CGMPlotter::_c_set_attributes 2113 #define _pl_c_set_bg_color CGMPlotter::_c_set_bg_color 2114 #define _pl_c_set_fill_color CGMPlotter::_c_set_fill_color 2115 #define _pl_c_set_pen_color CGMPlotter::_c_set_pen_color 2116 #endif /* LIBPLOTTER */ 2117 2118 #ifndef LIBPLOTTER 2119 ___BEGIN_DECLS 2120 /* PSPlotter protected methods, for libplot */ 2121 extern bool _pl_p_begin_page (Plotter *_plotter); 2122 extern bool _pl_p_end_page (Plotter *_plotter); 2123 extern bool _pl_p_erase_page (Plotter *_plotter); 2124 extern bool _pl_p_paint_paths (Plotter *_plotter); 2125 extern double _pl_p_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2126 extern void _pl_p_initialize (Plotter *_plotter); 2127 extern void _pl_p_paint_path (Plotter *_plotter); 2128 extern void _pl_p_paint_point (Plotter *_plotter); 2129 extern void _pl_p_terminate (Plotter *_plotter); 2130 /* PSPlotter internal functions, for libplot */ 2131 extern double _pl_p_emit_common_attributes (Plotter *_plotter); 2132 extern void _pl_p_compute_idraw_bgcolor (Plotter *_plotter); 2133 extern void _pl_p_fellipse_internal (Plotter *_plotter, double x, double y, double rx, double ry, double angle, bool circlep); 2134 extern void _pl_p_set_fill_color (Plotter *_plotter); 2135 extern void _pl_p_set_pen_color (Plotter *_plotter); 2136 ___END_DECLS 2137 #else /* LIBPLOTTER */ 2138 /* PSPlotter protected methods, for libplotter */ 2139 #define _pl_p_begin_page PSPlotter::begin_page 2140 #define _pl_p_end_page PSPlotter::end_page 2141 #define _pl_p_erase_page PSPlotter::erase_page 2142 #define _pl_p_paint_text_string PSPlotter::paint_text_string 2143 #define _pl_p_initialize PSPlotter::initialize 2144 #define _pl_p_paint_path PSPlotter::paint_path 2145 #define _pl_p_paint_paths PSPlotter::paint_paths 2146 #define _pl_p_paint_point PSPlotter::paint_point 2147 #define _pl_p_terminate PSPlotter::terminate 2148 /* PSPlotter internal functions, for libplotter */ 2149 #define _pl_p_compute_idraw_bgcolor PSPlotter::_p_compute_idraw_bgcolor 2150 #define _pl_p_emit_common_attributes PSPlotter::_p_emit_common_attributes 2151 #define _pl_p_fellipse_internal PSPlotter::_p_fellipse_internal 2152 #define _pl_p_set_fill_color PSPlotter::_p_set_fill_color 2153 #define _pl_p_set_pen_color PSPlotter::_p_set_pen_color 2154 #endif /* LIBPLOTTER */ 2155 2156 #ifndef LIBPLOTTER 2157 ___BEGIN_DECLS 2158 /* AIPlotter protected methods, for libplot */ 2159 extern bool _pl_a_begin_page (Plotter *_plotter); 2160 extern bool _pl_a_end_page (Plotter *_plotter); 2161 extern bool _pl_a_erase_page (Plotter *_plotter); 2162 extern bool _pl_a_paint_paths (Plotter *_plotter); 2163 extern double _pl_a_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2164 extern void _pl_a_initialize (Plotter *_plotter); 2165 extern void _pl_a_paint_path (Plotter *_plotter); 2166 extern void _pl_a_paint_point (Plotter *_plotter); 2167 extern void _pl_a_terminate (Plotter *_plotter); 2168 /* AIPlotter internal functions, for libplot */ 2169 extern void _pl_a_set_attributes (Plotter *_plotter); 2170 extern void _pl_a_set_fill_color (Plotter *_plotter, bool force_pen_color); 2171 extern void _pl_a_set_pen_color (Plotter *_plotter); 2172 ___END_DECLS 2173 #else /* LIBPLOTTER */ 2174 /* AIPlotter protected methods, for libplotter */ 2175 #define _pl_a_begin_page AIPlotter::begin_page 2176 #define _pl_a_end_page AIPlotter::end_page 2177 #define _pl_a_erase_page AIPlotter::erase_page 2178 #define _pl_a_paint_text_string AIPlotter::paint_text_string 2179 #define _pl_a_initialize AIPlotter::initialize 2180 #define _pl_a_paint_path AIPlotter::paint_path 2181 #define _pl_a_paint_paths AIPlotter::paint_paths 2182 #define _pl_a_paint_point AIPlotter::paint_point 2183 #define _pl_a_terminate AIPlotter::terminate 2184 /* AIPlotter internal functions, for libplotter */ 2185 #define _pl_a_set_attributes AIPlotter::_a_set_attributes 2186 #define _pl_a_set_fill_color AIPlotter::_a_set_fill_color 2187 #define _pl_a_set_pen_color AIPlotter::_a_set_pen_color 2188 #endif /* LIBPLOTTER */ 2189 2190 #ifndef LIBPLOTTER 2191 ___BEGIN_DECLS 2192 /* SVGPlotter protected methods, for libplot */ 2193 extern bool _pl_s_begin_page (Plotter *_plotter); 2194 extern bool _pl_s_end_page (Plotter *_plotter); 2195 extern bool _pl_s_erase_page (Plotter *_plotter); 2196 extern bool _pl_s_paint_paths (Plotter *_plotter); 2197 extern double _pl_s_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2198 extern void _pl_s_initialize (Plotter *_plotter); 2199 extern void _pl_s_paint_path (Plotter *_plotter); 2200 extern void _pl_s_paint_point (Plotter *_plotter); 2201 extern void _pl_s_terminate (Plotter *_plotter); 2202 /* PSPlotter internal functions, for libplot */ 2203 extern void _pl_s_set_matrix (Plotter *_plotter, const double m_local[6]); 2204 ___END_DECLS 2205 #else /* LIBPLOTTER */ 2206 /* SVGPlotter protected methods, for libplotter */ 2207 #define _pl_s_begin_page SVGPlotter::begin_page 2208 #define _pl_s_end_page SVGPlotter::end_page 2209 #define _pl_s_erase_page SVGPlotter::erase_page 2210 #define _pl_s_paint_text_string SVGPlotter::paint_text_string 2211 #define _pl_s_initialize SVGPlotter::initialize 2212 #define _pl_s_paint_path SVGPlotter::paint_path 2213 #define _pl_s_paint_paths SVGPlotter::paint_paths 2214 #define _pl_s_paint_point SVGPlotter::paint_point 2215 #define _pl_s_terminate SVGPlotter::terminate 2216 /* SVGPlotter internal functions, for libplotter */ 2217 #define _pl_s_set_matrix SVGPlotter::_s_set_matrix 2218 #endif /* LIBPLOTTER */ 2219 2220 #ifndef LIBPLOTTER 2221 ___BEGIN_DECLS 2222 /* PNMPlotter protected methods, for libplot */ 2223 extern void _pl_n_initialize (Plotter *_plotter); 2224 extern void _pl_n_terminate (Plotter *_plotter); 2225 /* PNMPlotter internal functions (which override BitmapPlotter functions) */ 2226 extern int _pl_n_maybe_output_image (Plotter *_plotter); 2227 /* other PNMPlotter internal functions, for libplot */ 2228 extern void _pl_n_write_pnm (Plotter *_plotter); 2229 extern void _pl_n_write_pbm (Plotter *_plotter); 2230 extern void _pl_n_write_pgm (Plotter *_plotter); 2231 extern void _pl_n_write_ppm (Plotter *_plotter); 2232 ___END_DECLS 2233 #else /* LIBPLOTTER */ 2234 /* PNMPlotter protected methods, for libplotter */ 2235 #define _pl_n_initialize PNMPlotter::initialize 2236 #define _pl_n_terminate PNMPlotter::terminate 2237 /* PNMPlotter internal methods (which override BitmapPlotter methods) */ 2238 #define _pl_n_maybe_output_image PNMPlotter::_maybe_output_image 2239 /* other PNMPlotter internal functions, for libplotter */ 2240 #define _pl_n_write_pnm PNMPlotter::_n_write_pnm 2241 #define _pl_n_write_pbm PNMPlotter::_n_write_pbm 2242 #define _pl_n_write_pgm PNMPlotter::_n_write_pgm 2243 #define _pl_n_write_ppm PNMPlotter::_n_write_ppm 2244 #endif /* LIBPLOTTER */ 2245 2246 #ifdef INCLUDE_PNG_SUPPORT 2247 #ifndef LIBPLOTTER 2248 ___BEGIN_DECLS 2249 /* PNGPlotter protected methods, for libplot */ 2250 extern void _pl_z_initialize (Plotter *_plotter); 2251 extern void _pl_z_terminate (Plotter *_plotter); 2252 /* PNGPlotter internal functions (which override BitmapPlotter functions) */ 2253 extern int _pl_z_maybe_output_image (Plotter *_plotter); 2254 ___END_DECLS 2255 #else /* LIBPLOTTER */ 2256 /* PNGPlotter protected methods, for libplotter */ 2257 #define _pl_z_initialize PNGPlotter::initialize 2258 #define _pl_z_terminate PNGPlotter::terminate 2259 /* PNGPlotter internal methods (which override BitmapPlotter methods) */ 2260 #define _pl_z_maybe_output_image PNGPlotter::_maybe_output_image 2261 #endif /* LIBPLOTTER */ 2262 #endif /* INCLUDE_PNG_SUPPORT */ 2263 2264 #ifndef LIBPLOTTER 2265 ___BEGIN_DECLS 2266 /* GIFPlotter protected methods, for libplot */ 2267 extern bool _pl_i_begin_page (Plotter *_plotter); 2268 extern bool _pl_i_end_page (Plotter *_plotter); 2269 extern bool _pl_i_erase_page (Plotter *_plotter); 2270 extern bool _pl_i_paint_paths (Plotter *_plotter); 2271 extern void _pl_i_initialize (Plotter *_plotter); 2272 extern void _pl_i_paint_path (Plotter *_plotter); 2273 extern void _pl_i_paint_point (Plotter *_plotter); 2274 extern void _pl_i_terminate (Plotter *_plotter); 2275 /* GIFPlotter internal functions, for libplot */ 2276 extern int _pl_i_scan_pixel (Plotter *_plotter); 2277 extern unsigned char _pl_i_new_color_index (Plotter *_plotter, int red, int green, int blue); 2278 extern void _pl_i_delete_image (Plotter *_plotter); 2279 extern void _pl_i_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 2280 extern void _pl_i_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 2281 extern void _pl_i_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); 2282 extern void _pl_i_new_image (Plotter *_plotter); 2283 extern void _pl_i_set_bg_color (Plotter *_plotter); 2284 extern void _pl_i_set_fill_color (Plotter *_plotter); 2285 extern void _pl_i_set_pen_color (Plotter *_plotter); 2286 extern void _pl_i_start_scan (Plotter *_plotter); 2287 extern void _pl_i_write_gif_header (Plotter *_plotter); 2288 extern void _pl_i_write_gif_image (Plotter *_plotter); 2289 extern void _pl_i_write_gif_trailer (Plotter *_plotter); 2290 extern void _pl_i_write_short_int (Plotter *_plotter, unsigned int i); 2291 ___END_DECLS 2292 #else /* LIBPLOTTER */ 2293 /* GIFPlotter protected methods, for libplotter */ 2294 #define _pl_i_begin_page GIFPlotter::begin_page 2295 #define _pl_i_end_page GIFPlotter::end_page 2296 #define _pl_i_erase_page GIFPlotter::erase_page 2297 #define _pl_i_initialize GIFPlotter::initialize 2298 #define _pl_i_paint_path GIFPlotter::paint_path 2299 #define _pl_i_paint_paths GIFPlotter::paint_paths 2300 #define _pl_i_paint_point GIFPlotter::paint_point 2301 #define _pl_i_terminate GIFPlotter::terminate 2302 /* GIFPlotter internal functions, for libplotter */ 2303 #define _pl_i_scan_pixel GIFPlotter::_i_scan_pixel 2304 #define _pl_i_new_color_index GIFPlotter::_i_new_color_index 2305 #define _pl_i_delete_image GIFPlotter::_i_delete_image 2306 #define _pl_i_draw_elliptic_arc GIFPlotter::_i_draw_elliptic_arc 2307 #define _pl_i_draw_elliptic_arc_2 GIFPlotter::_i_draw_elliptic_arc_2 2308 #define _pl_i_draw_elliptic_arc_internal GIFPlotter::_i_draw_elliptic_arc_internal 2309 #define _pl_i_new_image GIFPlotter::_i_new_image 2310 #define _pl_i_set_bg_color GIFPlotter::_i_set_bg_color 2311 #define _pl_i_set_fill_color GIFPlotter::_i_set_fill_color 2312 #define _pl_i_set_pen_color GIFPlotter::_i_set_pen_color 2313 #define _pl_i_start_scan GIFPlotter::_i_start_scan 2314 #define _pl_i_write_gif_header GIFPlotter::_i_write_gif_header 2315 #define _pl_i_write_gif_image GIFPlotter::_i_write_gif_image 2316 #define _pl_i_write_gif_trailer GIFPlotter::_i_write_gif_trailer 2317 #define _pl_i_write_short_int GIFPlotter::_i_write_short_int 2318 #endif /* LIBPLOTTER */ 2319 2320 #ifndef X_DISPLAY_MISSING 2321 #ifndef LIBPLOTTER 2322 ___BEGIN_DECLS 2323 /* XDrawablePlotter/XPlotter protected methods, for libplot */ 2324 extern bool _pl_x_begin_page (Plotter *_plotter); 2325 extern bool _pl_x_end_page (Plotter *_plotter); 2326 extern bool _pl_x_erase_page (Plotter *_plotter); 2327 extern bool _pl_x_flush_output (Plotter *_plotter); 2328 extern bool _pl_x_paint_paths (Plotter *_plotter); 2329 extern bool _pl_x_path_is_flushable (Plotter *_plotter); 2330 extern bool _pl_x_retrieve_font (Plotter *_plotter); 2331 extern double _pl_x_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); 2332 extern double _pl_x_get_text_width (Plotter *_plotter, const unsigned char *s); 2333 extern void _pl_x_initialize (Plotter *_plotter); 2334 extern void _pl_x_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); 2335 extern void _pl_x_paint_path (Plotter *_plotter); 2336 extern void _pl_x_paint_point (Plotter *_plotter); 2337 extern void _pl_x_pop_state (Plotter *_plotter); 2338 extern void _pl_x_push_state (Plotter *_plotter); 2339 extern void _pl_x_terminate (Plotter *_plotter); 2340 /* XDrawablePlotter/XPlotter internal functions, for libplot */ 2341 extern bool _pl_x_retrieve_color (Plotter *_plotter, XColor *rgb_ptr); 2342 extern bool _pl_x_select_font_carefully (Plotter *_plotter, const char *name, const unsigned char *s, bool subsetting); 2343 extern bool _pl_x_select_xlfd_font_carefully (Plotter *_plotter, const char *x_name, const char *x_name_alt, const char *x_name_alt2, const char *x_name_alt3); 2344 extern void _pl_x_add_gcs_to_first_drawing_state (Plotter *_plotter); 2345 extern void _pl_x_delete_gcs_from_first_drawing_state (Plotter *_plotter); 2346 extern void _pl_x_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 2347 extern void _pl_x_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); 2348 extern void _pl_x_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); 2349 extern void _pl_x_set_attributes (Plotter *_plotter, int x_gc_type); 2350 extern void _pl_x_set_bg_color (Plotter *_plotter); 2351 extern void _pl_x_set_fill_color (Plotter *_plotter); 2352 extern void _pl_x_set_pen_color (Plotter *_plotter); 2353 /* XDrawablePlotter internal functions, for libplot */ 2354 extern void _pl_x_maybe_get_new_colormap (Plotter *_plotter); 2355 extern void _pl_x_maybe_handle_x_events (Plotter *_plotter); 2356 /* XPlotter protected methods, for libplot */ 2357 extern bool _pl_y_begin_page (Plotter *_plotter); 2358 extern bool _pl_y_end_page (Plotter *_plotter); 2359 extern bool _pl_y_erase_page (Plotter *_plotter); 2360 extern void _pl_y_initialize (Plotter *_plotter); 2361 extern void _pl_y_terminate (Plotter *_plotter); 2362 /* XPlotter internal functions, for libplot */ 2363 extern void _pl_y_flush_plotter_outstreams (Plotter *_plotter); 2364 extern void _pl_y_maybe_get_new_colormap (Plotter *_plotter); 2365 extern void _pl_y_maybe_handle_x_events (Plotter *_plotter); 2366 extern void _pl_y_set_data_for_quitting (Plotter *_plotter); 2367 ___END_DECLS 2368 #else /* LIBPLOTTER */ 2369 /* XDrawablePlotter/XPlotter protected methods, for libplotter */ 2370 #define _pl_x_begin_page XDrawablePlotter::begin_page 2371 #define _pl_x_end_page XDrawablePlotter::end_page 2372 #define _pl_x_erase_page XDrawablePlotter::erase_page 2373 #define _pl_x_paint_text_string XDrawablePlotter::paint_text_string 2374 #define _pl_x_get_text_width XDrawablePlotter::get_text_width 2375 #define _pl_x_flush_output XDrawablePlotter::flush_output 2376 #define _pl_x_path_is_flushable XDrawablePlotter::path_is_flushable 2377 #define _pl_x_maybe_prepaint_segments XDrawablePlotter::maybe_prepaint_segments 2378 #define _pl_x_paint_path XDrawablePlotter::paint_path 2379 #define _pl_x_paint_paths XDrawablePlotter::paint_paths 2380 #define _pl_x_paint_point XDrawablePlotter::paint_point 2381 #define _pl_x_pop_state XDrawablePlotter::pop_state 2382 #define _pl_x_push_state XDrawablePlotter::push_state 2383 #define _pl_x_retrieve_font XDrawablePlotter::retrieve_font 2384 /* XDrawablePlotter protected methods (overridden in XPlotter class) */ 2385 #define _pl_x_initialize XDrawablePlotter::initialize 2386 #define _pl_x_terminate XDrawablePlotter::terminate 2387 /* XPlotter protected methods (which override the preceding) */ 2388 #define _pl_y_begin_page XPlotter::begin_page 2389 #define _pl_y_end_page XPlotter::end_page 2390 #define _pl_y_erase_page XPlotter::erase_page 2391 #define _pl_y_initialize XPlotter::initialize 2392 #define _pl_y_terminate XPlotter::terminate 2393 /* XDrawablePlotter/XPlotter internal functions, for libplotter */ 2394 #define _pl_x_add_gcs_to_first_drawing_state XDrawablePlotter::_x_add_gcs_to_first_drawing_state 2395 #define _pl_x_delete_gcs_from_first_drawing_state XDrawablePlotter::_x_delete_gcs_from_first_drawing_state 2396 #define _pl_x_draw_elliptic_arc XDrawablePlotter::_x_draw_elliptic_arc 2397 #define _pl_x_draw_elliptic_arc_2 XDrawablePlotter::_x_draw_elliptic_arc_2 2398 #define _pl_x_draw_elliptic_arc_internal XDrawablePlotter::_x_draw_elliptic_arc_internal 2399 #define _pl_x_retrieve_color XDrawablePlotter::_x_retrieve_color 2400 #define _pl_x_select_font XDrawablePlotter::_x_select_font 2401 #define _pl_x_select_font_carefully XDrawablePlotter::_x_select_font_carefully 2402 #define _pl_x_select_xlfd_font_carefully XDrawablePlotter::_x_select_xlfd_font_carefully 2403 #define _pl_x_set_attributes XDrawablePlotter::_x_set_attributes 2404 #define _pl_x_set_bg_color XDrawablePlotter::_x_set_bg_color 2405 #define _pl_x_set_fill_color XDrawablePlotter::_x_set_fill_color 2406 #define _pl_x_set_font_dimensions XDrawablePlotter::_x_set_font_dimensions 2407 #define _pl_x_set_pen_color XDrawablePlotter::_x_set_pen_color 2408 /* XDrawablePlotter internal functions (overridden in XPlotter class) */ 2409 #define _pl_x_maybe_get_new_colormap XDrawablePlotter::_maybe_get_new_colormap 2410 #define _pl_x_maybe_handle_x_events XDrawablePlotter::_maybe_handle_x_events 2411 /* XPlotter internal functions (which override the preceding) */ 2412 #define _pl_y_maybe_get_new_colormap XPlotter::_maybe_get_new_colormap 2413 #define _pl_y_maybe_handle_x_events XPlotter::_maybe_handle_x_events 2414 /* other XPlotter internal functions, for libplotter */ 2415 #define _pl_y_flush_plotter_outstreams XPlotter::_y_flush_plotter_outstreams 2416 #define _pl_y_set_data_for_quitting XPlotter::_y_set_data_for_quitting 2417 #endif /* LIBPLOTTER */ 2418 #endif /* not X_DISPLAY_MISSING */ 2419 2420 /* Declarations of the PlotterParams methods. In libplot, these are 2421 declarations of global functions. But in libplotter, we use #define and 2422 the double colon notation to make them function members of the 2423 PlotterParams class. 2424 2425 The ___BEGIN_DECLS...___END_DECLS is to support compilation of libplot 2426 by a C++ compiler; see the remarks above. */ 2427 2428 #ifndef LIBPLOTTER 2429 ___BEGIN_DECLS 2430 /* PlotterParams public methods, for libplot */ 2431 extern int _setplparam (PlotterParams *_plotter_params, const char *parameter, void * value); 2432 extern int _pushplparams (PlotterParams *_plotter_params); 2433 extern int _popplparams (PlotterParams *_plotter_params); 2434 ___END_DECLS 2435 #else /* LIBPLOTTER */ 2436 /* PlotterParams public methods, for libplotter */ 2437 #define _setplparam PlotterParams::setplparam 2438 #define _pushplparams PlotterParams::pushplparams 2439 #define _popplparams PlotterParams::popplparams 2440 #endif /* LIBPLOTTER */ 2441