LibVNCServer/LibVNCClient
SDLvncviewer.c
Go to the documentation of this file.
1
6#include <SDL.h>
7#include <signal.h>
8#include <rfb/rfbclient.h>
9
10struct { int sdl; int rfb; } buttonMapping[]={
11 {1, rfbButton1Mask},
12 {2, rfbButton2Mask},
13 {3, rfbButton3Mask},
14 {4, rfbButton4Mask},
15 {5, rfbButton5Mask},
16 {0,0}
17};
18
19struct { char mask; int bits_stored; } utf8Mapping[]= {
20 {0b00111111, 6},
21 {0b01111111, 7},
22 {0b00011111, 5},
23 {0b00001111, 4},
24 {0b00000111, 3},
25 {0,0}
26};
27
28static int enableResizable = 1, viewOnly, listenLoop, buttonMask;
30SDL_Texture *sdlTexture;
31SDL_Renderer *sdlRenderer;
32SDL_Window *sdlWindow;
33/* client's pointer position */
34int x,y;
35
36static int rightAltKeyDown, leftAltKeyDown;
37
38static rfbBool resize(rfbClient* client) {
41
42 if (enableResizable)
43 sdlFlags |= SDL_WINDOW_RESIZABLE;
44
45 /* (re)create the surface used as the client's framebuffer */
46 SDL_FreeSurface(rfbClientGetClientData(client, SDL_Init));
47 SDL_Surface* sdl=SDL_CreateRGBSurface(0,
48 width,
49 height,
50 depth,
51 0,0,0,0);
52 if(!sdl)
53 rfbClientErr("resize: error creating surface: %s\n", SDL_GetError());
54
56 client->width = sdl->pitch / (depth / 8);
57 client->frameBuffer=sdl->pixels;
58
60 client->format.redShift=sdl->format->Rshift;
61 client->format.greenShift=sdl->format->Gshift;
62 client->format.blueShift=sdl->format->Bshift;
63 client->format.redMax=sdl->format->Rmask>>client->format.redShift;
65 client->format.blueMax=sdl->format->Bmask>>client->format.blueShift;
67
68 /* create or resize the window */
69 if(!sdlWindow) {
70 sdlWindow = SDL_CreateWindow(client->desktopName,
71 SDL_WINDOWPOS_UNDEFINED,
72 SDL_WINDOWPOS_UNDEFINED,
73 width,
74 height,
75 sdlFlags);
76 if(!sdlWindow)
77 rfbClientErr("resize: error creating window: %s\n", SDL_GetError());
78 } else {
79 SDL_SetWindowSize(sdlWindow, width, height);
80 }
81
82 /* create the renderer if it does not already exist */
83 if(!sdlRenderer) {
84 sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, 0);
85 if(!sdlRenderer)
86 rfbClientErr("resize: error creating renderer: %s\n", SDL_GetError());
87 SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); /* make the scaled rendering look smoother. */
88 }
89 SDL_RenderSetLogicalSize(sdlRenderer, width, height); /* this is a departure from the SDL1.2-based version, but more in the sense of a VNC viewer in keeeping aspect ratio */
90
91 /* (re)create the texture that sits in between the surface->pixels and the renderer */
92 if(sdlTexture)
93 SDL_DestroyTexture(sdlTexture);
94 sdlTexture = SDL_CreateTexture(sdlRenderer,
95 SDL_PIXELFORMAT_ARGB8888,
96 SDL_TEXTUREACCESS_STREAMING,
97 width, height);
98 if(!sdlTexture)
99 rfbClientErr("resize: error creating texture: %s\n", SDL_GetError());
100 return TRUE;
101}
102
103static rfbKeySym SDL_key2rfbKeySym(SDL_KeyboardEvent* e) {
104 rfbKeySym k = 0;
105 SDL_Keycode sym = e->keysym.sym;
106
107 switch (sym) {
108 case SDLK_BACKSPACE: k = XK_BackSpace; break;
109 case SDLK_TAB: k = XK_Tab; break;
110 case SDLK_CLEAR: k = XK_Clear; break;
111 case SDLK_RETURN: k = XK_Return; break;
112 case SDLK_PAUSE: k = XK_Pause; break;
113 case SDLK_ESCAPE: k = XK_Escape; break;
114 case SDLK_DELETE: k = XK_Delete; break;
115 case SDLK_KP_0: k = XK_KP_0; break;
116 case SDLK_KP_1: k = XK_KP_1; break;
117 case SDLK_KP_2: k = XK_KP_2; break;
118 case SDLK_KP_3: k = XK_KP_3; break;
119 case SDLK_KP_4: k = XK_KP_4; break;
120 case SDLK_KP_5: k = XK_KP_5; break;
121 case SDLK_KP_6: k = XK_KP_6; break;
122 case SDLK_KP_7: k = XK_KP_7; break;
123 case SDLK_KP_8: k = XK_KP_8; break;
124 case SDLK_KP_9: k = XK_KP_9; break;
125 case SDLK_KP_PERIOD: k = XK_KP_Decimal; break;
126 case SDLK_KP_DIVIDE: k = XK_KP_Divide; break;
127 case SDLK_KP_MULTIPLY: k = XK_KP_Multiply; break;
128 case SDLK_KP_MINUS: k = XK_KP_Subtract; break;
129 case SDLK_KP_PLUS: k = XK_KP_Add; break;
130 case SDLK_KP_ENTER: k = XK_KP_Enter; break;
131 case SDLK_KP_EQUALS: k = XK_KP_Equal; break;
132 case SDLK_UP: k = XK_Up; break;
133 case SDLK_DOWN: k = XK_Down; break;
134 case SDLK_RIGHT: k = XK_Right; break;
135 case SDLK_LEFT: k = XK_Left; break;
136 case SDLK_INSERT: k = XK_Insert; break;
137 case SDLK_HOME: k = XK_Home; break;
138 case SDLK_END: k = XK_End; break;
139 case SDLK_PAGEUP: k = XK_Page_Up; break;
140 case SDLK_PAGEDOWN: k = XK_Page_Down; break;
141 case SDLK_F1: k = XK_F1; break;
142 case SDLK_F2: k = XK_F2; break;
143 case SDLK_F3: k = XK_F3; break;
144 case SDLK_F4: k = XK_F4; break;
145 case SDLK_F5: k = XK_F5; break;
146 case SDLK_F6: k = XK_F6; break;
147 case SDLK_F7: k = XK_F7; break;
148 case SDLK_F8: k = XK_F8; break;
149 case SDLK_F9: k = XK_F9; break;
150 case SDLK_F10: k = XK_F10; break;
151 case SDLK_F11: k = XK_F11; break;
152 case SDLK_F12: k = XK_F12; break;
153 case SDLK_F13: k = XK_F13; break;
154 case SDLK_F14: k = XK_F14; break;
155 case SDLK_F15: k = XK_F15; break;
156 case SDLK_NUMLOCKCLEAR: k = XK_Num_Lock; break;
157 case SDLK_CAPSLOCK: k = XK_Caps_Lock; break;
158 case SDLK_SCROLLLOCK: k = XK_Scroll_Lock; break;
159 case SDLK_RSHIFT: k = XK_Shift_R; break;
160 case SDLK_LSHIFT: k = XK_Shift_L; break;
161 case SDLK_RCTRL: k = XK_Control_R; break;
162 case SDLK_LCTRL: k = XK_Control_L; break;
163 case SDLK_RALT: k = XK_Alt_R; break;
164 case SDLK_LALT: k = XK_Alt_L; break;
165 case SDLK_LGUI: k = XK_Super_L; break;
166 case SDLK_RGUI: k = XK_Super_R; break;
167#if 0
168 case SDLK_COMPOSE: k = XK_Compose; break;
169#endif
170 case SDLK_MODE: k = XK_Mode_switch; break;
171 case SDLK_HELP: k = XK_Help; break;
172 case SDLK_PRINTSCREEN: k = XK_Print; break;
173 case SDLK_SYSREQ: k = XK_Sys_Req; break;
174 default: break;
175 }
176 /* SDL_TEXTINPUT does not generate characters if ctrl is down, so handle those here */
177 if (k == 0 && sym > 0x0 && sym < 0x100 && e->keysym.mod & KMOD_CTRL)
178 k = sym;
179
180 return k;
181}
182
183/* UTF-8 decoding is from https://rosettacode.org/wiki/UTF-8_encode_and_decode which is under GFDL 1.2 */
184static rfbKeySym utf8char2rfbKeySym(const char chr[4]) {
185 int bytes = strlen(chr);
186 int shift = utf8Mapping[0].bits_stored * (bytes - 1);
187 rfbKeySym codep = (*chr++ & utf8Mapping[bytes].mask) << shift;
188 int i;
189 for(i = 1; i < bytes; ++i, ++chr) {
190 shift -= utf8Mapping[0].bits_stored;
191 codep |= ((char)*chr & utf8Mapping[0].mask) << shift;
192 }
193 return codep;
194}
195
196static void update(rfbClient* cl,int x,int y,int w,int h) {
197 SDL_Surface *sdl = rfbClientGetClientData(cl, SDL_Init);
198 /* update texture from surface->pixels */
199 SDL_Rect r = {x,y,w,h};
200 if(SDL_UpdateTexture(sdlTexture, &r, sdl->pixels + y*sdl->pitch + x*4, sdl->pitch) < 0)
201 rfbClientErr("update: failed to update texture: %s\n", SDL_GetError());
202 /* copy texture to renderer and show */
203 if(SDL_RenderClear(sdlRenderer) < 0)
204 rfbClientErr("update: failed to clear renderer: %s\n", SDL_GetError());
205 if(SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, NULL) < 0)
206 rfbClientErr("update: failed to copy texture to renderer: %s\n", SDL_GetError());
207 SDL_RenderPresent(sdlRenderer);
208}
209
210static void kbd_leds(rfbClient* cl, int value, int pad) {
211 /* note: pad is for future expansion 0=unused */
212 fprintf(stderr,"Led State= 0x%02X\n", value);
213 fflush(stderr);
214}
215
216/* trivial support for textchat */
217static void text_chat(rfbClient* cl, int value, char *text) {
218 switch(value) {
219 case rfbTextChatOpen:
220 fprintf(stderr,"TextChat: We should open a textchat window!\n");
221 TextChatOpen(cl);
222 break;
223 case rfbTextChatClose:
224 fprintf(stderr,"TextChat: We should close our window!\n");
225 break;
227 fprintf(stderr,"TextChat: We should close our window!\n");
228 break;
229 default:
230 fprintf(stderr,"TextChat: Received \"%s\"\n", text);
231 break;
232 }
233 fflush(stderr);
234}
235
236#ifdef __MINGW32__
237#define LOG_TO_FILE
238#endif
239
240#ifdef LOG_TO_FILE
241#include <stdarg.h>
242static void
243log_to_file(const char *format, ...)
244{
245 FILE* logfile;
246 static char* logfile_str=0;
247 va_list args;
248 char buf[256];
249 time_t log_clock;
250
252 return;
253
254 if(logfile_str==0) {
255 logfile_str=getenv("VNCLOG");
256 if(logfile_str==0)
257 logfile_str="vnc.log";
258 }
259
260 logfile=fopen(logfile_str,"a");
261
262 va_start(args, format);
263
264 time(&log_clock);
265 strftime(buf, 255, "%d/%m/%Y %X ", localtime(&log_clock));
266 fprintf(logfile,buf);
267
268 vfprintf(logfile, format, args);
269 fflush(logfile);
270
271 va_end(args);
272 fclose(logfile);
273}
274#endif
275
276
277static void cleanup(rfbClient* cl)
278{
279 /*
280 just in case we're running in listenLoop:
281 close viewer window by restarting SDL video subsystem
282 */
283 SDL_QuitSubSystem(SDL_INIT_VIDEO);
284 SDL_InitSubSystem(SDL_INIT_VIDEO);
285 if(cl)
287}
288
289
290static rfbBool handleSDLEvent(rfbClient *cl, SDL_Event *e)
291{
292 switch(e->type) {
293 case SDL_WINDOWEVENT:
294 switch (e->window.event) {
295 case SDL_WINDOWEVENT_EXPOSED:
297 cl->width, cl->height, FALSE);
298 break;
299 case SDL_WINDOWEVENT_RESIZED:
300 SendExtDesktopSize(cl, e->window.data1, e->window.data2);
301 break;
302 case SDL_WINDOWEVENT_FOCUS_GAINED:
303 if (SDL_HasClipboardText()) {
304 char *text = SDL_GetClipboardText();
305 if(text) {
306 rfbClientLog("sending clipboard text '%s'\n", text);
307 if(!SendClientCutTextUTF8(cl, text, strlen(text)))
308 SendClientCutText(cl, text, strlen(text));
309 }
310 }
311
312 break;
313 case SDL_WINDOWEVENT_FOCUS_LOST:
314 if (rightAltKeyDown) {
316 rightAltKeyDown = FALSE;
317 rfbClientLog("released right Alt key\n");
318 }
319 if (leftAltKeyDown) {
321 leftAltKeyDown = FALSE;
322 rfbClientLog("released left Alt key\n");
323 }
324 break;
325 }
326 break;
327 case SDL_MOUSEWHEEL:
328 {
329 int steps;
330 if (viewOnly)
331 break;
332
333 if(e->wheel.y > 0)
334 for(steps = 0; steps < e->wheel.y; ++steps) {
336 SendPointerEvent(cl, x, y, 0);
337 }
338 if(e->wheel.y < 0)
339 for(steps = 0; steps > e->wheel.y; --steps) {
341 SendPointerEvent(cl, x, y, 0);
342 }
343 if(e->wheel.x > 0)
344 for(steps = 0; steps < e->wheel.x; ++steps) {
345 SendPointerEvent(cl, x, y, 0b01000000);
346 SendPointerEvent(cl, x, y, 0);
347 }
348 if(e->wheel.x < 0)
349 for(steps = 0; steps > e->wheel.x; --steps) {
350 SendPointerEvent(cl, x, y, 0b00100000);
351 SendPointerEvent(cl, x, y, 0);
352 }
353 break;
354 }
355 case SDL_MOUSEBUTTONUP:
356 case SDL_MOUSEBUTTONDOWN:
357 case SDL_MOUSEMOTION:
358 {
359 int state, i;
360 if (viewOnly)
361 break;
362
363 if (e->type == SDL_MOUSEMOTION) {
364 x = e->motion.x;
365 y = e->motion.y;
366 state = e->motion.state;
367 }
368 else {
369 x = e->button.x;
370 y = e->button.y;
371 state = e->button.button;
372 for (i = 0; buttonMapping[i].sdl; i++)
373 if (state == buttonMapping[i].sdl) {
374 state = buttonMapping[i].rfb;
375 if (e->type == SDL_MOUSEBUTTONDOWN)
376 buttonMask |= state;
377 else
378 buttonMask &= ~state;
379 break;
380 }
381 }
382 SendPointerEvent(cl, x, y, buttonMask);
383 buttonMask &= ~(rfbButton4Mask | rfbButton5Mask);
384 break;
385 }
386 case SDL_KEYUP:
387 case SDL_KEYDOWN:
388 if (viewOnly)
389 break;
390 SendKeyEvent(cl, SDL_key2rfbKeySym(&e->key),
391 e->type == SDL_KEYDOWN ? TRUE : FALSE);
392 if (e->key.keysym.sym == SDLK_RALT)
393 rightAltKeyDown = e->type == SDL_KEYDOWN;
394 if (e->key.keysym.sym == SDLK_LALT)
395 leftAltKeyDown = e->type == SDL_KEYDOWN;
396 break;
397 case SDL_TEXTINPUT:
398 if (viewOnly)
399 break;
400 rfbKeySym sym = utf8char2rfbKeySym(e->text.text);
401 SendKeyEvent(cl, sym, TRUE);
402 SendKeyEvent(cl, sym, FALSE);
403 break;
404 case SDL_QUIT:
405 if(listenLoop)
406 {
407 cleanup(cl);
408 return FALSE;
409 }
410 else
411 {
413 exit(0);
414 }
415 default:
416 rfbClientLog("ignore SDL event: 0x%x\n", e->type);
417 }
418 return TRUE;
419}
420
421static void got_selection_latin1(rfbClient *cl, const char *text, int len)
422{
423 rfbClientLog("received latin1 clipboard text '%s'\n", text);
424 if(SDL_SetClipboardText(text) != 0)
425 rfbClientErr("could not set received latin1 clipboard text: %s\n", SDL_GetError());
426}
427
428static void got_selection_utf8(rfbClient *cl, const char *buf, int len)
429{
430 rfbClientLog("received utf8 clipboard text '%s'\n", buf);
431 if(SDL_SetClipboardText(buf) != 0)
432 rfbClientErr("could not set received utf8 clipboard text: %s\n", SDL_GetError());
433}
434
435
436static rfbCredential* get_credential(rfbClient* cl, int credentialType){
437 rfbCredential *c = malloc(sizeof(rfbCredential));
438 if (!c) {
439 return NULL;
440 }
442 if (!c->userCredential.username) {
443 free(c);
444 return NULL;
445 }
447 if (!c->userCredential.password) {
448 free(c->userCredential.username);
449 free(c);
450 return NULL;
451 }
452
453 if(credentialType != rfbCredentialTypeUser) {
454 rfbClientErr("something else than username and password required for authentication\n");
455 return NULL;
456 }
457
458 rfbClientLog("username and password required for authentication!\n");
459 printf("user: ");
460 fgets(c->userCredential.username, RFB_BUF_SIZE, stdin);
461 printf("pass: ");
462 fgets(c->userCredential.password, RFB_BUF_SIZE, stdin);
463
464 /* remove trailing newlines */
465 c->userCredential.username[strcspn(c->userCredential.username, "\n")] = 0;
466 c->userCredential.password[strcspn(c->userCredential.password, "\n")] = 0;
467
468 return c;
469}
470
471
472#ifdef mac
473#define main SDLmain
474#endif
475
476int main(int argc,char** argv) {
477 rfbClient* cl;
478 int i, j;
479 SDL_Event e;
480
481#ifdef LOG_TO_FILE
482 rfbClientLog=rfbClientErr=log_to_file;
483#endif
484
485 for (i = 1, j = 1; i < argc; i++)
486 if (!strcmp(argv[i], "-viewonly"))
487 viewOnly = 1;
488 else if (!strcmp(argv[i], "-resizable"))
489 enableResizable = 1;
490 else if (!strcmp(argv[i], "-no-resizable"))
491 enableResizable = 0;
492 else if (!strcmp(argv[i], "-listen")) {
493 listenLoop = 1;
494 argv[i] = "-listennofork";
495 ++j;
496 }
497 else {
498 if (i != j)
499 argv[j] = argv[i];
500 j++;
501 }
502 argc = j;
503
504 SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
505 atexit(SDL_Quit);
506 signal(SIGINT, exit);
507
508 do {
509 /* 16-bit: cl=rfbGetClient(5,3,2); */
510 cl=rfbGetClient(8,3,4);
511 cl->MallocFrameBuffer=resize;
513 cl->GotFrameBufferUpdate=update;
514 cl->HandleKeyboardLedState=kbd_leds;
515 cl->HandleTextChat=text_chat;
516 /* two different cut text handlers here for demo purposes, you
517 might as well use the same callback for both if it doesn't
518 matter for your application */
519 cl->GotXCutText = got_selection_latin1;
520 cl->GotXCutTextUTF8 = got_selection_utf8;
521 cl->GetCredential = get_credential;
524 if(!rfbInitClient(cl,&argc,argv))
525 {
526 cl = NULL; /* rfbInitClient has already freed the client struct */
527 cleanup(cl);
528 break;
529 }
530
531 while(1) {
532 if(SDL_PollEvent(&e)) {
533 /*
534 handleSDLEvent() return 0 if user requested window close.
535 In this case, handleSDLEvent() will have called cleanup().
536 */
537 if(!handleSDLEvent(cl, &e))
538 break;
539 }
540 else {
541 i=WaitForMessage(cl,500);
542 if(i<0)
543 {
544 cleanup(cl);
545 break;
546 }
547 if(i)
549 {
550 cleanup(cl);
551 break;
552 }
553 }
554 }
555 }
556 while(listenLoop);
557
558 return 0;
559}
560
int y
Definition: SDLvncviewer.c:34
int sdl
Definition: SDLvncviewer.c:10
int rfb
Definition: SDLvncviewer.c:10
int main(int argc, char **argv)
Definition: SDLvncviewer.c:476
SDL_Texture * sdlTexture
Definition: SDLvncviewer.c:30
int bits_stored
Definition: SDLvncviewer.c:19
int x
Definition: SDLvncviewer.c:34
struct @5 buttonMapping[]
SDL_Window * sdlWindow
Definition: SDLvncviewer.c:32
char mask
Definition: SDLvncviewer.c:19
struct @6 utf8Mapping[]
int sdlFlags
Definition: SDLvncviewer.c:29
SDL_Renderer * sdlRenderer
Definition: SDLvncviewer.c:31
rfbBool SendClientCutText(rfbClient *client, char *str, int len)
Places a Latin-1-encoded string on the server's clipboard.
int WaitForMessage(rfbClient *client, unsigned int usecs)
Waits for an RFB message to arrive from the server.
rfbBool TextChatOpen(rfbClient *client)
Opens a text chat window on the server.
rfbClientLogProc rfbClientLog
rfbClient * rfbGetClient(int bitsPerSample, int samplesPerPixel, int bytesPerPixel)
Allocates and returns a pointer to an rfbClient structure.
void rfbClientCleanup(rfbClient *client)
Cleans up the client structure and releases the memory allocated for it.
rfbBool SendExtDesktopSize(rfbClient *client, uint16_t width, uint16_t height)
Sends a SetDesktopSize event to the server.
rfbBool HandleRFBServerMessage(rfbClient *client)
Handles messages from the RFB server.
rfbBool SendPointerEvent(rfbClient *client, int x, int y, int buttonMask)
Sends a pointer event to the server.
rfbBool rfbInitClient(rfbClient *client, int *argc, char **argv)
Initializes the client.
rfbBool SendKeyEvent(rfbClient *client, uint32_t key, rfbBool down)
Sends a key event to the server.
rfbBool SendClientCutTextUTF8(rfbClient *client, char *str, int len)
Places a UTF-8-encoded string on the server's clipboard if the server supports it.
rfbBool SendFramebufferUpdateRequest(rfbClient *client, int x, int y, int w, int h, rfbBool incremental)
Sends a framebuffer update request to the server.
#define rfbCredentialTypeUser
Definition: rfbclient.h:162
#define LISTEN_PORT_OFFSET
Definition: rfbclient.h:84
void * rfbClientGetClientData(rfbClient *client, void *tag)
Returns a pointer to the client data associated with the given tag.
rfbClientLogProc rfbClientErr
Definition: rfbclient.h:512
void rfbClientSetClientData(rfbClient *client, void *tag, void *data)
Associates a client data tag with the given pointer.
rfbBool rfbEnableClientLogging
rfbBool SetFormatAndEncodings(rfbClient *client)
Sends format and encoding parameters to the server.
#define XK_Right
Definition: keysym.h:172
#define XK_F11
Definition: keysym.h:259
#define XK_KP_6
Definition: keysym.h:235
#define XK_Super_R
Definition: keysym.h:324
#define XK_Clear
Definition: keysym.h:126
#define XK_Print
Definition: keysym.h:185
#define XK_KP_Multiply
Definition: keysym.h:222
#define XK_Alt_L
Definition: keysym.h:321
#define XK_KP_3
Definition: keysym.h:232
#define XK_Shift_R
Definition: keysym.h:313
#define XK_KP_1
Definition: keysym.h:230
#define XK_Left
Definition: keysym.h:170
#define XK_F8
Definition: keysym.h:256
#define XK_Scroll_Lock
Definition: keysym.h:129
#define XK_KP_2
Definition: keysym.h:231
#define XK_Home
Definition: keysym.h:169
#define XK_KP_8
Definition: keysym.h:237
#define XK_Page_Down
Definition: keysym.h:177
#define XK_F6
Definition: keysym.h:254
#define XK_KP_4
Definition: keysym.h:233
#define XK_KP_Decimal
Definition: keysym.h:226
#define XK_KP_Subtract
Definition: keysym.h:225
#define XK_Return
Definition: keysym.h:127
#define XK_F2
Definition: keysym.h:250
#define XK_Down
Definition: keysym.h:173
#define XK_F9
Definition: keysym.h:257
#define XK_F12
Definition: keysym.h:261
#define XK_Caps_Lock
Definition: keysym.h:316
#define XK_Tab
Definition: keysym.h:124
#define XK_F1
Definition: keysym.h:249
#define XK_End
Definition: keysym.h:178
#define XK_Mode_switch
Definition: keysym.h:195
#define XK_KP_5
Definition: keysym.h:234
#define XK_Control_L
Definition: keysym.h:314
#define XK_Shift_L
Definition: keysym.h:312
#define XK_Escape
Definition: keysym.h:131
#define XK_Alt_R
Definition: keysym.h:322
#define XK_F7
Definition: keysym.h:255
#define XK_KP_7
Definition: keysym.h:236
#define XK_F4
Definition: keysym.h:252
#define XK_Delete
Definition: keysym.h:132
#define XK_F10
Definition: keysym.h:258
#define XK_KP_9
Definition: keysym.h:238
#define XK_Control_R
Definition: keysym.h:315
#define XK_Sys_Req
Definition: keysym.h:130
#define XK_F5
Definition: keysym.h:253
#define XK_Up
Definition: keysym.h:171
#define XK_Pause
Definition: keysym.h:128
#define XK_Super_L
Definition: keysym.h:323
#define XK_F14
Definition: keysym.h:265
#define XK_F3
Definition: keysym.h:251
#define XK_Help
Definition: keysym.h:193
#define XK_KP_Add
Definition: keysym.h:223
#define XK_KP_Equal
Definition: keysym.h:221
#define XK_F15
Definition: keysym.h:267
#define XK_KP_Enter
Definition: keysym.h:203
#define XK_F13
Definition: keysym.h:263
#define XK_Num_Lock
Definition: keysym.h:197
#define XK_KP_0
Definition: keysym.h:229
#define XK_BackSpace
Definition: keysym.h:123
#define XK_Page_Up
Definition: keysym.h:175
#define XK_KP_Divide
Definition: keysym.h:227
#define XK_Insert
Definition: keysym.h:187
#define RFB_BUF_SIZE
Definition: rfbclient.h:278
#define rfbButton1Mask
Definition: rfbproto.h:1429
int8_t rfbBool
Definition: rfbproto.h:108
#define rfbTextChatFinished
Definition: rfbproto.h:1115
uint32_t rfbKeySym
Definition: rfbproto.h:122
#define rfbTextChatClose
Definition: rfbproto.h:1114
#define rfbButton2Mask
Definition: rfbproto.h:1430
#define rfbButton3Mask
Definition: rfbproto.h:1431
#define rfbTextChatOpen
Definition: rfbproto.h:1113
#define TRUE
Definition: rfbproto.h:112
#define FALSE
Definition: rfbproto.h:110
#define rfbButton5Mask
Definition: rfbproto.h:1433
#define rfbButton4Mask
Definition: rfbproto.h:1432
char * desktopName
Definition: rfbclient.h:273
int width
Definition: rfbclient.h:244
int listen6Port
Definition: rfbclient.h:415
GotFrameBufferUpdateProc GotFrameBufferUpdate
Definition: rfbclient.h:355
GotXCutTextProc GotXCutText
Definition: rfbclient.h:359
HandleTextChatProc HandleTextChat
Definition: rfbclient.h:350
GotXCutTextUTF8Proc GotXCutTextUTF8
Callback fired when "Extended Clipboard" UTF-8 text data is received.
Definition: rfbclient.h:488
int listenPort
Definition: rfbclient.h:254
uint8_t * frameBuffer
Definition: rfbclient.h:243
GetCredentialProc GetCredential
To support security types that requires user input (except VNC password authentication),...
Definition: rfbclient.h:390
HandleKeyboardLedStateProc HandleKeyboardLedState
Definition: rfbclient.h:351
int canHandleNewFBSize
Definition: rfbclient.h:347
int height
Definition: rfbclient.h:244
MallocFrameBufferProc MallocFrameBuffer
Definition: rfbclient.h:358
rfbPixelFormat format
Definition: rfbclient.h:274
uint16_t redMax
Definition: rfbproto.h:180
uint16_t greenMax
Definition: rfbproto.h:184
uint16_t blueMax
Definition: rfbproto.h:186
uint8_t greenShift
Definition: rfbproto.h:200
uint8_t bitsPerPixel
Definition: rfbproto.h:163
uint8_t blueShift
Definition: rfbproto.h:202
uint8_t redShift
Definition: rfbproto.h:188
For GetCredentialProc callback function to return.
Definition: rfbclient.h:143
char * password
Definition: rfbclient.h:157
char * username
Definition: rfbclient.h:156
struct rfbCredential::@3 userCredential
Plain (VeNCrypt), MSLogon (UltraVNC)
rfbClient * client
Definition: vnc2mpg.c:358
#define height
Definition: vncev.c:19
#define width
Definition: vncev.c:18