[Amis-vcs] SF.net SVN: amis: [2165] branches/amis3
Brought to you by:
julienq,
marisademeglio
From: <mar...@us...> - 2007-09-24 15:04:21
|
Revision: 2165 http://amis.svn.sourceforge.net/amis/?rev=2165&view=rev Author: marisademeglio Date: 2007-09-24 08:04:19 -0700 (Mon, 24 Sep 2007) Log Message: ----------- removed thai encoding conversion workaround; instead, the installer will add a registry alias that says TIS-620 = windows-874. Added initial installer script (doesn't work) which has a note about the registry key that we need to add. Modified Paths: -------------- branches/amis3/AmisCore/include/io/XercesSaxParseBase.h branches/amis3/AmisCore/src/io/BookmarksFileIO.cpp branches/amis3/AmisCore/src/io/ModuleDescReader.cpp branches/amis3/AmisCore/src/io/NavFileReader.cpp branches/amis3/AmisCore/src/io/OpfFileReader.cpp branches/amis3/AmisCore/src/io/QuickDataSmilFileReader.cpp branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp branches/amis3/AmisCore/src/io/SmilFileReader.cpp branches/amis3/AmisCore/src/io/TextSearch.cpp branches/amis3/AmisCore/src/io/XercesSaxParseBase.cpp branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp branches/amis3/installer/main/setup-amis3.nsi Modified: branches/amis3/AmisCore/include/io/XercesSaxParseBase.h =================================================================== --- branches/amis3/AmisCore/include/io/XercesSaxParseBase.h 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/include/io/XercesSaxParseBase.h 2007-09-24 15:04:19 UTC (rev 2165) @@ -43,9 +43,7 @@ public: XercesSaxParseBase(); virtual ~XercesSaxParseBase() = 0; - - //removed forcedEncoding = "" for python wrapping (it confused the source-generation parser) - bool parseFile(const ambulant::net::url*, string forcedEncoding); + bool parseFile(const ambulant::net::url*); amis::Error getError(); //SAX METHODS Modified: branches/amis3/AmisCore/src/io/BookmarksFileIO.cpp =================================================================== --- branches/amis3/AmisCore/src/io/BookmarksFileIO.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/BookmarksFileIO.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -86,7 +86,7 @@ mElementStack.clear(); - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { delete mpBookmarks; return false; Modified: branches/amis3/AmisCore/src/io/ModuleDescReader.cpp =================================================================== --- branches/amis3/AmisCore/src/io/ModuleDescReader.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/ModuleDescReader.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -59,7 +59,7 @@ mpData = new amis::ModuleDescData(); mb_flagGetChars = false; - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { delete mpData; return false; Modified: branches/amis3/AmisCore/src/io/NavFileReader.cpp =================================================================== --- branches/amis3/AmisCore/src/io/NavFileReader.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/NavFileReader.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -84,7 +84,7 @@ //push the root onto the open nodes list mOpenNodes.push_back(mpNavModel->getNavMap()->getRoot()); - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { delete mpNavModel; return false; Modified: branches/amis3/AmisCore/src/io/OpfFileReader.cpp =================================================================== --- branches/amis3/AmisCore/src/io/OpfFileReader.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/OpfFileReader.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -44,7 +44,7 @@ mpSpine = new amis::dtb::Spine(); mUnsortedSmilFiles.clear(); mItemRefs.clear(); - bool b_return_value = amis::io::XercesSaxParseBase::parseFile(filename, ""); + bool b_return_value = amis::io::XercesSaxParseBase::parseFile(filename); sortSpine(); Modified: branches/amis3/AmisCore/src/io/QuickDataSmilFileReader.cpp =================================================================== --- branches/amis3/AmisCore/src/io/QuickDataSmilFileReader.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/QuickDataSmilFileReader.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -66,7 +66,7 @@ mpNodes = pNodes; mbFlag_GetNextAudio = false; - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { return false; } Modified: branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp =================================================================== --- branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/RecentBooksFileIO.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -76,7 +76,7 @@ mb_flagGetChars = false; - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { delete mpRecentBooks; return false; Modified: branches/amis3/AmisCore/src/io/SmilFileReader.cpp =================================================================== --- branches/amis3/AmisCore/src/io/SmilFileReader.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/SmilFileReader.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -96,7 +96,7 @@ clearOpenNodesList(); - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { delete mpSmilTree; return false; Modified: branches/amis3/AmisCore/src/io/TextSearch.cpp =================================================================== --- branches/amis3/AmisCore/src/io/TextSearch.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/TextSearch.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -80,7 +80,7 @@ std::transform(mSearchString.begin(), mSearchString.end(), mSearchString.begin(), (int(*)(int))tolower); - if (!this->parseFile(filepath, "")) + if (!this->parseFile(filepath)) { return ""; } Modified: branches/amis3/AmisCore/src/io/XercesSaxParseBase.cpp =================================================================== --- branches/amis3/AmisCore/src/io/XercesSaxParseBase.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisCore/src/io/XercesSaxParseBase.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -47,7 +47,7 @@ { } -bool amis::io::XercesSaxParseBase::parseFile(const ambulant::net::url* filepath, string forcedEncoding) +bool amis::io::XercesSaxParseBase::parseFile(const ambulant::net::url* filepath) { SAX2XMLReader* parser; mFilepath = *filepath; @@ -66,7 +66,6 @@ str.assign(msg); mError.setMessage(str); XMLString::release(&msg); - //cout<<"XML platform utils initialization error"<<endl; return false; } @@ -86,7 +85,6 @@ mError.setMessage(str); delete parser; XMLPlatformUtils::Terminate(); - //cout<<"parsing error."<<endl; return false; } //try-catch block for Xerces parsing @@ -95,24 +93,8 @@ //give the sax parser pointers to our content and error handler object parser->setContentHandler(this); parser->setErrorHandler(this); - - if (forcedEncoding == "") - { - //parser begins parsing; expect SAX Events soon - parser->parse((*p_input_source)); - } - else - { - //reset the error message - mError.clear(); - XMLCh* xmlch_encoding = XMLString::transcode(forcedEncoding.c_str()); - - //todo: flag that we had to set the encoding in case anyone else (like ambulant) needs to be told explicitly - p_input_source->setEncoding(xmlch_encoding); - parser->parse((*p_input_source)); - - XMLString::release(&xmlch_encoding); - } + //parser begins parsing; expect SAX Events soon + parser->parse((*p_input_source)); } catch (const XMLException& toCatch) @@ -125,7 +107,6 @@ XMLString::release(&msg); delete parser; XMLPlatformUtils::Terminate(); - //cout<<"parsing error."<<endl; return false; } @@ -144,16 +125,8 @@ //... } - if (mError.getCode() != amis::OK) - { - //cout<<"parsing error: "<<mError.getMessage()<<endl; - return false; - } - else - { - //cout<<"oh my god, it parsed!"<<endl; - return true; - } + if (mError.getCode() != amis::OK) return false; + else return true; } amis::Error amis::io::XercesSaxParseBase::getError() @@ -172,24 +145,12 @@ } void amis::io::XercesSaxParseBase::fatalError(const SAXParseException& e) -{ - char* verbose_thai_encoding_msg = "An exception occurred! Type:TranscodingException, Message:Could not create a converter for encoding: TIS-620"; - +{ char* xerces_msg = XMLString::transcode(e.getMessage()); mError.setCode (amis::PARSE_ERROR); string msg = "While processing *" + mFilepath.get_url() + "* Xerces signalled: \"" + xerces_msg + "\""; mError.setMessage(msg); - //if the file had problems because it was encoded using TIS-620 - if (!strcmp(xerces_msg, verbose_thai_encoding_msg)) - { - XMLString::release(&xerces_msg); - //reparse with forced encoding - parseFile(&mFilepath, "iso-8859-11"); - } - else - { - XMLString::release(&xerces_msg); - } + XMLString::release(&xerces_msg); } Modified: branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp =================================================================== --- branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/AmisGuiMFC2/src/io/PreferencesFileIO.cpp 2007-09-24 15:04:19 UTC (rev 2165) @@ -72,7 +72,7 @@ { mpPrefs = NULL; ambulant::net::url file = ambulant::net::url::from_filename(filepath); - return this->parseFile(&file, ""); + return this->parseFile(&file); } //-------------- Modified: branches/amis3/installer/main/setup-amis3.nsi =================================================================== --- branches/amis3/installer/main/setup-amis3.nsi 2007-09-24 14:38:46 UTC (rev 2164) +++ branches/amis3/installer/main/setup-amis3.nsi 2007-09-24 15:04:19 UTC (rev 2165) @@ -2,7 +2,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "AMIS" -!define PRODUCT_VERSION "2.6" +!define PRODUCT_VERSION "3.0" !define PRODUCT_PUBLISHER "DAISY for All Project" !define PRODUCT_WEB_SITE "http://amis.sf.net" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\AMIS.exe" @@ -68,9 +68,9 @@ Name "${PRODUCT_NAME} ${PRODUCT_VERSION} (${LANG_NAME})" ;this is the name of the installer that gets created. ;for some reason, i vaguely remember that it shouldn't have spaces in the filename. -OutFile "Setup-amis-26-${DEFAULT_LANGPACK}.exe" +OutFile "Setup-amis-3-${DEFAULT_LANGPACK}.exe" InstallDir "$PROGRAMFILES\AMIS" -;InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" +InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show @@ -85,10 +85,9 @@ CreateShortCut "$DESKTOP\AMIS.lnk" "$INSTDIR\AMIS.exe" ;copy the DLLs + File "${BIN_DIR}\libambulant_shwin32.dll" File "${BIN_DIR}\AmisAudio.dll" - File "${BIN_DIR}\AmisCommon.dll" - File "${BIN_DIR}\NavParse.dll" - File "${BIN_DIR}\SmilEngine.dll" + File "${BIN_DIR}\AmisCore.dll" File "${BIN_DIR}\xerces-c_2_7.dll" File "${BIN_DIR}\TransformSample.ax" @@ -97,10 +96,10 @@ File "${BIN_DIR}\settings\bmk\readme.txt" ;copy the default settings - SetOutPath "$INSTDIR\settings\config" - File "${BIN_DIR}\settings\config\amisPrefs.xml" - File "${BIN_DIR}\settings\config\amisRecentBooks.xml" - File "${BIN_DIR}\settings\config\*.css" + SetOutPath "$INSTDIR\settings" + File "${BIN_DIR}\settings\amisPrefs.xml" + File "${BIN_DIR}\settings\amisRecentBooks.xml" + File "${BIN_DIR}\settings\*.css" ;copy the images SetOutPath "$INSTDIR\settings\img" @@ -128,6 +127,10 @@ File "${WIN32_DIR}\MSVCP71.DLL" File "${WIN32_DIR}\MFC71U.DLL" + ;TODO: ask the user if they want to change their registry to support Thai books + ;TODO: if so, add this key in HKLM + ;Software\Classes\MIME\Database\Charset\TIS-620 and set AliasForCharset to windows-874 + SectionEnd ;****************************** @@ -244,7 +247,6 @@ Delete "$INSTDIR\settings\lang\*" Delete "$INSTDIR\settings\img\*" - Delete "$INSTDIR\settings\config\*" Delete "$INSTDIR\settings\bmk\*.txt" Delete "$SMPROGRAMS\AMIS\*" @@ -253,7 +255,6 @@ RMDir "$INSTDIR\settings\lang" RMDir "$INSTDIR\settings\img" - RMDir "$INSTDIR\settings\config" RMDir "$INSTDIR\settings\bmk" RMDir "$INSTDIR" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |