summaryrefslogtreecommitdiff
path: root/contrib/japanese/gdev10v.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/japanese/gdev10v.c')
-rw-r--r--contrib/japanese/gdev10v.c73
1 files changed, 24 insertions, 49 deletions
diff --git a/contrib/japanese/gdev10v.c b/contrib/japanese/gdev10v.c
index d429c005e..6f341f43d 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,10 +54,27 @@ 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);
-#endif
+/* 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 int
+bj10v_initialize(gx_device *dev)
+{
+ int code = gdev_prn_initialize_mono(dev);
+
+ set_dev_proc(dev, get_initial_matrix, bj10v_get_initial_matrix);
+
+ return 0;
+}
+
+#else
+
static int
bj10v_initialize(gx_device *dev)
{
@@ -99,11 +88,10 @@ bj10v_initialize(gx_device *dev)
return 0;
}
-gx_device_procs prn_bj10v_procs =
- devprocs_initialize(bj10v_initialize);
+#endif
gx_device_printer gs_bj10v_device =
- prn_device(prn_bj10v_procs, "bj10v",
+ prn_device(bj10v_initialize, "bj10v",
DEFAULT_WIDTH_10THS, /* width_10ths */
DEFAULT_HEIGHT_10THS, /* height_10ths */
360, /* x_dpi */
@@ -112,7 +100,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, "bj10vh",
DEFAULT_WIDTH_10THS, /* width_10ths */
DEFAULT_HEIGHT_10THS, /* height_10ths */
360, /* x_dpi */
@@ -120,19 +108,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,