├── build-common.xml
├── build-sourceforge.xml
├── gnu-getopt-1.0.11-java
└── lib
│ └── java-getopt-1.0.11.jar
├── gnu-getopt-1.0.13-java
└── lib
│ └── java-getopt-1.0.13.jar
├── keymaps
├── ar
├── da
├── de
├── en-gb
├── en-us
├── es
├── fi
├── fr
├── fr-be
├── hr
├── it
├── ja
├── lt
├── lv
├── mk
├── no
├── pl
├── pt
├── pt-br
├── ru
├── sl
├── sv
├── tk
└── tr
├── log4j-java1.1
└── log4j-java1.1.jar
├── src
└── com
│ └── elusiva
│ └── rdp
│ ├── Bitmap.java
│ ├── Cache.java
│ ├── Common.java
│ ├── CommunicationMonitor.java
│ ├── ConnectionException.java
│ ├── Constants.java
│ ├── DataBlob.java
│ ├── DisconnnectCodeMapper.java
│ ├── Glyph.java
│ ├── HexDump.java
│ ├── ISO.java
│ ├── Input.java
│ ├── Licence.java
│ ├── LicenceStore.java
│ ├── MCS.java
│ ├── OKDialog.java
│ ├── Options.java
│ ├── OptionsBuilder.java
│ ├── OrderException.java
│ ├── OrderState.java
│ ├── Orders.java
│ ├── PstCache.java
│ ├── RDPClientChooser.java
│ ├── RasterOp.java
│ ├── Rdesktop.java
│ ├── RdesktopCanvas.java
│ ├── RdesktopComponentAdapter.java
│ ├── RdesktopException.java
│ ├── RdesktopFocusListener.java
│ ├── RdesktopFrame.java
│ ├── RdesktopRunner.java
│ ├── RdesktopWindowAdapter.java
│ ├── Rdp.java
│ ├── RdpPacket.java
│ ├── Secure.java
│ ├── Utilities.java
│ ├── Version.java
│ ├── WrappedImage.java
│ ├── YesNoDialog.java
│ ├── applet
│ └── RdpApplet.java
│ ├── crypto
│ ├── BlockMessageDigest.java
│ ├── CryptoException.java
│ ├── Key.java
│ ├── MD5.java
│ ├── RC4.java
│ └── SHA1.java
│ ├── keymapping
│ ├── KeyCode.java
│ ├── KeyCode_FileBased.java
│ ├── KeyMapException.java
│ └── MapDef.java
│ ├── loader
│ └── JRdpLoader.java
│ ├── menu
│ └── RdpMenu.java
│ ├── orders
│ ├── BoundsOrder.java
│ ├── Brush.java
│ ├── DeskSaveOrder.java
│ ├── DestBltOrder.java
│ ├── LineOrder.java
│ ├── MemBltOrder.java
│ ├── Order.java
│ ├── PatBltOrder.java
│ ├── Pen.java
│ ├── PolyLineOrder.java
│ ├── RectangleOrder.java
│ ├── ScreenBltOrder.java
│ ├── Text2Order.java
│ └── TriBltOrder.java
│ ├── rdp5
│ ├── Rdp5.java
│ ├── TestChannel.java
│ ├── VChannel.java
│ ├── VChannels.java
│ └── cliprdr
│ │ ├── BMPToImageThread.java
│ │ ├── ClipBMP.java
│ │ ├── ClipChannel.java
│ │ ├── ClipInterface.java
│ │ ├── DIBHandler.java
│ │ ├── ImageSelection.java
│ │ ├── MetafilepictHandler.java
│ │ ├── TextHandler.java
│ │ ├── TypeHandler.java
│ │ ├── TypeHandlerList.java
│ │ └── UnicodeHandler.java
│ └── tools
│ └── SendEvent.java
├── src1.1
└── com
│ └── elusiva
│ └── rdp
│ ├── ISO_Localised.java
│ ├── Input_Localised.java
│ ├── KeyCode_FileBased_Localised.java
│ ├── LicenceStore_Localised.java
│ ├── RdesktopCanvas_Localised.java
│ ├── RdesktopFrame_Localised.java
│ ├── RdpPacket_Localised.java
│ └── Utilities_Localised.java
├── src1.2
└── com
│ └── elusiva
│ └── rdp
│ ├── ISO_Localised.java
│ ├── Input_Localised.java
│ ├── KeyCode_FileBased_Localised.java
│ ├── LicenceStore_Localised.java
│ ├── RdesktopCanvas_Localised.java
│ ├── RdesktopFrame_Localised.java
│ ├── RdpPacket_Localised.java
│ └── Utilities_Localised.java
├── src1.3
└── com
│ └── elusiva
│ └── rdp
│ ├── ISO_Localised.java
│ ├── Input_Localised.java
│ ├── KeyCode_FileBased_Localised.java
│ ├── LicenceStore_Localised.java
│ ├── RdesktopCanvas_Localised.java
│ ├── RdesktopFrame_Localised.java
│ ├── RdpPacket_Localised.java
│ └── Utilities_Localised.java
├── src1.4
└── com
│ └── elusiva
│ └── rdp
│ ├── ISO_Localised.java
│ ├── Input_Localised.java
│ ├── KeyCode_FileBased_Localised.java
│ ├── LicenceStore_Localised.java
│ ├── RdesktopCanvas_Localised.java
│ ├── RdesktopFrame_Localised.java
│ ├── RdpPacket_Localised.java
│ └── Utilities_Localised.java
└── src1.5
└── com
└── elusiva
└── rdp
├── ISO_Localised.java
├── Input_Localised.java
├── KeyCode_FileBased_Localised.java
├── LicenceStore_Localised.java
├── RdesktopCanvas_Localised.java
├── RdesktopFrame_Localised.java
├── RdpPacket_Localised.java
└── Utilities_Localised.java
/build-common.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 | * Copyright © 1995-1997
9 | * Systemics Ltd on behalf of the
10 | * Cryptix Development Team.
11 | *
All rights reserved.
12 | *
13 | * $Revision: 1.1.1.1 $
14 | * @author David Hopwood
15 | * @since Cryptix 2.2.2
16 | */
17 | public abstract class BlockMessageDigest
18 | {
19 | /**
20 | * The buffer used to store the last incomplete block.
21 | */
22 | private byte[] buffer;
23 |
24 | /**
25 | * The number of bytes currently stored in buffer
.
26 | */
27 | private int buffered;
28 |
29 | private String algorithm ;
30 | /**
31 | * The number of bytes that have been input to the digest.
32 | */
33 | private int count;
34 |
35 | private static final int MAX_COUNT = (1 << 28) -1;
36 |
37 | /**
38 | * The length of a data block for this algorithm.
39 | */
40 | private int data_length;
41 |
42 | /**
43 | * Constructs a message digest with the specified algorithm name.
44 | *
45 | * @param algorithm the standard name of the digest algorithm.
46 | */
47 | protected BlockMessageDigest(String algorithm)
48 | {
49 | this.algorithm = algorithm;
50 | data_length = engineGetDataLength();
51 | buffer = new byte[data_length];
52 | }
53 |
54 | /**
55 | * @return number of bits hashed so far?
56 | */
57 | protected int bitcount() {
58 | return count * 8;
59 | }
60 |
61 | /**
62 | * SPI: Resets the digest. Subclasses that override engineReset
63 | * should always call this implementation using super.engineReset()
.
64 | */
65 | public void engineReset()
66 | {
67 | buffered = 0;
68 | count = 0;
69 | }
70 |
71 | /**
72 | * SPI: Updates the message digest with a byte of new data.
73 | *
74 | * @param b the byte to be added.
75 | */
76 | public void engineUpdate(byte b) throws CryptoException
77 | {
78 | byte[] data = { b };
79 | engineUpdate(data, 0, 1);
80 | }
81 |
82 | /**
83 | * SPI: Updates the message digest with new data.
84 | *
85 | * @param data the data to be added.
86 | * @param offset the start of the data in the array.
87 | * @param length the number of bytes of data to add.
88 | */
89 | public void engineUpdate(byte[] data, int offset, int length) throws CryptoException
90 | {
91 | count += length;
92 | if (count > MAX_COUNT)
93 | throw new CryptoException(getAlgorithm() + ": Maximum input length exceeded");
94 |
95 | int datalen = data_length;
96 | int remainder;
97 |
98 | while (length >= (remainder = datalen - buffered)) {
99 | System.arraycopy(data, offset, buffer, buffered, remainder);
100 | engineTransform(buffer);
101 | length -= remainder;
102 | offset += remainder;
103 | buffered = 0;
104 | }
105 |
106 | if (length > 0) {
107 | System.arraycopy(data, offset, buffer, buffered, length);
108 | buffered += length;
109 | }
110 | }
111 |
112 | /**
113 | * SPI: Calculates the final digest. BlockMessageDigest
114 | * subclasses should not usually override this method.
115 | *
116 | * @return the digest as a byte array.
117 | */
118 | public byte[] engineDigest()
119 | {
120 | return engineDigest(buffer, buffered);
121 | }
122 |
123 | //
124 | // Override int engineDigest(byte[] buf, int offset, int len)
125 | // from Java 1.2 preview docs? For the time being no - it should work
126 | // anyway.
127 | //
128 |
129 | /**
130 | * SPI (for BlockMessageDigests only): Calculates the
131 | * final digest. data[0..length-1]
contains the last
132 | * incomplete input block. length will be less than
133 | * engineDataLength()
.
134 | *
135 | * @param data the last incomplete block.
136 | * @param length the length in bytes of the last block.
137 | * @return the digest as a byte array.
138 | */
139 | public abstract byte[] engineDigest(byte[] data, int length);
140 |
141 | /**
142 | * SPI (for BlockMessageDigests only): Performs a
143 | * transformation on the given data, which is always one block long.
144 | */
145 | protected abstract void engineTransform(byte[] data);
146 |
147 | /**
148 | * SPI: Returns the length of the block that this hash
149 | * function operates on.
150 | */
151 | protected abstract int engineGetDataLength();
152 |
153 | protected String getAlgorithm() { return this.algorithm;}
154 | }
155 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/crypto/CryptoException.java:
--------------------------------------------------------------------------------
1 | package com.elusiva.rdp.crypto;
2 |
3 | /**
4 | * This class is for any unexpected exception in the crypto library.
5 | *
6 | * Copyright © 1997
7 | * Systemics Ltd on behalf of the
8 | * Cryptix Development Team.
9 | *
All rights reserved.
10 | *
11 | * $Revision: 1.1.1.1 $ 12 | * @author David Hopwood 13 | * @since Cryptix 2.2.2 14 | */ 15 | public class CryptoException 16 | extends Exception 17 | { 18 | public CryptoException() { super(); } 19 | /** @param reason the reason why the exception was thrown. */ 20 | public CryptoException(String reason) { super(reason); } 21 | } 22 | -------------------------------------------------------------------------------- /src/com/elusiva/rdp/crypto/Key.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Key.java 1.47 00/02/02 3 | * 4 | * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved. 5 | * 6 | * This software is the proprietary information of Sun Microsystems, Inc. 7 | * Use is subject to license terms. 8 | * 9 | */ 10 | 11 | package com.elusiva.rdp.crypto; 12 | 13 | /** 14 | * The Key interface is the top-level interface for all keys. It 15 | * defines the functionality shared by all key objects. All keys 16 | * have three characteristics: 17 | * 18 | *
This is the key algorithm for that key. The key algorithm is usually 23 | * an encryption or asymmetric operation algorithm (such as DSA or 24 | * RSA), which will work with those algorithms and with related 25 | * algorithms (such as MD5 with RSA, SHA-1 with RSA, Raw DSA, etc.) 26 | * The name of the algorithm of a key is obtained using the 27 | * {@link #getAlgorithm() getAlgorithm} method.
28 | * 29 | *
This is an external encoded form for the key used when a standard 32 | * representation of the key is needed outside the Java Virtual Machine, 33 | * as when transmitting the key to some other party. The key 34 | * is encoded according to a standard format (such as X.509 or PKCS#8), and 35 | * is returned using the {@link #getEncoded() getEncoded} method.
36 | * 37 | *
This is the name of the format of the encoded key. It is returned 40 | * by the {@link #getFormat() getFormat} method.
41 | * 42 | *
"X.509"
. Similarly,
96 | * the name of the ASN.1 data format for private keys is
97 | * PrivateKeyInfo,
98 | * as defined by the PKCS #8 standard; in this case, the returned format is
99 | * "PKCS#8"
.
100 | *
101 | * @return the primary encoding format of the key.
102 | */
103 | public String getFormat();
104 |
105 | /**
106 | * Returns the key in its primary encoding format, or null
107 | * if this key does not support encoding.
108 | *
109 | * @return the encoded key, or null if the key does not support
110 | * encoding.
111 | */
112 | public byte[] getEncoded();
113 | }
114 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/keymapping/KeyCode.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaseya/JavaRDP/7ec023411bafb0db0ffee44c1908f06e95f6189a/src/com/elusiva/rdp/keymapping/KeyCode.java
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/keymapping/KeyMapException.java:
--------------------------------------------------------------------------------
1 | /* KeyMapException.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:38 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: General exception for keymapping operations
11 | */
12 | package com.elusiva.rdp.keymapping;
13 | /*
14 | * Created on 20-Apr-2005
15 | *
16 | * TODO To change the template for this generated file go to
17 | * Window - Preferences - Java - Code Style - Code Templates
18 | */
19 |
20 | /**
21 | * @author Tom Elliott
22 | *
23 | * TODO To change the template for this generated type comment go to
24 | * Window - Preferences - Java - Code Style - Code Templates
25 | */
26 | public class KeyMapException extends Exception {
27 |
28 | public KeyMapException(String s){
29 | super(s);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/keymapping/MapDef.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaseya/JavaRDP/7ec023411bafb0db0ffee44c1908f06e95f6189a/src/com/elusiva/rdp/keymapping/MapDef.java
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/loader/JRdpLoader.java:
--------------------------------------------------------------------------------
1 | /* JRdpLoader.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:42 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Launch ProperJavaRDP with settings from a config file
11 | */
12 | package com.elusiva.rdp.loader;
13 |
14 | import java.io.DataInputStream;
15 | import java.io.FileInputStream;
16 | import java.io.IOException;
17 | import java.util.StringTokenizer;
18 |
19 | import com.elusiva.rdp.*;
20 |
21 | public class JRdpLoader {
22 |
23 | // Set of identifiers to be found within the launch file
24 | private static String[] identifiers = {
25 | "--user",
26 | "--password",
27 | "--domain",
28 | "--fullscreen",
29 | "--geometry",
30 | "--use_rdp5"
31 | };
32 |
33 | // Set of command-line options mapping to the launch file identifiers
34 | private static String[] pairs = {
35 | "-u",
36 | "-p",
37 | "-d",
38 | "-f",
39 | "-g",
40 | "--use_rdp5"
41 | };
42 |
43 | public static void main(String args[]){
44 |
45 | if(args.length <= 0){
46 | System.err.println("Expected usage: JRdpLoader launchFile");
47 | System.exit(-1);
48 | }
49 |
50 | String launchFile = args[0];
51 |
52 | String server = ""; String port = "";
53 |
54 | try{
55 | String outArgs = "";
56 |
57 | // Open the file specified at the command-line
58 | FileInputStream fstream = new FileInputStream(launchFile);
59 | DataInputStream in = new DataInputStream(fstream);
60 | while (in.available() != 0) {
61 | String line = in.readLine();
62 | StringTokenizer stok = new StringTokenizer(line);
63 | if(stok.hasMoreTokens()){
64 | String identifier = stok.nextToken();
65 | String value = "";
66 | while(stok.hasMoreTokens()){
67 | value += stok.nextToken();
68 | if(stok.hasMoreTokens()) value += " ";
69 | }
70 |
71 | if(identifier.equals("--server")) server = value;
72 | else if(identifier.equals("--port")) port = value;
73 | else{
74 | String p = getParam(identifier);
75 | if(p != null) outArgs += p + " " + value + " ";
76 | }
77 | }
78 | }
79 |
80 | if(server != null && server != ""){
81 | outArgs += server;
82 | if(port != null && port != "") outArgs += ":" + port;
83 |
84 | //String[] finArgs = outArgs.split(" ");
85 | String[] finArgs = Utilities_Localised.split(outArgs, " ");
86 |
87 | Rdesktop.main(finArgs, null);
88 | in.close();
89 | }else{ System.err.println("No server name provided"); System.exit(0); }
90 |
91 |
92 | }
93 | catch(IOException ioe){ System.err.println("Launch file could not be read: " + ioe.getMessage()); System.exit(-1); }
94 | catch(Exception e){ e.printStackTrace(); System.exit(-1); }
95 | }
96 |
97 | private static String getParam(String identifier){
98 | for(int i = 0; i < identifiers.length; i++){
99 | if(identifier.equals(identifiers[i])){
100 | return pairs[i];
101 | }
102 | }
103 |
104 | return null;
105 | }
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/menu/RdpMenu.java:
--------------------------------------------------------------------------------
1 | /* RdpMenu.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.2 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/13 18:21:57 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Menu bar for main frame
11 | */
12 | package com.elusiva.rdp.menu;
13 |
14 | import java.awt.*;
15 | import java.awt.event.ActionEvent;
16 | import java.awt.event.ActionListener;
17 |
18 | import com.elusiva.rdp.RdesktopFrame;
19 | import com.elusiva.rdp.RdesktopCanvas;
20 | import com.elusiva.rdp.Rdesktop;
21 |
22 |
23 | public class RdpMenu extends MenuBar {
24 |
25 | private RdesktopFrame parent;
26 |
27 | /**
28 | * Initialise the properJavaRDP menu bar and attach to an RdesktopFrame
29 | * @param parent Menu is attached to this frame
30 | */
31 | public RdpMenu(RdesktopFrame parent){
32 | MenuItem item;
33 |
34 | this.parent = parent;
35 |
36 | Menu m = new Menu("RDC");
37 |
38 | item = new MenuItem("Send CTRL-ALT-DEL");
39 | item.addActionListener(new ActionListener() {
40 | public void actionPerformed(ActionEvent e)
41 | {
42 | sendCtrlAltDel();
43 | }
44 | });
45 | m.add(item);
46 |
47 | m.addSeparator();
48 |
49 | item = new MenuItem("Exit");
50 | item.addActionListener(new ActionListener() {
51 | public void actionPerformed(ActionEvent e)
52 | {
53 | exitFrame();
54 | }
55 | });
56 | m.add(item);
57 | this.add(m);
58 |
59 | /*
60 | m = new Menu("Input");
61 | m.add(new MenuItem("Insert Symbol"));
62 | m.addSeparator();
63 | m.add(new MenuItem("Turn Caps-Lock On"));
64 | m.add(new MenuItem("Turn Num-Lock On"));
65 | m.add(new MenuItem("Turn Scroll-Lock On"));
66 | this.add(m); */
67 |
68 | // m = new Menu("Display");
69 | //
70 | // if(!parent.getOption().isFullscreen()){
71 | // item = new MenuItem("Fullscreen Mode");
72 | // item.addActionListener(new ActionListener() {
73 | // public void actionPerformed(ActionEvent e)
74 | // {
75 | // goFullScreen();
76 | // }
77 | // });
78 | // //mi.disable();
79 | // }else item = new MenuItem("Windowed Mode");
80 | //
81 | // m.add(item);
82 | // this.add(m);
83 |
84 | }
85 |
86 | private void goFullScreen() {
87 | Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
88 | // ensure width a multiple of 4
89 | parent.getOption().setWidth(screen_size.width & ~3);
90 | parent.getOption().setHeight(screen_size.height);
91 | parent.getOption().enableFullScreen();
92 | parent.goFullScreen();
93 | }
94 |
95 |
96 | /**
97 | * @deprecated Replaced by action listeners.
98 | */
99 | public boolean action(Event event, Object arg) {
100 | /*
101 | if(arg == "Turn Caps-Lock On") ((MenuItem) event.target).setLabel("Turn Caps-Lock Off");
102 | if(arg == "Turn Caps-Lock Off") ((MenuItem) event.target).setLabel("Turn Caps-Lock On");
103 |
104 | if(arg == "Turn Num-Lock On") ((MenuItem) event.target).setLabel("Turn Num-Lock Off");
105 | if(arg == "Turn Num-Lock Off") ((MenuItem) event.target).setLabel("Turn Num-Lock On");
106 |
107 | if(arg == "Turn Scroll-Lock On") ((MenuItem) event.target).setLabel("Turn Scroll-Lock Off");
108 | if(arg == "Turn Scroll-Lock Off") ((MenuItem) event.target).setLabel("Turn Scroll-Lock On");
109 |
110 | if(arg == "Exit") Common.exit();
111 |
112 | if(arg == "Fullscreen Mode"){
113 | parent.goFullScreen();
114 | ((MenuItem) event.target).setLabel("Windowed Mode");
115 | }
116 |
117 | if(arg == "Windowed Mode"){
118 | parent.leaveFullScreen();
119 | ((MenuItem) event.target).setLabel("Fullscreen Mode");
120 | }
121 | */
122 | return false;
123 | }
124 |
125 |
126 | private void sendCtrlAltDel()
127 | {
128 | RdesktopCanvas canvas = parent.getCanvas();
129 | canvas.sendCtrlAltDel();
130 |
131 | }
132 |
133 | private void exitFrame()
134 | {
135 | Rdesktop.stopApplet(parent.getOption().getDisconnectHandler());
136 | parent.disconnectPlayer();
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/BoundsOrder.java:
--------------------------------------------------------------------------------
1 | /* BoundsOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class BoundsOrder implements Order {
15 |
16 | private int left = 0;
17 | private int right = 0;
18 | private int top = 0;
19 | private int bottom = 0;
20 |
21 | public BoundsOrder() {
22 | }
23 |
24 | public int getLeft() {
25 | return this.left;
26 | }
27 |
28 | public int getRight() {
29 | return this.right;
30 | }
31 |
32 | public int getTop() {
33 | return this.top;
34 | }
35 |
36 | public int getBottom() {
37 | return this.bottom;
38 | }
39 |
40 | public void setLeft(int left) {
41 | this.left = left;
42 | }
43 |
44 | public void setRight(int right) {
45 | this.right = right;
46 | }
47 |
48 | public void setTop(int top) {
49 | this.top = top;
50 | }
51 |
52 | public void setBottom(int bottom) {
53 | this.bottom = bottom;
54 | }
55 |
56 | public void reset() {
57 | left = 0;
58 | right = 0;
59 | top = 0;
60 | bottom = 0;
61 | }
62 | }
63 |
64 |
65 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/Brush.java:
--------------------------------------------------------------------------------
1 | /* Brush.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class Brush {
15 |
16 | private int xorigin = 0;
17 | private int yorigin = 0;
18 | private int style = 0;
19 | private byte[] pattern = new byte[8];
20 |
21 | public Brush() {
22 | }
23 |
24 | public int getXOrigin() {
25 | return this.xorigin;
26 | }
27 |
28 | public int getYOrigin() {
29 | return this.yorigin;
30 | }
31 |
32 | public int getStyle() {
33 | return this.style;
34 | }
35 |
36 | public byte[] getPattern(){
37 | return this.pattern;
38 | }
39 |
40 | public void setXOrigin(int xorigin) {
41 | this.xorigin = xorigin;
42 | }
43 |
44 | public void setYOrigin(int yorigin) {
45 | this.yorigin = yorigin;
46 | }
47 |
48 | public void setStyle(int style) {
49 | this.style = style;
50 | }
51 |
52 | public void setPattern(byte[] pattern){
53 | this.pattern = pattern;
54 | }
55 |
56 | public void reset() {
57 | xorigin = 0;
58 | yorigin = 0;
59 | style = 0;
60 | pattern = new byte[8];
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/DeskSaveOrder.java:
--------------------------------------------------------------------------------
1 | /* DeskSaveOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class DeskSaveOrder extends BoundsOrder {
15 |
16 | private int offset = 0;
17 | private int action = 0;
18 |
19 | public DeskSaveOrder() {
20 | super();
21 | }
22 |
23 | public int getOffset() {
24 | return this.offset;
25 | }
26 |
27 | public int getAction() {
28 | return this.action;
29 | }
30 |
31 | public void setOffset(int offset) {
32 | this.offset = offset;
33 | }
34 |
35 | public void setAction(int action) {
36 | this.action = action;
37 | }
38 |
39 | public void reset() {
40 | super.reset();
41 | offset = 0;
42 | action = 0;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/DestBltOrder.java:
--------------------------------------------------------------------------------
1 | /* DestBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class DestBltOrder implements Order {
15 |
16 | private int x = 0;
17 | private int y = 0;
18 | private int cx = 0;
19 | private int cy = 0;
20 | private int opcode = 0;
21 |
22 | public DestBltOrder() {
23 | }
24 |
25 | public int getX() {
26 | return this.x;
27 | }
28 |
29 | public int getY() {
30 | return this.y;
31 | }
32 |
33 | public int getCX() {
34 | return this.cx;
35 | }
36 |
37 | public int getCY() {
38 | return this.cy;
39 | }
40 |
41 | public int getOpcode() {
42 | return this.opcode;
43 | }
44 |
45 | public void setX(int x) {
46 | this.x = x;
47 | }
48 |
49 | public void setY(int y) {
50 | this.y = y;
51 | }
52 |
53 | public void setCX(int cx) {
54 | this.cx = cx;
55 | }
56 |
57 | public void setCY(int cy) {
58 | this.cy = cy;
59 | }
60 |
61 | public void setOpcode(int opcode) {
62 | this.opcode = opcode;
63 | }
64 |
65 | public void reset() {
66 | x = 0;
67 | y = 0;
68 | cx = 0;
69 | cy = 0;
70 | opcode = 0;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/LineOrder.java:
--------------------------------------------------------------------------------
1 | /* LineOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class LineOrder implements Order {
15 |
16 | private int mixmode = 0;
17 | private int startx = 0;
18 | private int starty = 0;
19 | private int endx = 0;
20 | private int endy = 0;
21 | private int bgcolor = 0;
22 | private int opcode = 0;
23 | Pen pen = null;
24 |
25 | public LineOrder() {
26 | pen = new Pen();
27 | }
28 |
29 | public int getMixmode() {
30 | return this.mixmode;
31 | }
32 |
33 | public int getStartX() {
34 | return this.startx;
35 | }
36 |
37 | public int getStartY() {
38 | return this.starty;
39 | }
40 |
41 | public int getEndX() {
42 | return this.endx;
43 | }
44 |
45 | public int getEndY() {
46 | return this.endy;
47 | }
48 |
49 | public int getBackgroundColor() {
50 | return this.bgcolor;
51 | }
52 |
53 | public int getOpcode() {
54 | return this.opcode;
55 | }
56 |
57 | public Pen getPen(){
58 | return this.pen;
59 | }
60 |
61 | public void setMixmode(int mixmode) {
62 | this.mixmode = mixmode;
63 | }
64 |
65 | public void setStartX(int startx) {
66 | this.startx = startx;
67 | }
68 |
69 | public void setStartY(int starty) {
70 | this.starty = starty;
71 | }
72 |
73 | public void setEndX(int endx) {
74 | this.endx = endx;
75 | }
76 |
77 | public void setEndY(int endy) {
78 | this.endy = endy;
79 | }
80 |
81 | public void setBackgroundColor(int bgcolor) {
82 | this.bgcolor = bgcolor;
83 | }
84 |
85 | public void setOpcode(int opcode) {
86 | this.opcode = opcode;
87 | }
88 |
89 | public void reset() {
90 | mixmode = 0;
91 | startx = 0;
92 | starty = 0;
93 | endx = 0;
94 | endy = 0;
95 | bgcolor = 0;
96 | opcode = 0;
97 | pen.reset();
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/MemBltOrder.java:
--------------------------------------------------------------------------------
1 | /* MemBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class MemBltOrder extends ScreenBltOrder {
15 |
16 | private int color_table = 0;
17 | private int cache_id = 0;
18 | private int cache_idx = 0;
19 |
20 | public MemBltOrder() {
21 | super();
22 | }
23 |
24 | public int getColorTable(){
25 | return this.color_table;
26 | }
27 |
28 | public int getCacheID() {
29 | return this.cache_id;
30 | }
31 |
32 | public int getCacheIDX() {
33 | return this.cache_idx;
34 | }
35 |
36 | public void setColorTable(int color_table) {
37 | this.color_table = color_table;
38 | }
39 |
40 | public void setCacheID(int cache_id) {
41 | this.cache_id = cache_id;
42 | }
43 |
44 | public void setCacheIDX(int cache_idx) {
45 | this.cache_idx = cache_idx;
46 | }
47 |
48 | public void reset() {
49 | super.reset();
50 | color_table = 0;
51 | cache_id = 0;
52 | cache_idx = 0;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/Order.java:
--------------------------------------------------------------------------------
1 | /* Order.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public interface Order {
15 | }
16 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/PatBltOrder.java:
--------------------------------------------------------------------------------
1 | /* PatBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class PatBltOrder extends DestBltOrder {
15 |
16 | private int bgcolor = 0;
17 | private int fgcolor = 0;
18 | private Brush brush = null;
19 |
20 | public PatBltOrder() {
21 | super();
22 | brush = new Brush();
23 | }
24 |
25 | public int getBackgroundColor() {
26 | return this.bgcolor;
27 | }
28 |
29 | public int getForegroundColor() {
30 | return this.fgcolor;
31 | }
32 |
33 | public Brush getBrush(){
34 | return this.brush;
35 | }
36 |
37 | public void setBackgroundColor(int bgcolor) {
38 | this.bgcolor = bgcolor;
39 | }
40 |
41 | public void setForegroundColor(int fgcolor) {
42 | this.fgcolor = fgcolor;
43 | }
44 |
45 | public void reset() {
46 | super.reset();
47 | bgcolor = 0;
48 | fgcolor = 0;
49 | brush.reset();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/Pen.java:
--------------------------------------------------------------------------------
1 | /* Pen.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class Pen {
15 |
16 | private int style = 0;
17 | private int width = 0;
18 | private int color = 0;
19 |
20 | public Pen() {
21 | }
22 |
23 | public int getStyle() {
24 | return this.style;
25 | }
26 |
27 | public int getWidth() {
28 | return this.width;
29 | }
30 |
31 | public int getColor() {
32 | return this.color;
33 | }
34 |
35 | public void setStyle(int style) {
36 | this.style = style;
37 | }
38 |
39 | public void setWidth(int width) {
40 | this.width = width;
41 | }
42 |
43 | public void setColor(int color) {
44 | this.color = color;
45 | }
46 |
47 | public void reset() {
48 | style = 0;
49 | width = 0;
50 | color = 0;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/PolyLineOrder.java:
--------------------------------------------------------------------------------
1 | /* PolyLineOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class PolyLineOrder implements Order {
15 |
16 | private int x = 0;
17 | private int y = 0;
18 | private int flags = 0;
19 | private int fgcolor = 0;
20 | private int lines = 0;
21 | private int opcode = 0;
22 | private int datasize = 0;
23 | byte[] data = new byte[256];
24 |
25 | public PolyLineOrder() {
26 | }
27 |
28 | public int getX() {
29 | return this.x;
30 | }
31 |
32 | public int getY() {
33 | return this.y;
34 | }
35 |
36 | public int getFlags() {
37 | return this.flags;
38 | }
39 |
40 | public int getForegroundColor() {
41 | return this.fgcolor;
42 | }
43 |
44 | public int getLines() {
45 | return this.lines;
46 | }
47 |
48 | public int getDataSize() {
49 | return this.datasize;
50 | }
51 |
52 | public byte[] getData() {
53 | return this.data;
54 | }
55 |
56 | public int getOpcode(){
57 | return this.opcode;
58 | }
59 |
60 | public void setX(int x) {
61 | this.x = x;
62 | }
63 |
64 | public void setY(int y) {
65 | this.y = y;
66 | }
67 |
68 | public void setFlags(int flags) {
69 | this.flags = flags;
70 | }
71 |
72 | public void setForegroundColor(int fgcolor) {
73 | this.fgcolor = fgcolor;
74 | }
75 |
76 | public void setLines(int lines){
77 | this.lines = lines;
78 | }
79 |
80 | public void setDataSize(int datasize) {
81 | this.datasize = datasize;
82 | }
83 |
84 | public void setData(byte[] data) {
85 | this.data = data;
86 | }
87 |
88 | public void setOpcode(int opcode){
89 | this.opcode = opcode;
90 | }
91 | public void reset() {
92 | x = 0;
93 | y = 0;
94 | flags = 0;
95 | fgcolor = 0;
96 | lines = 0;
97 | datasize = 0;
98 | opcode = 0;
99 | data = new byte[256];
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/RectangleOrder.java:
--------------------------------------------------------------------------------
1 | /* RectangleOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class RectangleOrder implements Order {
15 |
16 | private int x = 0;
17 | private int y = 0;
18 | private int cx = 0;
19 | private int cy = 0;
20 | public int color = 0;
21 |
22 | public RectangleOrder() {
23 | }
24 |
25 | public int getX() {
26 | return this.x;
27 | }
28 |
29 | public int getY() {
30 | return this.y;
31 | }
32 |
33 | public int getCX() {
34 | return this.cx;
35 | }
36 |
37 | public int getCY() {
38 | return this.cy;
39 | }
40 |
41 | public int getColor() {
42 | return this.color;
43 | }
44 |
45 | public void setX(int x) {
46 | this.x = x;
47 | }
48 |
49 | public void setY(int y) {
50 | this.y = y;
51 | }
52 |
53 | public void setCX(int cx) {
54 | this.cx = cx;
55 | }
56 |
57 | public void setCY(int cy) {
58 | this.cy = cy;
59 | }
60 |
61 | public void setColor(int color) {
62 | this.color = color;
63 | }
64 |
65 | public void reset() {
66 | x = 0;
67 | y = 0;
68 | cx = 0;
69 | cy = 0;
70 | color = 0;
71 | }
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/ScreenBltOrder.java:
--------------------------------------------------------------------------------
1 | /* ScreenBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class ScreenBltOrder extends DestBltOrder {
15 |
16 | private int srcx = 0;
17 | private int srcy = 0;
18 |
19 | public ScreenBltOrder() {
20 | super();
21 | }
22 |
23 | public int getSrcX() {
24 | return this.srcx;
25 | }
26 |
27 | public int getSrcY() {
28 | return this.srcy;
29 | }
30 |
31 | public void setSrcX(int srcx) {
32 | this.srcx = srcx;
33 | }
34 |
35 | public void setSrcY(int srcy) {
36 | this.srcy = srcy;
37 | }
38 |
39 | public void reset() {
40 | super.reset();
41 | srcx = 0;
42 | srcy = 0;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/Text2Order.java:
--------------------------------------------------------------------------------
1 | /* Text2Order.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class Text2Order implements Order {
15 |
16 | private int flags = 0;
17 | private int mixmode = 0;
18 | private int fgcolor = 0;
19 | private int bgcolor = 0;
20 | private int x = 0;
21 | private int y = 0;
22 | private int unknown = 0;
23 |
24 | private int font = 0;
25 | private int clipleft = 0;
26 | private int cliptop = 0;
27 | private int clipright = 0;
28 | private int clipbottom = 0;
29 | private int boxleft = 0;
30 | private int boxtop = 0;
31 | private int boxright = 0;
32 | private int boxbottom = 0;
33 | private int opcode = 0;
34 |
35 | private int length = 0;
36 | byte[] text = new byte[256];
37 |
38 | public Text2Order() {
39 | }
40 |
41 | public int getFont() {
42 | return this.font;
43 | }
44 |
45 | public int getClipLeft(){
46 | return this.clipleft;
47 | }
48 |
49 | public int getClipRight() {
50 | return this.clipright;
51 | }
52 |
53 | public int getClipTop() {
54 | return this.cliptop;
55 | }
56 |
57 | public int getClipBottom() {
58 | return this.clipbottom;
59 | }
60 |
61 | public int getBoxLeft(){
62 | return this.boxleft;
63 | }
64 |
65 | public int getBoxRight() {
66 | return this.boxright;
67 | }
68 |
69 | public int getBoxTop() {
70 | return this.boxtop;
71 | }
72 |
73 | public int getBoxBottom() {
74 | return this.boxbottom;
75 | }
76 |
77 | public int getX() {
78 | return this.x;
79 | }
80 |
81 | public int getUnknown() {
82 | return this.unknown;
83 | }
84 |
85 | public int getY() {
86 | return this.y;
87 | }
88 |
89 | public int getFlags() {
90 | return this.flags;
91 | }
92 |
93 | public int getMixmode() {
94 | return this.mixmode;
95 | }
96 |
97 | public int getForegroundColor() {
98 | return this.fgcolor;
99 | }
100 |
101 | public int getBackgroundColor() {
102 | return this.bgcolor;
103 | }
104 |
105 | public int getLength() {
106 | return this.length;
107 | }
108 |
109 | public byte[] getText() {
110 | return this.text;
111 | }
112 |
113 | public void setFont(int font) {
114 | this.font = font;
115 | }
116 |
117 | public void setX(int x) {
118 | this.x = x;
119 | }
120 |
121 | public void setUnknown(int unknown) {
122 | this.unknown = unknown;
123 | }
124 |
125 | public void setY(int y) {
126 | this.y = y;
127 | }
128 |
129 | public void setMixmode(int mixmode) {
130 | this.mixmode = mixmode;
131 | }
132 |
133 | public void setFlags(int flags) {
134 | this.flags = flags;
135 | }
136 |
137 | public void setForegroundColor(int fgcolor) {
138 | this.fgcolor = fgcolor;
139 | }
140 |
141 | public void setBackgroundColor(int bgcolor) {
142 | this.bgcolor = bgcolor;
143 | }
144 |
145 | public void setClipLeft(int clipleft){
146 | this.clipleft = clipleft;
147 | }
148 |
149 | public void setClipRight(int clipright) {
150 | this.clipright = clipright;
151 | }
152 |
153 | public void setClipTop(int cliptop) {
154 | this.cliptop = cliptop;
155 | }
156 |
157 | public void setClipBottom(int clipbottom) {
158 | this.clipbottom = clipbottom;
159 | }
160 |
161 | public void setBoxLeft(int boxleft){
162 | this.boxleft = boxleft;
163 | }
164 |
165 | public void setBoxRight(int boxright) {
166 | this.boxright = boxright;
167 | }
168 |
169 | public void setBoxTop(int boxtop) {
170 | this.boxtop = boxtop;
171 | }
172 |
173 | public void setBoxBottom(int boxbottom) {
174 | this.boxbottom = boxbottom;
175 | }
176 |
177 | public void setText(byte[] text) {
178 | this.text = text;
179 | }
180 |
181 | public void setLength(int length) {
182 | this.length = length;
183 | }
184 |
185 | public void reset() {
186 | font = 0;
187 | flags = 0;
188 | mixmode = 0;
189 | unknown = 0;
190 | fgcolor = 0;
191 | bgcolor = 0;
192 | clipleft = 0;
193 | cliptop = 0;
194 | clipright = 0;
195 | clipbottom = 0;
196 | boxleft = 0;
197 | boxtop = 0;
198 | boxright = 0;
199 | boxbottom = 0;
200 | x = 0;
201 | y = 0;
202 | length = 0;
203 | opcode = 0;
204 | text = new byte[256];
205 | }
206 |
207 | public int getOpcode(){
208 | return opcode;
209 | }
210 |
211 | public void setOpcode(int name) {
212 | opcode = name;
213 | }
214 | }
215 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/orders/TriBltOrder.java:
--------------------------------------------------------------------------------
1 | /* TriBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:35 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.orders;
13 |
14 | public class TriBltOrder extends PatBltOrder {
15 |
16 | private int color_table = 0;
17 | private int cache_id = 0;
18 | private int cache_idx = 0;
19 | private int srcx = 0;
20 | private int srcy = 0;
21 | private int unknown = 0;
22 |
23 | public TriBltOrder() {
24 | super();
25 | }
26 |
27 | public int getColorTable(){
28 | return this.color_table;
29 | }
30 |
31 | public int getCacheID() {
32 | return this.cache_id;
33 | }
34 |
35 | public int getCacheIDX() {
36 | return this.cache_idx;
37 | }
38 |
39 | public int getSrcX() {
40 | return this.srcx;
41 | }
42 |
43 | public int getSrcY() {
44 | return this.srcy;
45 | }
46 |
47 | public int getUnknown() {
48 | return this.unknown;
49 | }
50 |
51 | public void setColorTable(int color_table) {
52 | this.color_table = color_table;
53 | }
54 |
55 | public void setCacheID(int cache_id) {
56 | this.cache_id = cache_id;
57 | }
58 |
59 | public void setCacheIDX(int cache_idx) {
60 | this.cache_idx = cache_idx;
61 | }
62 |
63 | public void setSrcX(int srcx) {
64 | this.srcx = srcx; // corrected
65 | }
66 |
67 | public void setSrcY(int srcy) {
68 | this.srcy = srcy; // corrected
69 | }
70 |
71 | public void setUnknown(int unknown) {
72 | this.unknown = unknown;
73 | }
74 |
75 | public void reset() {
76 | super.reset();
77 | color_table = 0;
78 | cache_id = 0;
79 | cache_idx = 0;
80 | srcx = 0;
81 | srcy = 0;
82 | unknown = 0;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/Rdp5.java:
--------------------------------------------------------------------------------
1 | /* Rdp5.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Handle RDP5 orders
11 | */
12 |
13 | package com.elusiva.rdp.rdp5;
14 |
15 | import com.elusiva.rdp.*;
16 |
17 | public class Rdp5 extends Rdp {
18 |
19 | private VChannels channels;
20 |
21 | /**
22 | * Initialise the RDP5 communications layer, with specified virtual channels
23 | *
24 | * @param channels
25 | * Virtual channels for RDP layer
26 | */
27 | public Rdp5(VChannels channels, Options option) {
28 | super(channels, option);
29 | this.channels = channels;
30 |
31 | }
32 |
33 | public Rdp5(Options option, Secure secureLayer) {
34 | super(option, secureLayer);
35 | }
36 |
37 | /**
38 | * Process an RDP5 packet from a virtual channel
39 | * @param s Packet to be processed
40 | * @param channelno Channel on which packet was received
41 | */
42 | void rdp5_process_channel(RdpPacket_Localised s, int channelno) {
43 | VChannel channel = channels.find_channel_by_channelno(channelno);
44 | if (channel != null) {
45 | try {
46 | channel.process(s);
47 | } catch (Exception e) {
48 | }
49 | }
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/TestChannel.java:
--------------------------------------------------------------------------------
1 | /* TestChannel.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Dummy RDP5 channel for testing purposes
11 | */
12 | package com.elusiva.rdp.rdp5;
13 |
14 | import com.elusiva.rdp.RdpPacket;
15 |
16 | /**
17 | * @author Tom Elliott
18 | *
19 | * TODO To change the template for this generated type comment go to
20 | * Window - Preferences - Java - Code Style - Code Templates
21 | */
22 | public class TestChannel extends VChannel {
23 |
24 | public TestChannel(String name, int flags){
25 | this.name = name;
26 | this.flags = flags;
27 | }
28 |
29 | private String name;
30 | private int flags;
31 |
32 | public String name() {
33 | return name;
34 | }
35 |
36 | public int flags() {
37 | return flags;
38 | }
39 |
40 | public void process(RdpPacket data) {
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/VChannel.java:
--------------------------------------------------------------------------------
1 | /* VChannel.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Abstract class for RDP5 channels
11 | */
12 | package com.elusiva.rdp.rdp5;
13 |
14 | import java.io.IOException;
15 |
16 | import org.apache.log4j.Logger;
17 |
18 | import com.elusiva.rdp.Constants;
19 | import com.elusiva.rdp.Input;
20 | import com.elusiva.rdp.Common;
21 | import com.elusiva.rdp.Options;
22 | import com.elusiva.rdp.RdesktopException;
23 | import com.elusiva.rdp.RdpPacket;
24 | import com.elusiva.rdp.RdpPacket_Localised;
25 | import com.elusiva.rdp.Secure;
26 | import com.elusiva.rdp.crypto.CryptoException;
27 |
28 | public abstract class VChannel {
29 |
30 | protected static Logger logger = Logger.getLogger(Input.class);
31 |
32 | private int mcs_id = 0;
33 | protected Secure secureLayer;
34 |
35 | /**
36 | * Provide the name of this channel
37 | * @return Channel name as string
38 | */
39 | public abstract String name();
40 |
41 | /**
42 | * Provide the set of flags specifying working options for this channel
43 | * @return Option flags
44 | */
45 | public abstract int flags();
46 |
47 | /**
48 | * Process a packet sent on this channel
49 | * @param data Packet sent to this channel
50 | * @throws RdesktopException
51 | * @throws IOException
52 | * @throws CryptoException
53 | */
54 | public abstract void process(RdpPacket data) throws RdesktopException, IOException, CryptoException;
55 | public int mcs_id(){
56 | return mcs_id;
57 | }
58 |
59 | /**
60 | * Set the MCS ID for this channel
61 | * @param mcs_id New MCS ID
62 | */
63 | public void set_mcs_id(int mcs_id){
64 | this.mcs_id = mcs_id;
65 | }
66 |
67 | public void setSecureLayer(Secure secureLayer) {
68 | this.secureLayer = secureLayer;
69 | }
70 |
71 | protected Secure getSecureLayer() {
72 | assert(this.secureLayer != null);
73 | return this.secureLayer;
74 | }
75 |
76 | /**
77 | * Initialise a packet for transmission over this virtual channel
78 | * @param length Desired length of packet
79 | * @param option
80 | * @return Packet prepared for this channel
81 | * @throws RdesktopException
82 | */
83 | public RdpPacket_Localised init(int length, Options option) throws RdesktopException{
84 | RdpPacket_Localised s;
85 |
86 | s = getSecureLayer().init(option.isEncryptionEnabled() ? Secure.SEC_ENCRYPT : 0,length + 8);
87 | s.setHeader(RdpPacket.CHANNEL_HEADER);
88 | s.incrementPosition(8);
89 |
90 | return s;
91 | }
92 |
93 | /**
94 | * Send a packet over this virtual channel
95 | * @param data Packet to be sent
96 | * @throws RdesktopException
97 | * @throws IOException
98 | * @throws CryptoException
99 | */
100 | public void send_packet(RdpPacket_Localised data) throws RdesktopException, IOException, CryptoException
101 | {
102 | if(getSecureLayer() == null) return;
103 | int length = data.size();
104 |
105 | int data_offset = 0;
106 | int packets_sent = 0;
107 | int num_packets = (length/VChannels.CHANNEL_CHUNK_LENGTH);
108 | num_packets += length - (VChannels.CHANNEL_CHUNK_LENGTH)*num_packets;
109 |
110 | while(data_offset < length){
111 |
112 | int thisLength = Math.min(VChannels.CHANNEL_CHUNK_LENGTH, length - data_offset);
113 |
114 | RdpPacket_Localised s = getSecureLayer().init(Constants.encryption ? Secure.SEC_ENCRYPT : 0, 8 + thisLength);
115 | s.setLittleEndian32(length);
116 |
117 | int flags = ((data_offset == 0) ? VChannels.CHANNEL_FLAG_FIRST : 0);
118 | if(data_offset + thisLength >= length) flags |= VChannels.CHANNEL_FLAG_LAST;
119 |
120 | if ((this.flags() & VChannels.CHANNEL_OPTION_SHOW_PROTOCOL) != 0) flags |= VChannels.CHANNEL_FLAG_SHOW_PROTOCOL;
121 |
122 | s.setLittleEndian32(flags);
123 | s.copyFromPacket(data,data_offset,s.getPosition(),thisLength);
124 | s.incrementPosition(thisLength);
125 | s.markEnd();
126 |
127 | data_offset += thisLength;
128 |
129 | if(getSecureLayer() != null) getSecureLayer().send_to_channel(s, Constants.encryption ? Secure.SEC_ENCRYPT : 0, this.mcs_id());
130 | packets_sent++;
131 | }
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/BMPToImageThread.java:
--------------------------------------------------------------------------------
1 | /* BMPToImageThread.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.Image;
15 | import java.io.ByteArrayInputStream;
16 | import java.io.OutputStream;
17 |
18 | import com.elusiva.rdp.RdpPacket;
19 | public class BMPToImageThread extends Thread {
20 |
21 | RdpPacket data; int length; ClipInterface c;
22 |
23 | public BMPToImageThread(RdpPacket data, int length, ClipInterface c){
24 | super();
25 | this.data = data;
26 | this.length = length;
27 | this.c = c;
28 | }
29 |
30 | public void run(){
31 | String thingy = "";
32 | OutputStream out = null;
33 |
34 | int origin = data.getPosition();
35 |
36 | int head_len = data.getLittleEndian32();
37 |
38 | data.setPosition(origin);
39 |
40 | byte[] content = new byte[length];
41 |
42 | for(int i = 0; i < length; i++){
43 | content[i] = (byte) (data.get8() & 0xFF);
44 | }
45 |
46 | Image img = ClipBMP.loadbitmap(new ByteArrayInputStream(content));
47 | ImageSelection imageSelection = new ImageSelection(img);
48 | c.copyToClipboard(imageSelection);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/ClipInterface.java:
--------------------------------------------------------------------------------
1 | /* ClipInterface.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.Transferable;
15 |
16 | public interface ClipInterface {
17 |
18 | public void copyToClipboard(Transferable t);
19 | public void send_data(byte []data, int length);
20 | public void send_null(int type, int status);
21 | }
22 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/DIBHandler.java:
--------------------------------------------------------------------------------
1 | /* DIBHandler.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.Frame;
15 | import java.awt.Image;
16 | import java.awt.MediaTracker;
17 | import java.awt.datatransfer.DataFlavor;
18 | import java.awt.datatransfer.Transferable;
19 | import java.awt.datatransfer.UnsupportedFlavorException;
20 | import java.awt.image.ImageObserver;
21 | import java.io.IOException;
22 | import org.apache.log4j.Logger;
23 |
24 | import com.elusiva.rdp.Common;
25 | import com.elusiva.rdp.Input;
26 | import com.elusiva.rdp.RdpPacket;
27 | import com.elusiva.rdp.Utilities_Localised;
28 |
29 |
30 | public class DIBHandler extends TypeHandler implements ImageObserver {
31 |
32 | protected static Logger logger = Logger.getLogger(Input.class);
33 |
34 | public boolean formatValid(int format) {
35 | return (format == CF_DIB);
36 | }
37 |
38 | public boolean mimeTypeValid(String mimeType) {
39 | return mimeType.equals("image");
40 | }
41 |
42 | public int preferredFormat() {
43 | return CF_DIB;
44 | }
45 |
46 | public String name() {
47 | return "CF_DIB";
48 | }
49 |
50 | public void handleData(RdpPacket data, int length, ClipInterface c) {
51 | //System.out.println("DIBHandler.handleData");
52 | BMPToImageThread t = new BMPToImageThread(data, length, c);
53 | t.start();
54 | }
55 |
56 | public void send_data(Transferable in, ClipInterface c) {
57 | byte[] out = null;
58 |
59 | try {
60 | if (in != null && in.isDataFlavorSupported(Utilities_Localised.imageFlavor)) {
61 | Image img = (Image)in.getTransferData(Utilities_Localised.imageFlavor);
62 | ClipBMP b = new ClipBMP();
63 |
64 | MediaTracker mediaTracker = new MediaTracker(new Frame());
65 | mediaTracker.addImage(img, 0);
66 |
67 | try
68 | {
69 | mediaTracker.waitForID(0);
70 | }
71 | catch (InterruptedException ie)
72 | {
73 | System.err.println(ie);
74 | if(!Common.underApplet) System.exit(1);
75 | }
76 | if(img == null) return;
77 |
78 | int width = img.getWidth(this);
79 | int height = img.getHeight(this);
80 | out = b.getBitmapAsBytes(img,width,height);
81 |
82 | c.send_data(out,out.length);
83 | }
84 | } catch (UnsupportedFlavorException e) {
85 | System.err.println("Failed to send DIB: UnsupportedFlavorException");
86 | } catch (IOException e) {
87 | System.err.println("Failed to send DIB: IOException");
88 | }
89 |
90 | }
91 |
92 | public boolean imageUpdate(Image arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
93 | return false;
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/ImageSelection.java:
--------------------------------------------------------------------------------
1 | /* ImageSelection.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.Image;
15 | import java.awt.datatransfer.DataFlavor;
16 | import java.awt.datatransfer.Transferable;
17 | import java.awt.datatransfer.UnsupportedFlavorException;
18 | import java.io.IOException;
19 |
20 | import com.elusiva.rdp.Common;
21 | import com.elusiva.rdp.Utilities_Localised;
22 | public class ImageSelection
23 | implements Transferable
24 | {
25 | // the Image object which will be housed by the ImageSelection
26 | private Image image;
27 |
28 | public ImageSelection(Image image) {
29 | this.image = image;
30 | }
31 |
32 | // Returns the supported flavors of our implementation
33 | public DataFlavor[] getTransferDataFlavors()
34 | {
35 | return new DataFlavor[] {Utilities_Localised.imageFlavor};
36 | }
37 |
38 | // Returns true if flavor is supported
39 | public boolean isDataFlavorSupported(DataFlavor flavor)
40 | {
41 | return Utilities_Localised.imageFlavor.equals(flavor);
42 | }
43 |
44 | // Returns Image object housed by Transferable object
45 | public Object getTransferData(DataFlavor flavor)
46 | throws UnsupportedFlavorException,IOException
47 | {
48 | if (!Utilities_Localised.imageFlavor.equals(flavor))
49 | {
50 | throw new UnsupportedFlavorException(flavor);
51 | }
52 | // else return the payload
53 | return image;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/MetafilepictHandler.java:
--------------------------------------------------------------------------------
1 | /* MetafilepictHandler.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.StringSelection;
15 | import java.awt.datatransfer.Transferable;
16 | import java.io.FileNotFoundException;
17 | import java.io.FileOutputStream;
18 | import java.io.IOException;
19 | import java.io.OutputStream;
20 |
21 | import com.elusiva.rdp.RdpPacket;
22 |
23 | public class MetafilepictHandler extends TypeHandler {
24 |
25 | /* Mapping Modes */
26 | public static final int MM_TEXT = 1;
27 | public static final int MM_LOMETRIC = 2;
28 | public static final int MM_HIMETRIC = 3;
29 | public static final int MM_LOENGLISH = 4;
30 | public static final int MM_HIENGLISH = 5;
31 | public static final int MM_TWIPS = 6;
32 | public static final int MM_ISOTROPIC = 7;
33 | public static final int MM_ANISOTROPIC = 8;
34 |
35 | String[] mapping_modes = {
36 | "undefined",
37 | "MM_TEXT",
38 | "MM_LOMETRIC",
39 | "MM_HIMETRIC",
40 | "MM_LOENGLISH",
41 | "MM_HIENGLISH",
42 | "MM_TWIPS",
43 | "MM_ISOTROPIC",
44 | "MM_ANISOTROPIC"
45 | };
46 |
47 | public boolean formatValid(int format) {
48 | return (format == CF_METAFILEPICT);
49 | }
50 |
51 | public boolean mimeTypeValid(String mimeType) {
52 | return mimeType.equals("image");
53 | }
54 |
55 | public int preferredFormat() {
56 | return CF_METAFILEPICT;
57 | }
58 |
59 | public Transferable handleData(RdpPacket data, int length) {
60 | String thingy = "";
61 | OutputStream out = null;
62 |
63 | //System.out.print("Metafile mapping mode = ");
64 | int mm = data.getLittleEndian32();
65 | //System.out.print(mapping_modes[mm]);
66 | int width = data.getLittleEndian32();
67 | //System.out.print(", width = " + width);
68 | int height = data.getLittleEndian32();
69 | //System.out.println(", height = " + height);
70 |
71 | try {
72 | out = new FileOutputStream("test.wmf");
73 |
74 | for(int i = 0; i < (length-12); i++){
75 | int aByte = data.get8();
76 | out.write(aByte);
77 | thingy += Integer.toHexString(aByte & 0xFF) + " ";
78 | }
79 | //System.out.println(thingy);
80 | } catch (FileNotFoundException e) {
81 | e.printStackTrace();
82 | } catch (IOException e) {
83 | e.printStackTrace();
84 | }
85 | return(new StringSelection(thingy));
86 | }
87 |
88 | public String name() {
89 | return "CF_METAFILEPICT";
90 | }
91 |
92 |
93 | public byte[] fromTransferable(Transferable in) {
94 | return null;
95 | }
96 |
97 | public void handleData(RdpPacket data, int length, ClipInterface c) {
98 | String thingy = "";
99 | OutputStream out = null;
100 |
101 | //System.out.print("Metafile mapping mode = ");
102 | int mm = data.getLittleEndian32();
103 | //System.out.print(mapping_modes[mm]);
104 | int width = data.getLittleEndian32();
105 | //System.out.print(", width = " + width);
106 | int height = data.getLittleEndian32();
107 | //System.out.println(", height = " + height);
108 |
109 | try {
110 | out = new FileOutputStream("test.wmf");
111 |
112 | for(int i = 0; i < (length-12); i++){
113 | int aByte = data.get8();
114 | out.write(aByte);
115 | thingy += Integer.toHexString(aByte & 0xFF) + " ";
116 | }
117 | //System.out.println(thingy);
118 | } catch (FileNotFoundException e) {
119 | e.printStackTrace();
120 | } catch (IOException e) {
121 | e.printStackTrace();
122 | }
123 | }
124 |
125 | /* (non-Javadoc)
126 | * @see com.elusiva.rdp.rdp5.cliprdr.TypeHandler#send_data(java.awt.datatransfer.Transferable, com.elusiva.rdp.rdp5.cliprdr.ClipInterface)
127 | */
128 | public void send_data(Transferable in, ClipInterface c) {
129 | c.send_null(ClipChannel.CLIPRDR_DATA_RESPONSE,ClipChannel.CLIPRDR_ERROR);
130 | }
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/TextHandler.java:
--------------------------------------------------------------------------------
1 | /* TextHandler.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.DataFlavor;
15 | import java.awt.datatransfer.StringSelection;
16 | import java.awt.datatransfer.Transferable;
17 |
18 | import com.elusiva.rdp.RdpPacket;
19 | import com.elusiva.rdp.Utilities_Localised;
20 |
21 | public class TextHandler extends TypeHandler {
22 |
23 | public boolean formatValid(int format) {
24 | return (format == CF_TEXT);
25 | }
26 |
27 | public boolean mimeTypeValid(String mimeType) {
28 | return mimeType.equals("text");
29 | }
30 |
31 | public int preferredFormat() {
32 | return CF_TEXT;
33 | }
34 |
35 | public Transferable handleData(RdpPacket data, int length) {
36 | String thingy = "";
37 | for(int i = 0; i < length; i++){
38 | int aByte = data.get8();
39 | if(aByte != 0) thingy += (char) (aByte & 0xFF);
40 | }
41 | return(new StringSelection(thingy));
42 | }
43 |
44 | public String name() {
45 | return "CF_TEXT";
46 | }
47 |
48 |
49 | public byte[] fromTransferable(Transferable in) {
50 | String s;
51 | if (in != null)
52 | {
53 | try {
54 | s = (String)(in.getTransferData(DataFlavor.stringFlavor));
55 | }
56 | catch (Exception e) {
57 | s = e.toString();
58 | }
59 |
60 | // TODO: think of a better way of fixing this
61 | s = s.replace('\n',(char) 0x0a);
62 | //s = s.replaceAll("" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
63 | s = Utilities_Localised.strReplaceAll(s, "" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
64 | return s.getBytes();
65 | }
66 | return null;
67 | }
68 |
69 | /* (non-Javadoc)
70 | * @see com.elusiva.rdp.rdp5.cliprdr.TypeHandler#handleData(com.elusiva.rdp.RdpPacket, int, com.elusiva.rdp.rdp5.cliprdr.ClipInterface)
71 | */
72 | public void handleData(RdpPacket data, int length, ClipInterface c) {
73 | String thingy = "";
74 | for(int i = 0; i < length; i++){
75 | int aByte = data.get8();
76 | if(aByte != 0) thingy += (char) (aByte & 0xFF);
77 | }
78 | c.copyToClipboard (new StringSelection(thingy));
79 | }
80 |
81 | /* (non-Javadoc)
82 | * @see com.elusiva.rdp.rdp5.cliprdr.TypeHandler#send_data(java.awt.datatransfer.Transferable, com.elusiva.rdp.rdp5.cliprdr.ClipInterface)
83 | */
84 | public void send_data(Transferable in, ClipInterface c) {
85 | String s;
86 | if (in != null)
87 | {
88 | try {
89 | s = (String)(in.getTransferData(DataFlavor.stringFlavor));
90 | }
91 | catch (Exception e) {
92 | s = e.toString();
93 | }
94 |
95 | // TODO: think of a better way of fixing this
96 | s = s.replace('\n',(char) 0x0a);
97 | //s = s.replaceAll("" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
98 | s = Utilities_Localised.strReplaceAll(s, "" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
99 |
100 |
101 | //return s.getBytes();
102 | c.send_data(s.getBytes(),s.length());
103 | }
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/TypeHandler.java:
--------------------------------------------------------------------------------
1 | /* TypeHandler.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.DataFlavor;
15 | import java.awt.datatransfer.Transferable;
16 |
17 | import com.elusiva.rdp.RdpPacket;
18 |
19 | public abstract class TypeHandler {
20 |
21 | /* Clipboard constants, "borrowed" from GCC system headers in
22 | the w32 cross compiler */
23 |
24 | // Format constants
25 | public static final int CF_TEXT = 1;
26 | public static final int CF_BITMAP = 2;
27 | public static final int CF_METAFILEPICT = 3;
28 | public static final int CF_SYLK = 4;
29 | public static final int CF_DIF = 5;
30 | public static final int CF_TIFF = 6;
31 | public static final int CF_OEMTEXT = 7;
32 | public static final int CF_DIB = 8;
33 | public static final int CF_PALETTE = 9;
34 | public static final int CF_PENDATA = 10;
35 | public static final int CF_RIFF = 11;
36 | public static final int CF_WAVE = 12;
37 | public static final int CF_UNICODETEXT = 13;
38 | public static final int CF_ENHMETAFILE = 14;
39 | public static final int CF_HDROP = 15;
40 | public static final int CF_LOCALE = 16;
41 | public static final int CF_MAX = 17;
42 | public static final int CF_OWNERDISPLAY = 128;
43 | public static final int CF_DSPTEXT = 129;
44 | public static final int CF_DSPBITMAP = 130;
45 | public static final int CF_DSPMETAFILEPICT = 131;
46 | public static final int CF_DSPENHMETAFILE = 142;
47 | public static final int CF_PRIVATEFIRST = 512;
48 | public static final int CF_PRIVATELAST = 767;
49 | public static final int CF_GDIOBJFIRST = 768;
50 | public static final int CF_GDIOBJLAST = 1023;
51 |
52 | public abstract String name();
53 | public abstract void handleData(RdpPacket data, int length, ClipInterface c);
54 | public abstract int preferredFormat();
55 | public abstract boolean formatValid(int format);
56 | public abstract boolean mimeTypeValid(String mimeType);
57 |
58 | public abstract void send_data(Transferable in, ClipInterface c);
59 |
60 | public boolean clipboardValid(DataFlavor[] dataTypes) {
61 |
62 | for(int i = 0; i < dataTypes.length; i++){
63 | if(mimeTypeValid(dataTypes[i].getPrimaryType())) return true;
64 | }
65 | return false;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/TypeHandlerList.java:
--------------------------------------------------------------------------------
1 | /* TypeHandlerList.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:41 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.DataFlavor;
15 | import java.util.ArrayList;
16 | import java.util.Iterator;
17 |
18 | import com.elusiva.rdp.RdpPacket;
19 |
20 | public class TypeHandlerList {
21 |
22 | ArrayList handlers = new ArrayList();
23 | private int count;
24 |
25 | public TypeHandlerList(){
26 | count = 0;
27 | }
28 |
29 |
30 | public void add(TypeHandler t){
31 | if(t != null){ handlers.add(t); count++; }
32 | }
33 |
34 | public TypeHandler getHandlerForFormat(int format){
35 | TypeHandler handler = null;
36 | for(Iterator i = handlers.iterator(); i.hasNext();){
37 | handler = (TypeHandler)i.next();
38 | if((handler != null) && handler.formatValid(format)) return handler;
39 | }
40 | return null;
41 | }
42 |
43 | public TypeHandlerList getHandlersForMimeType(String mimeType){
44 | TypeHandlerList outList = new TypeHandlerList();
45 |
46 | TypeHandler handler = null;
47 | for(Iterator i = handlers.iterator(); i.hasNext();){
48 | handler = (TypeHandler)i.next();
49 | if(handler.mimeTypeValid(mimeType)) outList.add(handler);
50 | }
51 | return outList;
52 | }
53 |
54 | public TypeHandlerList getHandlersForClipboard(DataFlavor[] dataTypes){
55 | TypeHandlerList outList = new TypeHandlerList();
56 |
57 | TypeHandler handler = null;
58 | for(Iterator i = handlers.iterator(); i.hasNext();){
59 | handler = (TypeHandler)i.next();
60 | if(handler.clipboardValid(dataTypes)) outList.add(handler);
61 | }
62 | return outList;
63 | }
64 |
65 | public void writeTypeDefinitions(RdpPacket data){
66 | TypeHandler handler = null;
67 | for(Iterator i = handlers.iterator(); i.hasNext();){
68 | handler = (TypeHandler)i.next();
69 | data.setLittleEndian32(handler.preferredFormat());
70 | data.incrementPosition(32);
71 | }
72 | }
73 |
74 | public int count(){
75 | return count;
76 | }
77 |
78 | public TypeHandler getFirst() {
79 | if(count > 0)
80 | return (TypeHandler) handlers.get(0);
81 | else return null;
82 | }
83 |
84 | public Iterator iterator(){
85 | return handlers.iterator();
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/src/com/elusiva/rdp/rdp5/cliprdr/UnicodeHandler.java:
--------------------------------------------------------------------------------
1 | /* UnicodeHandler.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | */
12 | package com.elusiva.rdp.rdp5.cliprdr;
13 |
14 | import java.awt.datatransfer.DataFlavor;
15 | import java.awt.datatransfer.StringSelection;
16 | import java.awt.datatransfer.Transferable;
17 |
18 | import com.elusiva.rdp.RdpPacket;
19 | import com.elusiva.rdp.RdpPacket_Localised;
20 | import com.elusiva.rdp.Utilities_Localised;
21 |
22 | public class UnicodeHandler extends TypeHandler {
23 |
24 | public boolean formatValid(int format) {
25 | return (format == CF_UNICODETEXT);
26 | }
27 |
28 | public boolean mimeTypeValid(String mimeType) {
29 | return mimeType.equals("text");
30 | }
31 |
32 | public int preferredFormat() {
33 | return CF_UNICODETEXT;
34 | }
35 |
36 | public void handleData(RdpPacket data, int length, ClipInterface c) {
37 | String thingy = "";
38 | for(int i = 0; i < length; i+=2){
39 | int aByte = data.getLittleEndian16();
40 | if(aByte != 0) thingy += (char) (aByte);
41 | }
42 | c.copyToClipboard(new StringSelection(thingy));
43 | //return(new StringSelection(thingy));
44 | }
45 |
46 | public String name() {
47 | return "CF_UNICODETEXT";
48 | }
49 |
50 | public byte[] fromTransferable(Transferable in) {
51 | String s;
52 | if (in != null)
53 | {
54 | try {
55 | s = (String)(in.getTransferData(DataFlavor.stringFlavor));
56 | }
57 | catch (Exception e) {
58 | s = e.toString();
59 | }
60 |
61 | // TODO: think of a better way of fixing this
62 | s = s.replace('\n',(char) 0x0a);
63 | //s = s.replaceAll("" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
64 | s = Utilities_Localised.strReplaceAll(s, "" + (char) 0x0a, "" + (char) 0x0d + (char) 0x0a);
65 | byte[] sBytes = s.getBytes();
66 | int length = sBytes.length;
67 | int lengthBy2 = length*2;
68 | RdpPacket p = new RdpPacket_Localised(lengthBy2);
69 | for(int i = 0; i < sBytes.length; i++){
70 | p.setLittleEndian16(sBytes[i]);
71 | }
72 | sBytes = new byte[length*2];
73 | p.copyToByteArray(sBytes,0,0,lengthBy2);
74 | return sBytes;
75 | }
76 | return null;
77 | }
78 |
79 | /* (non-Javadoc)
80 | * @see com.elusiva.rdp.rdp5.cliprdr.TypeHandler#send_data(java.awt.datatransfer.Transferable)
81 | */
82 | public void send_data(Transferable in, ClipInterface c) {
83 | byte[] data = fromTransferable(in);
84 | c.send_data(data,data.length);
85 | }
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/ISO_Localised.java:
--------------------------------------------------------------------------------
1 | /* ISO.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of ISO class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 |
17 | public class ISO_Localised extends ISO {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/Input_Localised.java:
--------------------------------------------------------------------------------
1 | /* Input_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of Input class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | import com.elusiva.rdp.keymapping.KeyCode;
17 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
18 |
19 | public class Input_Localised extends Input {
20 |
21 | public Input_Localised(RdesktopCanvas c, Rdp r, String k){
22 | super(c,r,k);
23 | }
24 |
25 | public Input_Localised(RdesktopCanvas c, Rdp r, KeyCode_FileBased k){
26 | super(c,r,k);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/KeyCode_FileBased_Localised.java:
--------------------------------------------------------------------------------
1 | /* KeyCode_FileBased_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of KeyCode_FileBased class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | import java.awt.event.KeyEvent;
15 | import java.io.InputStream;
16 |
17 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
18 | import com.elusiva.rdp.keymapping.KeyMapException;
19 |
20 |
21 | public class KeyCode_FileBased_Localised extends KeyCode_FileBased {
22 |
23 | /**
24 | * @param fstream
25 | * @throws KeyMapException
26 | */
27 | public KeyCode_FileBased_Localised(InputStream fstream) throws KeyMapException {
28 | super(fstream);
29 | }
30 |
31 | public KeyCode_FileBased_Localised(String s) throws KeyMapException{
32 | super(s);
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/LicenceStore_Localised.java:
--------------------------------------------------------------------------------
1 | /* LicenceStore_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of LicenceStore class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class LicenceStore_Localised extends LicenceStore {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/RdesktopCanvas_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopCanvas_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of RdesktopCanvas class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 | import java.awt.Graphics;
16 | import java.awt.Rectangle;
17 | import java.awt.image.*;
18 | import java.awt.*;
19 |
20 | import com.elusiva.rdp.Options;
21 |
22 | public class RdesktopCanvas_Localised extends RdesktopCanvas {
23 | RdesktopCanvas_Localised(int width, int height){
24 | super(width,height);
25 | }
26 |
27 | public void update(Graphics g) {
28 | Rectangle r = g.getClipBounds();
29 | g.drawImage(backstore.getSubimage(r.x,r.y,r.width,r.height),r.x,r.y,null);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/RdesktopFrame_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopFrame_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of RdesktopFrame class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 |
17 | public class RdesktopFrame_Localised extends RdesktopFrame {
18 | protected void checkFullScreenWidthHeight(){
19 | if(Options.fullscreen){
20 | // can't remove frame decoration so reduce size to compensate
21 | Options.height -= 26;
22 | Options.width -= 8;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src1.1/com/elusiva/rdp/Utilities_Localised.java:
--------------------------------------------------------------------------------
1 | /* Utilities_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:59 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.1 specific extension of Utilities class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | public class Utilities_Localised extends Utilities {
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/ISO_Localised.java:
--------------------------------------------------------------------------------
1 | /* ISO.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of ISO class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class ISO_Localised extends ISO {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/Input_Localised.java:
--------------------------------------------------------------------------------
1 | /* Input_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of Input class
11 | */
12 | //Created on 07-Jul-2003
13 |
14 | package com.elusiva.rdp;
15 | import java.awt.event.*;
16 |
17 | import com.elusiva.rdp.keymapping.KeyCode;
18 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
19 |
20 | public class Input_Localised extends Input {
21 | public void clearKeys(){
22 | super.clearKeys();
23 | if (lastKeyEvent != null && lastKeyEvent.isAltGraphDown()) sendScancode(getTime(),RDP_KEYRELEASE,0x38 | KeyCode.SCANCODE_EXTENDED); //r.alt
24 | }
25 | public void setKeys(){
26 | super.setKeys();
27 | if (lastKeyEvent != null && lastKeyEvent.isAltGraphDown()) sendScancode(getTime(),RDP_KEYPRESS,0x38 | KeyCode.SCANCODE_EXTENDED); //r.alt
28 | }
29 |
30 | public Input_Localised(RdesktopCanvas c, Rdp r, String k){
31 | super(c,r,k);
32 | }
33 |
34 | public Input_Localised(RdesktopCanvas c, Rdp r, KeyCode_FileBased k){
35 | super(c,r,k);
36 | }
37 |
38 |
39 | public boolean handleShortcutKeys(long time, KeyEvent e, boolean pressed){
40 | if (super.handleShortcutKeys(time,e,pressed)) return true;
41 |
42 | if (!altDown) return false; // all of the below have ALT on
43 |
44 | switch(e.getKeyCode()){
45 | case KeyEvent.VK_MINUS: // for laptops that can't do Ctrl+Alt+Minus
46 | if (ctrlDown){
47 | if(pressed){
48 | sendScancode(time,RDP_KEYRELEASE,0x1d); // Ctrl
49 | sendScancode(time,RDP_KEYPRESS,0x37 | KeyCode.SCANCODE_EXTENDED); // PrtSc
50 | logger.debug("shortcut pressed: sent ALT+PRTSC");
51 | }
52 | else{
53 | sendScancode(time,RDP_KEYRELEASE,0x37 | KeyCode.SCANCODE_EXTENDED); // PrtSc
54 | sendScancode(time,RDP_KEYPRESS,0x1d); // Ctrl
55 | }
56 | }
57 | break;
58 | default: return false;
59 | }
60 | return true;
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/KeyCode_FileBased_Localised.java:
--------------------------------------------------------------------------------
1 | /* KeyCode_FileBased_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of KeyCode_FileBased class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | import java.awt.event.KeyEvent;
15 | import java.io.InputStream;
16 |
17 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
18 | import com.elusiva.rdp.keymapping.KeyMapException;
19 |
20 |
21 | public class KeyCode_FileBased_Localised extends KeyCode_FileBased {
22 |
23 | /**
24 | * @param fstream
25 | * @throws KeyMapException
26 | */
27 | public KeyCode_FileBased_Localised(InputStream fstream) throws KeyMapException {
28 | super(fstream);
29 | }
30 |
31 | public KeyCode_FileBased_Localised(String s) throws KeyMapException{
32 | super(s);
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/LicenceStore_Localised.java:
--------------------------------------------------------------------------------
1 | /* LicenceStore_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of LicenceStore class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class LicenceStore_Localised extends LicenceStore {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/RdesktopCanvas_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopCanvas_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of RdesktopCanvas class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 | import java.awt.image.*;
16 | import java.awt.*;
17 |
18 | import com.elusiva.rdp.Options;
19 |
20 |
21 | public class RdesktopCanvas_Localised extends RdesktopCanvas {
22 |
23 | RdesktopCanvas_Localised(int width, int height){
24 | super(width,height);
25 | }
26 |
27 | protected Cursor createCustomCursor(Image wincursor, Point p, String s, int cache_idx){
28 | return Toolkit.getDefaultToolkit().createCustomCursor(wincursor, p, "");
29 | }
30 |
31 |
32 | public void update(Graphics g){
33 | Rectangle r = g.getClipBounds();
34 | g.drawImage(backstore.getSubimage(r.x,r.y,r.width,r.height),r.x,r.y,null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/RdesktopFrame_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopFrame_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of RdesktopFrame class
11 | */
12 | // Created on 07-Jul-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class RdesktopFrame_Localised extends RdesktopFrame {
17 | protected void checkFullScreenWidthHeight(){
18 | if(Options.fullscreen){
19 | // can't remove frame decoration so reduce size to compensate
20 | Options.height -= 26;
21 | Options.width -= 8;
22 | }
23 | }
24 | }
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src1.2/com/elusiva/rdp/Utilities_Localised.java:
--------------------------------------------------------------------------------
1 | /* Utilities_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:44 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.2 specific extension of Utilities class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | public class Utilities_Localised extends Utilities {
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/ISO_Localised.java:
--------------------------------------------------------------------------------
1 | /* ISO.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:52 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of ISO class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class ISO_Localised extends ISO {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/Input_Localised.java:
--------------------------------------------------------------------------------
1 | /* Input_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:52 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of Input class
11 | */
12 | //Created on 07-Jul-2003
13 |
14 | package com.elusiva.rdp;
15 | import java.awt.*;
16 | import java.awt.event.*;
17 |
18 | import com.elusiva.rdp.Options;
19 | import com.elusiva.rdp.keymapping.KeyCode;
20 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
21 |
22 | public class Input_Localised extends Input {
23 | public void clearKeys(){
24 | super.clearKeys();
25 | if (lastKeyEvent != null && lastKeyEvent.isAltGraphDown()) sendScancode(getTime(),RDP_KEYRELEASE,0x38 | KeyCode.SCANCODE_EXTENDED); //r.alt
26 | }
27 | public void setKeys(){
28 | super.setKeys();
29 | if (lastKeyEvent != null && lastKeyEvent.isAltGraphDown()) sendScancode(getTime(),RDP_KEYPRESS,0x38 | KeyCode.SCANCODE_EXTENDED); //r.alt
30 | }
31 |
32 | public boolean handleShortcutKeys(long time, KeyEvent e, boolean pressed){
33 | if (super.handleShortcutKeys(time,e,pressed)) return true;
34 |
35 | if (!altDown) return false; // all of the below have ALT on
36 |
37 | switch(e.getKeyCode()){
38 | case KeyEvent.VK_MINUS: // for laptops that can't do Ctrl+Alt+Minus
39 | if (ctrlDown){
40 | if(pressed){
41 | sendScancode(time,RDP_KEYRELEASE,0x1d); // Ctrl
42 | sendScancode(time,RDP_KEYPRESS,0x37 | KeyCode.SCANCODE_EXTENDED); // PrtSc
43 | logger.debug("shortcut pressed: sent ALT+PRTSC");
44 | }
45 | else{
46 | sendScancode(time,RDP_KEYRELEASE,0x37 | KeyCode.SCANCODE_EXTENDED); // PrtSc
47 | sendScancode(time,RDP_KEYPRESS,0x1d); // Ctrl
48 | }
49 | }
50 | break;
51 | default: return false;
52 | }
53 | return true;
54 | }
55 |
56 | protected void doLockKeys(){
57 | // doesn't work on Java 1.4.1_02 or 1.4.2 on Linux, there is a bug in java....
58 | // does work on the same version on Windows.
59 | if(!Rdesktop.readytosend) return;
60 | if(Constants.OS == Constants.LINUX) return; // broken for linux
61 | if(Constants.OS == Constants.MAC) return; // unsupported operation for mac
62 | logger.debug("doLockKeys");
63 |
64 | try {
65 | Toolkit tk = Toolkit.getDefaultToolkit();
66 | if (tk.getLockingKeyState(KeyEvent.VK_CAPS_LOCK) != capsLockOn){
67 | capsLockOn = !capsLockOn;
68 | logger.debug("CAPS LOCK toggle");
69 | sendScancode(getTime(),RDP_KEYPRESS,0x3a);
70 | sendScancode(getTime(),RDP_KEYRELEASE,0x3a);
71 |
72 | }
73 | if (tk.getLockingKeyState(KeyEvent.VK_NUM_LOCK) != numLockOn){
74 | numLockOn = !numLockOn;
75 | logger.debug("NUM LOCK toggle");
76 | sendScancode(getTime(),RDP_KEYPRESS,0x45);
77 | sendScancode(getTime(),RDP_KEYRELEASE,0x45);
78 |
79 | }
80 | if (tk.getLockingKeyState(KeyEvent.VK_SCROLL_LOCK) != scrollLockOn){
81 | scrollLockOn = !scrollLockOn;
82 | logger.debug("SCROLL LOCK toggle");
83 | sendScancode(getTime(),RDP_KEYPRESS,0x46);
84 | sendScancode(getTime(),RDP_KEYRELEASE,0x46);
85 | }
86 | }catch(Exception e){
87 | Options.useLockingKeyState = false;
88 | }
89 | }
90 |
91 |
92 | public Input_Localised(RdesktopCanvas c, Rdp r, String k){
93 | super(c,r,k);
94 | }
95 |
96 | public Input_Localised(RdesktopCanvas c, Rdp r, KeyCode_FileBased k){
97 | super(c,r,k);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/KeyCode_FileBased_Localised.java:
--------------------------------------------------------------------------------
1 | /* KeyCode_FileBased_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of KeyCode_FileBased class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | import java.awt.event.KeyEvent;
15 | import java.io.InputStream;
16 | import java.util.HashMap;
17 |
18 | import com.elusiva.rdp.Options;
19 | import com.elusiva.rdp.keymapping.KeyCode_FileBased;
20 | import com.elusiva.rdp.keymapping.KeyMapException;
21 |
22 |
23 | public class KeyCode_FileBased_Localised extends KeyCode_FileBased {
24 |
25 | private HashMap keysCurrentlyDown = new HashMap();
26 |
27 | /**
28 | * @param fstream
29 | * @throws KeyMapException
30 | */
31 | public KeyCode_FileBased_Localised(InputStream fstream) throws KeyMapException {
32 | super(fstream);
33 | }
34 |
35 | public KeyCode_FileBased_Localised(String s) throws KeyMapException{
36 | super(s);
37 | }
38 |
39 | private void updateCapsLock(KeyEvent e){
40 | if(Options.useLockingKeyState){
41 | try {
42 | Options.useLockingKeyState = true;
43 | capsLockDown = e.getComponent().getToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
44 | } catch (Exception uoe){ Options.useLockingKeyState = false; }
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/LicenceStore_Localised.java:
--------------------------------------------------------------------------------
1 | /* LicenceStore_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of LicenceStore class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class LicenceStore_Localised extends LicenceStore {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/RdesktopCanvas_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopCanvas_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of RdesktopCanvas class
11 | */
12 | // Created on 03-Sep-2003
13 |
14 | package com.elusiva.rdp;
15 | import java.awt.image.*;
16 | import java.awt.*;
17 |
18 | import com.elusiva.rdp.Options;
19 |
20 |
21 | public class RdesktopCanvas_Localised extends RdesktopCanvas {
22 |
23 | private Robot robot = null;
24 |
25 | RdesktopCanvas_Localised(int width, int height){
26 | super(width,height);
27 | }
28 |
29 | public void movePointer(int x, int y){
30 | Point p = this.getLocationOnScreen();
31 | x = x + p.x;
32 | y = y + p.y;
33 | robot.mouseMove(x, y);
34 | }
35 |
36 | protected Cursor createCustomCursor(Image wincursor, Point p, String s, int cache_idx){
37 | return Toolkit.getDefaultToolkit().createCustomCursor(wincursor, p, "");
38 | }
39 |
40 | public void addNotify(){
41 | super.addNotify();
42 |
43 | if (robot == null) {
44 | try {
45 | robot = new Robot();
46 | } catch(AWTException e) {
47 | logger.warn("Pointer movement not allowed");
48 | }
49 | }
50 | }
51 |
52 | public void update(Graphics g){
53 | Rectangle r = g.getClipBounds();
54 | g.drawImage(backstore.getSubimage(r.x,r.y,r.width,r.height),r.x,r.y,null);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/RdesktopFrame_Localised.java:
--------------------------------------------------------------------------------
1 | /* RdesktopFrame_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of RdesktopFrame class
11 | */
12 | // Created on 07-Jul-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | public class RdesktopFrame_Localised extends RdesktopFrame {
17 | protected void checkFullScreenWidthHeight(){
18 | if(Options.fullscreen){
19 | // can't remove frame decoration so reduce size to compensate
20 | Options.height -= 26;
21 | Options.width -= 8;
22 | }
23 | }
24 | }
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src1.3/com/elusiva/rdp/Utilities_Localised.java:
--------------------------------------------------------------------------------
1 | /* Utilities_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.3 specific extension of Utilities class
11 | */
12 | package com.elusiva.rdp;
13 |
14 | public class Utilities_Localised extends Utilities {
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src1.4/com/elusiva/rdp/ISO_Localised.java:
--------------------------------------------------------------------------------
1 | /* ISO.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.1.1.1 $
5 | * Author: $Author: suvarov $
6 | * Date: $Date: 2007/03/08 00:26:53 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.4 specific extension of ISO class
11 | */
12 | // Created on 05-Aug-2003
13 |
14 | package com.elusiva.rdp;
15 |
16 | import java.io.IOException;
17 | import java.net.InetAddress;
18 | import java.net.InetSocketAddress;
19 | import java.net.Socket;
20 |
21 | public class ISO_Localised extends ISO {
22 |
23 | /*
24 | protected Socket negotiateSSL(Socket sock) throws Exception {
25 | // The default host/port to connect to
26 | String host="localhost";
27 | int port=4433;
28 | String keyfile="client.pem";
29 | String rootfile="root.pem";
30 | String randomfile="random.pem";
31 | String password="password";
32 | LongOpt Longopts[]=new LongOpt[13];
33 | int iterate=1;
34 | boolean acceptunverified=false;
35 | boolean fakeseed=false;
36 | boolean checkDates=false;
37 | short[] cipherSuites=null;
38 | int delay=0;
39 | boolean negotiateTLS=true;
40 |
41 | SSLContext ctx=new SSLContext();
42 | SSLPolicyInt policy=new SSLPolicyInt();
43 |
44 | if(cipherSuites!=null)
45 | policy.setCipherSuites(cipherSuites);
46 |
47 | policy.acceptUnverifiableCertificates(true);
48 | policy.negotiateTLS(negotiateTLS);
49 | ctx.setPolicy(policy);
50 |
51 |
52 | SSLSocket s = null;
53 |
54 | s = new SSLSocket(ctx,sock,host,port,SSLSocket.CLIENT);
55 | logger.info("Layered SSL socket on existing socket");
56 |
57 | Vector cc=s.getCertificateChain();
58 | int cs=s.getCipherSuite();
59 |
60 | System.out.println("Cipher suite: "+SSLPolicyInt.getCipherSuiteName
61 | (cs));
62 |
63 | if(cc!=null){
64 | System.out.println("Cert chain");
65 |
66 | for(int i=0;i