ReactOS 0.4.16-dev-292-gbbdcc14
vnc.c File Reference
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/socket.h>
#include "../rdesktop.h"
#include "vnc.h"
#include <errno.h>
#include <rfb/rfbregion.h>
Include dependency graph for vnc.c:

Go to the source code of this file.

Macros

#define BITSPERBYTES   8
 
#define TOBYTES(bits)   ((bits)/BITSPERBYTES)
 
#define FIRST_MODIFIER   XK_Shift_L
 
#define LAST_MODIFIER   XK_Hyper_R
 
#define DO_GLYPH(ttext, idx)
 
#define GETPIXEL(buf, x, y)    (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)])
 
#define SETPIXEL(buf, x, y, p)    (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)] = (uint8_t)p)
 

Functions

int ListenOnTCPPort (int port)
 
void vncHideCursor ()
 
BOOL vncwinClipRect (int *x, int *y, int *cx, int *cy)
 
void xwin_toggle_fullscreen (void)
 
void init_keyboard ()
 
BOOL get_key_state (unsigned int state, uint32 keysym)
 
void vncKey (rfbBool down, rfbKeySym keysym, struct _rfbClientRec *cl)
 
void vncMouse (int buttonMask, int x, int y, struct _rfbClientRec *cl)
 
void rdp2vnc_connect (char *server, uint32 flags, char *domain, char *password, char *shell, char *directory)
 
BOOL ui_create_window ()
 
void ui_destroy_window ()
 
int ui_select (int rdpSocket)
 
void ui_move_pointer (int x, int y)
 
HBITMAP ui_create_bitmap (int width, int height, uint8 *data)
 
void ui_paint_bitmap (int x, int y, int cx, int cy, int width, int height, uint8 *data)
 
void ui_destroy_bitmap (HBITMAP bmp)
 
uint8_t vncLookupColour (rfbColourMap *colourMap, uint8_t *p)
 
HCURSOR ui_create_cursor (unsigned int x, unsigned int y, int width, int height, uint8 *mask, uint8 *data)
 
void ui_set_cursor (HCURSOR cursor)
 
void ui_destroy_cursor (HCURSOR cursor)
 
void ui_set_null_cursor (void)
 
HGLYPH ui_create_glyph (int width, int height, uint8 *data)
 
void ui_destroy_glyph (HGLYPH glyph)
 
HCOLOURMAP ui_create_colourmap (COLOURMAP *colours)
 
void ui_destroy_colourmap (HCOLOURMAP map)
 
void ui_set_colourmap (HCOLOURMAP map)
 
void ui_set_clip (int x, int y, int cx, int cy)
 
void ui_reset_clip ()
 
void ui_bell ()
 
void ui_destblt (uint8 opcode, int x, int y, int cx, int cy)
 
void ui_patblt (uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_screenblt (uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
 
void ui_memblt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
 
void ui_triblt (uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
 
void ui_line (uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
 
void ui_rect (int x, int y, int cx, int cy, int colour)
 
void ui_draw_glyph (int mixmode, int x, int y, int cx, int cy, HGLYPH glyph, int srcx, int srcy, int bgcolour, int fgcolour)
 
void ui_draw_text (uint8 font, uint8 flags, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, int bgcolour, int fgcolour, uint8 *text, uint8 length)
 
void ui_desktop_save (uint32 offset, int x, int y, int cx, int cy)
 
void ui_desktop_restore (uint32 offset, int x, int y, int cx, int cy)
 
rfbPixelFormat * vncNewFormat (int depth)
 
vncBuffervncNewBuffer (int w, int h, int depth)
 
vncBuffervncDupBuffer (vncBuffer *b)
 
void vncPrintStats ()
 
void vncCopyBlitFromNoEncode (rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
 
void vncCopyBlit (rfbScreenInfoPtr s, int x, int y, int w, int h, int srcx, int srcy)
 
void vncCopyBlitFrom (rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
 
void vncTransBlitFrom (rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy, int bg)
 
void vncXorBlitFrom (rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
 
void vncAndBlitFrom (rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
 
void vncDeleteBuffer (vncBuffer *b)
 
rfbCursorPtr vncNewCursor (vncBuffer *mask, vncBuffer *pointer, int hotx, int hoty)
 
void vncSetCursor (rfbScreenInfoPtr s, rfbCursorPtr c)
 
vncPixel vncGetPixel (vncBuffer *b, int x, int y)
 
void vncSetPixel (vncBuffer *b, int x, int y, vncPixel c)
 
void vncSetRect (rfbScreenInfoPtr s, int x, int y, int w, int h, vncPixel c)
 
vncBuffervncGetRect (rfbScreenInfoPtr s, int x, int y, int w, int h)
 
rfbColourMap * vncNewColourMap (rfbScreenInfoPtr s, int n)
 
void vncSetColourMapEntry (rfbColourMap *m, int i, vncPixel r, vncPixel g, vncPixel b)
 
void vncDeleteColourMap (rfbColourMap *m)
 
void vncSetColourMap (rfbScreenInfoPtr s, rfbColourMap *m)
 
void ui_begin_update ()
 
void ui_end_update ()
 
void ui_resize_window ()
 

Variables

int rfbClientSocket = 0
 
int g_width
 
int g_height
 
int keylayout
 
BOOL sendmotion
 
int rfb_port = 5923
 
int defer_time = 5
 
static rfbScreenInfoPtr server = NULL
 
static vncBufferframeBuffer = NULL
 
static uint8_t reverseByte [0x100]
 
BOOL g_enable_compose = False
 
int g_display = 0
 
BOOL owncolmap = False
 
BOOL enable_compose = False
 
int mouseLookup [3]
 
int clipX
 
int clipY
 
int clipW
 
int clipH
 
static int lastbuttons = 0
 
static BOOL keystate [LAST_MODIFIER - FIRST_MODIFIER]
 
char g_title []
 
rfbPixelFormat vnc_formats []
 

Macro Definition Documentation

◆ BITSPERBYTES

#define BITSPERBYTES   8

Definition at line 59 of file vnc.c.

◆ DO_GLYPH

#define DO_GLYPH (   ttext,
  idx 
)
Value:
{\
glyph = cache_get_font (font, ttext[idx]);\
{\
offset = ttext[++idx];\
if ((offset & 0x80))\
offset = ((offset & 0x7f) << 8) | ttext[++idx];\
y += offset;\
else\
x += offset;\
}\
if (glyph != NULL)\
{\
ui_draw_glyph (mixmode, x + (short) glyph->offset,\
y + (short) glyph->baseline,\
glyph->width, glyph->height,\
glyph->pixmap, 0, 0, bgcolour, fgcolour);\
x += glyph->width;\
}\
}
FONTGLYPH * cache_get_font(uint8 font, uint16 character)
Definition: cache.c:279
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
#define TEXT2_VERTICAL
Definition: constants.h:275
#define NULL
Definition: types.h:112
unsigned int idx
Definition: utils.c:41
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLbitfield flags
Definition: glext.h:7161
GLintptr offset
Definition: glext.h:5920
Definition: mk_font.cpp:20

Definition at line 837 of file vnc.c.

◆ FIRST_MODIFIER

#define FIRST_MODIFIER   XK_Shift_L

Definition at line 130 of file vnc.c.

◆ GETPIXEL

#define GETPIXEL (   buf,
  x,
  y 
)     (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)])

Definition at line 1019 of file vnc.c.

◆ LAST_MODIFIER

#define LAST_MODIFIER   XK_Hyper_R

Definition at line 131 of file vnc.c.

◆ SETPIXEL

#define SETPIXEL (   buf,
  x,
  y,
  p 
)     (((uint8_t*)(buf->data))[(x)+((y)*buf->linew)] = (uint8_t)p)

Definition at line 1021 of file vnc.c.

◆ TOBYTES

#define TOBYTES (   bits)    ((bits)/BITSPERBYTES)

Definition at line 60 of file vnc.c.

Function Documentation

◆ get_key_state()

BOOL get_key_state ( unsigned int  state,
uint32  keysym 
)

Definition at line 146 of file vnc.c.

147{
148 if (keysym >= FIRST_MODIFIER && keysym <= LAST_MODIFIER)
149 return keystate[keysym - FIRST_MODIFIER];
150 return 0;
151}
#define FIRST_MODIFIER
Definition: vnc.c:130
#define LAST_MODIFIER
Definition: vnc.c:131
static BOOL keystate[LAST_MODIFIER - FIRST_MODIFIER]
Definition: vnc.c:133

Referenced by handle_special_keys(), reset_modifier_keys(), and ui_get_numlock_state().

◆ init_keyboard()

void init_keyboard ( )

Definition at line 136 of file vnc.c.

137{
138 int i;
139 for (i = 0; i < LAST_MODIFIER - FIRST_MODIFIER; i++)
140 keystate[i] = 0;
141
142 xkeymap_init();
143}
void xkeymap_init(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by ui_create_window().

◆ ListenOnTCPPort()

int ListenOnTCPPort ( int  port)

◆ rdp2vnc_connect()

void rdp2vnc_connect ( char server,
uint32  flags,
char domain,
char password,
char shell,
char directory 
)

Definition at line 226 of file vnc.c.

228{
229 struct sockaddr addr;
230 fd_set fdset;
231 struct timeval tv;
232 int rfbListenSock, addrlen = sizeof(addr);
233
234 rfbListenSock = rfbListenOnTCPPort(rfb_port);
235 fprintf(stderr, "Listening on VNC port %d\n", rfb_port);
236 if (rfbListenSock <= 0)
237 error("Cannot listen on port %d", rfb_port);
238 else
239 while (1)
240 {
241 FD_ZERO(&fdset);
242 FD_SET(rfbListenSock, &fdset);
243 tv.tv_sec = 5;
244 tv.tv_usec = 0;
245 if (select(rfbListenSock + 1, &fdset, NULL, NULL, &tv) > 0)
246 {
247 rfbClientSocket = accept(rfbListenSock, &addr, &addrlen);
248 if (rfbClientSocket < 0)
249 {
250 error("Error accepting client (%d: %s.\n",
252 continue;
253 }
256 {
257 error("Error connecting to RDP server.\n");
258 continue;
259 }
260 if (!fork())
261 {
264 printf("Connection successful.\n");
266 printf("Disconnecting...\n");
269 exit(0);
270 }
271 }
272 }
273}
void rdp_disconnect(void)
Definition: rdp.c:1779
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
Definition: rdp.c:1742
void rdp_main_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
Definition: rdp.c:1682
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
UINT32 uint32_t
Definition: types.h:75
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition: select.c:41
unsigned int BOOL
Definition: ntddk_ex.h:94
#define printf
Definition: freeldr.h:97
GLenum const GLvoid * addr
Definition: glext.h:9621
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define error(str)
Definition: mkdosfs.c:1605
const char * strerror(int err)
Definition: compat_str.c:23
static WCHAR password[]
Definition: url.c:33
#define errno
Definition: errno.h:18
#define exit(n)
Definition: config.h:202
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23
Definition: cookie.c:42
Definition: winsock.h:66
int deactivated
Definition: svgawin.c:63
uint32 ext_disc_reason
Definition: svgawin.c:64
int rfb_port
Definition: vnc.c:71
int rfbClientSocket
Definition: vnc.c:73
BOOL ui_create_window()
Definition: vnc.c:281
static rfbScreenInfoPtr server
Definition: vnc.c:74
void ui_destroy_window()
Definition: vnc.c:335
#define FD_ZERO(set)
Definition: winsock.h:96
#define FD_SET(fd, set)
Definition: winsock.h:89

Referenced by main().

◆ ui_begin_update()

void ui_begin_update ( void  )

Definition at line 1349 of file vnc.c.

1350{
1351}

Referenced by process_update_pdu(), and rdp5_process().

◆ ui_bell()

void ui_bell ( void  )

Definition at line 571 of file vnc.c.

572{
573 rfbSendBell(server);
574}

Referenced by process_data_pdu().

◆ ui_create_bitmap()

HBITMAP ui_create_bitmap ( int  width,
int  height,
uint8 data 
)

Definition at line 377 of file vnc.c.

378{
379 vncBuffer *buf;
380
382 memcpy(buf->data, data, width * height);
383
384 return (HBITMAP) buf;
385}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HBITMAP
Definition: button.c:44
Definition: vnc.h:11
vncBuffer * vncNewBuffer(int w, int h, int depth)
Definition: vnc.c:990

Referenced by process_bmpcache(), process_bmpcache2(), process_raw_bmpcache(), pstcache_load_bitmap(), and ui_paint_bitmap().

◆ ui_create_colourmap()

HCOLOURMAP ui_create_colourmap ( COLOURMAP colours)

Definition at line 528 of file vnc.c.

529{
530 int i;
531 rfbColourMap *map = vncNewColourMap(server, colours->ncolours);
532 for (i = 0; i < colours->ncolours; i++)
533 {
535 colours->colours[i].green, colours->colours[i].blue);
536 }
537 return map;
538}
Definition: _map.h:48
uint8 red
Definition: types.h:57
uint8 blue
Definition: types.h:59
uint8 green
Definition: types.h:58
uint16 ncolours
Definition: types.h:66
COLOURENTRY * colours
Definition: types.h:67
void vncSetColourMapEntry(rfbColourMap *m, int i, vncPixel r, vncPixel g, vncPixel b)
Definition: vnc.c:1322
rfbColourMap * vncNewColourMap(rfbScreenInfoPtr s, int n)
Definition: vnc.c:1312

Referenced by process_colcache(), and process_palette().

◆ ui_create_cursor()

HCURSOR ui_create_cursor ( unsigned int  x,
unsigned int  y,
int  width,
int  height,
uint8 mask,
uint8 data 
)

Definition at line 421 of file vnc.c.

422{
423 int i, j;
424 uint8_t *d0, *d1;
425 uint8_t *cdata;
426 uint8_t white[3] = { 0xff, 0xff, 0xff };
427 uint8_t black[3] = { 0, 0, 0 };
428 uint8_t *cur;
429 rfbCursorPtr cursor;
430 rfbColourMap *colourMap = &server->colourMap;
431
432 cdata = xmalloc(sizeof(uint8_t) * width * height);
433 d0 = xmalloc(sizeof(uint32_t) * width * height / 4);
434 d1 = (uint8_t *) mask;
435 for (j = 0; j < height; j++)
436 for (i = 0; i < width / 8; i++)
437 {
438 d0[j * width / 8 + i] = d1[(height - 1 - j) * width / 8 + i] ^ 0xffffffff;
439 }
440 for (j = 0; j < height; j++)
441 {
442 for (i = 0; i < width; i++)
443 {
444 //strange that the pointer is in 24bit depth when everything
445 //else is in 8bit palletized.
446 cur = data + ((height - 1 - j) * width + i) * 3;
447 if (cur[0] > 0x80 || cur[1] > 0x80 || cur[2] > 0x80)
448 {
449 if (!(d0[(j * width + i) / 8] & (0x80 >> (i & 7))))
450 {
451 /* text cursor! */
452 cdata[j * width + i] = vncLookupColour(colourMap, black);
453 d0[(j * width + i) / 8] |= 0x80 >> (i & 7);
454 }
455 else
456 cdata[j * width + i] = vncLookupColour(colourMap, white);
457 }
458 else
459 cdata[j * width + i] = vncLookupColour(colourMap, cur);
460 }
461 }
462 cursor = (rfbCursorPtr) xmalloc(sizeof(rfbCursor));
463 cursor->width = width;
464 cursor->height = height;
465 cursor->xhot = x;
466 cursor->yhot = y;
467 cursor->mask = (char *) d0;
468 cursor->source = 0;
469 cursor->richSource = cdata;
470 cursor->cleanup = 0; // workaround: this produces a memleak
471
472 cursor->backRed = cursor->backGreen = cursor->backBlue = 0xffff;
473 cursor->foreRed = cursor->foreGreen = cursor->foreBlue = 0;
474
475 return (HCURSOR) cursor;
476}
void * xmalloc(int size)
Definition: uimain.c:747
FxCollectionEntry * cur
GLenum GLint GLuint mask
Definition: glext.h:6028
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
const char cursor[]
Definition: icontest.c:13
BYTE uint8_t
Definition: msvideo1.c:66
uint8_t vncLookupColour(rfbColourMap *colourMap, uint8_t *p)
Definition: vnc.c:403
HICON HCURSOR
Definition: windef.h:299

◆ ui_create_glyph()

HGLYPH ui_create_glyph ( int  width,
int  height,
uint8 data 
)

Definition at line 499 of file vnc.c.

500{
501 int x, y;
502 vncBuffer *buf;
503
505
506 //data is padded to multiple of 16bit line lengths
507 for (y = 0; y < height; y++)
508 {
509 for (x = 0; x < width; x++)
510 {
511 int byte = x / 8 + (y * ((width + 7) / 8));
512 byte = rfbEndianTest ? reverseByte[data[byte]] : data[byte];
513 byte = (byte >> (x & 7)) & 0x01;
514 vncSetPixel(buf, x, y, byte ? 0x7f : 0x00);
515 }
516 }
517
518 return (HGLYPH) buf;
519}
#define byte(x, n)
Definition: tomcrypt.h:118
static uint8_t reverseByte[0x100]
Definition: vnc.c:76
void vncSetPixel(vncBuffer *b, int x, int y, vncPixel c)
Definition: vnc.c:1225

Referenced by process_fontcache(), and ui_patblt().

◆ ui_create_window()

BOOL ui_create_window ( void  )

Definition at line 281 of file vnc.c.

282{
283 int i;
284
285 for (i = 0; i < 0x100; i++)
286 reverseByte[i] =
287 (((i >> 7) & 1)) | (((i >> 6) & 1) << 1) | (((i >> 5) & 1) << 2) |
288 (((i >> 4) & 1) << 3) | (((i >> 3) & 1) << 4) | (((i >> 2) & 1) << 5) |
289 (((i >> 1) & 1) << 6) | (((i >> 0) & 1) << 7);
290
291 server = rfbGetScreen(0, NULL, g_width, g_height, 8, 1, 1);
292 server->desktopName = g_title;
293 server->frameBuffer = (char *) malloc(g_width * g_height);
294 server->ptrAddEvent = vncMouse;
295 server->kbdAddEvent = vncKey;
296#ifdef ENABLE_SHADOW
297 server->httpPort = 6124 + client_counter;
298 server->port = 5924 + client_counter;
299 rfbInitSockets(server);
300 server->alwaysShared = TRUE;
301 server->neverShared = FALSE;
302#else
303 server->port = -1;
304 server->alwaysShared = FALSE;
305 server->neverShared = FALSE;
306#endif
307 server->inetdSock = rfbClientSocket;
308 server->serverFormat.trueColour = FALSE; /* activate colour maps */
309 server->deferUpdateTime = defer_time;
310
311 frameBuffer = (vncBuffer *) malloc(sizeof(vncBuffer));
315 frameBuffer->data = server->frameBuffer;
317 frameBuffer->format = &server->serverFormat;
318
320
321 rfbInitServer(server);
322#ifndef ENABLE_SHADOW
323 server->port = rfb_port;
324#else
325 fprintf(stderr, "server listening on port %d (socket %d)\n", server->port,
326 server->listenSock);
327#endif
328
330
331 return (server != NULL);
332}
#define malloc
Definition: debug_ros.c:4
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
uint16_t linew
Definition: vnc.h:13
char * data
Definition: vnc.h:15
uint16_t h
Definition: vnc.h:12
rfbPixelFormat * format
Definition: vnc.h:14
BOOL owner
Definition: vnc.h:16
uint16_t w
Definition: vnc.h:12
int g_width
Definition: uimain.c:42
int g_height
Definition: uimain.c:43
void vncKey(rfbBool down, rfbKeySym keysym, struct _rfbClientRec *cl)
Definition: vnc.c:154
void ui_set_clip(int x, int y, int cx, int cy)
Definition: vnc.c:553
void vncMouse(int buttonMask, int x, int y, struct _rfbClientRec *cl)
Definition: vnc.c:198
void init_keyboard()
Definition: vnc.c:136
int defer_time
Definition: vnc.c:72
static vncBuffer * frameBuffer
Definition: vnc.c:75
char g_title[]

Referenced by main(), rdp2vnc_connect(), and xwin_toggle_fullscreen().

◆ ui_desktop_restore()

void ui_desktop_restore ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 945 of file vnc.c.

946{
947 uint8 *data;
948 vncBuffer *buf;
949 int ox, oy, srcx, srcy;
950
951 srcx = srcy = 0;
952 ox = x;
953 oy = y;
954
955 offset *= TOBYTES(server->serverFormat.bitsPerPixel);
956 data = cache_get_desktop(offset, cx, cy, TOBYTES(server->serverFormat.bitsPerPixel));
957 if (data == NULL)
958 return;
959
960 buf = vncNewBuffer(cx, cy, 8);
961 memcpy(buf->data, data, cx * cy * 1);
962
963 if (vncwinClipRect(&x, &y, &cx, &cy))
964 {
965 srcx += x - ox;
966 srcy += y - oy;
967 vncCopyBlitFrom(server, x, y, cx, cy, buf, srcx, srcy);
968 }
970}
uint8 * cache_get_desktop(uint32 offset, int cx, int cy, int bytes_per_pixel)
Definition: cache.c:353
unsigned char uint8
Definition: types.h:28
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TOBYTES(bits)
Definition: vnc.c:60
BOOL vncwinClipRect(int *x, int *y, int *cx, int *cy)
Definition: vnc.c:102
void vncCopyBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
Definition: vnc.c:1075
void vncDeleteBuffer(vncBuffer *b)
Definition: vnc.c:1170

Referenced by process_desksave().

◆ ui_desktop_save()

void ui_desktop_save ( uint32  offset,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 934 of file vnc.c.

935{
936 vncBuffer *buf;
937
938 buf = vncGetRect(server, x, y, cx, cy);
939 offset *= TOBYTES(server->serverFormat.bitsPerPixel);
940 cache_put_desktop(offset, cx, cy, cx, TOBYTES(server->serverFormat.bitsPerPixel),
941 (buf->data));
942}
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, int bytes_per_pixel, uint8 *data)
Definition: cache.c:371
vncBuffer * vncGetRect(rfbScreenInfoPtr s, int x, int y, int w, int h)
Definition: vnc.c:1272

Referenced by process_desksave().

◆ ui_destblt()

void ui_destblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 577 of file vnc.c.

579{
580 int i;
581 vncBuffer *buf;
582
583 switch (opcode)
584 {
585 case 0:
586 case 15:
587 ui_rect(x, y, cx, cy, 0xff);
588 break;
589 case 5: // invert
590 buf = vncGetRect(server, x, y, cx, cy);
591 for (i = 0; i < cx * cy; i++)
592 ((char *) (buf->data))[i] = !((char *) (buf->data))[i];
593 break;
594 default:
595 unimpl("ui_destblt: opcode=%d %d,%d %dx%d\n", opcode, x, y, cx, cy);
596 }
597}
void unimpl(char *format,...)
Definition: uimain.c:801
void ui_rect(int x, int y, int cx, int cy, int colour)
Definition: vnc.c:771

Referenced by process_destblt().

◆ ui_destroy_bitmap()

void ui_destroy_bitmap ( HBITMAP  bmp)

Definition at line 397 of file vnc.c.

398{
400}
BITMAP bmp
Definition: alphablend.c:62

Referenced by ui_destroy_glyph().

◆ ui_destroy_colourmap()

void ui_destroy_colourmap ( HCOLOURMAP  map)

Definition at line 541 of file vnc.c.

542{
544}
void vncDeleteColourMap(rfbColourMap *m)
Definition: vnc.c:1333

◆ ui_destroy_cursor()

void ui_destroy_cursor ( HCURSOR  cursor)

Definition at line 486 of file vnc.c.

487{
488 if (cursor)
489 rfbFreeCursor((rfbCursorPtr) cursor);
490}

◆ ui_destroy_glyph()

void ui_destroy_glyph ( HGLYPH  glyph)

Definition at line 522 of file vnc.c.

523{
524 ui_destroy_bitmap((HBITMAP) glyph);
525}
void ui_destroy_bitmap(HBITMAP bmp)
Definition: vnc.c:397

Referenced by cache_put_font(), and ui_patblt().

◆ ui_destroy_window()

void ui_destroy_window ( void  )

Definition at line 335 of file vnc.c.

336{
337 rfbCloseClient(server->clientHead);
338}

Referenced by main(), rdp2vnc_connect(), and xwin_toggle_fullscreen().

◆ ui_draw_glyph()

void ui_draw_glyph ( int  mixmode,
int  x,
int  y,
int  cx,
int  cy,
HGLYPH  glyph,
int  srcx,
int  srcy,
int  bgcolour,
int  fgcolour 
)

Definition at line 782 of file vnc.c.

786{
787 int xx, yy;
788 int ox, oy;
789 vncBuffer *buf = vncDupBuffer(glyph);
790
791 x &= 0xffff;
792 y &= 0xffff;
793
794 /* yes, sometimes same fgcolour and bgcolour are sent, but because
795 * of transparency, we have to change that! */
796 if (mixmode == MIX_TRANSPARENT && fgcolour == bgcolour)
797 bgcolour = fgcolour ^ 0xff;
798
799 ox = x;
800 oy = y;
801
802 for (yy = srcy; yy < srcy + cy; yy++)
803 {
804 for (xx = srcx; xx < srcx + cx; xx++)
805 {
806 vncSetPixel(buf, xx, yy, vncGetPixel(buf, xx, yy) ? fgcolour : bgcolour);
807 }
808 }
809
810 switch (mixmode)
811 {
812 case MIX_TRANSPARENT:
813 if (vncwinClipRect(&x, &y, &cx, &cy))
814 {
815 //if we clipped top or left, we have to adjust srcx,srcy;
816 srcx += x - ox;
817 srcy += y - oy;
818 vncTransBlitFrom(server, x, y, cx, cy, buf, srcx, srcy, bgcolour);
819 }
820 break;
821 case MIX_OPAQUE:
822 if (vncwinClipRect(&x, &y, &cx, &cy))
823 {
824 //if we clipped top or left, we have to adjust srcx,srcy;
825 srcx += x - ox;
826 srcy += y - oy;
827 vncCopyBlitFrom(server, x, y, cx, cy, buf, srcx, srcy);
828 }
829 break;
830
831 default:
832 unimpl("mix %d\n", mixmode);
833 }
835}
#define MIX_TRANSPARENT
Definition: constants.h:272
#define MIX_OPAQUE
Definition: constants.h:273
int xx
Definition: npserver.c:29
void vncTransBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy, int bg)
Definition: vnc.c:1082
vncPixel vncGetPixel(vncBuffer *b, int x, int y)
Definition: vnc.c:1218
vncBuffer * vncDupBuffer(vncBuffer *b)
Definition: vnc.c:1003

◆ ui_draw_text()

void ui_draw_text ( uint8  font,
uint8  flags,
int  mixmode,
int  x,
int  y,
int  clipx,
int  clipy,
int  clipcx,
int  clipcy,
int  boxx,
int  boxy,
int  boxcx,
int  boxcy,
int  bgcolour,
int  fgcolour,
uint8 text,
uint8  length 
)

Definition at line 863 of file vnc.c.

867{
868 FONTGLYPH *glyph;
869 int i, j, offset;
871
872 if (boxcx > 1)
873 {
874 ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);
875 }
876 else if (mixmode == MIX_OPAQUE)
877 {
878 ui_rect(clipx, clipy, clipcx, clipcy, bgcolour);
879 }
880
881 /* Paint text, character by character */
882 for (i = 0; i < length;)
883 {
884 switch (text[i])
885 {
886 case 0xff:
887 if (i + 2 < length)
888 cache_put_text(text[i + 1], &(text[i - text[i + 2]]),
889 text[i + 2]);
890 else
891 {
892 error("this shouldn't be happening\n");
893 break;
894 }
895 /* this will move pointer from start to first character after FF command */
896 length -= i + 3;
897 text = &(text[i + 3]);
898 i = 0;
899 break;
900
901 case 0xfe:
902 entry = cache_get_text(text[i + 1]);
903 if (entry != NULL)
904 {
905 if ((((uint8 *) (entry->data))[1] == 0)
906 && (!(flags & TEXT2_IMPLICIT_X)))
907 {
908 if (flags & 0x04) /* vertical text */
909 y += text[i + 2];
910 else
911 x += text[i + 2];
912 }
913 if (i + 2 < length)
914 i += 3;
915 else
916 i += 2;
917 length -= i;
918 /* this will move pointer from start to first character after FE command */
919 text = &(text[i]);
920 i = 0;
921 for (j = 0; j < entry->size; j++)
922 DO_GLYPH(((uint8 *) (entry->data)), j);
923 }
924 break;
925 default:
926 DO_GLYPH(text, i);
927 i++;
928 break;
929 }
930 }
931}
void cache_put_text(uint8 cache_id, void *data, int length)
Definition: cache.c:335
DATABLOB * cache_get_text(uint8 cache_id)
Definition: cache.c:325
const WCHAR * text
Definition: package.c:1794
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
uint32_t entry
Definition: isohybrid.c:63
#define DO_GLYPH(ttext, idx)
Definition: vnc.c:837

◆ ui_end_update()

void ui_end_update ( void  )

Definition at line 1354 of file vnc.c.

1355{
1356}

Referenced by process_update_pdu(), and rdp5_process().

◆ ui_line()

void ui_line ( uint8  opcode,
int  startx,
int  starty,
int  endx,
int  endy,
PEN pen 
)

Definition at line 760 of file vnc.c.

763{
764 //vncSetRect(server,startx,starty,1+endx-startx,endy-starty,pen->colour);
765 //unimpl("drawline: pen colour=%d\n",pen->colour);
766 /* TODO: implement opcodes */
767 rfbDrawLine(server, startx, starty, endx, endy, pen->colour);
768}
uint32 colour
Definition: types.h:86

Referenced by process_line().

◆ ui_memblt()

void ui_memblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy 
)

Definition at line 692 of file vnc.c.

695{
696 int ox, oy;
697 ox = x;
698 oy = y;
699
700 if (vncwinClipRect(&x, &y, &cx, &cy))
701 {
702 //if we clipped top or left, we have to adjust srcx,srcy;
703 srcx += x - ox;
704 srcy += y - oy;
705 switch (ROP2_S(opcode))
706 {
707 case ROP2_OR:
708 vncTransBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
709 srcy, 0x0);
710 break;
711 case ROP2_XOR:
712 vncXorBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx, srcy);
713 break;
714 case ROP2_AND:
715 vncAndBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx, srcy);
716 break;
717 case ROP2_COPY:
718 vncCopyBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
719 srcy);
720 break;
721 default:
722 unimpl("ui_memblt: op%d %d,%d %dx%d\n", opcode, x, y, cx, cy);
723 vncCopyBlitFrom(server, x, y, cx, cy, (vncBuffer *) src, srcx,
724 srcy);
725 break;
726 }
727 }
728}
#define ROP2_S(rop3)
Definition: constants.h:263
#define ROP2_OR
Definition: constants.h:270
#define ROP2_COPY
Definition: constants.h:266
#define ROP2_AND
Definition: constants.h:268
#define ROP2_XOR
Definition: constants.h:267
GLenum src
Definition: glext.h:6340
void vncAndBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
Definition: vnc.c:1141
void vncXorBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
Definition: vnc.c:1112

