[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#883523: xpdf: FTBFS with poppler 0.61.1



I just took a look at the xpdf build failure.

Unfortunately I was unable to find documentation on the "object" changes but after reading the sourcecode I was able to figure out that.

1. It appears "output" objects are now returned by value rather than being passed by pointer.
2. Freeing objects is now handled automatically by destructors etc and is no longer allowed to be done manually.
3. dictLookup now seems to return a "Null" object on failure.
4. getFileSpecNameForPlatform now seems to return a "None" object on failure.

Based on these figurings out I was able to make the file build. Patch attatched.

Unfortunately the build then goes on to fail in another file

build/XPDFParams.cc: In member function ‘void XPDFParams::parseScreenType(GooList*, GooString*, int)’:
build/XPDFParams.cc:1631:19: error: ‘class GlobalParams’ has no member named ‘setScreenType’; did you mean ‘setEnableFreeType’?
     globalParams->setScreenType(screenDispersed);
                   ^~~~~~~~~~~~~
                   setEnableFreeType
compilation terminated due to -Wfatal-errors.
<builtin>: recipe for target 'build/XPDFParams.o' failed

Any thoughts?


description: split responsibility for global parameters into separate poppler and xpdf classes
author: Michael Gilbert <mgilbert@debian.org>
author: Dmitry Shachnev <mitya57@ubuntu.com>
bug-debian: http://bugs.debian.org/640515
bug-ubuntu: https://bugs.launchpad.net/bugs/943195
bug-ubuntu: https://bugs.launchpad.net/bugs/1205732

--- a/xpdf/PDFCore.cc
+++ b/xpdf/PDFCore.cc
@@ -18,6 +18,7 @@
 #include "GString.h"
 #include "GList.h"
 #include "GlobalParams.h"
+#include "XPDFParams.h"
 #include "Splash.h"
 #include "SplashBitmap.h"
 #include "SplashPattern.h"
@@ -86,7 +87,7 @@
   int i;
 
   doc = NULL;
-  continuousMode = globalParams->getContinuousView();
+  continuousMode = xpdfParams->getContinuousView();
   drawAreaWidth = drawAreaHeight = 0;
   maxPageW = totalDocH = 0;
   pageY = NULL;
--- a/xpdf/XPDFCore.cc
+++ b/xpdf/XPDFCore.cc
@@ -22,6 +22,7 @@
 #include "GList.h"
 #include "Error.h"
 #include "GlobalParams.h"
+#include "XPDFParams.h"
 #include "PDFDoc.h"
 #include "Link.h"
 #include "FileSpec.h"
@@ -116,7 +117,7 @@
   if (fullScreen) {
     zoom = zoomPage;
   } else {
-    initialZoom = globalParams->getInitialZoom();
+    initialZoom = xpdfParams->getInitialZoom();;
     if (!initialZoom->cmp("page")) {
       zoom = zoomPage;
     } else if (!initialZoom->cmp("width")) {
@@ -567,9 +568,9 @@
 #else
       fileName->append(" &");
 #endif
-      if (globalParams->getLaunchCommand()) {
+      if (xpdfParams->getLaunchCommand()) {
 	fileName->insert(0, ' ');
-	fileName->insert(0, globalParams->getLaunchCommand());
+	fileName->insert(0, xpdfParams->getLaunchCommand());
 	errcode = system(fileName->getCString());
         if (errcode != 0) {
           error(errInternal, -1 , "non-zero error code returned by system call");
@@ -591,7 +592,7 @@
 
   // URI action
   case actionURI:
-    if (!(cmd = globalParams->getURLCommand())) {
+    if (!(cmd = xpdfParams->getURLCommand())) {
       error(errConfig, -1, "No urlCommand defined in config file");
       break;
     }
@@ -629,7 +630,7 @@
 
   // Movie action
   case actionMovie:
-    if (!(cmd = globalParams->getMovieCommand())) {
+    if (!(cmd = xpdfParams->getMovieCommand())) {
       error(errConfig, -1, "No movieCommand defined in config file");
       break;
     }
--- a/xpdf/XPDFViewer.cc
+++ b/xpdf/XPDFViewer.cc
@@ -33,6 +33,7 @@
 #include "GList.h"
 #include "Error.h"
 #include "GlobalParams.h"
+#include "XPDFParams.h"
 #include "PDFDoc.h"
 #include "Link.h"
 #include "ErrorCodes.h"
@@ -132,6 +133,7 @@
 #include "printDis.xbm"
 #include "about.xbm"
 #include "about-text.h"
+#include "xfile.h"
 
 //------------------------------------------------------------------------
 
@@ -605,7 +607,7 @@
     return;
   }
 
-  if ((cmds = globalParams->getKeyBinding(keyCode,
+  if ((cmds = xpdfParams->getKeyBinding(keyCode,
 					  viewer->getModifiers(modifiers),
 					  viewer->getContext(modifiers)))) {
     for (i = 0; i < cmds->getLength(); ++i) {
@@ -637,7 +639,7 @@
     return;
   }
 
-  if ((cmds = globalParams->getKeyBinding(keyCode,
+  if ((cmds = xpdfParams->getKeyBinding(keyCode,
 					  viewer->getModifiers(
 						      event->xkey.state),
 					  viewer->getContext(
@@ -3532,7 +3534,7 @@
   XtSetValues(printDialog, args, n);
 
   //----- initial values
-  if ((psFileName = globalParams->getPSFile())) {
+  if ((psFileName = xpdfParams->getPSFile())) {
     if (psFileName->getChar(0) == '|') {
       XmTextFieldSetString(printCmdText,
 			   psFileName->getCString() + 1);
@@ -3604,7 +3606,7 @@
   char *p;
 
   doc = core->getDoc();
-  psFileName = globalParams->getPSFile();
+  psFileName = xpdfParams->getPSFile();
   if (!psFileName || psFileName->getChar(0) == '|') {
     if ((pdfFileName = doc->getFileName())) {
       p = pdfFileName->getCString() + pdfFileName->getLength() - 4;
@@ -3717,15 +3719,26 @@
     lastPage = doc->getNumPages();
   }
 
+  int imgLLX, imgLLY, imgURX, imgURY;
+  xpdfParams->getPSImageableArea(&imgLLX, &imgLLY, &imgURX, &imgURY);
+
   // Normal print mode
   if (printAll && !printBack)
   {
-    psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
-          doc->getCatalog(), firstPage, lastPage,
-          psModePS);
+    std::vector<int> pages;
+    pages.reserve((lastPage - firstPage) + 1);
+
+    for (int i = firstPage; i <= lastPage; ++i)
+        pages.push_back(i);
+
+    psOut = new PSOutputDev(
+          psFileName->getCString(), doc, NULL, pages, psModePS,
+          xpdfParams->getPSPaperWidth(), xpdfParams->getPSPaperHeight(),
+          xpdfParams->getPSCrop(), xpdfParams->getPSDuplex(),
+          imgLLX, imgLLY, imgURX, imgURY);
     if (psOut->isOk()) {
       doc->displayPages(psOut, firstPage, lastPage, 72, 72,
-            0, gTrue, globalParams->getPSCrop(), gFalse);
+            0, gTrue, xpdfParams->getPSCrop(), gFalse);
     }
     delete psOut;
   }
@@ -3734,6 +3747,8 @@
   {
     int step=1, i;
     int beginPage, endPage;
+    std::vector<int> page;
+    page.reserve(1);
 
     if (!printAll)
     {
@@ -3764,13 +3779,16 @@
 
     if (firstPage<=lastPage)
     {
-      for (i=beginPage;; i+=step)
+      for (i=beginPage; page[0] = i; i+=step)
       {
-        psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(),
-              doc->getCatalog(), i, i, psModePS);
+        psOut = new PSOutputDev(
+              psFileName->getCString(), doc, NULL, page, psModePS,
+              xpdfParams->getPSPaperWidth(), xpdfParams->getPSPaperHeight(),
+              xpdfParams->getPSCrop(), xpdfParams->getPSDuplex(),
+              imgLLX, imgLLY, imgURX, imgURY);
         if (psOut->isOk()) {
           doc->displayPages(psOut, i, i, 72, 72,
-                0, gTrue, globalParams->getPSCrop(), gFalse);
+                0, gTrue, xpdfParams->getPSCrop(), gFalse);
         }
         else
         {
--- a/xpdf/xpdf.cc
+++ b/xpdf/xpdf.cc
@@ -13,6 +13,7 @@
 #include "gfile.h"
 #include "gmem.h"
 #include "GlobalParams.h"
+#include "XPDFParams.h"
 #include "Object.h"
 #include "XPDFApp.h"
 #include "config.h"
@@ -152,23 +153,24 @@
 
   // read config file
   globalParams = new GlobalParams(cfgFileName);
+  xpdfParams = new XPDFParams(cfgFileName);
   globalParams->setupBaseFonts(NULL);
   if (contView) {
-    globalParams->setContinuousView(contView);
+    xpdfParams->setContinuousView(contView);
   }
   if (psFileArg[0]) {
-    globalParams->setPSFile(psFileArg);
+    xpdfParams->setPSFile(psFileArg);
   }
   if (paperSize[0]) {
-    if (!globalParams->setPSPaperSize(paperSize)) {
+    if (!xpdfParams->setPSPaperSize(paperSize)) {
       fprintf(stderr, "Invalid paper size\n");
     }
   } else {
     if (paperWidth) {
-      globalParams->setPSPaperWidth(paperWidth);
+      xpdfParams->setPSPaperWidth(paperWidth);
     }
     if (paperHeight) {
-      globalParams->setPSPaperHeight(paperHeight);
+      xpdfParams->setPSPaperHeight(paperHeight);
     }
   }
   if (level1) {
@@ -188,12 +190,12 @@
     }
   }
   if (antialiasStr[0]) {
-    if (!globalParams->setAntialias(antialiasStr)) {
+    if (!xpdfParams->setAntialias(antialiasStr)) {
       fprintf(stderr, "Bad '-aa' value on command line\n");
     }
   }
   if (vectorAntialiasStr[0]) {
-    if (!globalParams->setVectorAntialias(vectorAntialiasStr)) {
+    if (!xpdfParams->setVectorAntialias(vectorAntialiasStr)) {
       fprintf(stderr, "Bad '-aaVector' value on command line\n");
     }
   }
@@ -210,7 +212,7 @@
   // 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());
+    xpdfParams->setInitialZoom(app->getInitialZoom()->getCString());
   }
 
   // check command line
@@ -326,6 +328,7 @@
  done1:
   delete app;
   delete globalParams;
+  delete xpdfParams;
 
   // check for memory leaks
  done0:
--- a/xpdf/GlobalParams.cc
+++ b/xpdf/GlobalParams.cc
@@ -35,7 +35,8 @@
 #include "GList.h"
 #include "GHash.h"
 #include "gfile.h"
-#include "FoFiIdentifier.h"
+#include "xfile.h"
+#include "fofi/FoFiIdentifier.h"
 #include "Error.h"
 #include "NameToCharCode.h"
 #include "CharCodeToUnicode.h"
@@ -47,6 +48,8 @@
 #  include "XpdfPluginAPI.h"
 #endif
 #include "GlobalParams.h"
+#include "PopplerParams.h"
+#include "config.h"
 
 #ifdef _WIN32
 #  define strcasecmp stricmp
@@ -154,6 +157,8 @@
 
 GlobalParams *globalParams = NULL;
 
+/*
+
 //------------------------------------------------------------------------
 // PSFontParam16
 //------------------------------------------------------------------------
@@ -471,6 +476,8 @@
 }
 #endif
 
+*/
+
 //------------------------------------------------------------------------
 // KeyBinding
 //------------------------------------------------------------------------
@@ -504,6 +511,8 @@
   deleteGList(cmds, GString);
 }
 
+/*
+
 #ifdef ENABLE_PLUGINS
 //------------------------------------------------------------------------
 // Plugin
@@ -644,22 +653,25 @@
 
 #endif // ENABLE_PLUGINS
 
+*/
+
 //------------------------------------------------------------------------
 // parsing
 //------------------------------------------------------------------------
 
 GlobalParams::GlobalParams(const char *cfgFileName) {
-  UnicodeMap *map;
+//  UnicodeMap *map;
   GString *fileName;
   FILE *f;
   int i;
 
 #if MULTITHREADED
   gInitMutex(&mutex);
-  gInitMutex(&unicodeMapCacheMutex);
-  gInitMutex(&cMapCacheMutex);
+//  gInitMutex(&unicodeMapCacheMutex);
+//  gInitMutex(&cMapCacheMutex);
 #endif
 
+  /*
   initBuiltinFontTables();
 
   // scan the encoding in reverse because we want the lowest-numbered
@@ -689,6 +701,7 @@
   ccFontFiles = new GHash(gTrue);
   base14SysFonts = new GHash(gTrue);
   sysFonts = new SysFontList();
+  */
 #if HAVE_PAPER_H
   char *paperName;
   const struct paper *paperType;
@@ -711,13 +724,16 @@
   psImageableURX = psPaperWidth;
   psImageableURY = psPaperHeight;
   psCrop = gTrue;
+  /*
   psUseCropBoxAsPage = gFalse;
   psExpandSmaller = gFalse;
   psShrinkLarger = gTrue;
   psCenter = gTrue;
+  */
   psDuplex = gFalse;
-  psLevel = psLevel2;
+  //psLevel = psLevel2;
   psFile = NULL;
+  /*
   psResidentFonts = new GHash(gTrue);
   psResidentFonts16 = new GList();
   psResidentFontsCC = new GList();
@@ -746,13 +762,17 @@
 #endif
   textPageBreaks = gTrue;
   textKeepTinyChars = gTrue;
+  */
   initialZoom = new GString("125");
   continuousView = gFalse;
+  /*
   enableFreeType = gTrue;
   disableFreeTypeHinting = gFalse;
+  */
   antialias = gTrue;
   vectorAntialias = gTrue;
   antialiasPrinting = gFalse;
+  /*
   strokeAdjust = gTrue;
   screenType = screenUnset;
   screenSize = -1;
@@ -763,14 +783,18 @@
   minLineWidth = 0.0;
   drawAnnotations = gTrue;
   overprintPreview = gFalse;
+  */
   launchCommand = NULL;
   urlCommand = NULL;
   movieCommand = NULL;
+  /*
   mapNumericCharNames = gTrue;
   mapUnknownCharNames = gFalse;
   mapExtTrueTypeFontsViaUnicode = gTrue;
   enableXFA = gTrue;
+  */
   createDefaultKeyBindings();
+  /*
   printCommands = gFalse;
   errQuiet = gFalse;
 
@@ -807,6 +831,7 @@
   residentUnicodeMaps->add(map->getEncodingName(), map);
   map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
   residentUnicodeMaps->add(map->getEncodingName(), map);
+  */
 
   // look for a user config file, then a system-wide config file
   f = NULL;
@@ -1024,6 +1049,7 @@
 	error(errConfig, -1, "Bad 'include' config file command ({0:t}:{1:d})",
 	      fileName, line);
       }
+    /*
     } else if (!cmd->cmp("nameToUnicode")) {
       parseNameToUnicode(tokens, fileName, line);
     } else if (!cmd->cmp("cidToUnicode")) {
@@ -1036,12 +1062,15 @@
       parseCMapDir(tokens, fileName, line);
     } else if (!cmd->cmp("toUnicodeDir")) {
       parseToUnicodeDir(tokens, fileName, line);
+    */
     } else if (!cmd->cmp("fontFile")) {
       parseFontFile(tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("fontDir")) {
       parseFontDir(tokens, fileName, line);
     } else if (!cmd->cmp("fontFileCC")) {
       parseFontFileCC(tokens, fileName, line);
+    */
     } else if (!cmd->cmp("psFile")) {
       parsePSFile(tokens, fileName, line);
     } else if (!cmd->cmp("psPaperSize")) {
@@ -1050,6 +1079,7 @@
       parsePSImageableArea(tokens, fileName, line);
     } else if (!cmd->cmp("psCrop")) {
       parseYesNo("psCrop", &psCrop, tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("psUseCropBoxAsPage")) {
       parseYesNo("psUseCropBoxAsPage", &psUseCropBoxAsPage,
 		 tokens, fileName, line);
@@ -1060,10 +1090,12 @@
       parseYesNo("psShrinkLarger", &psShrinkLarger, tokens, fileName, line);
     } else if (!cmd->cmp("psCenter")) {
       parseYesNo("psCenter", &psCenter, tokens, fileName, line);
+    */
     } else if (!cmd->cmp("psDuplex")) {
       parseYesNo("psDuplex", &psDuplex, tokens, fileName, line);
     } else if (!cmd->cmp("psLevel")) {
       parsePSLevel(tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("psResidentFont")) {
       parsePSResidentFont(tokens, fileName, line);
     } else if (!cmd->cmp("psResidentFont16")) {
@@ -1086,7 +1118,7 @@
 		 tokens, fileName, line);
     } else if (!cmd->cmp("psPreload")) {
       parseYesNo("psPreload", &psPreload, tokens, fileName, line);
-    } else if (!cmd->cmp("psOPI")) {
+    }  else if (!cmd->cmp("psOPI")) {
       parseYesNo("psOPI", &psOPI, tokens, fileName, line);
     } else if (!cmd->cmp("psASCIIHex")) {
       parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
@@ -1119,15 +1151,18 @@
     } else if (!cmd->cmp("textKeepTinyChars")) {
       parseYesNo("textKeepTinyChars", &textKeepTinyChars,
 		 tokens, fileName, line);
+    */
     } else if (!cmd->cmp("initialZoom")) {
       parseInitialZoom(tokens, fileName, line);
     } else if (!cmd->cmp("continuousView")) {
       parseYesNo("continuousView", &continuousView, tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("enableFreeType")) {
       parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
     } else if (!cmd->cmp("disableFreeTypeHinting")) {
       parseYesNo("disableFreeTypeHinting", &disableFreeTypeHinting,
 		 tokens, fileName, line);
+    */
     } else if (!cmd->cmp("antialias")) {
       parseYesNo("antialias", &antialias, tokens, fileName, line);
     } else if (!cmd->cmp("vectorAntialias")) {
@@ -1136,6 +1171,7 @@
     } else if (!cmd->cmp("antialiasPrinting")) {
       parseYesNo("antialiasPrinting", &antialiasPrinting,
 		 tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("strokeAdjust")) {
       parseYesNo("strokeAdjust", &strokeAdjust, tokens, fileName, line);
     } else if (!cmd->cmp("screenType")) {
@@ -1163,12 +1199,14 @@
     } else if (!cmd->cmp("overprintPreview")) {
       parseYesNo("overprintPreview", &overprintPreview,
 		 tokens, fileName, line);
+    */
     } else if (!cmd->cmp("launchCommand")) {
       parseCommand("launchCommand", &launchCommand, tokens, fileName, line);
     } else if (!cmd->cmp("urlCommand")) {
       parseCommand("urlCommand", &urlCommand, tokens, fileName, line);
     } else if (!cmd->cmp("movieCommand")) {
       parseCommand("movieCommand", &movieCommand, tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("mapNumericCharNames")) {
       parseYesNo("mapNumericCharNames", &mapNumericCharNames,
 		 tokens, fileName, line);
@@ -1181,14 +1219,17 @@
 		 tokens, fileName, line);
     } else if (!cmd->cmp("enableXFA")) {
       parseYesNo("enableXFA", &enableXFA, tokens, fileName, line);
+    */
     } else if (!cmd->cmp("bind")) {
       parseBind(tokens, fileName, line);
     } else if (!cmd->cmp("unbind")) {
       parseUnbind(tokens, fileName, line);
+    /*
     } else if (!cmd->cmp("printCommands")) {
       parseYesNo("printCommands", &printCommands, tokens, fileName, line);
     } else if (!cmd->cmp("errQuiet")) {
       parseYesNo("errQuiet", &errQuiet, tokens, fileName, line);
+    */
     } else {
       error(errConfig, -1, "Unknown config file command '{0:t}' ({1:t}:{2:d})",
 	    cmd, fileName, line);
@@ -1204,6 +1245,22 @@
       } else if (!cmd->cmp("fontpath") || !cmd->cmp("fontmap")) {
 	error(errConfig, -1,
 	      "The config file format has changed since Xpdf 0.9x");
+      } else if (!cmd->cmp("psAlwaysRasterize") ||
+                 !cmd->cmp("enableT1lib") ||
+                 !cmd->cmp("drawAnnotations") ||
+                 !cmd->cmp("nameToUnicode") ||
+                 !cmd->cmp("cidToUnicode") ||
+                 !cmd->cmp("unicodeToUnicode") ||
+                 !cmd->cmp("unicodeMap") ||
+                 !cmd->cmp("cMapDir") ||
+                 !cmd->cmp("toUnicodeDir") ||
+                 !cmd->cmp("fontDir") ||
+                 !cmd->cmp("fontFileCC") ||
+                 !cmd->cmp("psResidentFont") ||
+                 !cmd->cmp("psResidentFont16") ||
+                 !cmd->cmp("psResidentFontCC")) {
+        error(errConfig, -1,
+              "Some work needs to be done to support this option in the Poppler version of xpdf");
       }
     }
   }
@@ -1211,6 +1268,8 @@
   deleteGList(tokens, GString);
 }
 
+/*
+
 void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
 				      int line) {
   GString *name;
@@ -1329,16 +1388,20 @@
   toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
 }
 
+*/
+
 void GlobalParams::parseFontFile(GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 3) {
     error(errConfig, -1, "Bad 'fontFile' config file command ({0:t}:{1:d})",
 	  fileName, line);
     return;
   }
-  fontFiles->add(((GString *)tokens->get(1))->copy(),
+  popplerParams->addFontFile(((GString *)tokens->get(1))->copy(),
 		 ((GString *)tokens->get(2))->copy());
 }
 
+/*
+
 void GlobalParams::parseFontDir(GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 2) {
     error(errConfig, -1, "Bad 'fontDir' config file command ({0:t}:{1:d})",
@@ -1359,6 +1422,8 @@
 		   ((GString *)tokens->get(2))->copy());
 }
 
+*/
+
 void GlobalParams::parsePSFile(GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 2) {
     error(errConfig, -1, "Bad 'psFile' config file command ({0:t}:{1:d})",
@@ -1420,23 +1485,25 @@
   }
   tok = (GString *)tokens->get(1);
   if (!tok->cmp("level1")) {
-    psLevel = psLevel1;
+    popplerParams->setPSLevel(psLevel1);
   } else if (!tok->cmp("level1sep")) {
-    psLevel = psLevel1Sep;
+    popplerParams->setPSLevel(psLevel1Sep);
   } else if (!tok->cmp("level2")) {
-    psLevel = psLevel2;
+    popplerParams->setPSLevel(psLevel2);
   } else if (!tok->cmp("level2sep")) {
-    psLevel = psLevel2Sep;
+    popplerParams->setPSLevel(psLevel2Sep);
   } else if (!tok->cmp("level3")) {
-    psLevel = psLevel3;
+    popplerParams->setPSLevel(psLevel3);
   } else if (!tok->cmp("level3Sep")) {
-    psLevel = psLevel3Sep;
+    popplerParams->setPSLevel(psLevel3Sep);
   } else {
     error(errConfig, -1, "Bad 'psLevel' config file command ({0:t}:{1:d})",
 	  fileName, line);
   }
 }
 
+/*
+
 void GlobalParams::parsePSResidentFont(GList *tokens, GString *fileName,
 				       int line) {
   if (tokens->getLength() != 3) {
@@ -1537,6 +1604,8 @@
   }
 }
 
+*/
+
 void GlobalParams::parseInitialZoom(GList *tokens,
 				    GString *fileName, int line) {
   if (tokens->getLength() != 2) {
@@ -1559,11 +1628,11 @@
   }
   tok = (GString *)tokens->get(1);
   if (!tok->cmp("dispersed")) {
-    screenType = screenDispersed;
+    popplerParams->setScreenType(screenDispersed);
   } else if (!tok->cmp("clustered")) {
-    screenType = screenClustered;
+    popplerParams->setScreenType(screenClustered);
   } else if (!tok->cmp("stochasticClustered")) {
-    screenType = screenStochasticClustered;
+    popplerParams->setScreenType(screenStochasticClustered);
   } else {
     error(errConfig, -1, "Bad 'screenType' config file command ({0:t}:{1:d})",
 	  fileName, line);
@@ -1873,6 +1942,7 @@
   GString *key;
   GList *list;
 
+  /*
   freeBuiltinFontTables();
 
   delete macRomanReverseMap;
@@ -1889,13 +1959,16 @@
   deleteGHash(ccFontFiles, GString);
   deleteGHash(base14SysFonts, Base14FontInfo);
   delete sysFonts;
+  */
   if (psFile) {
     delete psFile;
   }
+  /*
   deleteGHash(psResidentFonts, GString);
   deleteGList(psResidentFonts16, PSFontParam16);
   deleteGList(psResidentFontsCC, PSFontParam16);
   delete textEncoding;
+  */
   delete initialZoom;
   if (launchCommand) {
     delete launchCommand;
@@ -1908,6 +1981,7 @@
   }
   deleteGList(keyBindings, KeyBinding);
 
+  /*
   cMapDirs->startIter(&iter);
   while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
     deleteGList(list, GString);
@@ -1923,16 +1997,19 @@
   delete securityHandlers;
   deleteGList(plugins, Plugin);
 #endif
+  */
 
 #if MULTITHREADED
   gDestroyMutex(&mutex);
-  gDestroyMutex(&unicodeMapCacheMutex);
-  gDestroyMutex(&cMapCacheMutex);
+//  gDestroyMutex(&unicodeMapCacheMutex);
+//  gDestroyMutex(&cMapCacheMutex);
 #endif
 }
 
 //------------------------------------------------------------------------
 
+/*
+
 void GlobalParams::setBaseDir(char *dir) {
   delete baseDir;
   baseDir = new GString(dir);
@@ -2323,6 +2400,8 @@
   return path;
 }
 
+*/
+
 GString *GlobalParams::getPSFile() {
   GString *s;
 
@@ -2368,6 +2447,8 @@
   return f;
 }
 
+/*
+
 GBool GlobalParams::getPSUseCropBoxAsPage() {
   GBool f;
 
@@ -2404,6 +2485,8 @@
   return f;
 }
 
+*/
+
 GBool GlobalParams::getPSDuplex() {
   GBool d;
 
@@ -2413,6 +2496,8 @@
   return d;
 }
 
+/*
+
 PSLevel GlobalParams::getPSLevel() {
   PSLevel level;
 
@@ -2656,6 +2741,8 @@
   return tiny;
 }
 
+*/
+
 GString *GlobalParams::getInitialZoom() {
   GString *s;
 
@@ -2674,6 +2761,8 @@
   return f;
 }
 
+/*
+
 GBool GlobalParams::getEnableFreeType() {
   GBool f;
 
@@ -2692,6 +2781,7 @@
   return f;
 }
 
+*/
 
 GBool GlobalParams::getAntialias() {
   GBool f;
@@ -2720,6 +2810,8 @@
   return f;
 }
 
+/*
+
 GBool GlobalParams::getStrokeAdjust() {
   GBool f;
 
@@ -2838,6 +2930,8 @@
   return enable;
 }
 
+*/
+
 GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
   KeyBinding *binding;
   GList *cmds;
@@ -2864,6 +2958,8 @@
   return cmds;
 }
 
+/*
+
 GBool GlobalParams::getPrintCommands() {
   GBool p;
 
@@ -2960,6 +3056,8 @@
   unlockGlobalParams;
 }
 
+*/
+
 void GlobalParams::setPSFile(char *file) {
   lockGlobalParams;
   if (psFile) {
@@ -3027,6 +3125,8 @@
   unlockGlobalParams;
 }
 
+/*
+
 void GlobalParams::setPSUseCropBoxAsPage(GBool crop) {
   lockGlobalParams;
   psUseCropBoxAsPage = crop;
@@ -3051,12 +3151,16 @@
   unlockGlobalParams;
 }
 
+*/
+
 void GlobalParams::setPSDuplex(GBool duplex) {
   lockGlobalParams;
   psDuplex = duplex;
   unlockGlobalParams;
 }
 
+/*
+
 void GlobalParams::setPSLevel(PSLevel level) {
   lockGlobalParams;
   psLevel = level;
@@ -3146,6 +3250,8 @@
   unlockGlobalParams;
 }
 
+*/
+
 void GlobalParams::setInitialZoom(char *s) {
   lockGlobalParams;
   delete initialZoom;
@@ -3159,6 +3265,8 @@
   unlockGlobalParams;
 }
 
+/*
+
 GBool GlobalParams::setEnableFreeType(char *s) {
   GBool ok;
 
@@ -3168,6 +3276,7 @@
   return ok;
 }
 
+*/
 
 GBool GlobalParams::setAntialias(char *s) {
   GBool ok;
@@ -3187,6 +3296,8 @@
   return ok;
 }
 
+/*
+
 void GlobalParams::setScreenType(ScreenType t) {
   lockGlobalParams;
   screenType = t;
@@ -3318,3 +3429,5 @@
 }
 
 #endif // ENABLE_PLUGINS
+
+*/
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -33,6 +33,7 @@
 #endif // _WIN32
 #include "GString.h"
 #include "gfile.h"
+#include "xfile.h"
 
 // Some systems don't define this, so just make it something reasonably
 // large.
@@ -88,6 +89,8 @@
 #endif
 }
 
+/*
+
 GString *getCurrentDir() {
   char buf[PATH_MAX+1];
 
@@ -345,6 +348,8 @@
 #endif
 }
 
+*/
+
 GString *makePathAbsolute(GString *path) {
 #ifdef VMS
   //---------- VMS ----------
@@ -427,6 +432,8 @@
 #endif
 }
 
+/*
+
 time_t getModTime(char *fileName) {
 #ifdef _WIN32
   //~ should implement this, but it's (currently) only used in xpdf
@@ -870,3 +877,5 @@
 #endif
 #endif
 }
+
+*/
--- a/goo/gfile.h
+++ b/goo/gfile.h
@@ -11,6 +11,7 @@
 #ifndef GFILE_H
 #define GFILE_H
 
+/*
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -49,6 +50,8 @@
 #endif
 #include "gtypes.h"
 
+*/
+
 class GString;
 
 //------------------------------------------------------------------------
@@ -56,6 +59,8 @@
 // Get home directory path.
 extern GString *getHomeDir();
 
+/*
+
 // Get current directory.
 extern GString *getCurrentDir();
 
@@ -70,10 +75,14 @@
 // Is this an absolute path or file name?
 extern GBool isAbsolutePath(char *path);
 
+*/
+
 // Make this path absolute by prepending current directory (if path is
 // relative) or prepending user's directory (if path starts with '~').
 extern GString *makePathAbsolute(GString *path);
 
+/*
+
 // Get the modification time for <fileName>.  Returns 0 if there is an
 // error.
 extern time_t getModTime(char *fileName);
@@ -176,4 +185,6 @@
 #endif
 };
 
+*/
+
 #endif
--- a/xpdf/GlobalParams.h
+++ b/xpdf/GlobalParams.h
@@ -44,6 +44,8 @@
 
 //------------------------------------------------------------------------
 
+/*
+
 enum SysFontType {
   sysFontPFA,
   sysFontPFB,
@@ -95,6 +97,8 @@
   screenStochasticClustered
 };
 
+*/
+
 //------------------------------------------------------------------------
 
 class KeyBinding {
@@ -177,13 +181,16 @@
 
   ~GlobalParams();
 
+  /*
   void setBaseDir(char *dir);
   void setupBaseFonts(char *dir);
+  */
 
   void parseLine(char *buf, GString *fileName, int line);
 
   //----- accessors
 
+  /*
   CharCode getMacRomanCharCode(char *charName);
 
   GString *getBaseDir();
@@ -198,12 +205,14 @@
   GString *findSystemFontFile(GString *fontName, SysFontType *type,
 			      int *fontNum);
   GString *findCCFontFile(GString *collection);
+  */
   GString *getPSFile();
   int getPSPaperWidth();
   int getPSPaperHeight();
   void getPSImageableArea(int *llx, int *lly, int *urx, int *ury);
   GBool getPSDuplex();
   GBool getPSCrop();
+  /*
   GBool getPSUseCropBoxAsPage();
   GBool getPSExpandSmaller();
   GBool getPSShrinkLarger();
@@ -232,13 +241,17 @@
   EndOfLineKind getTextEOL();
   GBool getTextPageBreaks();
   GBool getTextKeepTinyChars();
+  */
   GString *getInitialZoom();
   GBool getContinuousView();
+  /*
   GBool getEnableFreeType();
   GBool getDisableFreeTypeHinting();
+  */
   GBool getAntialias();
   GBool getVectorAntialias();
   GBool getAntialiasPrinting();
+  /*
   GBool getStrokeAdjust();
   ScreenType getScreenType();
   int getScreenSize();
@@ -249,14 +262,18 @@
   double getMinLineWidth();
   GBool getDrawAnnotations();
   GBool getOverprintPreview() { return overprintPreview; }
+  */
   GString *getLaunchCommand() { return launchCommand; }
   GString *getURLCommand() { return urlCommand; }
   GString *getMovieCommand() { return movieCommand; }
+  /*
   GBool getMapNumericCharNames();
   GBool getMapUnknownCharNames();
   GBool getMapExtTrueTypeFontsViaUnicode();
   GBool getEnableXFA();
+  */
   GList *getKeyBinding(int code, int mods, int context);
+  /*
   GBool getPrintCommands();
   GBool getErrQuiet();
 
@@ -269,6 +286,7 @@
   //----- functions to set parameters
 
   void addFontFile(GString *fontName, GString *path);
+  */
   void setPSFile(char *file);
   GBool setPSPaperSize(char *size);
   void setPSPaperWidth(int width);
@@ -276,6 +294,7 @@
   void setPSImageableArea(int llx, int lly, int urx, int ury);
   void setPSDuplex(GBool duplex);
   void setPSCrop(GBool crop);
+  /*
   void setPSUseCropBoxAsPage(GBool crop);
   void setPSExpandSmaller(GBool expand);
   void setPSShrinkLarger(GBool shrink);
@@ -293,11 +312,15 @@
   GBool setTextEOL(char *s);
   void setTextPageBreaks(GBool pageBreaks);
   void setTextKeepTinyChars(GBool keep);
+  */
   void setInitialZoom(char *s);
   void setContinuousView(GBool cont);
+  /*
   GBool setEnableFreeType(char *s);
+  */
   GBool setAntialias(char *s);
   GBool setVectorAntialias(char *s);
+  /*
   void setScreenType(ScreenType t);
   void setScreenSize(int size);
   void setScreenDotRadius(int r);
@@ -315,30 +338,37 @@
 
   void addSecurityHandler(XpdfSecurityHandler *handler);
   XpdfSecurityHandler *getSecurityHandler(char *name);
+  */
 
 private:
 
   void createDefaultKeyBindings();
   void parseFile(GString *fileName, FILE *f);
+  /*
   void parseNameToUnicode(GList *tokens, GString *fileName, int line);
   void parseCIDToUnicode(GList *tokens, GString *fileName, int line);
   void parseUnicodeToUnicode(GList *tokens, GString *fileName, int line);
   void parseUnicodeMap(GList *tokens, GString *fileName, int line);
   void parseCMapDir(GList *tokens, GString *fileName, int line);
+  */
   void parseToUnicodeDir(GList *tokens, GString *fileName, int line);
   void parseFontFile(GList *tokens, GString *fileName, int line);
+  /*
   void parseFontDir(GList *tokens, GString *fileName, int line);
   void parseFontFileCC(GList *tokens, GString *fileName,
 		       int line);
+  */
   void parsePSFile(GList *tokens, GString *fileName, int line);
   void parsePSPaperSize(GList *tokens, GString *fileName, int line);
   void parsePSImageableArea(GList *tokens, GString *fileName, int line);
   void parsePSLevel(GList *tokens, GString *fileName, int line);
+  /*
   void parsePSResidentFont(GList *tokens, GString *fileName, int line);
   void parsePSResidentFont16(GList *tokens, GString *fileName, int line);
   void parsePSResidentFontCC(GList *tokens, GString *fileName, int line);
   void parseTextEncoding(GList *tokens, GString *fileName, int line);
   void parseTextEOL(GList *tokens, GString *fileName, int line);
+  */
   void parseInitialZoom(GList *tokens, GString *fileName, int line);
   void parseScreenType(GList *tokens, GString *fileName, int line);
   void parseBind(GList *tokens, GString *fileName, int line);
@@ -356,6 +386,7 @@
 		    GList *tokens, GString *fileName, int line);
   void parseFloat(const char *cmdName, double *val,
 		  GList *tokens, GString *fileName, int line);
+  /*
   UnicodeMap *getUnicodeMap2(GString *encodingName);
 #ifdef ENABLE_PLUGINS
   GBool loadPlugin(char *type, char *name);
@@ -391,6 +422,7 @@
   GHash *base14SysFonts;	// Base-14 system font files: font name
 				//   mapped to path [Base14FontInfo]
   SysFontList *sysFonts;	// system fonts
+  */
   GString *psFile;		// PostScript file or command (for xpdf)
   int psPaperWidth;		// paper size, in PostScript points, for
   int psPaperHeight;		//   PostScript output
@@ -399,11 +431,14 @@
       psImageableURX,
       psImageableURY;
   GBool psCrop;			// crop PS output to CropBox
+  /*
   GBool psUseCropBoxAsPage;	// use CropBox as page size
   GBool psExpandSmaller;	// expand smaller pages to fill paper
   GBool psShrinkLarger;		// shrink larger pages to fit paper
   GBool psCenter;		// center pages on the paper
+  */
   GBool psDuplex;		// enable duplexing in PostScript?
+  /*
   PSLevel psLevel;		// PostScript level to generate
   GHash *psResidentFonts;	// 8-bit fonts resident in printer:
 				//   PDF font name mapped to PS font name
@@ -439,13 +474,17 @@
 				//   output
   GBool textPageBreaks;		// insert end-of-page markers?
   GBool textKeepTinyChars;	// keep all characters in text output
+  */
   GString *initialZoom;		// initial zoom level
   GBool continuousView;		// continuous view mode
+  /*
   GBool enableFreeType;		// FreeType enable flag
   GBool disableFreeTypeHinting;	// FreeType hinting disable flag
+  */
   GBool antialias;		// font anti-aliasing enable flag
   GBool vectorAntialias;	// vector anti-aliasing enable flag
   GBool antialiasPrinting;	// allow anti-aliasing when printing
+  /*
   GBool strokeAdjust;		// stroke adjustment enable flag
   ScreenType screenType;	// halftone screen type
   int screenSize;		// screen matrix size
@@ -456,15 +495,19 @@
   double minLineWidth;		// minimum line width
   GBool drawAnnotations;	// draw annotations or not
   GBool overprintPreview;	// enable overprint preview
+  */
   GString *launchCommand;	// command executed for 'launch' links
   GString *urlCommand;		// command executed for URL links
   GString *movieCommand;	// command executed for movie annotations
+  /*
   GBool mapNumericCharNames;	// map numeric char names (from font subsets)?
   GBool mapUnknownCharNames;	// map unknown char names?
   GBool mapExtTrueTypeFontsViaUnicode;  // map char codes to GID via Unicode
 				        //   for external TrueType fonts?
   GBool enableXFA;		// enable XFA form rendering
+  */
   GList *keyBindings;		// key & mouse button bindings [KeyBinding]
+  /*
   GBool printCommands;		// print the drawing commands
   GBool errQuiet;		// suppress error messages?
 
@@ -478,11 +521,12 @@
   GList *securityHandlers;	// list of loaded security handlers
 				//   [XpdfSecurityHandler]
 #endif
+  */
 
 #if MULTITHREADED
   GMutex mutex;
-  GMutex unicodeMapCacheMutex;
-  GMutex cMapCacheMutex;
+//  GMutex unicodeMapCacheMutex;
+//  GMutex cMapCacheMutex;
 #endif
 };
 

Reply to: