summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Griffis <agriffis@gentoo.org>2003-04-28 16:53:28 +0000
committerAron Griffis <agriffis@gentoo.org>2003-04-28 16:53:28 +0000
commit191672d54c4c835f4b68c126bff7a9a584f6615c (patch)
treeae727a53f8c3729800165ba99e94d650a3727609 /net-misc/rdesktop
parentadd patch for rudimentary clipboard support (diff)
downloadhistorical-191672d54c4c835f4b68c126bff7a9a584f6615c.tar.gz
historical-191672d54c4c835f4b68c126bff7a9a584f6615c.tar.bz2
historical-191672d54c4c835f4b68c126bff7a9a584f6615c.zip
add patch for rudimentary clipboard support
Diffstat (limited to 'net-misc/rdesktop')
-rw-r--r--net-misc/rdesktop/Manifest4
-rw-r--r--net-misc/rdesktop/files/digest-rdesktop-1.2.0-r11
-rw-r--r--net-misc/rdesktop/files/rdesktop-paste.patch219
-rw-r--r--net-misc/rdesktop/rdesktop-1.2.0-r1.ebuild62
4 files changed, 284 insertions, 2 deletions
diff --git a/net-misc/rdesktop/Manifest b/net-misc/rdesktop/Manifest
index 43689ed125e4..4db4cc37eb08 100644
--- a/net-misc/rdesktop/Manifest
+++ b/net-misc/rdesktop/Manifest
@@ -1,9 +1,9 @@
-MD5 dcc814da0ad81fe11b032165866f1ad1 ChangeLog 2025
+MD5 9142fef9efd616e5a207bc5981291193 ChangeLog 2369
MD5 6cc289143e96cf2b38cc201595414f4f rdesktop-1.1.0-r1.ebuild 1116
MD5 c10b51068b3b9620fafebe48b8f30e93 rdesktop-1.1.0.19.9.0.ebuild 1483
MD5 bd418ae699f0b50754737bdce5f36875 rdesktop-1.2.0.ebuild 1061
MD5 aaa16477dc9796bc4140c36f981dd0ee rdesktop-1.2_beta1-r1.ebuild 1089
-MD5 2c5b14bdcf9ab4154b5ad78b0f35f281 rdesktop-1.2.0-r1.ebuild 1660
+MD5 9faa41120ce416a4c36b26bd49ee50d9 rdesktop-1.2.0-r1.ebuild 1667
MD5 b725fe39705164e5a09322c86b51404e files/digest-rdesktop-1.1.0-r1 65
MD5 aeb3de64582b54e5628b30a70a493f09 files/digest-rdesktop-1.1.0.19.9.0 142
MD5 a79de715834dc26c2336e60271ea10d2 files/digest-rdesktop-1.2.0 66
diff --git a/net-misc/rdesktop/files/digest-rdesktop-1.2.0-r1 b/net-misc/rdesktop/files/digest-rdesktop-1.2.0-r1
new file mode 100644
index 000000000000..514ca21fb75d
--- /dev/null
+++ b/net-misc/rdesktop/files/digest-rdesktop-1.2.0-r1
@@ -0,0 +1 @@
+MD5 b5e108e83e9de883e965a2bb0c7e7036 rdesktop-1.2.0.tar.gz 125674
diff --git a/net-misc/rdesktop/files/rdesktop-paste.patch b/net-misc/rdesktop/files/rdesktop-paste.patch
new file mode 100644
index 000000000000..4a5bbdfa4bcd
--- /dev/null
+++ b/net-misc/rdesktop/files/rdesktop-paste.patch
@@ -0,0 +1,219 @@
+diff -bBdru -x Makeconf -x TAGS rdesktop-1.2.0/proto.h rdesktop-1.2.0-paste/proto.h
+--- rdesktop-1.2.0/proto.h Tue Jan 28 12:11:01 2003
++++ rdesktop-1.2.0-paste/proto.h Wed Apr 2 17:47:56 2003
+@@ -77,6 +77,7 @@
+ void ensure_remote_modifiers(uint32 ev_time, key_translation tr);
+ void reset_modifier_keys(unsigned int state);
+ void rdp_send_scancode(uint32 time, uint16 flags, uint8 scancode);
++void rdp_send_keystring(uint32 time, const unsigned char *string);
+ /* xwin.c */
+ void mwm_hide_decorations(void);
+ BOOL get_key_state(unsigned int state, uint32 keysym);
+diff -bBdru -x Makeconf -x TAGS rdesktop-1.2.0/xkeymap.c rdesktop-1.2.0-paste/xkeymap.c
+--- rdesktop-1.2.0/xkeymap.c Thu Jan 30 11:04:07 2003
++++ rdesktop-1.2.0-paste/xkeymap.c Thu Apr 3 13:16:49 2003
+@@ -19,6 +19,7 @@
+ */
+
+ #include <X11/Xlib.h>
++#include <X11/Xutil.h>
+ #define XK_MISCELLANY
+ #include <X11/keysymdef.h>
+ #include <ctype.h>
+@@ -41,6 +42,15 @@
+ static int min_keycode;
+ static uint16 remote_modifier_state = 0;
+
++typedef struct
++{
++ KeySym sym;
++ unsigned int keycode;
++ unsigned int state;
++} ascii_map_entry;
++
++static ascii_map_entry ascii_map[256];
++
+ static void update_modifier_state(uint8 scancode, BOOL pressed);
+
+ static void
+@@ -208,6 +218,52 @@
+ return True;
+ }
+
++static void
++init_ascii_entry(unsigned int keycode, unsigned int state)
++{
++ XKeyEvent event;
++ unsigned char buf[4];
++ KeySym sym;
++ ascii_map_entry *ent;
++
++ event.type = KeyPress;
++ event.display = display;
++ event.keycode = keycode;
++ event.state = state;
++ if (XLookupString(&event, buf, sizeof(buf), &sym, NULL) == 1)
++ {
++ ent = &ascii_map[*buf];
++ if (ent->sym == NoSymbol)
++ {
++ ent->sym = sym;
++ ent->keycode = keycode;
++ ent->state = state;
++ }
++ }
++}
++
++static void
++init_ascii_map(unsigned int min_keycode, unsigned int max_keycode)
++{
++ int ix;
++ unsigned int key;
++
++ for (ix = 0; ix < 256; ix++)
++ ascii_map[ix].sym = NoSymbol;
++ for (key = min_keycode; key <= max_keycode; key++)
++ {
++ init_ascii_entry(key, 0);
++ init_ascii_entry(key, ShiftMask);
++ init_ascii_entry(key, LockMask);
++ init_ascii_entry(key, ControlMask);
++ init_ascii_entry(key, Mod1Mask);
++ init_ascii_entry(key, Mod2Mask);
++ init_ascii_entry(key, Mod3Mask);
++ init_ascii_entry(key, Mod4Mask);
++ init_ascii_entry(key, Mod5Mask);
++ }
++ ascii_map[10] = ascii_map[13]; /* Make '\n' send the Return key */
++}
+
+ /* Before connecting and creating UI */
+ void
+@@ -231,6 +287,7 @@
+ }
+
+ XDisplayKeycodes(display, &min_keycode, (int *) &max_keycode);
++ init_ascii_map(min_keycode, max_keycode);
+ }
+
+ /* Handles, for example, multi-scancode keypresses (which is not
+@@ -602,3 +659,26 @@
+ rdp_send_input(time, RDP_INPUT_SCANCODE, flags, scancode, 0);
+ }
+ }
++
++void
++rdp_send_keystring(uint32 time, const unsigned char *string)
++{
++ unsigned ch;
++ ascii_map_entry *ent;
++ key_translation tr;
++
++ while ((ch = *string++))
++ {
++ ent = &ascii_map[ch];
++ if (ent->sym == NoSymbol)
++ fprintf(stderr, "ascii_map failed for %03o\n", ch);
++ else
++ {
++ tr = xkeymap_translate_key(ent->sym, ent->keycode, ent->state);
++ ensure_remote_modifiers(time, tr);
++ rdp_send_scancode(time, tr.modifiers, tr.scancode);
++ rdp_send_scancode(time, tr.modifiers|RDP_KEYRELEASE, tr.scancode);
++ }
++ }
++}
++
+diff -bBdru -x Makeconf -x TAGS rdesktop-1.2.0/xwin.c rdesktop-1.2.0-paste/xwin.c
+--- rdesktop-1.2.0/xwin.c Thu Jan 30 11:27:45 2003
++++ rdesktop-1.2.0-paste/xwin.c Wed Apr 2 18:06:14 2003
+@@ -20,6 +20,7 @@
+
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
++#include <X11/Xatom.h>
+ #include <time.h>
+ #include <errno.h>
+ #include "rdesktop.h"
+@@ -47,7 +48,7 @@
+ static XIC IC;
+ static XModifierKeymap *mod_map;
+ static Cursor current_cursor;
+-static Atom protocol_atom, kill_atom;
++static Atom protocol_atom, kill_atom, selection_atom;
+
+ /* endianness */
+ static BOOL host_be;
+@@ -457,6 +458,7 @@
+ protocol_atom = XInternAtom(display, "WM_PROTOCOLS", True);
+ kill_atom = XInternAtom(display, "WM_DELETE_WINDOW", True);
+ XSetWMProtocols(display, wnd, &kill_atom, 1);
++ selection_atom = XInternAtom(display, "RdeskopSelect", False);
+
+ return True;
+ }
+@@ -495,6 +497,30 @@
+ }
+ }
+
++static void
++xwin_send_selection(XEvent *xevent)
++{
++ Atom act_type;
++ int act_fmt;
++ unsigned long nitems;
++ unsigned long bytes_after;
++ unsigned char *prop;
++
++ if (xevent->xselection.property == None)
++ fputs("selection conversion failed\n", stderr);
++ else
++ {
++ if (XGetWindowProperty(display, wnd, selection_atom, 0, 256, True,
++ XA_STRING, &act_type, &act_fmt,
++ &nitems, &bytes_after, &prop) == 0)
++ {
++ rdp_send_keystring(xevent->xselection.time, prop);
++ }
++ else
++ fputs("failed to fetch selection window property\n", stderr);
++ }
++}
++
+ /* Process all events in Xlib queue
+ Returns 0 after user quit, 1 otherwise */
+ static int
+@@ -594,10 +620,23 @@
+ break;
+
+ case ButtonPress:
++ if (xevent.xbutton.button == Button2)
++ {
++ /* request the primary selection */
++ XConvertSelection(display,
++ XA_PRIMARY,
++ XA_STRING,
++ selection_atom,
++ wnd,
++ xevent.xbutton.time);
++ break;
++ }
+ flags = MOUSE_FLAG_DOWN;
+ /* fall through */
+
+ case ButtonRelease:
++ if (xevent.xbutton.button == Button2)
++ break;
+ button = xkeymap_translate_button(xevent.xbutton.button);
+ if (button == 0)
+ break;
+@@ -677,6 +716,9 @@
+ }
+ break;
+
++ case SelectionNotify:
++ xwin_send_selection(&xevent);
++ break;
+ }
+ }
+ /* Keep going */
diff --git a/net-misc/rdesktop/rdesktop-1.2.0-r1.ebuild b/net-misc/rdesktop/rdesktop-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..325ed01ccded
--- /dev/null
+++ b/net-misc/rdesktop/rdesktop-1.2.0-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/rdesktop/rdesktop-1.2.0-r1.ebuild,v 1.1 2003/04/28 16:53:23 agriffis Exp $
+
+IUSE="ssl"
+
+S=${WORKDIR}/${P}
+
+DESCRIPTION="A Remote Desktop Protocol Client"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://rdesktop.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~alpha ~sparc"
+
+DEPEND="x11-base/xfree
+ ssl? ( >=dev-libs/openssl-0.9.6b )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ # Apply patch from Steve Fosdick to do rudimentary X->TS
+ # cut'n'paste. This isn't really supported by the RDP4 protocol,
+ # but official support for clipboard interaction will be in RDP5.
+ # http://sf.net/mailarchive/forum.php?thread_id=1920955&forum_id=8865
+ epatch ${FILESDIR}/rdesktop-paste.patch || die "epatch failed"
+
+ # Note there is an additional patch further down that conversation
+ # to send a middle click to TS if the clipboard is empty. I
+ # don't think I'll need that. If somebody wants to add it here,
+ # that's fine for a later rev...
+}
+
+src_compile() {
+ local myconf
+
+ use ssl \
+ && myconf="--with-openssl=/usr/include/openssl" \
+ || myconf="--without-openssl"
+
+ [ "${DEBUG}" ] && myconf="${myconf} --with-debug"
+
+ sed -e "s:-O2:${CFLAGS}:g" Makefile > Makefile.tmp
+ mv Makefile.tmp Makefile
+ echo "CFLAGS += ${CXXFLAGS}" >> Makeconf
+
+ ./configure \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --sharedir=/usr/share/${PN} \
+ ${myconf} || die
+
+ emake || die
+}
+
+src_install () {
+ make DESTDIR=${D} install
+
+ dodoc COPYING doc/HACKING doc/TODO doc/keymapping.txt
+}