View | Details | Raw Unified
Collapse All | Expand All

(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/PDFCore.cc (-5 / +4 lines)
 Lines 81-87   PDFCore::PDFCore(SplashColorMode colorMo Link Here 
  int i;
  int i;
  doc = NULL;
  doc = NULL;
  continuousMode = globalParams->getContinuousView();
  drawAreaWidth = drawAreaHeight = 0;
  drawAreaWidth = drawAreaHeight = 0;
  maxPageW = totalDocH = 0;
  maxPageW = totalDocH = 0;
  pageY = NULL;
  pageY = NULL;
 Lines 791-797   void PDFCore::needTile(PDFCorePage *page Link Here 
  memcpy(tile->ctm, out->getDefCTM(), 6 * sizeof(double));
  memcpy(tile->ctm, out->getDefCTM(), 6 * sizeof(double));
  memcpy(tile->ictm, out->getDefICTM(), 6 * sizeof(double));
  memcpy(tile->ictm, out->getDefICTM(), 6 * sizeof(double));
  if (!page->links) {
  if (!page->links) {
    page->links = doc->takeLinks();
    page->links = doc->getLinks(page->page);
  }
  }
  if (!page->text) {
  if (!page->text) {
    if ((textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse))) {
    if ((textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse))) {
 Lines 851-857   GBool PDFCore::gotoPrevPage(int dec, GBo Link Here 
  return gTrue;
  return gTrue;
}
}
GBool PDFCore::gotoNamedDestination(UGooString *dest) {
GBool PDFCore::gotoNamedDestination(GooString *dest) {
  LinkDest *d;
  LinkDest *d;
  if (!doc) {
  if (!doc) {
 Lines 1213-1219   void PDFCore::xorRectangle(int pg, int x Link Here 
    for (i = 0; i < page->tiles->getLength(); ++i) {
    for (i = 0; i < page->tiles->getLength(); ++i) {
      tile = (PDFCoreTile *)page->tiles->get(i);
      tile = (PDFCoreTile *)page->tiles->get(i);
      if (!oneTile || tile == oneTile) {
      if (!oneTile || tile == oneTile) {
	splash = new Splash(tile->bitmap);
	splash = new Splash(tile->bitmap, gFalse);
	splash->setFillPattern(pattern->copy());
	splash->setFillPattern(pattern->copy());
	xx0 = (SplashCoord)(x0 - tile->xMin);
	xx0 = (SplashCoord)(x0 - tile->xMin);
	yy0 = (SplashCoord)(y0 - tile->yMin);
	yy0 = (SplashCoord)(y0 - tile->yMin);
 Lines 1584-1590   void PDFCore::cvtUserToDev(int pg, doubl Link Here 
		tile->ctm[3] * yu + tile->ctm[5] + 0.5);
		tile->ctm[3] * yu + tile->ctm[5] + 0.5);
  } else {
  } else {
    doc->getCatalog()->getPage(pg)->getDefaultCTM(ctm, dpi, dpi, rotate,
    doc->getCatalog()->getPage(pg)->getDefaultCTM(ctm, dpi, dpi, rotate,
						  out->upsideDown());
												  gFalse, out->upsideDown());
    *xd = (int)(ctm[0] * xu + ctm[2] * yu + ctm[4] + 0.5);
    *xd = (int)(ctm[0] * xu + ctm[2] * yu + ctm[4] + 0.5);
    *yd = (int)(ctm[1] * xu + ctm[3] * yu + ctm[5] + 0.5);
    *yd = (int)(ctm[1] * xu + ctm[3] * yu + ctm[5] + 0.5);
  }
  }
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/PDFCore.h (-2 / +2 lines)
 Lines 16-22    Link Here 
#include <stdlib.h>
#include <stdlib.h>
#include "SplashTypes.h"
#include "SplashTypes.h"
#include "CharTypes.h"
#include "CharTypes.h"
#include "UGooString.h"
#include "GooString.h"
class GooString;
class GooString;
class GooList;
class GooList;
 Lines 156-162   public: Link Here 
  virtual GBool gotoNextPage(int inc, GBool top);
  virtual GBool gotoNextPage(int inc, GBool top);
  virtual GBool gotoPrevPage(int dec, GBool top, GBool bottom);
  virtual GBool gotoPrevPage(int dec, GBool top, GBool bottom);
  virtual GBool gotoNamedDestination(UGooString *dest);
  virtual GBool gotoNamedDestination(GooString *dest);
  virtual GBool goForward();
  virtual GBool goForward();
  virtual GBool goBackward();
  virtual GBool goBackward();
  virtual void scrollLeft(int nCols = 1);
  virtual void scrollLeft(int nCols = 1);
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/XPDFApp.cc (-4 / +4 lines)
 Lines 236-242   XPDFViewer *XPDFApp::open(GooString *fil Link Here 
  return viewer;
  return viewer;
}
}
XPDFViewer *XPDFApp::openAtDest(GooString *fileName, UGooString *dest,
XPDFViewer *XPDFApp::openAtDest(GooString *fileName, GooString *dest,
				GooString *ownerPassword,
				GooString *ownerPassword,
				GooString *userPassword) {
				GooString *userPassword) {
  XPDFViewer *viewer;
  XPDFViewer *viewer;
 Lines 324-330   void XPDFApp::remoteOpen(GooString *file Link Here 
  XFlush(display);
  XFlush(display);
}
}
void XPDFApp::remoteOpenAtDest(GooString *fileName, UGooString *dest, GBool raise) {
void XPDFApp::remoteOpenAtDest(GooString *fileName, GooString *dest, GBool raise) {
  char cmd[remoteCmdSize];
  char cmd[remoteCmdSize];
  sprintf(cmd, "%c +%.256s %.200s",
  sprintf(cmd, "%c +%.256s %.200s",
 Lines 362-368   void XPDFApp::remoteMsgCbk(Widget widget Link Here 
  char *p, *q;
  char *p, *q;
  GooString *fileName;
  GooString *fileName;
  int page;
  int page;
  UGooString *destName;
  GooString *destName;
  if (event->xproperty.atom != app->remoteAtom) {
  if (event->xproperty.atom != app->remoteAtom) {
    *cont = True;
    *cont = True;
 Lines 393-399   void XPDFApp::remoteMsgCbk(Widget widget Link Here 
    page = 1;
    page = 1;
    destName = NULL;
    destName = NULL;
    if (*p == '+') {
    if (*p == '+') {
      destName = new UGooString(p + 1);
      destName = new GooString(p + 1);
    } else {
    } else {
      page = atoi(p);
      page = atoi(p);
    }
    }
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/XPDFApp.h (-3 / +3 lines)
 Lines 18-24    Link Here 
#undef Object
#undef Object
#include "gtypes.h"
#include "gtypes.h"
#include "SplashTypes.h"
#include "SplashTypes.h"
#include "UGooString.h"
#include "GooString.h"
class GooString;
class GooString;
class GooList;
class GooList;
 Lines 41-47   public: Link Here 
  XPDFViewer *open(GooString *fileName, int page = 1,
  XPDFViewer *open(GooString *fileName, int page = 1,
		   GooString *ownerPassword = NULL,
		   GooString *ownerPassword = NULL,
		   GooString *userPassword = NULL);
		   GooString *userPassword = NULL);
  XPDFViewer *openAtDest(GooString *fileName, UGooString *dest,
  XPDFViewer *openAtDest(GooString *fileName, GooString *dest,
			 GooString *ownerPassword = NULL,
			 GooString *ownerPassword = NULL,
			 GooString *userPassword = NULL);
			 GooString *userPassword = NULL);
  void close(XPDFViewer *viewer, GBool closeLast);
  void close(XPDFViewer *viewer, GBool closeLast);
 Lines 53-59   public: Link Here 
  void setRemoteName(char *remoteName);
  void setRemoteName(char *remoteName);
  GBool remoteServerRunning();
  GBool remoteServerRunning();
  void remoteOpen(GooString *fileName, int page, GBool raise);
  void remoteOpen(GooString *fileName, int page, GBool raise);
  void remoteOpenAtDest(GooString *fileName, UGooString *dest, GBool raise);
  void remoteOpenAtDest(GooString *fileName, GooString *dest, GBool raise);
  void remoteReload(GBool raise);
  void remoteReload(GBool raise);
  void remoteRaise();
  void remoteRaise();
  void remoteQuit();
  void remoteQuit();
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/xpdf.cc (-32 / +3 lines)
 Lines 127-133   int main(int argc, char *argv[]) { Link Here 
  XPDFApp *app;
  XPDFApp *app;
  GooString *fileName;
  GooString *fileName;
  int pg;
  int pg;
  UGooString *destName;
  GooString *destName;
  GooString *userPasswordStr, *ownerPasswordStr;
  GooString *userPasswordStr, *ownerPasswordStr;
  GBool ok;
  GBool ok;
  int exitCode;
  int exitCode;
 Lines 148-173   int main(int argc, char *argv[]) { Link Here 
  }
  }
  // read config file
  // read config file
  globalParams = new GlobalParams(cfgFileName);
  globalParams = new GlobalParams();
  //globalParams->setupBaseFonts(NULL);
  //globalParams->setupBaseFonts(NULL);
  if (contView) {
    globalParams->setContinuousView(contView);
  }
  if (psFileArg[0]) {
    globalParams->setPSFile(psFileArg);
  }
  if (paperSize[0]) {
    if (!globalParams->setPSPaperSize(paperSize)) {
      fprintf(stderr, "Invalid paper size\n");
    }
  } else {
    if (paperWidth) {
      globalParams->setPSPaperWidth(paperWidth);
    }
    if (paperHeight) {
      globalParams->setPSPaperHeight(paperHeight);
    }
  }
  if (level1) {
  if (level1) {
    globalParams->setPSLevel(psLevel1);
    globalParams->setPSLevel(psLevel1);
  }
  }
 Lines 179-189   int main(int argc, char *argv[]) { Link Here 
      fprintf(stderr, "Bad '-eol' value on command line\n");
      fprintf(stderr, "Bad '-eol' value on command line\n");
    }
    }
  }
  }
  if (enableT1libStr[0]) {
    if (!globalParams->setEnableT1lib(enableT1libStr)) {
      fprintf(stderr, "Bad '-t1lib' value on command line\n");
    }
  }
  if (enableFreeTypeStr[0]) {
  if (enableFreeTypeStr[0]) {
    if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
    if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
      fprintf(stderr, "Bad '-freetype' value on command line\n");
      fprintf(stderr, "Bad '-freetype' value on command line\n");
 Lines 204-215   int main(int argc, char *argv[]) { Link Here 
  // create the XPDFApp object
  // create the XPDFApp object
  app = new XPDFApp(&argc, argv);
  app = new XPDFApp(&argc, argv);
  // the initialZoom parameter can be set in either the config file or
  // as an X resource (or command line arg)
  if (app->getInitialZoom()) {
    globalParams->setInitialZoom(app->getInitialZoom()->getCString());
  }
  // check command line
  // check command line
  ok = ok && argc >= 1 && argc <= 3;
  ok = ok && argc >= 1 && argc <= 3;
  if (doRemoteReload) {
  if (doRemoteReload) {
 Lines 239-245   int main(int argc, char *argv[]) { Link Here 
  destName = NULL;
  destName = NULL;
  if (argc == 3) {
  if (argc == 3) {
    if (argv[2][0] == '+') {
    if (argv[2][0] == '+') {
      destName = new UGooString(&argv[2][1]);
      destName = new GooString(&argv[2][1]);
    } else {
    } else {
      pg = atoi(argv[2]);
      pg = atoi(argv[2]);
      if (pg < 0) {
      if (pg < 0) {
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/XPDFCore.cc (-63 / +3 lines)
 Lines 148-166   XPDFCore::XPDFCore(Widget shellA, Widget Link Here 
  drawAreaFrame = NULL;
  drawAreaFrame = NULL;
  drawArea = NULL;
  drawArea = NULL;
  // get the initial zoom value
  initialZoom = globalParams->getInitialZoom();
  if (!initialZoom->cmp("page")) {
    zoom = zoomPage;
  } else if (!initialZoom->cmp("width")) {
    zoom = zoomWidth;
  } else {
    zoom = atoi(initialZoom->getCString());
    if (zoom <= 0) {
      zoom = defZoom;
      zoom = defZoom;
    }
  }
  delete initialZoom;
  linkAction = NULL;
  linkAction = NULL;
 Lines 442-448   GBool XPDFCore::doLink(int pg, int x, in Link Here 
void XPDFCore::doAction(LinkAction *action) {
void XPDFCore::doAction(LinkAction *action) {
  LinkActionKind kind;
  LinkActionKind kind;
  LinkDest *dest;
  LinkDest *dest;
  UGooString *namedDest;
  GooString *namedDest;
  char *s;
  char *s;
  GooString *fileName, *fileName2;
  GooString *fileName, *fileName2;
  GooString *cmd;
  GooString *cmd;
 Lines 462-468   void XPDFCore::doAction(LinkAction *acti Link Here 
      if ((dest = ((LinkGoTo *)action)->getDest())) {
      if ((dest = ((LinkGoTo *)action)->getDest())) {
	dest = dest->copy();
	dest = dest->copy();
      } else if ((namedDest = ((LinkGoTo *)action)->getNamedDest())) {
      } else if ((namedDest = ((LinkGoTo *)action)->getNamedDest())) {
	namedDest = new UGooString(*namedDest);
	namedDest = new GooString(*namedDest);
      }
      }
    } else {
    } else {
      dest = NULL;
      dest = NULL;
 Lines 470-476   void XPDFCore::doAction(LinkAction *acti Link Here 
      if ((dest = ((LinkGoToR *)action)->getDest())) {
      if ((dest = ((LinkGoToR *)action)->getDest())) {
	dest = dest->copy();
	dest = dest->copy();
      } else if ((namedDest = ((LinkGoToR *)action)->getNamedDest())) {
      } else if ((namedDest = ((LinkGoToR *)action)->getNamedDest())) {
	namedDest = new UGooString(*namedDest);
	namedDest = new GooString(*namedDest);
      }
      }
      s = ((LinkGoToR *)action)->getFileName()->getCString();
      s = ((LinkGoToR *)action)->getFileName()->getCString();
      //~ translate path name for VMS (deal with '/')
      //~ translate path name for VMS (deal with '/')
 Lines 548-559   void XPDFCore::doAction(LinkAction *acti Link Here 
  // URI action
  // URI action
  case actionURI:
  case actionURI:
    if (!(cmd = globalParams->getURLCommand())) {
      error(-1, "No urlCommand defined in config file");
      error(-1, "No urlCommand defined in config file");
      break;
      break;
    }
    runCommand(cmd, ((LinkURI *)action)->getURI());
    break;
  // Named action
  // Named action
  case actionNamed:
  case actionNamed:
 Lines 585-636   void XPDFCore::doAction(LinkAction *acti Link Here 
  // Movie action
  // Movie action
  case actionMovie:
  case actionMovie:
    if (!(cmd = globalParams->getMovieCommand())) {
      error(-1, "No movieCommand defined in config file");
      error(-1, "No movieCommand defined in config file");
      break;
      break;
    }
    if (((LinkMovie *)action)->hasAnnotRef()) {
      doc->getXRef()->fetch(((LinkMovie *)action)->getAnnotRef()->num,
			    ((LinkMovie *)action)->getAnnotRef()->gen,
			    &movieAnnot);
    } else {
      //~ need to use the correct page num here
      doc->getCatalog()->getPage(topPage)->getAnnots(&obj1);
      if (obj1.isArray()) {
	for (i = 0; i < obj1.arrayGetLength(); ++i) {
	  if (obj1.arrayGet(i, &movieAnnot)->isDict()) {
	    if (movieAnnot.dictLookup("Subtype", &obj2)->isName("Movie")) {
	      obj2.free();
	      break;
	    }
	    obj2.free();
	  }
	  movieAnnot.free();
	}
	obj1.free();
      }
    }
    if (movieAnnot.isDict()) {
      if (movieAnnot.dictLookup("Movie", &obj1)->isDict()) {
	if (obj1.dictLookup("F", &obj2)) {
	  if ((fileName = LinkAction::getFileSpecName(&obj2))) {
	    if (!isAbsolutePath(fileName->getCString())) {
	      fileName2 = appendToPath(
			      grabPath(doc->getFileName()->getCString()),
			      fileName->getCString());
	      delete fileName;
	      fileName = fileName2;
	    }
	    runCommand(cmd, fileName);
	    delete fileName;
	  }
	  obj2.free();
	}
	obj1.free();
      }
    }
    movieAnnot.free();
    break;
  // unknown action type
  // unknown action type
  case actionUnknown:
  case actionUnknown:
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/XPDFViewer.cc (-40 / +6 lines)
 Lines 111-117   static ZoomMenuInfo zoomMenuInfo[nZoomMe Link Here 
//------------------------------------------------------------------------
//------------------------------------------------------------------------
XPDFViewer::XPDFViewer(XPDFApp *appA, GooString *fileName,
XPDFViewer::XPDFViewer(XPDFApp *appA, GooString *fileName,
		       int pageA, UGooString *destName,
		       int pageA, GooString *destName,
		       GooString *ownerPassword, GooString *userPassword) {
		       GooString *ownerPassword, GooString *userPassword) {
  LinkDest *dest;
  LinkDest *dest;
  int pg;
  int pg;
 Lines 185-191   XPDFViewer::~XPDFViewer() { Link Here 
#endif
#endif
}
}
void XPDFViewer::open(GooString *fileName, int pageA, UGooString *destName) {
void XPDFViewer::open(GooString *fileName, int pageA, GooString *destName) {
  LinkDest *dest;
  LinkDest *dest;
  int pg;
  int pg;
  double z;
  double z;
 Lines 267-273   void XPDFViewer::displayDest(LinkDest *d Link Here 
  core->displayDest(dest, zoomA, rotateA, addToHist);
  core->displayDest(dest, zoomA, rotateA, addToHist);
}
}
void XPDFViewer::getPageAndDest(int pageA, UGooString *destName,
void XPDFViewer::getPageAndDest(int pageA, GooString *destName,
				int *pageOut, LinkDest **destOut) {
				int *pageOut, LinkDest **destOut) {
  Ref pageRef;
  Ref pageRef;
 Lines 2299-2314   void XPDFViewer::initPrintDialog() { Link Here 
  XtSetArg(args[n], XmNcancelButton, cancelBtn); ++n;
  XtSetArg(args[n], XmNcancelButton, cancelBtn); ++n;
  XtSetValues(printDialog, args, n);
  XtSetValues(printDialog, args, n);
  //----- initial values
  if ((psFileName = globalParams->getPSFile())) {
    if (psFileName->getChar(0) == '|') {
      XmTextFieldSetString(printCmdText,
			   psFileName->getCString() + 1);
    } else {
      XmTextFieldSetString(printFileText, psFileName->getCString());
    }
    delete psFileName;
  }
}
}
void XPDFViewer::setupPrintDialog() {
void XPDFViewer::setupPrintDialog() {
 Lines 2318-2351   void XPDFViewer::setupPrintDialog() { Link Here 
  char *p;
  char *p;
  doc = core->getDoc();
  doc = core->getDoc();
  psFileName = globalParams->getPSFile();
  if (!psFileName || psFileName->getChar(0) == '|') {
    pdfFileName = doc->getFileName();
    p = pdfFileName->getCString() + pdfFileName->getLength() - 4;
    if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")) {
      psFileName2 = new GooString(pdfFileName->getCString(),
				pdfFileName->getLength() - 4);
    } else {
      psFileName2 = pdfFileName->copy();
    }
    psFileName2->append(".ps");
    XmTextFieldSetString(printFileText, psFileName2->getCString());
    delete psFileName2;
  }
  if (psFileName && psFileName->getChar(0) == '|') {
    XmToggleButtonSetState(printWithCmdBtn, True, False);
    XmToggleButtonSetState(printToFileBtn, False, False);
    XtVaSetValues(printCmdText, XmNsensitive, True, NULL);
    XtVaSetValues(printFileText, XmNsensitive, False, NULL);
  } else {
    XmToggleButtonSetState(printWithCmdBtn, False, False);
    XmToggleButtonSetState(printWithCmdBtn, False, False);
    XmToggleButtonSetState(printToFileBtn, True, False);
    XmToggleButtonSetState(printToFileBtn, True, False);
    XtVaSetValues(printCmdText, XmNsensitive, False, NULL);
    XtVaSetValues(printCmdText, XmNsensitive, False, NULL);
    XtVaSetValues(printFileText, XmNsensitive, True, NULL);
    XtVaSetValues(printFileText, XmNsensitive, True, NULL);
  }
  if (psFileName) {
    delete psFileName;
  }
  sprintf(buf, "%d", doc->getNumPages());
  sprintf(buf, "%d", doc->getNumPages());
  XmTextFieldSetString(printFirstPage, "1");
  XmTextFieldSetString(printFirstPage, "1");
 Lines 2419-2429   void XPDFViewer::printPrintCbk(Widget wi Link Here 
  }
  }
  psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
  psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
			  doc->getCatalog(), firstPage, lastPage,
			  doc->getCatalog(), NULL, firstPage, lastPage,
			  psModePS);
			  psModePS, 0, 0, gFalse, 0, 0, 0, 0, gFalse, gFalse);
  if (psOut->isOk()) {
  if (psOut->isOk()) {
    doc->displayPages(psOut, firstPage, lastPage, 72, 72,
    doc->displayPages(psOut, firstPage, lastPage, 72, 72,
		      0, gTrue, globalParams->getPSCrop(), gFalse);
		      0, gTrue, gFalse, gFalse);
  }
  }
  delete psOut;
  delete psOut;
  delete psFileName;
  delete psFileName;
(-) /usr/src/debug/app-text/xpdf-3.01-r8/xpdf-3.01-poppler/XPDFViewer.h (-3 / +3 lines)
 Lines 48-59   class XPDFViewer { Link Here 
public:
public:
  XPDFViewer(XPDFApp *appA, GooString *fileName,
  XPDFViewer(XPDFApp *appA, GooString *fileName,
	     int pageA, UGooString *destName,
	     int pageA, GooString *destName,
	     GooString *ownerPassword, GooString *userPassword);
	     GooString *ownerPassword, GooString *userPassword);
  GBool isOk() { return ok; }
  GBool isOk() { return ok; }
  ~XPDFViewer();
  ~XPDFViewer();
  void open(GooString *fileName, int pageA, UGooString *destName);
  void open(GooString *fileName, int pageA, GooString *destName);
  void clear();
  void clear();
  void reloadFile();
  void reloadFile();
 Lines 68-74   private: Link Here 
                   GBool scrollToTop, GBool addToHist);
                   GBool scrollToTop, GBool addToHist);
  void displayDest(LinkDest *dest, double zoomA, int rotateA,
  void displayDest(LinkDest *dest, double zoomA, int rotateA,
		   GBool addToHist);
		   GBool addToHist);
  void getPageAndDest(int pageA, UGooString *destName,
  void getPageAndDest(int pageA, GooString *destName,
		      int *pageOut, LinkDest **destOut);
		      int *pageOut, LinkDest **destOut);
  //----- actions
  //----- actions