Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed Mar 4, 2016
1 parent 24af8fc commit 7468390
Show file tree
Hide file tree
Showing 65 changed files with 896 additions and 3,308 deletions.
42 changes: 42 additions & 0 deletions LittleBigMouse.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifyChange", "NotifyChang
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Argyll", "..\LightMeter\Argyll\Argyll.csproj", "{444F1148-7014-469B-8809-834FEDA0F730}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAPI", "..\MgthFramework\NativeMethods\WinAPI.csproj", "{641054C2-F89B-4ABE-97B4-EE841556E999}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsMonitors", "WindowsMonitors\WindowsMonitors.csproj", "{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorVcp", "MonitorVcp\MonitorVcp.csproj", "{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}"
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
Expand Down Expand Up @@ -114,6 +120,42 @@ Global
{444F1148-7014-469B-8809-834FEDA0F730}.Release|x64.Build.0 = Release|x64
{444F1148-7014-469B-8809-834FEDA0F730}.Release|x86.ActiveCfg = Release|Any CPU
{444F1148-7014-469B-8809-834FEDA0F730}.Release|x86.Build.0 = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|Any CPU.Build.0 = Debug|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|x64.ActiveCfg = Debug|x64
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|x64.Build.0 = Debug|x64
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|x86.ActiveCfg = Debug|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Debug|x86.Build.0 = Debug|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|Any CPU.ActiveCfg = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|Any CPU.Build.0 = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|x64.ActiveCfg = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|x64.Build.0 = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|x86.ActiveCfg = Release|Any CPU
{641054C2-F89B-4ABE-97B4-EE841556E999}.Release|x86.Build.0 = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|x64.ActiveCfg = Debug|x64
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|x64.Build.0 = Debug|x64
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|x86.ActiveCfg = Debug|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Debug|x86.Build.0 = Debug|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|Any CPU.Build.0 = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|x64.ActiveCfg = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|x64.Build.0 = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|x86.ActiveCfg = Release|Any CPU
{0C90E881-B94C-4DC5-B2D0-FF6DC7601DE4}.Release|x86.Build.0 = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|x64.ActiveCfg = Debug|x64
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|x64.Build.0 = Debug|x64
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|x86.ActiveCfg = Debug|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Debug|x86.Build.0 = Debug|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|Any CPU.Build.0 = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|x64.ActiveCfg = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|x64.Build.0 = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|x86.ActiveCfg = Release|Any CPU
{543A85AB-37E8-4DB6-B51A-07B719A4DF2E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
390 changes: 195 additions & 195 deletions LittleBigMouse_Control/App.xaml

Large diffs are not rendered by default.

72 changes: 71 additions & 1 deletion LittleBigMouse_Control/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System.Windows;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

namespace LittleBigMouse_Control
{
Expand All @@ -8,5 +12,71 @@ namespace LittleBigMouse_Control
public partial class App : Application
{
}

public class BoolToStringConverter : BoolToValueConverter<String> { }
public class BoolToBrushConverter : BoolToValueConverter<Brush> { }
public class BoolToVisibilityConverter : BoolToValueConverter<Visibility> { }
public class BoolToObjectConverter : BoolToValueConverter<Object> { }
public class BoolToValueConverter<T> : IValueConverter
{
public T FalseValue { get; set; }
public T TrueValue { get; set; }

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return FalseValue;
else
return (bool)value ? TrueValue : FalseValue;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value?.Equals(TrueValue) ?? false;
}
}

public class ScaleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double v = 12;
if (value is double)
v = (double)value;
else if (value is FrameworkElement)
v = Math.Min(((FrameworkElement)value).ActualHeight, ((FrameworkElement)value).ActualWidth);

double scale = double.Parse((string)parameter, CultureInfo.InvariantCulture);

return Math.Max(v * scale, 0.1);
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}

}

public class MultiScaleConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
double v = double.MaxValue;
foreach (object value in values)
{
if (value is double && (double)value < v) v = (double)value;
}

double scale = double.Parse((string)parameter, CultureInfo.InvariantCulture);

return Math.Max(v * scale, 0.1);
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

15 changes: 0 additions & 15 deletions LittleBigMouse_Control/IPluginButton.cs

This file was deleted.

