diff --git a/src/Artemis.Plugins.Devices.Wooting/Artemis.Plugins.Devices.Wooting.csproj b/src/Artemis.Plugins.Devices.Wooting/Artemis.Plugins.Devices.Wooting.csproj new file mode 100644 index 000000000..7a9cf0fc1 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/Artemis.Plugins.Devices.Wooting.csproj @@ -0,0 +1,80 @@ + + + + + Debug + AnyCPU + {C6BDB6D9-062D-4C28-A280-F3BD6197F07F} + Library + Properties + Artemis.Plugins.Devices.Wooting + Artemis.Plugins.Devices.Wooting + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\RGB.NET\bin\net45\RGB.NET.Core.dll + + + ..\..\..\RGB.NET\bin\net45\RGB.NET.Devices.Wooting.dll + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + PreserveNewest + + + + + {9b811f9b-86b9-4771-87af-72bae7078a36} + Artemis.Core + + + + + echo Copying resources to plugin output directory +XCOPY "$(ProjectDir)Images" "$(TargetDir)Images" /s /q /i /y +XCOPY "$(ProjectDir)Layouts" "$(TargetDir)Layouts" /s /q /i /y +echo Copying plugin to Artemis.UI output directory +XCOPY "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)\Artemis.UI\$(OutDir)Plugins\$(ProjectName)" /s /q /i /y + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/Missing.png b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/Missing.png new file mode 100644 index 000000000..42807f806 Binary files /dev/null and b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/Missing.png differ diff --git a/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/WOOTINGTWO.png b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/WOOTINGTWO.png new file mode 100644 index 000000000..ea29a6171 Binary files /dev/null and b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/Keyboards/WOOTINGTWO.png differ diff --git a/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/empty.png b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/empty.png new file mode 100644 index 000000000..af367b99a Binary files /dev/null and b/src/Artemis.Plugins.Devices.Wooting/Images/Wooting/empty.png differ diff --git a/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGONE/US.xml b/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGONE/US.xml new file mode 100644 index 000000000..4922c8693 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGONE/US.xml @@ -0,0 +1,319 @@ + + + Wooting One - Physical US + Physical US (ANSI) layout of the Wooting One + Keyboard + Key + Wooting + Wooting One + 450 + 150 + Images\Wooting\Keyboards + WOOTINGONE.png + + + 8 + 9 + + + +19 + + + + + + +9.5 + + + + + + +9.5 + + + + + + +8 + + + + + +8 + 1 + + + 1 + + + 1 + + + 1 + + + 8 + +5 + + + + + + + + + + + + + + + 2 + + + +8 + + + + + +8 + + + + + + 8 + + + 1.5 + + + + + + + + + + + + + + + 1.5 + + + +8 + + + + + +8 + + + + + 2 + + + 8 + ~ + 1.75 + + + + + + + + + + + + + + 2.25 + + + +73 + + + + + 8 + + + 2.25 + + + + + + + + + + + + + 2.75 + + + +27 + + + +27 + + + + + 2 + + + 8 + ~ + 1.2 + + + 1.25 + + + 1.25 + + + 6.35 + + + 1.25 + + + 1.25 + + + 1.25 + + + 1.2 + + + +8 + + + + + +8 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGTWO/US.xml b/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGTWO/US.xml new file mode 100644 index 000000000..f812756c4 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/Layouts/Wooting/Keyboards/WOOTINGTWO/US.xml @@ -0,0 +1,319 @@ + + + Wooting Two - Physical US + Physical US (ANSI) layout of the Wooting Two + Keyboard + Key + Wooting + Wooting Two + 450 + 150 + Images\Wooting\Keyboards + WOOTINGTWO.png + + + 8 + 9 + + + +19 + + + + + + +9.5 + + + + + + +9.5 + + + + + + +8 + + + + + +8 + 1 + + + 1 + + + 1 + + + 1 + + + 8 + +5 + + + + + + + + + + + + + + + 2 + + + +8 + + + + + +8 + + + + + + 8 + + + 1.5 + + + + + + + + + + + + + + + 1.5 + + + +8 + + + + + +8 + + + + + 2 + + + 8 + ~ + 1.75 + + + + + + + + + + + + + + 2.25 + + + +73 + + + + + 8 + + + 2.25 + + + + + + + + + + + + + 2.75 + + + +27 + + + +27 + + + + + 2 + + + 8 + ~ + 1.2 + + + 1.25 + + + 1.25 + + + 6.35 + + + 1.25 + + + 1.25 + + + 1.25 + + + 1.2 + + + +8 + + + + + +8 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Wooting/Properties/AssemblyInfo.cs b/src/Artemis.Plugins.Devices.Wooting/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..f08f0d2fa --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Artemis.Plugins.Devices.Wooting")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Artemis.Plugins.Devices.Wooting")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c6bdb6d9-062d-4c28-a280-f3bd6197f07f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Artemis.Plugins.Devices.Wooting/WootingDeviceProvider.cs b/src/Artemis.Plugins.Devices.Wooting/WootingDeviceProvider.cs new file mode 100644 index 000000000..01ac495f0 --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/WootingDeviceProvider.cs @@ -0,0 +1,40 @@ +using System.IO; +using Artemis.Core.Plugins.Abstract; +using Artemis.Core.Plugins.Models; +using Artemis.Core.Services.Interfaces; +using RGB.NET.Core; +using RGB.NET.Devices.Wooting.Generic; + +namespace Artemis.Plugins.Devices.Wooting +{ + // ReSharper disable once UnusedMember.Global + public class WootingDeviceProvider : DeviceProvider + { + private readonly IRgbService _rgbService; + + public WootingDeviceProvider(PluginInfo pluginInfo, IRgbService rgbService) : base(pluginInfo, RGB.NET.Devices.Wooting.WootingDeviceProvider.Instance) + { + _rgbService = rgbService; + } + + public override void EnablePlugin() + { + PathHelper.ResolvingAbsolutePath += (sender, args) => ResolveAbsolutePath(typeof(WootingRGBDevice<>), sender, args); + RGB.NET.Devices.Wooting.WootingDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "wooting-rgb-sdk64.dll")); + RGB.NET.Devices.Wooting.WootingDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "wooting-rgb-sdk.dll")); + _rgbService.AddDeviceProvider(RgbDeviceProvider); + } + + public override void DisablePlugin() + { + // TODO: Remove the device provider from the surface + } + + public override void Dispose() + { + // TODO: This will probably not go well without first removing the device provider + // WootingDeviceProvider.Instance.ResetDevices(); + // WootingDeviceProvider.Instance.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins.Devices.Wooting/plugin.json b/src/Artemis.Plugins.Devices.Wooting/plugin.json new file mode 100644 index 000000000..6851ed5be --- /dev/null +++ b/src/Artemis.Plugins.Devices.Wooting/plugin.json @@ -0,0 +1,10 @@ +{ + "Guid": "e70fd5ba-9881-480a-8ff6-078ed5f747fa", + "Name": "Wooting Devices", + "Version": { + "Major": 1, + "Minor": 0, + "Build": 0 + }, + "Main": "Artemis.Plugins.Devices.Wooting.dll" +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileDeviceView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileDeviceView.xaml index f130ea888..21b97be25 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileDeviceView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/Visualization/ProfileDeviceView.xaml @@ -25,8 +25,9 @@ HorizontalAlignment="Left" Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}" /> - -