/*
*
* (c) Copyright 1990-1994 Adobe Systems Incorporated.
* All rights reserved.
*
* Permission to use, copy, modify, distribute, and sublicense this software
* and its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notices appear in all copies and that
* both those copyright notices and this permission notice appear in
* supporting documentation and that the name of Adobe Systems Incorporated
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. No trademark license
* to use the Adobe trademarks is hereby granted. If the Adobe trademark
* "Display PostScript"(tm) is used to describe this software, its
* functionality or for any other purpose, such use shall be limited to a
* statement that this software works in conjunction with the Display
* PostScript system. Proper trademark attribution to reflect Adobe's
* ownership of the trademark shall be given whenever any such reference to
* the Display PostScript system is made.
*
* ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
* ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
* TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
* PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
*
* Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
* Incorporated which may be registered in certain jurisdictions
*
* Author: Adobe Systems Incorporated
*/
/* $XFree86$ */
#include <DPS/dpsXclient.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef NeXT
#include <unistd.h>
#endif
#include <DPS/dpsXshare.h>
#include <DPS/dpsXpreview.h>
#include "XDPSpwraps.h"
#include "dpsXcommonI.h"
#include <math.h>
#define SELECT_TYPE int *
#else
#endif
static void FillPixmapWithGray(
double pixelsPerPoint,
int XDPSSetFileFunctions(
{
if (rewindFunc != NULL) {
}
}
return 0;
}
/* ARGSUSED */
{
rewind(f);
}
/* ARGSUSED */
{
}
{
p->nestingLevel = 0;
p->continuedLine = False;
p->binaryCount = 0;
}
}
{
int count;
unsigned len;
return NULL;
}
/* If previous call didn't get a whole line, we're somewhere in the
middle, so don't check for comments. Also, if we're in the middle of
binary data, don't look for comments either. */
if (p->binaryCount != 0) {
else p->binaryCount -= len;
} else if (!p->continuedLine) {
p->nestingLevel++;
if (p->nestingLevel == 0) {
return NULL;
}
else p->nestingLevel--;
}
}
else p->continuedLine = False;
return buf;
}
int depth,
double pixelsPerPoint,
{
Pixmap p;
pixelsPerPoint <= 0) {
return dps_status_illegal_value;
}
}
return dps_status_failure;
}
}
else return dps_status_no_extension;
}
{
float x, y, r, t;
int n;
int nestingLevel = 0;
unsigned long binaryCount = 0;
unsigned len;
while (1) {
return dps_status_failure;
}
/* If in binary data or continued line, ignore everything */
if (binaryCount != 0) {
else binaryCount -= len;
} else if (!continuedLine) {
nestingLevel++;
nestingLevel--;
/* Only check for bounding box comments at nesting level 0 */
} else if (nestingLevel == 0) {
/* If we haven't already hit an (atend), the end of the
comments is a good place to stop looking for the bbox */
return dps_status_failure;
}
&x, &y, &r, &t);
if (n != 4) {
} else return dps_status_failure;
} else {
bb->x = (int) x;
bb->y = (int) y;
return dps_status_success;
}
}
}
}
/* See if this line fills the buffer */
}
}
{
(float) WidthMMOfScreen(screen);
}
{
maxDoubles = max;
}
typedef struct _StatusInfo {
} StatusInfo;
static void SetUpStatusVariables(
unsigned long startReq,
{
StatusList = info;
}
static void SetEndReqNum(
unsigned long endReq)
{
}
static void HandlePreviewStatus(
int status)
{
unsigned long serial;
/* This event is from before our imaging; send to old status proc. */
return;
}
/* This event is from during our imaging; ignore it */
/* This event is juuuuust right. */
}
static int FinishUp(
{
static char restorebuf[] =
"\n$Adobe$DPS$Lib$Dict /EPSFsave get restore grestore\n";
int err;
/* Check the results of the imaging: Get the error status and restore the
context */
/* Can't do this is a wrap because of restore semantics */
(void) XDPSPopContextParameters(cookie);
/* See if we have an info record and delete it if so */
}
if (err) return dps_status_postscript_error;
else return dps_status_success;
}
{
int status;
}
}
{
}
int drawableHeight,
int drawableDepth,
double pixelsPerPoint,
{
stop\n\
Magic end of data line )))))))))) 99#2 2#99 <xyz> // 7gsad,32h4ghNmndFgj2\n";
unsigned int flags = 0;
int status;
int doublings;
int ms;
drawableHeight <= 0 || drawableDepth <= 0 ||
pixelsPerPoint <= 0) {
return dps_status_illegal_value;
}
return dps_status_no_extension;
}
}
if (!waitForCompletion) {
/* Any status events before this point go to old handler */
}
if (!inited) {
}
if (createMask) {
rgbMap.base_pixel = 0;
}
/* Prepare to read PostScript code */
}
/* This marks the end of the data stream */
if (!waitForCompletion) {
/* Check for done until we run out of time */
doublings = 0;
while (1) {
break;
}
if (doublings >= maxDoubles) break;
/* Wait a while */
ms *= 2;
doublings++;
}
}
/* If previous decided imaging is done, it changed waitForCompletion */
else {
return dps_status_imaging_incomplete;
}
}
static void FillPixmapWithGray(
double pixelsPerPoint,
{
XGCValues v;
if (createMask) {
v.foreground = 1;
return;
}
v.stipple = grayStipple;
GCStipple | GCFillStyle, &v);
}