diff options
Diffstat (limited to 'kviewshell/plugins/djvu/libdjvu')
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/CMakeLists.txt | 41 | ||||
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake | 25 | ||||
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp | 8 | ||||
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp | 2 | ||||
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/GOS.cpp | 1 | ||||
-rw-r--r-- | kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp | 4 |
6 files changed, 74 insertions, 7 deletions
diff --git a/kviewshell/plugins/djvu/libdjvu/CMakeLists.txt b/kviewshell/plugins/djvu/libdjvu/CMakeLists.txt new file mode 100644 index 00000000..6426c975 --- /dev/null +++ b/kviewshell/plugins/djvu/libdjvu/CMakeLists.txt @@ -0,0 +1,41 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include( ConfigureChecks.cmake ) + +add_definitions( + -DUNIX + -DHAVE_STDINCLUDES +) + +include_directories( + ${CMAKE_BINARY_DIR} + ${TQT_INCLUDE_DIRS} +) + + +##### djvu (shared) ############################# + +tde_add_library( djvu SHARED + SOURCES + Arrays.cpp DjVuDocEditor.cpp DjVuMessageLite.cpp GOS.cpp IW44Image.cpp + BSByteStream.cpp DjVuDocument.cpp DjVuNavDir.cpp GPixmap.cpp JB2EncodeCodec.cpp + BSEncodeByteStream.cpp DjVuDumpHelper.cpp DjVuPalette.cpp GRect.cpp + JB2Image.cpp ByteStream.cpp DjVuErrorList.cpp DjVuPort.cpp GScaler.cpp + JPEGDecoder.cpp DataPool.cpp DjVuFileCache.cpp DjVuText.cpp GSmartPointer.cpp + MMRDecoder.cpp DjVuFile.cpp DjVuToPS.cpp GString.cpp MMX.cpp DjVmNav.cpp + debug.cpp DjVuGlobal.cpp GBitmap.cpp GThreads.cpp UnicodeByteStream.cpp + DjVmDir0.cpp DjVuGlobalMemory.cpp GContainer.cpp GUnicode.cpp XMLParser.cpp + DjVmDir.cpp DjVuImage.cpp GException.cpp GURL.cpp XMLTags.cpp DjVmDoc.cpp + DjVuInfo.cpp GIFFManager.cpp IFFByteStream.cpp ZPCodec.cpp DjVuAnno.cpp + DjVuMessage.cpp GMapAreas.cpp IW44EncodeCodec.cpp + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake b/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake new file mode 100644 index 00000000..50f708f1 --- /dev/null +++ b/kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake @@ -0,0 +1,25 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include( CheckFunctionExists ) + +check_type_size( wchar_t WCHAR_T ) + +if( HAVE_WCHAR_T ) + tde_save( CMAKE_EXTRA_INCLUDE_FILES ) + set( CMAKE_EXTRA_INCLUDE_FILES wchar.h ) + check_type_size( mbstate_t MBSTATE_T ) + tde_restore( CMAKE_EXTRA_INCLUDE_FILES ) + check_function_exists( iswspace HAVE_ISWSPACE ) + if( HAVE_MBSTATE_T ) + check_function_exists( wcrtomb HAVE_WCRTOMB ) + endif( ) +endif( ) diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp index a6772e61..7cece60b 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp @@ -241,8 +241,8 @@ GLObject::print(ByteStream & str, int compact, int indent, int * cur_pos) const else { char buf[8]; - static char *tr1 = "\"\\tnrbf"; - static char *tr2 = "\"\\\t\n\r\b\f"; + static const char *tr1 = "\"\\tnrbf"; + static const char *tr2 = "\"\\\t\n\r\b\f"; sprintf(buf,"\\%03o", (int)(((unsigned char*)data)[span])); for (int i=0; tr2[i]; i++) if (data[span] == tr2[i]) @@ -472,8 +472,8 @@ GLParser::get_token(const char * & start) } else { - static char *tr1 = "tnrbfva"; - static char *tr2 = "\t\n\r\b\f\013\007"; + const static char *tr1 = "tnrbfva"; + const static char *tr2 = "\t\n\r\b\f\013\007"; for (int i=0; tr1[i]; i++) if (c == tr1[i]) c = tr2[i]; diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp index beaa01bc..d18c7801 100644 --- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp +++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp @@ -267,7 +267,7 @@ DjVuToPS::DjVuToPS(void) DEBUG_MAKE_INDENT(3); DEBUG_MSG("Initializing dig2hex[]\n"); // Creating tables for bin=>text translation - static char * dig2hex="0123456789ABCDEF"; + static const char * dig2hex="0123456789ABCDEF"; int i; for(i=0;i<256;i++) { diff --git a/kviewshell/plugins/djvu/libdjvu/GOS.cpp b/kviewshell/plugins/djvu/libdjvu/GOS.cpp index 35aa8997..94449512 100644 --- a/kviewshell/plugins/djvu/libdjvu/GOS.cpp +++ b/kviewshell/plugins/djvu/libdjvu/GOS.cpp @@ -66,6 +66,7 @@ #include "GOS.h" #include "GURL.h" +#include <errno.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> diff --git a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp index 9bf184bd..c8b79809 100644 --- a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp +++ b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp @@ -145,12 +145,12 @@ IFFByteStream::check_id(const char *id) if (id[i]<0x20 || id[i]>0x7e) return -1; // check composite chunks - static char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", 0 }; + static const char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", 0 }; for (i=0; szComposite[i]; i++) if (!memcmp(id, szComposite[i], 4)) return 1; // check reserved chunks - static char *szReserved[] = { "FOR", "LIS", "CAT", 0 }; + static const char *szReserved[] = { "FOR", "LIS", "CAT", 0 }; for (i=0; szReserved[i]; i++) if (!memcmp(id, szReserved[i], 3) && id[3]>='1' && id[3]<='9') return -1; |