From 89e95ef3bec8eaa23e5374da182bb57cd882d2c9 Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 26 Aug 2020 14:54:31 +1000 Subject: [PATCH] Core - Add CompositionUnderline.Style (IME) https://source.chromium.org/chromium/chromium/src/+/master:ui/base/ime/win/imm32_manager.cc;l=82;drc=c70af83bc44f6829277cdc3621e7015d6e0d7530;bpv=1;bpt=1?q=GCS_COMPCLAUSE&ss=chromium%2Fchromium%2Fsrc Resolves #3107 --- .../Internals/CefBrowserHostWrapper.cpp | 1 + CefSharp/CefSharp.csproj | 1 + CefSharp/Enums/CompositionUnderlineStyle.cs | 29 +++++++++++++++++++ CefSharp/Structs/CompositionUnderline.cs | 27 +++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 CefSharp/Enums/CompositionUnderlineStyle.cs diff --git a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp b/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp index a635bec36..e08aa5f48 100644 --- a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp +++ b/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp @@ -499,6 +499,7 @@ void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array + diff --git a/CefSharp/Enums/CompositionUnderlineStyle.cs b/CefSharp/Enums/CompositionUnderlineStyle.cs new file mode 100644 index 000000000..f04972d70 --- /dev/null +++ b/CefSharp/Enums/CompositionUnderlineStyle.cs @@ -0,0 +1,29 @@ +// Copyright © 2020 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. + +namespace CefSharp.Enums +{ + /// + /// Composition underline style. + /// + public enum CompositionUnderlineStyle + { + /// + /// Solid + /// + Solid, + /// + /// Dot + /// + Dot, + /// + /// Dash + /// + Dash, + /// + /// None + /// + None + } +} diff --git a/CefSharp/Structs/CompositionUnderline.cs b/CefSharp/Structs/CompositionUnderline.cs index c64f08600..acc30479d 100644 --- a/CefSharp/Structs/CompositionUnderline.cs +++ b/CefSharp/Structs/CompositionUnderline.cs @@ -2,6 +2,8 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +using CefSharp.Enums; + namespace CefSharp.Structs { /// @@ -30,6 +32,11 @@ namespace CefSharp.Structs /// public bool Thick { get; private set; } + /// + /// Style + /// + public CompositionUnderlineStyle Style { get; private set; } + /// /// Constructor. /// @@ -47,6 +54,26 @@ namespace CefSharp.Structs BackgroundColor = backGroundColor; Thick = thick; } + + /// + /// Constructor. + /// + /// Underline character range. + /// Text color. 32-bit ARGB color value, not premultiplied. The color components are always in a known order. + /// Equivalent to the SkColor type. + /// Background color. 32-bit ARGB color value, not premultiplied. The color components are always in + /// a known order. Equivalent to the SkColor type. + /// True for thickunderline. + /// Style + public CompositionUnderline(Range range, uint color, uint backGroundColor, bool thick, CompositionUnderlineStyle style) + : this() + { + Range = range; + Color = color; + BackgroundColor = backGroundColor; + Thick = thick; + Style = style; + } } }