commit 17d81237615b92cd658f1d55fa2d463da4f2b8d4
parent a40b7292b0027e2cd8568e325dc67da5cbb6b597
Author: Kyle Milz <krwmilz@gmail.com>
Date: Fri, 20 Aug 2021 21:51:47 +0000
Remove PS_DPS support
Diffstat:
D | psdps.c | | | 828 | ------------------------------------------------------------------------------- |
M | special.c | | | 6 | ------ |
M | xdvi.c | | | 9 | --------- |
M | xdvi.h | | | 8 | +------- |
4 files changed, 1 insertion(+), 850 deletions(-)
diff --git a/psdps.c b/psdps.c
@@ -1,828 +0,0 @@
-/*========================================================================*\
-
-Copyright (c) 1994-2002 Paul Vojta
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-NOTES:
- This code was originally written by Ricardo Telichevesky
- (ricardo@rle-vlsi-mit.edu) and Luis Miguel Silveira
- (lms@rle-vlsi-mit.edu).
- It was largely influenced by similar code in the SeeTeX/XTeX
- package by Dirk Grunwald (grunwald@colorado.edu).
-
-\*========================================================================*/
-
-#include "xdvi.h"
-#include <errno.h>
-#include <signal.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <DPS/XDPSlib.h>
-#include <DPS/dpsXclient.h>
-#include <DPS/dpsexcept.h>
-#include <DPS/dpsclient.h>
-
-#if defined(sun) || defined(__sun)
-#ifndef SUNHACK
-#define SUNHACK 1
-#endif
-#endif
-
-
- /*
- * This string reads chunks (delimited by %%xdvimark).
- * The first character of a chunk tells whether a given chunk
- * is to be done within save/restore or not.
- * The `H' at the end tells it that the first group is a
- * header; i.e., no save/restore.
- */
-#if !SUNHACK
-static char preamble[] = "\
-/xdvi$line 81 string def \
-/xdvi$run {{$error null ne {$error /newerror false put}if \
- currentfile cvx stopped \
- $error null eq {false} {$error /newerror get} ifelse and \
- {handleerror} if} stopped pop} def \
-/xdvi$dslen countdictstack def \
-{currentfile read not {exit} if 72 eq \
- {xdvi$run} \
- {/xdvi$sav save def xdvi$run \
- clear countdictstack xdvi$dslen sub {end} repeat xdvi$sav restore} \
- ifelse \
- {(%%xdvimark) currentfile xdvi$line {readline} stopped \
- {clear} {pop eq {exit} if} ifelse }loop \
- (xdvi$Ack\n) print flush \
-}loop\nH";
-#else /* SUNHACK */
-static char preamble[] = "\
-/xdvi$line 81 string def \
-/xdvi$run {{$error null ne {$error /newerror false put}if \
- currentfile cvx stopped \
- $error null eq {false} {$error /newerror get} ifelse and \
- {handleerror} if} stopped pop} def \
-/xdvi$dslen countdictstack def \
-/xdvi$ack {{(%%xdvimark) currentfile xdvi$line {readline} stopped \
- {clear} {pop eq {exit} if} ifelse }loop \
- (xdvi$Ack\n) print flush} bind def \
-errordict begin /interrupt{(xdvi$Int\n) print flush stop}bind def \
-end \
-{{currentfile read not {exit} if 72 eq \
- {xdvi$run} \
- {/xdvi$sav save def xdvi$run \
- clear countdictstack xdvi$dslen sub {end} repeat xdvi$sav restore} \
- ifelse \
- xdvi$ack \
- }loop \
-xdvi$ack \
-}loop\nH";
-#endif /* SUNHACK */
-
-extern const char psheader[];
-extern unsigned psheaderlen;
-
-#define postscript resource._postscript
-
-
-/* global procedures (besides initDPS) */
-
-static void toggleDPS ARGS((void));
-static void destroyDPS ARGS((void));
-static void interruptDPS ARGS((void));
-static void endpageDPS ARGS((void));
-static void drawbeginDPS ARGS((int, int, const char *));
-static void drawrawDPS ARGS((const char *));
-static void drawfileDPS ARGS((const char *, FILE *));
-static void drawendDPS ARGS((const char *));
-static void beginheaderDPS ARGS((void));
-static void endheaderDPS ARGS((void));
-static void newdocDPS ARGS((void));
-
-static struct psprocs dps_procs = {
- /* toggle */ toggleDPS,
- /* destroy */ destroyDPS,
- /* interrupt */ interruptDPS,
- /* endpage */ endpageDPS,
- /* drawbegin */ drawbeginDPS,
- /* drawraw */ drawrawDPS,
- /* drawfile */ drawfileDPS,
- /* drawend */ drawendDPS,
- /* beginheader */ beginheaderDPS,
- /* endheader */ endheaderDPS,
- /* newdoc */ newdocDPS};
-
-#define DPS_MASK_NORMAL EV_GE_NEWPAGE
-#define DPS_MASK_HEADER EV_GE_PS_TOGGLE
-#define DPS_MASK_INIT (EV_GE_TERM | EV_PS_TOGGLE)
-
-static DPSContext DPS_ctx = NULL;
-static DPSSpace DPS_space = NULL;
-static int DPS_mag; /* magnification currently in use */
-static int DPS_shrink; /* shrink factor currently in use */
-static Boolean DPS_active; /* if we've started a page */
-static int DPS_pending; /* number of ack's we're expecting */
-static Boolean DPS_in_header; /* if we're sending a header */
-static Boolean DPS_in_doc; /* if we've sent header information */
-static int DPS_ev_mask = DPS_MASK_NORMAL;
- /* events for which we'll stop */
-
-#if 0
-static void DPSErrorProcHandler();
-#else
-#define DPSErrorProcHandler DPSDefaultErrorProc
-#endif
-
-
-static char ackstr[] = "xdvi$Ack\n";
-#if SUNHACK
-static char intstr[] = "xdvi$Int\n";
-static char intstr2[] = "xdvi$In2\n";
-#endif
-
-#define LINELEN 81
-#define BUFLEN (LINELEN + sizeof(ackstr))
-static char line[BUFLEN + 1];
-static char *linepos = line;
-
-/* ARGSUSED */
-static void
-TextProc(ctxt, buf, count)
- DPSContext ctxt;
- char *buf;
- unsigned long count;
-{
- int i;
- char *p;
- char *p0;
-
- while (count > 0) {
- i = line + BUFLEN - linepos;
- if (i > count) i = count;
- (void) bcopy(buf, linepos, i);
- linepos += i;
- buf += i;
- count -= i;
- p0 = line;
- for (;;) {
- if (p0 >= linepos) {
- linepos = line;
- break;
- }
- p = memchr(p0, '\n', linepos - p0);
- if (p == NULL) {
- if (p0 != line) {
- (void) bcopy(p0, line, linepos - p0);
- linepos -= p0 - line;
- }
- else if (linepos == line + BUFLEN) {
- char c;
-
- c = line[LINELEN];
- line[LINELEN] = '\0';
- Printf("DPS: %s\n", line);
- line[LINELEN] = c;
- linepos -= LINELEN;
- (void) bcopy(line + LINELEN, line, linepos - line);
- }
- break;
- }
- if (p >= p0 + 8 && memcmp(p - 8, ackstr, 9) == 0) {
- --DPS_pending;
- if (DPS_pending == 0)
- ev_flags |= EV_ACK;
- if (debug & DBG_PS)
- Printf("Got DPS ack; %d pending.\n", DPS_pending);
- ++p;
- (void) bcopy(p, p - 9, linepos - p);
- linepos -= 9;
- continue;
- }
-#if SUNHACK
- if (p >= p0 + 8 && memcmp(p - 8, intstr, 9) == 0) {
- if (debug & DBG_PS)
- Puts("Got DPS int.");
- ++p;
- (void) bcopy(p, p - 9, linepos - p);
- linepos -= 9;
- ev_flags |= EV_ACK;
- continue;
- }
- if (p >= p0 + 8 && memcmp(p - 8, intstr2, 9) == 0) {
- if (debug & DBG_PS)
- Puts("Got DPS int 2.");
- ++p;
- (void) bcopy(p, p - 9, linepos - p);
- linepos -= 9;
- DPS_pending = 3;
- continue;
- }
-#endif /* SUNHACK */
- *p = '\0';
- Printf("DPS: %s\n", p0);
- p0 = p + 1;
- }
- }
-}
-
-
-/*---------------------------------------------------------------------------*
- waitack()
-
- Arguments: none.
-
- Returns: (void)
-
- Description:
- Waits until the requisite number of acknowledgements has been received from
- the context.
-
-+----------------------------------------------------------------------------*/
-
-#if SUNHACK
-static void DPS_alarm ARGS((struct xtimer *));
-
-static struct xtimer DPS_timer = TIMER_INIT(DPS_alarm);
-static Boolean DPS_timer_set;
-
-static void
-DPS_alarm(arg)
- struct xtimer *arg;
-{
- if (debug & DBG_PS)
- Puts("Received DPS alarm");
-
- DPS_timer_set = False;
- ev_flags |= EV_ACK;
-}
-#endif /* SUNHACK */
-
-static void
-waitack()
-{
- if (DPS_pending <= 0)
- return;
-
- DPSFlushContext(DPS_ctx);
- if (read_events(DPS_ev_mask | EV_ACK) & EV_ACK) {
- ev_flags &= ~EV_ACK;
- return;
- }
-
- if (debug & DBG_PS)
- Printf("Interrupting DPS in waitack(); code is now %d %x\n",
- XDPSGetContextStatus(DPS_ctx), ev_flags);
-
- DPS_active = DPS_in_header = DPS_in_doc = False;
- DPS_ev_mask = DPS_MASK_NORMAL;
-
- /*
- * I would really like to use DPSInterruptContext() here, but (at least
- * on an RS6000) I can't get it to work.
- */
-
-#if SUNHACK
-
- /*
- * On the other hand, under OpenWindows 3.3 (at least), destroying and
- * re-creating contexts has a nasty habit of crashing the server.
- */
-
- DPS_pending = 32767;
- DPSInterruptContext(DPS_ctx);
- DPSFlushContext(DPS_ctx);
- (void) read_events(EV_GE_TERM | EV_ACK);
- ev_flags &= ~EV_ACK;
-
- XSync(DISP, False);
- DPSPrintf(DPS_ctx, " stop\n%%%%xdvimark\n stop\n%%%%xdvimark\n");
- DPSPrintf(DPS_ctx," (xdvi$In2\n) print flush stop\n%%%%xdvimark\n");
- DPSPrintf(DPS_ctx, " stop\n%%%%xdvimark\n stop\n%%%%xdvimark\n");
- DPSFlushContext(DPS_ctx);
-
- if (debug & DBG_PS)
- Puts("Setting DPS timer");
- DPS_timer_set = True;
- set_timer(&DPS_timer, 500);
- (void) read_events(EV_GE_TERM | EV_ACK);
- ev_flags &= ~EV_ACK;
-
- if (DPS_pending <= 0) {
- if (DPS_timer_set) cancel_timer(&DPS_timer);
- return;
- }
-
- /*
- * However, under Solaris 2.6 (at least), sometimes interrupting the
- * context leaves it in an uncommunicative state, so destruction
- * is the only alternative.
- */
-
- if (debug & DBG_PS)
- Puts("Plan B: Destroying DPS context");
-
-#endif /* SUNHACK */
-
- DPSDestroyContext(DPS_ctx);
- DPS_ctx = NULL;
- DPS_pending = 0;
-}
-
-
-/*---------------------------------------------------------------------------*
- initDPS()
-
- Arguments: (none)
- Returns: (void)
- Side-Effects: DPS_ctx may be set as well as other static variables.
-
- Description:
- Initializes variables from the application main loop. Checks to see if
- a connection to the DPS server can be opened.
-
-+----------------------------------------------------------------------------*/
-
-static int
-get_shift(mask)
- Pixel mask;
-{
- int k;
-
- for (k = 0; (mask & 1) == 0; ++k)
- mask >>= 1;
- return k;
-}
-
-Boolean
-initDPS()
-{
-
- /* Try to create a context */
-
-#if GREY
-
- if (our_colormap == DefaultColormapOfScreen(SCRN))
- DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, copyGC, 0, 0,
- TextProc, DPSDefaultErrorProc, NULL);
- else {
- static XStandardColormap *ccube = NULL;
- static XStandardColormap *grayramp = NULL;
- int shift;
-
- if (grayramp == NULL) {
- grayramp = XAllocStandardColormap();
- if (grayramp == NULL)
- return False;
- }
-
- if (ccube == NULL) {
- ccube = XAllocStandardColormap();
- if (ccube == NULL)
- return False;
- }
-
- shift = get_shift(our_visual->red_mask);
- ccube->red_max = our_visual->red_mask >> shift;
- ccube->red_mult = 1 << shift;
-
- shift = get_shift(our_visual->green_mask);
- ccube->green_max = our_visual->green_mask >> shift;
- ccube->green_mult = 1 << shift;
-
- shift = get_shift(our_visual->blue_mask);
- ccube->blue_max = our_visual->blue_mask >> shift;
- ccube->blue_mult = 1 << shift;
-
- grayramp->red_max = ccube->red_max & ccube->green_max
- & ccube->blue_max;
- grayramp->red_mult = ccube->red_mult + ccube->green_mult
- + ccube->blue_mult;
-
- ccube->colormap = grayramp->colormap = our_colormap;
- ccube->visualid = grayramp->visualid = our_visual->visualid;
-
- DPS_ctx = XDPSCreateContext(DISP, mane.win, copyGC, 0, 0,
- 0, grayramp, ccube,
- /* actual */ (ccube->red_max + 1) * (ccube->green_max + 1)
- * (ccube->blue_max + 1),
- TextProc, DPSDefaultErrorProc, NULL);
- }
-
-#else /* not GREY */
-
- DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, copyGC, 0, 0,
- TextProc, DPSDefaultErrorProc, NULL);
-
-#endif /* not GREY */
-
- if (DPS_ctx == NULL)
- return False;
-
- DPS_mag = DPS_shrink = -1;
- DPS_active = False;
- DPS_pending = 1;
-
- DPS_space = DPSSpaceFromContext(DPS_ctx);
- DPSWritePostScript(DPS_ctx, preamble, sizeof(preamble) - 1);
- DPSWritePostScript(DPS_ctx, (char *) psheader, psheaderlen);
- DPSPrintf(DPS_ctx, "matrix setmatrix stop\n%%%%xdvimark\n");
- DPSFlushContext(DPS_ctx);
-
- psp = dps_procs;
- return True;
-}
-
-
-/*---------------------------------------------------------------------------*
- toggleDPS()
-
- Arguments: none
- Returns: (void)
- Side-Effects: psp.drawbegin is changed.
-
- Description:
- Used to toggle the rendering of PostScript by the DPS server
- This routine may be called from within read_events().
-
-+----------------------------------------------------------------------------*/
-
-static void
-toggleDPS()
-{
- if (debug & DBG_PS) Puts("Toggling DPS on or off");
-
- psp.drawbegin = (postscript ? drawbeginDPS : drawbegin_none);
-}
-
-
-/*---------------------------------------------------------------------------*
- destroyDPS()
-
- Arguments: none
- Returns: (void)
- Side-Effects: the context is nulled out and destroyed.
-
- Description:
- Close the connection to the DPS server; used when rendering is terminated
- in any way.
-
-+----------------------------------------------------------------------------*/
-
-static void
-destroyDPS()
-{
- if (debug & DBG_PS)
- Puts("Calling destroyDPS()");
- if (linepos > line) {
- *linepos = '\0';
- Printf("DPS: %s\n", line);
- }
- DPSDestroySpace(DPS_space);
- psp = no_ps_procs;
- scanned_page = scanned_page_ps = scanned_page_reset;
-}
-
-
-/*---------------------------------------------------------------------------*
- interruptDPS()
-
- Arguments: none
- Returns: (void)
- Side-Effects: the context may be nulled out and destroyed.
-
- Description:
- Close the connection to the DPS server; used when rendering is terminated
- because of an interruption in the viewing of the current page.
-
-+----------------------------------------------------------------------------*/
-
-static void
-interruptDPS()
-{
-
- if (debug & DBG_PS)
- Puts("Running interruptDPS()");
-
- if (DPS_pending <= 0)
- return; /* nothing to do */
-
- if (DPS_active) {
- DPSPrintf(DPS_ctx, "stop\n%%%%xdvimark\n");
- DPS_active = False;
- }
-
- waitack();
-}
-
-
-/*---------------------------------------------------------------------------*
- endpageDPS()
-
- Arguments: none
- Returns: (void)
- Side-Effects: the DPS_active variable is cleared.
-
- Description:
- Should be called at the end of a page to end this chunk for the DPS server.
-
-+----------------------------------------------------------------------------*/
-
-static void
-endpageDPS()
-{
- if (DPS_active) {
- if (debug & DBG_PS)
- Puts("Endpage sent to context");
- DPSPrintf(DPS_ctx, "stop\n%%%%xdvimark\n");
- DPS_active = False;
- waitack();
- }
-}
-
-
-/*
- * checkDPS - Check that the DPS interpreter is still running.
- * Return True for success, False for failure.
- */
-
-static Boolean
-checkDPS()
-{
- /* static char faulty_display_vs[]
- * ="DECWINDOWS DigitalEquipmentCorporation UWS4.2LA"; */
-
- if (DPS_ctx == NULL) {
- DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, copyGC, 0, 0,
- TextProc, DPSErrorProcHandler, DPS_space);
- if (DPS_ctx == NULL) {
- psp = no_ps_procs;
- draw_bbox();
- return False;
- }
- DPSWritePostScript(DPS_ctx, preamble, sizeof(preamble) - 1);
- /* it already has psheader */
- DPSPrintf(DPS_ctx, "matrix setmatrix stop\n%%%%xdvimark\n");
- DPS_mag = DPS_shrink = -1;
- DPS_active = False;
- DPS_pending = 1;
- }
-
- return True;
-}
-
-
-/*---------------------------------------------------------------------------*
- drawbeginDPS ()
-
- Arguments: xul, yul - coordinates of the upper left corner of the figure
- cp - string with the bounding box line data
- Returns: (void)
- Side-Effects: DPS_ctx is set is set and connection to DPS server is
- opened.
-
- Description:
- Opens a connection to the DPS server and send in the preamble and the
- bounding box information after correctly computing resolution factors.
- In case no rendering is to be done, outlines the figure.
- An outline is also generated whenever the a context cannot be allocated
-
-+----------------------------------------------------------------------------*/
-
-static void
-drawbeginDPS(xul, yul, cp)
- int xul, yul;
- const char *cp;
-{
- if (debug & DBG_PS)
- Printf("Begin drawing at xul= %d, yul= %d.\n", xul, yul);
-
- if (!checkDPS()) return;
-
- if (!DPS_active) {
- /* send initialization to context */
- if (magnification != DPS_mag) {
- DPSPrintf(DPS_ctx, "H TeXDict begin /DVImag %d 1000 div def \
-end stop\n%%%%xdvimark\n",
- DPS_mag = magnification);
- ++DPS_pending;
- }
- if (mane.shrinkfactor != DPS_shrink) {
- DPSPrintf(DPS_ctx, "H TeXDict begin %d %d div dup \
-/Resolution X /VResolution X \
-end stop\n%%%%xdvimark\n",
- pixels_per_inch, DPS_shrink = mane.shrinkfactor);
- ++DPS_pending;
- }
- DPSPrintf(DPS_ctx, " TeXDict begin\n");
- DPS_active = True;
- ++DPS_pending;
- }
-
- if (ev_flags & DPS_MASK_NORMAL)
- longjmp(canit_env, 1);
-
- DPSPrintf(DPS_ctx, "%d %d moveto\n", xul, yul);
- DPSPrintf(DPS_ctx, "%s\n", cp);
-}
-
-
-/*---------------------------------------------------------------------------*
-
- drawrawDPS()
-
- Arguments: cp - the raw string to be sent to the postscript interpreter
- Returns: (void)
- Side-Effects: (none)
-
- Description:
- If there is a valid postscript context, just send the string to the
- interpreter, else leave.
-
-+----------------------------------------------------------------------------*/
-
-static void
-drawrawDPS(cp)
- const char *cp;
-{
- if (!DPS_active || (ev_flags & DPS_ev_mask))
- return;
-
- if (debug & DBG_PS)
- Printf("Sending raw PS to context: %s\n", cp);
-
- DPSPrintf(DPS_ctx,"%s\n", cp);
-}
-
-
-/*---------------------------------------------------------------------------*
- drawfileDPS()
-
- Arguments: cp - string with the postscript file pathname
- psfile - opened file pointer
- Returns: (void)
- Side-Effects: none
-
- Description:
- Postscript file containing the figure is opened and sent to the DPS server.
-
-+----------------------------------------------------------------------------*/
-
-static void
-drawfileDPS(cp, psfile)
- const char *cp;
- FILE *psfile;
-{
- char buffer[1025];
- int blen;
-
- if (DPS_active && !(read_events(EV_NOWAIT) & DPS_ev_mask)) {
- if (debug & DBG_PS)
- Printf("sending file %s\n", cp);
- for (;;) {
- blen = fread(buffer, sizeof(char), 1024, psfile);
- if (blen == 0) break;
- DPSWritePostScript(DPS_ctx, buffer, blen);
- if (read_events(EV_NOWAIT) & DPS_ev_mask) {
- /* ||| stop at a good place */
- if (debug & DBG_PS)
- Puts("Interrupting in drawfileDPS");
- break;
- }
- }
- }
-
- Fclose(psfile);
- ++n_files_left;
-
- if (ev_flags & DPS_ev_mask)
- longjmp(canit_env, 1);
-}
-
-
-/*---------------------------------------------------------------------------*
- drawendDPS()
-
- Arguments: cp - string with indication of the end of the special
- Returns: (void)
- Side-Effects: none
-
- Description:
- Sends the indication of end of the figure PostScript code.
-
-+----------------------------------------------------------------------------*/
-
-static void
-drawendDPS(cp)
- const char *cp;
-{
- if (!DPS_active || (ev_flags & DPS_MASK_NORMAL))
- return;
-
- if (debug & DBG_PS)
- Printf("End PS: %s\n", cp);
- DPSPrintf(DPS_ctx,"%s\n", cp);
-}
-
-
-/*---------------------------------------------------------------------------*
- beginheaderDPS()
-
- Arguments: none
- Returns: (void)
-
- Description:
- Prepares the PostScript interpreter for receipt of header code.
-
-+----------------------------------------------------------------------------*/
-
-static void
-beginheaderDPS()
-{
- if (ev_flags & DPS_MASK_HEADER || !checkDPS())
- return;
-
- if (debug & DBG_PS) Puts("Running beginheaderDPS()");
-
- if (DPS_active) {
- if (!DPS_in_header)
- oops("Internal error in beginheaderDPS().\n");
- return;
- }
-
- DPS_in_header = True;
- DPS_ev_mask = DPS_MASK_HEADER;
-
- if (DPS_in_doc)
- DPSPrintf(DPS_ctx, "H");
- else {
- DPSPrintf(DPS_ctx, "Hsave /xdvi$doc exch def\n");
- DPS_in_doc = True;
- }
- DPS_active = True;
- ++DPS_pending;
-}
-
-
-/*---------------------------------------------------------------------------*
- endheaderDPS()
-
- Arguments: none
- Returns: (void)
-
- Description:
- Prepares the PostScript interpreter for receipt of header code.
-
-+----------------------------------------------------------------------------*/
-
-static void
-endheaderDPS()
-{
- if (debug & DBG_PS) Puts("Running endheaderDPS()");
-
- if (DPS_active) {
- DPSPrintf(DPS_ctx, "stop\n%%%%xdvimark\n");
- DPS_active = False;
- waitack();
- DPS_in_header = False;
- DPS_ev_mask = DPS_MASK_NORMAL;
- }
-}
-
-
-/*---------------------------------------------------------------------------*
- newdocDPS()
-
- Arguments: none
- Returns: (void)
-
- Description:
- Clears out headers stored from the previous document.
-
-+----------------------------------------------------------------------------*/
-
-static void
-newdocDPS()
-{
- if (debug & DBG_PS) Puts("Running newdocDPS()");
-
- if (DPS_in_doc) {
- DPSPrintf(DPS_ctx, "H xdvi$doc restore stop\n%%%%xdvimark\n");
- ++DPS_pending;
- DPS_mag = DPS_shrink = -1;
- DPS_in_doc = False;
- }
-}
diff --git a/special.c b/special.c
@@ -732,12 +732,6 @@ actual_startup()
* Choose DPS then NEWS then Ghostscript if they are available
*/
if (!(
-#ifdef PS_DPS
- (resource.useDPS && initDPS())
-#if defined(PS_NEWS) || defined(PS_GS)
- ||
-#endif
-#endif /* PS_DPS */
#ifdef PS_NEWS
(resource.useNeWS && initNeWS())
diff --git a/xdvi.c b/xdvi.c
@@ -67,7 +67,6 @@ NOTE:
* TEXXET support reflection dvi codes (right-to-left typesetting)
* GREY use grey levels to shrink fonts
* PS_GS use Ghostscript to render pictures/bounding boxes
- * PS_DPS use display postscript to render pictures/bounding boxes
* PS_NEWS use the NeWS server to render pictures/bounding boxes
* GS_PATH path to call the Ghostscript interpreter by
*/
@@ -310,10 +309,6 @@ static XrmOptionDescRec options[] = {
{"+nopostscript",".postscript", XrmoptionNoArg, (XPointer) "on"},
{"-allowshell", ".allowShell", XrmoptionNoArg, (XPointer) "on"},
{"+allowshell", ".allowShell", XrmoptionNoArg, (XPointer) "off"},
-#ifdef PS_DPS
-{"-nodps", ".dps", XrmoptionNoArg, (XPointer) "off"},
-{"+nodps", ".dps", XrmoptionNoArg, (XPointer) "on"},
-#endif
#ifdef PS_NEWS
{"-nonews", ".news", XrmoptionNoArg, (XPointer) "off"},
{"+nonews", ".news", XrmoptionNoArg, (XPointer) "on"},
@@ -516,10 +511,6 @@ static XtResource application_resources[] = {
offset(_postscript), XtRString, "true"},
{"allowShell", "AllowShell", XtRBoolean, sizeof(Boolean),
offset(allow_shell), XtRString, "false"},
-#ifdef PS_DPS
-{"dps", "DPS", XtRBoolean, sizeof(Boolean),
- offset(useDPS), XtRString, "true"},
-#endif
#ifdef PS_NEWS
{"news", "News", XtRBoolean, sizeof(Boolean),
offset(useNeWS), XtRString, "true"},
diff --git a/xdvi.h b/xdvi.h
@@ -218,7 +218,7 @@ unsigned int page_w, page_h;
#define PS_GS 1
#endif
-#if defined(PS_DPS) || defined(PS_NEWS) || defined(PS_GS)
+#if defined(PS_NEWS) || defined(PS_GS)
#define PS 1
#else
#define PS 0
@@ -454,9 +454,6 @@ extern struct _resource {
* we will figure out later on which one we will use */
Boolean _postscript;
Boolean allow_shell;
-#ifdef PS_DPS
- Boolean useDPS;
-#endif
#ifdef PS_NEWS
Boolean useNeWS;
#endif
@@ -1062,9 +1059,6 @@ extern void ps_init_paths(void);
extern void drawbegin_none(int, int, const char *);
extern void draw_bbox(void);
extern void NullProc(void);
-#ifdef PS_DPS
-extern Boolean initDPS(void);
-#endif
#ifdef PS_NEWS
extern Boolean initNeWS(void);
#endif