forked from zohead/fbvnc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vnc.h
122 lines (104 loc) · 1.74 KB
/
vnc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#define VNC_CONN_FAILED 0
#define VNC_CONN_NOAUTH 1
#define VNC_CONN_AUTH 2
#define VNC_AUTH_OK 0
#define VNC_AUTH_FAILED 1
#define VNC_AUTH_TOOMANY 2
#define VNC_SERVER_FBUP 0
#define VNC_SERVER_COLORMAP 1
#define VNC_SERVER_BELL 2
#define VNC_SERVER_CUTTEXT 3
#define VNC_CLIENT_PIXFMT 0
#define VNC_CLIENT_COLORMAP 1
#define VNC_CLIENT_SETENC 2
#define VNC_CLIENT_FBUP 3
#define VNC_CLIENT_KEYEVENT 4
#define VNC_CLIENT_RATEVENT 5
#define VNC_CLIENT_CUTTEXT 6
#define VNC_ENC_RAW 0
#define VNC_ENC_COPYRECT 1
#define VNC_ENC_RRE 2
#define VNC_ENC_CORRE 4
#define VNC_ENC_HEXTILE 5
#define VNC_BUTTON1_MASK 0x1
#define VNC_BUTTON2_MASK 0x2
#define VNC_BUTTON3_MASK 0x4
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
struct vnc_pixelfmt {
u8 bpp;
u8 depth;
u8 bigendian;
u8 truecolor;
u16 rmax;
u16 gmax;
u16 bmax;
u8 rshl;
u8 gshl;
u8 bshl;
u8 pad1;
u16 pad2;
};
struct vnc_client_init {
u8 shared;
};
struct vnc_server_init {
u16 w;
u16 h;
struct vnc_pixelfmt fmt;
u32 len;
/* char name[len]; */
};
struct vnc_rect {
u16 x, y;
u16 w, h;
u32 enc;
/* rect bytes */
};
struct vnc_server_fbup {
u8 type;
u8 pad;
u16 n;
/* struct vnc_rect rects[n]; */
};
struct vnc_server_cuttext {
u8 type;
u8 pad1;
u16 pad2;
u32 len;
/* char text[length] */
};
struct vnc_server_colormap {
u8 type;
u8 pad;
u16 first;
u16 n;
/* u8 colors[n * 3 * 2]; */
};
struct vnc_client_pixelfmt {
u8 type;
u8 pad1;
u16 pad2;
struct vnc_pixelfmt format;
};
struct vnc_client_fbup {
u8 type;
u8 inc;
u16 x;
u16 y;
u16 w;
u16 h;
};
struct vnc_client_keyevent {
u8 type;
u8 down;
u16 pad;
u32 key;
};
struct vnc_client_ratevent {
u8 type;
u8 mask;
u16 x;
u16 y;
};