Beispiel #1
0
PAPERINFO * PRpaperinfoOriginal (PAPERCODE size, int xres, int yres)
{
	int i;
	PAPERINFO  *p, * papers;
        papers = (PAPERINFO*)malloc(115 * sizeof(PAPERINFO));
	i = PRpapertable(papers, xres, yres);

	for (p = papers; i > 0; i--, p++) {
		/*ASSERT(p);*/
		if (p->OMcode == size) {
#ifdef LONG_EDGE_FEED
		/*	For these four sizes, we have matched pairs of entries in the table,
		 *	with the short-edge version preceeding the long-edge version, such that
		 *	when we have the first one in 'p', the second is implicitly at 'p+1'.
		 *	The option that we are interrogating is normally implemented, for Core
		 *	testing, by the "-L" command-line switch; for porting/customer purposes,
		 *	this may have to be modified.  (A long-edge version of A3, for example,
		 *	is quite unlikely in a typical printer.)
		 *
		 *	Because this OM call will lock a semaphore, it is inadvisable to call
		 *	PRpaperinfo() before the Options Manager has been initialized.
		 *	If this proves to be a problem, Core can replace the option with
		 *	a simple global flag; customers might need something more elaborate.
		 */
			  if (p->OMcode == PAPERSIZE_A4 && OMGetCurrentBool(LONGEDGEFEED, OMPRINTER))
			    return (p + 1);
			   else if (p->OMcode == PAPERSIZE_LETTER && OMGetCurrentBool(LONGEDGEFEED, OMPRINTER))
			    return (p + 1);
#endif
			return p;
		}
	}
	return NULL;
return papers;
}
Beispiel #2
0
void PRpaperPair (PAPERCODE OMsize, int xres, int yres, OMenum *LongEdge, OMenum *ShortEdge )
{
    int nPapers,retval;
    const PAPERINFO *paperInfo, *paperInfo2;
    PAPERINFO  * papers;
    papers = (PAPERINFO*)malloc(115 * sizeof(PAPERINFO));    
	retval = Map_Page_Size(OMsize,GET_OMCODE);
	OMsize=retval;	
    paperInfo = PRpaperinfoOriginal (OMsize, xres, yres);
    /*ASSERT(paperInfo);*/
    nPapers = PRpapertable(papers, xres, yres);
	/*ASSERT(LongEdge && ShortEdge);*/
    *LongEdge = *ShortEdge = 0;

    if( paperInfo != (papers+nPapers) ) {    /* 'paperInfo' is not last table */
        paperInfo2 = paperInfo + 1; /* check next PAPERINFO */
	        if ( paperInfo->PCLpaperID == paperInfo2->PCLpaperID ) {
#ifdef SYS_CHECK_DIRECTION
            if ( PrintSysGetPaperInfo(paperInfo->OMcode) )
#endif
            *ShortEdge = paperInfo->OMcode;
#ifdef SYS_CHECK_DIRECTION
            if ( PrintSysGetPaperInfo(paperInfo2->OMcode) )
#endif
            *LongEdge = paperInfo2->OMcode;
			
			retval = Map_Page_Size(*ShortEdge,GET_PCL_SIZE);
	        *ShortEdge=retval;	
			retval = Map_Page_Size(*LongEdge,GET_PCL_SIZE);
	        *LongEdge=retval;	
			return;
        }
    }

    if( paperInfo != papers ) {  /* 'paperInfo' is not first table*/
        paperInfo2 = paperInfo - 1; /* check previous PAPERINFO */
            if ( paperInfo->PCLpaperID == paperInfo2->PCLpaperID ) {
#ifdef SYS_CHECK_DIRECTION
            if ( PrintSysGetPaperInfo(paperInfo2->OMcode) )
#endif
            *ShortEdge = paperInfo2->OMcode;
#ifdef SYS_CHECK_DIRECTION
            if ( PrintSysGetPaperInfo(paperInfo->OMcode) )
#endif
            *LongEdge = paperInfo->OMcode;
			retval = Map_Page_Size(*ShortEdge,GET_PCL_SIZE);
	        *ShortEdge=retval;	
			retval = Map_Page_Size(*LongEdge,GET_PCL_SIZE);
	        *LongEdge=retval;	
            return;
        }
    }

    *ShortEdge = paperInfo->OMcode; /*Not found pair code*/
	retval = Map_Page_Size(*ShortEdge,GET_PCL_SIZE);
	*ShortEdge=retval;	
}
Beispiel #3
0
const PAPERINFO * PRpaperfirst(Sint32 code, int xres, int yres, int (*comp)())
{
    int nPapers;
    PAPERINFO * papers;

    nPapers = PRpapertable(&papers, xres, yres);
    curPaper = papers;
    endPaper = papers+nPapers;
    /*ASSERT(comp && curPaper);*/

    while (curPaper != endPaper) {
        if ((*comp)(code, curPaper) == TRUE)
            if (PrintSysGetPaperInfo(curPaper->OMcode))
            return curPaper ++;
        curPaper ++;
    }
    return (PAPERINFO *)NULL;       /* not found */
}