Referenced by ui_triblt().

◆ ui_move_pointer()

void ui_move_pointer ( int  x,
int  y 
)

Definition at line 368 of file vnc.c.

369{
370 // TODO: Is there a way to send x,y even if cursor encoding is active?
371 rfbUndrawCursor(server);
372 server->cursorX = x;
373 server->cursorY = y;
374}

Referenced by process_pointer_pdu(), and rdp5_process().

◆ ui_paint_bitmap()

void ui_paint_bitmap ( int  x,
int  y,
int  cx,
int  cy,
int  width,
int  height,
uint8 data 
)

Definition at line 388 of file vnc.c.

389{
390 vncBuffer *buf;
392 vncCopyBlitFrom(server, x, y, cx, cy, buf, 0, 0);
394}
HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
Definition: vnc.c:377

Referenced by process_bitmap_updates().

◆ ui_patblt()

void ui_patblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 600 of file vnc.c.

603{
604 switch (brush->style)
605 {
606 case 0: /* Solid */
607 switch (opcode)
608 {
609 case ROP2_XOR:
610 {
611 int xx, yy;
613 for (yy = 0; yy < cy; yy++)
614 for (xx = 0; xx < cx; xx++)
615 vncSetPixel(fill, xx, yy, fgcolour);
616 if (vncwinClipRect(&x, &y, &cx, &cy))
618 0, 0);
619 break;
620 }
621
622 default:
623 if (vncwinClipRect(&x, &y, &cx, &cy))
624 vncSetRect(server, x, y, cx, cy, fgcolour);
625 }
626 break;
627
628 case 3: /* Pattern */
629 {
630 int xx, yy;
632 fill = (vncBuffer *) ui_create_glyph(8, 8, brush->pattern);
633
634 for (yy = 0; yy < 8; yy++)
635 {
636 for (xx = 0; xx < 8; xx++)
637 {
638 vncSetPixel(fill, xx, yy,
640 yy) ? fgcolour : bgcolour);
641 }
642 }
643
644 if (vncwinClipRect(&x, &y, &cx, &cy))
645 {
646 switch (opcode)
647 {
648 case ROP2_COPY:
650 0, 0);
651 break;
652 case ROP2_XOR:
654 0, 0);
655 break;
656 default:
657 unimpl("pattern blit (%d,%d) opcode=%d bg=%d fg=%d\n", x, y, opcode, bgcolour, fgcolour);
659 0, 0);
660 break;
661 }
662 }
663
665 break;
666
667 }
668 default:
669 unimpl("brush %d\n", brush->style);
670 }
671}
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algobase.h:449
void ui_destroy_glyph(HGLYPH glyph)
Definition: vnc.c:522
HGLYPH ui_create_glyph(int width, int height, uint8 *data)
Definition: vnc.c:499
void vncSetRect(rfbScreenInfoPtr s, int x, int y, int w, int h, vncPixel c)
Definition: vnc.c:1232

Referenced by process_patblt(), and ui_triblt().

◆ ui_rect()

void ui_rect ( int  x,
int  y,
int  cx,
int  cy,
int  colour 
)

Definition at line 771 of file vnc.c.

774{
775 if (vncwinClipRect(&x, &y, &cx, &cy))
776 {
777 vncSetRect(server, x, y, cx, cy, colour);
778 }
779}

Referenced by process_rect(), ui_destblt(), and ui_draw_text().

◆ ui_reset_clip()

void ui_reset_clip ( void  )

Definition at line 562 of file vnc.c.

563{
564 clipX = 0;
565 clipY = 0;
566 clipW = 64000;
567 clipH = 64000;
568}
int clipX
Definition: vnc.c:99
int clipY
Definition: vnc.c:99
int clipH
Definition: vnc.c:99
int clipW
Definition: vnc.c:99

Referenced by process_orders(), and ui_create_window().

◆ ui_resize_window()

void ui_resize_window ( void  )

Definition at line 1359 of file vnc.c.

1360{
1361 rfbClientIteratorPtr iter;
1362 rfbClientPtr cl;
1363
1364 server->width = g_width;
1365 server->height = g_height;
1366 server->frameBuffer = (char *) realloc(server->frameBuffer, g_width * g_height);
1367 server->paddedWidthInBytes = g_width;
1368
1369 iter = rfbGetClientIterator(server);
1370 while ((cl = rfbClientIteratorNext(iter)))
1371 if (cl->useNewFBSize)
1372 cl->newFBSizePending = TRUE;
1373 else
1374 rfbLog("Warning: Client %s does not support NewFBSize!\n ", cl->host);
1375 rfbReleaseClientIterator(iter);
1376}
#define realloc
Definition: debug_ros.c:6

Referenced by rdp_process_bitmap_caps().

◆ ui_screenblt()

void ui_screenblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
int  srcx,
int  srcy 
)

Definition at line 674 of file vnc.c.

677{
678 int ox, oy;
679
680 ox = x;
681 oy = y;
682 if (vncwinClipRect(&x, &y, &cx, &cy))
683 {
684 //if we clipped top or left, we have to adjust srcx,srcy;
685 srcx += x - ox;
686 srcy += y - oy;
687 vncCopyBlit(server, x, y, cx, cy, srcx, srcy);
688 }
689}
void vncCopyBlit(rfbScreenInfoPtr s, int x, int y, int w, int h, int srcx, int srcy)
Definition: vnc.c:1068

Referenced by process_screenblt().

◆ ui_select()

int ui_select ( int  rdpSocket)

Definition at line 342 of file vnc.c.

343{
344 fd_set fds;
345 struct timeval tv;
346 int n, m = server->maxFd;
347
348 if (rdpSocket > m)
349 m = rdpSocket;
350 while (1)
351 {
352 fds = server->allFds;
353 FD_SET(rdpSocket, &fds);
354 tv.tv_sec = defer_time / 1000;
355 tv.tv_usec = (defer_time % 1000) * 1000;
356 n = select(m + 1, &fds, NULL, NULL, &tv);
357 rfbProcessEvents(server, 0);
358 /* if client is gone, close connection */
359 if (!server->clientHead)
360 close(rdpSocket);
361 if (FD_ISSET(rdpSocket, &fds))
362 return 1;
363 }
364 return 0;
365}
#define close
Definition: acwin.h:98
GLdouble n
Definition: glext.h:7729
const GLfloat * m
Definition: glext.h:10848
#define FD_ISSET(fd, set)
Definition: winsock.h:100

Referenced by tcp_recv().

◆ ui_set_clip()

void ui_set_clip ( int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 553 of file vnc.c.

554{
555 clipX = x;
556 clipY = y;
557 clipW = cx;
558 clipH = cy;
559}

Referenced by process_orders(), and ui_create_window().

◆ ui_set_colourmap()

void ui_set_colourmap ( HCOLOURMAP  map)

Definition at line 547 of file vnc.c.

548{
550}
void vncSetColourMap(rfbScreenInfoPtr s, rfbColourMap *m)
Definition: vnc.c:1341

Referenced by process_colcache(), and process_palette().

◆ ui_set_cursor()

void ui_set_cursor ( HCURSOR  cursor)

Definition at line 479 of file vnc.c.

480{
481 /* FALSE means: don't delete old cursor */
482 rfbSetCursor(server, (rfbCursorPtr) cursor, FALSE);
483}

◆ ui_set_null_cursor()

void ui_set_null_cursor ( void  )

Definition at line 493 of file vnc.c.

494{
495 rfbSetCursor(server, 0, FALSE);
496}

Referenced by process_system_pointer_pdu(), and rdp5_process().

◆ ui_triblt()

void ui_triblt ( uint8  opcode,
int  x,
int  y,
int  cx,
int  cy,
HBITMAP  src,
int  srcx,
int  srcy,
BRUSH brush,
int  bgcolour,
int  fgcolour 
)

Definition at line 731 of file vnc.c.

735{
736 /* This is potentially difficult to do in general. Until someone
737 comes up with a more efficient way of doing it I am using cases. */
738
739 switch (opcode)
740 {
741 case 0x69: /* PDSxxn */
742 ui_memblt(ROP2_XOR, x, y, cx, cy, src, srcx, srcy);
743 ui_patblt(ROP2_NXOR, x, y, cx, cy, brush, bgcolour, fgcolour);
744 break;
745
746 case 0xb8: /* PSDPxax */
747 ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
748 ui_memblt(ROP2_AND, x, y, cx, cy, src, srcx, srcy);
749 ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour);
750 break;
751
752 default:
753 unimpl("ui_triblt 1x%x\n", opcode);
754 ui_memblt(ROP2_COPY, x, y, cx, cy, src, srcx, srcy);
755 }
756
757}
#define ROP2_NXOR
Definition: constants.h:269
void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
Definition: vnc.c:600
void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
Definition: vnc.c:692

◆ vncAndBlitFrom()

void vncAndBlitFrom ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncBuffer src,
int  srcx,
int  srcy 
)

Definition at line 1141 of file vnc.c.

1142{
1143 int xx, yy;
1144
1145 vncHideCursor();
1146
1147 // xsrc,ysrc provide tiling copy support.
1148 for (yy = y; yy < y + h; yy++)
1149 {
1150 int ysrc = srcy + yy - y;
1151 while (ysrc >= src->h)
1152 ysrc -= src->h;
1153 for (xx = x; xx < x + w; xx++)
1154 {
1155 vncPixel p, pp;
1156 int xsrc = srcx + xx - x;
1157 while (xsrc >= src->linew)
1158 xsrc -= src->linew;
1159 p = GETPIXEL(src, xsrc, ysrc);
1160 pp = GETPIXEL(frameBuffer, xx, yy);
1161 // and blit!
1162 SETPIXEL(frameBuffer, xx, yy, p & pp);
1163 }
1164 }
1165
1166 rfbMarkRectAsModified(s, x, y, x + w, y + h);
1167}
GLdouble s
Definition: gl.h:2039
GLfloat GLfloat p
Definition: glext.h:8902
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define GETPIXEL(buf, x, y)
Definition: vnc.c:1019
#define SETPIXEL(buf, x, y, p)
Definition: vnc.c:1021
void vncHideCursor()
Definition: vnc.c:85
unsigned int vncPixel
Definition: vnc.h:8

Referenced by ui_memblt().

◆ vncCopyBlit()

void vncCopyBlit ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
int  srcx,
int  srcy 
)

Definition at line 1068 of file vnc.c.

1069{
1070 /* LibVNCServer already knows how to copy the data. */
1071 rfbDoCopyRect(s, x, y, x + w, y + h, x - srcx, y - srcy);
1072}

Referenced by ui_screenblt().

◆ vncCopyBlitFrom()

void vncCopyBlitFrom ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncBuffer src,
int  srcx,
int  srcy 
)

Definition at line 1075 of file vnc.c.

1076{
1077 vncCopyBlitFromNoEncode(s, x, y, w, h, src, srcx, srcy);
1078 rfbMarkRectAsModified(s, x, y, x + w, y + h);
1079}
void vncCopyBlitFromNoEncode(rfbScreenInfoPtr s, int x, int y, int w, int h, vncBuffer *src, int srcx, int srcy)
Definition: vnc.c:1025

Referenced by ui_desktop_restore(), ui_draw_glyph(), ui_memblt(), ui_paint_bitmap(), and ui_patblt().

◆ vncCopyBlitFromNoEncode()

void vncCopyBlitFromNoEncode ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncBuffer src,
int  srcx,
int  srcy 
)

Definition at line 1025 of file vnc.c.

1027{
1028 int xx, yy;
1029
1030 vncHideCursor();
1031
1032 if (s->serverFormat.bitsPerPixel == src->format->bitsPerPixel
1033 && srcx + w <= src->w && srcy + h <= src->h)
1034 {
1035 //simple copy
1036 uint8_t *srcdata, *dstdata;
1037 srcdata = src->data + (srcy * src->linew + srcx);
1038 dstdata = s->frameBuffer + (y * s->paddedWidthInBytes + x);
1039 for (yy = 0; yy < h; yy++)
1040 {
1041 memcpy(dstdata, srcdata, w);
1042 dstdata += s->paddedWidthInBytes;
1043 srcdata += src->linew;
1044 }
1045 }
1046 else
1047 {
1048 // xsrc,ysrc provide tiling copy support.
1049 for (yy = y; yy < y + h; yy++)
1050 {
1051 int ysrc = srcy + yy - y;
1052 while (ysrc >= src->h)
1053 ysrc -= src->h;
1054 for (xx = x; xx < x + w; xx++)
1055 {
1056 vncPixel p;
1057 int xsrc = srcx + xx - x;
1058 while (xsrc >= src->linew)
1059 xsrc -= src->linew;
1060 p = GETPIXEL(src, xsrc, ysrc);
1061 SETPIXEL(frameBuffer, xx, yy, p);
1062 }
1063 }
1064 }
1065}

Referenced by vncCopyBlitFrom().

◆ vncDeleteBuffer()

void vncDeleteBuffer ( vncBuffer b)

Definition at line 1170 of file vnc.c.

1171{
1172 if (b->owner)
1173 xfree(b->data);
1174 xfree(b);
1175}
void xfree(void *mem)
Definition: uimain.c:758
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Referenced by ui_desktop_restore(), ui_destroy_bitmap(), ui_draw_glyph(), ui_paint_bitmap(), and vncNewCursor().

◆ vncDeleteColourMap()

void vncDeleteColourMap ( rfbColourMap *  m)

Definition at line 1333 of file vnc.c.

1334{
1335 if (m->data.bytes)
1336 free(m->data.bytes);
1337 m->count = 0;
1338}
#define free
Definition: debug_ros.c:5

Referenced by ui_destroy_colourmap(), and vncSetColourMap().

◆ vncDupBuffer()

vncBuffer * vncDupBuffer ( vncBuffer b)

Definition at line 1003 of file vnc.c.

1004{
1005 vncBuffer *buf = vncNewBuffer(b->w, b->h, b->format->depth);
1006 memcpy(buf->data, b->data, b->linew * b->h * b->format->bitsPerPixel / 8);
1007 return buf;
1008}

Referenced by ui_draw_glyph().

◆ vncGetPixel()

vncPixel vncGetPixel ( vncBuffer b,
int  x,
int  y 
)

Definition at line 1218 of file vnc.c.

1219{
1220 unsigned long offset = (x + (y * (b->linew))) * (b->format->bitsPerPixel >> 3);
1221 return ((uint8_t *) (b->data))[offset];
1222}

Referenced by ui_draw_glyph(), and ui_patblt().

◆ vncGetRect()

vncBuffer * vncGetRect ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 1272 of file vnc.c.

1273{
1274 int xx, yy;
1275 vncBuffer *b = vncNewBuffer(w, h, s->serverFormat.depth);
1276
1277 vncHideCursor();
1278
1279 if (s->serverFormat.bitsPerPixel == 8)
1280 {
1281 //simple copy
1282 int srcstep, dststep;
1283 char *srcdata, *dstdata;
1284 srcstep = s->paddedWidthInBytes * s->serverFormat.bitsPerPixel / 8;
1285 dststep = w * s->serverFormat.bitsPerPixel / 8;
1286 dstdata = b->data;
1287 srcdata = s->frameBuffer + (y * srcstep + x * s->serverFormat.bitsPerPixel / 8);
1288 for (yy = 0; yy < h; yy++)
1289 {
1290 memcpy(dstdata, srcdata, dststep);
1291 dstdata += dststep;
1292 srcdata += srcstep;
1293 }
1294 }
1295 else
1296 {
1297 for (yy = y; yy < y + h; yy++)
1298 {
1299 for (xx = x; xx < x + w; xx++)
1300 {
1301 SETPIXEL(b, xx - x, yy - y, GETPIXEL(frameBuffer, xx, yy));
1302 }
1303 }
1304 }
1305
1306 return b;
1307}
#define b
Definition: ke_i.h:79

Referenced by ui_desktop_save(), and ui_destblt().

◆ vncHideCursor()

void vncHideCursor ( )

Definition at line 85 of file vnc.c.

86{
87 if (server->clientHead)
88 rfbUndrawCursor(server);
89}

Referenced by vncAndBlitFrom(), vncCopyBlitFromNoEncode(), vncGetRect(), vncSetRect(), vncTransBlitFrom(), and vncXorBlitFrom().

◆ vncKey()

void vncKey ( rfbBool  down,
rfbKeySym  keysym,
struct _rfbClientRec *  cl 
)

Definition at line 154 of file vnc.c.

155{
156 uint32 ev_time = time(NULL);
157 key_translation tr = { 0, 0 };
158
159 if (keysym >= FIRST_MODIFIER && keysym <= LAST_MODIFIER)
160 {
161 /* TODO: fake local state */
162 keystate[keysym - FIRST_MODIFIER] = down;
163 }
164
165 if (down)
166 {
167 /* TODO: fake local state */
168 if (handle_special_keys(keysym, 0, ev_time, True))
169 return;
170
171 /* TODO: fake local state */
172 tr = xkeymap_translate_key(keysym, 0, 0);
173
174 if (tr.scancode == 0)
175 return;
176
177 ensure_remote_modifiers(ev_time, tr);
178
180 }
181 else
182 {
183 /* todO: fake local state */
184 if (handle_special_keys(keysym, 0, ev_time, False))
185 return;
186
187 /* todO: fake local state */
188 tr = xkeymap_translate_key(keysym, 0, 0);
189
190 if (tr.scancode == 0)
191 return;
192
194 }
195}
#define RDP_KEYPRESS
Definition: constants.h:251
#define RDP_KEYRELEASE
Definition: constants.h:252
RD_BOOL handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, RD_BOOL pressed)
void rdp_send_scancode(uint32 time, uint16 flags, uint8 scancode)
key_translation xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state)
void ensure_remote_modifiers(uint32 ev_time, key_translation tr)
unsigned int uint32
Definition: types.h:32
#define False
Definition: types.h:25
#define True
Definition: types.h:24
#define down(mutex)
Definition: glue.h:29
__u16 time
Definition: mkdosfs.c:8
uint8 scancode
Definition: types.h:132

Referenced by ui_create_window().

◆ vncLookupColour()

uint8_t vncLookupColour ( rfbColourMap *  colourMap,
uint8_t p 
)

Definition at line 403 of file vnc.c.

404{
405 uint8_t i, i1 = 0;
406 uint8_t *cm = colourMap->data.bytes;
407 uint32_t m, m1 = abs(cm[0] - p[0]) + abs(cm[1] - p[1]) + abs(cm[2] - p[2]);
408 for (i = 1; i < 255; i++)
409 {
410 m = abs(cm[i * 3] - p[0]) + abs(cm[i * 3 + 1] - p[1]) + abs(cm[i * 3 + 2] - p[2]);
411 if (m < m1)
412 {
413 m1 = m;
414 i1 = i;
415 }
416 }
417 return (i1);
418}
#define abs(i)
Definition: fconv.c:206

Referenced by ui_create_cursor().

◆ vncMouse()

void vncMouse ( int  buttonMask,
int  x,
int  y,
struct _rfbClientRec *  cl 
)

Definition at line 198 of file vnc.c.

199{
200 int b;
201 uint32 ev_time = time(NULL);
202
204
205 for (b = 0; b < 3; b++)
206 {
207 int bb = 1 << (b);
208 if (!(lastbuttons & bb) && (buttonMask & bb))
209 {
212 }
213 else if ((lastbuttons & bb) && !(buttonMask & bb))
214 {
216 }
217 }
218 lastbuttons = buttonMask;
219
220 /* handle cursor */
221 rfbDefaultPtrAddEvent(buttonMask, x, y, cl);
222}
#define MOUSE_FLAG_DOWN
Definition: constants.h:260
@ RDP_INPUT_MOUSE
Definition: constants.h:235
#define MOUSE_FLAG_MOVE
Definition: constants.h:254
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
static int lastbuttons
Definition: vnc.c:128
int mouseLookup[3]
Definition: vnc.c:95

Referenced by ui_create_window().

◆ vncNewBuffer()

vncBuffer * vncNewBuffer ( int  w,
int  h,
int  depth 
)

Definition at line 990 of file vnc.c.

991{
992 vncBuffer *b = (vncBuffer *) xmalloc(sizeof(vncBuffer));
993 b->format = vncNewFormat(depth);
994 b->data = (void *) xmalloc(w * h * (b->format->bitsPerPixel / 8));
995 b->owner = 1;
996 b->w = w;
997 b->h = h;
998 b->linew = w;
999 return b;
1000}
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
rfbPixelFormat * vncNewFormat(int depth)
Definition: vnc.c:984

Referenced by ui_create_bitmap(), ui_create_glyph(), ui_desktop_restore(), ui_patblt(), vncDupBuffer(), and vncGetRect().

◆ vncNewColourMap()

rfbColourMap * vncNewColourMap ( rfbScreenInfoPtr  s,
int  n 
)

Definition at line 1312 of file vnc.c.

1313{
1314 rfbColourMap *m = (rfbColourMap *) xmalloc(sizeof(rfbColourMap));
1315 m->is16 = FALSE;
1316 m->count = n;
1317 m->data.bytes = (uint8_t *) xmalloc(n * 3);
1318 return m;
1319}

Referenced by ui_create_colourmap().

◆ vncNewCursor()

rfbCursorPtr vncNewCursor ( vncBuffer mask,
vncBuffer pointer,
int  hotx,
int  hoty 
)

Definition at line 1179 of file vnc.c.

1180{
1181 int i, j, w = (mask->w + 7) / 8, mask_size = w * mask->h,
1182 pointer_size = pointer->w * pointer->h;
1183 rfbCursorPtr c = (rfbCursorPtr) xmalloc(sizeof(rfbCursor));
1184
1185 if (mask->w != pointer->w || mask->h != pointer->h)
1186 error("ERROR! Mask is %dx%d, Pointer is %dx%d\n",
1187 mask->w, mask->h, pointer->w, pointer->h);
1188
1189 c->xhot = hotx;
1190 c->yhot = hoty;
1191 c->width = mask->w;
1192 c->height = mask->h;
1193
1194 c->mask = (char *) xmalloc(mask_size);
1195 for (j = 0; j < c->height; j++)
1196 for (i = 0; i < w; i++)
1197 c->mask[j * w + i] =
1198 reverseByte[((unsigned char *) mask->data)[(j) * w + i]];
1200
1201 c->source = 0;
1202 c->richSource = (char *) xmalloc(pointer_size);
1203 memcpy(c->richSource, pointer->data, pointer_size);
1205
1206 return c;
1207}
const GLubyte * c
Definition: glext.h:8905
GLsizei const GLvoid * pointer
Definition: glext.h:5848
#define c
Definition: ke_i.h:80
unsigned int pointer_size
Definition: widl.c:158

◆ vncNewFormat()

rfbPixelFormat * vncNewFormat ( int  depth)

Definition at line 984 of file vnc.c.

985{
986 return &(vnc_formats[(depth + 1) / 8 - 1]);
987}
rfbPixelFormat vnc_formats[]
Definition: vnc.c:972

Referenced by vncNewBuffer().

◆ vncPrintStats()

void vncPrintStats ( )

Definition at line 1011 of file vnc.c.

1012{
1013 if (server && server->clientHead)
1014 rfbPrintStats(server->clientHead);
1015}

◆ vncSetColourMap()

void vncSetColourMap ( rfbScreenInfoPtr  s,
rfbColourMap *  m 
)

Definition at line 1341 of file vnc.c.

1342{
1343 vncDeleteColourMap(&s->colourMap);
1344 s->colourMap = *m;
1345 rfbSetClientColourMaps(s, 0, 0);
1346}

Referenced by ui_set_colourmap().

◆ vncSetColourMapEntry()

void vncSetColourMapEntry ( rfbColourMap *  m,
int  i,
vncPixel  r,
vncPixel  g,
vncPixel  b 
)

Definition at line 1322 of file vnc.c.

1323{
1324 if (i < m->count)
1325 {
1326 m->data.bytes[3 * i + 0] = r;
1327 m->data.bytes[3 * i + 1] = g;
1328 m->data.bytes[3 * i + 2] = b;
1329 }
1330}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean g
Definition: glext.h:6204

Referenced by ui_create_colourmap().

◆ vncSetCursor()

void vncSetCursor ( rfbScreenInfoPtr  s,
rfbCursorPtr  c 
)

Definition at line 1211 of file vnc.c.

1212{
1213 rfbSetCursor(s, c, FALSE);
1214}

◆ vncSetPixel()

void vncSetPixel ( vncBuffer b,
int  x,
int  y,
vncPixel  c 
)

Definition at line 1225 of file vnc.c.

1226{
1227 unsigned long offset = (x + (y * (b->linew))) * (b->format->bitsPerPixel >> 3);
1228 ((uint8_t *) (b->data))[offset] = c;
1229}

Referenced by ui_create_glyph(), ui_draw_glyph(), and ui_patblt().

◆ vncSetRect()

void vncSetRect ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncPixel  c 
)

Definition at line 1232 of file vnc.c.

1233{
1234 int xx, yy;
1235
1236 if (x + w > s->width)
1237 w = s->width - x;
1238 if (y + h > s->height)
1239 h = s->height - y;
1240 if (w <= 0 || h <= 0)
1241 return;
1242
1243 vncHideCursor();
1244
1245 // - Fill the rect in the local framebuffer
1246 if (s->serverFormat.bitsPerPixel == 8)
1247 {
1248 // - Simple 8-bit fill
1249 uint8_t *dstdata;
1250 dstdata = s->frameBuffer + (y * s->paddedWidthInBytes + x);
1251 for (yy = 0; yy < h; yy++)
1252 {
1253 memset(dstdata, c, w);
1254 dstdata += s->paddedWidthInBytes;
1255 }
1256 }
1257 else
1258 {
1259 for (yy = y; yy < y + h; yy++)
1260 {
1261 for (xx = x; xx < x + w; xx++)
1262 {
1263 SETPIXEL(frameBuffer, xx, yy, c);
1264 }
1265 }
1266 }
1267
1268 rfbMarkRectAsModified(s, x, y, x + w, y + h);
1269}
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ui_patblt(), and ui_rect().

◆ vncTransBlitFrom()

void vncTransBlitFrom ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncBuffer src,
int  srcx,
int  srcy,
int  bg 
)

Definition at line 1082 of file vnc.c.

1084{
1085 int xx, yy;
1086
1087 vncHideCursor();
1088
1089 // xsrc,ysrc provide tiling copy support.
1090 for (yy = y; yy < y + h; yy++)
1091 {
1092 int ysrc = srcy + yy - y;
1093 while (ysrc >= src->h)
1094 ysrc -= src->h;
1095 for (xx = x; xx < x + w; xx++)
1096 {
1097 vncPixel p;
1098 int xsrc = srcx + xx - x;
1099 while (xsrc >= src->linew)
1100 xsrc -= src->linew;
1101 p = GETPIXEL(src, xsrc, ysrc);
1102 // transparent blit!
1103 if (p != bg)
1104 SETPIXEL(frameBuffer, xx, yy, p);
1105 }
1106 }
1107
1108 rfbMarkRectAsModified(s, x, y, x + w, y + h);
1109}

Referenced by ui_draw_glyph(), and ui_memblt().

◆ vncwinClipRect()

BOOL vncwinClipRect ( int x,
int y,
int cx,
int cy 
)

Definition at line 102 of file vnc.c.

103{
104 if (*x + *cx > clipX + clipW)
105 *cx = clipX + clipW - *x;
106 if (*y + *cy > clipY + clipH)
107 *cy = clipY + clipH - *y;
108 if (*x < clipX)
109 {
110 *cx -= clipX - *x;
111 *x = clipX;
112 }
113 if (*y < clipY)
114 {
115 *cy -= clipY - *y;
116 *y = clipY;
117 }
118 if (*cx < 0 || *cy < 0)
119 *cx = *cy = 0;
120 return (*cx > 0 && *cy > 0 && *x < server->width && *y < server->height);
121}

Referenced by ui_desktop_restore(), ui_draw_glyph(), ui_memblt(), ui_patblt(), ui_rect(), and ui_screenblt().

◆ vncXorBlitFrom()

void vncXorBlitFrom ( rfbScreenInfoPtr  s,
int  x,
int  y,
int  w,
int  h,
vncBuffer src,
int  srcx,
int  srcy 
)

Definition at line 1112 of file vnc.c.

1113{
1114 int xx, yy;
1115
1116 vncHideCursor();
1117
1118 // xsrc,ysrc provide tiling copy support.
1119 for (yy = y; yy < y + h; yy++)
1120 {
1121 int ysrc = srcy + yy - y;
1122 while (ysrc >= src->h)
1123 ysrc -= src->h;
1124 for (xx = x; xx < x + w; xx++)
1125 {
1126 vncPixel p, pp;
1127 int xsrc = srcx + xx - x;
1128 while (xsrc >= src->linew)
1129 xsrc -= src->linew;
1130 p = GETPIXEL(src, xsrc, ysrc);
1131 pp = GETPIXEL(frameBuffer, xx, yy);
1132 // xor blit!
1133 SETPIXEL(frameBuffer, xx, yy, p ^ pp);
1134 }
1135 }
1136
1137 rfbMarkRectAsModified(s, x, y, x + w, y + h);
1138}

Referenced by ui_memblt(), and ui_patblt().

◆ xwin_toggle_fullscreen()

void xwin_toggle_fullscreen ( void  )

Definition at line 124 of file vnc.c.

125{
126}

Referenced by handle_special_keys().

Variable Documentation

◆ clipH

int clipH

Definition at line 99 of file vnc.c.

Referenced by ui_reset_clip(), ui_set_clip(), and vncwinClipRect().

◆ clipW

int clipW

Definition at line 99 of file vnc.c.

Referenced by ui_reset_clip(), ui_set_clip(), and vncwinClipRect().

◆ clipX

int clipX

Definition at line 99 of file vnc.c.

Referenced by ui_reset_clip(), ui_set_clip(), and vncwinClipRect().

◆ clipY

int clipY

Definition at line 99 of file vnc.c.

Referenced by ui_reset_clip(), ui_set_clip(), and vncwinClipRect().

◆ defer_time

int defer_time = 5

Definition at line 72 of file vnc.c.

Referenced by ui_create_window(), and ui_select().

◆ enable_compose

BOOL enable_compose = False

Definition at line 82 of file vnc.c.

◆ frameBuffer

◆ g_display

int g_display = 0

Definition at line 78 of file vnc.c.

◆ g_enable_compose

BOOL g_enable_compose = False

Definition at line 77 of file vnc.c.

◆ g_height

◆ g_title

char g_title[]
extern

Referenced by ui_create_window().

◆ g_width

◆ keylayout

int keylayout
extern

◆ keystate

BOOL keystate[LAST_MODIFIER - FIRST_MODIFIER]
static

Definition at line 133 of file vnc.c.

Referenced by get_key_state(), init_keyboard(), and vncKey().

◆ lastbuttons

int lastbuttons = 0
static

Definition at line 128 of file vnc.c.

Referenced by vncMouse().

◆ mouseLookup

int mouseLookup[3]
Initial value:
= {
}
#define MOUSE_FLAG_BUTTON1
Definition: constants.h:255
#define MOUSE_FLAG_BUTTON2
Definition: constants.h:256
#define MOUSE_FLAG_BUTTON3
Definition: constants.h:257

Definition at line 95 of file vnc.c.

Referenced by vncMouse().

◆ owncolmap

BOOL owncolmap = False

Definition at line 81 of file vnc.c.

◆ reverseByte

uint8_t reverseByte[0x100]
static

Definition at line 76 of file vnc.c.

Referenced by ui_create_glyph(), ui_create_window(), and vncNewCursor().

◆ rfb_port

int rfb_port = 5923

Definition at line 71 of file vnc.c.

Referenced by rdp2vnc_connect(), and ui_create_window().

◆ rfbClientSocket

int rfbClientSocket = 0

Definition at line 73 of file vnc.c.

Referenced by rdp2vnc_connect(), and ui_create_window().

◆ sendmotion

BOOL sendmotion
extern

◆ server

rfbScreenInfoPtr server ( void  ) = NULL
static

Definition at line 74 of file vnc.c.

Referenced by addserver(), build_canonical_path(), build_path(), build_resource_string(), build_servername(), client_server(), collect_connections(), copy_servername_from_name(), create_netconn(), create_netconn_socket(), create_overlapped_pipe(), create_pipe_pair(), CreateStubFromTypeInfo(), data_client_status(), debugclient_AttachProcess(), debugclient_ConnectProcessServer(), debugclient_ConnectProcessServerWide(), debugclient_CreateProcess(), debugclient_CreateProcess2(), debugclient_CreateProcess2Wide(), debugclient_CreateProcessAndAttach(), debugclient_CreateProcessAndAttach2(), debugclient_CreateProcessAndAttach2Wide(), debugclient_CreateProcessAndAttachWide(), debugclient_CreateProcessWide(), debugclient_DisconnectProcessServer(), debugclient_EndProcessServer(), debugclient_GetRunningProcessDescription(), debugclient_GetRunningProcessDescriptionWide(), debugclient_GetRunningProcessSystemIdByExecutableName(), debugclient_GetRunningProcessSystemIdByExecutableNameWide(), debugclient_GetRunningProcessSystemIds(), DECLARE_INTERFACE_(), dispatch_create_stub(), dispatch_typelib_ps_CreateStub(), domain_matches(), event_redirect(), file_layout_read_thread(), file_layout_write_thread(), get_dnsserversearchorder(), get_server(), HTTP_DomainMatches(), HTTP_ResolveName(), HTTP_ShouldBypassProxy(), InternetGetSecurityInfoByURLW(), is_local_machine(), is_local_machineA(), is_local_machineW(), iso_connect(), iso_reconnect(), main(), mcs_connect(), mcs_connect_start(), mcs_reconnect(), MprAdminIsServiceRunning(), ncacn_pipe_name(), NETCON_secure_connect(), netconn_verify_cert(), NetStatisticsGet(), nfs41_server_addrs(), nfs41_server_deref(), nfs41_server_find_or_create(), nfs41_server_ref(), nfs41_superblock_for_fh(), SEALED_::OnRedirect(), open_http(), parse_path(), parse_resource(), parse_server_and_port(), path_SetServer(), PathIsUNCEx(), pnfs_data_server_client(), process_host_port(), process_redirect_pdu(), PSetupCreateMonitorInfo(), PSFactoryBuffer_CreateStub(), rdp2vnc_connect(), rdp_connect(), rdp_reconnect(), register_server(), RPCRT4_AllocBinding(), RPCRT4_BuildHttpFlowControlHeader(), rpcrt4_conn_tcp_handoff(), RPCRT4_CreateBindingA(), RPCRT4_CreateBindingW(), RPCRT4_CreateConnection(), RPCRT4_ParseHttpFlowControlHeader(), sec_connect(), sec_reconnect(), server_addref(), server_compare(), server_create(), server_free(), server_ref_locked(), server_release(), set_server_for_hostname(), SetUpListener(), should_bypass_proxy(), START_TEST(), tcp_connect(), tcp_socketpair(), tcp_socketpair_ovl(), test_authentication(), test_events(), test_file_info(), test_GetNamedPipeInfo(), test_NamedPipeHandleState(), test_overlapped_transport(), test_ReadFile(), test_readfileex_pending(), test_security_info(), test_tcp(), test_udp(), test_Win32_Process(), testAuth(), testSignSeal(), typelib_stub_init(), ui_bell(), ui_create_colourmap(), ui_create_cursor(), ui_create_window(), ui_desktop_restore(), ui_desktop_save(), ui_destblt(), ui_destroy_window(), ui_draw_glyph(), ui_line(), ui_memblt(), ui_move_pointer(), ui_paint_bitmap(), ui_patblt(), ui_rect(), ui_resize_window(), ui_screenblt(), ui_select(), ui_set_colourmap(), ui_set_cursor(), ui_set_null_cursor(), update_server(), vncHideCursor(), vncPrintStats(), wbem_locator_ConnectServer(), WDML_EventProc(), WDML_RemoveServer(), WinHttpConnect(), WinMGMTS_ParseDisplayName(), WTSEnumerateProcessesExA(), WTSEnumerateProcessesExW(), WTSEnumerateSessionsExA(), and WTSEnumerateSessionsExW().

◆ vnc_formats

rfbPixelFormat vnc_formats[]
Initial value:
= {
{8, 8, 1, 0, 7, 7, 3, 0, 3, 6}
,
{16, 16, 1, 1, 31, 63, 31, 0, 5, 10}
,
{32, 24, 1, 1, 255, 255, 255, 0, 8, 16}
,
{32, 32, 1, 1, 2047, 2047, 1023, 0, 11, 22}
}

Definition at line 972 of file vnc.c.

Referenced by vncNewFormat().