/* UNISRC_ID: %W% %E% */ /********************************************************************* * file: h/sys/plotemi.h * part #: * internal sequence #: * * ************************************************************ * * " (c) Copyright Hewlett-Packard Company, 1984. All * * * rights are reserved. Copying or other reproduction * * * of this program except for archival purposes is * * * prohibited without the prior written consent of * * * Hewlett-Packard Company." * * ************************************************************ * * * This file contains the definitions and declarations used * internally by the HPGL plotter emulator. * * Pisces Q-DOS project * Jay Phillips PCD * * $Log: /users/jay/uts.p/uts/h/scrn/plotemi.h,v $ * Revision 2.3 84/04/06 15:34:48 jay * *** empty log message *** * * Revision 2.2 84/03/29 08:27:33 jay * Removed variable digcurs_on from plotter data. * * Revision 2.1 84/03/12 19:46:24 jay * Release 8 * * Revision 1.3 84/01/31 10:36:35 jay * Added RCS change logging * * * Revision History * ----------------------------------------------------------------- * 08/07/83 JNP Initial * 11/17/83 JNP Added comments * 01/28/84 JNP Split plotem.h into plotem.h and plotemi.h * ************************************************************************/ /************************************************************************ * * HPGL Parser State Definitions * * The following defines are the state values used to control * the state sequencer. They must be zero based and contiguous and * the table in plot_data.c must be in the same order as * these are numbered. * ************************************************************************/ #define PE_INIT_STATE 0 /* initial state */ #define C__CMDS 1 /* first character is 'C' */ #define CA_CMD 2 /* CA command */ #define CP_CMD 3 /* CP command */ #define CP_SPACE 4 /* CP parsing space parameter */ #define CP_NEGSPACE 5 /* CP parsing neg. space parm. */ #define CP_GOTSPACE 6 /* CP seen space parm. separ. */ #define CP_LINE 7 /* CP parsing line parameter */ #define CP_NEGLINE 8 /* CP parsing neg line parm. */ #define CS_CMD 9 /* CS command */ #define D__CMDS 10 /* first character is 'D' */ #define DF_CMD 11 /* DF command */ #define DI_CMD 12 /* DI command */ #define DI_RUN 13 /* DI parsing run */ #define DI_NEGRUN 14 /* DI parsing negative run */ #define DI_GOTRUN 15 /* DI seen run separator */ #define DI_RISE 16 /* DI parsing rise */ #define DI_NEGRISE 17 /* DI parsing negative rise */ #define DR_CMD 18 /* DR command */ #define DR_RUN 19 /* DR parsing run */ #define DR_NEGRUN 20 /* DR parsing negative run */ #define DR_GOTRUN 21 /* DR now have run */ #define DR_RISE 22 /* DR parsing rise */ #define DR_NEGRISE 23 /* DR parsing negative run */ #define DT_CMD 24 /* DT command */ #define I__CMDS 25 /* first character is 'I' */ #define IM_CMD 26 /* IM command */ #define IM_INEMASK 27 /* IM parsing emask */ #define IN_CMD 28 /* IN command */ #define IP_CMD 29 /* IP command */ #define IP_INP1X 30 /* IP parsing P1 x coord */ #define IP_INP1XNEG 31 /* IP parsing P1 x coord */ #define IP_GOTP1X 32 /* IP now have P1 x */ #define IP_INP1Y 33 /* IP parsing P1 y coord */ #define IP_INP1YNEG 34 /* IP parsing P1 y coord */ #define IP_GOTP1Y 35 /* IP now have P1 y */ #define IP_INP2X 36 /* IP parsing P2 x coord */ #define IP_INP2XNEG 37 /* IP parsing P2 x coord */ #define IP_GOTP2X 38 /* IP now have P2 x */ #define IP_INP2Y 39 /* IP parsing P2 y coord */ #define IP_INP2YNEG 40 /* IP parsing P2 y coord */ #define IW_CMD 41 /* IW command */ #define IW_INXLL 42 /* IW parsing x lower left */ #define IW_INXLLNEG 43 /* IW parsing x lower left */ #define IW_GOTXLL 44 /* IW now have x lower left */ #define IW_INYLL 45 /* IW parsing y lower left */ #define IW_INYLLNEG 46 /* IW parsing y lower left */ #define IW_GOTYLL 47 /* IW now have y lower left */ #define IW_INXUR 48 /* IW parsing x upper right */ #define IW_INXURNEG 49 /* IW parsing x upper right */ #define IW_GOTXUR 50 /* IW now have x upper right */ #define IW_INYUR 51 /* IW parsing y upper right */ #define IW_INYURNEG 52 /* IW parsing y upper right */ #define L__CMDS 53 /* first character is 'L' */ #define LB_CMD 54 /* LB command */ #define LT_CMD 55 /* LT command */ #define LT_INPAT 56 /* LT parsing pattern number */ #define LT_GOTPAT 57 /* LT now have pattern number */ #define LT_INLEN 58 /* LT parsing length */ #define O__CMDS 59 /* first character is 'O' */ #define P__CMDS 60 /* first character is 'P' */ #define PA_CMD 61 /* PA command */ #define PA_INXPARM 62 /* PA - building x parameter */ #define PA_NEGXPARM 63 /* PA - building x parameter */ #define PA_GOTXPARM 64 /* PA - found x parameter */ #define PA_INYPARM 65 /* PA - building y parameter */ #define PA_NEGYPARM 66 /* PA - building y parameter */ #define PR_CMD 67 /* PR command */ #define PR_INXPARM 68 /* PR parsing x */ #define PR_NEGXPARM 69 /* PR parsing negative x */ #define PR_GOTXPARM 70 /* PR now have x */ #define PR_INYPARM 71 /* PR parsing y */ #define PR_NEGYPARM 72 /* PR parsing negative y */ #define S__CMDS 73 /* first character is 'S' */ #define SC_CMD 74 /* SC command */ #define SC_XMIN 75 /* SC parsing xmin */ #define SC_NEGXMIN 76 /* SC parsing negative xmin */ #define SC_GOTXMIN 77 /* SC now have xmin */ #define SC_XMAX 78 /* SC parsing xmax */ #define SC_NEGXMAX 79 /* SC parsing negative xmax */ #define SC_GOTXMAX 80 /* SC now have xmax */ #define SC_YMIN 81 /* SC parsing ymin */ #define SC_NEGYMIN 82 /* SC parsing negative ymin */ #define SC_GOTYMIN 83 /* SC now have ymin */ #define SC_YMAX 84 /* SC parsing ymax */ #define SC_NEGYMAX 85 /* SC parsing negative ymax */ #define SI_CMD 86 /* SI command */ #define SI_W 87 /* SI parsing width */ #define SI_NEGW 88 /* SI parsing negative width */ #define SI_GOTW 89 /* SI now have width */ #define SI_H 90 /* SI parsing height */ #define SI_NEGH 91 /* SI parsing negative height */ #define SL_CMD 92 /* SL command */ #define SL_TAN 93 /* SL parsing tangent */ #define SL_NEGTAN 94 /* SL parsing negative tangent */ #define SM_CMD 95 /* SM command */ #define SP_CMD 96 /* SP command */ #define SP_PEN 97 /* SP parsing pen number */ #define SP_NEGPEN 98 /* SP parsing negative pen */ #define SR_CMD 99 /* SR command */ #define SR_W 100 /* SR parsing width */ #define SR_NEGW 101 /* SR parsing negative width */ #define SR_GOTW 102 /* SR now have width */ #define SR_H 103 /* SR parsing height */ #define SR_NEGH 104 /* SR parsing negative height */ #define T__CMDS 105 /* first character is 'T' */ #define TL_CMD 106 /* TL command */ #define TL_TP 107 /* TL parsing positive tick */ #define TL_NEGTP 108 /* TL parsing neg. pos. tick */ #define TL_GOTTP 109 /* TL now have positive tick */ #define TL_TN 110 /* TL parsing negative tick */ #define TL_NEGTN 111 /* TL parsing neg. neg. tick */ #define X__CMDS 112 /* first character is 'X' */ #define Y__CMDS 113 /* first character is 'Y' */ #define CA_INPARM 114 /* parsing CA parameter */ #define CS_INPARM 115 /* parsing CS parameter */ #define IM_INSMASK 116 /* parsing S mask parameter */ #define IM_INPMASK 117 /* parsing P mask parameter */ /************************************************************************ * * HPGL Parser Runtime Routines * * The routines declared below are called by the window common * state sequencer in wincom.c. The routines are referenced * in the plotter state table in plot_table.c. * ************************************************************************/ extern int pe_abs_char_def(); extern int pe_abs_char_size(); extern int pe_cancel_sym_mode(); extern int pe_char_plot(); extern int pe_char_slant(); extern int pe_chk_term(); extern int pe_ch_plot_def(); extern int pe_defaults(); extern int pe_define_term(); extern int pe_des_altchar(); extern int pe_des_stdchar(); extern int pe_digitize_clr(); extern int pe_digitize_pnt(); extern int pe_direct_abs(); extern int pe_direct_rel(); extern int pe_dir_abs_def(); extern int pe_dir_rel_def(); extern int pe_do_plot_abs(); extern int pe_do_plot_rel(); extern int enter_min_num(); extern int enter_num(); extern int pe_initialize(); extern int pe_input_mask(); extern int pe_input_emask(); extern int pe_input_smask(); extern int pe_input_P1P2(); extern int pe_input_window(); extern int pe_in_mask_def(); extern int pe_in_P1P2_def(); extern int pe_in_P1_defP2(); extern int pe_in_win_def(); extern int pe_label_chr(); extern int pe_label_space(); extern int pe_lab_BS(); extern int pe_lab_CR(); extern int pe_lab_LF(); extern int pe_lab_invLF(); extern int next_state(); extern int pe_out_actual(); extern int pe_out_commanded(); extern int pe_out_digitized(); extern int pe_out_error(); extern int pe_out_factors(); extern int pe_out_identify(); extern int pe_out_options(); extern int pe_out_P1P2(); extern int pe_out_status(); extern int pe_out_window(); extern int parm1(); extern int parm2(); extern int parm3(); extern int pe_pen_down(); extern int pe_pen_up(); extern int pe_clear(); extern int pe_rel_char_def(); extern int pe_rel_char_size(); extern int pe_scale(); extern int pe_scale_off(); extern int pe_select_pen(); extern int pe_serr1_nounget(); extern int pe_set_error1(); extern int pe_set_error2(); extern int pe_set_error3(); extern int set_frac(); extern int pe_set_line_def(); extern int pe_set_line_type(); extern int pe_set_abs_mode(); extern int pe_set_rel_mode(); extern int pe_slant_def(); extern int pe_symbol_mode(); extern int pe_tick_lendef(); extern int pe_tick_length(); extern int pe_x_tick(); extern int pe_y_tick(); /************************************************************************ * * Misc. Defines * ************************************************************************/ #define ON TRUE #define OFF FALSE #define X_ROLL_DOTS 6 /* # of dots per roll in x dir. */ #define Y_ROLL_DOTS 8 /* # of dots per roll in y dir. */ #define CHAR_WIDTH 6 /* default character width */ #define CHAR_HEIGHT 8 /* default character height */ #define CSIZE_WIDTH 0.176 /* centimetres - normal char */ #define CSIZE_HEIGHT 0.246 /* centimetres - normal char */ /************************************************************************ * * Plotting Modes * ************************************************************************/ #define PLOT_ABS 1 /* absolute plotting mode */ #define PLOT_REL 2 /* relative plotting mode */ /************************************************************************ * * Structure Definitions and Declarations * ************************************************************************/ /************************************************************************ * * area * * Structure defining a rectangular area of a raster. * ************************************************************************/ struct area { int minx; /* minimum x coordinate */ int maxx; /* maximum x coordinate */ int miny; /* minimum y coordinate */ int maxy; /* maximum y coordinate */ }; /************************************************************************ * * pe_data - plotter emulator data structure * ************************************************************************/ struct pe_data { struct ttcom cd; /* window common data MUST BE FIRST ITEM IN PLOTTER DATA */ struct xy_coord pos; /* current pen position */ struct xy_coord act_pos;/* actual pen position */ struct xy_coord lastpos;/* last pen position */ struct xy_coord dig_pos;/* digitize position */ struct xy_coord P1; /* P1 position */ struct xy_coord P2; /* P2 position */ struct xy_coord win_min;/* current window min point */ struct xy_coord win_max;/* current window max point */ struct xy_coord rs_ul; /* upper left of raster-screen copy block */ struct xy_coord rs_lr; /* lower right of raster-screen copy block */ double usr_x; /* pen position in user units */ double usr_y; /* pen position in user units */ double lastusr_x; /* pen position in user units */ double lastusr_y; /* pen position in user units */ double rel_run; /* used for label direction */ double rel_rise; /* " " " " */ double char_width; /* character width factor */ double char_height; /* character height factor */ double rel_width; /* relative character width */ double rel_height; /* relative character height */ double xtick_per; /* xtick length percentage */ double xtick_neg; /* amt of tick below axis */ double ytick_per; /* ytick length percentage */ double ytick_neg; /* amt of tick left of axis */ double char_slant; /* character slant */ double x_scale; /* x scale factor */ double y_scale; /* y scale factor */ double cos_theta; /* cos(theta) for label direct. */ double sin_theta; /* sin(theta) for label direct. */ double P1x_sc; /* P1 x scaled */ double P1y_sc; /* P1 y scaled */ double P2x_sc; /* P2 x scaled */ double P2y_sc; /* P2 y scaled */ int w_id; /* window id number */ int winx; /* coord. of window origin */ int winy; /* coord. of window origin */ int num_spaces; /* #spaces to move in char plot */ int num_lines; /* # lines to move in char plot */ int pen; /* pen value, positive/negative */ int cur_rr; /* current replacement rule */ int last_rule; /* last replacement rule set */ char label_term; /* label terminator character */ char sym_char; /* symbol-mode character */ byte_t E_mask; /* error mask */ byte_t line_type; /* line type value */ byte_t error; /* error register */ byte_t status; /* status register */ bool_t digitize_mode; /* indicates digitize mode */ bool_t plot_mode; /* flag for abs/rel plot mode */ bool_t symbol_mode; /* flag to indicate symbol mode */ bool_t scale_flag; /* indicates whether scale set */ bool_t pen_down; /* pen down flag */ bool_t follow_pen; /* TRUE if window follows pen */ bool_t fast_pen; /* TRUE if fast pen movement */ bool_t cursor_on; /* TRUE if cursor is on */ bool_t digcurs_on; /* TRUE if digitize cursor on */ bool_t rel_charsize; /* TRUE if relative char size */ bool_t rs_sync; /* TRUE if raster and screen are synchronized. */ bool_t scrn_active; /* TRUE if screen is active */ bool_t strap_a; /* TRUE if keyboard strap on */ bool_t labelchr; /* TRUE if labeling character */ };