Пример #1
0
Файл: PsPrint.c Проект: aosm/X11
/* StartPage 
 */
int
PsStartPage(
  XpContextPtr pCon,
  WindowPtr    pWin)
{
  int                iorient, iplex, icount, ires;
  unsigned short     iwd, iht;
  PsContextPrivPtr   pConPriv =
     (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
  PsWindowPrivPtr    pWinPriv =
     (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;

/*
 * Put a pointer to the context in the window private structure
 */
  pWinPriv->validContext = 1;
  pWinPriv->context      = pCon;

  /* get page level attributes */
  S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht);
  /*
   *  Start the page
   */
  if (pConPriv->pPsOut == NULL) {
      pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile,
				   iorient, icount, iplex, ires,
				   (int)iwd, (int)iht, False);
  }
  PsOut_BeginPage(pConPriv->pPsOut, iorient, icount, iplex, ires,
		  (int)iwd, (int)iht);

  return Success;
}
Пример #2
0
/* StartPage 
 */
int
PsStartPage(
  XpContextPtr pCon,
  WindowPtr    pWin)
{
  int                iorient, iplex, icount, ires;
  unsigned short     iwd, iht;
  register WindowPtr pChild;
  PsContextPrivPtr   pConPriv =
     (PsContextPrivPtr)pCon->devPrivates[PsContextPrivateIndex].ptr;
  PsWindowPrivPtr    pWinPriv =
     (PsWindowPrivPtr)pWin->devPrivates[PsWindowPrivateIndex].ptr;
  char               s[80];
  xEvent event;

/*
 * Put a pointer to the context in the window private structure
 */
  pWinPriv->validContext = 1;
  pWinPriv->context      = pCon;

  /* get page level attributes */
  S_GetPageAttributes(pCon,&iorient,&icount,&iplex,&ires,&iwd,&iht);
  /*
   *  Start the page
   */
  if (pConPriv->pPsOut == NULL) {
    char *title;
    
    /* get job level attributes */ 
    title = XpGetOneAttribute(pCon, XPJobAttr, "job-name");

    pConPriv->pPsOut = PsOut_BeginFile(pConPriv->pJobFile,
                                       title, iorient, icount, iplex, ires,
                                       (int)iwd, (int)iht, False);
    pConPriv->fontInfoRecords     = NULL;
    pConPriv->fontTypeInfoRecords = NULL;
  }
  PsOut_BeginPage(pConPriv->pPsOut, iorient, icount, iplex, ires,
		  (int)iwd, (int)iht);

  return Success;
}