Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 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 | |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
| 25 | #define X_VncExtSetParam 0 |
| 26 | #define X_VncExtGetParam 1 |
| 27 | #define X_VncExtGetParamDesc 2 |
| 28 | #define X_VncExtListParams 3 |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 29 | #define X_VncExtSelectInput 6 |
| 30 | #define X_VncExtConnect 7 |
| 31 | #define X_VncExtGetQueryConnect 8 |
| 32 | #define X_VncExtApproveConnect 9 |
| 33 | |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 34 | #define VncExtQueryConnectNotify 2 |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 35 | #define VncExtQueryConnectMask (1 << VncExtQueryConnectNotify) |
| 36 | |
| 37 | #define VncExtNumberEvents 3 |
| 38 | #define VncExtNumberErrors 0 |
| 39 | |
| 40 | #ifndef _VNCEXT_SERVER_ |
| 41 | |
| 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); |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 48 | Bool XVncExtSelectInput(Display* dpy, Window w, int mask); |
Pierre Ossman | 8f30811 | 2015-03-03 16:45:02 +0100 | [diff] [blame] | 49 | Bool XVncExtConnect(Display* dpy, const char* hostAndPort); |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 50 | Bool XVncExtGetQueryConnect(Display* dpy, char** addr, |
| 51 | char** user, int* timeout, void** opaqueId); |
| 52 | Bool XVncExtApproveConnect(Display* dpy, void* opaqueId, int approve); |
| 53 | |
| 54 | |
| 55 | typedef struct { |
| 56 | int type; |
| 57 | unsigned long serial; |
| 58 | Bool send_event; |
| 59 | Display *display; |
| 60 | Window window; |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 61 | } XVncExtQueryConnectEvent; |
| 62 | |
| 63 | #endif |
| 64 | |
| 65 | #ifdef _VNCEXT_PROTO_ |
| 66 | |
| 67 | #define VNCEXTNAME "VNC-EXTENSION" |
| 68 | |
| 69 | typedef struct { |
| 70 | CARD8 reqType; /* always VncExtReqCode */ |
| 71 | CARD8 vncExtReqType; /* always VncExtSetParam */ |
| 72 | CARD16 length B16; |
| 73 | CARD8 paramLen; |
| 74 | CARD8 pad0; |
| 75 | CARD16 pad1 B16; |
| 76 | } xVncExtSetParamReq; |
| 77 | #define sz_xVncExtSetParamReq 8 |
| 78 | |
| 79 | typedef struct { |
| 80 | BYTE type; /* X_Reply */ |
| 81 | BYTE success; |
| 82 | CARD16 sequenceNumber B16; |
| 83 | CARD32 length B32; |
| 84 | CARD32 pad0 B32; |
| 85 | CARD32 pad1 B32; |
| 86 | CARD32 pad2 B32; |
| 87 | CARD32 pad3 B32; |
| 88 | CARD32 pad4 B32; |
| 89 | CARD32 pad5 B32; |
| 90 | } xVncExtSetParamReply; |
| 91 | #define sz_xVncExtSetParamReply 32 |
| 92 | |
| 93 | |
| 94 | typedef struct { |
| 95 | CARD8 reqType; /* always VncExtReqCode */ |
| 96 | CARD8 vncExtReqType; /* always VncExtGetParam */ |
| 97 | CARD16 length B16; |
| 98 | CARD8 paramLen; |
| 99 | CARD8 pad0; |
| 100 | CARD16 pad1 B16; |
| 101 | } xVncExtGetParamReq; |
| 102 | #define sz_xVncExtGetParamReq 8 |
| 103 | |
| 104 | typedef struct { |
| 105 | BYTE type; /* X_Reply */ |
| 106 | BYTE success; |
| 107 | CARD16 sequenceNumber B16; |
| 108 | CARD32 length B32; |
| 109 | CARD16 valueLen B16; |
| 110 | CARD16 pad0 B16; |
| 111 | CARD32 pad1 B32; |
| 112 | CARD32 pad2 B32; |
| 113 | CARD32 pad3 B32; |
| 114 | CARD32 pad4 B32; |
| 115 | CARD32 pad5 B32; |
| 116 | } xVncExtGetParamReply; |
| 117 | #define sz_xVncExtGetParamReply 32 |
| 118 | |
| 119 | |
| 120 | typedef struct { |
| 121 | CARD8 reqType; /* always VncExtReqCode */ |
| 122 | CARD8 vncExtReqType; /* always VncExtGetParamDesc */ |
| 123 | CARD16 length B16; |
| 124 | CARD8 paramLen; |
| 125 | CARD8 pad0; |
| 126 | CARD16 pad1 B16; |
| 127 | } xVncExtGetParamDescReq; |
| 128 | #define sz_xVncExtGetParamDescReq 8 |
| 129 | |
| 130 | typedef struct { |
| 131 | BYTE type; /* X_Reply */ |
| 132 | BYTE success; |
| 133 | CARD16 sequenceNumber B16; |
| 134 | CARD32 length B32; |
| 135 | CARD16 descLen B16; |
| 136 | CARD16 pad0 B16; |
| 137 | CARD32 pad1 B32; |
| 138 | CARD32 pad2 B32; |
| 139 | CARD32 pad3 B32; |
| 140 | CARD32 pad4 B32; |
| 141 | CARD32 pad5 B32; |
| 142 | } xVncExtGetParamDescReply; |
| 143 | #define sz_xVncExtGetParamDescReply 32 |
| 144 | |
| 145 | |
| 146 | typedef struct { |
| 147 | CARD8 reqType; /* always VncExtReqCode */ |
| 148 | CARD8 vncExtReqType; /* always VncExtListParams */ |
| 149 | CARD16 length B16; |
| 150 | } xVncExtListParamsReq; |
| 151 | #define sz_xVncExtListParamsReq 4 |
| 152 | |
| 153 | typedef struct { |
| 154 | BYTE type; /* X_Reply */ |
| 155 | BYTE pad0; |
| 156 | CARD16 sequenceNumber B16; |
| 157 | CARD32 length B32; |
| 158 | CARD16 nParams B16; |
| 159 | CARD16 pad1 B16; |
| 160 | CARD32 pad2 B32; |
| 161 | CARD32 pad3 B32; |
| 162 | CARD32 pad4 B32; |
| 163 | CARD32 pad5 B32; |
| 164 | CARD32 pad6 B32; |
| 165 | } xVncExtListParamsReply; |
| 166 | #define sz_xVncExtListParamsReply 32 |
| 167 | |
| 168 | |
| 169 | typedef struct { |
| 170 | CARD8 reqType; /* always VncExtReqCode */ |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 171 | CARD8 vncExtReqType; /* always VncExtSelectInput */ |
| 172 | CARD16 length B16; |
| 173 | CARD32 window B32; |
| 174 | CARD32 mask B32; |
| 175 | } xVncExtSelectInputReq; |
| 176 | #define sz_xVncExtSelectInputReq 12 |
| 177 | |
| 178 | |
| 179 | typedef struct { |
| 180 | CARD8 reqType; /* always VncExtReqCode */ |
| 181 | CARD8 vncExtReqType; /* always VncExtConnect */ |
| 182 | CARD16 length B16; |
| 183 | CARD8 strLen; |
| 184 | CARD8 pad0; |
| 185 | CARD16 pad1 B16; |
| 186 | } xVncExtConnectReq; |
| 187 | #define sz_xVncExtConnectReq 8 |
| 188 | |
| 189 | typedef struct { |
| 190 | BYTE type; /* X_Reply */ |
| 191 | BYTE success; |
| 192 | CARD16 sequenceNumber B16; |
| 193 | CARD32 length B32; |
| 194 | CARD32 pad0 B32; |
| 195 | CARD32 pad1 B32; |
| 196 | CARD32 pad2 B32; |
| 197 | CARD32 pad3 B32; |
| 198 | CARD32 pad4 B32; |
| 199 | CARD32 pad5 B32; |
| 200 | } xVncExtConnectReply; |
| 201 | #define sz_xVncExtConnectReply 32 |
| 202 | |
| 203 | |
| 204 | typedef struct { |
| 205 | CARD8 reqType; /* always VncExtReqCode */ |
| 206 | CARD8 vncExtReqType; /* always VncExtGetQueryConnect */ |
| 207 | CARD16 length B16; |
| 208 | } xVncExtGetQueryConnectReq; |
| 209 | #define sz_xVncExtGetQueryConnectReq 4 |
| 210 | |
| 211 | typedef struct { |
| 212 | BYTE type; /* X_Reply */ |
| 213 | BYTE pad0; |
| 214 | CARD16 sequenceNumber B16; |
| 215 | CARD32 length B32; |
| 216 | CARD32 addrLen B32; |
| 217 | CARD32 userLen B32; |
| 218 | CARD32 timeout B32; |
| 219 | CARD32 opaqueId B32; |
| 220 | CARD32 pad4 B32; |
| 221 | CARD32 pad5 B32; |
| 222 | } xVncExtGetQueryConnectReply; |
| 223 | #define sz_xVncExtGetQueryConnectReply 32 |
| 224 | |
| 225 | typedef struct { |
| 226 | CARD8 reqType; /* always VncExtReqCode */ |
| 227 | CARD8 vncExtReqType; /* always VncExtApproveConnect */ |
| 228 | CARD16 length B16; |
| 229 | CARD8 approve; |
| 230 | CARD8 pad0; |
| 231 | CARD16 pad1; |
| 232 | CARD32 opaqueId B32; |
| 233 | } xVncExtApproveConnectReq; |
| 234 | #define sz_xVncExtApproveConnectReq 12 |
| 235 | |
| 236 | |
| 237 | |
| 238 | typedef struct { |
Constantin Kaplinsky | b30ae7f | 2006-05-25 05:04:46 +0000 | [diff] [blame] | 239 | BYTE type; /* always eventBase + VncExtQueryConnectNotify */ |
| 240 | BYTE pad0; |
| 241 | CARD16 sequenceNumber B16; |
| 242 | CARD32 window B32; |
| 243 | CARD32 pad6 B32; |
| 244 | CARD32 pad1 B32; |
| 245 | CARD32 pad2 B32; |
| 246 | CARD32 pad3 B32; |
| 247 | CARD32 pad4 B32; |
| 248 | CARD32 pad5 B32; |
| 249 | } xVncExtQueryConnectNotifyEvent; |
| 250 | #define sz_xVncExtQueryConnectNotifyEvent 32 |
| 251 | |
| 252 | #endif |
| 253 | |
| 254 | #ifdef __cplusplus |
| 255 | } |
| 256 | #endif |
| 257 | |
| 258 | #endif |