summaryrefslogtreecommitdiff
path: root/pcl/pgstate.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-19 23:49:56 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-19 23:49:56 +0200
commit781969994b5381ba4bed03beef217f9bde6e7c58 (patch)
treeaede27c7532f0fbe82f03dc0c04c9316be510fd5 /pcl/pgstate.h
parent0b17959f31afe3baffbc328e7f92e88e634ad8b8 (diff)
Indent with spaces and strip trailing whitespace.
Diffstat (limited to 'pcl/pgstate.h')
-rw-r--r--pcl/pgstate.h332
1 files changed, 166 insertions, 166 deletions
diff --git a/pcl/pgstate.h b/pcl/pgstate.h
index 4dbce5f7c..419cca0a9 100644
--- a/pcl/pgstate.h
+++ b/pcl/pgstate.h
@@ -21,7 +21,7 @@
#ifndef pgstate_INCLUDED
#define pgstate_INCLUDED
-/*
+/*
* HPGL/2 coordinates are internally represented in plotter units
* 1/1024" when scaling is off and user units when scaling is in
* effect. The data structure g.pos maintains the coordinates in the
@@ -63,7 +63,7 @@ typedef struct hpgl_line_type_s {
} hpgl_line_type_t;
typedef struct hpgl_path_state_s {
- gx_path path;
+ gx_path path;
} hpgl_path_state_t;
/* Define rendering modes - character, polygon, or vector.
@@ -71,33 +71,33 @@ typedef struct hpgl_path_state_s {
hpgl_set_graphics_line_attribute_state) and whether we use
stroke or fill on the path. */
typedef enum {
- hpgl_rm_vector,
- hpgl_rm_vector_no_close,
- hpgl_rm_character,
- hpgl_rm_polygon,
- hpgl_rm_vector_fill,
- hpgl_rm_clip_and_fill_polygon, /* for hpgl/2 line type filling */
- hpgl_rm_nop /* don't do anything with the path. future use */
+ hpgl_rm_vector,
+ hpgl_rm_vector_no_close,
+ hpgl_rm_character,
+ hpgl_rm_polygon,
+ hpgl_rm_vector_fill,
+ hpgl_rm_clip_and_fill_polygon, /* for hpgl/2 line type filling */
+ hpgl_rm_nop /* don't do anything with the path. future use */
} hpgl_rendering_mode_t;
/* state of lost mode */
typedef enum {
- hpgl_lost_mode_entered,
- hpgl_lost_mode_cleared
+ hpgl_lost_mode_entered,
+ hpgl_lost_mode_cleared
} hpgl_lost_mode_t;
typedef enum {
- hpgl_even_odd_rule,
- hpgl_winding_number_rule
+ hpgl_even_odd_rule,
+ hpgl_winding_number_rule
} hpgl_render_fill_type_t;
/* Define the structure for saving the pen state temporarily. */
/* HAS: note don't mix and match save a restores. perhaps there
should be a type check field in the structure. */
typedef struct hpgl_pen_state_s {
- int relative_coords;
- int move_or_draw;
- gs_point pos;
+ int relative_coords;
+ int move_or_draw;
+ gs_point pos;
} hpgl_pen_state_t;
/* Define the parameters for GL hatch/cross-hatch fill types. */
@@ -129,190 +129,190 @@ typedef enum {
gs_moveto, gs_rmoveto, gs_lineto, gs_rlineto
typedef struct pcl_hpgl_state_s {
- /* Chapter 17 lost mode (pgmisc.c) */
-
- /* According to PCLTRM IN, PG, RP and PA with args in range clears
- lost mode. Note that all these commands have PA with valid args
- as a side effect so only PA needs to clear lost mode. */
+ /* Chapter 17 lost mode (pgmisc.c) */
+
+ /* According to PCLTRM IN, PG, RP and PA with args in range clears
+ lost mode. Note that all these commands have PA with valid args
+ as a side effect so only PA needs to clear lost mode. */
- hpgl_lost_mode_t lost_mode;
+ hpgl_lost_mode_t lost_mode;
- /* Chapter 18 (pgframe.c) */
+ /* Chapter 18 (pgframe.c) */
- struct pf_ {
- coord_point_t size;
- coord_point_t anchor_point;
- } picture_frame;
+ struct pf_ {
+ coord_point_t size;
+ coord_point_t anchor_point;
+ } picture_frame;
#define picture_frame_width picture_frame.size.x
#define picture_frame_height picture_frame.size.y
- coord_point_t plot_size;
+ coord_point_t plot_size;
#define plot_width plot_size.x
#define plot_height plot_size.y
bool plot_size_vertical_specified;
bool plot_size_horizontal_specified;
- /* Chapter 19 (pgconfig.c) */
-
- enum {
- hpgl_scaling_none = -1,
- hpgl_scaling_anisotropic = 0,
- hpgl_scaling_isotropic = 1,
- hpgl_scaling_point_factor = 2
- } scaling_type;
- hpgl_scaling_params_t scaling_params;
- struct soft_clip_window_ {
+ /* Chapter 19 (pgconfig.c) */
+
+ enum {
+ hpgl_scaling_none = -1,
+ hpgl_scaling_anisotropic = 0,
+ hpgl_scaling_isotropic = 1,
+ hpgl_scaling_point_factor = 2
+ } scaling_type;
+ hpgl_scaling_params_t scaling_params;
+ struct soft_clip_window_ {
bool active; /* current unit window has be given,
if not use picture frame */
bool isbound; /* bound to plotter units */
- gs_rect rect; /* clipping window (IW) */
- } soft_clip_window;
- int rotation;
- gs_point P1, P2; /* in plotter units */
-
- /* Chapter 20 (pgvector.c) */
-
- int move_or_draw; /* hpgl_plot_move/draw */
- int relative_coords; /* hpgl_plot_absolute/relative */
+ gs_rect rect; /* clipping window (IW) */
+ } soft_clip_window;
+ int rotation;
+ gs_point P1, P2; /* in plotter units */
+
+ /* Chapter 20 (pgvector.c) */
+
+ int move_or_draw; /* hpgl_plot_move/draw */
+ int relative_coords; /* hpgl_plot_absolute/relative */
gs_point pos;
/* used to track the line drawing state in hpgl */
gs_point first_point;
- /* Chapter 21 (pgpoly.c) */
- struct polygon_ {
- hpgl_path_state_t buffer; /* path for polygon buffer */
- hpgl_pen_state_t pen_state; /* save pen state during polygon mode */
- } polygon;
- bool polygon_mode;
-
- /* Chapter 22 (pglfill.c) */
-
- struct lp_ {
- struct ltl_ {
- int type;
- /* the offset value is not required by the gl/2
+ /* Chapter 21 (pgpoly.c) */
+ struct polygon_ {
+ hpgl_path_state_t buffer; /* path for polygon buffer */
+ hpgl_pen_state_t pen_state; /* save pen state during polygon mode */
+ } polygon;
+ bool polygon_mode;
+
+ /* Chapter 22 (pglfill.c) */
+
+ struct lp_ {
+ struct ltl_ {
+ int type;
+ /* the offset value is not required by the gl/2
language, however we use it to implement offsetting
line patterns for hpgl/2 vector fills */
float pattern_offset;
- float pattern_length;
- bool pattern_length_relative;
- bool is_solid;
- gs_point pos;
- } current, saved; /* enable saving for LT99 */
- int cap;
- int join;
- } line;
- float miter_limit;
- struct pen_ {
- bool width_relative;
- int selected; /* currently selected pen # */
- } pen;
- byte symbol_mode; /* 0 if not in symbol mode */
- struct ft_ {
+ float pattern_length;
+ bool pattern_length_relative;
+ bool is_solid;
+ gs_point pos;
+ } current, saved; /* enable saving for LT99 */
+ int cap;
+ int join;
+ } line;
+ float miter_limit;
+ struct pen_ {
+ bool width_relative;
+ int selected; /* currently selected pen # */
+ } pen;
+ byte symbol_mode; /* 0 if not in symbol mode */
+ struct ft_ {
hpgl_FT_pattern_source_t type;
- /*
- * Because each fill type remembers its previous parameter values,
- * we must use a structure rather than a union here.
- */
- struct fp_ {
- hpgl_hatch_params_t hatch;
- hpgl_hatch_params_t crosshatch;
- int shading; /* 0..100 */
- struct { int pattern_index; bool use_current_pen; } user_defined;
- int pattern_type;
- uint pattern_id;
- } param;
- } fill;
+ /*
+ * Because each fill type remembers its previous parameter values,
+ * we must use a structure rather than a union here.
+ */
+ struct fp_ {
+ hpgl_hatch_params_t hatch;
+ hpgl_hatch_params_t crosshatch;
+ int shading; /* 0..100 */
+ struct { int pattern_index; bool use_current_pen; } user_defined;
+ int pattern_type;
+ uint pattern_id;
+ } param;
+ } fill;
/* current bits of fraction for polyline encoded numbers */
int32 fraction_bits;
- hpgl_render_fill_type_t fill_type;
- hpgl_line_type_t fixed_line_type[8];
- hpgl_line_type_t adaptive_line_type[8];
- gs_point anchor_corner;
- bool source_transparent;
- struct scr_ {
+ hpgl_render_fill_type_t fill_type;
+ hpgl_line_type_t fixed_line_type[8];
+ hpgl_line_type_t adaptive_line_type[8];
+ gs_point anchor_corner;
+ bool source_transparent;
+ struct scr_ {
hpgl_SV_pattern_source_t type;
- struct sp_ {
- int shading; /* 0..100 */
- struct { int pattern_index; bool use_current_pen; } user_defined;
- int pattern_type;
- uint pattern_id;
- } param;
- } screen;
- /* Temporary while downloading raster fill pattern */
- struct rf_ {
- int index, width, height;
- uint raster;
- byte *data;
+ struct sp_ {
+ int shading; /* 0..100 */
+ struct { int pattern_index; bool use_current_pen; } user_defined;
+ int pattern_type;
+ uint pattern_id;
+ } param;
+ } screen;
+ /* Temporary while downloading raster fill pattern */
+ struct rf_ {
+ int index, width, height;
+ uint raster;
+ byte *data;
bool is_mask;
- } raster_fill;
-
- /* Chapter 23 (pgchar.c, pglabel.c) */
-
- pcl_font_selection_t font_selection[2];
- int font_selected; /* 0 or 1 */
- pl_font_t *font; /* 0 means recompute from params */
- pl_symbol_map_t *map; /* map for current font */
- pl_font_t stick_font[2][2]; /* stick/arc fonts */
- struct ch_ {
- gs_point direction;
- bool direction_relative;
- enum {
- hpgl_text_right = 0,
- hpgl_text_down = 1,
- hpgl_text_left = 2,
- hpgl_text_up = 3
- } text_path;
+ } raster_fill;
+
+ /* Chapter 23 (pgchar.c, pglabel.c) */
+
+ pcl_font_selection_t font_selection[2];
+ int font_selected; /* 0 or 1 */
+ pl_font_t *font; /* 0 means recompute from params */
+ pl_symbol_map_t *map; /* map for current font */
+ pl_font_t stick_font[2][2]; /* stick/arc fonts */
+ struct ch_ {
+ gs_point direction;
+ bool direction_relative;
+ enum {
+ hpgl_text_right = 0,
+ hpgl_text_down = 1,
+ hpgl_text_left = 2,
+ hpgl_text_up = 3
+ } text_path;
#define hpgl_text_is_vertical(path) (((path) & 1) != 0)
- int line_feed_direction; /* +1 = normal, -1 = reversed */
- gs_point extra_space;
- gs_point size;
- enum {
- hpgl_size_not_set,
- hpgl_size_absolute,
- hpgl_size_relative
- } size_mode;
- hpgl_real_t slant;
- enum {
- hpgl_char_solid_edge = 0,
- hpgl_char_edge = 1,
- hpgl_char_fill = 2,
- hpgl_char_fill_edge = 3
- } fill_mode;
- int edge_pen; /* 0 = no edge */
- } character;
- struct lb_ {
- int origin;
- uint terminator;
- bool print_terminator;
- /* Double-byte support */
- uint row_offset; /* implicit high byte */
- bool double_byte;
- bool write_vertical;
- /*
- * The following are only used during the execution of a
- * single LB command, but since hpgl_LB may need to exit
- * back to the parser for more data, we can't make them
- * local variables of hpgl_LB.
- */
- gs_point initial_pos;
+ int line_feed_direction; /* +1 = normal, -1 = reversed */
+ gs_point extra_space;
+ gs_point size;
+ enum {
+ hpgl_size_not_set,
+ hpgl_size_absolute,
+ hpgl_size_relative
+ } size_mode;
+ hpgl_real_t slant;
+ enum {
+ hpgl_char_solid_edge = 0,
+ hpgl_char_edge = 1,
+ hpgl_char_fill = 2,
+ hpgl_char_fill_edge = 3
+ } fill_mode;
+ int edge_pen; /* 0 = no edge */
+ } character;
+ struct lb_ {
+ int origin;
+ uint terminator;
+ bool print_terminator;
+ /* Double-byte support */
+ uint row_offset; /* implicit high byte */
+ bool double_byte;
+ bool write_vertical;
+ /*
+ * The following are only used during the execution of a
+ * single LB command, but since hpgl_LB may need to exit
+ * back to the parser for more data, we can't make them
+ * local variables of hpgl_LB.
+ */
+ gs_point initial_pos;
#define hpgl_char_count 128 /* initial buffer size */
- byte *buffer; /* start of line buffer pointer */
+ byte *buffer; /* start of line buffer pointer */
uint buffer_size; /* size of the current buffer */
- uint char_count; /* count of chars in the buffer */
+ uint char_count; /* count of chars in the buffer */
byte ch;
byte prev_ch;
bool have_16bits; /* two byte terminators need 16 bits */
- } label;
- bool transparent_data;
- uint font_id[2];
- bool bitmap_fonts_allowed;
- gs_point carriage_return_pos;
+ } label;
+ bool transparent_data;
+ uint font_id[2];
+ bool bitmap_fonts_allowed;
+ gs_point carriage_return_pos;
/* extra pen state for routines that cannot use local variables
- because of longjmp parser braindamage. */
+ because of longjmp parser braindamage. */
hpgl_pen_state_t pen_state;
- bool subpolygon_started; /* true if we are just starting a subpolygon */
- bool have_drawn_in_path; /* true if the pen has been down during this path */
+ bool subpolygon_started; /* true if we are just starting a subpolygon */
+ bool have_drawn_in_path; /* true if the pen has been down during this path */
} pcl_hpgl_state_t;
#define hpgl_pen_relative (1)