69 changes: 44 additions & 25 deletions LittleBigMouse_Control/LittleBigMon_Control.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="OxyPlot.Wpf">
<HintPath>..\packages\OxyPlot.Wpf.1.0.0-unstable1886\lib\net45\OxyPlot.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand All @@ -134,25 +132,30 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Plugins\Debug\PluginDebug.cs" />
<Compile Include="Plugins\Debug\DebugScreenView.xaml.cs">
<DependentUpon>DebugScreenView.xaml</DependentUpon>
</Compile>
<Compile Include="Plugins\Debug\DebugViewModel.cs" />
<Compile Include="PresenterViewModel.cs" />
<Compile Include="ScreenControlViewModel.cs" />
<Compile Include="SizePlugin\SizeScreenView.xaml.cs">
<Compile Include="Plugins\Size\SizeScreenView.xaml.cs">
<DependentUpon>SizeScreenView.xaml</DependentUpon>
</Compile>
<Compile Include="SizePlugin\SizePlugin.cs" />
<Compile Include="Plugins\Size\SizePlugin.cs" />
<Compile Include="ColorsWindow.xaml.cs">
<DependentUpon>ColorsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Curve.xaml.cs">
<DependentUpon>Curve.xaml</DependentUpon>
</Compile>
<Compile Include="IPluginButton.cs" />
<Compile Include="Plugins\IPluginButton.cs" />
<Compile Include="MainViewModel.cs" />
<Compile Include="MultiScreensView.xaml.cs">
<DependentUpon>MultiScreensView.xaml</DependentUpon>
</Compile>
<Compile Include="MultiScreensViewModel.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Plugins\Plugin.cs" />
<Compile Include="ScreenFrameView.xaml.cs">
<DependentUpon>ScreenFrameView.xaml</DependentUpon>
</Compile>
Expand All @@ -161,37 +164,41 @@
</Compile>
<Compile Include="ScreenFrameViewModel.cs" />
<Compile Include="ScreenViewModel.cs" />
<Compile Include="SizePlugin\SizeViewModel.cs" />
<Compile Include="LocationPlugin\LocationControlView.xaml.cs">
<Compile Include="Plugins\Size\SizeViewModel.cs" />
<Compile Include="Plugins\Location\LocationControlView.xaml.cs">
<DependentUpon>LocationControlView.xaml</DependentUpon>
</Compile>
<Compile Include="LocationPlugin\LocationScreenView.xaml.cs">
<Compile Include="Plugins\Location\LocationScreenView.xaml.cs">
<DependentUpon>LocationScreenView.xaml</DependentUpon>
</Compile>
<Compile Include="SingleInstance.cs" />
<Compile Include="LocationPlugin\LocationControlViewModel.cs" />
<Compile Include="LocationPlugin\LocationPlugin.cs" />
<Compile Include="LocationPlugin\LocationScreenViewModel.cs" />
<Compile Include="Plugins\Location\LocationControlViewModel.cs" />
<Compile Include="Plugins\Location\LocationPlugin.cs" />
<Compile Include="Plugins\Location\LocationScreenViewModel.cs" />
<Compile Include="SmootGradientLinearBrush.cs" />
<Compile Include="TestPattern.cs" />
<Compile Include="TestPatternWindow.xaml.cs">
<DependentUpon>TestPatternWindow.xaml</DependentUpon>
</Compile>
<Compile Include="VcpPlugin\VcpControlView.xaml.cs">
<Compile Include="Plugins\Vcp\VcpControlView.xaml.cs">
<DependentUpon>VcpControlView.xaml</DependentUpon>
</Compile>
<Compile Include="VcpPlugin\LossyThread.cs" />
<Compile Include="VcpPlugin\ScreenGuiVcp.xaml.cs">
<Compile Include="Plugins\Vcp\LossyThread.cs" />
<Compile Include="Plugins\Vcp\ScreenGuiVcp.xaml.cs">
<DependentUpon>ScreenGuiVcp.xaml</DependentUpon>
</Compile>
<Compile Include="VcpPlugin\VcpControlViewModel.cs" />
<Compile Include="VcpPlugin\VcpPlugin.cs" />
<Compile Include="VcpPlugin\VcpSlider.xaml.cs">
<Compile Include="Plugins\Vcp\VcpControlViewModel.cs" />
<Compile Include="Plugins\Vcp\VcpPlugin.cs" />
<Compile Include="Plugins\Vcp\VcpSlider.xaml.cs">
<DependentUpon>VcpSlider.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel.cs" />
<Compile Include="WindowResize.cs" />
<Page Include="SizePlugin\SizeScreenView.xaml">
<Page Include="Plugins\Debug\DebugScreenView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Plugins\Size\SizeScreenView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -226,27 +233,27 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LocationPlugin\LocationControlView.xaml">
<Page Include="Plugins\Location\LocationControlView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LocationPlugin\LocationScreenView.xaml">
<Page Include="Plugins\Location\LocationScreenView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="TestPatternWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="VcpPlugin\VcpControlView.xaml">
<Page Include="Plugins\Vcp\VcpControlView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="VcpPlugin\ScreenGuiVcp.xaml">
<Page Include="Plugins\Vcp\ScreenGuiVcp.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="VcpPlugin\VcpSlider.xaml">
<Page Include="Plugins\Vcp\VcpSlider.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -303,10 +310,18 @@
<Name>Argyll</Name>
<EmbedInteropTypes>False</EmbedInteropTypes>
</ProjectReference>
<ProjectReference Include="..\..\MgthFramework\NativeMethods\WinAPI.csproj">
<Project>{641054c2-f89b-4abe-97b4-ee841556e999}</Project>
<Name>WinAPI</Name>
</ProjectReference>
<ProjectReference Include="..\LittleBigMouse_Daemon\LittleBigMouse_Daemon.csproj">
<Project>{cea3e9df-4011-4041-bccf-6318dc7e76f4}</Project>
<Name>LittleBigMouse_Daemon</Name>
</ProjectReference>
<ProjectReference Include="..\MonitorVcp\MonitorVcp.csproj">
<Project>{543a85ab-37e8-4db6-b51a-07b719a4df2e}</Project>
<Name>MonitorVcp</Name>
</ProjectReference>
<ProjectReference Include="..\NativeHelpers\NativeHelpers.vcxproj">
<Project>{938e65d0-ec9c-4181-87ca-a43d4747610d}</Project>
<Name>NativeHelpers</Name>
Expand All @@ -323,6 +338,10 @@
<Project>{81b5abcc-6909-483d-8bb3-84b52e3c7043}</Project>
<Name>TaskService</Name>
</ProjectReference>
<ProjectReference Include="..\WindowsMonitors\WindowsMonitors.csproj">
<Project>{0c90e881-b94c-4dc5-b2d0-ff6dc7601de4}</Project>
<Name>WindowsMonitors</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="setup\LittleBigMouse.iss" />
Expand Down
5 changes: 2 additions & 3 deletions LittleBigMouse_Control/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:src="clr-namespace:NativeHelpers;assembly=NativeHelpers"
xmlns:local="clr-namespace:LittleBigMouse_Control"
mc:Ignorable="d"
mc:Ignorable="d"
Icon="MainIcon.ico"
Title="Little Big LbmMouse" Topmost="True"
BorderBrush="Black"
Expand Down Expand Up @@ -44,7 +43,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.Column="0" Background="#C0000000">
<Grid.ColumnDefinitions>
Expand Down
19 changes: 5 additions & 14 deletions LittleBigMouse_Control/MainView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,11 @@ You should have received a copy of the GNU General Public License
http://www.mgth.fr
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using LbmScreenConfig;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using NativeHelpers;
using WinAPI_User32;
using System.Windows.Interop;
using System.Runtime.InteropServices;
using NotifyChange;

namespace LittleBigMouse_Control
{
Expand Down Expand Up @@ -66,9 +56,10 @@ public MainView()
Config = config,
Plugins =
{
new LocationPlugin.LocationPlugin(),
new SizePlugin.BordersPlugin(),
//new VcpPlugin.VcpPlugin()
new PluginLocation.LocationPlugin(),
new Plugins.Size.SizePlugin(),
//new VcpPlugin.VcpPlugin(),
new Plugins.Debug.PluginDebug(),
},
Presenter = presenter
};
Expand All @@ -80,7 +71,7 @@ public MainView()

private void Window_Loaded(object sender, RoutedEventArgs e)
{
User32.EnableBlur(this);
this.EnableBlur();
}


Expand Down
Loading

0 comments on commit 7468390

Please sign in to comment.