1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
/* This version is for CGM Plotters, which graphics only after all pages of
graphics have been drawn, and the Plotter is deleted. */
#include "sys-defines.h"
#include "extern.h"
bool
#ifdef _HAVE_PROTOS
_c_begin_page (S___(Plotter *_plotter))
#else
_c_begin_page (S___(_plotter))
S___(Plotter *_plotter;)
#endif
{
int i;
/* CGM Plotters use the `extra' field of their single plOutbuf (a void
pointer; it points to the head of a linked list of user-defined line
types for the page) */
_plotter->data->page->extra = (voidptr_t)NULL;
/* initialize `font used' array(s) for this page */
for (i = 0; i < NUM_PS_FONTS; i++)
_plotter->data->page->ps_font_used[i] = false;
/* reset page-specific, i.e. picture-specific, dynamic variables */
_plotter->cgm_page_version = 1;
_plotter->cgm_page_profile = CGM_PROFILE_WEB;
_plotter->cgm_page_need_color = false;
/* colors */
_plotter->cgm_line_color.red = -1;
_plotter->cgm_line_color.green = -1;
_plotter->cgm_line_color.blue = -1;
_plotter->cgm_edge_color.red = -1;
_plotter->cgm_edge_color.green = -1;
_plotter->cgm_edge_color.blue = -1;
_plotter->cgm_fillcolor.red = -1;
_plotter->cgm_fillcolor.green = -1;
_plotter->cgm_fillcolor.blue = -1;
_plotter->cgm_marker_color.red = -1;
_plotter->cgm_marker_color.green = -1;
_plotter->cgm_marker_color.blue = -1;
_plotter->cgm_text_color.red = -1;
_plotter->cgm_text_color.green = -1;
_plotter->cgm_text_color.blue = -1;
_plotter->cgm_bgcolor.red = -1;
_plotter->cgm_bgcolor.green = -1;
_plotter->cgm_bgcolor.blue = -1;
/* other dynamic variables */
_plotter->cgm_line_type = CGM_L_SOLID;
_plotter->cgm_dash_offset = 0.0;
_plotter->cgm_join_style = CGM_JOIN_UNSPEC;
_plotter->cgm_cap_style = CGM_CAP_UNSPEC;
_plotter->cgm_dash_cap_style = CGM_CAP_UNSPEC;
/* CGM's default line width: 1/1000 times the max VDC dimension */
_plotter->cgm_line_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500;
_plotter->cgm_interior_style = CGM_INT_STYLE_HOLLOW;
_plotter->cgm_edge_type = CGM_L_SOLID;
_plotter->cgm_edge_dash_offset = 0.0;
_plotter->cgm_edge_join_style = CGM_JOIN_UNSPEC;
_plotter->cgm_edge_cap_style = CGM_CAP_UNSPEC;
_plotter->cgm_edge_dash_cap_style = CGM_CAP_UNSPEC;
/* CGM's default edge width: 1/1000 times the max VDC dimension */
_plotter->cgm_edge_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500;
_plotter->cgm_edge_is_visible = false;
_plotter->cgm_miter_limit = 32767.0;
_plotter->cgm_marker_type = CGM_M_ASTERISK;
/* CGM's default marker size: 1/1000 times the max VDC dimension */
_plotter->cgm_marker_size = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) /500;
/* label-related variables */
_plotter->cgm_char_height = -1; /* impossible (dummy) value */
_plotter->cgm_char_base_vector_x = 1;
_plotter->cgm_char_base_vector_y = 0;
_plotter->cgm_char_up_vector_x = 0;
_plotter->cgm_char_up_vector_y = 1;
_plotter->cgm_horizontal_text_alignment = CGM_ALIGN_NORMAL_HORIZONTAL;
_plotter->cgm_vertical_text_alignment = CGM_ALIGN_NORMAL_VERTICAL;
_plotter->cgm_font_id = -1; /* impossible (dummy) value */
_plotter->cgm_charset_lower = 0; /* dummy value (we use values 1..4) */
_plotter->cgm_charset_upper = 0; /* dummy value (we use values 1..4) */
_plotter->cgm_restricted_text_type = CGM_RESTRICTED_TEXT_TYPE_BASIC;
/* copy background color to the CGM-specific part of the CGMPlotter;
it'll be written to the output file at the head of the picture */
_c_set_bg_color (S___(_plotter));
return true;
}
|