Permalink
Browse files

Update to code base

  • Loading branch information...
1 parent feaa02f commit 2dd45deff31eeb95f7afcbe80061ed7965c08e31 Steven Houben committed Aug 28, 2012
@@ -85,6 +85,7 @@
</ApplicationDefinition>
<Compile Include="Activity\Proxy.cs" />
<Compile Include="Context\InputRedirect.cs" />
+ <Compile Include="PDFConverter.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Xaml\ActivityButton.cs" />
<Compile Include="Xaml\IconToAvgColorBrushConverter.cs" />
@@ -170,6 +171,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
@@ -77,10 +77,9 @@ private void MouseHookMouseMove(object sender, MouseEventArgs e)
}
var xDif = _previousPoint.X - e.Location.X;
var yDif = _previousPoint.Y - e.Location.Y;
- Console.WriteLine(xDif + "---" + yDif);
if (PointerRole == PointerRole.Controller)
- Send(new PointerMessage(e.Location.X, e.Location.Y+ yDif, PointerEvent.MouseMove).ToString());
+ Send(new PointerMessage(e.Location.X, e.Location.Y, PointerEvent.MouseMove).ToString());
_previousPoint = e.Location;
}
private void MouseHookMouseDown(object sender, MouseEventArgs e)
@@ -0,0 +1,47 @@
+/****************************************************************************
+ (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
+
+ Pervasive Interaction Technology Laboratory (pIT lab)
+ IT University of Copenhagen
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
+ as published by the Free Software Foundation. Check
+ http://www.gnu.org/licenses/gpl.html for details.
+****************************************************************************/
+
+using System.Diagnostics;
+using System.IO;
+
+namespace ActivityUI
+{
+ public sealed class PDFConverter
+ {
+ public static void PdfToJpg(string ghostScriptPath,string input, string output)
+ {
+ var ars = "-dNOPAUSE -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r150*150 -o" + output + " " + input; //all image generate with full clarity and same pixel size (1275*1650)
+ var proc = new Process
+ {
+ StartInfo =
+ {
+ FileName = ghostScriptPath,
+ Arguments = ars,
+ CreateNoWindow = true,
+ WindowStyle = ProcessWindowStyle.Hidden
+ }
+ };
+ proc.Start();
+ proc.WaitForExit();
+ }
+ public static string Convert(string path)
+ {
+ var ghostScriptPath = @"C:\Program Files (x86)\gs\gs9.01\bin\gswin32a.exe";
+
+ var filename = Path.GetFileNameWithoutExtension(path);
+ var directory = Path.GetDirectoryName(path);
+ var outputFileName = directory + filename + ".png";
+ PdfToJpg(ghostScriptPath, path, outputFileName);
+ return outputFileName;
+ }
+ }
+}
@@ -24,6 +24,7 @@
using System.Runtime.InteropServices;
using System.Windows.Interop;
using ActivityUI.Context;
+using ActivityUI.Xaml.Login;
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Base.Service;
@@ -35,7 +36,6 @@
using NooSphere.Platform.Windows.Hooks;
using NooSphere.Platform.Windows.VDM;
using ActivityUI.Properties;
-using ActivityUI.Login;
using ActivityUI.PopUp;
namespace ActivityUI.Xaml
@@ -234,30 +234,28 @@ private void StartClient(string activityManagerHttpAddress)
_client.ActivityAdded += ClientActivityAdded;
_client.ActivityChanged += ClientActivityChanged;
_client.ActivityRemoved += ClientActivityRemoved;
- _client.ActivitySwitched += new ActivitySwitchedHandler(_client_ActivitySwitched);
+ _client.ActivitySwitched += ClientActivitySwitched;
_client.MessageReceived += ClientMessageReceived;
_client.FriendAdded += client_FriendAdded;
_client.FriendDeleted += client_FriendDeleted;
_client.FriendRequestReceived += ClientFriendRequestReceived;
- _client.ContextMessageReceived += _client_ContextMessageReceived;
-
_client.ConnectionEstablished += ClientConnectionEstablished;
- _client.ServiceIsDown += _client_ServiceIsDown;
-
- _client.ContextMonitor.AddContextService(new InputRedirect(PointerRole.Slave));
+ _client.ServiceIsDown += ClientServiceIsDown;
+ _client.ContextMonitor.AddContextService(new InputRedirect(PointerRole.Controller));
+ _client.ContextMessageReceived += _client_ContextMessageReceived;
_client.Open(activityManagerHttpAddress);
}
- void _client_ActivitySwitched(object sender, ActivityEventArgs e)
+ void ClientActivitySwitched(object sender, ActivityEventArgs e)
{
VirtualDesktopManager.CurrentDesktop = _proxies[e.Activity.Id].Desktop;
}
- void _client_ServiceIsDown(object sender, EventArgs e)
+ void ClientServiceIsDown(object sender, EventArgs e)
{
Environment.Exit(0);
}
@@ -440,7 +438,7 @@ public void DeleteActivity()
public void EditActivity(Activity ac)
{
_currentButton.Text = ac.Name;
- //client.UpdateActivity(ac);
+ _client.UpdateActivity(ac);
}
/// <summary>
@@ -695,7 +693,7 @@ public Activity GetInitializedActivity()
{
var ac = new Activity
{
- Name = "test activity - " + DateTime.Now,
+ Name = "nameless",
Description = "This is the description of the test activity - " + DateTime.Now
};
ac.Uri = "http://tempori.org/" + ac.Id;
@@ -807,25 +805,18 @@ private void ApplyGlass(IntPtr handle)
private void BDragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
- {
e.Effects = DragDropEffects.Copy;
- }
-
}
private void BDrop(object sender, DragEventArgs e)
{
- if (e.Data.GetDataPresent(DataFormats.FileDrop))
- {
-
- var droppedFilePaths =
+ if (!e.Data.GetDataPresent(DataFormats.FileDrop)) return;
+ var droppedFilePaths =
e.Data.GetData(DataFormats.FileDrop, true) as string[];
-
- _client.AddResource(new FileInfo(droppedFilePaths[0]), ((ActivityButton) sender).ActivityId);
-
- }
+ if (droppedFilePaths == null) return;
+ var fInfo = new FileInfo(droppedFilePaths[0]);
+ _client.AddResource(fInfo, ((ActivityButton)sender).ActivityId);
}
-
}
public enum RenderStyle
{
@@ -1,67 +1,67 @@
-<Window
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="ActivityUI.Login.LoginWindow"
- Title="Activity Cloud V1" Height="414" Width="418" Icon="/ActivityUI;component/Images/application_view_tile.png" UseLayoutRounding="True" SnapsToDevicePixels="False" WindowStartupLocation="CenterScreen" Topmost="True" ShowInTaskbar="False" ResizeMode="NoResize" WindowStyle="SingleBorderWindow">
- <Window.Resources>
- </Window.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.722*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" MinHeight="458"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Label Content="Username" Height="28" HorizontalAlignment="Left" Margin="8,113,0,0" x:Name="lblName" VerticalAlignment="Top" />
- <Label Content="Email" Height="28" HorizontalAlignment="Left" Margin="8,145,0,0" x:Name="lblEmail" VerticalAlignment="Top" />
- <TextBox Height="23" Margin="95,115,20,0" x:Name="txtUsername" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
- <TextBox Height="23" Margin="95,147,20,0" x:Name="txtEmail" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
- <TextBox Height="23" Margin="95,180,20,0" x:Name="txtDevicename" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
- <Image Height="94" HorizontalAlignment="Left" x:Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="144" Source="/ActivityUI;component/Images/activity1.PNG" />
- <Button Content="Go" Margin="0,0,8,89" Style="{DynamicResource Success}" Foreground="White" FontSize="13.333" HorizontalAlignment="Right" Width="81" RenderTransformOrigin="-0.037,0.75" Height="30" VerticalAlignment="Bottom" Name="btnGo" Click="btnGo_Click" MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" ToolTip="Start the application and connect to the cloud." IsDefault="True">
- <Button.Background>
- <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFF3F3F3" Offset="0"/>
- <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
- <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
- <GradientStop Color="#FFCDCDCD" Offset="1"/>
- </LinearGradientBrush>
- </Button.Background>
- </Button>
- <Button Content="Stop" Margin="0,0,93,89" Style="{DynamicResource Danger}" Foreground="White" FontSize="13.333" HorizontalAlignment="Right" Width="81" RenderTransformOrigin="-0.037,0.75" Height="30" VerticalAlignment="Bottom" Click="cancel_Click" MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" ToolTip="Stop the login process and exit the application." Name="btnStop">
- <Button.Background>
- <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFF3F3F3" Offset="0"/>
- <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
- <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
- <GradientStop Color="#FFCDCDCD" Offset="1"/>
- </LinearGradientBrush>
- </Button.Background>
- </Button>
- <RadioButton Content="Client and Host" Height="16" HorizontalAlignment="Left" Margin="158,248,0,0" Name="rbClientAndHost" VerticalAlignment="Top" GroupName="startup" IsChecked="True" />
- <RadioButton Content="Client" GroupName="startup" Height="16" HorizontalAlignment="Left" Margin="98,248,0,0" Name="rbClient" VerticalAlignment="Top" />
- <CheckBox Height="16" HorizontalAlignment="Right" Margin="0,285,209,0" Name="chkRemember" VerticalAlignment="Top" IsChecked="True" Width="166" Content="Remember my details." />
- <Label Content="Device name" Height="28" HorizontalAlignment="Left" Margin="8,177,0,0" Name="label1" VerticalAlignment="Top" Width="83" />
- <Button Content="Info" FontSize="13.333" Foreground="White" Height="30" HorizontalAlignment="Left" Margin="8,0,0,89" RenderTransformOrigin="-0.037,0.75" Style="{DynamicResource Action}" VerticalAlignment="Bottom" Width="81" Click="Button_Click" ToolTip="This will launch a website in you favorit browser." MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" Name="btnInfo">
- <Button.Background>
- <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#FFF3F3F3" Offset="0" />
- <GradientStop Color="#FFEBEBEB" Offset="0.5" />
- <GradientStop Color="#FFDDDDDD" Offset="0.5" />
- <GradientStop Color="#FFCDCDCD" Offset="1" />
- </LinearGradientBrush>
- </Button.Background>
- </Button>
- <TextBlock Height="22" Margin="21,307,30,0" Name="txtTooltip" Text="" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="12" Foreground="#FF3091FC" TextAlignment="Center" />
- <RadioButton Content="I don't know" GroupName="startup" Height="16" HorizontalAlignment="Left" Margin="270,248,0,0" Name="radioButton1" VerticalAlignment="Top" />
- <Image Height="47" x:Name="imgLogo" Stretch="None" VerticalAlignment="Top" Source="/ActivityUI;component/Images/logo.PNG" Margin="107,35,0,0" />
- <Label Content="Device type" Height="28" HorizontalAlignment="Left" Margin="8,211,0,0" Name="label2" VerticalAlignment="Top" Width="83" />
- <Label Content="Device tag" Height="28" HorizontalAlignment="Left" Margin="220,211,0,0" Name="label4" VerticalAlignment="Top" Width="83" />
- <Label Content="Connection" Height="28" HorizontalAlignment="Left" Margin="8,243,0,0" Name="label3" VerticalAlignment="Top" Width="83" />
-
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="95,211,0,0" Name="cbType" VerticalAlignment="Top" Width="127" ItemsSource="{Binding}" Tag="Unknown" />
- <ComboBox Height="23" HorizontalAlignment="Left" Margin="285,211,0,0" Name="cbTag" VerticalAlignment="Top" Width="91" ItemsSource="{Binding}" Tag="Unknown" />
-
- </Grid>
+<Window
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="ActivityUI.Xaml.Login.LoginWindow"
+ Title="Activity Cloud V1" Height="414" Width="418" Icon="/ActivityUI;component/Images/application_view_tile.png" UseLayoutRounding="True" SnapsToDevicePixels="False" WindowStartupLocation="CenterScreen" Topmost="True" ShowInTaskbar="False" ResizeMode="NoResize" WindowStyle="SingleBorderWindow">
+ <Window.Resources>
+ </Window.Resources>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="0.722*" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" MinHeight="458"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <Label Content="Username" Height="28" HorizontalAlignment="Left" Margin="8,113,0,0" x:Name="lblName" VerticalAlignment="Top" />
+ <Label Content="Email" Height="28" HorizontalAlignment="Left" Margin="8,145,0,0" x:Name="lblEmail" VerticalAlignment="Top" />
+ <TextBox Height="23" Margin="95,115,20,0" x:Name="txtUsername" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
+ <TextBox Height="23" Margin="95,147,20,0" x:Name="txtEmail" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
+ <TextBox Height="23" Margin="95,180,20,0" x:Name="txtDevicename" VerticalAlignment="Top" d:LayoutOverrides="GridBox" />
+ <Image Height="94" HorizontalAlignment="Left" x:Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="144" Source="/ActivityUI;component/Images/activity1.PNG" />
+ <Button Content="Go" Margin="0,0,8,89" Style="{DynamicResource Success}" Foreground="White" FontSize="13.333" HorizontalAlignment="Right" Width="81" RenderTransformOrigin="-0.037,0.75" Height="30" VerticalAlignment="Bottom" Name="btnGo" Click="btnGo_Click" MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" ToolTip="Start the application and connect to the cloud." IsDefault="True">
+ <Button.Background>
+ <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+ <GradientStop Color="#FFF3F3F3" Offset="0"/>
+ <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
+ <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
+ <GradientStop Color="#FFCDCDCD" Offset="1"/>
+ </LinearGradientBrush>
+ </Button.Background>
+ </Button>
+ <Button Content="Stop" Margin="0,0,93,89" Style="{DynamicResource Danger}" Foreground="White" FontSize="13.333" HorizontalAlignment="Right" Width="81" RenderTransformOrigin="-0.037,0.75" Height="30" VerticalAlignment="Bottom" Click="cancel_Click" MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" ToolTip="Stop the login process and exit the application." Name="btnStop">
+ <Button.Background>
+ <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+ <GradientStop Color="#FFF3F3F3" Offset="0"/>
+ <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
+ <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
+ <GradientStop Color="#FFCDCDCD" Offset="1"/>
+ </LinearGradientBrush>
+ </Button.Background>
+ </Button>
+ <RadioButton Content="Client and Host" Height="16" HorizontalAlignment="Left" Margin="158,248,0,0" Name="rbClientAndHost" VerticalAlignment="Top" GroupName="startup" IsChecked="True" />
+ <RadioButton Content="Client" GroupName="startup" Height="16" HorizontalAlignment="Left" Margin="98,248,0,0" Name="rbClient" VerticalAlignment="Top" />
+ <CheckBox Height="16" HorizontalAlignment="Right" Margin="0,285,209,0" Name="chkRemember" VerticalAlignment="Top" IsChecked="True" Width="166" Content="Remember my details." />
+ <Label Content="Device name" Height="28" HorizontalAlignment="Left" Margin="8,177,0,0" Name="label1" VerticalAlignment="Top" Width="83" />
+ <Button Content="Info" FontSize="13.333" Foreground="White" Height="30" HorizontalAlignment="Left" Margin="8,0,0,89" RenderTransformOrigin="-0.037,0.75" Style="{DynamicResource Action}" VerticalAlignment="Bottom" Width="81" Click="Button_Click" ToolTip="This will launch a website in you favorit browser." MouseEnter="btnGo_MouseEnter" MouseLeave="btnGo_MouseLeave" Name="btnInfo">
+ <Button.Background>
+ <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+ <GradientStop Color="#FFF3F3F3" Offset="0" />
+ <GradientStop Color="#FFEBEBEB" Offset="0.5" />
+ <GradientStop Color="#FFDDDDDD" Offset="0.5" />
+ <GradientStop Color="#FFCDCDCD" Offset="1" />
+ </LinearGradientBrush>
+ </Button.Background>
+ </Button>
+ <TextBlock Height="22" Margin="21,307,30,0" Name="txtTooltip" Text="" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="12" Foreground="#FF3091FC" TextAlignment="Center" />
+ <RadioButton Content="I don't know" GroupName="startup" Height="16" HorizontalAlignment="Left" Margin="270,248,0,0" Name="radioButton1" VerticalAlignment="Top" />
+ <Image Height="47" x:Name="imgLogo" Stretch="None" VerticalAlignment="Top" Source="/ActivityUI;component/Images/logo.PNG" Margin="107,35,0,0" />
+ <Label Content="Device type" Height="28" HorizontalAlignment="Left" Margin="8,211,0,0" Name="label2" VerticalAlignment="Top" Width="83" />
+ <Label Content="Device tag" Height="28" HorizontalAlignment="Left" Margin="220,211,0,0" Name="label4" VerticalAlignment="Top" Width="83" />
+ <Label Content="Connection" Height="28" HorizontalAlignment="Left" Margin="8,243,0,0" Name="label3" VerticalAlignment="Top" Width="83" />
+
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="95,211,0,0" Name="cbType" VerticalAlignment="Top" Width="127" ItemsSource="{Binding}" Tag="Unknown" />
+ <ComboBox Height="23" HorizontalAlignment="Left" Margin="285,211,0,0" Name="cbTag" VerticalAlignment="Top" Width="91" ItemsSource="{Binding}" Tag="Unknown" />
+
+ </Grid>
</Window>
Oops, something went wrong.

0 comments on commit 2dd45de

Please sign in to comment.