Commit 1a5f2be0 authored by Michel Ludwig's avatar Michel Ludwig
Browse files

Merge branch 'master' into viewerinterface

parents b4206819 94d4035a
......@@ -153,6 +153,7 @@ set(okularpart_SRCS
ui/formwidgets.cpp
ui/guiutils.cpp
ui/ktreeviewsearchline.cpp
ui/latexrenderer.cpp
ui/minibar.cpp
ui/pageitemdelegate.cpp
ui/pagepainter.cpp
......
......@@ -38,6 +38,7 @@ inline KAboutData okularAboutData( const char* name, const char* iname )
about.addAuthor(ki18n("Piotr Szymanski"), ki18n("Created Okular from KPDF codebase"), "djurban@pld-dc.org");
about.addAuthor(ki18n("Enrico Ros"), ki18n("KPDF developer"), "eros.kde@email.it");
about.addCredit(ki18n("Eugene Trounev"), ki18n("Annotations artwork"), "eugene.trounev@gmail.com");
about.addCredit(ki18n("Jiri Baum - NICTA"), ki18n("Table selection tool"), "jiri@baum.com.au");
return about;
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>378</height>
<width>558</width>
<height>575</height>
</rect>
</property>
<layout class="QVBoxLayout">
......@@ -193,17 +193,17 @@
<property name="title">
<string>View Options</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
<item row="0" column="0">
<widget class="QLabel" name="columnLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Overview columns:</string>
<string>Overview &amp;columns:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_ViewColumns</cstring>
</property>
</widget>
</item>
......@@ -225,6 +225,9 @@
<property name="text">
<string>&amp;Page Up/Down overlap:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_ScrollOverlap</cstring>
</property>
......@@ -243,6 +246,54 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="toolTip">
<string>Defines the default zoom mode for files which were never opened before.
For files which were opened before the previous zoom is applied.</string>
</property>
<property name="whatsThis">
<string comment="@info:whatsthis">Defines the default zoom mode for files which were never opened before.
For files which were opened before the previous zoom is applied.</string>
</property>
<property name="text">
<string>&amp;Default Zoom:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_ZoomMode</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="kcfg_ZoomMode">
<property name="toolTip">
<string>Defines the default zoom mode for files which were never opened before.
For files which were opened before the previous zoom is applied.</string>
</property>
<property name="whatsThis">
<string comment="@info:whatsthis">Defines the default zoom mode for files which were never opened before.
For files which were opened before the previous zoom is applied.</string>
</property>
<item>
<property name="text">
<string>100%</string>
</property>
</item>
<item>
<property name="text">
<string>Fit Width</string>
</property>
</item>
<item>
<property name="text">
<string>Fit Page</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -253,7 +253,7 @@
</choices>
</entry>
<entry key="ZoomMode" type="UInt" >
<default>2</default>
<default>1</default>
<max>2</max>
</entry>
<entry key="ZoomFactor" type="Double" >
......
......@@ -1372,6 +1372,16 @@ Add a 'Find Previous' entry
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Default Zoom</guilabel></term>
<listitem>
<para>
This options specifies the default zoom mode for file which were never
opened before. For those files which were opened before the previous zoom mode
is applied.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect1>
<sect1 id="configaccessibility">
......
......@@ -20,9 +20,8 @@ macro_log_feature(TIFF_FOUND "libTIFF" "A library for reading and writing TIFF f
macro_optional_find_package(Freetype)
macro_log_feature(FREETYPE_FOUND "FreeType" "A font rendering engine" "http://www.freetype.org" FALSE "" "Provides freetype font support in the okular DVI generator.")
#we look for JPEG in kdegraphics/CMakeLists.txt
#macro_optional_find_package(JPEG)
#macro_log_feature(JPEG_FOUND "JPEG" "A library for reading and writing JPEG image files." "http://www.ijg.org" FALSE "" "Support fof PalmDB documents in okular.")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "JPEG" "A library for reading and writing JPEG image files." "http://www.ijg.org" FALSE "" "Support fof PalmDB documents in okular.")
macro_optional_find_package(ZLIB)
macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.zlib.net" FALSE "" "Support for Plucker files in Okular.")
......
......@@ -361,11 +361,18 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
anchorList[anchorName] = Anchor(current_page+1, l);
}
// The PostScript code defines a bookmark
if (cp.contains("/Dest") && cp.contains("/Title"))
if (cp.contains("/Dest") && cp.contains("/Title")) {
const QString childrenNumberAndMoreStuff = cp.section('-', 1, 1); // Contains from the - symbol to the end of cp, effectively containing the number of children and some stuff after it
int indexOfFirstNonDigit = 0;
foreach(const QChar &c, childrenNumberAndMoreStuff) {
if (c.isDigit()) ++indexOfFirstNonDigit;
else break;
}
prebookmarks.append(PreBookmark(PDFencodingToQString(cp.section('(', 2, 2).section(')', 0, 0)),
cp.section('(', 1, 1).section(')', 0, 0),
cp.section('-', 1, 1).section(' ', 0, 0).toUInt()
childrenNumberAndMoreStuff.left(indexOfFirstNonDigit).toUInt()
));
}
return;
}
}
......
Description: Disable SYNCTEX_INLINE on non-MSVC compilers.
It is misplaced in the code (before "static"), so it causes compiling errors.
Author: Pino Toscano <pino@kde.org>
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c 2010-05-23 19:01:59.000000000 +0200
+++ synctex/synctex_parser.c 2010-05-23 19:02:29.000000000 +0200
@@ -66,7 +66,7 @@
diff --git a/generators/poppler/synctex/synctex_parser.c b/generators/poppler/synctex/synctex_parser.c
index 0d3de08..53f462d 100644
--- a/generators/poppler/synctex/synctex_parser.c
+++ b/generators/poppler/synctex/synctex_parser.c
@@ -67,7 +67,7 @@ Thu Jun 19 09:39:21 UTC 2008
# if defined(_MSC_VER)
# define SYNCTEX_INLINE __inline
# else
......
Description: Move the declaration of "_synctex_open", as it is needed by an earlier function.
Author: Pino Toscano <pino@kde.org>
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c 2010-05-23 18:52:35.000000000 +0200
+++ synctex/synctex_parser.c 2010-05-23 18:54:04.000000000 +0200
@@ -2481,6 +2481,8 @@
goto next_sheet;
}
+int _synctex_open(const char * output, const char * build_directory, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_modeRef);
+
/* Where the synctex scanner is created. */
synctex_scanner_t synctex_scanner_new_with_output_file(const char * output, const char * build_directory, int parse) {
gzFile file = NULL;
@@ -2650,8 +2652,6 @@
# undef io_mode
}
-int _synctex_open(const char * output, const char * build_directory, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_modeRef);
-
/* Opens the ouput file, taking into account the eventual build_directory.
* 0 on success, non 0 on error. */
int _synctex_open(const char * output, const char * build_directory, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_modeRef) {
Index: synctex/synctex_parser_utils.c
===================================================================
--- synctex.orig/synctex_parser_utils.c 2010-05-23 18:49:35.000000000 +0200
+++ synctex/synctex_parser_utils.c 2010-05-23 19:04:27.000000000 +0200
@@ -142,7 +142,7 @@
/* Compare two file names, windows is sometimes case insensitive... */
synctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs) {
diff --git a/generators/poppler/synctex/synctex_parser_utils.c b/generators/poppler/synctex/synctex_parser_utils.c
index 569f7e9..e85ca73 100644
--- a/generators/poppler/synctex/synctex_parser_utils.c
+++ b/generators/poppler/synctex/synctex_parser_utils.c
@@ -157,7 +157,7 @@ synctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs
/* Remove the leading regex '(\./+)*' in both rhs and lhs */
lhs = synctex_ignore_leading_dot_slash(lhs);
rhs = synctex_ignore_leading_dot_slash(rhs);
-# if SYNCTEX_WINDOWS
+# ifdef SYNCTEX_WINDOWS
/* On Windows, filename should be compared case insensitive.
* The characters '/' and '\' are both valid path separators.
* There will be a very serious problem concerning UTF8 because
@@ -174,7 +174,7 @@
@@ -189,7 +189,7 @@ synctex_bool_t _synctex_path_is_absolute(const char * name) {
if(!strlen(name)) {
return synctex_NO;
}
......@@ -20,11 +20,11 @@ Index: synctex/synctex_parser_utils.c
if(strlen(name)>2) {
return (name[1]==':' && SYNCTEX_IS_PATH_SEPARATOR(name[2]))?synctex_YES:synctex_NO;
}
Index: synctex/synctex_parser_utils.h
===================================================================
--- synctex.orig/synctex_parser_utils.h 2010-05-23 18:49:35.000000000 +0200
+++ synctex/synctex_parser_utils.h 2010-05-23 19:03:30.000000000 +0200
@@ -55,7 +55,7 @@
diff --git a/generators/poppler/synctex/synctex_parser_utils.h b/generators/poppler/synctex/synctex_parser_utils.h
index e67f8f5..f0709e9 100644
--- a/generators/poppler/synctex/synctex_parser_utils.h
+++ b/generators/poppler/synctex/synctex_parser_utils.h
@@ -61,13 +61,13 @@ authorization from the copyright holder.
extern "C" {
#endif
......@@ -33,3 +33,10 @@ Index: synctex/synctex_parser_utils.h
# define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c || '\\' == c)
# else
# define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c)
# endif
-# if _WIN32
+# ifdef _WIN32
# define SYNCTEX_IS_DOT(c) ('.' == c)
# else
# define SYNCTEX_IS_DOT(c) ('.' == c)
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c 2010-05-23 19:02:29.000000000 +0200
+++ synctex/synctex_parser.c 2010-05-23 19:07:22.000000000 +0200
@@ -1510,7 +1510,7 @@
typedef synctex_status_t (*synctex_decoder_t)(synctex_scanner_t,void *);
-synctex_status_t _synctex_scan_named(synctex_scanner_t scanner,char * name,void * value_ref,synctex_decoder_t decoder);
+synctex_status_t _synctex_scan_named(synctex_scanner_t scanner,const char * name,void * value_ref,synctex_decoder_t decoder);
/* Used when parsing the synctex file.
* Read one of the settings.
@@ -1520,7 +1520,7 @@
* On return, the scanner points to the next character after the decoded object whatever it is.
* It is the responsibility of the caller to prepare the scanner for the next line.
*/
-synctex_status_t _synctex_scan_named(synctex_scanner_t scanner,char * name,void * value_ref,synctex_decoder_t decoder) {
+synctex_status_t _synctex_scan_named(synctex_scanner_t scanner,const char * name,void * value_ref,synctex_decoder_t decoder) {
synctex_status_t status = 0;
if(NULL == scanner || NULL == name || NULL == value_ref || NULL == decoder) {
return SYNCTEX_STATUS_BAD_ARGUMENT;
Index: synctex/synctex_parser_utils.h
===================================================================
--- synctex.orig/synctex_parser_utils.h 2010-05-23 19:07:34.000000000 +0200
+++ synctex/synctex_parser_utils.h 2010-05-23 19:08:00.000000000 +0200
@@ -61,6 +61,12 @@
# define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c)
diff --git a/generators/poppler/synctex/synctex_parser_utils.h b/generators/poppler/synctex/synctex_parser_utils.h
index f0709e9..92184b8 100644
--- a/generators/poppler/synctex/synctex_parser_utils.h
+++ b/generators/poppler/synctex/synctex_parser_utils.h
@@ -72,7 +72,13 @@ extern "C" {
# else
# define SYNCTEX_IS_DOT(c) ('.' == c)
# endif
-
+
+# ifdef __GNUC__
+# define SYNCTEX_PRINTF_FORMAT(si, ftc) __attribute__ ((format (printf, si, ftc)))
+# else
+# define SYNCTEX_PRINTF_FORMAT(si, ftc)
+# endif
+
+
/* This custom malloc functions initializes to 0 the newly allocated memory.
* There is no bzero function on windows. */
void *_synctex_malloc(size_t size);
@@ -68,7 +74,7 @@
@@ -80,7 +86,7 @@ void *_synctex_malloc(size_t size);
/* This is used to log some informational message to the standard error stream.
* On Windows, the stderr stream is not exposed and another method is used.
* The return value is the number of characters printed. */
......
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c 2010-05-23 19:09:29.000000000 +0200
+++ synctex/synctex_parser.c 2010-05-23 19:10:17.000000000 +0200
@@ -1435,7 +1435,7 @@
diff --git a/generators/poppler/synctex/synctex_parser.c b/generators/poppler/synctex/synctex_parser.c
index 53f462d..588f350 100644
--- a/generators/poppler/synctex/synctex_parser.c
+++ b/generators/poppler/synctex/synctex_parser.c
@@ -1440,7 +1440,7 @@ next_character:
len = SYNCTEX_END - SYNCTEX_CUR;
if(current_size>UINT_MAX-len-1) {
if (current_size>UINT_MAX-len-1) {
/* We have reached the limit. */
- _synctex_error("limit reached (missing %i).",current_size-(UINT_MAX-len-1));
+ _synctex_error("limit reached (missing %lu).",current_size-(UINT_MAX-len-1));
......
......@@ -2,11 +2,11 @@ _vscprintf() is specific for MSVC; thus in _synctex_error(), for any other
compiler on Windows, use _vsnprintf() and grow the buffer until necessary.
Patch provided by Patrick Spendrin <ps_ml@gmx.de>.
Index: synctex/synctex_parser_utils.c
===================================================================
--- synctex.orig/synctex_parser_utils.c 2010-05-23 19:17:10.000000000 +0200
+++ synctex/synctex_parser_utils.c 2010-05-23 19:17:33.000000000 +0200
@@ -89,8 +89,26 @@
diff --git a/generators/poppler/synctex/synctex_parser_utils.c b/generators/poppler/synctex/synctex_parser_utils.c
index e85ca73..ef1645e 100644
--- a/generators/poppler/synctex/synctex_parser_utils.c
+++ b/generators/poppler/synctex/synctex_parser_utils.c
@@ -90,8 +90,26 @@ int _synctex_error(const char * reason,...) {
char *buff;
size_t len;
OutputDebugStringA("SyncTeX ERROR: ");
......
......@@ -6,16 +6,16 @@ Description: synctex_scanner_new_with_output_file: reset the io_mode to read bef
The easiest solution is to reset the io_mode before doing the second open
attempt.
Author: Albert Astals Cid <aacid@kde.org>
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c 2010-05-31 00:27:21.000000000 +0200
+++ synctex/synctex_parser.c 2010-05-31 00:27:56.000000000 +0200
@@ -2506,6 +2506,8 @@
diff --git a/generators/poppler/synctex/synctex_parser.c b/generators/poppler/synctex/synctex_parser.c
index 588f350..c8f61bb 100644
--- a/generators/poppler/synctex/synctex_parser.c
+++ b/generators/poppler/synctex/synctex_parser.c
@@ -2584,6 +2584,8 @@ synctex_scanner_t synctex_scanner_new_with_output_file(const char * output, cons
}
/* now open the synctex file */
if(_synctex_open(output,build_directory,&synctex,&file,synctex_NO,&io_mode) || !file) {
if (_synctex_open(output,build_directory,&synctex,&file,synctex_ADD_QUOTES,&io_mode) || !file) {
+ /* reset the io_mode to the default, ie read */
+ io_mode = synctex_io_mode_read;
if(_synctex_open(output,build_directory,&synctex,&file,synctex_YES,&io_mode) || !file) {
+ io_mode = 0;
if (_synctex_open(output,build_directory,&synctex,&file,synctex_DONT_ADD_QUOTES,&io_mode) || !file) {
return NULL;
}
diff --git a/generators/poppler/synctex/synctex_parser.c b/generators/poppler/synctex/synctex_parser.c
index c8f61bb..8244f27 100644
--- a/generators/poppler/synctex/synctex_parser.c
+++ b/generators/poppler/synctex/synctex_parser.c
@@ -3395,11 +3395,11 @@ int synctex_display_query(synctex_scanner_t scanner,const char * name,int line,i
}
start_ref += 1;
SYNCTEX_END = (char *)start_ref;
- SYNCTEX_CUR = NULL;// added on behalf of Jose Alliste
- return (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t);// added on behalf Jan Sundermeyer
+ SYNCTEX_CUR = NULL;/* added on behalf of Jose Alliste */
+ return (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t);/* added on behalf Jan Sundermeyer */
}
SYNCTEX_CUR = NULL;
- // return (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t); removed on behalf Jan Sundermeyer
+ /* return (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t); removed on behalf Jan Sundermeyer */
}
# if defined(__SYNCTEX_STRONG_DISPLAY_QUERY__)
break;
diff --git a/generators/poppler/synctex/synctex_parser_utils.c b/generators/poppler/synctex/synctex_parser_utils.c
index ef1645e..3be45b7 100644
--- a/generators/poppler/synctex/synctex_parser_utils.c
+++ b/generators/poppler/synctex/synctex_parser_utils.c
@@ -492,6 +492,6 @@ int _synctex_get_name(const char * output, const char * build_directory, char **
const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode) {
static const char * synctex_io_modes[4] = {"r","rb","a","ab"};
- unsigned index = ((io_mode & synctex_io_gz_mask)?1:0) + ((io_mode & synctex_io_append_mask)?2:0);// bug pointed out by Jose Alliste
+ unsigned index = ((io_mode & synctex_io_gz_mask)?1:0) + ((io_mode & synctex_io_append_mask)?2:0);/* bug pointed out by Jose Alliste */
return synctex_io_modes[index];
}
diff --git a/generators/poppler/synctex/synctex_parser_utils.c b/generators/poppler/synctex/synctex_parser_utils.c
index 3be45b7..3dd764f 100644
--- a/generators/poppler/synctex/synctex_parser_utils.c
+++ b/generators/poppler/synctex/synctex_parser_utils.c
@@ -199,7 +199,16 @@ next_character:
++rhs;
goto next_character;
# else
- return 0 == strcmp(lhs,rhs)?synctex_YES:synctex_NO;
+ if (lhs[0] == '/' && rhs[0] == '/') { /* for absolute paths compare the real paths */
+ char *lhsreal = realpath(lhs, 0);
+ char *rhsreal = realpath(rhs, 0);
+ synctex_bool_t result = lhsreal && rhsreal && 0 == strcmp(lhsreal,rhsreal)?synctex_YES:synctex_NO;
+ free (lhsreal);
+ free (rhsreal);
+ return result;
+ } else {
+ return 0 == strcmp(lhs,rhs)?synctex_YES:synctex_NO;
+ }
# endif
}
00-fix-__synctex_open-declaration.diff
00-disable-SYNCTEX_INLINE.diff
01-fix-win32-define.diff
03-fix-_synctex_scan_named.diff
04-gcc-specify-printf-format.diff
05-fix-error-formats.diff
06-mingw-_synctex_error.diff
07-synctex_scanner_new_with_output_file-reset-mode.diff
08-fix_cpp_comments.diff
09-fix_path_comparison.diff
This diff is collapsed.
/*
Copyright (c) 2008, 2009 jerome DOT laurens AT u-bourgogne DOT fr
Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr
This file is part of the SyncTeX package.
Latest Revision: Wed Jul 1 11:16:51 UTC 2009
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
Version: 1.16
Version: 1.8
See synctex_parser_readme.txt for more details
License:
......@@ -89,7 +90,7 @@ typedef _synctex_scanner_t * synctex_scanner_t;
* It is the directory where all the auxiliary stuff is created.
* Sometimes, the synctex output file and the pdf, dvi or xdv files are not created in the same directory.
* This is the case in MikTeX (I will include this into TeX Live).
* This directory path can be nil, it will be ignored.
* This directory path can be nil, it will be ignored then.
* It can be either absolute or relative to the directory of the output pdf (dvi or xdv) file.
* If no synctex file is found in the same directory as the output file, then we try to find one in the build directory.
* Please note that this new "build_directory" is provided as a convenient argument but should not be used.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment