You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vncExt.h 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. #ifndef _VNCEXT_H_
  19. #define _VNCEXT_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define X_VncExtSetParam 0
  24. #define X_VncExtGetParam 1
  25. #define X_VncExtGetParamDesc 2
  26. #define X_VncExtListParams 3
  27. #define X_VncExtSetServerCutText 4
  28. #define X_VncExtGetClientCutText 5
  29. #define X_VncExtSelectInput 6
  30. #define X_VncExtConnect 7
  31. #define X_VncExtGetQueryConnect 8
  32. #define X_VncExtApproveConnect 9
  33. #define VncExtClientCutTextNotify 0
  34. #define VncExtSelectionChangeNotify 1
  35. #define VncExtQueryConnectNotify 2
  36. #define VncExtClientCutTextMask (1 << VncExtClientCutTextNotify)
  37. #define VncExtSelectionChangeMask (1 << VncExtSelectionChangeNotify)
  38. #define VncExtQueryConnectMask (1 << VncExtQueryConnectNotify)
  39. #define VncExtNumberEvents 3
  40. #define VncExtNumberErrors 0
  41. #ifndef _VNCEXT_SERVER_
  42. Bool XVncExtQueryExtension(Display* dpy, int* event_basep, int* error_basep);
  43. Bool XVncExtSetParam(Display* dpy, const char* param);
  44. Bool XVncExtGetParam(Display* dpy, const char* param, char** value, int* len);
  45. char* XVncExtGetParamDesc(Display* dpy, const char* param);
  46. char** XVncExtListParams(Display* dpy, int* nParams);
  47. void XVncExtFreeParamList(char** list);
  48. Bool XVncExtSetServerCutText(Display* dpy, const char* str, int len);
  49. Bool XVncExtGetClientCutText(Display* dpy, char** str, int* len);
  50. Bool XVncExtSelectInput(Display* dpy, Window w, int mask);
  51. Bool XVncExtConnect(Display* dpy, const char* hostAndPort);
  52. Bool XVncExtGetQueryConnect(Display* dpy, char** addr,
  53. char** user, int* timeout, void** opaqueId);
  54. Bool XVncExtApproveConnect(Display* dpy, void* opaqueId, int approve);
  55. typedef struct {
  56. int type;
  57. unsigned long serial;
  58. Bool send_event;
  59. Display *display;
  60. Window window;
  61. Time time;
  62. } XVncExtClientCutTextEvent;
  63. typedef struct {
  64. int type;
  65. unsigned long serial;
  66. Bool send_event;
  67. Display *display;
  68. Window window;
  69. Atom selection;
  70. } XVncExtSelectionChangeEvent;
  71. typedef struct {
  72. int type;
  73. unsigned long serial;
  74. Bool send_event;
  75. Display *display;
  76. Window window;
  77. } XVncExtQueryConnectEvent;
  78. #endif
  79. #ifdef _VNCEXT_PROTO_
  80. #define VNCEXTNAME "VNC-EXTENSION"
  81. typedef struct {
  82. CARD8 reqType; /* always VncExtReqCode */
  83. CARD8 vncExtReqType; /* always VncExtSetParam */
  84. CARD16 length B16;
  85. CARD8 paramLen;
  86. CARD8 pad0;
  87. CARD16 pad1 B16;
  88. } xVncExtSetParamReq;
  89. #define sz_xVncExtSetParamReq 8
  90. typedef struct {
  91. BYTE type; /* X_Reply */
  92. BYTE success;
  93. CARD16 sequenceNumber B16;
  94. CARD32 length B32;
  95. CARD32 pad0 B32;
  96. CARD32 pad1 B32;
  97. CARD32 pad2 B32;
  98. CARD32 pad3 B32;
  99. CARD32 pad4 B32;
  100. CARD32 pad5 B32;
  101. } xVncExtSetParamReply;
  102. #define sz_xVncExtSetParamReply 32
  103. typedef struct {
  104. CARD8 reqType; /* always VncExtReqCode */
  105. CARD8 vncExtReqType; /* always VncExtGetParam */
  106. CARD16 length B16;
  107. CARD8 paramLen;
  108. CARD8 pad0;
  109. CARD16 pad1 B16;
  110. } xVncExtGetParamReq;
  111. #define sz_xVncExtGetParamReq 8
  112. typedef struct {
  113. BYTE type; /* X_Reply */
  114. BYTE success;
  115. CARD16 sequenceNumber B16;
  116. CARD32 length B32;
  117. CARD16 valueLen B16;
  118. CARD16 pad0 B16;
  119. CARD32 pad1 B32;
  120. CARD32 pad2 B32;
  121. CARD32 pad3 B32;
  122. CARD32 pad4 B32;
  123. CARD32 pad5 B32;
  124. } xVncExtGetParamReply;
  125. #define sz_xVncExtGetParamReply 32
  126. typedef struct {
  127. CARD8 reqType; /* always VncExtReqCode */
  128. CARD8 vncExtReqType; /* always VncExtGetParamDesc */
  129. CARD16 length B16;
  130. CARD8 paramLen;
  131. CARD8 pad0;
  132. CARD16 pad1 B16;
  133. } xVncExtGetParamDescReq;
  134. #define sz_xVncExtGetParamDescReq 8
  135. typedef struct {
  136. BYTE type; /* X_Reply */
  137. BYTE success;
  138. CARD16 sequenceNumber B16;
  139. CARD32 length B32;
  140. CARD16 descLen B16;
  141. CARD16 pad0 B16;
  142. CARD32 pad1 B32;
  143. CARD32 pad2 B32;
  144. CARD32 pad3 B32;
  145. CARD32 pad4 B32;
  146. CARD32 pad5 B32;
  147. } xVncExtGetParamDescReply;
  148. #define sz_xVncExtGetParamDescReply 32
  149. typedef struct {
  150. CARD8 reqType; /* always VncExtReqCode */
  151. CARD8 vncExtReqType; /* always VncExtListParams */
  152. CARD16 length B16;
  153. } xVncExtListParamsReq;
  154. #define sz_xVncExtListParamsReq 4
  155. typedef struct {
  156. BYTE type; /* X_Reply */
  157. BYTE pad0;
  158. CARD16 sequenceNumber B16;
  159. CARD32 length B32;
  160. CARD16 nParams B16;
  161. CARD16 pad1 B16;
  162. CARD32 pad2 B32;
  163. CARD32 pad3 B32;
  164. CARD32 pad4 B32;
  165. CARD32 pad5 B32;
  166. CARD32 pad6 B32;
  167. } xVncExtListParamsReply;
  168. #define sz_xVncExtListParamsReply 32
  169. typedef struct {
  170. CARD8 reqType; /* always VncExtReqCode */
  171. CARD8 vncExtReqType; /* always VncExtSetServerCutText */
  172. CARD16 length B16;
  173. CARD32 textLen B32;
  174. } xVncExtSetServerCutTextReq;
  175. #define sz_xVncExtSetServerCutTextReq 8
  176. typedef struct {
  177. CARD8 reqType; /* always VncExtReqCode */
  178. CARD8 vncExtReqType; /* always VncExtGetClientCutText */
  179. CARD16 length B16;
  180. } xVncExtGetClientCutTextReq;
  181. #define sz_xVncExtGetClientCutTextReq 4
  182. typedef struct {
  183. BYTE type; /* X_Reply */
  184. BYTE pad0;
  185. CARD16 sequenceNumber B16;
  186. CARD32 length B32;
  187. CARD32 textLen B32;
  188. CARD32 pad1 B32;
  189. CARD32 pad2 B32;
  190. CARD32 pad3 B32;
  191. CARD32 pad4 B32;
  192. CARD32 pad5 B32;
  193. } xVncExtGetClientCutTextReply;
  194. #define sz_xVncExtGetClientCutTextReply 32
  195. typedef struct {
  196. CARD8 reqType; /* always VncExtReqCode */
  197. CARD8 vncExtReqType; /* always VncExtSelectInput */
  198. CARD16 length B16;
  199. CARD32 window B32;
  200. CARD32 mask B32;
  201. } xVncExtSelectInputReq;
  202. #define sz_xVncExtSelectInputReq 12
  203. typedef struct {
  204. CARD8 reqType; /* always VncExtReqCode */
  205. CARD8 vncExtReqType; /* always VncExtConnect */
  206. CARD16 length B16;
  207. CARD8 strLen;
  208. CARD8 pad0;
  209. CARD16 pad1 B16;
  210. } xVncExtConnectReq;
  211. #define sz_xVncExtConnectReq 8
  212. typedef struct {
  213. BYTE type; /* X_Reply */
  214. BYTE success;
  215. CARD16 sequenceNumber B16;
  216. CARD32 length B32;
  217. CARD32 pad0 B32;
  218. CARD32 pad1 B32;
  219. CARD32 pad2 B32;
  220. CARD32 pad3 B32;
  221. CARD32 pad4 B32;
  222. CARD32 pad5 B32;
  223. } xVncExtConnectReply;
  224. #define sz_xVncExtConnectReply 32
  225. typedef struct {
  226. CARD8 reqType; /* always VncExtReqCode */
  227. CARD8 vncExtReqType; /* always VncExtGetQueryConnect */
  228. CARD16 length B16;
  229. } xVncExtGetQueryConnectReq;
  230. #define sz_xVncExtGetQueryConnectReq 4
  231. typedef struct {
  232. BYTE type; /* X_Reply */
  233. BYTE pad0;
  234. CARD16 sequenceNumber B16;
  235. CARD32 length B32;
  236. CARD32 addrLen B32;
  237. CARD32 userLen B32;
  238. CARD32 timeout B32;
  239. CARD32 opaqueId B32;
  240. CARD32 pad4 B32;
  241. CARD32 pad5 B32;
  242. } xVncExtGetQueryConnectReply;
  243. #define sz_xVncExtGetQueryConnectReply 32
  244. typedef struct {
  245. CARD8 reqType; /* always VncExtReqCode */
  246. CARD8 vncExtReqType; /* always VncExtApproveConnect */
  247. CARD16 length B16;
  248. CARD8 approve;
  249. CARD8 pad0;
  250. CARD16 pad1;
  251. CARD32 opaqueId B32;
  252. } xVncExtApproveConnectReq;
  253. #define sz_xVncExtApproveConnectReq 12
  254. typedef struct {
  255. BYTE type; /* always eventBase + VncExtClientCutTextNotify */
  256. BYTE pad0;
  257. CARD16 sequenceNumber B16;
  258. CARD32 window B32;
  259. CARD32 time B32;
  260. CARD32 pad1 B32;
  261. CARD32 pad2 B32;
  262. CARD32 pad3 B32;
  263. CARD32 pad4 B32;
  264. CARD32 pad5 B32;
  265. } xVncExtClientCutTextNotifyEvent;
  266. #define sz_xVncExtClientCutTextNotifyEvent 32
  267. typedef struct {
  268. BYTE type; /* always eventBase + VncExtSelectionChangeNotify */
  269. BYTE pad0;
  270. CARD16 sequenceNumber B16;
  271. CARD32 window B32;
  272. CARD32 selection B32;
  273. CARD32 pad1 B32;
  274. CARD32 pad2 B32;
  275. CARD32 pad3 B32;
  276. CARD32 pad4 B32;
  277. CARD32 pad5 B32;
  278. } xVncExtSelectionChangeNotifyEvent;
  279. #define sz_xVncExtSelectionChangeNotifyEvent 32
  280. typedef struct {
  281. BYTE type; /* always eventBase + VncExtQueryConnectNotify */
  282. BYTE pad0;
  283. CARD16 sequenceNumber B16;
  284. CARD32 window B32;
  285. CARD32 pad6 B32;
  286. CARD32 pad1 B32;
  287. CARD32 pad2 B32;
  288. CARD32 pad3 B32;
  289. CARD32 pad4 B32;
  290. CARD32 pad5 B32;
  291. } xVncExtQueryConnectNotifyEvent;
  292. #define sz_xVncExtQueryConnectNotifyEvent 32
  293. #endif
  294. #ifdef __cplusplus
  295. }
  296. #endif
  297. #endif