parent
5c5637f900
commit
8586cfc8cb
23
Makefile.in
23
Makefile.in
@ -20,17 +20,13 @@ CFLAGS = @CFLAGS@ @X_CFLAGS@ @DEFS@ -DKEYMAP_PATH=\"$(KEYMAP_PATH)\"
|
|||||||
LDFLAGS = @LDFLAGS@ @LIBS@ @X_LIBS@ @X_EXTRA_LIBS@
|
LDFLAGS = @LDFLAGS@ @LIBS@ @X_LIBS@ @X_EXTRA_LIBS@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
|
|
||||||
TARGETS = rdesktop @RDP2VNCTARGET@
|
TARGETS = rdesktop
|
||||||
VNCINC = @VNCINC@
|
|
||||||
LDVNC = @LDVNC@
|
|
||||||
VNCLINK = @VNCLINK@
|
|
||||||
SOUNDOBJ = @SOUNDOBJ@
|
SOUNDOBJ = @SOUNDOBJ@
|
||||||
SCARDOBJ = @SCARDOBJ@
|
SCARDOBJ = @SCARDOBJ@
|
||||||
CREDSSPOBJ = @CREDSSPOBJ@
|
CREDSSPOBJ = @CREDSSPOBJ@
|
||||||
|
|
||||||
RDPOBJ = tcp.o asn.o iso.o mcs.o secure.o licence.o rdp.o orders.o bitmap.o cache.o rdp5.o channels.o rdpdr.o serial.o printer.o disk.o parallel.o printercache.o mppc.o pstcache.o lspci.o seamless.o ssl.o utils.o
|
RDPOBJ = tcp.o asn.o iso.o mcs.o secure.o licence.o rdp.o orders.o bitmap.o cache.o rdp5.o channels.o rdpdr.o serial.o printer.o disk.o parallel.o printercache.o mppc.o pstcache.o lspci.o seamless.o ssl.o utils.o
|
||||||
X11OBJ = rdesktop.o xwin.o xkeymap.o ewmhints.o xclip.o cliprdr.o ctrl.o
|
X11OBJ = rdesktop.o xwin.o xkeymap.o ewmhints.o xclip.o cliprdr.o ctrl.o
|
||||||
VNCOBJ = vnc/rdp2vnc.o vnc/vnc.o vnc/xkeymap.o vnc/x11stubs.o
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
@ -38,21 +34,6 @@ all: $(TARGETS)
|
|||||||
rdesktop: $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ)
|
rdesktop: $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ)
|
||||||
$(CC) $(CFLAGS) -o rdesktop $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ) $(LDFLAGS) -lX11
|
$(CC) $(CFLAGS) -o rdesktop $(X11OBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ) $(LDFLAGS) -lX11
|
||||||
|
|
||||||
rdp2vnc: $(VNCOBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ)
|
|
||||||
$(VNCLINK) $(CFLAGS) -o rdp2vnc $(VNCOBJ) $(SOUNDOBJ) $(RDPOBJ) $(SCARDOBJ) $(CREDSSPOBJ) $(LDFLAGS) $(LDVNC)
|
|
||||||
|
|
||||||
vnc/rdp2vnc.o: rdesktop.c
|
|
||||||
$(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/rdp2vnc.o -c rdesktop.c
|
|
||||||
|
|
||||||
vnc/vnc.o: vnc/vnc.c
|
|
||||||
$(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/vnc.o -c vnc/vnc.c
|
|
||||||
|
|
||||||
vnc/xkeymap.o: xkeymap.c
|
|
||||||
$(CC) $(CFLAGS) $(VNCINC) -DRDP2VNC -o vnc/xkeymap.o -c xkeymap.c
|
|
||||||
|
|
||||||
vnc/x11stubs.o: vnc/x11stubs.c
|
|
||||||
$(CC) $(CFLAGS) $(VNCINC) -o vnc/x11stubs.o -c vnc/x11stubs.c
|
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: installbin installkeymaps installman
|
install: installbin installkeymaps installman
|
||||||
|
|
||||||
@ -91,7 +72,7 @@ proto:
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *~ vnc/*.o vnc/*~ rdesktop rdp2vnc
|
rm -f *.o *~ rdesktop
|
||||||
|
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
22
configure.ac
22
configure.ac
@ -234,28 +234,6 @@ AC_ARG_WITH(egd-socket,
|
|||||||
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
|
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# rdp2vnc
|
|
||||||
#
|
|
||||||
vncserverconfig=libvncserver-config
|
|
||||||
AC_ARG_WITH(libvncserver-config,
|
|
||||||
[ --with-libvncserver-config=CMD use CMD as libvncserver-config],
|
|
||||||
[vncserverconfig="$withval"]
|
|
||||||
)
|
|
||||||
AC_ARG_WITH(libvncserver,
|
|
||||||
[ --with-libvncserver make rdp2vnc],
|
|
||||||
[
|
|
||||||
VNCINC=`$vncserverconfig --cflags`
|
|
||||||
AC_SUBST(VNCINC)
|
|
||||||
LDVNC=`$vncserverconfig --libs`
|
|
||||||
AC_SUBST(LDVNC)
|
|
||||||
VNCLINK=`$vncserverconfig --link`
|
|
||||||
AC_SUBST(VNCLINK)
|
|
||||||
RDP2VNCTARGET="rdp2vnc"
|
|
||||||
AC_SUBST(RDP2VNCTARGET)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# sound
|
# sound
|
||||||
#
|
#
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
indent -bli0 -i8 -cli8 -npcs -l100 *.h *.c vnc/*.h vnc/*.c
|
indent -bli0 -i8 -cli8 -npcs -l100 *.h *.c
|
||||||
# Tweak in order to support both indent 2.2.10 and 2.2.11
|
# Tweak in order to support both indent 2.2.10 and 2.2.11
|
||||||
perl -pi -e 's|!!|! !|g' *.c
|
perl -pi -e 's|!!|! !|g' *.c
|
||||||
|
|
||||||
|
38
rdesktop.c
38
rdesktop.c
@ -152,13 +152,6 @@ extern RDPDR_DEVICE g_rdpdr_device[];
|
|||||||
extern uint32 g_num_devices;
|
extern uint32 g_num_devices;
|
||||||
extern char *g_rdpdr_clientname;
|
extern char *g_rdpdr_clientname;
|
||||||
|
|
||||||
#ifdef RDP2VNC
|
|
||||||
extern int rfb_port;
|
|
||||||
extern int defer_time;
|
|
||||||
void
|
|
||||||
rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password,
|
|
||||||
char *shell, char *directory);
|
|
||||||
#endif
|
|
||||||
/* Display usage information */
|
/* Display usage information */
|
||||||
static void
|
static void
|
||||||
usage(char *program)
|
usage(char *program)
|
||||||
@ -169,10 +162,6 @@ usage(char *program)
|
|||||||
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
|
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
|
||||||
|
|
||||||
fprintf(stderr, "Usage: %s [options] server[:port]\n", program);
|
fprintf(stderr, "Usage: %s [options] server[:port]\n", program);
|
||||||
#ifdef RDP2VNC
|
|
||||||
fprintf(stderr, " -V: vnc port\n");
|
|
||||||
fprintf(stderr, " -Q: defer time (ms)\n");
|
|
||||||
#endif
|
|
||||||
fprintf(stderr, " -u: user name\n");
|
fprintf(stderr, " -u: user name\n");
|
||||||
fprintf(stderr, " -d: domain\n");
|
fprintf(stderr, " -d: domain\n");
|
||||||
fprintf(stderr, " -s: shell / seamless application to start remotely\n");
|
fprintf(stderr, " -s: shell / seamless application to start remotely\n");
|
||||||
@ -565,30 +554,11 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
g_num_devices = 0;
|
g_num_devices = 0;
|
||||||
|
|
||||||
#ifdef RDP2VNC
|
|
||||||
#define VNCOPT "V:Q:"
|
|
||||||
#else
|
|
||||||
#define VNCOPT
|
|
||||||
#endif
|
|
||||||
while ((c = getopt(argc, argv,
|
while ((c = getopt(argc, argv,
|
||||||
VNCOPT "A:u:L:d:s:c:p:n:k:g:o:fbBeEitmzCDKS:T:NX:a:x:Pr:045vh?")) != -1)
|
"A:u:L:d:s:c:p:n:k:g:o:fbBeEitmzCDKS:T:NX:a:x:Pr:045vh?")) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
#ifdef RDP2VNC
|
|
||||||
case 'V':
|
|
||||||
rfb_port = strtol(optarg, NULL, 10);
|
|
||||||
if (rfb_port < 100)
|
|
||||||
rfb_port += 5900;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'Q':
|
|
||||||
defer_time = strtol(optarg, NULL, 10);
|
|
||||||
if (defer_time < 0)
|
|
||||||
defer_time = 0;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
g_seamless_rdp = True;
|
g_seamless_rdp = True;
|
||||||
STRNCPY(g_seamless_shell, optarg, sizeof(g_seamless_shell));
|
STRNCPY(g_seamless_shell, optarg, sizeof(g_seamless_shell));
|
||||||
@ -1096,11 +1066,6 @@ main(int argc, char *argv[])
|
|||||||
strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));
|
strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RDP2VNC
|
|
||||||
rdp2vnc_connect(server, flags, domain, g_password, shell, directory);
|
|
||||||
return EX_OK;
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* Only startup ctrl functionality is seamless are used for now. */
|
/* Only startup ctrl functionality is seamless are used for now. */
|
||||||
if (g_use_ctrl && g_seamless_rdp)
|
if (g_use_ctrl && g_seamless_rdp)
|
||||||
{
|
{
|
||||||
@ -1241,7 +1206,6 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
return handle_disconnect_reason(deactivated, ext_disc_reason);
|
return handle_disconnect_reason(deactivated, ext_disc_reason);
|
||||||
|
|
||||||
#endif
|
|
||||||
if (g_redirect_username)
|
if (g_redirect_username)
|
||||||
xfree(g_redirect_username);
|
xfree(g_redirect_username);
|
||||||
|
|
||||||
|
68
vnc/vnc.h
68
vnc/vnc.h
@ -1,68 +0,0 @@
|
|||||||
#ifndef VNC_H
|
|
||||||
#define VNC_H
|
|
||||||
|
|
||||||
#define BOOL rfb_BOOL
|
|
||||||
#include <rfb/rfb.h>
|
|
||||||
#undef BOOL
|
|
||||||
|
|
||||||
typedef unsigned int vncPixel;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint16_t w, h;
|
|
||||||
uint16_t linew;
|
|
||||||
rfbPixelFormat *format;
|
|
||||||
char *data;
|
|
||||||
BOOL owner;
|
|
||||||
}
|
|
||||||
vncBuffer;
|
|
||||||
|
|
||||||
extern int vncPreparedClientSocket;
|
|
||||||
extern int vncPreparedServerSocket;
|
|
||||||
|
|
||||||
/* - Buffer management */
|
|
||||||
extern vncBuffer *vncNewBuffer(int w, int h, int depth);
|
|
||||||
extern vncBuffer *vncDupBuffer(vncBuffer * b);
|
|
||||||
extern void vncDeleteBuffer(vncBuffer * b);
|
|
||||||
|
|
||||||
/* - Colourmaps */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t r, g, b;
|
|
||||||
}
|
|
||||||
vncColour;
|
|
||||||
|
|
||||||
extern void vncSetColourMap(rfbScreenInfoPtr s, rfbColourMap * m);
|
|
||||||
extern rfbColourMap *vncNewColourMap(rfbScreenInfoPtr s, int n);
|
|
||||||
extern void vncSetColourMapEntry(rfbColourMap * m, int i, vncPixel r, vncPixel g, vncPixel b);
|
|
||||||
extern void vncDeleteColourMap(rfbColourMap * m);
|
|
||||||
|
|
||||||
/* - Simple pixel manipulation */
|
|
||||||
extern vncPixel vncGetPixel(vncBuffer * b, int x, int y);
|
|
||||||
extern void vncSetPixel(vncBuffer * b, int x, int y, vncPixel c);
|
|
||||||
|
|
||||||
/* - Drawing primitives */
|
|
||||||
extern void vncSetRect(rfbScreenInfoPtr s, int x, int y, int w, int h, vncPixel c);
|
|
||||||
extern void vncCopyBlit(rfbScreenInfoPtr s, int x, int y, int w, int h, int srcx, int srcy);
|
|
||||||
extern void vncCopyBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
|
|
||||||
vncBuffer * b, int srcx, int srcy);
|
|
||||||
extern void vncTransBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
|
|
||||||
vncBuffer * b, int srcx, int srcy, int bg);
|
|
||||||
extern void vncXorBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
|
|
||||||
vncBuffer * b, int srcx, int srcy);
|
|
||||||
extern void vncAndBlitFrom(rfbScreenInfoPtr s, int x, int y, int w, int h,
|
|
||||||
vncBuffer * b, int srcx, int srcy);
|
|
||||||
extern vncBuffer *vncGetRect(rfbScreenInfoPtr s, int x, int y, int w, int h);
|
|
||||||
|
|
||||||
// - Low level VNC update primitives upon which the rest are based
|
|
||||||
extern void vncQueueCopyRect(rfbScreenInfoPtr s, int x, int y, int w, int h, int src_x, int src_y);
|
|
||||||
extern void vncQueueUpdate(rfbScreenInfoPtr s, int x, int y, int w, int h);
|
|
||||||
|
|
||||||
/* cursor */
|
|
||||||
extern rfbCursorPtr vncNewCursor(vncBuffer * mask, vncBuffer * pointer, int hotx, int hoty);
|
|
||||||
extern void vncSetCursor(rfbScreenInfoPtr s, rfbCursorPtr c);
|
|
||||||
|
|
||||||
int vncListenAtTcpAddr(unsigned short port);
|
|
||||||
void vncPrintStats();
|
|
||||||
|
|
||||||
#endif
|
|
1405
vnc/x11stubs.c
1405
vnc/x11stubs.c
File diff suppressed because it is too large
Load Diff
@ -1,33 +0,0 @@
|
|||||||
#ifndef NOXKEYMAP_H
|
|
||||||
#define NOXKEYMAP_H
|
|
||||||
|
|
||||||
/* Fake a few X11 calls */
|
|
||||||
|
|
||||||
#define XK_MISCELLANY
|
|
||||||
#include <rfb/rfb.h>
|
|
||||||
#include <rfb/keysym.h>
|
|
||||||
|
|
||||||
#define NoSymbol 0L
|
|
||||||
#define ShiftMask (1<<0)
|
|
||||||
#define LockMask (1<<1)
|
|
||||||
#define ControlMask (1<<2)
|
|
||||||
#define Mod1Mask (1<<3)
|
|
||||||
#define Mod2Mask (1<<4)
|
|
||||||
#define Mod3Mask (1<<5)
|
|
||||||
#define Mod4Mask (1<<6)
|
|
||||||
#define Mod5Mask (1<<7)
|
|
||||||
#define Button1 1
|
|
||||||
#define Button2 2
|
|
||||||
#define Button3 3
|
|
||||||
#define Button4 4
|
|
||||||
#define Button5 5
|
|
||||||
|
|
||||||
typedef int Display;
|
|
||||||
typedef int Window;
|
|
||||||
typedef rfbKeySym KeySym;
|
|
||||||
|
|
||||||
KeySym XStringToKeysym(const char *str);
|
|
||||||
const char *XKeysymToString(KeySym keysym);
|
|
||||||
void XDisplayKeycodes(Display * display, int *min_keycode, int *max_keycode);
|
|
||||||
|
|
||||||
#endif
|
|
@ -20,12 +20,8 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef RDP2VNC
|
|
||||||
#include "vnc/x11stubs.h"
|
|
||||||
#else
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -1027,16 +1023,12 @@ ensure_remote_modifiers(uint32 ev_time, key_translation tr)
|
|||||||
unsigned int
|
unsigned int
|
||||||
read_keyboard_state()
|
read_keyboard_state()
|
||||||
{
|
{
|
||||||
#ifdef RDP2VNC
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
unsigned int state;
|
unsigned int state;
|
||||||
Window wdummy;
|
Window wdummy;
|
||||||
int dummy;
|
int dummy;
|
||||||
|
|
||||||
XQueryPointer(g_display, g_wnd, &wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
|
XQueryPointer(g_display, g_wnd, &wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
|
||||||
return state;
|
return state;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user