]> www.fi.muni.cz Git - evince.git/commitdiff
Import of Xpdf 2.01 for merge XPDF_2_01
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>
Mon, 31 Mar 2003 21:55:40 +0000 (21:55 +0000)
committerMartin Kretzschmar <mkretzschmar@src.gnome.org>
Mon, 31 Mar 2003 21:55:40 +0000 (21:55 +0000)
pdf/xpdf/FontEncodingTables.cc
pdf/xpdf/Outline.cc
pdf/xpdf/XPDFApp.cc
pdf/xpdf/XPDFApp.h
pdf/xpdf/XPDFCore.cc
pdf/xpdf/XPDFCore.h
pdf/xpdf/XPDFViewer.cc
pdf/xpdf/XPDFViewer.h

index bd5f9cff6760183a4fcee8ed7c83ea13f79174c8..6deff95ca688fa74663f1be83617426a70578471 100644 (file)
@@ -184,32 +184,32 @@ char *macRomanEncoding[256] = {
   "trademark",
   "acute",
   "dieresis",
-  NULL,
+  "notequal",
   "AE",
   "Oslash",
-  NULL,
+  "infinity",
   "plusminus",
-  NULL,
-  NULL,
+  "lessequal",
+  "greaterequal",
   "yen",
   "mu",
-  NULL,
-  NULL,
-  NULL,
-  NULL,
-  NULL,
+  "partialdiff",
+  "summation",
+  "product",
+  "pi",
+  "integral",
   "ordfeminine",
   "ordmasculine",
-  NULL,
+  "Omega",
   "ae",
   "oslash",
   "questiondown",
   "exclamdown",
   "logicalnot",
-  NULL,
+  "radical",
   "florin",
-  NULL,
-  NULL,
+  "approxequal",
+  "Delta",
   "guillemotleft",
   "guillemotright",
   "ellipsis",
@@ -226,7 +226,7 @@ char *macRomanEncoding[256] = {
   "quoteleft",
   "quoteright",
   "divide",
-  NULL,
+  "lozenge",
   "ydieresis",
   "Ydieresis",
   "fraction",
@@ -251,7 +251,7 @@ char *macRomanEncoding[256] = {
   "Igrave",
   "Oacute",
   "Ocircumflex",
-  NULL,
+  "apple",
   "Ograve",
   "Uacute",
   "Ucircumflex",
index 256d38d4ba7ca62988f71a2cb14cb9c0baafce64..267c6a04af3ffcb1997bc0c67d81fe92b7d0f71f 100644 (file)
@@ -96,7 +96,7 @@ OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
 OutlineItem::~OutlineItem() {
   close();
   if (title) {
-    delete title;
+    gfree(title);
   }
   if (action) {
     delete action;
index e456310b6ad30c20b844ea4730419d4e83947286..864dabb480a54ff601ebd23782d46860b9f0a833 100644 (file)
@@ -306,6 +306,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 +354,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 +379,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);
+  }
 }
index 4875456e673bb02d6a1633f43b2dc71d75475ec6..d4841e7bb3023e375d13f8dfe4e346cfeae8641b 100644 (file)
@@ -54,6 +54,7 @@ public:
   GBool remoteServerRunning();
   void remoteOpen(GString *fileName, int page, GBool raise);
   void remoteOpenAtDest(GString *fileName, GString *dest, GBool raise);
+  void remoteReload(GBool raise);
   void remoteRaise();
   void remoteQuit();
 
index 8376ce97d5b5ce85bf352f426cfdea45342fe399..554154cbb70d7fc3c39b20a3201bcda300f9bd28 100644 (file)
@@ -150,6 +150,7 @@ XPDFCore::XPDFCore(Widget shellA, Widget parentWidgetA,
       zoom = maxZoom;
     }
   }
+  delete initialZoom;
 
   scrollX = 0;
   scrollY = 0;
@@ -961,7 +962,7 @@ GString *XPDFCore::extractText(int pageNum,
   if (!doc->okToCopy()) {
     return NULL;
   }
-  textOut = new TextOutputDev(NULL, gFalse, gFalse);
+  textOut = new TextOutputDev(NULL, gFalse, gFalse, gFalse);
   if (!textOut->isOk()) {
     delete textOut;
     return NULL;
@@ -1275,7 +1276,7 @@ void XPDFCore::find(char *s) {
   }
 
   // search following pages
-  textOut = new TextOutputDev(NULL, gFalse, gFalse);
+  textOut = new TextOutputDev(NULL, gFalse, gFalse, gFalse);
   if (!textOut->isOk()) {
     delete textOut;
     goto done;
index 348486f0ff9c786bfe8f994a98c40b6d638f8bb5..cf5308e37505daee74ce5ae1c458b6515761743f 100644 (file)
@@ -169,6 +169,7 @@ public:
   int getDrawAreaWidth() { return drawAreaWidth; }
   int getDrawAreaHeight() { return drawAreaHeight; }
   void setBusyCursor(GBool busy);
+  Cursor getBusyCursor() { return busyCursor; }
   void takeFocus();
   void enableHyperlinks(GBool on) { hyperlinksEnabled = on; }
   void enableSelect(GBool on) { selectEnabled = on; }
index a8c8f8f0fa68d32cb24d10aaf02f7d2547779ae7..83f8c7789adb9482ee49a03bd1eb4f9bfb15d1cf 100644 (file)
@@ -1560,6 +1560,7 @@ void XPDFViewer::initAboutDialog() {
   int n, i;
   XmString s;
   char buf[20];
+  XmFontListEntry entry;
 
   //----- dialog
   n = 0;
@@ -1600,18 +1601,24 @@ void XPDFViewer::initAboutDialog() {
   XtManageChild(col);
 
   //----- fonts
-  aboutBigFont = XmFontListAppendEntry(NULL,
-      XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG, XmFONT_IS_FONT,
-         XLoadQueryFont(display,
-             "-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1")));
-  aboutVersionFont = XmFontListAppendEntry(NULL,
-      XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG, XmFONT_IS_FONT,
-         XLoadQueryFont(display,
-             "-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1")));
-  aboutFixedFont = XmFontListAppendEntry(NULL,
-      XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG, XmFONT_IS_FONT,
-         XLoadQueryFont(display,
-             "-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1")));
+  entry = XmFontListEntryLoad(
+               display,
+               "-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1",
+               XmFONT_IS_FONT, XmFONTLIST_DEFAULT_TAG);
+  aboutBigFont = XmFontListAppendEntry(NULL, entry);
+  XmFontListEntryFree(&entry);
+  entry = XmFontListEntryLoad(
+               display,
+               "-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1",
+               XmFONT_IS_FONT, XmFONTLIST_DEFAULT_TAG);
+  aboutVersionFont = XmFontListAppendEntry(NULL, entry);
+  XmFontListEntryFree(&entry);
+  entry = XmFontListEntryLoad(
+               display,
+               "-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1",
+               XmFONT_IS_FONT, XmFONTLIST_DEFAULT_TAG);
+  aboutFixedFont = XmFontListAppendEntry(NULL, entry);
+  XmFontListEntryFree(&entry);
 
   //----- heading
   n = 0;
@@ -1816,7 +1823,10 @@ void XPDFViewer::findFindCbk(Widget widget, XtPointer ptr,
                             XtPointer callData) {
   XPDFViewer *viewer = (XPDFViewer *)ptr;
 
+  XDefineCursor(viewer->display, XtWindow(viewer->findDialog),
+               viewer->core->getBusyCursor());
   viewer->core->find(XmTextFieldGetString(viewer->findText));
+  XUndefineCursor(viewer->display, XtWindow(viewer->findDialog));
 }
 
 void XPDFViewer::findCloseCbk(Widget widget, XtPointer ptr,
@@ -2052,34 +2062,37 @@ void XPDFViewer::initPrintDialog() {
 void XPDFViewer::setupPrintDialog() {
   PDFDoc *doc;
   char buf[20];
-  GString *pdfFileName, *psFileName;
+  GString *pdfFileName, *psFileName, *psFileName2;
   char *p;
 
   doc = core->getDoc();
-
   psFileName = globalParams->getPSFile();
+
   if (psFileName && psFileName->getChar(0) != '|') {
     XmTextFieldSetString(printFileText, psFileName->getCString());
   } else {
     pdfFileName = doc->getFileName();
     p = pdfFileName->getCString() + pdfFileName->getLength() - 4;
     if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")) {
-      psFileName = new GString(pdfFileName->getCString(),
-                              pdfFileName->getLength() - 4);
+      psFileName2 = new GString(pdfFileName->getCString(),
+                               pdfFileName->getLength() - 4);
     } else {
-      psFileName = pdfFileName->copy();
+      psFileName2 = pdfFileName->copy();
     }
-    psFileName->append(".ps");
-    XmTextFieldSetString(printFileText, psFileName->getCString());
-    delete psFileName;
+    psFileName2->append(".ps");
+    XmTextFieldSetString(printFileText, psFileName2->getCString());
+    delete psFileName2;
   }
 
-  psFileName = globalParams->getPSFile();
   if (psFileName && psFileName->getChar(0) == '|') {
     XmTextFieldSetString(printCmdText,
                         psFileName->getCString() + 1);
   }
 
+  if (psFileName) {
+    delete psFileName;
+  }
+
   sprintf(buf, "%d", doc->getNumPages());
   XmTextFieldSetString(printFirstPage, "1");
   XmTextFieldSetString(printLastPage, buf);
index 77875c4163bbc1d6bafc47f3a556ce519722c610..124650ada30526b3f22695e57bcf578111790eea 100644 (file)
@@ -46,6 +46,7 @@ public:
 
   void open(GString *fileName, int pageA, GString *destName);
   void clear();
+  void reloadFile();
 
   Widget getWindow() { return win; }
 
@@ -54,7 +55,6 @@ private:
   //----- load / display
   GBool loadFile(GString *fileName, GString *ownerPassword = NULL,
                 GString *userPassword = NULL);
-  void reloadFile();
   void displayPage(int pageA, int zoomA, int rotateA,
                    GBool scrollToTop, GBool addToHist);
   void displayDest(LinkDest *dest, int zoomA, int rotateA,