The files name: modify underline to hyphen

This commit is contained in:
Jeff 2014-09-19 10:24:17 +08:00
parent e4e2cea97a
commit 2ffbe23c50
7 changed files with 74 additions and 15 deletions

View File

@ -430,7 +430,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClCompile Include="..\ui\UITextField.cpp" />
<ClCompile Include="..\ui\UIVBox.cpp" />
<ClCompile Include="..\ui\UIWebView.cpp" />
<ClCompile Include="..\ui\UIWebViewImpl_win32.cpp" />
<ClCompile Include="..\ui\UIWebViewImpl-win32.cpp" />
<ClCompile Include="..\ui\UIWidget.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
@ -811,7 +811,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
<ClInclude Include="..\ui\UIVBox.h" />
<ClInclude Include="..\ui\UIWebView-inl.h" />
<ClInclude Include="..\ui\UIWebView.h" />
<ClInclude Include="..\ui\UIWebViewImpl_win32.h" />
<ClInclude Include="..\ui\UIWebViewImpl-win32.h" />
<ClInclude Include="..\ui\UIWidget.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />

View File

@ -1168,7 +1168,7 @@
<ClCompile Include="..\ui\UIEditBox\UIEditBoxImpl-win32.cpp">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIWebViewImpl_win32.cpp">
<ClCompile Include="..\ui\UIWebViewImpl-win32.cpp">
<Filter>ui\UIWidgets</Filter>
</ClCompile>
<ClCompile Include="..\ui\UIWebView.cpp">
@ -2302,7 +2302,7 @@
<ClInclude Include="..\ui\UIEditBox\UIEditBoxImpl-win32.h">
<Filter>ui\UIWidgets\EditBox</Filter>
</ClInclude>
<ClInclude Include="..\ui\UIWebViewImpl_win32.h">
<ClInclude Include="..\ui\UIWebViewImpl-win32.h">
<Filter>ui\UIWidgets</Filter>
</ClInclude>
<ClInclude Include="..\ui\UIWebView-inl.h">

View File

@ -30,7 +30,7 @@
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include "UIWebViewImpl_win32.h"
#include "UIWebViewImpl-win32.h"
#include "UIWebView-inl.h"
#endif

View File

@ -1,3 +1,28 @@
/****************************************************************************
Copyright (c) 2014 cocos2d-x.org
Author: Jeff Wang <wohaaitinciu@gmail.com>
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
@ -6,12 +31,13 @@
#include <atlwin.h>
#include <ExDispid.h>
#include <UrlMon.h>
#include "UIWebViewImpl_win32.h"
#include "UIWebViewImpl-win32.h"
#include "UIWebView.h"
#include "base/CCDirector.h"
#include "platform/CCFileUtils.h"
#include "platform/CCGLView.h"
// declarate
class Win32WebControl : public DWebBrowserEvents2
{
public:
@ -290,9 +316,11 @@ CComModule Win32WebControl::s_module;
void Win32WebControl::lazyInit()
{
// reset the main windows style so that its drawing does not cover the webview sub window
HWND hwnd = cocos2d::Director::getInstance()->getOpenGLView()->getWin32Window();
LONG style = GetWindowLong(hwnd, GWL_STYLE);
SetWindowLong(hwnd, GWL_STYLE, style | WS_CLIPCHILDREN);
HINSTANCE hInstance = GetModuleHandle(NULL);
CoInitialize(NULL);
s_module.Init(NULL, hInstance);
@ -447,14 +475,20 @@ void Win32WebControl::setWebViewRect(const int left, const int top, const int wi
void Win32WebControl::setJavascriptInterfaceScheme(const std::string &scheme) const
{
// To be implemented!
}
void Win32WebControl::loadData(const std::string &data, const std::string &MIMEType, const std::string &encoding, const std::string &baseURL) const
{
// To be implemented!
}
void Win32WebControl::loadHTMLString(const std::string &html, const std::string &baseURL)
{
// NOTE: should we load base URL first?
// If so, we will cause many loadURL callbacks,
// and it would be very difficult to distinguish between `loadURL' and `loadHTMLString'
//if (baseURL.empty())
//{
_loadHTMLString(html);
@ -622,7 +656,7 @@ ULONG STDMETHODCALLTYPE Win32WebControl::Release(void)
{
CCASSERT(_reference > 0, "reference count should greater than 0");
InterlockedDecrement(&_reference);
// do not delete this if _reference == 0, otherwise, it will crash when call removeWebView
// DO NOT delete this if _reference == 0, otherwise, it will crash when call removeWebView
return _reference;
}
@ -709,7 +743,7 @@ HRESULT STDMETHODCALLTYPE Win32WebControl::Invoke(
{
if (_onJsCallback != nullptr)
{
_onJsCallback(bstr2string(url));
_onJsCallback(bstr2string(url + 11)); // skip the prefix `javascript'
}
}
else

View File

@ -1,5 +1,30 @@
#ifndef __cocos2d_plugin_WebViewImpl_win32_H_
#define __cocos2d_plugin_WebViewImpl_win32_H_
/****************************************************************************
Copyright (c) 2014 cocos2d-x.org
Author: Jeff Wang <wohaaitinciu@gmail.com>
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_
#define __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_
#include "platform/CCPlatformConfig.h"
@ -60,4 +85,4 @@ namespace cocos2d {
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#endif //__cocos2d_plugin_WebViewImpl_win32_H_
#endif // __COCOS2D__UI__WEBVIEWIMPL_WIN32_H_

View File

@ -40,7 +40,7 @@
<ClInclude Include="..\UIVBox.h" />
<ClInclude Include="..\UIWebView-inl.h" />
<ClInclude Include="..\UIWebView.h" />
<ClInclude Include="..\UIWebViewImpl_win32.h" />
<ClInclude Include="..\UIWebViewImpl-win32.h" />
<ClInclude Include="..\UIWidget.h" />
<ClInclude Include="Win32InputBox.h" />
</ItemGroup>
@ -71,7 +71,7 @@
<ClCompile Include="..\UITextField.cpp" />
<ClCompile Include="..\UIVBox.cpp" />
<ClCompile Include="..\UIWebView.cpp" />
<ClCompile Include="..\UIWebViewImpl_win32.cpp" />
<ClCompile Include="..\UIWebViewImpl-win32.cpp" />
<ClCompile Include="..\UIWidget.cpp" />
<ClCompile Include="Win32InputBox.cpp" />
</ItemGroup>

View File

@ -114,7 +114,7 @@
<ClInclude Include="..\UIWebView.h">
<Filter>UIWidgets</Filter>
</ClInclude>
<ClInclude Include="..\UIWebViewImpl_win32.h">
<ClInclude Include="..\UIWebViewImpl-win32.h">
<Filter>UIWidgets</Filter>
</ClInclude>
</ItemGroup>
@ -203,7 +203,7 @@
<ClCompile Include="..\UIWebView.cpp">
<Filter>UIWidgets</Filter>
</ClCompile>
<ClCompile Include="..\UIWebViewImpl_win32.cpp">
<ClCompile Include="..\UIWebViewImpl-win32.cpp">
<Filter>UIWidgets</Filter>
</ClCompile>
</ItemGroup>