X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FXPDFApp.cc;h=ae8d0099e241114509e556bd66e19efcdc881e09;hb=a2f683fe644fded868c536909907282555b1b777;hp=e456310b6ad30c20b844ea4730419d4e83947286;hpb=6112dfe4b45b0305c7a6f61bd8a847f69f892cbb;p=evince.git diff --git a/pdf/xpdf/XPDFApp.cc b/pdf/xpdf/XPDFApp.cc index e456310b..ae8d0099 100644 --- a/pdf/xpdf/XPDFApp.cc +++ b/pdf/xpdf/XPDFApp.cc @@ -2,7 +2,7 @@ // // XPDFApp.cc // -// Copyright 2002 Glyph & Cog, LLC +// Copyright 2002-2003 Glyph & Cog, LLC // //======================================================================== @@ -17,7 +17,7 @@ #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 @@ -35,6 +35,7 @@ //------------------------------------------------------------------------ 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" @@ -162,12 +163,20 @@ void XPDFApp::getResources() { 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)) { + paperRGB = splashMakeRGB8(xcol.red >> 8, + xcol.green >> 8, + xcol.blue >> 8); paperColor = xcol.pixel; } else { error(-1, "Couldn't allocate color '%s'", resources.paperColor); @@ -270,7 +279,11 @@ void XPDFApp::quit() { while (viewers->getLength() > 0) { delete (XPDFViewer *)viewers->del(0); } +#if HAVE_XTAPPSETEXITFLAG XtAppSetExitFlag(appContext); +#else + exit(0); +#endif } void XPDFApp::run() { @@ -306,6 +319,12 @@ void XPDFApp::remoteOpenAtDest(GString *fileName, GString *dest, GBool raise) { XFlush(display); } +void XPDFApp::remoteReload(GBool raise) { + XChangeProperty(display, remoteXWin, remoteAtom, remoteAtom, 8, + PropModeReplace, raise ? (Guchar *)"L" : (Guchar *)"l", 2); + XFlush(display); +} + void XPDFApp::remoteRaise() { XChangeProperty(display, remoteXWin, remoteAtom, remoteAtom, 8, PropModeReplace, (Guchar *)"r", 2); @@ -348,12 +367,6 @@ void XPDFApp::remoteMsgCbk(Widget widget, XtPointer ptr, return; } - // raise window - if (cmd[0] == 'D' || cmd[0] == 'r'){ - XMapRaised(app->display, XtWindow(app->remoteWin)); - XFlush(app->display); - } - // display file / page if (cmd[0] == 'd' || cmd[0] == 'D') { p = cmd + 2; @@ -374,13 +387,24 @@ void XPDFApp::remoteMsgCbk(Widget widget, XtPointer ptr, app->remoteViewer->open(fileName, page, destName); delete fileName; } - XFree((XPointer)cmd); if (destName) { delete destName; } + // reload + } else if (cmd[0] == 'l' || cmd[0] == 'L') { + app->remoteViewer->reloadFile(); + // quit } else if (cmd[0] == 'q') { app->quit(); } + + // raise window + if (cmd[0] == 'D' || cmd[0] == 'L' || cmd[0] == 'r'){ + XMapRaised(app->display, XtWindow(app->remoteWin)); + XFlush(app->display); + } + + XFree((XPointer)cmd); }