Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame^] | 1 | /* Copyright (C) 2002-2003 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 |
| 29 | #define X_VncExtSetServerCutText 4 |
| 30 | #define X_VncExtGetClientCutText 5 |
| 31 | #define X_VncExtSelectInput 6 |
| 32 | #define X_VncExtConnect 7 |
| 33 | |
| 34 | #define VncExtClientCutTextNotify 0 |
| 35 | #define VncExtSelectionChangeNotify 1 |
| 36 | #define VncExtClientCutTextMask (1 << VncExtClientCutTextNotify) |
| 37 | #define VncExtSelectionChangeMask (1 << VncExtSelectionChangeNotify) |
| 38 | |
| 39 | #define VncExtNumberEvents 2 |
| 40 | #define VncExtNumberErrors 0 |
| 41 | |
| 42 | #ifndef _VNCEXT_SERVER_ |
| 43 | |
| 44 | Bool XVncExtQueryExtension(Display* dpy, int* event_basep, int* error_basep); |
| 45 | Bool XVncExtSetParam(Display* dpy, const char* param); |
| 46 | Bool XVncExtGetParam(Display* dpy, const char* param, char** value, int* len); |
| 47 | char* XVncExtGetParamDesc(Display* dpy, const char* param); |
| 48 | char** XVncExtListParams(Display* dpy, int* nParams); |
| 49 | void XVncExtFreeParamList(char** list); |
| 50 | Bool XVncExtSetServerCutText(Display* dpy, const char* str, int len); |
| 51 | Bool XVncExtGetClientCutText(Display* dpy, char** str, int* len); |
| 52 | Bool XVncExtSelectInput(Display* dpy, Window w, int mask); |
| 53 | Bool XVncExtConnect(Display* dpy, char* hostAndPort); |
| 54 | |
| 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 | |
| 64 | typedef struct { |
| 65 | int type; |
| 66 | unsigned long serial; |
| 67 | Bool send_event; |
| 68 | Display *display; |
| 69 | Window window; |
| 70 | Atom selection; |
| 71 | } XVncExtSelectionChangeEvent; |
| 72 | |
| 73 | #endif |
| 74 | |
| 75 | #ifdef _VNCEXT_PROTO_ |
| 76 | |
| 77 | #define VNCEXTNAME "VNC-EXTENSION" |
| 78 | |
| 79 | typedef struct { |
| 80 | CARD8 reqType; /* always VncExtReqCode */ |
| 81 | CARD8 vncExtReqType; /* always VncExtSetParam */ |
| 82 | CARD16 length B16; |
| 83 | CARD8 paramLen; |
| 84 | CARD8 pad0; |
| 85 | CARD16 pad1 B16; |
| 86 | } xVncExtSetParamReq; |
| 87 | #define sz_xVncExtSetParamReq 8 |
| 88 | |
| 89 | typedef struct { |
| 90 | BYTE type; /* X_Reply */ |
| 91 | BYTE success; |
| 92 | CARD16 sequenceNumber B16; |
| 93 | CARD32 length B32; |
| 94 | CARD32 pad0 B32; |
| 95 | CARD32 pad1 B32; |
| 96 | CARD32 pad2 B32; |
| 97 | CARD32 pad3 B32; |
| 98 | CARD32 pad4 B32; |
| 99 | CARD32 pad5 B32; |
| 100 | } xVncExtSetParamReply; |
| 101 | #define sz_xVncExtSetParamReply 32 |
| 102 | |
| 103 | |
| 104 | typedef struct { |
| 105 | CARD8 reqType; /* always VncExtReqCode */ |
| 106 | CARD8 vncExtReqType; /* always VncExtGetParam */ |
| 107 | CARD16 length B16; |
| 108 | CARD8 paramLen; |
| 109 | CARD8 pad0; |
| 110 | CARD16 pad1 B16; |
| 111 | } xVncExtGetParamReq; |
| 112 | #define sz_xVncExtGetParamReq 8 |
| 113 | |
| 114 | typedef struct { |
| 115 | BYTE type; /* X_Reply */ |
| 116 | BYTE success; |
| 117 | CARD16 sequenceNumber B16; |
| 118 | CARD32 length B32; |
| 119 | CARD16 valueLen B16; |
| 120 | CARD16 pad0 B16; |
| 121 | CARD32 pad1 B32; |
| 122 | CARD32 pad2 B32; |
| 123 | CARD32 pad3 B32; |
| 124 | CARD32 pad4 B32; |
| 125 | CARD32 pad5 B32; |
| 126 | } xVncExtGetParamReply; |
| 127 | #define sz_xVncExtGetParamReply 32 |
| 128 | |
| 129 | |
| 130 | typedef struct { |
| 131 | CARD8 reqType; /* always VncExtReqCode */ |
| 132 | CARD8 vncExtReqType; /* always VncExtGetParamDesc */ |
| 133 | CARD16 length B16; |
| 134 | CARD8 paramLen; |
| 135 | CARD8 pad0; |
| 136 | CARD16 pad1 B16; |
| 137 | } xVncExtGetParamDescReq; |
| 138 | #define sz_xVncExtGetParamDescReq 8 |
| 139 | |
| 140 | typedef struct { |
| 141 | BYTE type; /* X_Reply */ |
| 142 | BYTE success; |
| 143 | CARD16 sequenceNumber B16; |
| 144 | CARD32 length B32; |
| 145 | CARD16 descLen B16; |
| 146 | CARD16 pad0 B16; |
| 147 | CARD32 pad1 B32; |
| 148 | CARD32 pad2 B32; |
| 149 | CARD32 pad3 B32; |
| 150 | CARD32 pad4 B32; |
| 151 | CARD32 pad5 B32; |
| 152 | } xVncExtGetParamDescReply; |
| 153 | #define sz_xVncExtGetParamDescReply 32 |
| 154 | |
| 155 | |
| 156 | typedef struct { |
| 157 | CARD8 reqType; /* always VncExtReqCode */ |
| 158 | CARD8 vncExtReqType; /* always VncExtListParams */ |
| 159 | CARD16 length B16; |
| 160 | } xVncExtListParamsReq; |
| 161 | #define sz_xVncExtListParamsReq 4 |
| 162 | |
| 163 | typedef struct { |
| 164 | BYTE type; /* X_Reply */ |
| 165 | BYTE pad0; |
| 166 | CARD16 sequenceNumber B16; |
| 167 | CARD32 length B32; |
| 168 | CARD16 nParams B16; |
| 169 | CARD16 pad1 B16; |
| 170 | CARD32 pad2 B32; |
| 171 | CARD32 pad3 B32; |
| 172 | CARD32 pad4 B32; |
| 173 | CARD32 pad5 B32; |
| 174 | CARD32 pad6 B32; |
| 175 | } xVncExtListParamsReply; |
| 176 | #define sz_xVncExtListParamsReply 32 |
| 177 | |
| 178 | |
| 179 | typedef struct { |
| 180 | CARD8 reqType; /* always VncExtReqCode */ |
| 181 | CARD8 vncExtReqType; /* always VncExtSetServerCutText */ |
| 182 | CARD16 length B16; |
| 183 | CARD32 textLen B32; |
| 184 | } xVncExtSetServerCutTextReq; |
| 185 | #define sz_xVncExtSetServerCutTextReq 8 |
| 186 | |
| 187 | |
| 188 | typedef struct { |
| 189 | CARD8 reqType; /* always VncExtReqCode */ |
| 190 | CARD8 vncExtReqType; /* always VncExtGetClientCutText */ |
| 191 | CARD16 length B16; |
| 192 | } xVncExtGetClientCutTextReq; |
| 193 | #define sz_xVncExtGetClientCutTextReq 4 |
| 194 | |
| 195 | typedef struct { |
| 196 | BYTE type; /* X_Reply */ |
| 197 | BYTE pad0; |
| 198 | CARD16 sequenceNumber B16; |
| 199 | CARD32 length B32; |
| 200 | CARD32 textLen B32; |
| 201 | CARD32 pad1 B32; |
| 202 | CARD32 pad2 B32; |
| 203 | CARD32 pad3 B32; |
| 204 | CARD32 pad4 B32; |
| 205 | CARD32 pad5 B32; |
| 206 | } xVncExtGetClientCutTextReply; |
| 207 | #define sz_xVncExtGetClientCutTextReply 32 |
| 208 | |
| 209 | |
| 210 | typedef struct { |
| 211 | CARD8 reqType; /* always VncExtReqCode */ |
| 212 | CARD8 vncExtReqType; /* always VncExtSelectInput */ |
| 213 | CARD16 length B16; |
| 214 | CARD32 window B32; |
| 215 | CARD32 mask B32; |
| 216 | } xVncExtSelectInputReq; |
| 217 | #define sz_xVncExtSelectInputReq 12 |
| 218 | |
| 219 | |
| 220 | typedef struct { |
| 221 | CARD8 reqType; /* always VncExtReqCode */ |
| 222 | CARD8 vncExtReqType; /* always VncExtConnect */ |
| 223 | CARD16 length B16; |
| 224 | CARD8 strLen; |
| 225 | CARD8 pad0; |
| 226 | CARD16 pad1 B16; |
| 227 | } xVncExtConnectReq; |
| 228 | #define sz_xVncExtConnectReq 8 |
| 229 | |
| 230 | typedef struct { |
| 231 | BYTE type; /* X_Reply */ |
| 232 | BYTE success; |
| 233 | CARD16 sequenceNumber B16; |
| 234 | CARD32 length B32; |
| 235 | CARD32 pad0 B32; |
| 236 | CARD32 pad1 B32; |
| 237 | CARD32 pad2 B32; |
| 238 | CARD32 pad3 B32; |
| 239 | CARD32 pad4 B32; |
| 240 | CARD32 pad5 B32; |
| 241 | } xVncExtConnectReply; |
| 242 | #define sz_xVncExtConnectReply 32 |
| 243 | |
| 244 | |
| 245 | typedef struct { |
| 246 | BYTE type; /* always eventBase + VncExtClientCutTextNotify */ |
| 247 | BYTE pad0; |
| 248 | CARD16 sequenceNumber B16; |
| 249 | CARD32 window B32; |
| 250 | CARD32 time B32; |
| 251 | CARD32 pad1 B32; |
| 252 | CARD32 pad2 B32; |
| 253 | CARD32 pad3 B32; |
| 254 | CARD32 pad4 B32; |
| 255 | CARD32 pad5 B32; |
| 256 | } xVncExtClientCutTextNotifyEvent; |
| 257 | #define sz_xVncExtClientCutTextNotifyEvent 32 |
| 258 | |
| 259 | typedef struct { |
| 260 | BYTE type; /* always eventBase + VncExtSelectionChangeNotify */ |
| 261 | BYTE pad0; |
| 262 | CARD16 sequenceNumber B16; |
| 263 | CARD32 window B32; |
| 264 | CARD32 selection B32; |
| 265 | CARD32 pad1 B32; |
| 266 | CARD32 pad2 B32; |
| 267 | CARD32 pad3 B32; |
| 268 | CARD32 pad4 B32; |
| 269 | CARD32 pad5 B32; |
| 270 | } xVncExtSelectionChangeNotifyEvent; |
| 271 | #define sz_xVncExtSelectionChangeNotifyEvent 32 |
| 272 | |
| 273 | #endif |
| 274 | |
| 275 | #ifdef __cplusplus |
| 276 | } |
| 277 | #endif |
| 278 | |
| 279 | #endif |