diff options
Diffstat (limited to 'contrib/japanese/gdev10v.c')
-rw-r--r-- | contrib/japanese/gdev10v.c | 77 |
1 files changed, 29 insertions, 48 deletions
diff --git a/contrib/japanese/gdev10v.c b/contrib/japanese/gdev10v.c index f4c349d1..0bd3cec0 100644 --- a/contrib/japanese/gdev10v.c +++ b/contrib/japanese/gdev10v.c @@ -37,36 +37,8 @@ copies. */ No checking on resolutions are being made. */ -#if 0 -#define prn_matrix_procs(p_open, p_get_initial_matrix, p_output_page, p_close) {\ - p_open,\ - p_get_initial_matrix,\ - NULL, /* sync_output */\ - p_output_page,\ - p_close,\ - gdev_prn_map_rgb_color,\ - gdev_prn_map_color_rgb,\ - NULL, /* fill_rectangle */\ - NULL, /* tile_rectangle */\ - NULL, /* copy_mono */\ - NULL, /* copy_color */\ - NULL, /* draw_line */\ - NULL, /* get_bits */\ - gdev_prn_get_params,\ - gdev_prn_put_params,\ - NULL, /* map_cmyk_color */\ - NULL, /* get_xfont_procs */\ - NULL, /* get_xfont_device */\ - NULL, /* map_rgb_alpha_color */\ - gx_page_device_get_page_device\ -} -#endif - /* The device descriptor */ static dev_proc_print_page(bj10v_print_page); -#if 0 -static dev_proc_get_initial_matrix(bj10v_get_initial_matrix); -#endif static int bj10v_open(gx_device * pdev) @@ -82,15 +54,37 @@ bj10v_open(gx_device * pdev) #if 0 -gx_device_procs prn_bj10v_procs = - prn_matrix_procs(gdev_prn_open, bj10v_get_initial_matrix, - gdev_prn_output_page, gdev_prn_close); +/* Shift the origin from the top left corner of the pysical page to the + first printable pixel, as defined by the top and left margins. */ +static void +bj10v_get_initial_matrix(gx_device *dev, gs_matrix *pmat) +{ gx_default_get_initial_matrix(dev, pmat); + pmat->tx -= dev_l_margin(dev) * dev->x_pixels_per_inch; + pmat->ty -= dev_t_margin(dev) * dev->y_pixels_per_inch; +} + +static void +bj10v_initialize_device_procs(gx_device *dev) +{ + gdev_prn_initialize_device_procs_mono(dev); + + set_dev_proc(dev, get_initial_matrix, bj10v_get_initial_matrix); +} + +#else + +static void +bj10v_initialize_device_procs(gx_device *dev) +{ + gdev_prn_initialize_device_procs_mono(dev); + + set_dev_proc(dev, open_device, bj10v_open); +} + #endif -gx_device_procs prn_bj10v_procs = - prn_procs(bj10v_open, gdev_prn_output_page, gdev_prn_close); gx_device_printer gs_bj10v_device = - prn_device(prn_bj10v_procs, "bj10v", + prn_device(bj10v_initialize_device_procs, "bj10v", DEFAULT_WIDTH_10THS, /* width_10ths */ DEFAULT_HEIGHT_10THS, /* height_10ths */ 360, /* x_dpi */ @@ -99,7 +93,7 @@ gx_device_printer gs_bj10v_device = 1, bj10v_print_page); gx_device_printer gs_bj10vh_device = - prn_device(prn_bj10v_procs, "bj10vh", + prn_device(bj10v_initialize_device_procs, "bj10vh", DEFAULT_WIDTH_10THS, /* width_10ths */ DEFAULT_HEIGHT_10THS, /* height_10ths */ 360, /* x_dpi */ @@ -107,19 +101,6 @@ gx_device_printer gs_bj10vh_device = 0.134, 0.507, 0.166, 0.335, /* l, b, r, t margins */ 1, bj10v_print_page); -/* ------ Internal routines ------ */ - -#if 0 -/* Shift the origin from the top left corner of the pysical page to the - first printable pixel, as defined by the top and left margins. */ -static void -bj10v_get_initial_matrix(gx_device *dev, gs_matrix *pmat) -{ gx_default_get_initial_matrix(dev, pmat); - pmat->tx -= dev_l_margin(dev) * dev->x_pixels_per_inch; - pmat->ty -= dev_t_margin(dev) * dev->y_pixels_per_inch; -} -#endif - /* ---- Printer output routines ---- */ /* Note: Following code is stolen from gdevp201.c. On NEC PC9801 series, |