aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.RemoteDesktop
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-06-01 02:06:40 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-06-01 02:06:40 +0300
commitaff00af76242117e3991b0ee526df905a63debce (patch)
tree96bc51983c314a6c08cc7f804c599a28f23efd8a /Software/Visual_Studio/Tango.RemoteDesktop
parent862ee0839083ca350125d48841ce7427d5a578d9 (diff)
downloadTango-aff00af76242117e3991b0ee526df905a63debce.tar.gz
Tango-aff00af76242117e3991b0ee526df905a63debce.zip
Remote Cursor.
Cursor Visibility. Mouse Scroll. PPC notification bar workaround.
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop')
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Frames/RasterFrame.cs12
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Input/MouseController.cs5
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseEventType.cs3
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseStateRequest.cs1
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Network/RemoteDesktopPacket.cs11
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityRequest.cs13
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityResponse.cs13
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/Tango.RemoteDesktop.csproj2
8 files changed, 59 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Frames/RasterFrame.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Frames/RasterFrame.cs
index bcb372bd3..a9cbea6f2 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Frames/RasterFrame.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Frames/RasterFrame.cs
@@ -110,6 +110,18 @@ namespace Tango.RemoteDesktop.Frames
}
/// <summary>
+ /// Draws the specified image on to this frame.
+ /// </summary>
+ /// <param name="bitmap">The bitmap.</param>
+ public virtual void DrawImage(Bitmap bitmap, Point position)
+ {
+ using (Graphics g = Graphics.FromImage(_bitmap))
+ {
+ g.DrawImage(bitmap, new Rectangle(position, bitmap.Size));
+ }
+ }
+
+ /// <summary>
/// Optimizes the bounds of this frame by removing unnecessary margins.
/// </summary>
/// <returns></returns>
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Input/MouseController.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Input/MouseController.cs
index ce3a3eb09..295aca4b1 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Input/MouseController.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Input/MouseController.cs
@@ -77,6 +77,11 @@ namespace Tango.RemoteDesktop.Input
simulator.Mouse.LeftButtonDoubleClick();
}
+ public static void Scroll(int delta)
+ {
+ simulator.Mouse.VerticalScroll(delta);
+ }
+
[StructLayout(LayoutKind.Sequential)]
public struct MousePoint
{
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseEventType.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseEventType.cs
index 2c9f84e03..ca8945dda 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseEventType.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseEventType.cs
@@ -11,6 +11,7 @@ namespace Tango.RemoteDesktop.Network
Down,
Up,
Move,
- DoubleClick
+ DoubleClick,
+ Scroll,
}
}
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseStateRequest.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseStateRequest.cs
index 36e98351f..67076c211 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseStateRequest.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Network/MouseStateRequest.cs
@@ -13,5 +13,6 @@ namespace Tango.RemoteDesktop.Network
public MouseButton Button { get; set; }
public MouseEventType EventType { get; set; }
public Point Location { get; set; }
+ public int ScrollDelta { get; set; }
}
}
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Network/RemoteDesktopPacket.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Network/RemoteDesktopPacket.cs
index 28f890a9a..f0186e94f 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Network/RemoteDesktopPacket.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Network/RemoteDesktopPacket.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows;
namespace Tango.RemoteDesktop.Network
{
@@ -22,5 +23,15 @@ namespace Tango.RemoteDesktop.Network
/// Gets or sets the region on the previous bitmap that needs to be applied with this packet bitmap.
/// </summary>
public CaptureRegion PartialRegion { get; set; }
+
+ /// <summary>
+ /// Gets or sets the mouse position.
+ /// </summary>
+ public Point MousePosition { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the frame includes the remote cursor.
+ /// </summary>
+ public bool CursorVisible { get; set; }
}
}
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityRequest.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityRequest.cs
new file mode 100644
index 000000000..f8b832f36
--- /dev/null
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityRequest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.RemoteDesktop.Network
+{
+ public class SetCursorVisibilityRequest
+ {
+ public bool Visible { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityResponse.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityResponse.cs
new file mode 100644
index 000000000..d333cb134
--- /dev/null
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Network/SetCursorVisibilityResponse.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.RemoteDesktop.Network
+{
+ public class SetCursorVisibilityResponse
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Tango.RemoteDesktop.csproj b/Software/Visual_Studio/Tango.RemoteDesktop/Tango.RemoteDesktop.csproj
index 25c1d265c..4b2c95501 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/Tango.RemoteDesktop.csproj
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/Tango.RemoteDesktop.csproj
@@ -100,6 +100,8 @@
<Compile Include="Network\RemoteDesktopCommandRequest.cs" />
<Compile Include="Network\RemoteDesktopPacket.cs" />
<Compile Include="Network\RemoteDesktopCommandResponse.cs" />
+ <Compile Include="Network\SetCursorVisibilityRequest.cs" />
+ <Compile Include="Network\SetCursorVisibilityResponse.cs" />
<Compile Include="Network\StartRemoteDesktopSessionRequest.cs" />
<Compile Include="Network\StartRemoteDesktopSessionResponse.cs" />
<Compile Include="Network\StopRemoteDesktopSessionRequest.cs" />