libnx
vi.h
Go to the documentation of this file.
1 /**
2  * @file vi.h
3  * @brief Display (vi:*) service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../services/sm.h"
10 
11 typedef struct {
12  u64 display_id;
13  char display_name[0x40];
14  bool initialized;
15 } ViDisplay;
16 
17 typedef struct {
18  u64 layer_id;
19  bool stray_layer;
20  bool initialized;
21 } ViLayer;
22 
23 typedef enum {
24  ViServiceType_Default = -1,
25  ViServiceType_Application = 0,
26  ViServiceType_System = 1,
27  ViServiceType_Manager = 2,
28 } ViServiceType;
29 
30 /// Used by viOpenLayer when CreateStrayLayer is used internally.
31 typedef enum {
32  ViLayerFlags_Default = 0x1,
33 } ViLayerFlags;
34 
35 /// Used with viSetLayerScalingMode.
36 typedef enum {
37  ViScalingMode_Default = 0x2,
39 
40 Result viInitialize(ViServiceType servicetype);
41 void viExit(void);
42 
43 Service* viGetSessionService(void);
44 Service* viGetSession_IApplicationDisplayService(void);
45 Service* viGetSession_IHOSBinderDriverRelay(void);
46 Service* viGetSession_ISystemDisplayService(void);
47 Service* viGetSession_IManagerDisplayService(void);
48 Service* viGetSession_IHOSBinderDriverIndirect(void);
49 
50 Result viOpenDisplay(const char *DisplayName, ViDisplay *display);
51 Result viCloseDisplay(ViDisplay *display);
52 Result viCreateManagedLayer(const ViDisplay *display, u32 LayerFlags, u64 AppletResourceUserId, u64 *layer_id);
53 Result viOpenLayer(u8 NativeWindow[0x100], u64 *NativeWindow_Size, const ViDisplay *display, ViLayer *layer, u32 LayerFlags, u64 LayerId);
54 Result viCloseLayer(ViLayer *layer);
55 
56 /// See ViScalingMode.
57 Result viSetLayerScalingMode(ViLayer *layer, u32 ScalingMode);
58 
59 Result viGetDisplayResolution(ViDisplay *display, u64 *width, u64 *height);
60 Result viGetDisplayVsyncEvent(ViDisplay *display, Handle *handle_out);
Definition: vi.h:11
u32 Handle
Kernel object handle.
Definition: types.h:45
Service object structure.
Definition: sm.h:23
u32 Result
Function error code result type.
Definition: types.h:46
Result viSetLayerScalingMode(ViLayer *layer, u32 ScalingMode)
See ViScalingMode.
uint8_t u8
8-bit unsigned integer.
Definition: types.h:21
uint64_t u64
64-bit unsigned integer.
Definition: types.h:24
uint32_t u32
32-bit unsigned integer.
Definition: types.h:23
Definition: vi.h:17
ViLayerFlags
Used by viOpenLayer when CreateStrayLayer is used internally.
Definition: vi.h:31
ViScalingMode
Used with viSetLayerScalingMode.
Definition: vi.h:36