Files
ryujinx/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardConfig.cs
TSRBerry 326749498b [Ryujinx.HLE] Address dotnet-format issues (#5380)
* dotnet format style --severity info

Some changes were manually reverted.

* dotnet format analyzers --serverity info

Some changes have been minimally adapted.

* Restore a few unused methods and variables

* Silence dotnet format IDE0060 warnings

* Silence dotnet format IDE0052 warnings

* Address or silence dotnet format IDE1006 warnings

* Address dotnet format CA1816 warnings

* Address or silence dotnet format CA2208 warnings

* Address or silence dotnet format CA1806 and a few CA1854 warnings

* Address dotnet format CA2211 warnings

* Address dotnet format CA1822 warnings

* Address or silence dotnet format CA1069 warnings

* Make dotnet format succeed in style mode

* Address or silence dotnet format CA2211 warnings

* Address review comments

* Address dotnet format CA2208 warnings properly

* Make ProcessResult readonly

* Address most dotnet format whitespace warnings

* Apply dotnet format whitespace formatting

A few of them have been manually reverted and the corresponding warning was silenced

* Add previously silenced warnings back

I have no clue how these disappeared

* Revert formatting changes for while and for-loops

* Format if-blocks correctly

* Run dotnet format style after rebase

* Run dotnet format whitespace after rebase

* Run dotnet format style after rebase

* Run dotnet format analyzers after rebase

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Disable 'prefer switch expression' rule

* Add comments to disabled warnings

* Fix a few disabled warnings

* Fix naming rule violation, Convert shader properties to auto-property and convert values to const

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Start working on disabled warnings

* Fix and silence a few dotnet-format warnings again

* Run dotnet format after rebase

* Use using declaration instead of block syntax

* Address IDE0251 warnings

* Address a few disabled IDE0060 warnings

* Silence IDE0060 in .editorconfig

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* First dotnet format pass

* Fix naming rule violations

* Fix typo

* Add trailing commas, use targeted new and use array initializer

* Fix build issues

* Fix remaining build issues

* Remove SuppressMessage for CA1069 where possible

* Address dotnet format issues

* Address formatting issues

Co-authored-by: Ac_K <acoustik666@gmail.com>

* Add GetHashCode implementation for RenderingSurfaceInfo

* Explicitly silence CA1822 for every affected method in Syscall

* Address formatting issues in Demangler.cs

* Address review feedback

Co-authored-by: Ac_K <acoustik666@gmail.com>

* Revert marking service methods as static

* Next dotnet format pass

* Address review feedback

---------

Co-authored-by: Ac_K <acoustik666@gmail.com>
2023-07-16 19:31:14 +02:00

139 lines
4.9 KiB
C#

using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
{
/// <summary>
/// A structure that defines the configuration options of the software keyboard.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
struct SoftwareKeyboardConfig
{
private const int SubmitTextLength = 8;
private const int HeaderTextLength = 64;
private const int SubtitleTextLength = 128;
private const int GuideTextLength = 256;
/// <summary>
/// Type of keyboard.
/// </summary>
public KeyboardMode Mode;
/// <summary>
/// The string displayed in the Submit button.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SubmitTextLength + 1)]
public string SubmitText;
/// <summary>
/// The character displayed in the left button of the numeric keyboard.
/// This is ignored when Mode is not set to NumbersOnly.
/// </summary>
public char LeftOptionalSymbolKey;
/// <summary>
/// The character displayed in the right button of the numeric keyboard.
/// This is ignored when Mode is not set to NumbersOnly.
/// </summary>
public char RightOptionalSymbolKey;
/// <summary>
/// When set, predictive typing is enabled making use of the system dictionary,
/// and any custom user dictionary.
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool PredictionEnabled;
/// <summary>
/// Specifies prohibited characters that cannot be input into the text entry area.
/// </summary>
public InvalidCharFlags InvalidCharFlag;
/// <summary>
/// The initial position of the text cursor displayed in the text entry area.
/// </summary>
public InitialCursorPosition InitialCursorPosition;
/// <summary>
/// The string displayed in the header area of the keyboard.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = HeaderTextLength + 1)]
public string HeaderText;
/// <summary>
/// The string displayed in the subtitle area of the keyboard.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SubtitleTextLength + 1)]
public string SubtitleText;
/// <summary>
/// The placeholder string displayed in the text entry area when no text is entered.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = GuideTextLength + 1)]
public string GuideText;
/// <summary>
/// When non-zero, specifies the maximum allowed length of the string entered into the text entry area.
/// </summary>
public int StringLengthMax;
/// <summary>
/// When non-zero, specifies the minimum allowed length of the string entered into the text entry area.
/// </summary>
public int StringLengthMin;
/// <summary>
/// When enabled, hides input characters as dots in the text entry area.
/// </summary>
public PasswordMode PasswordMode;
/// <summary>
/// Specifies whether the text entry area is displayed as a single-line entry, or a multi-line entry field.
/// </summary>
public InputFormMode InputFormMode;
/// <summary>
/// When set, enables or disables the return key. This value is ignored when single-line entry is specified as the InputFormMode.
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool UseNewLine;
/// <summary>
/// When set, the software keyboard will return a UTF-8 encoded string, rather than UTF-16.
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool UseUtf8;
/// <summary>
/// When set, the software keyboard will blur the game application rendered behind the keyboard.
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool UseBlurBackground;
/// <summary>
/// Offset into the work buffer of the initial text when the keyboard is first displayed.
/// </summary>
public int InitialStringOffset;
/// <summary>
/// Length of the initial text.
/// </summary>
public int InitialStringLength;
/// <summary>
/// Offset into the work buffer of the custom user dictionary.
/// </summary>
public int CustomDictionaryOffset;
/// <summary>
/// Number of entries in the custom user dictionary.
/// </summary>
public int CustomDictionaryCount;
/// <summary>
/// When set, the text entered will be validated on the application side after the keyboard has been submitted.
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool CheckText;
}
}