From 2923352d38a4c36c8c0c186d76c45e6d09e219d7 Mon Sep 17 00:00:00 2001 From: David McKeone Date: Mon, 11 Aug 2014 19:44:47 -0400 Subject: [PATCH 1/2] Add unicode build targets and standardize string handling so that it works nicely in unicode and non-unicode (avoid str255 except at the boundaries) --- proj/Release - Unicode/BuildLog.htm | Bin 0 -> 7680 bytes proj/webLib.sln | 22 +-- proj/webLib.suo | Bin 84480 -> 84480 bytes proj/webLib.vcproj | 208 +++++++++++++++++++++++++++- src/OmnisTools.cpp | 151 +++++++++++++------- src/OmnisTools.h | 4 +- src/WebBrowser.cpp | 45 +++--- src/WebBrowser.h | 6 +- 8 files changed, 345 insertions(+), 91 deletions(-) create mode 100644 proj/Release - Unicode/BuildLog.htm diff --git a/proj/Release - Unicode/BuildLog.htm b/proj/Release - Unicode/BuildLog.htm new file mode 100644 index 0000000000000000000000000000000000000000..6ba1c1b9fbe79d57a0038938a7155961f0db3714 GIT binary patch literal 7680 zcmeI1X>S@=6o&8TO8F0ns@d8=wx+JLsKH>@s<%2`(w53H1`|>Y?f_Y;{`R)ddk*7S zpav&Sl}gcwVdgI9p5;Buz4P~9kHU*E3@4!*o`fsmv!M4@I1J6R_w`T_R7^=X0c4wqGrL4V_2Ki1;tqleD6zMcx-fo&M3-v+HIVVQm2J z9JgKG8aB#tU7rJ?8uJWKP~7vY67CZR?{nP?3)~k%34Rny6t@)<6f5%)+!67M;i4Qi zp-=!1oABdLtGr(gzr%l@`46F4qF-n_LZXp*OS)gPtGPKF7Hul{*h+@hw6XhSp$+r9 zSyT`3QH`y_?LNAgHC`H*7Tl}n8U36%vKiLV@)|2uX0EWo=mR*}!8WVR-I+NMg|g5aeh&<7v)7Gnvxe^SqgRM_ zvc2M-{%ces1MsBh^>N#Zc~Uw2O#32sI|94%uLDr1cpdjBjz#EPky|y2_bv0BUe!_C zK-ZqJ%gj-(jdMVG?1`R1O3c=JX$sD7Khrjw>Li8cds5iPH^hr;OV!(?f7a1v#E3d5 zIWcq%z+#_E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SV8UsoU!@m6MxhALMLwKBEJL_k+WT&#IGyzZERyd*X)g%p-D)Z(?H( zz{n&Y)X|dCOFH^xb+X%DQP-z#A>0vl1L|ZAj)5hML3P5%!C}M`>f{j*#n6!Qx=P`b z;4tDF>Li&r!BR%l$!Li&&`F(_vgedP~EozFoY3kO)rK`(Qw+=3lfc2MbvQ-M_fWwH> z)s=(4#0N^5p-wmmmMIUZlVnQ3Qs%3Z->s$U%G7O!TcoZ$rg9VH60jstp-y-ySdyt! zR}C%%ONpuzt^(H}-mgxQS*PRHt80dPSY4yK!ZygqRBl$;3fBad1RhTq4lbaUY<|SM O!dkJ4e#uP}Q1L%CC{M)z diff --git a/proj/webLib.vcproj b/proj/webLib.vcproj index 81d487c..3308449 100644 --- a/proj/webLib.vcproj +++ b/proj/webLib.vcproj @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/OmnisTools.cpp b/src/OmnisTools.cpp index 773b1bd..3299e8a 100644 --- a/src/OmnisTools.cpp +++ b/src/OmnisTools.cpp @@ -43,8 +43,51 @@ #include +// Set an existing EXTfldval object from a std::string +#ifdef isunicode +qchar* OmnisTools::getQCharFromString(const std::string readString, qlong &retLength) { + qlong length = readString.size(); + + // Cast-away constness of c_str() pointer + char* cString = const_cast(readString.c_str()); + + // Feed into raw byte data + qbyte* utf8data = reinterpret_cast (cString); + + // Allocate new qchar* string + qchar* omnisString = new qchar[length]; + + // Convert to Omnis Character field + retLength = CHRunicode::utf8ToChar(utf8data, length, omnisString); // Convert characters into Omnis Char Field + + return omnisString; +} // Set an existing EXTfldval object from a std::string +void OmnisTools::getEXTFldValFromString(EXTfldval& fVal, const std::string readString) { + qlong length; + qchar* omnisString = getQCharFromString(readString, length); + + fVal.setChar(omnisString, length); // Set value of character field, but exclude the last character since it will be the null terminator from the C String + + // Clean-up + delete [] omnisString; +} +#else +// Get a dynamically allocated qchar* array from a std::string +qchar* OmnisTools::getQCharFromString(const std::string readString, qlong &retLength) { + + // Get a dynamically allocated qchar* array from a std::string + qlong length = retLength = readString.size(); + qoschar* cString = const_cast(readString.c_str()); + qoschar* utf8data = reinterpret_cast(cString); + CHRconvFromOs test(utf8data,length); + + qchar* qcharData = new qchar[length+1]; + OMstrcpy(qcharData, test.dataPtr()); + return qcharData; +} + void OmnisTools::getEXTFldValFromString(EXTfldval& fVal, const std::string readString) { qlong length = readString.size(); @@ -57,8 +100,8 @@ void OmnisTools::getEXTFldValFromString(EXTfldval& fVal, const std::string readS // Clean-up delete [] qcharData; - } +#endif // Set an existing EXTfldval object from a std::wstring void OmnisTools::getEXTFldValFromChar(EXTfldval& fVal, const char* readChar) { @@ -71,35 +114,22 @@ void OmnisTools::getEXTFldValFromChar(EXTfldval& fVal, const char* readChar) { getEXTFldValFromString(fVal, readString); } -// Get a dynamically allocated qchar* array from a std::string -qchar* OmnisTools::getQCharFromString(const std::string readString, qlong &retLength) { - - // Get a dynamically allocated qchar* array from a std::string - qlong length = retLength = readString.size(); - qoschar* cString = const_cast(readString.c_str()); - qoschar* utf8data = reinterpret_cast(cString); - CHRconvFromOs test(utf8data,length); - - qchar* qcharData = new qchar[length+1]; - OMstrcpy(qcharData, test.dataPtr()); - return qcharData; -} - - - - // Get a std::string from an EXTfldval object +#ifdef isunicode std::string OmnisTools::getStringFromEXTFldVal(EXTfldval& fVal) { std::string retString; // Get a qchar* string - qlong maxLength = fVal.getBinLen()*2; // Use binary length as approximation of maximum size + qlong maxLength = fVal.getBinLen()+1; // Use binary length as approximation of maximum size qlong length = 0, stringLength = 0; qchar* omnisString = new qchar[maxLength]; fVal.getChar(maxLength, omnisString, length); - - qoschar* utf8data = reinterpret_cast(omnisString); - stringLength = CHRconvToOs::convToOs(omnisString,length,utf8data); + + // Translate qchar* string into UTF8 binary + qbyte* utf8data = reinterpret_cast(omnisString); + stringLength = CHRunicode::charToUtf8(omnisString, length, utf8data); + + // Translate UTF8 binary into char* string char* cString = reinterpret_cast (utf8data); // Create standard string @@ -110,30 +140,46 @@ std::string OmnisTools::getStringFromEXTFldVal(EXTfldval& fVal) { return retString; } - -// Get a std::string from an EXTfldval object -Awesomium::WebString OmnisTools::getWebStringFromEXTFldVal(EXTfldval& fVal) { - std::string retString; +#else +std::string OmnisTools::getStringFromEXTFldVal(EXTfldval& fVal) { + std::string retString; // Get a qchar* string - qlong maxLength = fVal.getBinLen() + 5; // Use binary length as approximation of maximum size + qlong maxLength = fVal.getBinLen()*2; // Use binary length as approximation of maximum size qlong length = 0, stringLength = 0; qchar* omnisString = new qchar[maxLength]; fVal.getChar(maxLength, omnisString, length); - + qoschar* utf8data = reinterpret_cast(omnisString); stringLength = CHRconvToOs::convToOs(omnisString,length,utf8data); char* cString = reinterpret_cast (utf8data); - std::string input = std::string(cString,stringLength); - Awesomium::WebString webString = getWebStringFromStr(input); + // Create standard string + retString = std::string(cString,stringLength); + // Clean-up delete [] omnisString; + return retString; +} +#endif + + +// Get a std::string from an EXTfldval object +Awesomium::WebString OmnisTools::getWebStringFromEXTFldVal(EXTfldval& fVal) { + std::string retString; + std::string input = getStringFromEXTFldVal(fVal); + Awesomium::WebString webString = getWebStringFromStr(input); return webString; } // Get a std::string from an EXTfldval object +#ifdef isunicode +Awesomium::WebString OmnisTools::getWebStringFromStr(std::string& value) { + Awesomium::WebString webString = Awesomium::ToWebString(value); + return webString; +} +#else Awesomium::WebString OmnisTools::getWebStringFromStr(std::string& value) { Awesomium::WebString webString; if (value.length()<=0){ @@ -147,27 +193,15 @@ Awesomium::WebString OmnisTools::getWebStringFromStr(std::string& value) { return webString; } +#endif -// Get a std::string from an EXTfldval object -Awesomium::WebString OmnisTools::getWebStringFromStr255(str255& value) { - - // Get a qchar* string - qlong maxLength = value.length() + 5; - qlong stringLength = 0; - qchar* omnisString = value.cString(); - - qoschar* utf8data = reinterpret_cast(omnisString); - stringLength = CHRconvToOs::convToOs(omnisString,maxLength,utf8data); - char* cString = reinterpret_cast (utf8data); - - std::string input = std::string(cString,stringLength); - Awesomium::WebString webString = getWebStringFromStr(input); - return webString; +#ifdef isunicode +std::string OmnisTools::getStringFromWebString(const Awesomium::WebString& value) { + std::string output = Awesomium::ToString(value); + return output; } - - -// Get a std::string from an EXTfldval object +#else std::string OmnisTools::getStringFromWebString(const Awesomium::WebString& value) { std::string output; std::string input = Awesomium::ToString(value); @@ -179,6 +213,7 @@ std::string OmnisTools::getStringFromWebString(const Awesomium::WebString& value } return output; } +#endif // Return a C++ int from an EXTfldval @@ -217,10 +252,26 @@ void OmnisTools::getEXTFldValFromInt64(EXTfldval& fVal, int64 i) { } +// Get a str255 object for a character constant (No string if it doesn't correspond to the conditions) +#ifdef isunicode +str255 OmnisTools::initStr255(const char* in) { + str255 theString; + qshort length = strlen(in); + if (length > 0 && length <= 255) { + theString.setUtf8((qbyte*) in, strlen(in)); + } + return theString; +} +#else +str255 OmnisTools::initStr255(const char* in) { + return str255(in); +} +#endif -void OmnisTools::logToTrace(str255 msg) +void OmnisTools::logToTrace(const char* msg) { #if defined(IS_DEBUG) - ECOaddTraceLine(&msg); + str255 logString = initStr255(msg); + ECOaddTraceLine(&logString); #endif } diff --git a/src/OmnisTools.h b/src/OmnisTools.h index 90b727f..63ecc45 100644 --- a/src/OmnisTools.h +++ b/src/OmnisTools.h @@ -59,7 +59,6 @@ namespace OmnisTools { Awesomium::WebString getWebStringFromEXTFldVal(EXTfldval& fVal); Awesomium::WebString getWebStringFromStr(std::string& value); - Awesomium::WebString getWebStringFromStr255(str255& value); std::string getStringFromWebString(const Awesomium::WebString& value); int getIntFromEXTFldVal(EXTfldval& fVal); @@ -70,10 +69,11 @@ namespace OmnisTools { void getEXTFldValFromInt64(EXTfldval& fVal, int64); void getEXTFldValFromBool(EXTfldval& fVal, bool b); + str255 initStr255(const char*); // Allg Helpers qchar* getQCharFromString( const std::string readString, qlong &retLength ); - void logToTrace(str255 msg); + void logToTrace(const char* msg); } #endif // OMNIS_TOOLS_HE_ diff --git a/src/WebBrowser.cpp b/src/WebBrowser.cpp index 97bf6f0..daf7669 100644 --- a/src/WebBrowser.cpp +++ b/src/WebBrowser.cpp @@ -54,7 +54,7 @@ WebBrowser::WebBrowser(HWND pHWnd, Awesomium::WebSession* pWebSession) WebBrowser::~WebBrowser() { - OmnisTools::logToTrace(str255("destruct()")); + OmnisTools::logToTrace("destruct()"); // Cleanup if (mWndTimerSet){ @@ -113,20 +113,17 @@ Awesomium::WebSession* WebBrowser::getWebSession(){ qlong WebBrowser::initWebView() { - OmnisTools::logToTrace(str255("initWebView()")); + OmnisTools::logToTrace("initWebView()"); // Prüfen ob der WebCore bereits initialisiert wurde mWebCore = Awesomium::WebCore::instance(); if (!mWebCore){ - OmnisTools::logToTrace(str255("Webcore intializing")); - - qchar* cUserPath = mUserPath.cString(); - qchar* cBasePath = mBasePath.cString(); - + OmnisTools::logToTrace("Webcore intializing"); + // Setup path Vars - Awesomium::WebString _logfile = Awesomium::WSLit((const char*) cUserPath); - Awesomium::WebString _pluginPath = Awesomium::WSLit((const char*) cBasePath); - Awesomium::WebString _sysPath = Awesomium::WSLit((const char*) cBasePath); + Awesomium::WebString _logfile = Awesomium::ToWebString(mUserPath); + Awesomium::WebString _pluginPath = Awesomium::ToWebString(mBasePath); + Awesomium::WebString _sysPath = Awesomium::ToWebString(mBasePath); _logfile.Append(Awesomium::WSLit("\\debug.log")); _pluginPath.Append(Awesomium::WSLit("plugins\\")); @@ -182,23 +179,21 @@ qlong WebBrowser::initWebView() prefs.accept_language = Awesomium::WSLit("de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4"); prefs.default_encoding = Awesomium::WSLit("UTF-8"); - qchar* cUserPath = mUserPath.cString(); - Awesomium::WebString _sessionPath = Awesomium::WSLit((const char*) cUserPath); + Awesomium::WebString _sessionPath = Awesomium::ToWebString(mUserPath); _sessionPath.Append(Awesomium::WSLit("")); - if (cUserPath) { + if (mUserPath.length() == 0) { // Persitent - OmnisTools::logToTrace(str255("persitent-session")); + OmnisTools::logToTrace("persitent-session"); mWebSession = mWebCore->CreateWebSession(_sessionPath, prefs); }else { // In memory - OmnisTools::logToTrace(str255("in-memory-session")); + OmnisTools::logToTrace("in-memory-session"); mWebSession = mWebCore->CreateWebSession(Awesomium::WSLit(""), prefs); } - qchar* cBasePath = mBasePath.cString(); - Awesomium::WebString _pakPath = Awesomium::WSLit((const char*) cBasePath); + Awesomium::WebString _pakPath = Awesomium::ToWebString(mBasePath); _pakPath.Append(Awesomium::WSLit("paks\\weblib.pak")); Awesomium::DataSource* data_source = new Awesomium::DataPakSource(_pakPath); @@ -258,8 +253,8 @@ void WebBrowser::setupWebView(){ mMethodDispatcher.Bind(jsObj,Awesomium::WSLit("doCompInit"),JSDelegate(this, &WebBrowser::jsDoCompInit)); - jsObj.SetProperty(Awesomium::WSLit("basePath"),OmnisTools::getWebStringFromStr255(mBasePath)); - jsObj.SetProperty(Awesomium::WSLit("userPath"),OmnisTools::getWebStringFromStr255(mUserPath)); + jsObj.SetProperty(Awesomium::WSLit("basePath"), Awesomium::ToWebString(mBasePath)); + jsObj.SetProperty(Awesomium::WSLit("userPath"), Awesomium::ToWebString(mUserPath)); } else { // Event evOnJsInitFailed occurred. Send event to OMNIS @@ -539,7 +534,7 @@ qlong WebBrowser::startDownload(int downloadId,std::string downloadPath){ qlong WebBrowser::shutDownWebView() { int result = 0; - OmnisTools::logToTrace(str255("shutDown WebView()")); + OmnisTools::logToTrace("shutDown WebView()"); if (mWebView) { mWebView->Stop(); @@ -637,12 +632,12 @@ qlong WebBrowser::attributeSupport( LPARAM pMessage, WPARAM wParam, LPARAM lPara { case pBasePath: { - mBasePath = (str255)fval.getChar(); + mBasePath = OmnisTools::getStringFromEXTFldVal(fval); break; } case pUserPath: { - mUserPath = (str255)fval.getChar(); + mUserPath = OmnisTools::getStringFromEXTFldVal(fval); break; } } @@ -658,13 +653,13 @@ qlong WebBrowser::attributeSupport( LPARAM pMessage, WPARAM wParam, LPARAM lPara { // we are setting our color property case pBasePath: - { - fval.setChar((str255) mBasePath); + { + OmnisTools::getEXTFldValFromString(fval, mBasePath); break; } case pUserPath: { - fval.setChar((str255) mUserPath); + OmnisTools::getEXTFldValFromString(fval, mUserPath); break; } } diff --git a/src/WebBrowser.h b/src/WebBrowser.h index 0f35ddb..8425f4d 100644 --- a/src/WebBrowser.h +++ b/src/WebBrowser.h @@ -103,8 +103,8 @@ namespace WebLib { qbool mInitCompleted; // Omnis Props - str255 mBasePath; - str255 mUserPath; + std::string mBasePath; + std::string mUserPath; // Window Proc qbool mWndTimerSet; @@ -164,7 +164,7 @@ namespace WebLib { // Methoden Helper Methoden static WebBrowser *objectFromHwnd(HWND pHwnd, EXTCompInfo *eci); - static void logToTrace(str255 msg); + static void logToTrace(const char* msg); }; } // namespace WebLib From 445fec3ee14b38b9e6d10932bef5b4f4027d2d7d Mon Sep 17 00:00:00 2001 From: David McKeone Date: Mon, 11 Aug 2014 19:48:26 -0400 Subject: [PATCH 2/2] Fix incorrect conversion of cUserPath if condition --- src/WebBrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebBrowser.cpp b/src/WebBrowser.cpp index daf7669..436118a 100644 --- a/src/WebBrowser.cpp +++ b/src/WebBrowser.cpp @@ -183,7 +183,7 @@ qlong WebBrowser::initWebView() Awesomium::WebString _sessionPath = Awesomium::ToWebString(mUserPath); _sessionPath.Append(Awesomium::WSLit("")); - if (mUserPath.length() == 0) { + if (mUserPath.length() > 0) { // Persitent OmnisTools::logToTrace("persitent-session"); mWebSession = mWebCore->CreateWebSession(_sessionPath, prefs);