123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- #include "sys-defines.h"
- #include "extern.h"
- #ifndef LIBPLOTTER
- const Plotter _pl_a_default_plotter =
- {
-
- _pl_a_initialize, _pl_a_terminate,
-
- _pl_a_begin_page, _pl_a_erase_page, _pl_a_end_page,
-
- _pl_g_push_state, _pl_g_pop_state,
-
- _pl_a_paint_path, _pl_a_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments,
-
- _pl_g_paint_marker, _pl_a_paint_point,
-
- _pl_g_paint_text_string_with_escapes, _pl_a_paint_text_string,
- _pl_g_get_text_width,
-
- _pl_g_retrieve_font,
-
- _pl_g_flush_output,
-
- _pl_g_warning,
- _pl_g_error,
- };
- #endif
- void
- _pl_a_initialize (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_g_initialize (S___(_plotter));
- #endif
-
- #ifndef LIBPLOTTER
-
- _plotter->data->type = PL_AI;
- #endif
-
- _plotter->data->output_model = PL_OUTPUT_ONE_PAGE;
-
- _plotter->data->have_wide_lines = 1;
- _plotter->data->have_dash_array = 1;
- _plotter->data->have_solid_fill = 1;
- _plotter->data->have_odd_winding_fill = 1;
- _plotter->data->have_nonzero_winding_fill = 1;
- _plotter->data->have_settable_bg = 0;
- _plotter->data->have_escaped_string_support = 0;
- _plotter->data->have_ps_fonts = 1;
- _plotter->data->have_pcl_fonts = 1;
- _plotter->data->have_stick_fonts = 0;
- _plotter->data->have_extra_stick_fonts = 0;
- _plotter->data->have_other_fonts = 0;
-
- _plotter->data->default_font_type = PL_F_POSTSCRIPT;
- _plotter->data->pcl_before_ps = false;
- _plotter->data->issue_font_warning = true;
- _plotter->data->have_horizontal_justification = true;
- _plotter->data->have_vertical_justification = false;
-
- _plotter->data->have_mixed_paths = true;
- _plotter->data->allowed_arc_scaling = AS_NONE;
- _plotter->data->allowed_ellarc_scaling = AS_NONE;
- _plotter->data->allowed_quad_scaling = AS_NONE;
- _plotter->data->allowed_cubic_scaling = AS_ANY;
- _plotter->data->allowed_box_scaling = AS_NONE;
- _plotter->data->allowed_circle_scaling = AS_NONE;
- _plotter->data->allowed_ellipse_scaling = AS_NONE;
-
- _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL;
- _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL;
- _plotter->data->flipped_y = false;
- _plotter->data->imin = 0;
- _plotter->data->imax = 0;
- _plotter->data->jmin = 0;
- _plotter->data->jmax = 0;
- _plotter->data->xmin = 0.0;
- _plotter->data->xmax = 0.0;
- _plotter->data->ymin = 0.0;
- _plotter->data->ymax = 0.0;
- _plotter->data->page_data = (plPageData *)NULL;
-
- _plotter->ai_version = AI_VERSION_5;
- _plotter->ai_pen_cyan = 0.0;
- _plotter->ai_pen_magenta = 0.0;
- _plotter->ai_pen_yellow = 0.0;
- _plotter->ai_pen_black = 1.0;
- _plotter->ai_fill_cyan = 0.0;
- _plotter->ai_fill_magenta = 0.0;
- _plotter->ai_fill_yellow = 0.0;
- _plotter->ai_fill_black = 1.0;
- _plotter->ai_cyan_used = false;
- _plotter->ai_magenta_used = false;
- _plotter->ai_yellow_used = false;
- _plotter->ai_black_used = false;
- _plotter->ai_cap_style = AI_LINE_CAP_BUTT;
- _plotter->ai_join_style = AI_LINE_JOIN_MITER;
- _plotter->ai_miter_limit = 4.0;
- _plotter->ai_line_type = PL_L_SOLID;
- _plotter->ai_line_width = 1.0;
- _plotter->ai_fill_rule_type = 0;
-
-
- {
- const char *version_s;
-
- version_s = (const char *)_get_plot_param (_plotter->data, "AI_VERSION");
- if (strcmp (version_s, "3") == 0)
- _plotter->ai_version = AI_VERSION_3;
- else if (strcmp (version_s, "5") == 0)
- _plotter->ai_version = AI_VERSION_5;
- else
- {
- version_s = (const char *)_get_default_plot_param ("AI_VERSION");
- if (strcmp (version_s, "3") == 0)
- _plotter->ai_version = AI_VERSION_3;
- else if (strcmp (version_s, "5") == 0)
- _plotter->ai_version = AI_VERSION_5;
- }
- }
-
- if (_plotter->ai_version == AI_VERSION_3)
- _plotter->data->have_odd_winding_fill = 0;
-
- {
-
- _set_page_type (_plotter->data);
-
-
- _plotter->data->xmin = 72 * (_plotter->data->viewport_xorigin
- + _plotter->data->viewport_xoffset);
- _plotter->data->xmax = 72 * (_plotter->data->viewport_xorigin
- + _plotter->data->viewport_xoffset
- + _plotter->data->viewport_xsize);
- _plotter->data->ymin = 72 * (_plotter->data->viewport_yorigin
- + _plotter->data->viewport_yoffset);
- _plotter->data->ymax = 72 * (_plotter->data->viewport_yorigin
- + _plotter->data->viewport_yoffset
- + _plotter->data->viewport_ysize);
- }
-
- _compute_ndc_to_device_map (_plotter->data);
- }
- void
- _pl_a_terminate (S___(Plotter *_plotter))
- {
- #ifndef LIBPLOTTER
-
- _pl_g_terminate (S___(_plotter));
- #endif
- }
- #ifdef LIBPLOTTER
- AIPlotter::AIPlotter (FILE *infile, FILE *outfile, FILE *errfile)
- :Plotter (infile, outfile, errfile)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (FILE *outfile)
- :Plotter (outfile)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (istream& in, ostream& out, ostream& err)
- : Plotter (in, out, err)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (ostream& out)
- : Plotter (out)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter ()
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters)
- :Plotter (infile, outfile, errfile, parameters)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (FILE *outfile, PlotterParams ¶meters)
- :Plotter (outfile, parameters)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters)
- : Plotter (in, out, err, parameters)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (ostream& out, PlotterParams ¶meters)
- : Plotter (out, parameters)
- {
- _pl_a_initialize ();
- }
- AIPlotter::AIPlotter (PlotterParams ¶meters)
- : Plotter (parameters)
- {
- _pl_a_initialize ();
- }
- AIPlotter::~AIPlotter ()
- {
-
- if (_plotter->data->open)
- _API_closepl ();
- _pl_a_terminate ();
- }
- #endif
|