SoftwareKeyboardAppear.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using System.Runtime.InteropServices;
  2. namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
  3. {
  4. /// <summary>
  5. /// A structure with appearance configurations for the software keyboard when running in inline mode.
  6. /// </summary>
  7. [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
  8. struct SoftwareKeyboardAppear
  9. {
  10. public const int OkTextLength = SoftwareKeyboardAppearEx.OkTextLength;
  11. public KeyboardMode KeyboardMode;
  12. /// <summary>
  13. /// The string displayed in the Submit button.
  14. /// </summary>
  15. [MarshalAs(UnmanagedType.ByValTStr, SizeConst = OkTextLength + 1)]
  16. public string OkText;
  17. /// <summary>
  18. /// The character displayed in the left button of the numeric keyboard.
  19. /// </summary>
  20. public char LeftOptionalSymbolKey;
  21. /// <summary>
  22. /// The character displayed in the right button of the numeric keyboard.
  23. /// </summary>
  24. public char RightOptionalSymbolKey;
  25. /// <summary>
  26. /// When set, predictive typing is enabled making use of the system dictionary, and any custom user dictionary.
  27. /// </summary>
  28. [MarshalAs(UnmanagedType.I1)]
  29. public bool PredictionEnabled;
  30. /// <summary>
  31. /// When set, there is only the option to accept the input.
  32. /// </summary>
  33. [MarshalAs(UnmanagedType.I1)]
  34. public bool CancelButtonDisabled;
  35. /// <summary>
  36. /// Specifies prohibited characters that cannot be input into the text entry area.
  37. /// </summary>
  38. public InvalidCharFlags InvalidChars;
  39. /// <summary>
  40. /// Maximum text length allowed.
  41. /// </summary>
  42. public int TextMaxLength;
  43. /// <summary>
  44. /// Minimum text length allowed.
  45. /// </summary>
  46. public int TextMinLength;
  47. /// <summary>
  48. /// Indicates the return button is enabled in the keyboard. This allows for input with multiple lines.
  49. /// </summary>
  50. [MarshalAs(UnmanagedType.I1)]
  51. public bool UseNewLine;
  52. /// <summary>
  53. /// [10.0.0+] If value is 1 or 2, then keytopAsFloating=0 and footerScalable=1 in Calc.
  54. /// </summary>
  55. public KeyboardMiniaturizationMode MiniaturizationMode;
  56. public byte Reserved1;
  57. public byte Reserved2;
  58. /// <summary>
  59. /// Bit field with invalid buttons for the keyboard.
  60. /// </summary>
  61. public InvalidButtonFlags InvalidButtons;
  62. [MarshalAs(UnmanagedType.I1)]
  63. public bool UseSaveData;
  64. public uint Reserved3;
  65. public ushort Reserved4;
  66. public byte Reserved5;
  67. public ulong Reserved6;
  68. public ulong Reserved7;
  69. public SoftwareKeyboardAppearEx ToExtended()
  70. {
  71. SoftwareKeyboardAppearEx appear = new SoftwareKeyboardAppearEx();
  72. appear.KeyboardMode = KeyboardMode;
  73. appear.OkText = OkText;
  74. appear.LeftOptionalSymbolKey = LeftOptionalSymbolKey;
  75. appear.RightOptionalSymbolKey = RightOptionalSymbolKey;
  76. appear.PredictionEnabled = PredictionEnabled;
  77. appear.CancelButtonDisabled = CancelButtonDisabled;
  78. appear.InvalidChars = InvalidChars;
  79. appear.TextMaxLength = TextMaxLength;
  80. appear.TextMinLength = TextMinLength;
  81. appear.UseNewLine = UseNewLine;
  82. appear.MiniaturizationMode = MiniaturizationMode;
  83. appear.Reserved1 = Reserved1;
  84. appear.Reserved2 = Reserved2;
  85. appear.InvalidButtons = InvalidButtons;
  86. appear.UseSaveData = UseSaveData;
  87. appear.Reserved3 = Reserved3;
  88. appear.Reserved4 = Reserved4;
  89. appear.Reserved5 = Reserved5;
  90. appear.Uid0 = Reserved6;
  91. appear.Uid1 = Reserved7;
  92. appear.SamplingNumber = 0;
  93. appear.Reserved6 = 0;
  94. appear.Reserved7 = 0;
  95. appear.Reserved8 = 0;
  96. appear.Reserved9 = 0;
  97. return appear;
  98. }
  99. }
  100. }