summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-04-08 17:31:29 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-04-13 12:48:37 +0100
commita35f70a48789b27f49b31bcb0ec552ca4b14f659 (patch)
treefbfa15d5bbf430e322d8c9f143737e54134d105d /contrib
parented45f95ecf2c44484f9ff0594fb3e51eb13f6cfa (diff)
downloadghostpdl-a35f70a48789b27f49b31bcb0ec552ca4b14f659.tar.gz
Remove support for old version of GS from contrib devices.
We cannot the test old versions, so this will merely bitrot and make maintenance harder.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/eplaser/gdevescv.c144
-rw-r--r--contrib/lips4/gdevl4r.c5
-rw-r--r--contrib/lips4/gdevl4v.c89
-rw-r--r--contrib/lips4/gdevlprn.h5
-rw-r--r--contrib/opvp/gdevopvp.c80
5 files changed, 7 insertions, 316 deletions
diff --git a/contrib/eplaser/gdevescv.c b/contrib/eplaser/gdevescv.c
index 83248407d..70f76f244 100644
--- a/contrib/eplaser/gdevescv.c
+++ b/contrib/eplaser/gdevescv.c
@@ -35,33 +35,6 @@
#include <stdlib.h> /* for abs() and free */
-#if ( 6 > GS_VERSION_MAJOR )
-
-#include <string.h>
-#ifndef _WIN32
-#include <sys/utsname.h> /* for uname(2) */
-#endif
-#include <ctype.h> /* for toupper(3) */
-
-#include "math_.h"
-#include "gx.h"
-#include "gserrors.h"
-#include "gsmatrix.h"
-#include "gsparam.h"
-#include "gxdevice.h"
-#include "gscspace.h"
-#include "gsutil.h"
-#include "gdevvec.h"
-#include "gdevpstr.h"
-#include "ghost.h"
-#include "gzstate.h"
-
-#include "gdevescv.h"
-#include "gspath.h"
-#include "gzpath.h"
-
-#else /* 6 <= GS_VERSION_MAJOR */
-
#include "math_.h"
#ifndef _WIN32
#include <sys/utsname.h> /* for uname(2) */
@@ -76,14 +49,10 @@
#include "gxdevice.h"
#include "gdevvec.h"
-#if ( 7 >= GS_VERSION_MAJOR )
#include "gscspace.h"
-#endif
#include "gdevescv.h"
-#endif /* GS_VERSION_MAJOR */
-
#define ESCV_FORCEDRAWPATH 0 /* 0: correct LP-9200C path trouble. */
/* ---------------- Device definition ---------------- */
@@ -332,38 +301,6 @@ gx_device_escv far_data gs_lps6500_device ={escv_device_body("lps6500"), escv_pr
gx_device_escv far_data gs_eplcolor_device ={escv_device_body(ESCPAGE_DEVICENAME_COLOR), escv_procs, escv_init_code};
/* Vector device implementation */
-#if ( 6 > GS_VERSION_MAJOR )
-static int escv_beginpage(P1(gx_device_vector * vdev));
-static int escv_setfillcolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc));
-static int escv_setstrokecolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc));
-static int escv_setdash(P4(gx_device_vector * vdev, const float *pattern,
- uint count, double offset));
-static int escv_setflat(P2(gx_device_vector * vdev, double flatness));
-static int escv_setlogop(P3(gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff));
-static int escv_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
- fixed y1, gx_path_type_t type);
-static int escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
- gx_path_type_t type);
-static int escv_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-static int escv_moveto(P6(gx_device_vector * vdev, double x0, double y0,
- double x, double y, gx_path_type_t type));
-static int escv_lineto(P6(gx_device_vector * vdev, double x0, double y0,
- double x, double y, gx_path_type_t type));
-static int escv_curveto(P10(gx_device_vector * vdev, double x0, double y0,
- double x1, double y1, double x2, double y2,
- double x3, double y3, gx_path_type_t type));
-static int escv_closepath(P6(gx_device_vector * vdev, double x, double y,
- double x_start, double y_start, gx_path_type_t type));
-
-static int escv_endpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-static int escv_setlinewidth(gx_device_vector * vdev, double width);
-static int escv_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
-static int escv_setlinejoin(gx_device_vector * vdev, gs_line_join join);
-static int escv_setmiterlimit(gx_device_vector * vdev, double limit);
-
-#else /* 6 <= GS_VERSION_MAJOR */
-
/* Page management */
static int escv_beginpage (gx_device_vector * vdev);
/* Imager state */
@@ -377,17 +314,12 @@ static int escv_setflat (gx_device_vector * vdev, double flatness);
static int escv_setlogop (gx_device_vector * vdev, gs_logical_operation_t lop,
gs_logical_operation_t diff);
/* Other state */
-#if ( 8 <= GS_VERSION_MAJOR )
static bool escv_can_handle_hl_color (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
static int escv_setfillcolor (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
static int escv_setstrokecolor (gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
-#else
-static int escv_setfillcolor (gx_device_vector * vdev, const gx_drawing_color * pdc);
-static int escv_setstrokecolor (gx_device_vector * vdev, const gx_drawing_color * pdc);
-#endif
/* Paths */
/* dopath and dorect are normally defaulted */
static int escv_vector_dopath (gx_device_vector * vdev, const gx_path * ppath,
@@ -406,7 +338,6 @@ static int escv_closepath (gx_device_vector * vdev, double x0, double y0,
double x_start, double y_start, gx_path_type_t type);
static int escv_endpath (gx_device_vector * vdev, gx_path_type_t type);
-#endif /* GS_VERSION_MAJOR */
static const gx_device_vector_procs escv_vector_procs =
{
@@ -421,9 +352,7 @@ static const gx_device_vector_procs escv_vector_procs =
escv_setflat,
escv_setlogop,
/* Other state */
-#if ( 8 <= GS_VERSION_MAJOR )
escv_can_handle_hl_color, /* add gs815 */
-#endif
escv_setfillcolor, /* fill & stroke colors are the same */
escv_setstrokecolor,
/* Paths */
@@ -508,10 +437,7 @@ escv_range_check(gx_device * dev)
static int
escv_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
- gx_path_type_t type
-#if ( 6 <= GS_VERSION_MAJOR )
- , const gs_matrix *pmat
-#endif
+ gx_path_type_t type, const gs_matrix *pmat
)
{
gx_device_escv *pdev = (gx_device_escv *) vdev;
@@ -1320,19 +1246,6 @@ escv_setlinewidth(gx_device_vector * vdev, double width)
gx_device_escv *const pdev = (gx_device_escv *) vdev;
char obuf[64];
-#if GS_VERSION_MAJOR == 5
- /* Scale を掛けているのは, Ghostscript 5.10/5.50 のバグのため */
- double xscale, yscale;
-
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0 || yscale > xscale) /* if portrait */
- width = ceil(width * yscale);
- else
- width = ceil(width * xscale);
-#endif
-
if (width < 1) width = 1;
/* ESC/Page では線幅/終端/接合部の設定は1つのコマンドになっているため保持しておく。 */
@@ -1425,20 +1338,16 @@ escv_setmiterlimit(gx_device_vector * vdev, double limit)
return 0;
}
-#if ( 8 <= GS_VERSION_MAJOR )
static bool
escv_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc)
{
return false;
}
-#endif
static int
escv_setfillcolor(gx_device_vector * vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
const gs_gstate * pgs,
-#endif
const gx_drawing_color * pdc)
{
stream *s = gdev_vector_stream(vdev);
@@ -1479,9 +1388,7 @@ escv_setfillcolor(gx_device_vector * vdev,
static int
escv_setstrokecolor(gx_device_vector * vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
const gs_gstate * pgs,
-#endif
const gx_drawing_color * pdc)
{
stream *s = gdev_vector_stream(vdev);
@@ -1532,18 +1439,6 @@ escv_setdash(gx_device_vector * vdev, const float *pattern, uint count, double o
int i;
char obuf[64];
-#if GS_VERSION_MAJOR == 5
- float scale, xscale, yscale;
- /* Scale を掛けているのは, Ghostscript 5.10/5.50 のバグのため */
- xscale = fabs(igs->ctm.xx);
- yscale = fabs(igs->ctm.xy);
-
- if (xscale == 0) /* if portrait */
- scale = yscale;
- else
- scale = xscale;
-#endif
-
if (count == 0){
/* 実線 */
lputs(s, ESC_GS "0;0lpG");
@@ -1555,13 +1450,7 @@ escv_setdash(gx_device_vector * vdev, const float *pattern, uint count, double o
if (count) {
if (count == 1) {
-#if GS_VERSION_MAJOR == 5
- (void)gs_sprintf(obuf, ESC_GS "1;%d;%ddlG",
- (int)(pattern[0] * scale / vdev->x_pixels_per_inch + 0.5),
- (int)(pattern[0] * scale / vdev->x_pixels_per_inch + 0.5));
-#else
(void)gs_sprintf(obuf, ESC_GS "1;%d;%ddlG", (int) pattern[0], (int) pattern[0]);
-#endif
lputs(s, obuf);
} else {
/* pattern に0があった場合は描画不可として返却 */
@@ -1571,12 +1460,7 @@ escv_setdash(gx_device_vector * vdev, const float *pattern, uint count, double o
lputs(s, ESC_GS "1");
for (i = 0; i < count; ++i) {
-#if GS_VERSION_MAJOR == 5
- (void)gs_sprintf(obuf, ";%d", (int)(pattern[i] * scale / vdev->x_pixels_per_inch + 0.5));
-
-#else
(void)gs_sprintf(obuf, ";%d", (int) pattern[i]);
-#endif
lputs(s, obuf);
}
lputs(s, "dlG");
@@ -2171,19 +2055,14 @@ escv_copy_mono(gx_device * dev, const byte * data,
gx_color_index c_color = 0;
char obuf[128];
int depth = 1;
-#if ( 8 <= GS_VERSION_MAJOR )
- /* FIXME! add for gs815 */
const gs_gstate * pgs = (const gs_gstate *)0;
-#endif
if (id != gs_no_id && zero == gx_no_color_index && one != gx_no_color_index && data_x == 0) {
gx_drawing_color dcolor;
color_set_pure(&dcolor, one);
escv_setfillcolor(vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
pgs,
-#endif
&dcolor); /* FIXME! gs815 */
}
@@ -2269,9 +2148,7 @@ escv_copy_mono(gx_device * dev, const byte * data,
}
color_set_pure(&color, one);
code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
-#if ( 8 <= GS_VERSION_MAJOR )
pgs,
-#endif
&color);
/* ここを通過したら以下の色設定は無意味? */
@@ -2383,18 +2260,13 @@ escv_fill_mask(gx_device * dev,
gx_color_index color = gx_dc_pure_color(pdcolor);
char obuf[64];
-#if ( 8 <= GS_VERSION_MAJOR )
- /* FIXME! add for gs815 */
const gs_gstate * pgs = (const gs_gstate *)0;
-#endif
if (w <= 0 || h <= 0) return 0;
if (depth > 1 ||
gdev_vector_update_fill_color(vdev,
-#if ( 8 <= GS_VERSION_MAJOR )
pgs,
-#endif
pdcolor) < 0 ||
gdev_vector_update_clip_path(vdev, pcpath) < 0 ||
gdev_vector_update_log_op(vdev, lop) < 0
@@ -2667,15 +2539,9 @@ escv_begin_image(gx_device * dev,
/* Process the next piece of an image. */
static int
-#if GS_VERSION_MAJOR >= 6
escv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used)
-#else
- escv_image_plane_data(gx_device *dev, gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height)
-#endif
{
-#if GS_VERSION_MAJOR >= 6
gx_device *dev = info->dev;
-#endif
gx_device_vector *const vdev = (gx_device_vector *) dev;
gx_device_escv *const pdev = (gx_device_escv *) dev;
gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
@@ -2691,10 +2557,8 @@ escv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *plan
{
-#if GS_VERSION_MAJOR >= 6
if (height == 260)
height = 1;
-#endif
width_bytes = (pie->width * pie->bits_per_pixel / pdev->ncomp + 7) / 8 * pdev->ncomp;
tbyte = width_bytes * height;
buf = gs_alloc_bytes(vdev->memory, tbyte, "escv_image_data(buf)");
@@ -2881,15 +2745,9 @@ escv_image_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *plan
}
static int
-#if GS_VERSION_MAJOR >= 6
escv_image_end_image(gx_image_enum_common_t * info, bool draw_last)
-#else
- escv_image_end_image(gx_device *dev, gx_image_enum_common_t * info, bool draw_last)
-#endif
{
-#if GS_VERSION_MAJOR >= 6
gx_device *dev = info->dev;
-#endif
gx_device_vector *const vdev = (gx_device_vector *) dev;
gx_device_escv *const pdev = (gx_device_escv *) dev;
gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info;
diff --git a/contrib/lips4/gdevl4r.c b/contrib/lips4/gdevl4r.c
index d8bcec7ef..0e03270aa 100644
--- a/contrib/lips4/gdevl4r.c
+++ b/contrib/lips4/gdevl4r.c
@@ -179,13 +179,8 @@ static int lips4c_output_page(gx_device_printer * pdev, gp_file * prn_stream);
static int lips_delta_encode(byte * inBuff, byte * prevBuff, byte * outBuff, byte * diffBuff, int Length);
static int lips_byte_cat(byte * TotalBuff, byte * Buff, int TotalLen, int Len);
static int lips_print_page_copies(gx_device_printer * pdev, gp_file * prn_stream, lips_printer_type ptype, int numcopies);
-#if GS_VERSION_MAJOR >= 8
static int lips_print_page_copies(gx_device_printer * pdev, gp_file * prn_stream, lips_printer_type ptype, int numcopies);
static int lips4type_print_page_copies(gx_device_printer * pdev, gp_file * prn_stream, int num_copies, int ptype);
-#else
-static int lips_print_page_copies(P4(gx_device_printer * pdev, gp_file * prn_stream, lips_printer_type ptype, int numcopies));
-static int lips_print_page_copies(P4(gx_device_printer * pdev, gp_file * prn_stream, lips_printer_type ptype, int numcopies));
-#endif
static int
lips2p_open(gx_device * pdev)
{
diff --git a/contrib/lips4/gdevl4v.c b/contrib/lips4/gdevl4v.c
index 47b3fd170..acf5a1eed 100644
--- a/contrib/lips4/gdevl4v.c
+++ b/contrib/lips4/gdevl4v.c
@@ -226,7 +226,6 @@ gx_device_lips4v far_data gs_lips4v_device = {
};
/* Vector device implementation */
-#if GS_VERSION_MAJOR >= 8
static int lips4v_beginpage(gx_device_vector * vdev);
static int lips4v_setfillcolor(gx_device_vector * vdev, const gs_gstate * pgs,
const gx_drawing_color * pdc);
@@ -258,43 +257,6 @@ lips4v_closepath(gx_device_vector * vdev, double x, double y, double x_start,
double y_start, gx_path_type_t type);
static int lips4v_endpath(gx_device_vector * vdev, gx_path_type_t type);
-#else
-static int lips4v_beginpage(P1(gx_device_vector * vdev));
-static int lips4v_setfillcolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-static int lips4v_setstrokecolor(P2(gx_device_vector * vdev,
- const gx_drawing_color * pdc));
-static int lips4v_setdash(P4(gx_device_vector * vdev, const float *pattern,
- uint count, double offset));
-static int lips4v_setflat(P2(gx_device_vector * vdev, double flatness));
-static int
-lips4v_setlogop(P3
-
- (gx_device_vector * vdev, gs_logical_operation_t lop,
- gs_logical_operation_t diff));
-static int
-
-lips4v_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-static int
-lips4v_moveto(P6
- (gx_device_vector * vdev, double x0, double y0, double x,
- double y, gx_path_type_t type));
-static int
-lips4v_lineto(P6
- (gx_device_vector * vdev, double x0, double y0, double x,
- double y, gx_path_type_t type));
-static int
-lips4v_curveto(P10
- (gx_device_vector * vdev, double x0, double y0, double x1,
- double y1, double x2, double y2, double x3, double y3,
- gx_path_type_t type));
-static int
-lips4v_closepath(P6
- (gx_device_vector * vdev, double x, double y, double x_start,
- double y_start, gx_path_type_t type));
-
-static int lips4v_endpath(P2(gx_device_vector * vdev, gx_path_type_t type));
-#endif
static int lips4v_setlinewidth(gx_device_vector * vdev, double width);
static int lips4v_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
static int lips4v_setlinejoin(gx_device_vector * vdev, gs_line_join join);
@@ -311,9 +273,7 @@ static const gx_device_vector_procs lips4v_vector_procs = {
lips4v_setflat,
lips4v_setlogop,
/* Other state */
-#if GS_VERSION_MAJOR >= 8
lips4v_can_handle_hl_color, /* can_handle_hl_color (dummy) */
-#endif
lips4v_setfillcolor, /* fill & stroke colors are the same */
lips4v_setstrokecolor,
/* Paths */
@@ -1070,13 +1030,8 @@ lips4v_setmiterlimit(gx_device_vector * vdev, double limit)
return 0;
}
-#if GS_VERSION_MAJOR >= 8
static int
lips4v_setfillcolor(gx_device_vector * vdev, const gs_gstate * pgs, const gx_drawing_color * pdc)
-#else
-static int
-lips4v_setfillcolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
{
if (!gx_dc_is_pure(pdc))
@@ -1138,13 +1093,8 @@ lips4v_setfillcolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
return 0;
}
-#if GS_VERSION_MAJOR >= 8
static int
lips4v_setstrokecolor(gx_device_vector * vdev, const gs_gstate * pgs, const gx_drawing_color * pdc)
-#else
-static int
-lips4v_setstrokecolor(gx_device_vector * vdev, const gx_drawing_color * pdc)
-#endif
{
if (!gx_dc_is_pure(pdc))
return_error(gs_error_rangecheck);
@@ -1280,7 +1230,6 @@ lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
return 0;
}
-#if GS_VERSION_MAJOR >= 8
/*--- added for Ghostscritp 8.15 ---*/
static int
lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs1,
@@ -1288,7 +1237,6 @@ lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs1,
{
return false; /* High level color is not implemented yet. */
}
-#endif
static int
lips4v_beginpath(gx_device_vector * vdev, gx_path_type_t type)
@@ -1438,21 +1386,15 @@ lips4v_open(gx_device * dev)
/****** WRONG ******/
vdev->vec_procs = &lips4v_vector_procs;
-#if GS_VERSION_MAJOR >= 8
- code = gdev_vector_open_file_options(vdev, 512,
+ code = gdev_vector_open_file_options(vdev, 512,
(VECTOR_OPEN_FILE_SEQUENTIAL|VECTOR_OPEN_FILE_BBOX));
-#else
- code = gdev_vector_open_file_bbox(vdev, 512, true);
-#endif
if (code < 0)
return code;
-#if GS_VERSION_MAJOR >= 8
- if (pdev->bbox_device != NULL) {
- if (pdev->bbox_device->memory == NULL)
- pdev->bbox_device->memory = gs_memory_stable(dev->memory);
- }
-#endif
+ if (pdev->bbox_device != NULL) {
+ if (pdev->bbox_device->memory == NULL)
+ pdev->bbox_device->memory = gs_memory_stable(dev->memory);
+ }
gdev_vector_init(vdev);
pdev->first_page = true;
@@ -1874,11 +1816,7 @@ lips4v_copy_mono(gx_device * dev, const byte * data,
gx_drawing_color dcolor;
color_set_pure(&dcolor, one);
-#if GS_VERSION_MAJOR >= 8
lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
if (lips4v_copy_text_char(dev, data, raster, id, x, y, w, h) >= 0)
return 0;
@@ -1978,13 +1916,8 @@ lips4v_copy_mono(gx_device * dev, const byte * data,
}
color_set_pure(&color, one);
-#if GS_VERSION_MAJOR >= 8
code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
NULL, &color);
-#else
- code = gdev_vector_update_fill_color((gx_device_vector *) pdev,
- &color);
-#endif
}
if (code < 0)
return 0;
@@ -2061,11 +1994,7 @@ lips4v_copy_color(gx_device * dev,
/* LIPS IV ではグレースケールも単色イメージ・カラー指定命令に
影響されるので黒色を指定しなければならない。 */
color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
} else {
if (pdev->TextMode) {
sputc(s, LIPS_CSI);
@@ -2131,11 +2060,7 @@ lips4v_fill_mask(gx_device * dev,
if (w <= 0 || h <= 0)
return 0;
if (depth > 1 ||
-#if GS_VERSION_MAJOR >= 8
gdev_vector_update_fill_color(vdev, NULL, pdcolor) < 0 ||
-#else
- gdev_vector_update_fill_color(vdev, pdcolor) < 0 ||
-#endif
gdev_vector_update_clip_path(vdev, pcpath) < 0 ||
gdev_vector_update_log_op(vdev, lop) < 0)
return gx_default_fill_mask(dev, data, data_x, raster, id,
@@ -2276,11 +2201,7 @@ lips4v_begin_image(gx_device * dev,
/* LIPS IV ではグレースケールも単色イメージ・カラー指定命令に
影響されるので黒色を明示的に指定しなければならない。 */
color_set_pure(&dcolor, vdev->black);
-#if GS_VERSION_MAJOR >= 8
lips4v_setfillcolor(vdev, NULL, &dcolor);
-#else
- lips4v_setfillcolor(vdev, &dcolor);
-#endif
}
if (pim->ImageMask || (pim->BitsPerComponent == 1 && num_components == 1)) {
if (pim->Decode[0] > pim->Decode[1])
diff --git a/contrib/lips4/gdevlprn.h b/contrib/lips4/gdevlprn.h
index 6b9245a70..de04ed3ac 100644
--- a/contrib/lips4/gdevlprn.h
+++ b/contrib/lips4/gdevlprn.h
@@ -31,13 +31,8 @@
#include "gdevprn.h"
-#if GS_VERSION_MAJOR >= 8
#define lprn_dev_proc_image_out(proc)\
void proc(gx_device_printer *, gp_file *, int, int, int, int)
-#else
-#define lprn_dev_proc_image_out(proc)\
- void proc(P6(gx_device_printer *, gp_file *, int, int, int, int))
-#endif
#define dev_proc_image_out(proc) lprn_dev_proc_image_out(proc)
diff --git a/contrib/opvp/gdevopvp.c b/contrib/opvp/gdevopvp.c
index 70475add3..60276f3fa 100644
--- a/contrib/opvp/gdevopvp.c
+++ b/contrib/opvp/gdevopvp.c
@@ -170,12 +170,7 @@ static int oprp_open(gx_device *);
static void opvp_get_initial_matrix(gx_device *, gs_matrix *);
static int opvp_output_page(gx_device *, int, int);
static int opvp_close(gx_device *);
-#if GS_VERSION_MAJOR >= 8
static gx_color_index opvp_map_rgb_color(gx_device *, const gx_color_value *); /* modified for gs 8.15 */
-#else
-static gx_color_index opvp_map_rgb_color(gx_device *, gx_color_value,
- gx_color_value, gx_color_value);
-#endif
static int opvp_map_color_rgb(gx_device *, gx_color_index, gx_color_value *);
static int opvp_copy_mono(gx_device *, const byte *, int, int,
gx_bitmap_id, int, int, int, int,
@@ -221,14 +216,9 @@ static int opvp_setdash(gx_device_vector *, const float *, uint, double);
static int opvp_setflat(gx_device_vector *, double);
static int opvp_setlogop(gx_device_vector *, gs_logical_operation_t,
gs_logical_operation_t);
-#if GS_VERSION_MAJOR >= 8
static int opvp_can_handle_hl_color(gx_device_vector *, const gs_gstate *, const gx_drawing_color *);
static int opvp_setfillcolor(gx_device_vector *, const gs_gstate *, const gx_drawing_color *);
static int opvp_setstrokecolor(gx_device_vector *, const gs_gstate *,const gx_drawing_color *);
-#else
-static int opvp_setfillcolor(gx_device_vector *, const gx_drawing_color *);
-static int opvp_setstrokecolor(gx_device_vector *, const gx_drawing_color *);
-#endif
static int opvp_vector_dopath(gx_device_vector *, const gx_path *,
gx_path_type_t, const gs_matrix *);
static int opvp_vector_dorect(gx_device_vector *, fixed, fixed, fixed, fixed,
@@ -373,9 +363,7 @@ static gx_device_vector_procs opvp_vector_procs =
opvp_setflat,
opvp_setlogop,
/* Other state */
-#if GS_VERSION_MAJOR >= 8
opvp_can_handle_hl_color, /* added for gs 8.15 */
-#endif
opvp_setfillcolor,
opvp_setstrokecolor,
/* Paths */
@@ -1931,11 +1919,9 @@ prepare_open(gx_device *dev)
dev->color_info.dither_grays = 256;
dev->color_info.dither_colors = 256;
}
-#if GS_VERSION_MAJOR >= 8
dev->procs.get_color_mapping_procs = NULL;
dev->procs.get_color_comp_index = NULL;
gx_device_fill_in_procs(dev);
-#endif
}
/* call Closerinter as dummy */
@@ -2050,13 +2036,11 @@ opvp_open(gx_device *dev)
}
rdev = (gx_device_oprp *)(dev);
pdev = (gx_device_opvp *)(dev);
-#if GS_VERSION_MAJOR >= 8
if (pdev->bbox_device != NULL) {
if (pdev->bbox_device->memory == NULL) {
pdev->bbox_device->memory = gs_memory_stable(dev->memory);
}
}
-#endif
outputFD = fileno(gp_get_file(pdev->file));
} else {
/* open printer device */
@@ -2479,17 +2463,9 @@ opvp_close(gx_device *dev)
/*
* map rgb color
*/
-#if GS_VERSION_MAJOR >= 8
static gx_color_index
opvp_map_rgb_color(gx_device *dev,
const gx_color_value *prgb /* modified for gs 8.15 */)
-#else
-static gx_color_index
-opvp_map_rgb_color(gx_device *dev,
- gx_color_value r,
- gx_color_value g,
- gx_color_value b)
-#endif
{
opvp_cspace_t cs;
uint c, m, y, k;
@@ -2499,12 +2475,10 @@ opvp_map_rgb_color(gx_device *dev,
opvp_result_t r;
#endif
-#if GS_VERSION_MAJOR >= 8
gx_color_value r, g, b; /* added for gs 8.15 */
r = prgb[0];
g = prgb[1];
b = prgb[2];
-#endif
#if ENABLE_SIMPLE_MODE
cs = colorSpace;
@@ -2565,31 +2539,19 @@ opvp_map_rgb_color(gx_device *dev,
;
break;
case OPVP_CSPACE_DEVICEGRAY:
-#if GS_VERSION_MAJOR >= 8
{
gx_color_value rgb[3];
rgb[0] = rgb[1] = rgb[2] = r;
return gx_default_gray_map_rgb_color(dev, rgb);
}
-#else
- return gx_default_gray_map_rgb_color(dev, r, g, b);
-#endif
break;
case OPVP_CSPACE_BW :
-#if GS_VERSION_MAJOR >= 8
return gx_default_b_w_map_rgb_color(dev, prgb);
-#else
- return gx_default_b_w_map_rgb_color(dev, r, g, b);
-#endif
break;
case OPVP_CSPACE_STANDARDRGB:
case OPVP_CSPACE_DEVICEKRGB:
default:
-#if GS_VERSION_MAJOR >= 8
return gx_default_rgb_map_rgb_color(dev, prgb);
-#else
- return gx_default_rgb_map_rgb_color(dev, r, g, b);
-#endif
break;
}
}
@@ -3584,11 +3546,7 @@ opvp_fill_mask(
{
if (vector) {
int code;
-#if GS_VERSION_MAJOR >= 8 /* for gs 8.15 */
code = gdev_vector_update_fill_color((gx_device_vector *)dev, NULL, pdcolor);
-#else
- code = gdev_vector_update_fill_color((gx_device_vector *)dev, pdcolor);
-#endif
if (code < 0) return code;
code = gdev_vector_update_clip_path((gx_device_vector *)dev, pcpath);
if (code < 0) return code;
@@ -3687,11 +3645,7 @@ opvp_begin_image(
byte2frac((*(p + 1 + (count * 4)))),
byte2frac((*(p + 2 + (count * 4)))),
byte2frac((*(p + 3 + (count * 4)))),
-#if GS_VERSION_MAJOR >= 9
pgs, rgb, mem);
-#else
- pgs, rgb);
-#endif
*(palette + 0 + (count * 3)) = frac2byte(rgb[0]);
*(palette + 1 + (count * 3)) = frac2byte(rgb[1]);
*(palette + 2 + (count * 3)) = frac2byte(rgb[2]);
@@ -4344,7 +4298,6 @@ opvp_image_plane_data(
}
}
}
-#if GS_VERSION_MAJOR >= 8
if (vinfo->bits_per_pixel == 24) { /* 24bit RGB color */
for (i = 0; i < height; i++) {
ptr = buf + raster_length * i;
@@ -4362,25 +4315,6 @@ opvp_image_plane_data(
}
}
}
-#else
- if (vinfo->bits_per_pixel == 24) { /* 24bit RGB color */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j = 0; j < vinfo->width; j++) {
- ptr[j*3+0] = frac2byte(gx_map_color_frac(pgs, byte2frac(ptr[j*3+0]), effective_transfer.colored.red));
- ptr[j*3+1] = frac2byte(gx_map_color_frac(pgs, byte2frac(ptr[j*3+1]), effective_transfer.colored.green));
- ptr[j*3+2] = frac2byte(gx_map_color_frac(pgs, byte2frac(ptr[j*3+2]), effective_transfer.colored.blue));
- }
- }
- } else if (vinfo->bits_per_pixel == 8) { /* 8bit Gray image */
- for (i = 0; i < height; i++) {
- ptr = buf + raster_length * i;
- for (j = 0; j < vinfo->width; j++) {
- ptr[j] = frac2byte(gx_map_color_frac(pgs, byte2frac(ptr[j]), effective_transfer.colored.gray));
- }
- }
- }
-#endif
/* call TansferDrawImage */
if (apiEntry->opvpTransferDrawImage) {
@@ -4721,29 +4655,22 @@ opvp_setlogop(
return 0;
}
-#if GS_VERSION_MAJOR >= 8
-/*--- added for Ghostscritp 8.15 ---*/
+/*--- added for Ghostscript 8.15 ---*/
static int
opvp_can_handle_hl_color(gx_device_vector * vdev,
const gs_gstate * pgs1, const gx_drawing_color * pdc)
{
return false; /* High level color is not implemented yet. */
}
-#endif
/*
* set fill color
*/
-#if GS_VERSION_MAJOR >= 8
static int
opvp_setfillcolor(
gx_device_vector *vdev,
const gs_gstate *pgs, /* added for gs 8.15 */
const gx_drawing_color *pdc)
-#else
-static int
-opvp_setfillcolor(gx_device_vector *vdev, const gx_drawing_color *pdc)
-#endif
{
gx_device_opvp *pdev = (gx_device_opvp *)vdev;
opvp_result_t r = -1;
@@ -4775,16 +4702,11 @@ opvp_setfillcolor(gx_device_vector *vdev, const gx_drawing_color *pdc)
/*
* set stroke color
*/
-#if GS_VERSION_MAJOR >= 8
static int
opvp_setstrokecolor(
gx_device_vector *vdev,
const gs_gstate *pgs, /* added for gs 8.15 */
const gx_drawing_color *pdc)
-#else
-static int
-opvp_setstrokecolor(gx_device_vector *vdev, const gx_drawing_color *pdc)
-#endif
{
gx_device_opvp *pdev = (gx_device_opvp *)vdev;
opvp_result_t r = -1;