summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-06 22:03:48 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-06 22:03:48 +0000
commit0f962a277e58ccb2c6d9ee36ce68966db9b071cc (patch)
treee5341e2fcac3338daf25796bc20ae8c16307673e
parent19158a8de8416c95f7c961e107c475dd786f6449 (diff)
downloadtdegraphics-0f962a277e58ccb2c6d9ee36ce68966db9b071cc.tar.gz
tdegraphics-0f962a277e58ccb2c6d9ee36ce68966db9b071cc.zip
[kdegraphics] cmake support for kamera, kcoloredit, and kviewshell
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1230743 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--CMakeLists.txt8
-rw-r--r--config.h.cmake19
-rw-r--r--kamera/CMakeLists.txt16
-rw-r--r--kamera/ConfigureChecks.cmake15
-rw-r--r--kamera/kcontrol/CMakeLists.txt36
-rw-r--r--kamera/kioslave/CMakeLists.txt32
-rw-r--r--kamera/pics/CMakeLists.txt13
-rw-r--r--kcoloredit/CMakeLists.txt57
-rw-r--r--kviewshell/CMakeLists.txt110
-rw-r--r--kviewshell/pics/CMakeLists.txt14
-rw-r--r--kviewshell/pics/icons/CMakeLists.txt12
-rw-r--r--kviewshell/plugins/CMakeLists.txt12
-rw-r--r--kviewshell/plugins/djvu/CMakeLists.txt47
-rw-r--r--kviewshell/plugins/djvu/libdjvu/CMakeLists.txt41
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake25
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp8
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp2
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GOS.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp4
19 files changed, 464 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57cfa602..4928d498 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,10 +49,13 @@ option( WITH_LIBPAPER "Enable libpaper support" OFF )
##### user requested modules ####################
option( BUILD_ALL "Build all" OFF )
+option( BUILD_KAMERA "Build kamera" ${BUILD_ALL} )
+option( BUILD_KCOLOREDIT "Build kcoloredit" ${BUILD_ALL} )
option( BUILD_KVIEW "Build kview" ${BUILD_ALL} )
option( BUILD_KRULER "Build kruler" ${BUILD_ALL} )
option( BUILD_KPDF "Build kpdf" ${BUILD_ALL} )
option( BUILD_KSVG "Build ksvg" ${BUILD_ALL} )
+option( BUILD_KVIEWSHELL "Build kviewshell" ${BUILD_ALL} )
##### configure checks ##########################
@@ -66,17 +69,20 @@ add_definitions(
-DHAVE_CONFIG_H
)
-set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS} -fexceptions" )
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
##### kdegraphics directories ###################
+tde_conditional_add_subdirectory( BUILD_KAMERA kamera )
+tde_conditional_add_subdirectory( BUILD_KCOLOREDIT kcoloredit )
tde_conditional_add_subdirectory( BUILD_KVIEW kview )
tde_conditional_add_subdirectory( BUILD_KRULER kruler )
tde_conditional_add_subdirectory( BUILD_KPDF kpdf )
tde_conditional_add_subdirectory( BUILD_KSVG ksvg )
+tde_conditional_add_subdirectory( BUILD_KVIEWSHELL kviewshell )
##### write configure files #####################
diff --git a/config.h.cmake b/config.h.cmake
index d4bf009e..40e12535 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -12,3 +12,22 @@
#define STDC_HEADERS 1
#cmakedefine LCMS_HEADER <@LCMS_HEADER@>
#cmakedefine HAVE_FREETYPE_2_2_x 1
+
+// kviewshell (djvu plugin)
+#cmakedefine HAVE_WCHAR_T 1
+#cmakedefine HAVE_ISWSPACE 1
+#cmakedefine HAVE_WCRTOMB 1
+#cmakedefine HAVE_MBSTATE_T 1
+#if !defined(HAVE_WCHAR_T)
+ #define HAS_WCHAR 0
+ #define HAS_WCTYPE 0
+ #define HAS_MBSTATE 0
+#else
+ #define HAS_WCHAR 1
+ #if defined(HAVE_WCTYPE_H) && defined(HAVE_ISWSPACE)
+ #define HAS_WCTYPE 1
+ #endif
+ #if defined(HAVE_MBSTATE_T) && defined(HAVE_WCRTOMB)
+ #define HAS_MBSTATE 1
+ #endif
+#endif
diff --git a/kamera/CMakeLists.txt b/kamera/CMakeLists.txt
new file mode 100644
index 00000000..700fe6a9
--- /dev/null
+++ b/kamera/CMakeLists.txt
@@ -0,0 +1,16 @@
+#################################################
+#
+# (C) 2010-2011 Calvin Morrison
+# mutantturkey@gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include( ConfigureChecks.cmake )
+
+add_subdirectory( kioslave )
+add_subdirectory( kcontrol )
+add_subdirectory( pics )
diff --git a/kamera/ConfigureChecks.cmake b/kamera/ConfigureChecks.cmake
new file mode 100644
index 00000000..359f9a00
--- /dev/null
+++ b/kamera/ConfigureChecks.cmake
@@ -0,0 +1,15 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+pkg_search_module( GPHOTO2 libgphoto2 )
+if( NOT GPHOTO2_FOUND )
+ tde_message_fatal( "libgphoto2 is required, but was not found on your system" )
+endif( )
diff --git a/kamera/kcontrol/CMakeLists.txt b/kamera/kcontrol/CMakeLists.txt
new file mode 100644
index 00000000..c4a395ab
--- /dev/null
+++ b/kamera/kcontrol/CMakeLists.txt
@@ -0,0 +1,36 @@
+#################################################
+#
+# (C) 2010-2011 Calvin Morrison
+# mutantturkey@gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${GPHOTO2_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+#### other data #################################
+
+install( FILES kamera.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+
+#### kamera (module) ############################
+
+tde_add_kpart( kcm_kamera SHARED AUTOMOC
+ SOURCES kamera.cpp kameradevice.cpp kameraconfigdialog.cpp
+ LINK kio-shared ${GPHOTO2_LIBRARIES}
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/kamera/kioslave/CMakeLists.txt b/kamera/kioslave/CMakeLists.txt
new file mode 100644
index 00000000..65bbbf75
--- /dev/null
+++ b/kamera/kioslave/CMakeLists.txt
@@ -0,0 +1,32 @@
+#################################################
+#
+# (C) 2010-2011 Calvin Morrison
+# mutantturkey@gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${GPHOTO2_INCLUDE_DIRS}
+)
+
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+#### kamera (module) ############################
+
+tde_add_kpart( kio_kamera AUTOMOC
+ SOURCES kamera.cpp
+ LINK kio-shared ${GPHOTO2_LIBRARIES}
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/kamera/pics/CMakeLists.txt b/kamera/pics/CMakeLists.txt
new file mode 100644
index 00000000..b42c7419
--- /dev/null
+++ b/kamera/pics/CMakeLists.txt
@@ -0,0 +1,13 @@
+#################################################
+#
+# (C) 2010-2011 Calvin Morrison
+# mutantturkey@gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+tde_install_icons( camera )
+tde_install_icons( camera_test )
diff --git a/kcoloredit/CMakeLists.txt b/kcoloredit/CMakeLists.txt
new file mode 100644
index 00000000..93fc29f3
--- /dev/null
+++ b/kcoloredit/CMakeLists.txt
@@ -0,0 +1,57 @@
+#################################################
+#
+# (C) 2010-2011 Calvin Morrison
+# mutantturkey@gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+#### other data #################################
+
+tde_install_icons( kcoloredit kcolorchooser )
+
+install( FILES
+ kcoloredit.desktop kcolorchooser.desktop
+ DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+install( FILES
+ kcoloreditui.rc
+ DESTINATION ${DATA_INSTALL_DIR}/kcoloredit )
+
+
+#### kcoloredit (executable) ####################
+
+tde_add_executable( kcoloredit AUTOMOC
+ SOURCES
+ kzcolorselector.cpp imageselection.cpp
+ texteditselection.cpp gradientselection.cpp colorselector.cpp
+ kxycolorselector.cpp paletteview.cpp paletteviewscrolledarea.cpp
+ editablestreamhistory.cpp color.cpp palette.cpp loadpalettedlg.cpp
+ kcoloreditview.cpp kcoloreditdoc.cpp kcoloredit.cpp main.cpp
+ LINK kio-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### kcolorchooser (executable) ################
+
+tde_add_executable( kcolorchooser AUTOMOC
+ SOURCES kcolorchooser.cpp
+ LINK kdeui-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kviewshell/CMakeLists.txt b/kviewshell/CMakeLists.txt
new file mode 100644
index 00000000..7361af84
--- /dev/null
+++ b/kviewshell/CMakeLists.txt
@@ -0,0 +1,110 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+project( kviewshell )
+
+add_subdirectory( pics )
+add_subdirectory( plugins )
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### headers ###################################
+
+install( FILES
+ kmultipageInterface.h
+ DESTINATION ${INCLUDE_INSTALL_DIR} )
+
+install( FILES
+ anchor.h bookmark.h pageView.h documentPageCache.h
+ documentRenderer.h documentWidget.h history.h hyperlink.h
+ kmultipage.h length.h pageNumber.h pageSize.h renderedDocumentPage.h
+ renderedDocumentPagePixmap.h renderedDocumentPagePrinter.h
+ selection.h simplePageSize.h textBox.h zoom.h zoomlimits.h
+ DESTINATION ${INCLUDE_INSTALL_DIR}/kviewshell )
+
+
+##### other data ################################
+
+install( FILES kviewshell.rc DESTINATION ${DATA_INSTALL_DIR}/kviewshell )
+install( FILES kviewerpart.rc DESTINATION ${DATA_INSTALL_DIR}/kviewerpart )
+install( FILES kmultipage.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
+install( FILES emptymultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES kviewshell.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
+
+
+##### ifaces (static) ###########################
+
+tde_add_library( ifaces STATIC_PIC AUTOMOC
+ SOURCES
+ kviewpart_iface.cpp
+)
+
+
+##### kviewshell (static) #######################
+
+tde_add_library( kviewshell STATIC_PIC AUTOMOC
+ SOURCES
+ kviewshell.cpp
+)
+
+
+##### kmultipage (shared) #######################
+
+tde_add_library( kmultipage SHARED AUTOMOC
+ SOURCES
+ kmultipage.cpp pageView.cpp marklist.cpp kmultipageInterface.skel
+ units.cpp pageSize.cpp simplePageSize.cpp renderedDocumentPage.cpp
+ renderedDocumentPagePixmap.cpp renderedDocumentPagePrinter.cpp
+ documentPageCache.cpp documentWidget.cpp searchWidget.cpp
+ selection.cpp documentRenderer.cpp history.cpp kvsprefs.kcfgc
+ tableOfContents.cpp kprintDialogPage_pageoptions.cpp
+ LINK kparts-shared kdeprint-shared
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### kviewerpart (module) ######################
+
+tde_add_kpart( kviewerpart AUTOMOC
+ SOURCES
+ kviewpart.cpp pageSizeWidget_base.ui pageSizeWidget.cpp
+ pageSizeDialog.cpp pageSize.cpp sizePreview.cpp zoom.cpp
+ units.cpp kvsprefs.kcfgc optionDialogGUIWidget_base.ui
+ optionDialogAccessibilityWidget.ui simplePageSize.cpp
+ LINK ifaces-static kparts-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### emptymultipagepart (module) ###############
+
+tde_add_kpart( emptymultipagepart AUTOMOC
+ SOURCES
+ empty_multipage.cpp emptyRenderer.cpp
+ LINK kmultipage-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### install import cmake modules ###############
+
+tde_install_export( )
diff --git a/kviewshell/pics/CMakeLists.txt b/kviewshell/pics/CMakeLists.txt
new file mode 100644
index 00000000..ea5b4c56
--- /dev/null
+++ b/kviewshell/pics/CMakeLists.txt
@@ -0,0 +1,14 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_subdirectory( icons )
+
+tde_install_icons( kviewshell )
diff --git a/kviewshell/pics/icons/CMakeLists.txt b/kviewshell/pics/icons/CMakeLists.txt
new file mode 100644
index 00000000..dc54ed2e
--- /dev/null
+++ b/kviewshell/pics/icons/CMakeLists.txt
@@ -0,0 +1,12 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/kviewerpart/icons )
diff --git a/kviewshell/plugins/CMakeLists.txt b/kviewshell/plugins/CMakeLists.txt
new file mode 100644
index 00000000..9efe72f9
--- /dev/null
+++ b/kviewshell/plugins/CMakeLists.txt
@@ -0,0 +1,12 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_subdirectory( djvu )
diff --git a/kviewshell/plugins/djvu/CMakeLists.txt b/kviewshell/plugins/djvu/CMakeLists.txt
new file mode 100644
index 00000000..2d6ba936
--- /dev/null
+++ b/kviewshell/plugins/djvu/CMakeLists.txt
@@ -0,0 +1,47 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_subdirectory( libdjvu )
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/../..
+ ${CMAKE_CURRENT_SOURCE_DIR}/libdjvu
+ ${CMAKE_CURRENT_SOURCE_DIR}/../..
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES djvumultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES djvumultipage.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
+install( FILES djvumultipage.rc DESTINATION ${DATA_INSTALL_DIR} )
+
+
+##### djvuviewpart (module) #####################
+
+tde_add_kpart( djvuviewpart
+ SOURCES
+ djvumultipage.cpp djvurenderer.cpp
+ kprintDialogPage_DJVUpageoptions.cpp
+ kprintDialogPage_DJVUconversionoptions.cpp
+ kprintDialogPage_DJVUconversionoptions_basewidget.ui
+ pageRangeWidget_base.ui pageRangeWidget.cpp prefs.kcfgc
+ LINK djvu-shared kmultipage-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
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;