]> www.fi.muni.cz Git - evince.git/commitdiff
new widget: table with labels displaying properties of PDFs
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>
Sun, 23 Feb 2003 13:35:35 +0000 (13:35 +0000)
committerMartin Kretzschmar <mkretzschmar@src.gnome.org>
Sun, 23 Feb 2003 13:35:35 +0000 (13:35 +0000)
* xpdf/pdf-properties-display.c, xpdf/pdf-properties-display.h,
xpdf/gpdf-properties-dialog.glade:
new widget: table with labels displaying properties of PDFs

* xpdf/gpdf-control.cc (has_unicode_marker)
(utf16_big_endian_to_utf8, info_dict_get_string)
(info_dict_get_date, gpdf_control_process_string_property)
(gpdf_control_process_date_property)
(gpdf_control_process_properties)
(gpdf_control_properties_dialog_response_cb)
(verb_FileProperties_cb): new: a PDF properties command

* xpdf/Makefile.am: build pdf-properties-display.[ch], install
glade file

* xpdf/.cvsignore: ignore gpdf-properties-dialog.gladep

* xpdf/gpdf-persist-stream.h, xpdf/gpdf-persist-stream.cc
(gpdf_persist_stream_get_length): new function

* xpdf/gpdf-control-ui.xml: add FileProperties command and menu
item inside a "File Items Placeholder"

* shell/gpdf-window-ui.xml: add "File Items Placeholder"

* configure.in: check for libglade-2.0

* Makefile.am (EXTRA_DIST): don't dist gpdf.mime

* xpdf/PDFDoc.cc, xpdf/Function.cc, xpdf/FontFile.cc,
goo/parseargs.c: call atof only in the "C" locale

pdf/goo/parseargs.c
pdf/xpdf/.cvsignore
pdf/xpdf/FontFile.cc
pdf/xpdf/Function.cc
pdf/xpdf/Makefile.am
pdf/xpdf/PDFDoc.cc

index ad8460ae89385453b795c32998ab203ae922caa1..1f2c986a84300e66ed05003ad2fe76ca7e2aa873 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright 1996-2002 Glyph & Cog, LLC
  */
 
+#include <locale.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <string.h>
@@ -117,7 +118,11 @@ static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]) {
     break;
   case argFP:
     if (i + 1 < *argc && isFP(argv[i+1])) {
-      *(double *)arg->val = atof(argv[i+1]);
+      {
+        char *theLocale = setlocale(LC_NUMERIC, "C");
+        *(double *)arg->val = atof(argv[i+1]);
+        setlocale(LC_NUMERIC, theLocale);
+      }
       n = 2;
     } else {
       ok = gFalse;
index 6ebaacb4f4163e350d3f9f08eee753e5f29befd4..9df01f328225e7671b2fa525b2141cda5aea124b 100644 (file)
@@ -9,6 +9,7 @@ gnome-pdf-viewer
 gpdf 
 gpdf-marshal.c
 gpdf-marshal.h
+gpdf-properties-dialog.gladep
 pdfimages
 pdfinfo
 pdftopbm
index ae585470d696089d2942cb06637a1d65a8ad9787..56807a4b9157aee6d7e1f90a08ff51236cf11d6d 100644 (file)
@@ -11,6 +11,7 @@
 #endif
 
 #include <aconf.h>
+#include <locale.h>
 #include <math.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -2130,7 +2131,11 @@ double Type1CFontFile::getNum(Guchar **ptr, GBool *isFP) {
       }
     } while (i < 64);
     buf[i] = '\0';
-    x = atof(buf);
+    {
+      char *theLocale = setlocale(LC_NUMERIC, "C");
+      x = atof(buf);
+      setlocale(LC_NUMERIC, theLocale);
+    }
     *isFP = gTrue;
   } else if (b0 == 31) {
     x = 0;
index 64ea60c1902e6bbbcc8b7e3e3b0ef21ceb993fa6..6d70858a17fd747ceda1ccfd5cc5c05bba72871f 100644 (file)
@@ -11,6 +11,7 @@
 #endif
 
 #include <aconf.h>
+#include <locale.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
@@ -1071,7 +1072,11 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
       resizeCode(*codePtr);
       if (isReal) {
        code[*codePtr].type = psReal;
-       code[*codePtr].real = atof(tok->getCString());
+        {
+          char *theLocale = setlocale(LC_NUMERIC, "C");
+          code[*codePtr].real = atof(tok->getCString());
+          setlocale(LC_NUMERIC, theLocale);
+        }
       } else {
        code[*codePtr].type = psInt;
        code[*codePtr].intg = atoi(tok->getCString());
index dbaa4e4e36f1ce16f9be2072ffcff39d4078fac3..d346d60740914a2d667dbd46cedd03eb0930d6ce 100644 (file)
@@ -125,6 +125,8 @@ gnome_pdf_viewer_SOURCES =          \
        gtkgesture.h                    \
        page-control.c                  \
        page-control.h                  \
+       pdf-properties-display.c        \
+       pdf-properties-display.h        \
        $(BUILT_SOURCES)
 
 # Font embedding hack for Gnome Print < 2.1.?2?
@@ -224,13 +226,11 @@ gpdf-marshal.c: gpdf-marshal.list $(GLIB_GENMARSHAL)
 stockdir = $(datadir)/pixmaps/gpdf
 stock_DATA = fitwidth.png
 
-ltk =                  \
-       xpdf-flip.ltk   \
-       xpdf-top.ltk    \
-       xpdf.ltk
+gladedir = $(datadir)/gpdf/glade
+glade_DATA =                           \
+       gpdf-properties-dialog.glade
 
 server_in_files = GNOME_PDF.server.in.in
-
 serverdir = $(libdir)/bonobo/servers
 server_DATA = $(server_in_files:.server.in.in=.server)
 $(server_in_files:.server.in.in=.server.in): $(server_in_files)
index 683e4d2d69d0cc18259fd5254789e32fca7482d3..f3b7f799417c272f705b5b8ffeafd92e58afd09e 100644 (file)
@@ -11,6 +11,7 @@
 #endif
 
 #include <aconf.h>
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -168,7 +169,11 @@ void PDFDoc::checkHeader() {
   }
   str->moveStart(i);
   p = strtok(&hdrBuf[i+5], " \t\n\r");
-  pdfVersion = atof(p);
+  {
+    char *theLocale = setlocale(LC_NUMERIC, "C");
+    pdfVersion = atof(p);
+    setlocale(LC_NUMERIC, theLocale);
+  }
   if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
       pdfVersion > supportedPDFVersionNum + 0.0001) {
     error(-1, "PDF version %s -- xpdf supports version %s"