]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/XPDFApp.cc
Scroll at the top of the page when changing page
[evince.git] / pdf / xpdf / XPDFApp.cc
index d93f2a0490c2898731f80bd174be099d368518ec..ae8d0099e241114509e556bd66e19efcdc881e09 100644 (file)
@@ -17,7 +17,7 @@
 #include "Error.h"
 #include "XPDFViewer.h"
 #include "XPDFApp.h"
 #include "Error.h"
 #include "XPDFViewer.h"
 #include "XPDFApp.h"
-#include "config.h"
+#include "xpdfconfig.h"
 
 // these macro defns conflict with xpdf's Object class
 #ifdef LESSTIF_VERSION
 
 // these macro defns conflict with xpdf's Object class
 #ifdef LESSTIF_VERSION
@@ -35,6 +35,7 @@
 //------------------------------------------------------------------------
 
 static String fallbackResources[] = {
 //------------------------------------------------------------------------
 
 static String fallbackResources[] = {
+  "*.zoomComboBox*fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*XmTextField.fontList: -*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*.fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*XmTextField.translations: #override\\n"
   "*XmTextField.fontList: -*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*.fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
   "*XmTextField.translations: #override\\n"
@@ -162,12 +163,20 @@ void XPDFApp::getResources() {
   installCmap = (GBool)resources.installCmap;
   rgbCubeSize = resources.rgbCubeSize;
   reverseVideo = (GBool)resources.reverseVideo;
   installCmap = (GBool)resources.installCmap;
   rgbCubeSize = resources.rgbCubeSize;
   reverseVideo = (GBool)resources.reverseVideo;
-  paperColor = reverseVideo ? BlackPixel(display, screenNum) :
-                              WhitePixel(display, screenNum);
+  if (reverseVideo) {
+    paperRGB = splashMakeRGB8(0x00, 0x00, 0x00);
+    paperColor = BlackPixel(display, screenNum);
+  } else {
+    paperRGB = splashMakeRGB8(0xff, 0xff, 0xff);
+    paperColor = WhitePixel(display, screenNum);
+  }
   if (resources.paperColor) {
     XtVaGetValues(appShell, XmNcolormap, &colormap, NULL);
     if (XAllocNamedColor(display, colormap, resources.paperColor,
                         &xcol, &xcol2)) {
   if (resources.paperColor) {
     XtVaGetValues(appShell, XmNcolormap, &colormap, NULL);
     if (XAllocNamedColor(display, colormap, resources.paperColor,
                         &xcol, &xcol2)) {
+      paperRGB = splashMakeRGB8(xcol.red >> 8,
+                               xcol.green >> 8,
+                               xcol.blue >> 8);
       paperColor = xcol.pixel;
     } else {
       error(-1, "Couldn't allocate color '%s'", resources.paperColor);
       paperColor = xcol.pixel;
     } else {
       error(-1, "Couldn't allocate color '%s'", resources.paperColor);
@@ -271,9 +280,9 @@ void XPDFApp::quit() {
     delete (XPDFViewer *)viewers->del(0);
   }
 #if HAVE_XTAPPSETEXITFLAG
     delete (XPDFViewer *)viewers->del(0);
   }
 #if HAVE_XTAPPSETEXITFLAG
-  exit(0);
-#else
   XtAppSetExitFlag(appContext);
   XtAppSetExitFlag(appContext);
+#else
+  exit(0);
 #endif
 }
 
 #endif
 }
 
@@ -378,7 +387,6 @@ void XPDFApp::remoteMsgCbk(Widget widget, XtPointer ptr,
       app->remoteViewer->open(fileName, page, destName);
       delete fileName;
     }
       app->remoteViewer->open(fileName, page, destName);
       delete fileName;
     }
-    XFree((XPointer)cmd);
     if (destName) {
       delete destName;
     }
     if (destName) {
       delete destName;
     }
@@ -397,4 +405,6 @@ void XPDFApp::remoteMsgCbk(Widget widget, XtPointer ptr,
     XMapRaised(app->display, XtWindow(app->remoteWin));
     XFlush(app->display);
   }
     XMapRaised(app->display, XtWindow(app->remoteWin));
     XFlush(app->display);
   }
+
+  XFree((XPointer)cmd);
 }
 }