diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CMakeL10n.txt | 3 | ||||
-rw-r--r-- | lib/CMakeLists.txt | 3 | ||||
-rw-r--r-- | lib/Makefile.am | 17 | ||||
-rw-r--r-- | lib/chmlib/CMakeLists.txt | 22 | ||||
-rw-r--r-- | lib/chmlib/Makefile.am | 3 | ||||
-rw-r--r-- | lib/chmlib/lzx.c | 14 | ||||
-rw-r--r-- | lib/libchmfile/CMakeLists.txt | 26 | ||||
-rw-r--r-- | lib/libchmfile/Makefile.am | 10 | ||||
-rw-r--r-- | lib/libchmfile/lchmurlhandler.cpp | 32 | ||||
-rw-r--r-- | lib/libchmfile/lchmurlhandler.h | 36 | ||||
-rw-r--r-- | lib/libchmfile/libchmfile.h | 9 | ||||
-rw-r--r-- | lib/libchmfile/libchmfile_search.cpp | 2 | ||||
-rw-r--r-- | lib/libchmfile/libchmfileimpl.cpp | 21 | ||||
-rw-r--r-- | lib/libchmfile/libchmfileimpl.h | 14 | ||||
-rw-r--r-- | lib/libchmfile/libchmtextencoding.h | 2 | ||||
-rw-r--r-- | lib/libchmfile/libchmurlfactory.h | 2 | ||||
-rw-r--r-- | lib/libchmfile/qt34.cpp | 259 | ||||
-rw-r--r-- | lib/libchmfile/qt34.h | 123 | ||||
-rw-r--r-- | lib/tdeio-msits/CMakeL10n.txt | 6 | ||||
-rw-r--r-- | lib/tdeio-msits/CMakeLists.txt | 39 | ||||
-rw-r--r-- | lib/tdeio-msits/Makefile.am | 14 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/tdeio-msits/msits.cpp | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/tdeio-msits/msits.h | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/tdeio-msits/msits.protocol | 16 |
24 files changed, 135 insertions, 552 deletions
diff --git a/lib/CMakeL10n.txt b/lib/CMakeL10n.txt new file mode 100644 index 0000000..b585ce4 --- /dev/null +++ b/lib/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..bc085ac --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory( libchmfile ) +tde_conditional_add_subdirectory( USE_BUILTIN_CHMLIB chmlib ) +tde_conditional_add_subdirectory( WITH_TDE tdeio-msits ) diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index fcf2131..0000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -if AMC_USE_KDE -SUBDIR_TDEIO = tdeio-msits -endif - -if AMC_BUILD_CHMLIB -SUBDIR_CHMLIB = chmlib -endif - -SUBDIRS = $(SUBDIR_CHMLIB) $(SUBDIR_TDEIO) libchmfile -DIST_SUBDIRS = chmlib tdeio-msits libchmfile - -package-messages: - $(MAKE) -f admin/Makefile.common package-messages - $(MAKE) -C po merge - -# Uncomment this line before opening the project in tdevelop for the first time! -#SUBDIRS = chmlib tdeio-msits libchmfile diff --git a/lib/chmlib/CMakeLists.txt b/lib/chmlib/CMakeLists.txt new file mode 100644 index 0000000..738a4b5 --- /dev/null +++ b/lib/chmlib/CMakeLists.txt @@ -0,0 +1,22 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### chm (static) + +tde_add_library( chm STATIC_PIC + + SOURCES + chm_lib.c + lzx.c +) diff --git a/lib/chmlib/Makefile.am b/lib/chmlib/Makefile.am deleted file mode 100644 index bcbe427..0000000 --- a/lib/chmlib/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -noinst_LTLIBRARIES = libchm.la -noinst_HEADERS = chm_lib.h lzx.h -libchm_la_SOURCES = chm_lib.c lzx.c diff --git a/lib/chmlib/lzx.c b/lib/chmlib/lzx.c index 7a5545b..b189439 100644 --- a/lib/chmlib/lzx.c +++ b/lib/chmlib/lzx.c @@ -346,9 +346,9 @@ int LZXreset(struct LZXstate *pState) */ static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) { - register UWORD sym; - register ULONG leaf; - register UBYTE bit_num = 1; + UWORD sym; + ULONG leaf; + UBYTE bit_num = 1; ULONG fill; ULONG pos = 0; /* the current position in the decode table */ ULONG table_mask = 1 << nbits; @@ -425,8 +425,8 @@ static int lzx_read_lens(struct LZXstate *pState, UBYTE *lens, ULONG first, ULON ULONG i,j, x,y; int z; - register ULONG bitbuf = lb->bb; - register int bitsleft = lb->bl; + ULONG bitbuf = lb->bb; + int bitsleft = lb->bl; UBYTE *inpos = lb->ip; UWORD *hufftbl; @@ -476,8 +476,8 @@ int LZXdecompress(struct LZXstate *pState, unsigned char *inpos, unsigned char * ULONG R1 = pState->R1; ULONG R2 = pState->R2; - register ULONG bitbuf; - register int bitsleft; + ULONG bitbuf; + int bitsleft; ULONG match_offset, i,j,k; /* ijk used in READ_HUFFSYM macro */ struct lzx_bits lb; /* used in READ_LENGTHS macro */ diff --git a/lib/libchmfile/CMakeLists.txt b/lib/libchmfile/CMakeLists.txt new file mode 100644 index 0000000..cd8990a --- /dev/null +++ b/lib/libchmfile/CMakeLists.txt @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${CHMLIB_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### chmfile (static) + +tde_add_library( chmfile STATIC_PIC + + SOURCES + libchmfile.cpp + libchmfile_search.cpp + libchmfileimpl.cpp + libchmtextencoding.cpp + libchmtocimage.cpp +) diff --git a/lib/libchmfile/Makefile.am b/lib/libchmfile/Makefile.am deleted file mode 100644 index 2e16016..0000000 --- a/lib/libchmfile/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -lib_LIBRARIES=libchmfile.a -libchmfile_a_SOURCES = libchmfile.cpp libchmfile_search.cpp libchmfileimpl.cpp \ - libchmtextencoding.cpp libchmtocimage.cpp -noinst_HEADERS = libchmfile.h bitfiddle.h libchmfileimpl.h libchmtextencoding.h \ - libchmtocimage.h libchmurlfactory.h - -INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) - -METASOURCES = AUTO -KDE_OPTIONS = qtonly diff --git a/lib/libchmfile/lchmurlhandler.cpp b/lib/libchmfile/lchmurlhandler.cpp deleted file mode 100644 index 6e905f6..0000000 --- a/lib/libchmfile/lchmurlhandler.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#include "lchmurlhandler.h" - -LCHMUrlHandler::LCHMUrlHandler() -{ -} - - -LCHMUrlHandler::~LCHMUrlHandler() -{ -} - - diff --git a/lib/libchmfile/lchmurlhandler.h b/lib/libchmfile/lchmurlhandler.h deleted file mode 100644 index 9eb29ec..0000000 --- a/lib/libchmfile/lchmurlhandler.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef LCHMURLHANDLER_H -#define LCHMURLHANDLER_H - -/** - @author tim <tim@krasnogorsk.ru> -*/ -class LCHMUrlHandler{ -public: - LCHMUrlHandler(); - - ~LCHMUrlHandler(); - -}; - -#endif diff --git a/lib/libchmfile/libchmfile.h b/lib/libchmfile/libchmfile.h index f5707d2..8a5a232 100644 --- a/lib/libchmfile/libchmfile.h +++ b/lib/libchmfile/libchmfile.h @@ -29,16 +29,9 @@ #include <tqmap.h> #include <tqvaluevector.h> #include <tqtextcodec.h> - #include "libchmtextencoding.h" -// TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used. -// In TQt4 TQVector stores values, so we can use TQVector -#if defined (USE_TQT_4) - #define QT34VECTOR TQVector -#else - #define QT34VECTOR TQValueVector -#endif +#define QT34VECTOR TQValueVector //! Contains different (non-standard) image types diff --git a/lib/libchmfile/libchmfile_search.cpp b/lib/libchmfile/libchmfile_search.cpp index 928a809..5f3be21 100644 --- a/lib/libchmfile/libchmfile_search.cpp +++ b/lib/libchmfile/libchmfile_search.cpp @@ -198,7 +198,7 @@ bool LCHMFile::searchQuery( const TQString& inquery, TQStringList * searchresult TQRegExp rxphrase( "\"(.*)\"" ); TQRegExp rxword( "([^\\s]+)" ); - rxphrase.setMinimal( TRUE ); + rxphrase.setMinimal( true ); // First, get the phrase queries while ( (pos = rxphrase.search (query, 0)) != -1 ) diff --git a/lib/libchmfile/libchmfileimpl.cpp b/lib/libchmfile/libchmfileimpl.cpp index c8e8801..63fc376 100644 --- a/lib/libchmfile/libchmfileimpl.cpp +++ b/lib/libchmfile/libchmfileimpl.cpp @@ -27,7 +27,11 @@ #include <tqapplication.h> #include "config.h" +#if USE_BUILTIN_CHMLIB #include "chm_lib.h" +#else +#include <chm_lib.h> +#endif #include "bitfiddle.h" #include "libchmfile.h" #include "libchmurlfactory.h" @@ -527,13 +531,8 @@ bool LCHMFileImpl::ResolveObject(const TQString& fileName, chmUnitInfo *ui) cons size_t LCHMFileImpl::RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const { -#if USE_BUILTIN_CHMLIB - return ::chm_retrieve_object(m_chmFile, ui, buffer, - fileOffset, bufferSize); -#else return ::chm_retrieve_object(m_chmFile, const_cast<chmUnitInfo*>(ui), buffer, fileOffset, bufferSize); -#endif } @@ -865,7 +864,7 @@ TQCString LCHMFileImpl::convertSearchWord( const TQString & src ) }; if ( !m_textCodec ) - return (TQCString) src.lower(); + return src.lower().utf8(); TQCString dest = m_textCodec->fromUnicode (src); @@ -997,7 +996,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCH else if ( tagword == "/object" && in_object ) { // a topic entry closed. Add a tree item - if ( entry.name ) + if ( !entry.name.isEmpty() ) { if ( !root_indent_offset_set ) { @@ -1033,18 +1032,18 @@ bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCH TQString name_pattern = "name=", value_pattern = "value="; TQString pname, pvalue; - if ( (offset = tag.find (name_pattern, 0, FALSE)) == -1 ) + if ( (offset = tag.find (name_pattern, 0, false)) == -1 ) tqFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no name=\n", tag.ascii()); // offset+5 skips 'name=' - offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); + offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, true, false); pname = pname.lower(); - if ( (offset = tag.find (value_pattern, offset, FALSE)) == -1 ) + if ( (offset = tag.find (value_pattern, offset, false)) == -1 ) tqFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no value=\n", tag.ascii()); // offset+6 skips 'value=' - findStringInQuotes (tag, offset + value_pattern.length(), pvalue, FALSE, TRUE); + findStringInQuotes (tag, offset + value_pattern.length(), pvalue, false, true); //tqDebug ("<param>: name '%s', value '%s'", pname.ascii(), pvalue.ascii()); diff --git a/lib/libchmfile/libchmfileimpl.h b/lib/libchmfile/libchmfileimpl.h index c6558f7..4dd7f85 100644 --- a/lib/libchmfile/libchmfileimpl.h +++ b/lib/libchmfile/libchmfileimpl.h @@ -19,9 +19,11 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ - +#if USE_BUILTIN_CHMLIB #include "chm_lib.h" - +#else +#include <chm_lib.h> +#endif #include "libchmfile.h" #include "libchmtocimage.h" @@ -107,7 +109,7 @@ class LCHMFileImpl //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. inline TQString encodeWithCurrentCodec (const TQString& str) const { - return (m_textCodec ? m_textCodec->toUnicode (str) : str); + return (m_textCodec ? m_textCodec->toUnicode (str.utf8()) : str); } //! Encode the string with the currently selected text codec, if possible. Or return as-is, if not. @@ -120,7 +122,7 @@ class LCHMFileImpl //! Or return as-is, if not. inline TQString encodeInternalWithCurrentCodec (const TQString& str) const { - return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str); + return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str.utf8()) : str); } //! Encode the string from internal files with the currently selected text codec, if possible. @@ -256,7 +258,7 @@ class LCHMFileImpl //! Map to decode HTML entitles like ´ based on current encoding TQMap<TQString, TQString> m_entityDecodeMap; - //! TRUE if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid + //! true if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid bool m_lookupTablesValid; //! pointer to /#TOPICS @@ -272,7 +274,7 @@ class LCHMFileImpl chmUnitInfo m_chmURLSTR; //! Indicates whether the built-in search is available. This is true only when m_lookupTablesValid - //! is TRUE, and m_chmFIftiMain is resolved. + //! is true, and m_chmFIftiMain is resolved. bool m_searchAvailable; //! pointer to /$FIftiMain diff --git a/lib/libchmfile/libchmtextencoding.h b/lib/libchmfile/libchmtextencoding.h index b62b3d0..0db6ccd 100644 --- a/lib/libchmfile/libchmtextencoding.h +++ b/lib/libchmfile/libchmtextencoding.h @@ -26,7 +26,7 @@ /*! * Represents a text encoding of CHM file; also has some useful routines. */ -typedef struct LCHMTextEncoding +struct LCHMTextEncoding { const char * language; //! French, English, etc. language == 0 represents the end of table. const char * sublanguage; //! French:Canada, French:France etc. May be 0 - no sublanguage diff --git a/lib/libchmfile/libchmurlfactory.h b/lib/libchmfile/libchmurlfactory.h index a897138..fba5614 100644 --- a/lib/libchmfile/libchmurlfactory.h +++ b/lib/libchmfile/libchmurlfactory.h @@ -113,7 +113,7 @@ static inline bool handleFileType( const TQString& link, TQString& generated ) if ( !link.endsWith( intext ) ) return false; - TQString filelink = link.left( link.length() - strlen( intext ) ); + TQString filelink = link.left( link.length() - intext.length() ); generated = "<html><body><img src=\"" + filelink + "\"></body></html>"; return true; } diff --git a/lib/libchmfile/qt34.cpp b/lib/libchmfile/qt34.cpp deleted file mode 100644 index cb2f3d8..0000000 --- a/lib/libchmfile/qt34.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Albert Astals Cid, aacid@kde.org * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include <tqdir.h> - -#include "tqt34.h" - -LIBCHMCString::LIBCHMCString() -{ -} - -LIBCHMCString::LIBCHMCString(const char *string) -{ -#if defined (USE_TQT_4) - cs = TQByteArray(string); -#else - cs = TQCString(string); -#endif -} - - -const char *LIBCHMCString::toCString() const -{ - return cs.data(); -} - - -void LIBCHMCString::clear() -{ -#if defined (USE_TQT_4) - cs = TQByteArray(); -#else - cs = TQCString(); -#endif -} - -bool LIBCHMCString::operator==(const TQString &string) const -{ - return TQString(cs) == string; -} - -uint LIBCHMCString::length() const -{ - return cs.length(); -} - -bool LIBCHMCString::isEmpty() const -{ - return cs.isEmpty(); -} - -void LIBCHMCString::prepend(char c) -{ - cs = c + cs; -} - -char LIBCHMCString::at(uint i) const -{ - return cs.at(i); -} - -void LIBCHMCString::replace(uint index, uint len, const char *str) -{ - cs.replace(index, len, str); -} - -void LIBCHMCString::remove(uint index, uint len) -{ - cs.remove(index, len); -} - -LIBCHMCString LIBCHMCString::lower() -{ -#if defined (USE_TQT_4) - return cs.toLower().data(); -#else - return cs.lower().data(); -#endif -} - - - -LIBCHMRegExp::LIBCHMRegExp(const TQString ®exp) -{ - re = TQRegExp(regexp); -} - -int LIBCHMRegExp::search(const TQString &str, int offset) -{ -#if defined (USE_TQT_4) - return re.indexIn(str, offset); -#else - return re.search(str, offset); -#endif -} - -TQString LIBCHMRegExp::cap(int nth) -{ - return re.cap(nth); -} - -void LIBCHMRegExp::setMinimal(bool minimal) -{ - return re.setMinimal(minimal); -} - -int LIBCHMRegExp::matchedLength() const -{ - return re.matchedLength(); -} - - - - -LIBCHMString::LIBCHMString() -{ -} - -LIBCHMString::LIBCHMString(const TQString &string) -{ - s = string; -} - -LIBCHMString::LIBCHMString(const char *string) -{ - s = TQString(string); -} - -TQString LIBCHMString::lower() const -{ -#if defined (USE_TQT_4) - return s.toLower(); -#else - return s.lower(); -#endif -} - -const char *LIBCHMString::ascii() const -{ -#if defined (USE_TQT_4) - return s.toAscii(); -#else - return s.ascii(); -#endif -} - -int LIBCHMString::find(char c, int index) const -{ -#if defined (USE_TQT_4) - return s.indexOf(c, index); -#else - return s.find(c, index); -#endif -} - -int LIBCHMString::find(const TQChar &c, int index) const -{ -#if defined (USE_TQT_4) - return s.indexOf(c, index); -#else - return s.find(c, index); -#endif -} - -int LIBCHMString::find(const TQString &string, int index, bool cs) const -{ -#if defined (USE_TQT_4) - TQt::CaseSensitivity cse; - if (cs) cse = TQt::CaseSensitive; - else cse = TQt::CaseInsensitive; - return s.indexOf(string, index, cse); -#else - return s.find(string, index, cs); -#endif -} - -int LIBCHMString::findRev(char c) const -{ -#if defined (USE_TQT_4) - return s.lastIndexOf(c); -#else - return s.findRev(c); -#endif -} - -TQChar LIBCHMString::at(uint i) const -{ - return s.at(i); -} - -TQString LIBCHMString::left(uint len) const -{ - return s.left(len); -} - -LIBCHMString LIBCHMString::mid(uint index, uint len) const -{ - return s.mid(index, len); -} - -bool LIBCHMString::isEmpty() const -{ - return s.isEmpty(); -} - -TQString LIBCHMString::toString() const -{ - return s; -} - -bool LIBCHMString::operator==(const TQString &string) const -{ - return s == string; -} - - - -TQString LIBCHMDir::cleanDirPath(const TQString &dir) -{ -#if defined (USE_TQT_4) - return TQDir::cleanPath(dir); -#else - return TQDir::cleanDirPath(dir); -#endif -} - - - -bool LIBCHMStringList::contains(const TQStringList &list, const TQString &string) -{ - return list.contains(string); -} - -TQStringList LIBCHMStringList::split(const TQRegExp ®exp, const TQString &string) -{ -#if defined (USE_TQT_4) - return string.split(regexp, TQString::SkipEmptyParts); -#else - return TQStringList::split(regexp, string); -#endif -} diff --git a/lib/libchmfile/qt34.h b/lib/libchmfile/qt34.h deleted file mode 100644 index d37c3a2..0000000 --- a/lib/libchmfile/qt34.h +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Albert Astals Cid, aacid@kde.org * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef INCLUDE_QT34_H -#define INCLUDE_QT34_H - -#include <tqregexp.h> -#include <tqstring.h> - -// TQt3/TQt4 compatibility: in TQt3 TQVector stores pointers, not values - so TQValueVector should be used. -// In TQt4 TQVector stores values, so we can use TQVector -#if defined (USE_TQT_4) - #define LIBCHMVector TQVector -#else -#include <tqvaluevector.h> - #define LIBCHMVector TQValueVector -#endif - -#if defined (USE_TQT_4) - #define LIBCHMMemArray TQVector -#else - #define LIBCHMMemArray TQMemArray -#endif - -class LIBCHMCString -{ - public: - LIBCHMCString(); - LIBCHMCString(const char *string); - - const char *toCString() const; - - void clear(); - - bool operator==(const TQString &string) const; - uint length() const; - bool isEmpty() const; - void prepend(char c); - char at(uint i) const; - void replace(uint index, uint len, const char *str); - void remove(uint index, uint len); - LIBCHMCString lower(); - - private: -#if defined (USE_TQT_4) - TQByteArray cs; -#else - TQCString cs; -#endif -}; - -class LIBCHMRegExp -{ - public: - LIBCHMRegExp(const TQString ®exp); - - int search(const TQString &str, int offset = 0); - TQString cap(int nth); - void setMinimal(bool minimal); - int matchedLength() const; - - private: - TQRegExp re; -}; - -class LIBCHMString -{ - public: - LIBCHMString(); - LIBCHMString(const TQString &string); - LIBCHMString(const char *string); - - TQString lower() const; - const char *ascii() const; - int find(char c, int index = -1) const; - int find(const TQChar &c, int index) const; - int find(const TQString &string, int index, bool cs) const; - int findRev(char c) const; - TQChar at(uint i) const; - TQString left(uint len) const; - LIBCHMString mid(uint index, uint len = 0xffffffff) const; - bool isEmpty() const; - - TQString toString() const; - - bool operator==(const TQString &string) const; - - private: - TQString s; -}; - -class LIBCHMDir -{ - public: - static TQString cleanDirPath(const TQString &dir); -}; - -class LIBCHMStringList -{ - public: - static bool contains(const TQStringList &list, const TQString &string); - static TQStringList split(const TQRegExp ®exp, const TQString &string); -}; - -#endif diff --git a/lib/tdeio-msits/CMakeL10n.txt b/lib/tdeio-msits/CMakeL10n.txt new file mode 100644 index 0000000..81e35fd --- /dev/null +++ b/lib/tdeio-msits/CMakeL10n.txt @@ -0,0 +1,6 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "desktop_files/kchmviewer-desktops" + SOURCES *.desktop *.protocol +) diff --git a/lib/tdeio-msits/CMakeLists.txt b/lib/tdeio-msits/CMakeLists.txt new file mode 100644 index 0000000..d0ab1ae --- /dev/null +++ b/lib/tdeio-msits/CMakeLists.txt @@ -0,0 +1,39 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${CHMLIB_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/lib/libchmfile +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### tdeio_msits (kpart) + +tde_add_kpart( tdeio_msits + + SOURCES + msits.cpp + LINK + tdeio-shared + tdecore-shared + ${CHMLIB_LIBRARIES} + + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other data + +tde_create_translated_desktop( + SOURCE msits.protocol + DESTINATION ${SERVICES_INSTALL_DIR} +) + +tde_create_translated_desktop( ${PROJECT_NAME}.desktop ) diff --git a/lib/tdeio-msits/Makefile.am b/lib/tdeio-msits/Makefile.am deleted file mode 100644 index 37e1b64..0000000 --- a/lib/tdeio-msits/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -METASOURCES = AUTO -INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) $(LIBCHMFILE_INCLUDES) - -kde_module_LTLIBRARIES = tdeio_msits.la - -tdeio_msits_la_SOURCES = msits.cpp -tdeio_msits_la_LIBADD = -ltdeio $(CHM_LIBS) -tdeio_msits_la_LDFLAGS = -module -avoid-version $(KDE_LDFLAGS) $(LIB_QT) $(LIB_TDEIO) $(LIB_TDECORE) $(KDE_PLUGIN) $(QT_LDFLAGS) - -protocol_DATA = msits.protocol -protocoldir = $(kde_servicesdir) - -# Put it here to avoid creating another directory -kde_apps_DATA = kchmviewer.desktop diff --git a/lib/tdeio-msits/msits.cpp b/lib/tdeio-msits/msits.cpp index 28d2821..c61216c 100755..100644 --- a/lib/tdeio-msits/msits.cpp +++ b/lib/tdeio-msits/msits.cpp @@ -25,7 +25,7 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <kinstance.h> +#include <tdeinstance.h> #include <kurl.h> #include <kmimemagic.h> @@ -40,7 +40,7 @@ using namespace TDEIO; extern "C" { - int kdemain( int argc, char **argv ) +TDE_EXPORT int kdemain( int argc, char **argv ) { kdDebug() << "*** tdeio_msits Init" << endl; diff --git a/lib/tdeio-msits/msits.h b/lib/tdeio-msits/msits.h index 4248908..7678ba3 100755..100644 --- a/lib/tdeio-msits/msits.h +++ b/lib/tdeio-msits/msits.h @@ -30,8 +30,11 @@ #include <tqcstring.h> #include "config.h" +#if USE_BUILTIN_CHMLIB #include "chm_lib.h" - +#else +#include <chm_lib.h> +#endif class ProtocolMSITS : public TDEIO::SlaveBase { @@ -59,13 +62,8 @@ private: // Retrieve an object from the CHM file inline size_t RetrieveObject (const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) { -#if USE_BUILTIN_CHMLIB - return ::chm_retrieve_object(m_chmFile, ui, buffer, - fileOffset, bufferSize); -#else return ::chm_retrieve_object(m_chmFile, const_cast<chmUnitInfo*>(ui), buffer, fileOffset, bufferSize); -#endif } // An opened file name, if presend diff --git a/lib/tdeio-msits/msits.protocol b/lib/tdeio-msits/msits.protocol index 8a03aea..e58ed02 100755..100644 --- a/lib/tdeio-msits/msits.protocol +++ b/lib/tdeio-msits/msits.protocol @@ -7,19 +7,5 @@ reading=true listing=Name,Type,Size defaultMimetype=text/html Description=A tdeioslave for displaying WinHelp files -Description[da]=En tdeioslave til visning af Windows hjælpefiler -Description[de]=Ein Ein-/Ausgabemodul zur Anzeige von WinHelp-Dateien -Description[es]=Un tdeioslave para mostrar archivos WinHelp -Description[et]=WinHelp-failide kuvamise IO-moodul -Description[fr]=Un module d'entrée / sortie pour l'affichage des fichiers WinHelp -Description[hu]=TDE-protokoll WinHelp-fájlok megjelenítéséhez -Description[it]=Un tdeioslave per mostrare i file WinHelp -Description[nl]=Een tdeioslave voor het weergeven van WinHelp-bestanden -Description[pl]=tdeioslave do pokazywania plików WinHelp -Description[pt]=A 'tdeioslave' para mostrar ficheiros WinHelp -Description[pt_BR]=Um tdeioslave para exibir arquivos WinHelp -Description[ru]=Обработчик ввода-вывода для файлов WinHelp -Description[sv]=En I/O-slav för att visa WinHelp-filer -Description[xx]=xxA tdeioslave for displaying WinHelp filesxx Icon=help -DocPath=tdeioslave/msits/index.html +X-DocPath=tdeioslave/msits/index.html |