Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed WPF osr ime support #2103

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if $(PlatformName) == x86 (
"$(DevEnvDir)..\..\VC\bin\editbin" /largeaddressaware /TSAWARE "$(TargetPath)"
call "$(DevEnvDir)..\Tools\vsvars32.bat"
sn -R "$(TargetPath)" "$(ProjectDir)..\CefSharp.snk"
) else (
"$(DevEnvDir)..\..\VC\bin\amd64\editbin" /TSAWARE "$(TargetPath)"
)</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should be reverted, since it disables strong named signing.

</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
4 changes: 4 additions & 0 deletions CefSharp.Core/CefSharp.Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@
<ClCompile Include="Internals\Serialization\V8Serialization.cpp" />
<ClCompile Include="Internals\Serialization\Primitives.cpp" />
<ClCompile Include="Internals\Serialization\JsObjectsSerialization.cpp" />
<ClCompile Include="OsrImeHandler.cpp" />
<ClCompile Include="OsrImeWin.cpp" />
<ClCompile Include="ResourceHandlerWrapper.cpp" />
<ClCompile Include="Stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
Expand Down Expand Up @@ -283,6 +285,8 @@
<ClInclude Include="Internals\CefTaskScheduler.h" />
<ClInclude Include="Internals\CefTaskWrapper.h" />
<ClInclude Include="Internals\CefWrapper.h" />
<ClInclude Include="OsrImeHandler.h" />
<ClInclude Include="OsrImeWin.h" />
<ClInclude Include="PopupFeatures.h" />
<ClInclude Include="RequestContextHandler.h" />
<ClInclude Include="resource.h" />
Expand Down
12 changes: 12 additions & 0 deletions CefSharp.Core/CefSharp.Core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
<ClCompile Include="CookieManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OsrImeHandler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OsrImeWin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="vcclr_local.h">
Expand Down Expand Up @@ -271,6 +277,12 @@
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="OsrImeHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="OsrImeWin.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Internals\CefSharpBrowserWrapper.h">
Expand Down
26 changes: 22 additions & 4 deletions CefSharp.Core/Internals/CefBrowserHostWrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2010-2017 The CefSharp Authors. All rights reserved.
// Copyright ?2010-2017 The CefSharp Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and other similar changes should be reverted - the copyright sign should remain in the previous encoding. (UTF-8 I presume)

//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Expand Down Expand Up @@ -322,12 +322,30 @@ void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array<Compositi
_browserHost->ImeSetComposition(StringUtils::ToNative(text), underlinesVector, CefRange(), range);
}

void CefBrowserHostWrapper::ImeSetComposition(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can likely be removed and you just get a reference to the underlying CefBrowserHost rather than adding code.

It's my understanding that some of the params are only used on Mac and can be left out of any Windows implementation.

const CefString& text,
const std::vector<CefCompositionUnderline>& underlines,
const CefRange& replacement_range,
const CefRange& selection_range) {

ThrowIfDisposed();
_browserHost->ImeSetComposition(text, underlines, replacement_range, selection_range);
}

void CefBrowserHostWrapper::ImeCommitText(String^ text)
{
ThrowIfDisposed();
ThrowIfDisposed();

//Range and cursor position are Mac OSX only
_browserHost->ImeCommitText(StringUtils::ToNative(text), CefRange(), NULL);
}

void CefBrowserHostWrapper::ImeCommitText(const CefString& text,
const CefRange& replacement_range,
int relative_cursor_pos) {

//Range and cursor position are Mac OSX only
_browserHost->ImeCommitText(StringUtils::ToNative(text), CefRange(), NULL);
ThrowIfDisposed();
_browserHost->ImeCommitText(text, replacement_range, relative_cursor_pos);
}

void CefBrowserHostWrapper::ImeFinishComposingText(bool keepSelection)
Expand Down
6 changes: 4 additions & 2 deletions CefSharp.Core/Internals/CefBrowserHostWrapper.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2010-2017 The CefSharp Authors. All rights reserved.
// Copyright ?2010-2017 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Expand Down Expand Up @@ -82,7 +82,9 @@ namespace CefSharp
virtual void Invalidate(PaintElementType type);

virtual void ImeSetComposition(String^ text, cli::array<CompositionUnderline>^ underlines, Nullable<Range> selectionRange);
virtual void ImeCommitText(String^ text);
virtual void ImeSetComposition(const CefString& text, const std::vector<CefCompositionUnderline>& underlines, const CefRange& replacement_range, const CefRange& selection_range);
virtual void ImeCommitText(String^ text);
virtual void ImeCommitText(const CefString& text, const CefRange& replacement_range, int relative_cursor_pos);
virtual void ImeFinishComposingText(bool keepSelection);
virtual void ImeCancelComposition();

Expand Down
Loading