libnx  v4.8.0
pl.h
Go to the documentation of this file.
1 /**
2  * @file pl.h
3  * @brief pl:u service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 
11 typedef enum {
12  PlServiceType_User = 0, ///< Initializes pl:u.
13  PlServiceType_System = 1, ///< Initializes pl:s. With [16.0.0+] SharedFont is no longer available with this, pl:u must be used for that.
15 
16 /// SharedFontType
17 typedef enum {
18  PlSharedFontType_Standard = 0, ///< Japan, US and Europe
19  PlSharedFontType_ChineseSimplified = 1, ///< Chinese Simplified
20  PlSharedFontType_ExtChineseSimplified = 2, ///< Extended Chinese Simplified
21  PlSharedFontType_ChineseTraditional = 3, ///< Chinese Traditional
22  PlSharedFontType_KO = 4, ///< Korean (Hangul)
23  PlSharedFontType_NintendoExt = 5, ///< Nintendo Extended. This font only has the special Nintendo-specific characters, which aren't available with the other fonts.
24  PlSharedFontType_Total, ///< Total fonts supported by this enum.
26 
27 /// FontData
28 typedef struct {
29  u32 type; ///< \ref PlSharedFontType
30  u32 offset; ///< Offset of the font in sharedmem.
31  u32 size; ///< Size of the font.
32  void* address; ///< Address of the actual font.
33 } PlFontData;
34 
35 /// Initialize pl.
37 
38 /// Exit pl.
39 void plExit(void);
40 
41 /// Gets the Service object for the actual pl service session.
43 
44 /// Gets the address of the SharedMemory.
45 void* plGetSharedmemAddr(void);
46 
47 ///< Gets a specific shared-font via \ref PlSharedFontType.
49 
50 ///< Gets shared font(s).
51 Result plGetSharedFont(u64 LanguageCode, PlFontData* fonts, s32 max_fonts, s32* total_fonts);
52 
void plExit(void)
Exit pl.
Result plGetSharedFontByType(PlFontData *font, PlSharedFontType SharedFontType)
Gets shared font(s).
PlServiceType
Definition: pl.h:11
@ PlServiceType_User
Initializes pl:u.
Definition: pl.h:12
@ PlServiceType_System
Initializes pl:s. With [16.0.0+] SharedFont is no longer available with this, pl:u must be used for t...
Definition: pl.h:13
Result plInitialize(PlServiceType service_type)
Initialize pl.
void * plGetSharedmemAddr(void)
Gets the address of the SharedMemory.
Service * plGetServiceSession(void)
Gets the Service object for the actual pl service session.
PlSharedFontType
SharedFontType.
Definition: pl.h:17
@ PlSharedFontType_Total
Total fonts supported by this enum.
Definition: pl.h:24
@ PlSharedFontType_ExtChineseSimplified
Extended Chinese Simplified.
Definition: pl.h:20
@ PlSharedFontType_NintendoExt
Nintendo Extended. This font only has the special Nintendo-specific characters, which aren't availabl...
Definition: pl.h:23
@ PlSharedFontType_ChineseSimplified
Chinese Simplified.
Definition: pl.h:19
@ PlSharedFontType_ChineseTraditional
Chinese Traditional.
Definition: pl.h:21
@ PlSharedFontType_KO
Korean (Hangul)
Definition: pl.h:22
@ PlSharedFontType_Standard
Japan, US and Europe.
Definition: pl.h:18
FontData.
Definition: pl.h:28
u32 size
Size of the font.
Definition: pl.h:31
u32 type
PlSharedFontType
Definition: pl.h:29
u32 offset
Offset of the font in sharedmem.
Definition: pl.h:30
void * address
Address of the actual font.
Definition: pl.h:32
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21