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