📄 xlm_codegen.h
字号:
/* @(#)xlm_codegen.h 4.1 7/2/90 *//* file: xlm_codegen.h - Translator code generator routines * created: mgb 29-MAY-1986 15:22:08 * edit: gh 20-JUN-1986 13:09:07 Changed M$SET_FONT to compute * [1200 0 0 -1200 0 0] makefont in str_buffer, then * to output that in the middle of str_courier string. * mgb 25-JUN-1986 14:04:00 Put output_vchar in and modified * set_font. * * araj 26-JUL-1986 13:19:11 * modified set origin to use M$UPDATE_AP_A (-1,-1) * instead of M$SET_AP (-1,-1) * The goal is to indicate an invalid AP, * not to force one. * gh 11-AUG-1986 14:02:24 Removed M$OUTPUT_PREAMBLE - * put equiv code in codegen because needed to make * output of error handler conditional, which macro * processor did not seem to like * mgb 20-AUG-1986 11:10:13 Adding sheet length to current * ps state. * laf 27-AUG-1986 15:57:15 Modified M$CLOSE_SHOW to fix * problem of UL "following" the chars on PLU/PLD. * nv 15-SEP-1986 09:36:17 Removed NUMBER_OF_PS_DICTIONARIES * and NUMBER_OF_PS_FIXED_FONT_DICTNRS. * * mgb 19-APR-1988 18:05 * changed ps_font... to paired_font... * * mgb 12-MAY-1988 14:38 * Adding font cache to M$SET_FONT * * kws 29-JUL-1988 16:32:42 * Change boxnumber to unspaced_boxnumber in M$SET_FONT. * pass unspaced_boxnumber it to dispose_cache_spacing & * dispose_add_spacing_to_cache. Change boxnumber to * spaced_boxnumber in M$SET_SPACING. * * * ejs 1-SEP-1988 19:04 * Modified a number of macros to use the CPAR approch to font * numbering. This included: * * M$SAVE * M$SET_FONT * M$SET_SPACING * M$CHECK_STATE_CHANGE_FONT * M$CHECK_STATE_CHANGE_ALL * * araj 29-NOV-1988 15:18 * Removed M$SET_FONT snd M$SET_SPACING, modified M$CHECK_STATE_CHANGE_FONT * to do test, then call subroutine set_font_and_spacing. * * 18-DEC-1988 15:19 ejs * Major changes to data structutes. GLYPH has been modified * to allow struct copies more easily. The PS output is not * changed (barring bugs of course). * * 20-MAR-1989 C.Peters * Removed extraneous '&' operator for Ultrix port. * * 23-MAR-1989 C.Peters * Removed extraneous '&' operator for Ultrix port. *//************************************************************************ * * * COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1985, * * 1986. ALL RIGHTS RESERVED. * * * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE * * USED AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF * * SUCH LICENSE AND WITH THE INCLUSION OF THE ABOVE * * COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER COPIES * * THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE * * AVAILABLE TO ANY OTHER PERSON. NO TITLE TO AND * * OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED. * * * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE * * WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A * * COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. * * * * DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR * * RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT * * SUPPLIED BY DIGITAL. * ************************************************************************//*** DFEINITIONS ***/#define SIXEL_BASELINE_OFFSET 700#define ALLCLOSED 0#define SIXELOPEN 1#define SHOWOPEN 2#define DECVECOPEN 3#define FONTOPEN 4#define SPACINGOPEN 5#define BAREUNIT 0 /* Translator entry level */#define PREAMBLE 1 /* Preamble level */#define DLL_LEVEL 2 /* DLL loaded */#define SPACED_LEVEL 3 /* SPACED loaded */#define DEFINE_LEVEL 4 /* Define loaded */#define PAGE 5 /* Page loaded *//* DEFAULT VALUE *//* >>>>>>>>>>>>>>>>>>>>>>>*** MAY NEED TO BE REDEFINED!!! */#define XL_ST_DEFAULT_ORIGIN_X 0#define XL_ST_DEFAULT_ORIGIN_Y 0#define XL_ST_DEFAULT_ORIENTATION ORIENT_PS#define DEFAULT_SCALE_X 1#define DEFAULT_SCALE_Y 1#define DEFAULT_THICKNESS 100/******************************************************************M$SAVE() 5.1.1 Generalities Outputs the "save" command in postscript and pushes the current psstate table on the stack. 5.1.2 Input 1. ps_state 2. stack pointer 5.1.3 Output 1. str_save 2. stack_ptr 5.1.4 Called Routines 1. oprintf 5.1.5 Internal Variables And Storage *** (T.B.D.) *** 5.1.6 Code Comments 1. Send "save" command 2. Push current ps_state 1. Increment current stack pointer 2. Copy ps_state to new current location on stack******************************************************************/#define M$SAVE() \ \/* Output PS command */ \ \ps_str (str_save); \ \/* Puts ps_st onto stack */ \ \old_ps_stack_ptr = stack_ptr; /* Save old stack pointer */ \stack_ptr++; /* Increment stack pointer */ \cur_ps_st = &ps_st[stack_ptr]; /* Update cur_ps_st */ \ \/* Copy last ps_st into top of stack */ \ps_st[stack_ptr] = ps_st[old_ps_stack_ptr]/******************************************************************M$RESTORE() 5.2.1 Generalities Outputs the "restore" command and decrements the stack pointer to previous states. 5.2.2 Input None 5.2.3 Output 1. str_restore - PS "restore" command 2. stack_ptr - stack pointer 5.2.4 Called Routines 1. oprintf 5.2.5 Internal Variables And Storage None 5.2.6 Code Comments 1. prints "restore" command 2. Decrement stack pointer******************************************************************/#define M$RESTORE() \ \/* Output PS command and decrement stack pointer */ \ \ps_str (str_restore); \cur_ps_st = &ps_st[--stack_ptr]; /******************************************************************M$UPDATE_PAIRED_FONTDICT() 5.35.1 Generalities 5.35.2 Input 5.35.3 Output 5.35.4 Called Routines 5.35.5 Internal Variables And Storage 5.35.6 Code Comments******************************************************************/#define M$UPDATE_PAIRED_FONTDICT() \ \/* STUB */ /******************************************************************M$UPDATE_BUFF_SIZE(m$sixel_buf_size) 5.32.1 Generalities This will store the old sixel count. 5.32.2 Input 5.32.3 Output 5.32.4 Called Routines None 5.32.5 Internal Variables And Storage******************************************************************/ /* * #define M$UPDATE_BUFF_SIZE(m$sixel_buf_size) \ * \ * cur_ps_st -> sixel_buf_size = m$sixel_buf_size; *//******************************************************************M$UPDATE_SIXEL() 5.31.1 Generalities This will store the old sixel count and update ap. 5.31.2 Input 5.31.3 Output 5.31.4 Called Routines None 5.31.5 Internal Variables And Storage******************************************************************/ #define M$UPDATE_SIXEL(m$buff_size) \ \ cg_st.cgst_wpf = TRUE; \ cur_ps_st -> scale_factor.xval = scalex; \ cur_ps_st -> scale_factor.yval = scaley; \ cur_ps_st -> sixel_buf_size = m$buff_size; /******************************************************************M$UPDATE_SHOWPAGE() 5.30.1 Generalities This will close all open elements and resets all related states to postscript defaults. i.e. Origin goes back to lower left corner of page. ^ y| +---> x Orientation ^ y| +---> x Scale goes back to 1/72" per pixel. 5.30.2 Input None 5.30.3 Output None 5.30.4 Called Routines None 5.30.5 Internal Variables And Storage******************************************************************/ #define M$UPDATE_SHOWPAGE() \ \cg_st.cgst_wpf = FALSE; \ \ \cur_ps_st -> curchar.ap.xval = -1; \cur_ps_st -> curchar.ap.yval = -1; \ \cur_ps_st -> origin.xval = XL_ST_DEFAULT_ORIGIN_X; \cur_ps_st -> origin.yval = XL_ST_DEFAULT_ORIGIN_Y; \ \cur_ps_st -> orientation = XL_ST_DEFAULT_ORIENTATION; \cur_ps_st -> sheet_len = 0; \ \cur_ps_st -> scale_factor.xval = DEFAULT_SCALE_X; \cur_ps_st -> scale_factor.yval = DEFAULT_SCALE_Y; \ \cur_ps_st -> line_thickness = DEFAULT_THICKNESS; \ \cur_ps_st -> open = ALLCLOSED; /* This is not needed since \ everything is already closed */ /******************************************************************M$UPDATE_AP_A(m$x,m$y) 5.29.1 Generalities This updates active position absolute into the ps_state table 5.29.2 Input desired ap 5.29.3 Output ps_state.ap 5.29.4 Called Routines None 5.29.5 Internal Variables And Storage******************************************************************/#define M$UPDATE_AP_A(m$x,m$y) \ \ /* add the change in active position */ \ \ cur_ps_st -> curchar.ap.xval = (m$x); \ cur_ps_st -> curchar.ap.yval = (m$y); /******************************************************************M$UPDATE_AP_R(m$x) 5.28.1 Generalities This updates active position relative into the ps_state table 5.28.2 Input desired ap 5.28.3 Output ps_state.ap 5.28.4 Called Routines None 5.28.5 Internal Variables And Storage******************************************************************/ #define M$UPDATE_AP_R(m$x) \ \ /* add the change in active position */ \ \ cur_ps_st -> curchar.ap.xval += (m$x); /******************************************************************M$OUTPUT_SHOWPAGE() 5.26.1 Generalities The postscript command is outputted here. 5.26.2 Input 5.26.3 Output
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -