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 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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_VncExtSelectInput 6
  28. #define X_VncExtConnect 7
  29. #define X_VncExtGetQueryConnect 8
  30. #define X_VncExtApproveConnect 9
  31. #define VncExtQueryConnectNotify 2
  32. #define VncExtQueryConnectMask (1 << VncExtQueryConnectNotify)
  33. #define VncExtNumberEvents 3
  34. #define VncExtNumberErrors 0
  35. #ifndef _VNCEXT_SERVER_
  36. Bool XVncExtQueryExtension(Display* dpy, int* event_basep, int* error_basep);
  37. Bool XVncExtSetParam(Display* dpy, const char* param);
  38. Bool XVncExtGetParam(Display* dpy, const char* param, char** value, int* len);
  39. char* XVncExtGetParamDesc(Display* dpy, const char* param);
  40. char** XVncExtListParams(Display* dpy, int* nParams);
  41. void XVncExtFreeParamList(char** list);
  42. Bool XVncExtSelectInput(Display* dpy, Window w, int mask);
  43. Bool XVncExtConnect(Display* dpy, const char* hostAndPort, Bool viewOnly);
  44. Bool XVncExtGetQueryConnect(Display* dpy, char** addr,
  45. char** user, int* timeout, void** opaqueId);
  46. Bool XVncExtApproveConnect(Display* dpy, void* opaqueId, int approve);
  47. typedef struct {
  48. int type;
  49. unsigned long serial;
  50. Bool send_event;
  51. Display *display;
  52. Window window;
  53. } XVncExtQueryConnectEvent;
  54. #endif
  55. #ifdef _VNCEXT_PROTO_
  56. #define VNCEXTNAME "VNC-EXTENSION"
  57. typedef struct {
  58. CARD8 reqType; /* always VncExtReqCode */
  59. CARD8 vncExtReqType; /* always VncExtSetParam */
  60. CARD16 length B16;
  61. CARD8 paramLen;
  62. CARD8 pad0;
  63. CARD16 pad1 B16;
  64. } xVncExtSetParamReq;
  65. #define sz_xVncExtSetParamReq 8
  66. typedef struct {
  67. BYTE type; /* X_Reply */
  68. BYTE success;
  69. CARD16 sequenceNumber B16;
  70. CARD32 length B32;
  71. CARD32 pad0 B32;
  72. CARD32 pad1 B32;
  73. CARD32 pad2 B32;
  74. CARD32 pad3 B32;
  75. CARD32 pad4 B32;
  76. CARD32 pad5 B32;
  77. } xVncExtSetParamReply;
  78. #define sz_xVncExtSetParamReply 32
  79. typedef struct {
  80. CARD8 reqType; /* always VncExtReqCode */
  81. CARD8 vncExtReqType; /* always VncExtGetParam */
  82. CARD16 length B16;
  83. CARD8 paramLen;
  84. CARD8 pad0;
  85. CARD16 pad1 B16;
  86. } xVncExtGetParamReq;
  87. #define sz_xVncExtGetParamReq 8
  88. typedef struct {
  89. BYTE type; /* X_Reply */
  90. BYTE success;
  91. CARD16 sequenceNumber B16;
  92. CARD32 length B32;
  93. CARD16 valueLen B16;
  94. CARD16 pad0 B16;
  95. CARD32 pad1 B32;
  96. CARD32 pad2 B32;
  97. CARD32 pad3 B32;
  98. CARD32 pad4 B32;
  99. CARD32 pad5 B32;
  100. } xVncExtGetParamReply;
  101. #define sz_xVncExtGetParamReply 32
  102. typedef struct {
  103. CARD8 reqType; /* always VncExtReqCode */
  104. CARD8 vncExtReqType; /* always VncExtGetParamDesc */
  105. CARD16 length B16;
  106. CARD8 paramLen;
  107. CARD8 pad0;
  108. CARD16 pad1 B16;
  109. } xVncExtGetParamDescReq;
  110. #define sz_xVncExtGetParamDescReq 8
  111. typedef struct {
  112. BYTE type; /* X_Reply */
  113. BYTE success;
  114. CARD16 sequenceNumber B16;
  115. CARD32 length B32;
  116. CARD16 descLen B16;
  117. CARD16 pad0 B16;
  118. CARD32 pad1 B32;
  119. CARD32 pad2 B32;
  120. CARD32 pad3 B32;
  121. CARD32 pad4 B32;
  122. CARD32 pad5 B32;
  123. } xVncExtGetParamDescReply;
  124. #define sz_xVncExtGetParamDescReply 32
  125. typedef struct {
  126. CARD8 reqType; /* always VncExtReqCode */
  127. CARD8 vncExtReqType; /* always VncExtListParams */
  128. CARD16 length B16;
  129. } xVncExtListParamsReq;
  130. #define sz_xVncExtListParamsReq 4
  131. typedef struct {
  132. BYTE type; /* X_Reply */
  133. BYTE pad0;
  134. CARD16 sequenceNumber B16;
  135. CARD32 length B32;
  136. CARD16 nParams B16;
  137. CARD16 pad1 B16;
  138. CARD32 pad2 B32;
  139. CARD32 pad3 B32;
  140. CARD32 pad4 B32;
  141. CARD32 pad5 B32;
  142. CARD32 pad6 B32;
  143. } xVncExtListParamsReply;
  144. #define sz_xVncExtListParamsReply 32
  145. typedef struct {
  146. CARD8 reqType; /* always VncExtReqCode */
  147. CARD8 vncExtReqType; /* always VncExtSelectInput */
  148. CARD16 length B16;
  149. CARD32 window B32;
  150. CARD32 mask B32;
  151. } xVncExtSelectInputReq;
  152. #define sz_xVncExtSelectInputReq 12
  153. typedef struct {
  154. CARD8 reqType; /* always VncExtReqCode */
  155. CARD8 vncExtReqType; /* always VncExtConnect */
  156. CARD16 length B16;
  157. CARD8 strLen;
  158. CARD8 viewOnly;
  159. CARD16 pad1 B16;
  160. } xVncExtConnectReq;
  161. #define sz_xVncExtConnectReq 8
  162. typedef struct {
  163. BYTE type; /* X_Reply */
  164. BYTE success;
  165. CARD16 sequenceNumber B16;
  166. CARD32 length B32;
  167. CARD32 pad0 B32;
  168. CARD32 pad1 B32;
  169. CARD32 pad2 B32;
  170. CARD32 pad3 B32;
  171. CARD32 pad4 B32;
  172. CARD32 pad5 B32;
  173. } xVncExtConnectReply;
  174. #define sz_xVncExtConnectReply 32
  175. typedef struct {
  176. CARD8 reqType; /* always VncExtReqCode */
  177. CARD8 vncExtReqType; /* always VncExtGetQueryConnect */
  178. CARD16 length B16;
  179. } xVncExtGetQueryConnectReq;
  180. #define sz_xVncExtGetQueryConnectReq 4
  181. typedef struct {
  182. BYTE type; /* X_Reply */
  183. BYTE pad0;
  184. CARD16 sequenceNumber B16;
  185. CARD32 length B32;
  186. CARD32 addrLen B32;
  187. CARD32 userLen B32;
  188. CARD32 timeout B32;
  189. CARD32 opaqueId B32;
  190. CARD32 pad4 B32;
  191. CARD32 pad5 B32;
  192. } xVncExtGetQueryConnectReply;
  193. #define sz_xVncExtGetQueryConnectReply 32
  194. typedef struct {
  195. CARD8 reqType; /* always VncExtReqCode */
  196. CARD8 vncExtReqType; /* always VncExtApproveConnect */
  197. CARD16 length B16;
  198. CARD8 approve;
  199. CARD8 pad0;
  200. CARD16 pad1;
  201. CARD32 opaqueId B32;
  202. } xVncExtApproveConnectReq;
  203. #define sz_xVncExtApproveConnectReq 12
  204. typedef struct {
  205. BYTE type; /* always eventBase + VncExtQueryConnectNotify */
  206. BYTE pad0;
  207. CARD16 sequenceNumber B16;
  208. CARD32 window B32;
  209. CARD32 pad6 B32;
  210. CARD32 pad1 B32;
  211. CARD32 pad2 B32;
  212. CARD32 pad3 B32;
  213. CARD32 pad4 B32;
  214. CARD32 pad5 B32;
  215. } xVncExtQueryConnectNotifyEvent;
  216. #define sz_xVncExtQueryConnectNotifyEvent 32
  217. #endif
  218. #ifdef __cplusplus
  219. }
  220. #endif
  221. #endif