Skip to content

Commit

Permalink
Merge 931d232 into e8b6c0b
Browse files Browse the repository at this point in the history
  • Loading branch information
starts2000 authored Jan 17, 2018
2 parents e8b6c0b + 931d232 commit 5b38163
Show file tree
Hide file tree
Showing 11 changed files with 858 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CefSharp.Core/CefSharp.Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,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 @@ -279,6 +281,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
24 changes: 21 additions & 3 deletions CefSharp.Core/Internals/CefBrowserHostWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,30 @@ void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array<Compositi
_browserHost->ImeSetComposition(StringUtils::ToNative(text), underlinesVector, CefRange(), range);
}

void CefBrowserHostWrapper::ImeSetComposition(
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 @@ -83,7 +83,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

0 comments on commit 5b38163

Please sign in to comment.