libctru  v1.6.0
apt.h
Go to the documentation of this file.
1 /**
2  * @file apt.h
3  * @brief APT (Applet) service.
4  */
5 #pragma once
6 
7 /**
8  * @brief NS Application IDs.
9  *
10  * Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs
11  */
12 typedef enum {
13  APPID_NONE = 0,
14  APPID_HOMEMENU = 0x101, ///< Home Menu
15  APPID_CAMERA = 0x110, ///< Camera applet
16  APPID_FRIENDS_LIST = 0x112, ///< Friends List applet
17  APPID_GAME_NOTES = 0x113, ///< Game Notes applet
18  APPID_WEB = 0x114, ///< Internet Browser
19  APPID_INSTRUCTION_MANUAL = 0x115, ///< Instruction Manual applet
20  APPID_NOTIFICATIONS = 0x116, ///< Notifications applet
21  APPID_MIIVERSE = 0x117, ///< Miiverse applet (olv)
22  APPID_MIIVERSE_POSTING = 0x118, ///< Miiverse posting applet (solv3)
23  APPID_AMIIBO_SETTINGS = 0x119, ///< Amiibo settings applet (cabinet)
24  APPID_APPLICATION = 0x300, ///< Application
25  APPID_ESHOP = 0x301, ///< eShop (tiger)
26  APPID_SOFTWARE_KEYBOARD = 0x401, ///< Software Keyboard
27  APPID_APPLETED = 0x402, ///< appletEd
28  APPID_PNOTE_AP = 0x404, ///< PNOTE_AP
29  APPID_SNOTE_AP = 0x405, ///< SNOTE_AP
30  APPID_ERROR = 0x406, ///< error
31  APPID_MINT = 0x407, ///< mint
32  APPID_EXTRAPAD = 0x408, ///< extrapad
33  APPID_MEMOLIB = 0x409, ///< memolib
34 } NS_APPID;
35 
36 /// APT applet position.
37 typedef enum {
38  APTPOS_NONE = -1, ///< No position specified.
39  APTPOS_APP = 0, ///< Application.
40  APTPOS_APPLIB = 1, ///< Application library (?).
41  APTPOS_SYS = 2, ///< System applet.
42  APTPOS_SYSLIB = 3, ///< System library (?).
43  APTPOS_RESIDENT = 4, ///< Resident applet.
45 
46 typedef u8 APT_AppletAttr;
47 
48 /// Create an APT_AppletAttr bitfield from its components.
49 static inline APT_AppletAttr aptMakeAppletAttr(APT_AppletPos pos, bool manualGpuRights, bool manualDspRights)
50 {
51  return (pos&7) | (manualGpuRights ? BIT(3) : 0) | (manualDspRights ? BIT(4) : 0);
52 }
53 
54 /// APT query reply.
55 typedef enum {
56  APTREPLY_REJECT = 0,
57  APTREPLY_ACCEPT = 1,
58  APTREPLY_LATER = 2,
60 
61 /// APT signals.
62 typedef enum {
63  APTSIGNAL_NONE = 0, ///< No signal received.
64  APTSIGNAL_HOMEBUTTON = 1, ///< HOME button pressed.
65  APTSIGNAL_HOMEBUTTON2 = 2, ///< HOME button pressed (again?).
66  APTSIGNAL_SLEEP_QUERY = 3, ///< Prepare to enter sleep mode.
67  APTSIGNAL_SLEEP_CANCEL = 4, ///< Triggered when ptm:s GetShellStatus() returns 5.
68  APTSIGNAL_SLEEP_ENTER = 5, ///< Enter sleep mode.
69  APTSIGNAL_SLEEP_WAKEUP = 6, ///< Wake from sleep mode.
70  APTSIGNAL_SHUTDOWN = 7, ///< Shutdown.
71  APTSIGNAL_POWERBUTTON = 8, ///< POWER button pressed.
72  APTSIGNAL_POWERBUTTON2 = 9, ///< POWER button cleared (?).
73  APTSIGNAL_TRY_SLEEP = 10, ///< System sleeping (?).
74  APTSIGNAL_ORDERTOCLOSE = 11, ///< Order to close (such as when an error happens?).
75 } APT_Signal;
76 
77 /// APT commands.
78 typedef enum {
79  APTCMD_NONE = 0, ///< No command received.
80  APTCMD_WAKEUP = 1, ///< Applet should wake up.
81  APTCMD_REQUEST = 2, ///< Source applet sent us a parameter.
82  APTCMD_RESPONSE = 3, ///< Target applet replied to our parameter.
83  APTCMD_EXIT = 4, ///< Exit (??)
84  APTCMD_MESSAGE = 5, ///< Message (??)
85  APTCMD_HOMEBUTTON_ONCE = 6, ///< HOME button pressed once.
86  APTCMD_HOMEBUTTON_TWICE = 7, ///< HOME button pressed twice (double-pressed).
87  APTCMD_DSP_SLEEP = 8, ///< DSP should sleep (manual DSP rights related?).
88  APTCMD_DSP_WAKEUP = 9, ///< DSP should wake up (manual DSP rights related?).
89  APTCMD_WAKEUP_EXIT = 10, ///< Applet wakes up due to a different applet exiting.
90  APTCMD_WAKEUP_PAUSE = 11, ///< Applet wakes up after being paused through HOME menu.
91  APTCMD_WAKEUP_CANCEL = 12, ///< Applet wakes up due to being cancelled.
92  APTCMD_WAKEUP_CANCELALL = 13, ///< Applet wakes up due to all applets being cancelled.
93  APTCMD_WAKEUP_POWERBUTTON = 14, ///< Applet wakes up due to POWER button being pressed (?).
94  APTCMD_WAKEUP_JUMPTOHOME = 15, ///< Applet wakes up and is instructed to jump to HOME menu (?).
95  APTCMD_SYSAPPLET_REQUEST = 16, ///< Request for sysapplet (?).
96  APTCMD_WAKEUP_LAUNCHAPP = 17, ///< Applet wakes up and is instructed to launch another applet (?).
97 } APT_Command;
98 
99 /// APT capture buffer information.
100 typedef struct
101 {
102  u32 size;
103  u32 is3D;
104  struct
105  {
106  u32 leftOffset;
107  u32 rightOffset;
108  u32 format;
109  } top, bottom;
111 
112 /// APT hook types.
113 typedef enum {
114  APTHOOK_ONSUSPEND = 0, ///< App suspended.
115  APTHOOK_ONRESTORE, ///< App restored.
116  APTHOOK_ONSLEEP, ///< App sleeping.
117  APTHOOK_ONWAKEUP, ///< App waking up.
118  APTHOOK_ONEXIT, ///< App exiting.
119 
120  APTHOOK_COUNT, ///< Number of APT hook types.
121 } APT_HookType;
122 
123 /// APT hook function.
124 typedef void (*aptHookFn)(APT_HookType hook, void* param);
125 
126 /// APT hook cookie.
127 typedef struct tag_aptHookCookie
128 {
129  struct tag_aptHookCookie* next; ///< Next cookie.
130  aptHookFn callback; ///< Hook callback.
131  void* param; ///< Callback parameter.
132 } aptHookCookie;
133 
134 /// APT message callback.
135 typedef void (*aptMessageCb)(void* user, NS_APPID sender, void* msg, size_t msgsize);
136 
137 /// Initializes APT.
138 Result aptInit(void);
139 
140 /// Exits APT.
141 void aptExit(void);
142 
143 /**
144  * @brief Sends an APT command through IPC, taking care of locking, opening and closing an APT session.
145  * @param aptcmdbuf Pointer to command buffer (should have capacity for at least 16 words).
146  */
147 Result aptSendCommand(u32* aptcmdbuf);
148 
149 /**
150  * @brief Gets whether to allow the system to enter sleep mode.
151  * @return Whether sleep mode is allowed.
152  */
153 bool aptIsSleepAllowed(void);
154 
155 /**
156  * @brief Sets whether to allow the system to enter sleep mode.
157  * @param allowed Whether to allow sleep mode.
158  */
159 void aptSetSleepAllowed(bool allowed);
160 
161 /**
162  * @brief Gets whether to allow the system to go back to HOME menu.
163  * @return Whether going back to HOME menu is allowed.
164  */
165 bool aptIsHomeAllowed(void);
166 
167 /**
168  * @brief Sets whether to allow the system to go back to HOME menu.
169  * @param allowed Whether going back to HOME menu is allowed.
170  */
171 void aptSetHomeAllowed(bool allowed);
172 
173 /**
174  * @brief Returns when the HOME button is pressed.
175  * @return Whether the HOME button is being pressed.
176  */
177 bool aptIsHomePressed(void);
178 
179 /**
180  * @brief Processes the current APT status. Generally used within a main loop.
181  * @return Whether the application should continue running.
182  */
183 bool aptMainLoop(void);
184 
185 /**
186  * @brief Sets up an APT status hook.
187  * @param cookie Hook cookie to use.
188  * @param callback Function to call when APT's status changes.
189  * @param param User-defined parameter to pass to the callback.
190  */
191 void aptHook(aptHookCookie* cookie, aptHookFn callback, void* param);
192 
193 /**
194  * @brief Removes an APT status hook.
195  * @param cookie Hook cookie to remove.
196  */
197 void aptUnhook(aptHookCookie* cookie);
198 
199 /**
200  * @brief Sets the function to be called when an APT message from another applet is received.
201  * @param callback Callback function.
202  * @param user User-defined data to be passed to the callback.
203  */
204 void aptSetMessageCallback(aptMessageCb callback, void* user);
205 
206 /**
207  * @brief Launches a library applet.
208  * @param appId ID of the applet to launch.
209  * @param buf Input/output buffer that contains launch parameters on entry and result data on exit.
210  * @param bufsize Size of the buffer.
211  * @param handle Handle to pass to the library applet.
212  * @return Whether the application should continue running after the library applet launch.
213  */
214 bool aptLaunchLibraryApplet(NS_APPID appId, void* buf, size_t bufsize, Handle handle);
215 
216 /**
217  * @brief Sets the chainloader target.
218  * @param programID ID of the program to chainload to.
219  * @param mediatype Media type of the program to chainload to.
220  */
221 void aptSetChainloader(u64 programID, u8 mediatype);
222 
223 /**
224  * @brief Gets an APT lock handle.
225  * @param flags Flags to use.
226  * @param lockHandle Pointer to output the lock handle to.
227  */
228 Result APT_GetLockHandle(u16 flags, Handle* lockHandle);
229 
230 /**
231  * @brief Initializes an application's registration with APT.
232  * @param appId ID of the application.
233  * @param attr Attributes of the application.
234  * @param signalEvent Pointer to output the signal event handle to.
235  * @param resumeEvent Pointer to output the resume event handle to.
236  */
237 Result APT_Initialize(NS_APPID appId, APT_AppletAttr attr, Handle* signalEvent, Handle* resumeEvent);
238 
239 /**
240  * @brief Terminates an application's registration with APT.
241  * @param appID ID of the application.
242  */
244 
245 /// Asynchronously resets the hardware.
247 
248 /**
249  * @brief Enables APT.
250  * @param attr Attributes of the application.
251  */
252 Result APT_Enable(APT_AppletAttr attr);
253 
254 /**
255  * @brief Gets applet management info.
256  * @param inpos Requested applet position.
257  * @param outpos Pointer to output the position of the current applet to.
258  * @param req_appid Pointer to output the AppID of the applet at the requested position to.
259  * @param menu_appid Pointer to output the HOME menu AppID to.
260  * @param active_appid Pointer to output the AppID of the currently active applet to.
261  */
262 Result APT_GetAppletManInfo(APT_AppletPos inpos, APT_AppletPos* outpos, NS_APPID* req_appid, NS_APPID* menu_appid, NS_APPID* active_appid);
263 
264 /**
265  * @brief Gets the menu's app ID.
266  * @return The menu's app ID.
267  */
268 static inline NS_APPID aptGetMenuAppID(void)
269 {
270  NS_APPID menu_appid = APPID_NONE;
271  APT_GetAppletManInfo(APTPOS_NONE, NULL, NULL, &menu_appid, NULL);
272  return menu_appid;
273 }
274 
275 /**
276  * @brief Gets an applet's information.
277  * @param appID AppID of the applet.
278  * @param pProgramID Pointer to output the program ID to.
279  * @param pMediaType Pointer to output the media type to.
280  * @param pRegistered Pointer to output the registration status to.
281  * @param pLoadState Pointer to output the load state to.
282  * @param pAttributes Pointer to output the applet atrributes to.
283  */
284 Result APT_GetAppletInfo(NS_APPID appID, u64* pProgramID, u8* pMediaType, bool* pRegistered, bool* pLoadState, APT_AppletAttr* pAttributes);
285 
286 /**
287  * @brief Gets an applet's program information.
288  * @param id ID of the applet.
289  * @param flags Flags to use when retreiving the information.
290  * @param titleversion Pointer to output the applet's title version to.
291  *
292  * Flags:
293  * - 0x01: Use AM_ListTitles with NAND media type.
294  * - 0x02: Use AM_ListTitles with SDMC media type.
295  * - 0x04: Use AM_ListTitles with GAMECARD media type.
296  * - 0x10: Input ID is an app ID. Must be set if 0x20 is not.
297  * - 0x20: Input ID is a program ID. Must be set if 0x10 is not.
298  * - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set.
299  */
300 Result APT_GetAppletProgramInfo(u32 id, u32 flags, u16 *titleversion);
301 
302 /**
303  * @brief Gets the current application's program ID.
304  * @param pProgramID Pointer to output the program ID to.
305  */
306 Result APT_GetProgramID(u64* pProgramID);
307 
308 /// Prepares to jump to the home menu.
310 
311 /**
312  * @brief Jumps to the home menu.
313  * @param param Parameters to jump with.
314  * @param Size of the parameter buffer.
315  * @param handle Handle to pass.
316  */
317 Result APT_JumpToHomeMenu(const void* param, size_t paramSize, Handle handle);
318 
319 /**
320  * @brief Prepares to jump to an application.
321  * @param exiting Specifies whether the applet is exiting.
322  */
324 
325 /**
326  * @brief Jumps to an application.
327  * @param param Parameters to jump with.
328  * @param Size of the parameter buffer.
329  * @param handle Handle to pass.
330  */
331 Result APT_JumpToApplication(const void* param, size_t paramSize, Handle handle);
332 
333 /**
334  * @brief Gets whether an application is registered.
335  * @param appID ID of the application.
336  * @param out Pointer to output the registration state to.
337  */
338 Result APT_IsRegistered(NS_APPID appID, bool* out);
339 
340 /**
341  * @brief Inquires as to whether a signal has been received.
342  * @param appID ID of the application.
343  * @param signalType Pointer to output the signal type to.
344  */
345 Result APT_InquireNotification(u32 appID, APT_Signal* signalType);
346 
347 /**
348  * @brief Notifies an application to wait.
349  * @param appID ID of the application.
350  */
352 
353 /**
354  * @brief Calls an applet utility function.
355  * @param id Utility function to call.
356  * @param out Pointer to write output data to.
357  * @param outSize Size of the output buffer.
358  * @param in Pointer to the input data.
359  * @param inSize Size of the input buffer.
360  */
361 Result APT_AppletUtility(int id, void* out, size_t outSize, const void* in, size_t inSize);
362 
363 /// Sleeps if shell is closed (?).
365 
366 /**
367  * @brief Tries to lock a transition (?).
368  * @param transition Transition ID.
369  * @param succeeded Pointer to output whether the lock was successfully applied.
370  */
371 Result APT_TryLockTransition(u32 transition, bool* succeeded);
372 
373 /**
374  * @brief Unlocks a transition (?).
375  * @param transition Transition ID.
376  */
377 Result APT_UnlockTransition(u32 transition);
378 
379 /**
380  * @brief Glances at a receieved parameter without removing it from the queue.
381  * @param appID AppID of the application.
382  * @param buffer Buffer to receive to.
383  * @param bufferSize Size of the buffer.
384  * @param sender Pointer to output the sender's AppID to.
385  * @param command Pointer to output the command ID to.
386  * @param actualSize Pointer to output the actual received data size to.
387  * @param parameter Pointer to output the parameter handle to.
388  */
389 Result APT_GlanceParameter(NS_APPID appID, void* buffer, size_t bufferSize, NS_APPID* sender, APT_Command* command, size_t* actualSize, Handle* parameter);
390 
391 /**
392  * @brief Receives a parameter.
393  * @param appID AppID of the application.
394  * @param buffer Buffer to receive to.
395  * @param bufferSize Size of the buffer.
396  * @param sender Pointer to output the sender's AppID to.
397  * @param command Pointer to output the command ID to.
398  * @param actualSize Pointer to output the actual received data size to.
399  * @param parameter Pointer to output the parameter handle to.
400  */
401 Result APT_ReceiveParameter(NS_APPID appID, void* buffer, size_t bufferSize, NS_APPID* sender, APT_Command* command, size_t* actualSize, Handle* parameter);
402 
403 /**
404  * @brief Sends a parameter.
405  * @param source AppID of the source application.
406  * @param dest AppID of the destination application.
407  * @param command Command to send.
408  * @param buffer Buffer to send.
409  * @param bufferSize Size of the buffer.
410  * @param parameter Parameter handle to pass.
411  */
412 Result APT_SendParameter(NS_APPID source, NS_APPID dest, APT_Command command, const void* buffer, u32 bufferSize, Handle parameter);
413 
414 /**
415  * @brief Cancels a parameter which matches the specified source and dest AppIDs.
416  * @param source AppID of the source application (use APPID_NONE to disable the check).
417  * @param dest AppID of the destination application (use APPID_NONE to disable the check).
418  * @param success Pointer to output true if a parameter was cancelled, or false otherwise.
419  */
420 Result APT_CancelParameter(NS_APPID source, NS_APPID dest, bool* success);
421 
422 /**
423  * @brief Sends capture buffer information.
424  * @param captureBuf Capture buffer information to send.
425  */
427 
428 /**
429  * @brief Replies to a sleep query.
430  * @param appID ID of the application.
431  * @param reply Query reply value.
432  */
434 
435 /**
436  * @brief Replies that a sleep notification has been completed.
437  * @param appID ID of the application.
438  */
440 
441 /**
442  * @brief Prepares to close the application.
443  * @param cancelPreload Whether applet preloads should be cancelled.
444  */
445 Result APT_PrepareToCloseApplication(bool cancelPreload);
446 
447 /**
448  * @brief Closes the application.
449  * @param param Parameters to close with.
450  * @param paramSize Size of param.
451  * @param handle Handle to pass.
452  */
453 Result APT_CloseApplication(const void* param, size_t paramSize, Handle handle);
454 
455 /**
456  * @brief Sets the application's CPU time limit.
457  * @param percent CPU time limit percentage to set.
458  */
460 
461 /**
462  * @brief Gets the application's CPU time limit.
463  * @param percent Pointer to output the CPU time limit percentage to.
464  */
466 
467 /**
468  * @brief Checks whether the system is a New 3DS.
469  * @param out Pointer to write the New 3DS flag to.
470  */
471 Result APT_CheckNew3DS(bool* out);
472 
473 /**
474  * @brief Prepares for an applicaton jump.
475  * @param flags Flags to use.
476  * @param programID ID of the program to jump to.
477  * @param mediatype Media type of the program to jump to.
478  */
479 Result APT_PrepareToDoApplicationJump(u8 flags, u64 programID, u8 mediatype);
480 
481 /**
482  * @brief Performs an application jump.
483  * @param param Parameter buffer.
484  * @param paramSize Size of parameter buffer.
485  * @param hmac HMAC buffer (should be 0x20 bytes long).
486  */
487 Result APT_DoApplicationJump(const void* param, size_t paramSize, const void* hmac);
488 
489 /**
490  * @brief Prepares to start a library applet.
491  * @param appID AppID of the applet to start.
492  */
494 
495 /**
496  * @brief Starts a library applet.
497  * @param appID AppID of the applet to launch.
498  * @param param Buffer containing applet parameters.
499  * @param paramsize Size of the buffer.
500  * @param handle Handle to pass to the applet.
501  */
502 Result APT_StartLibraryApplet(NS_APPID appID, const void* param, size_t paramSize, Handle handle);
503 
504 /**
505  * @brief Prepares to start a system applet.
506  * @param appID AppID of the applet to start.
507  */
509 
510 /**
511  * @brief Starts a system applet.
512  * @param appID AppID of the applet to launch.
513  * @param param Buffer containing applet parameters.
514  * @param paramSize Size of the parameter buffer.
515  * @param handle Handle to pass to the applet.
516  */
517 Result APT_StartSystemApplet(NS_APPID appID, const void* param, size_t paramSize, Handle handle);
518 
519 /**
520  * @brief Retrieves the shared system font.
521  * @brief fontHandle Pointer to write the handle of the system font memory block to.
522  * @brief mapAddr Pointer to write the mapping address of the system font memory block to.
523  */
524 Result APT_GetSharedFont(Handle* fontHandle, u32* mapAddr);
525 
526 /**
527  * @brief Receives the deliver (launch) argument
528  * @param param Parameter buffer.
529  * @param paramSize Size of parameter buffer.
530  * @param hmac HMAC buffer (should be 0x20 bytes long).
531  * @param sender Pointer to output the sender's AppID to.
532  * @param received Pointer to output whether an argument was received to.
533  */
534 Result APT_ReceiveDeliverArg(const void* param, size_t paramSize, const void* hmac, u64* sender, bool* received);
Application.
Definition: apt.h:24
Result APT_ReceiveDeliverArg(const void *param, size_t paramSize, const void *hmac, u64 *sender, bool *received)
Receives the deliver (launch) argument.
Triggered when ptm:s GetShellStatus() returns 5.
Definition: apt.h:67
Result aptSendCommand(u32 *aptcmdbuf)
Sends an APT command through IPC, taking care of locking, opening and closing an APT session.
Amiibo settings applet (cabinet)
Definition: apt.h:23
Result APT_PrepareToJumpToApplication(bool exiting)
Prepares to jump to an application.
Result APT_UnlockTransition(u32 transition)
Unlocks a transition (?).
aptHookFn callback
Hook callback.
Definition: apt.h:130
Result APT_ReceiveParameter(NS_APPID appID, void *buffer, size_t bufferSize, NS_APPID *sender, APT_Command *command, size_t *actualSize, Handle *parameter)
Receives a parameter.
s32 Result
Function result.
Definition: types.h:42
bool aptIsSleepAllowed(void)
Gets whether to allow the system to enter sleep mode.
void aptSetHomeAllowed(bool allowed)
Sets whether to allow the system to go back to HOME menu.
Result APT_CancelParameter(NS_APPID source, NS_APPID dest, bool *success)
Cancels a parameter which matches the specified source and dest AppIDs.
APT hook cookie.
Definition: apt.h:127
Result APT_TryLockTransition(u32 transition, bool *succeeded)
Tries to lock a transition (?).
void aptSetChainloader(u64 programID, u8 mediatype)
Sets the chainloader target.
bool aptMainLoop(void)
Processes the current APT status.
SNOTE_AP.
Definition: apt.h:29
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
App restored.
Definition: apt.h:115
HOME button pressed once.
Definition: apt.h:85
void(* aptHookFn)(APT_HookType hook, void *param)
APT hook function.
Definition: apt.h:124
extrapad
Definition: apt.h:32
App exiting.
Definition: apt.h:118
static APT_AppletAttr aptMakeAppletAttr(APT_AppletPos pos, bool manualGpuRights, bool manualDspRights)
Create an APT_AppletAttr bitfield from its components.
Definition: apt.h:49
Result aptInit(void)
Initializes APT.
void aptHook(aptHookCookie *cookie, aptHookFn callback, void *param)
Sets up an APT status hook.
Result APT_SendCaptureBufferInfo(const aptCaptureBufInfo *captureBuf)
Sends capture buffer information.
Friends List applet.
Definition: apt.h:16
Source applet sent us a parameter.
Definition: apt.h:81
Result APT_ReplySleepNotificationComplete(NS_APPID appID)
Replies that a sleep notification has been completed.
Shutdown.
Definition: apt.h:70
struct tag_aptHookCookie * next
Next cookie.
Definition: apt.h:129
void aptSetMessageCallback(aptMessageCb callback, void *user)
Sets the function to be called when an APT message from another applet is received.
APT_AppletPos
APT applet position.
Definition: apt.h:37
Instruction Manual applet.
Definition: apt.h:19
u32 Handle
Resource handle.
Definition: types.h:41
Applet wakes up after being paused through HOME menu.
Definition: apt.h:90
Result APT_DoApplicationJump(const void *param, size_t paramSize, const void *hmac)
Performs an application jump.
APT_QueryReply
APT query reply.
Definition: apt.h:55
App waking up.
Definition: apt.h:117
Notifications applet.
Definition: apt.h:20
Result APT_StartSystemApplet(NS_APPID appID, const void *param, size_t paramSize, Handle handle)
Starts a system applet.
Applet wakes up due to all applets being cancelled.
Definition: apt.h:92
System library (?).
Definition: apt.h:42
void aptSetSleepAllowed(bool allowed)
Sets whether to allow the system to enter sleep mode.
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
POWER button pressed.
Definition: apt.h:71
Miiverse posting applet (solv3)
Definition: apt.h:22
HOME button pressed.
Definition: apt.h:64
No position specified.
Definition: apt.h:38
void(* aptMessageCb)(void *user, NS_APPID sender, void *msg, size_t msgsize)
APT message callback.
Definition: apt.h:135
DSP should sleep (manual DSP rights related?).
Definition: apt.h:87
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
Applet should wake up.
Definition: apt.h:80
Result APT_Initialize(NS_APPID appId, APT_AppletAttr attr, Handle *signalEvent, Handle *resumeEvent)
Initializes an application's registration with APT.
Applet wakes up due to being cancelled.
Definition: apt.h:91
Result APT_SetAppCpuTimeLimit(u32 percent)
Sets the application's CPU time limit.
No command received.
Definition: apt.h:79
Exit (??)
Definition: apt.h:83
mint
Definition: apt.h:31
Result APT_PrepareToCloseApplication(bool cancelPreload)
Prepares to close the application.
Resident applet.
Definition: apt.h:43
Result APT_GetSharedFont(Handle *fontHandle, u32 *mapAddr)
Retrieves the shared system font.
Result APT_AppletUtility(int id, void *out, size_t outSize, const void *in, size_t inSize)
Calls an applet utility function.
Application library (?).
Definition: apt.h:40
Miiverse applet (olv)
Definition: apt.h:21
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
Enter sleep mode.
Definition: apt.h:68
APT_Command
APT commands.
Definition: apt.h:78
Applet wakes up due to a different applet exiting.
Definition: apt.h:89
Result APT_IsRegistered(NS_APPID appID, bool *out)
Gets whether an application is registered.
Result APT_GlanceParameter(NS_APPID appID, void *buffer, size_t bufferSize, NS_APPID *sender, APT_Command *command, size_t *actualSize, Handle *parameter)
Glances at a receieved parameter without removing it from the queue.
Result APT_PrepareToStartLibraryApplet(NS_APPID appID)
Prepares to start a library applet.
Result APT_GetLockHandle(u16 flags, Handle *lockHandle)
Gets an APT lock handle.
Camera applet.
Definition: apt.h:15
Applet wakes up due to POWER button being pressed (?).
Definition: apt.h:93
Applet wakes up and is instructed to launch another applet (?).
Definition: apt.h:96
Wake from sleep mode.
Definition: apt.h:69
Result APT_CheckNew3DS(bool *out)
Checks whether the system is a New 3DS.
Result APT_JumpToApplication(const void *param, size_t paramSize, Handle handle)
Jumps to an application.
Result APT_PrepareToStartSystemApplet(NS_APPID appID)
Prepares to start a system applet.
Prepare to enter sleep mode.
Definition: apt.h:66
void aptExit(void)
Exits APT.
Result APT_SleepIfShellClosed(void)
Sleeps if shell is closed (?).
Applet wakes up and is instructed to jump to HOME menu (?).
Definition: apt.h:94
Result APT_Enable(APT_AppletAttr attr)
Enables APT.
Home Menu.
Definition: apt.h:14
App suspended.
Definition: apt.h:114
System sleeping (?).
Definition: apt.h:73
Request for sysapplet (?).
Definition: apt.h:95
bool aptIsHomePressed(void)
Returns when the HOME button is pressed.
No signal received.
Definition: apt.h:63
Result APT_InquireNotification(u32 appID, APT_Signal *signalType)
Inquires as to whether a signal has been received.
error
Definition: apt.h:30
Result APT_GetAppCpuTimeLimit(u32 *percent)
Gets the application's CPU time limit.
void * param
Callback parameter.
Definition: apt.h:131
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:47
Game Notes applet.
Definition: apt.h:17
void aptUnhook(aptHookCookie *cookie)
Removes an APT status hook.
bool aptLaunchLibraryApplet(NS_APPID appId, void *buf, size_t bufsize, Handle handle)
Launches a library applet.
System applet.
Definition: apt.h:41
Result APT_ReplySleepQuery(NS_APPID appID, APT_QueryReply reply)
Replies to a sleep query.
Number of APT hook types.
Definition: apt.h:120
HOME button pressed twice (double-pressed).
Definition: apt.h:86
NS_APPID
NS Application IDs.
Definition: apt.h:12
memolib
Definition: apt.h:33
static NS_APPID aptGetMenuAppID(void)
Gets the menu's app ID.
Definition: apt.h:268
Result APT_HardwareResetAsync(void)
Asynchronously resets the hardware.
DSP should wake up (manual DSP rights related?).
Definition: apt.h:88
Result APT_PrepareToDoApplicationJump(u8 flags, u64 programID, u8 mediatype)
Prepares for an applicaton jump.
HOME button pressed (again?).
Definition: apt.h:65
Internet Browser.
Definition: apt.h:18
Order to close (such as when an error happens?).
Definition: apt.h:74
bool aptIsHomeAllowed(void)
Gets whether to allow the system to go back to HOME menu.
APT_Signal
APT signals.
Definition: apt.h:62
Software Keyboard.
Definition: apt.h:26
Result APT_GetAppletInfo(NS_APPID appID, u64 *pProgramID, u8 *pMediaType, bool *pRegistered, bool *pLoadState, APT_AppletAttr *pAttributes)
Gets an applet's information.
Result APT_JumpToHomeMenu(const void *param, size_t paramSize, Handle handle)
Jumps to the home menu.
APT_HookType
APT hook types.
Definition: apt.h:113
Result APT_Finalize(NS_APPID appId)
Terminates an application's registration with APT.
appletEd
Definition: apt.h:27
Result APT_CloseApplication(const void *param, size_t paramSize, Handle handle)
Closes the application.
Result APT_StartLibraryApplet(NS_APPID appID, const void *param, size_t paramSize, Handle handle)
Starts a library applet.
PNOTE_AP.
Definition: apt.h:28
Result APT_GetAppletProgramInfo(u32 id, u32 flags, u16 *titleversion)
Gets an applet's program information.
Message (??)
Definition: apt.h:84
Result APT_NotifyToWait(NS_APPID appID)
Notifies an application to wait.
POWER button cleared (?).
Definition: apt.h:72
APT capture buffer information.
Definition: apt.h:100
Application.
Definition: apt.h:39
Result APT_GetProgramID(u64 *pProgramID)
Gets the current application's program ID.
eShop (tiger)
Definition: apt.h:25
Result APT_GetAppletManInfo(APT_AppletPos inpos, APT_AppletPos *outpos, NS_APPID *req_appid, NS_APPID *menu_appid, NS_APPID *active_appid)
Gets applet management info.
Result APT_PrepareToJumpToHomeMenu(void)
Prepares to jump to the home menu.
Target applet replied to our parameter.
Definition: apt.h:82
App sleeping.
Definition: apt.h:116
Result APT_SendParameter(NS_APPID source, NS_APPID dest, APT_Command command, const void *buffer, u32 bufferSize, Handle parameter)
Sends a parameter.