-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
X11 IME preedit, preedit cursor, input context improvements (#13282)
Co-authored-by: Dan Walmsley <[email protected]>
- Loading branch information
1 parent
43f1b9d
commit 5b02b03
Showing
13 changed files
with
340 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/Avalonia.Base/Input/TextInput/TextInputMethodClientRequeryRequestedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Avalonia.Interactivity; | ||
|
||
namespace Avalonia.Input.TextInput; | ||
|
||
public class TextInputMethodClientRequeryRequestedEventArgs : RoutedEventArgs | ||
{ | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/Avalonia.Base/Media/TextFormatting/Unicode/Utf16Utils.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
|
||
namespace Avalonia.Media.TextFormatting.Unicode; | ||
|
||
internal class Utf16Utils | ||
{ | ||
public static int CharacterOffsetToStringOffset(string s, int off, bool throwOnOutOfRange) | ||
{ | ||
if (off == 0) | ||
return 0; | ||
var symbolOffset = 0; | ||
for (var c = 0; c < s.Length; c++) | ||
{ | ||
if (symbolOffset == off) | ||
return c; | ||
|
||
if (!char.IsSurrogatePair(s, c)) | ||
symbolOffset++; | ||
} | ||
|
||
if (throwOnOutOfRange) | ||
throw new IndexOutOfRangeException(); | ||
return s.Length; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.