wut  1.0.0-alpha
Wii U Toolchain
swkbd_cpp.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include <coreinit/filesystem.h>
4 #include <nn/result.h>
5 #include <padscore/kpad.h>
6 #include <vpad/input.h>
7 #include <string.h>
8 
15 #ifdef __cplusplus
16 
17 namespace nn
18 {
19 namespace swkbd
20 {
21 
22 enum class ControllerType
23 {
24  Unknown0 = 0,
25 };
26 
27 enum class LanguageType
28 {
29  Japanese = 0,
30  English = 1,
31 };
32 
33 enum class RegionType
34 {
35  Japan = 0,
36  USA = 1,
37  Europe = 2,
38 };
39 
40 enum class State
41 {
42  Unknown0 = 0,
43 };
44 
45 struct ConfigArg
46 {
48  {
49  memset(this, 0, sizeof(*this));
51  unk_0x04 = 4;
52  unk_0x0C = 0x7FFFF;
53  unk_0x10 = 19;
54  unk_0x14 = -1;
55  unk_0x9C = 1;
56  unk_0xA4 = -1;
57  }
58 
60  uint32_t unk_0x04;
61  uint32_t unk_0x08;
62  uint32_t unk_0x0C;
63  uint32_t unk_0x10;
64  int32_t unk_0x14;
65  WUT_UNKNOWN_BYTES(0x9C - 0x18);
66  uint32_t unk_0x9C;
67  WUT_UNKNOWN_BYTES(4);
68  int32_t unk_0xA4;
69 };
70 WUT_CHECK_OFFSET(ConfigArg, 0x00, languageType);
71 WUT_CHECK_OFFSET(ConfigArg, 0x04, unk_0x04);
72 WUT_CHECK_OFFSET(ConfigArg, 0x08, unk_0x08);
73 WUT_CHECK_OFFSET(ConfigArg, 0x0C, unk_0x0C);
74 WUT_CHECK_OFFSET(ConfigArg, 0x10, unk_0x10);
75 WUT_CHECK_OFFSET(ConfigArg, 0x14, unk_0x14);
76 WUT_CHECK_OFFSET(ConfigArg, 0x9C, unk_0x9C);
77 WUT_CHECK_OFFSET(ConfigArg, 0xA4, unk_0xA4);
78 WUT_CHECK_SIZE(ConfigArg, 0xA8);
79 
81 {
82  uint32_t unk_0x00 = 0;
83  uint32_t unk_0x04 = 0;
84  uint32_t unk_0x08 = 0;
85  int32_t unk_0x0C = -1;
86  uint32_t unk_0x10 = 0;
87  int32_t unk_0x14 = -1;
88 };
89 WUT_CHECK_OFFSET(ReceiverArg, 0x00, unk_0x00);
90 WUT_CHECK_OFFSET(ReceiverArg, 0x04, unk_0x04);
91 WUT_CHECK_OFFSET(ReceiverArg, 0x08, unk_0x08);
92 WUT_CHECK_OFFSET(ReceiverArg, 0x0C, unk_0x0C);
93 WUT_CHECK_OFFSET(ReceiverArg, 0x10, unk_0x10);
94 WUT_CHECK_OFFSET(ReceiverArg, 0x14, unk_0x14);
95 WUT_CHECK_SIZE(ReceiverArg, 0x18);
96 
98 {
101 };
102 WUT_CHECK_SIZE(KeyboardArg, 0xC0);
103 
105 {
106  uint32_t unk_0x00 = 1;
107  int32_t unk_0x04 = -1;
108  uint32_t unk_0x08 = 0;
109  uint32_t unk_0x0C = 0;
110  int32_t maxTextLength = -1;
111  uint32_t unk_0x14 = 0;
112  uint32_t unk_0x18 = 0;
113  bool unk_0x1C = false;
114  bool unk_0x1D = false;
115  bool unk_0x1E = false;
116  WUT_PADDING_BYTES(1);
117 };
118 WUT_CHECK_OFFSET(InputFormArg, 0x00, unk_0x00);
119 WUT_CHECK_OFFSET(InputFormArg, 0x04, unk_0x04);
120 WUT_CHECK_OFFSET(InputFormArg, 0x08, unk_0x08);
121 WUT_CHECK_OFFSET(InputFormArg, 0x0C, unk_0x0C);
122 WUT_CHECK_OFFSET(InputFormArg, 0x10, maxTextLength);
123 WUT_CHECK_OFFSET(InputFormArg, 0x14, unk_0x14);
124 WUT_CHECK_OFFSET(InputFormArg, 0x18, unk_0x18);
125 WUT_CHECK_OFFSET(InputFormArg, 0x1C, unk_0x1C);
126 WUT_CHECK_OFFSET(InputFormArg, 0x1D, unk_0x1D);
127 WUT_CHECK_OFFSET(InputFormArg, 0x1E, unk_0x1E);
128 WUT_CHECK_SIZE(InputFormArg, 0x20);
129 
130 struct AppearArg
131 {
134 };
135 WUT_CHECK_SIZE(AppearArg, 0xE0);
136 
137 struct CreateArg
138 {
139  void *workMemory = nullptr;
141  uint32_t unk_0x08 = 0;
142  FSClient *fsClient = nullptr;
143 };
144 WUT_CHECK_OFFSET(CreateArg, 0x00, workMemory);
145 WUT_CHECK_OFFSET(CreateArg, 0x04, regionType);
146 WUT_CHECK_OFFSET(CreateArg, 0x08, unk_0x08);
147 WUT_CHECK_OFFSET(CreateArg, 0x0C, fsClient);
148 WUT_CHECK_SIZE(CreateArg, 0x10);
149 
151 {
152  VPADStatus *vpad = nullptr;
153  KPADStatus *kpad[4] = { nullptr, nullptr, nullptr, nullptr };
154 };
155 WUT_CHECK_OFFSET(ControllerInfo, 0x00, vpad);
156 WUT_CHECK_OFFSET(ControllerInfo, 0x04, kpad);
157 WUT_CHECK_SIZE(ControllerInfo, 0x14);
158 
160 {
162  {
163  memset(this, 0, sizeof(*this));
164  }
165 
166  WUT_UNKNOWN_BYTES(0x1C);
167 };
168 WUT_CHECK_SIZE(DrawStringInfo, 0x1C);
169 
171 {
172  uint32_t unk_0x00 = 0;
173  uint32_t unk_0x04 = 0;
174 };
175 WUT_CHECK_OFFSET(KeyboardCondition, 0x00, unk_0x00);
176 WUT_CHECK_OFFSET(KeyboardCondition, 0x04, unk_0x04);
177 WUT_CHECK_SIZE(KeyboardCondition, 0x8);
178 
179 struct IEventReceiver;
180 struct IControllerEventObj;
181 struct ISoundObj;
182 
183 bool
184 AppearInputForm(const AppearArg& args);
185 
186 bool
187 AppearKeyboard(const KeyboardArg& args);
188 
189 void
191 
192 void
194 
195 void
196 Calc(const ControllerInfo &controllerInfo);
197 
198 void
200 
201 bool
202 Create(const CreateArg &args);
203 
204 void
205 Destroy();
206 
207 bool
209 
210 bool
212 
213 void
214 DrawDRC();
215 
216 void
217 DrawTV();
218 
219 void
220 GetDrawStringInfo(DrawStringInfo *drawStringInfo);
221 
222 const char16_t *
224 
225 void
226 GetKeyboardCondition(KeyboardCondition *keyboardCondition);
227 
228 State
230 
231 State
233 
234 uint32_t
235 GetWorkMemorySize(uint32_t unk);
236 
237 void
239 
240 
241 bool
242 InitLearnDic(void *dictionary);
243 
244 bool
246 
247 bool
248 IsDecideCancelButton(bool *outIsSelected);
249 
250 bool
251 IsDecideOkButton(bool *outIsSelected);
252 
253 bool
254 IsKeyboardTarget(IEventReceiver *eventReceiver);
255 
256 bool
258 
259 bool
261 
262 bool
264 
265 void
266 MuteAllSound(bool muted);
267 
268 void
270 
271 void
272 SetCursorPos(int);
273 
274 void
275 SetEnableOkButton(bool);
276 
277 void
278 SetInputFormString(const char16_t *str);
279 
280 void
281 SetReceiver(const ReceiverArg &receiver);
282 
283 void
284 SetSelectFrom(int);
285 
286 void
287 SetUserControllerEventObj(IControllerEventObj *controllerEventObj);
288 
289 void
290 SetUserSoundObj(ISoundObj *soundObj);
291 
292 } // namespace swkbd
293 } // namespace nn
294 
295 #endif // ifdef __cplusplus
296 
bool IsNeedCalcSubThreadFont()
void DrawTV()
bool IsNeedCalcSubThreadPredict()
bool InitLearnDic(void *dictionary)
LanguageType languageType
Definition: swkbd_cpp.h:59
const char16_t * GetInputFormString()
Definition: ac_cpp.h:13
RegionType regionType
Definition: swkbd_cpp.h:140
void SetReceiver(const ReceiverArg &receiver)
bool Create(const CreateArg &args)
void CalcSubThreadFont()
bool AppearInputForm(const AppearArg &args)
InputFormArg inputFormArg
Definition: swkbd_cpp.h:133
bool DisappearKeyboard()
void ConfirmUnfixAll()
bool DisappearInputForm()
void SetCursorPos(int)
bool IsDecideCancelButton(bool *outIsSelected)
uint32_t GetWorkMemorySize(uint32_t unk)
ControllerType
Definition: swkbd_cpp.h:22
void SetEnableOkButton(bool)
void SetSelectFrom(int)
void Calc(const ControllerInfo &controllerInfo)
void CalcSubThreadPredict()
void DrawDRC()
KPADStatus * kpad[4]
Definition: swkbd_cpp.h:153
bool IsSelectCursorActive()
bool IsCoveredWithSubWindow()
FSClient * fsClient
Definition: swkbd_cpp.h:142
void GetDrawStringInfo(DrawStringInfo *drawStringInfo)
bool IsKeyboardTarget(IEventReceiver *eventReceiver)
void SetControllerRemo(ControllerType type)
State GetStateInputForm()
bool AppearKeyboard(const KeyboardArg &args)
void InactivateSelectCursor()
void SetUserControllerEventObj(IControllerEventObj *controllerEventObj)
void Destroy()
State GetStateKeyboard()
void GetKeyboardCondition(KeyboardCondition *keyboardCondition)
void SetUserSoundObj(ISoundObj *soundObj)
void MuteAllSound(bool muted)
KeyboardArg keyboardArg
Definition: swkbd_cpp.h:132
void SetInputFormString(const char16_t *str)
bool IsDecideOkButton(bool *outIsSelected)
ReceiverArg receiverArg
Definition: swkbd_cpp.h:100