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

Re: [PATCH] xpdf 3.04 debian package: added options to set outline pane width



On 10/11/2017 18:48, PaulTT wrote:
don't know if you're interested, i added a simple option to set outline pane size via xpdfrc: (i had to, because i've got an hidpi panel, and bigger fonts, so side panel fixed was too narrow and expanding it by default was imho not so good)


outlinePaneSize 175


175 is the actual default, i'm actually using a value double than that

i saw that original xpdf is no longer developped as X app, so i wrote directly to deb mantainer(s), being you, i think, hoping not to annoy

bye and thanx
Paul


updated with manual page too
sorry, i thought about it later :(

--
"Capitano Long Horn! Nessun Sistema Operativo in Vista!!"

diff -urN xpdf-3.04/doc/xpdfrc.5 xpdf-3.04_PTT2/doc/xpdfrc.5
--- xpdf-3.04/doc/xpdfrc.5	2017-11-13 11:55:46.000000000 +0100
+++ xpdf-3.04_PTT2/doc/xpdfrc.5	2017-11-13 11:58:48.972068609 +0100
@@ -399,6 +399,9 @@
 one vertical screoll bar for the whole document.  This defaults to
 "no".
 .TP
+.BR outlinePaneSize " pixels"
+Sets the outline side panel width, in pixels.  This defaults to 175.
+.TP
 .BR enableFreeType " yes | no"
 Enables or disables use of FreeType (a TrueType / Type 1 font
 rasterizer).  This is only relevant if the Xpdf tools were built with
diff -urN xpdf-3.04/xpdf/GlobalParams.cc xpdf-3.04_PTT2/xpdf/GlobalParams.cc
--- xpdf-3.04/xpdf/GlobalParams.cc	2017-11-13 11:55:46.000000000 +0100
+++ xpdf-3.04_PTT2/xpdf/GlobalParams.cc	2017-11-13 11:56:03.532064507 +0100
@@ -765,6 +765,7 @@
   */
   initialZoom = new GString("125");
   continuousView = gFalse;
+  outlinePaneSize = 175;
   /*
   enableFreeType = gTrue;
   disableFreeTypeHinting = gFalse;
@@ -1156,6 +1157,8 @@
       parseInitialZoom(tokens, fileName, line);
     } else if (!cmd->cmp("continuousView")) {
       parseYesNo("continuousView", &continuousView, tokens, fileName, line);
+    } else if (!cmd->cmp("outlinePaneSize")) {
+      parseInteger("outlinePaneSize", &outlinePaneSize, tokens, fileName, line);
     /*
     } else if (!cmd->cmp("enableFreeType")) {
       parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
@@ -2761,6 +2764,15 @@
   return f;
 }
 
+int GlobalParams::getOutlinePaneSize() {
+  int size;
+
+  lockGlobalParams;
+  size = outlinePaneSize;
+  unlockGlobalParams;
+  return size;
+}
+
 /*
 
 GBool GlobalParams::getEnableFreeType() {
@@ -3265,6 +3277,12 @@
   unlockGlobalParams;
 }
 
+void GlobalParams::setOutlinePaneSize(int size) {
+  lockGlobalParams;
+  outlinePaneSize = size;
+  unlockGlobalParams;
+}
+
 /*
 
 GBool GlobalParams::setEnableFreeType(char *s) {
diff -urN xpdf-3.04/xpdf/GlobalParams.h xpdf-3.04_PTT2/xpdf/GlobalParams.h
--- xpdf-3.04/xpdf/GlobalParams.h	2017-11-13 11:55:46.000000000 +0100
+++ xpdf-3.04_PTT2/xpdf/GlobalParams.h	2017-11-13 11:56:03.532064507 +0100
@@ -244,6 +244,7 @@
   */
   GString *getInitialZoom();
   GBool getContinuousView();
+  int getOutlinePaneSize();
   /*
   GBool getEnableFreeType();
   GBool getDisableFreeTypeHinting();
@@ -315,6 +316,7 @@
   */
   void setInitialZoom(char *s);
   void setContinuousView(GBool cont);
+  void setOutlinePaneSize(int size);
   /*
   GBool setEnableFreeType(char *s);
   */
@@ -477,6 +479,7 @@
   */
   GString *initialZoom;		// initial zoom level
   GBool continuousView;		// continuous view mode
+  int outlinePaneSize;		// side panel size
   /*
   GBool enableFreeType;		// FreeType enable flag
   GBool disableFreeTypeHinting;	// FreeType hinting disable flag
diff -urN xpdf-3.04/xpdf/XPDFViewer.cc xpdf-3.04_PTT2/xpdf/XPDFViewer.cc
--- xpdf-3.04/xpdf/XPDFViewer.cc	2017-11-13 11:55:46.000000000 +0100
+++ xpdf-3.04_PTT2/xpdf/XPDFViewer.cc	2017-11-13 11:56:03.532064507 +0100
@@ -274,7 +274,7 @@
 #ifndef DISABLE_OUTLINE
   outlineLabels = NULL;
   outlineLabelsLength = outlineLabelsSize = 0;
-  outlinePaneWidth = 175;
+  outlinePaneWidth = xpdfParams->getOutlinePaneSize();
 #endif
 
   // do Motif-specific initialization and create the window;

Reply to: