|
|
@ -117,6 +117,7 @@ int guess_bits_per_color(int bits_per_pixel) {
|
|
|
|
|
|
|
|
|
|
|
|
int XFlush_wr(Display *disp) {
|
|
|
|
int XFlush_wr(Display *disp) {
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!disp) {}
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if (disp) {
|
|
|
|
if (disp) {
|
|
|
@ -157,6 +158,7 @@ Status XShmGetImage_wr(Display *disp, Drawable d, XImage *image, int x, int y,
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
return XShmGetImage(disp, d, image, x, y, mask);
|
|
|
|
return XShmGetImage(disp, d, image, x, y, mask);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!disp || !d || !image || !x || !y || !mask) {}
|
|
|
|
return (Status) 0;
|
|
|
|
return (Status) 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -169,6 +171,7 @@ XImage *XShmCreateImage_wr(Display* disp, Visual* vis, unsigned int depth,
|
|
|
|
return XShmCreateImage(disp, vis, depth, format, data, shminfo,
|
|
|
|
return XShmCreateImage(disp, vis, depth, format, data, shminfo,
|
|
|
|
width, height);
|
|
|
|
width, height);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!disp || !vis || !depth || !format || !data || !shminfo || !width || !height) {}
|
|
|
|
return (XImage *) 0;
|
|
|
|
return (XImage *) 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -177,6 +180,7 @@ Status XShmAttach_wr(Display *disp, XShmSegmentInfo *shminfo) {
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
return XShmAttach(disp, shminfo);
|
|
|
|
return XShmAttach(disp, shminfo);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!disp || !shminfo) {}
|
|
|
|
return (Status) 0;
|
|
|
|
return (Status) 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -185,6 +189,7 @@ Status XShmDetach_wr(Display *disp, XShmSegmentInfo *shminfo) {
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
return XShmDetach(disp, shminfo);
|
|
|
|
return XShmDetach(disp, shminfo);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!disp || !shminfo) {}
|
|
|
|
return (Status) 0;
|
|
|
|
return (Status) 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -193,6 +198,7 @@ Bool XShmQueryExtension_wr(Display *disp) {
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
#if LIBVNCSERVER_HAVE_XSHM
|
|
|
|
return XShmQueryExtension(disp);
|
|
|
|
return XShmQueryExtension(disp);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!disp) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -202,6 +208,7 @@ Bool XShmQueryExtension_wr(Display *disp) {
|
|
|
|
XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
|
|
|
|
XImage *xreadscreen(Display *disp, Drawable d, int x, int y,
|
|
|
|
unsigned int width, unsigned int height, Bool show_cursor) {
|
|
|
|
unsigned int width, unsigned int height, Bool show_cursor) {
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!disp || !d || !x || !y || !width || !height || !show_cursor) {}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -231,6 +238,7 @@ XImage *XGetSubImage_wr(Display *disp, Drawable d, int x, int y,
|
|
|
|
int format, XImage *dest_image, int dest_x, int dest_y) {
|
|
|
|
int format, XImage *dest_image, int dest_x, int dest_y) {
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format || !dest_image || !dest_x || !dest_y) {}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
ADJUST_ROOTSHIFT
|
|
|
|
ADJUST_ROOTSHIFT
|
|
|
@ -264,6 +272,7 @@ XImage *XGetImage_wr(Display *disp, Drawable d, int x, int y,
|
|
|
|
unsigned int width, unsigned int height, unsigned long plane_mask,
|
|
|
|
unsigned int width, unsigned int height, unsigned long plane_mask,
|
|
|
|
int format) {
|
|
|
|
int format) {
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!disp || !d || !x || !y || !width || !height || !plane_mask || !format) {}
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -309,6 +318,7 @@ XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
|
|
|
|
|
|
|
|
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!disp || !visual || !depth || !format || !offset || !data || !width || !height || !width || !bitmap_pad || !bytes_per_line) {}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if (overlay) {
|
|
|
|
if (overlay) {
|
|
|
@ -589,6 +599,7 @@ void init_track_keycode_state(void) {
|
|
|
|
static void upup_downdown_warning(KeyCode key, Bool down) {
|
|
|
|
static void upup_downdown_warning(KeyCode key, Bool down) {
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!key || !down) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if ((down ? 1:0) == keycode_state[(int) key]) {
|
|
|
|
if ((down ? 1:0) == keycode_state[(int) key]) {
|
|
|
@ -610,6 +621,7 @@ void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !key || !down || !delay) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -642,6 +654,7 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
|
|
|
|
|
|
|
|
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !key || !down || !delay || !first) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if (debug_keyboard) {
|
|
|
|
if (debug_keyboard) {
|
|
|
@ -699,6 +712,7 @@ void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !button || !is_press || !delay) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -725,6 +739,7 @@ void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !button || !is_press || !delay) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -764,6 +779,7 @@ void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
|
|
|
|
|
|
|
|
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !screen || !x || !y || !delay) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if (! xtrap_present) {
|
|
|
|
if (! xtrap_present) {
|
|
|
@ -788,6 +804,7 @@ void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
nox11_exit(1);
|
|
|
|
nox11_exit(1);
|
|
|
|
|
|
|
|
if (!dpy || !screen || !x || !y || !delay) {}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -825,6 +842,7 @@ Bool XTestCompareCurrentCursorWithWindow_wr(Display* dpy, Window w) {
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
return XTestCompareCurrentCursorWithWindow(dpy, w);
|
|
|
|
return XTestCompareCurrentCursorWithWindow(dpy, w);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!w) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -837,6 +855,7 @@ Bool XTestCompareCursorWithWindow_wr(Display* dpy, Window w, Cursor cursor) {
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
return XTestCompareCursorWithWindow(dpy, w, cursor);
|
|
|
|
return XTestCompareCursorWithWindow(dpy, w, cursor);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!dpy || !w || !cursor) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -847,6 +866,7 @@ Bool XTestQueryExtension_wr(Display *dpy, int *ev, int *er, int *maj,
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
return XTestQueryExtension(dpy, ev, er, maj, min);
|
|
|
|
return XTestQueryExtension(dpy, ev, er, maj, min);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!dpy || !ev || !er || !maj || !min) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -858,6 +878,8 @@ void XTestDiscard_wr(Display *dpy) {
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
RAWFB_RET_VOID
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
#if LIBVNCSERVER_HAVE_XTEST
|
|
|
|
XTestDiscard(dpy);
|
|
|
|
XTestDiscard(dpy);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!dpy) {}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -882,6 +904,7 @@ int XTestGrabControl_wr(Display *dpy, Bool impervious) {
|
|
|
|
XTestGrabControl(dpy, impervious);
|
|
|
|
XTestGrabControl(dpy, impervious);
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!dpy || !impervious) {}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -991,6 +1014,7 @@ Bool XRecordQueryVersion_wr(Display *dpy, int *maj, int *min) {
|
|
|
|
#if LIBVNCSERVER_HAVE_RECORD
|
|
|
|
#if LIBVNCSERVER_HAVE_RECORD
|
|
|
|
return XRecordQueryVersion(dpy, maj, min);
|
|
|
|
return XRecordQueryVersion(dpy, maj, min);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!dpy || !maj || !min) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1045,7 +1069,7 @@ int xauth_raw(int on) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Display *XOpenDisplay_wr(char *display_name) {
|
|
|
|
Display *XOpenDisplay_wr(char *display_name) {
|
|
|
|
Display *d;
|
|
|
|
Display *d = NULL;
|
|
|
|
int db = 0;
|
|
|
|
int db = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (! xauth_raw(1)) {
|
|
|
|
if (! xauth_raw(1)) {
|
|
|
@ -1053,6 +1077,7 @@ Display *XOpenDisplay_wr(char *display_name) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
rfbLog("This x11vnc was built without X11 support (-rawfb only).\n");
|
|
|
|
rfbLog("This x11vnc was built without X11 support (-rawfb only).\n");
|
|
|
|
|
|
|
|
if (!display_name || !d || !db) {}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -1086,12 +1111,13 @@ static int last_local_y = 0;
|
|
|
|
Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
|
|
|
|
Bool XQueryPointer_wr(Display *display, Window w, Window *root_return,
|
|
|
|
Window *child_return, int *root_x_return, int *root_y_return,
|
|
|
|
Window *child_return, int *root_x_return, int *root_y_return,
|
|
|
|
int *win_x_return, int *win_y_return, unsigned int *mask_return) {
|
|
|
|
int *win_x_return, int *win_y_return, unsigned int *mask_return) {
|
|
|
|
Bool rc;
|
|
|
|
|
|
|
|
XErrorHandler old_handler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!display || !w || !root_return || !child_return || !root_x_return || !root_y_return || !win_x_return || !win_y_return || !mask_return) {}
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
Bool rc;
|
|
|
|
|
|
|
|
XErrorHandler old_handler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (! display) {
|
|
|
|
if (! display) {
|
|
|
|
return False;
|
|
|
|
return False;
|
|
|
@ -1137,6 +1163,7 @@ Status XQueryTree_wr(Display *display, Window w, Window *root_return,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!display || !w || !root_return || !parent_return || !children_return || !nchildren_return) {}
|
|
|
|
return (Status) 0;
|
|
|
|
return (Status) 0;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if (! display) {
|
|
|
|
if (! display) {
|
|
|
@ -1164,6 +1191,7 @@ int XFree_wr(void *data) {
|
|
|
|
|
|
|
|
|
|
|
|
int XSelectInput_wr(Display *display, Window w, long event_mask) {
|
|
|
|
int XSelectInput_wr(Display *display, Window w, long event_mask) {
|
|
|
|
#if NO_X11
|
|
|
|
#if NO_X11
|
|
|
|
|
|
|
|
if (!display || !w || !event_mask) {}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
int rc;
|
|
|
|
int rc;
|
|
|
|