]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/XPDFApp.cc
Reused eog HIG dialog in GPdf.
[evince.git] / pdf / xpdf / XPDFApp.cc
index e456310b6ad30c20b844ea4730419d4e83947286..d93f2a0490c2898731f80bd174be099d368518ec 100644 (file)
@@ -2,7 +2,7 @@
 //
 // XPDFApp.cc
 //
-// Copyright 2002 Glyph & Cog, LLC
+// Copyright 2002-2003 Glyph & Cog, LLC
 //
 //========================================================================
 
@@ -270,7 +270,11 @@ void XPDFApp::quit() {
   while (viewers->getLength() > 0) {
     delete (XPDFViewer *)viewers->del(0);
   }
+#if HAVE_XTAPPSETEXITFLAG
+  exit(0);
+#else
   XtAppSetExitFlag(appContext);
+#endif
 }
 
 void XPDFApp::run() {
@@ -306,6 +310,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 +358,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;
@@ -379,8 +383,18 @@ void XPDFApp::remoteMsgCbk(Widget widget, XtPointer ptr,
       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);
+  }
 }