extern.h 114 KB

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