Permalink
Browse files

Revert "code clean up"

This reverts commit 3b55dd2.
  • Loading branch information...
1 parent 3b55dd2 commit cd4c79b9ce695bd15377f16962d324906ec8256a @kmscode kmscode committed Jul 2, 2016
Showing with 392 additions and 299 deletions.
  1. +1 −0 VncSharp/EncodedRectangleFactory.cs
  2. +1 −0 VncSharp/Encodings/CPixelReader.cs
  3. +6 −4 VncSharp/Encodings/CoRreRectangle.cs
  4. +4 −3 VncSharp/Encodings/CopyRectRectangle.cs
  5. +3 −2 VncSharp/Encodings/EncodedRectangle.cs
  6. +2 −1 VncSharp/Encodings/HextileRectangle.cs
  7. +2 −1 VncSharp/Encodings/PixelReader.cs
  8. +1 −0 VncSharp/Encodings/PixelReader16.cs
  9. +5 −4 VncSharp/Encodings/PixelReader32.cs
  10. +1 −0 VncSharp/Encodings/PixelReader8.cs
  11. +2 −0 VncSharp/Encodings/RawRectangle.cs
  12. +6 −4 VncSharp/Encodings/RreRectangle.cs
  13. +3 −0 VncSharp/Encodings/ZrleRectangle.cs
  14. +9 −9 VncSharp/Framebuffer.cs
  15. +1 −0 VncSharp/IDesktopUpdater.cs
  16. +1 −0 VncSharp/IVncInputPolicy.cs
  17. +3 −0 VncSharp/PasswordDialog.cs
  18. +1 −0 VncSharp/Properties/AssemblyInfo.cs
  19. +271 −216 VncSharp/RemoteDesktop.cs
  20. +17 −14 VncSharp/RfbProtocol.cs
  21. +3 −3 VncSharp/VncClient.cs
  22. +2 −0 VncSharp/VncClippedDesktopPolicy.cs
  23. +1 −0 VncSharp/VncDefaultInputPolicy.cs
  24. +1 −0 VncSharp/VncDesignModeDesktopPolicy.cs
  25. +2 −0 VncSharp/VncDesktopTransformPolicy.cs
  26. +1 −0 VncSharp/VncScaledDesktopPolicy.cs
  27. +1 −0 VncSharp/VncViewInputPolicy.cs
  28. +1 −1 VncSharp/zlib.NET/Adler32.cs
  29. +6 −6 VncSharp/zlib.NET/Deflate.cs
  30. +8 −8 VncSharp/zlib.NET/InfBlocks.cs
  31. +1 −1 VncSharp/zlib.NET/InfCodes.cs
  32. +1 −1 VncSharp/zlib.NET/InfTree.cs
  33. +2 −2 VncSharp/zlib.NET/Inflate.cs
  34. +1 −1 VncSharp/zlib.NET/StaticTree.cs
  35. +4 −1 VncSharp/zlib.NET/SupportClass.cs
  36. +3 −3 VncSharp/zlib.NET/Tree.cs
  37. +5 −5 VncSharp/zlib.NET/ZInputStream.cs
  38. +5 −5 VncSharp/zlib.NET/ZOutputStream.cs
  39. +1 −1 VncSharp/zlib.NET/ZStream.cs
  40. +1 −1 VncSharp/zlib.NET/ZStreamException.cs
  41. +2 −2 VncSharp/zlib.NET/Zlib.cs
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
using VncSharp.Encodings;
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.IO;
namespace VncSharp.Encodings
@@ -15,7 +15,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
+using System.Drawing.Imaging;
// FIXME: I can't understand why yet, but under the Xvnc server in Unix (v. 3.3.7), this doesn't work.
// Everything is fine using the Windows server!?
@@ -49,10 +51,10 @@ public override void Decode()
// Colour in all the subrectangles, reading the properties of each one after another.
for (int i = 0; i < numSubRect; i++) {
subRectVal = preader.ReadPixel();
- x = rfb.ReadByte();
- y = rfb.ReadByte();
- w = rfb.ReadByte();
- h = rfb.ReadByte();
+ x = (int) rfb.ReadByte();
+ y = (int) rfb.ReadByte();
+ w = (int) rfb.ReadByte();
+ h = (int) rfb.ReadByte();
// Colour in this sub-rectangle with the colour provided.
FillRectangle(new Rectangle(x, y, w, h), subRectVal);
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
using System.Drawing.Imaging;
@@ -40,11 +41,11 @@ public override void Decode()
{
// Read the source point from which to begin copying pixels
source = new Point();
- source.X = rfb.ReadUInt16();
- source.Y = rfb.ReadUInt16();
+ source.X = (int) rfb.ReadUInt16();
+ source.Y = (int) rfb.ReadUInt16();
}
- public override unsafe void Draw(Bitmap desktop)
+ public unsafe override void Draw(Bitmap desktop)
{
// Given a source area, copy this region to the point specified by destination
BitmapData bmpd = desktop.LockBits(new Rectangle(new Point(0,0), desktop.Size),
@@ -18,6 +18,7 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
+using System.Runtime.InteropServices;
using System.IO;
namespace VncSharp.Encodings
@@ -61,7 +62,7 @@ public EncodedRectangle(RfbProtocol rfb, Framebuffer framebuffer, Rectangle rect
preader = new PixelReader8(reader, framebuffer, rfb);
break;
default:
- throw new ArgumentOutOfRangeException(nameof(framebuffer.BitsPerPixel), framebuffer.BitsPerPixel, "Valid VNC Pixel Widths are 8, 16 or 32 bits.");
+ throw new ArgumentOutOfRangeException("BitsPerPixel", framebuffer.BitsPerPixel, "Valid VNC Pixel Widths are 8, 16 or 32 bits.");
}
}
@@ -83,7 +84,7 @@ public EncodedRectangle(RfbProtocol rfb, Framebuffer framebuffer, Rectangle rect
/// After calling Decode() an EncodedRectangle can be drawn to a Bitmap, which is the local representation of the remote desktop.
/// </summary>
/// <param name="desktop">The image the represents the remote desktop. NOTE: this image will be altered.</param>
- public virtual unsafe void Draw(Bitmap desktop)
+ public unsafe virtual void Draw(Bitmap desktop)
{
// Lock the bitmap's scan-lines in RAM so we can iterate over them using pointers and update the area
// defined in rectangle.
@@ -14,8 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+using System;
using System.Drawing;
+using System.Drawing.Imaging;
namespace VncSharp.Encodings
{
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.IO;
namespace VncSharp.Encodings
@@ -39,7 +40,7 @@ protected PixelReader(BinaryReader reader, Framebuffer framebuffer)
protected int ToGdiPlusOrder(byte red, byte green, byte blue)
{
// Put colour values into proper order for GDI+ (i.e., BGRA, where Alpha is always 0xFF)
- return blue & 0xFF | green << 8 | red << 16 | 0xFF << 24;
+ return (int) (blue & 0xFF | green << 8 | red << 16 | 0xFF << 24);
}
}
}
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.IO;
namespace VncSharp.Encodings
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.IO;
namespace VncSharp.Encodings
@@ -33,10 +34,10 @@ public override int ReadPixel()
// Read the pixel value
byte[] b = reader.ReadBytes(4);
- uint pixel = ((uint)b[0]) & 0xFF |
- ((uint)b[1]) << 8 |
- ((uint)b[2]) << 16 |
- ((uint)b[3]) << 24;
+ uint pixel = (uint)(((uint)b[0]) & 0xFF |
+ ((uint)b[1]) << 8 |
+ ((uint)b[2]) << 16 |
+ ((uint)b[3]) << 24);
// Extract RGB intensities from pixel
byte red = (byte) ((pixel >> framebuffer.RedShift) & framebuffer.RedMax);
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.IO;
namespace VncSharp.Encodings
@@ -15,7 +15,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
+using System.Drawing.Imaging;
namespace VncSharp.Encodings
{
@@ -15,7 +15,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
+using System.Drawing.Imaging;
namespace VncSharp.Encodings
{
@@ -44,10 +46,10 @@ public override void Decode()
// Colour in all the subrectangles, reading the properties of each one after another.
for (int i = 0; i < numSubRect; i++) {
subRectVal = preader.ReadPixel();
- x = rfb.ReadUInt16();
- y = rfb.ReadUInt16();
- w = rfb.ReadUInt16();
- h = rfb.ReadUInt16();
+ x = (int) rfb.ReadUInt16();
+ y = (int) rfb.ReadUInt16();
+ w = (int) rfb.ReadUInt16();
+ h = (int) rfb.ReadUInt16();
// Colour in this sub-rectangle
FillRectangle(new Rectangle(x, y, w, h), subRectVal);
@@ -16,6 +16,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.IO.Compression;
namespace VncSharp.Encodings
{
@@ -229,7 +229,7 @@ public Framebuffer(int width, int height)
}
set {
if (value == null)
- throw new ArgumentNullException(nameof(DesktopName));
+ throw new ArgumentNullException("DesktopName");
name = value;
}
}
@@ -274,16 +274,16 @@ public static Framebuffer FromPixelFormat(byte[] b, int width, int height)
Framebuffer buffer = new Framebuffer(width, height);
- buffer.BitsPerPixel = b[0];
- buffer.Depth = b[1];
+ buffer.BitsPerPixel = (int) b[0];
+ buffer.Depth = (int) b[1];
buffer.BigEndian = (b[2] != 0);
buffer.TrueColour = (b[3] != 0);
- buffer.RedMax = b[5] | b[4] << 8;
- buffer.GreenMax = b[7] | b[6] << 8;
- buffer.BlueMax = b[9] | b[8] << 8;
- buffer.RedShift = b[10];
- buffer.GreenShift = b[11];
- buffer.BlueShift = b[12];
+ buffer.RedMax = (int) (b[5] | b[4] << 8);
+ buffer.GreenMax = (int) (b[7] | b[6] << 8);
+ buffer.BlueMax = (int) (b[9] | b[8] << 8);
+ buffer.RedShift = (int) b[10];
+ buffer.GreenShift = (int) b[11];
+ buffer.BlueShift = (int) b[12];
// Last 3 bytes are padding, ignore
return buffer;
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
namespace VncSharp
@@ -15,6 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
using System.Drawing;
namespace VncSharp
@@ -15,6 +15,9 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Drawing;
+using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
@@ -1,4 +1,5 @@
using System.Reflection;
+using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("VncSharpNG")]
[assembly: AssemblyDescription(".NET VNC Client Library")]
Oops, something went wrong.

0 comments on commit cd4c79b

Please sign in to comment.