diff --git a/Corale.Colore/Corale.Colore.csproj b/Corale.Colore/Corale.Colore.csproj index 27887480..2f61c801 100644 --- a/Corale.Colore/Corale.Colore.csproj +++ b/Corale.Colore/Corale.Colore.csproj @@ -92,7 +92,16 @@ + + + + + + + + + diff --git a/Corale.Colore/Core/Device.Obsoletes.cs b/Corale.Colore/Core/Device.Obsoletes.cs new file mode 100644 index 00000000..baa50aa9 --- /dev/null +++ b/Corale.Colore/Core/Device.Obsoletes.cs @@ -0,0 +1,57 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + + /// + /// Base class for devices, containing code common between all devices. + /// + public abstract partial class Device + { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public abstract void Set(Color color); + + /// + /// Updates the device to use the effect pointed to by the specified GUID. + /// + /// GUID to set. + [Obsolete("Set is deprecated, please use SetGuid(Guid).", false)] + public void Set(Guid guid) + { + SetGuid(guid); + } + } +} diff --git a/Corale.Colore/Core/Device.cs b/Corale.Colore/Core/Device.cs index 7a14413a..a463ea6b 100644 --- a/Corale.Colore/Core/Device.cs +++ b/Corale.Colore/Core/Device.cs @@ -35,7 +35,7 @@ namespace Corale.Colore.Core /// /// Base class for devices, containing code common between all devices. /// - public abstract class Device : IDevice + public abstract partial class Device : IDevice { /// /// Gets or sets the ID of the currently active effect. diff --git a/Corale.Colore/Core/GenericDevice.Obsoletes.cs b/Corale.Colore/Core/GenericDevice.Obsoletes.cs new file mode 100644 index 00000000..46997b17 --- /dev/null +++ b/Corale.Colore/Core/GenericDevice.Obsoletes.cs @@ -0,0 +1,76 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using System.Collections.Generic; + using System.Runtime.InteropServices; + using Corale.Colore.Annotations; + using Corale.Colore.Razer; + using log4net; + + /// + /// A generic device. + /// + public sealed partial class GenericDevice + { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) + { + SetAll(color); + } + + /// + /// Sets a parameter-less effect on this device. + /// + /// Effect to set. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + public void Set(Effect effect) + { + SetEffect(effect, IntPtr.Zero); + } + + /// + /// Sets an effect on this device, taking a parameter. + /// + /// Effect to set. + /// Effect-specific parameter to use. + [Obsolete("Set is deprecated, please use SetEffect(Effect, IntPtr).", false)] + public void Set(Effect effect, IntPtr param) + { + SetGuid(NativeWrapper.CreateEffect(DeviceId, effect, param)); + } + } +} diff --git a/Corale.Colore/Core/GenericDevice.cs b/Corale.Colore/Core/GenericDevice.cs index 25609fcc..d16a428e 100644 --- a/Corale.Colore/Core/GenericDevice.cs +++ b/Corale.Colore/Core/GenericDevice.cs @@ -42,7 +42,7 @@ namespace Corale.Colore.Core /// /// A generic device. /// - public sealed class GenericDevice : Device, IGenericDevice + public sealed partial class GenericDevice : Device, IGenericDevice { /// /// Logger instance for this class. @@ -112,7 +112,7 @@ public override void SetAll(Color color) try { - SetGuid(NativeWrapper.CreateEffect(DeviceId, Effect.Static, colorPtr)); + SetEffect(Effect.Static, colorPtr); } finally { diff --git a/Corale.Colore/Core/Headset.Obsoletes.cs b/Corale.Colore/Core/Headset.Obsoletes.cs index 3255bc9e..1502d45d 100644 --- a/Corale.Colore/Core/Headset.Obsoletes.cs +++ b/Corale.Colore/Core/Headset.Obsoletes.cs @@ -38,6 +38,16 @@ namespace Corale.Colore.Core /// public sealed partial class Headset : Device, IHeadset { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) + { + SetAll(color); + } + /// /// Sets an effect on the headset that doesn't /// take any parameters, currently only valid diff --git a/Corale.Colore/Core/IDevice.Obsoletes.cs b/Corale.Colore/Core/IDevice.Obsoletes.cs new file mode 100644 index 00000000..f21eea23 --- /dev/null +++ b/Corale.Colore/Core/IDevice.Obsoletes.cs @@ -0,0 +1,57 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Annotations; + + /// + /// Interface for functionality common with all devices. + /// + public partial interface IDevice + { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Color).", false)] + [PublicAPI] + void Set(Color color); + + /// + /// Updates the device to use the effect pointed to by the specified GUID. + /// + /// GUID to set. + [Obsolete("Set is deprecated, please use SetGuid(Guid).", false)] + [PublicAPI] + void Set(Guid guid); + } +} diff --git a/Corale.Colore/Core/IDevice.cs b/Corale.Colore/Core/IDevice.cs index 4d97e980..af12eb8e 100644 --- a/Corale.Colore/Core/IDevice.cs +++ b/Corale.Colore/Core/IDevice.cs @@ -37,7 +37,7 @@ namespace Corale.Colore.Core /// /// Interface for functionality common with all devices. /// - public interface IDevice + public partial interface IDevice { /// /// Gets the ID of the currently active effect. diff --git a/Corale.Colore/Core/IGenericDevice.Obsoletes.cs b/Corale.Colore/Core/IGenericDevice.Obsoletes.cs new file mode 100644 index 00000000..3d9c294a --- /dev/null +++ b/Corale.Colore/Core/IGenericDevice.Obsoletes.cs @@ -0,0 +1,54 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Razer; + + /// + /// Interface for generic devices. + /// + public partial interface IGenericDevice + { + /// + /// Sets a parameter-less effect on this device. + /// + /// Effect to set. + void Set(Effect effect); + + /// + /// Sets an effect on this device, taking a parameter. + /// + /// Effect to set. + /// Effect-specific parameter to use. + void Set(Effect effect, IntPtr param); + } +} diff --git a/Corale.Colore/Core/IGenericDevice.cs b/Corale.Colore/Core/IGenericDevice.cs index f8e2a78d..2d032195 100644 --- a/Corale.Colore/Core/IGenericDevice.cs +++ b/Corale.Colore/Core/IGenericDevice.cs @@ -37,7 +37,7 @@ namespace Corale.Colore.Core /// /// Interface for generic devices. /// - public interface IGenericDevice : IDevice + public partial interface IGenericDevice : IDevice { /// /// Gets the of this device. diff --git a/Corale.Colore/Core/IHeadset.Obsoletes.cs b/Corale.Colore/Core/IHeadset.Obsoletes.cs new file mode 100644 index 00000000..16e7813f --- /dev/null +++ b/Corale.Colore/Core/IHeadset.Obsoletes.cs @@ -0,0 +1,70 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Razer.Headset.Effects; + + /// + /// Interface for headset functionality. + /// + public partial interface IHeadset : IDevice + { + /// + /// Sets an effect on the headset that doesn't + /// take any parameters, currently only valid + /// for the effect. + /// + /// The type of effect to set. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + void Set(Effect effect); + + /// + /// Sets a new static effect on the headset. + /// + /// + /// An instance of the struct + /// describing the effect. + /// + [Obsolete("Set is deprecated, please use SetStatic(Static).", false)] + void Set(Static effect); + + /// + /// Sets a new breathing effect on the headset. + /// + /// + /// An instance of the struct + /// describing the effect. + /// + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + void Set(Breathing effect); + } +} diff --git a/Corale.Colore/Core/IHeadset.cs b/Corale.Colore/Core/IHeadset.cs index 76f5ddff..8770c6db 100644 --- a/Corale.Colore/Core/IHeadset.cs +++ b/Corale.Colore/Core/IHeadset.cs @@ -35,7 +35,7 @@ namespace Corale.Colore.Core /// /// Interface for headset functionality. /// - public interface IHeadset : IDevice + public partial interface IHeadset : IDevice { /// /// Sets an effect on the headset that doesn't diff --git a/Corale.Colore/Core/IKeyboard.Obsoletes.cs b/Corale.Colore/Core/IKeyboard.Obsoletes.cs new file mode 100644 index 00000000..bc60a0bc --- /dev/null +++ b/Corale.Colore/Core/IKeyboard.Obsoletes.cs @@ -0,0 +1,182 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using System.Collections.Generic; + using Corale.Colore.Annotations; + using Corale.Colore.Razer.Keyboard; + using Corale.Colore.Razer.Keyboard.Effects; + + /// + /// Interface for keyboard functionality. + /// + public partial interface IKeyboard : IDevice + { + /// + /// Sets a breathing effect on the keyboard. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + [PublicAPI] + void Set(Breathing effect); + + /// + /// Sets a breathing effect on the keyboard, fading between the + /// two specified colors. + /// + /// Color to start from. + /// Color to reach, before going back to . + [Obsolete("Set is deprecated, please use SetBreathing(Color, Color).", false)] + [PublicAPI] + void Set(Color first, Color second); + + /// + /// Sets a reactive effect on the keyboard with the specified + /// color and duration. + /// + /// Color to emit on key press. + /// How long to illuminate the key after being pressed. + [Obsolete("Set is deprecated, please use SetReactive(Color, Duration).", false)] + [PublicAPI] + void Set(Color color, Duration duration); + + /// + /// Sets a custom grid effect on the keyboard using + /// a two dimensional array of color values. + /// + /// The grid of colors to use. + /// + /// The passed in arrays cannot have more than rows and + /// not more than columns in any row. + /// + /// This will overwrite the internal + /// struct in the class. + /// + [Obsolete("Set is deprecated, please use SetGrid(Color[][]).", false)] + [PublicAPI] + void Set(Color[][] colors); + + /// + /// Sets a custom grid effect on the keyboard. + /// + /// Effect options. + /// + /// This will overwrite the current internal + /// struct in the class. + /// + [Obsolete("Set is deprecated, please use SetCustom(Custom).", false)] + [PublicAPI] + void Set(Custom effect); + + /// + /// Sets a wave effect on the keyboard in the specified direction. + /// + /// Direction of the wave. + [Obsolete("Set is deprecated, please use SetWave(Direction).", false)] + [PublicAPI] + void Set(Direction direction); + + /// + /// Sets an effect without any parameters. + /// Currently, this only works for the and effects. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + [PublicAPI] + void Set(Effect effect); + + /// + /// Sets the color on a specific row and column on the keyboard grid. + /// + /// Row to set, between 1 and . + /// Column to set, between 1 and . + /// Color to set. + /// Whether or not to clear the existing colors before setting this one. + [Obsolete("Set is deprecated, please use SetPosition(Size, Size, Color, bool).", false)] + [PublicAPI] + void Set(Size row, Size column, Color color, bool clear = false); + + /// + /// Sets the color of a specific key on the keyboard. + /// + /// Key to modify. + /// Color to set. + /// If true, the keyboard will first be cleared before setting the key. + [Obsolete("Set is deprecated, please use SetKey(Key, Color, bool).", false)] + [PublicAPI] + void Set(Key key, Color color, bool clear = false); + + /// + /// Sets the specified color on a set of keys. + /// + /// The to apply. + /// First key to change. + /// Additional keys that should also have the color applied. + [Obsolete("Set is deprecated, please use SetKeys(Color, Key, Key[][]).", false)] + [PublicAPI] + void Set(Color color, Key key, params Key[] keys); + + /// + /// Sets a color on a collection of keys. + /// + /// The keys which should have their color changed. + /// The to apply. + /// If true, the keyboard will first be cleared before setting the keys. + [Obsolete("Set is deprecated, please use SetKeys(INumerable, Color, bool).", false)] + [PublicAPI] + void Set(IEnumerable keys, Color color, bool clear = false); + + /// + /// Sets a reactive effect on the keyboard. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetReactive(Reactive).", false)] + [PublicAPI] + void Set(Reactive effect); + + /// + /// Sets a static color on the keyboard. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetStatic(Static).", false)] + [PublicAPI] + void Set(Static effect); + + /// + /// Sets a wave effect on the keyboard. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetWave(Wave).", false)] + [PublicAPI] + void Set(Wave effect); + } +} diff --git a/Corale.Colore/Core/IKeyboard.cs b/Corale.Colore/Core/IKeyboard.cs index e6104126..6149bd82 100644 --- a/Corale.Colore/Core/IKeyboard.cs +++ b/Corale.Colore/Core/IKeyboard.cs @@ -39,7 +39,7 @@ namespace Corale.Colore.Core /// /// Interface for keyboard functionality. /// - public interface IKeyboard : IDevice + public partial interface IKeyboard : IDevice { /// /// Gets or sets the for a specific on the keyboard. diff --git a/Corale.Colore/Core/IKeypad.Obsoletes.cs b/Corale.Colore/Core/IKeypad.Obsoletes.cs new file mode 100644 index 00000000..5ceb81be --- /dev/null +++ b/Corale.Colore/Core/IKeypad.Obsoletes.cs @@ -0,0 +1,92 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Annotations; + using Corale.Colore.Razer.Keypad; + using Corale.Colore.Razer.Keypad.Effects; + + /// + /// Interface for keypad functions. + /// + public partial interface IKeypad : IDevice + { + /// + /// Sets a effect on the keypad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + [PublicAPI] + void Set(Breathing effect); + + /// + /// Sets a effect on the keypad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetCustom(Custom).", false)] + [PublicAPI] + void Set(Custom effect); + + /// + /// Sets a effect on the keypad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetReactive(Reactive).", false)] + [PublicAPI] + void Set(Reactive effect); + + /// + /// Sets a effect on the keypad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetStatic(Static).", false)] + [PublicAPI] + void Set(Static effect); + + /// + /// Sets a effect on the keypad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetWave(Wave).", false)] + [PublicAPI] + void Set(Wave effect); + + /// + /// Sets an effect without any parameters. + /// Currently, this only works for the effect. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + [PublicAPI] + void Set(Effect effect); + } +} diff --git a/Corale.Colore/Core/IKeypad.cs b/Corale.Colore/Core/IKeypad.cs index 104c559a..16e561f3 100644 --- a/Corale.Colore/Core/IKeypad.cs +++ b/Corale.Colore/Core/IKeypad.cs @@ -37,7 +37,7 @@ namespace Corale.Colore.Core /// /// Interface for keypad functions. /// - public interface IKeypad : IDevice + public partial interface IKeypad : IDevice { /// /// Gets or sets a color at the specified position in the keypad's diff --git a/Corale.Colore/Core/IMouse.Obsoletes.cs b/Corale.Colore/Core/IMouse.Obsoletes.cs new file mode 100644 index 00000000..2d39952d --- /dev/null +++ b/Corale.Colore/Core/IMouse.Obsoletes.cs @@ -0,0 +1,105 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Annotations; + using Corale.Colore.Razer.Mouse; + using Corale.Colore.Razer.Mouse.Effects; + + /// + /// Interface for mouse functionality. + /// + public partial interface IMouse : IDevice + { + /// + /// Sets the color of a specific LED on the mouse. + /// + /// Which LED to modify. + /// Color to set. + [Obsolete("Set is deprecated, please use SetLed(Led, Color).", false)] + [PublicAPI] + void Set(Led led, Color color); + + /// + /// Sets an effect without any parameters. + /// Currently, this only works for the effect. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + [PublicAPI] + void Set(Effect effect); + + /// + /// Sets a breathing effect on the mouse. + /// + /// An instance of the effect. + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + [PublicAPI] + void Set(Breathing effect); + + /// + /// Sets a static color on the mouse. + /// + /// An instance of the effect. + [Obsolete("Set is deprecated, please use SetStatic(Static).", false)] + [PublicAPI] + void Set(Static effect); + + /// + /// Starts a blinking effect on the specified LED. + /// + /// An instance of the effect. + [Obsolete("Set is deprecated, please use SetBlinking(Blinking).", false)] + void Set(Blinking effect); + + /// + /// Sets a reactive effect on the mouse. + /// + /// Effect options struct. + [Obsolete("Set is deprecated, please use SetReactive(Reactive).", false)] + void Set(Reactive effect); + + /// + /// Sets a spectrum cycling effect on the mouse. + /// + /// Effect options struct. + [Obsolete("Set is deprecated, please use SetSpectrumCycling(SpectrumCycling).", false)] + void Set(SpectrumCycling effect); + + /// + /// Sets a wave effect on the mouse. + /// + /// Effect options struct. + [Obsolete("Set is deprecated, please use SetWave(Wave).", false)] + void Set(Wave effect); + } +} diff --git a/Corale.Colore/Core/IMouse.cs b/Corale.Colore/Core/IMouse.cs index 5c337978..f9768969 100644 --- a/Corale.Colore/Core/IMouse.cs +++ b/Corale.Colore/Core/IMouse.cs @@ -37,7 +37,7 @@ namespace Corale.Colore.Core /// /// Interface for mouse functionality. /// - public interface IMouse : IDevice + public partial interface IMouse : IDevice { /// /// Sets the color of a specific LED on the mouse. diff --git a/Corale.Colore/Core/IMousepad.Obsoletes.cs b/Corale.Colore/Core/IMousepad.Obsoletes.cs new file mode 100644 index 00000000..9f2f0495 --- /dev/null +++ b/Corale.Colore/Core/IMousepad.Obsoletes.cs @@ -0,0 +1,83 @@ +// --------------------------------------------------------------------------------------- +// +// Copyright © 2015 by Adam Hellberg and Brandon Scott. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any +// of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott +// do not take responsibility for any harm caused, direct or indirect, to any +// Razer peripherals via the use of Colore. +// +// "Razer" is a trademark of Razer USA Ltd. +// +// --------------------------------------------------------------------------------------- + +namespace Corale.Colore.Core +{ + using System; + using Corale.Colore.Annotations; + using Corale.Colore.Razer.Mousepad.Effects; + + /// + /// Interface for mouse pad functionality. + /// + public partial interface IMousepad : IDevice + { + /// + /// Sets a breathing effect on the mouse pad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + [PublicAPI] + void Set(Breathing effect); + + /// + /// Sets a static color effect on the mouse pad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetStatic(Static).", false)] + [PublicAPI] + void Set(Static effect); + + /// + /// Sets a wave effect on the mouse pad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetWave(Wave).", false)] + [PublicAPI] + void Set(Wave effect); + + /// + /// Sets a custom effect on the mouse pad. + /// + /// An instance of the struct. + [Obsolete("Set is deprecated, please use SetCustom(Custom).", false)] + [PublicAPI] + void Set(Custom effect); + + /// + /// Sets an effect without any parameters. + /// Currently, this only works for the effect. + /// + /// Effect options. + [Obsolete("Set is deprecated, please use SetEffect(Effect).", false)] + [PublicAPI] + void Set(Effect effect); + } +} diff --git a/Corale.Colore/Core/IMousepad.cs b/Corale.Colore/Core/IMousepad.cs index 0422c4ed..83250045 100644 --- a/Corale.Colore/Core/IMousepad.cs +++ b/Corale.Colore/Core/IMousepad.cs @@ -36,7 +36,7 @@ namespace Corale.Colore.Core /// /// Interface for mouse pad functionality. /// - public interface IMousepad : IDevice + public partial interface IMousepad : IDevice { /// /// Sets a breathing effect on the mouse pad. diff --git a/Corale.Colore/Core/Keyboard.Obsoletes.cs b/Corale.Colore/Core/Keyboard.Obsoletes.cs index 7e1a59f9..b7ced253 100644 --- a/Corale.Colore/Core/Keyboard.Obsoletes.cs +++ b/Corale.Colore/Core/Keyboard.Obsoletes.cs @@ -42,23 +42,23 @@ namespace Corale.Colore.Core public sealed partial class Keyboard { /// - /// Sets a breathing effect on the keyboard. + /// Sets the color of all components on this device. /// - /// Effect options. - [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] - public void Set(Breathing effect) + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) { - SetBreathing(effect); + SetAll(color); } /// - /// Sets the color of all keys on the keyboard. + /// Sets a breathing effect on the keyboard. /// - /// Color to set. - [Obsolete("Set is deprecated, please use SetAll(Color).", false)] - public void Set(Color color) + /// Effect options. + [Obsolete("Set is deprecated, please use SetBreathing(Breathing).", false)] + public void Set(Breathing effect) { - SetAll(color); + SetBreathing(effect); } /// @@ -221,4 +221,4 @@ public void Set(Wave effect) SetWave(effect); } } -} \ No newline at end of file +} diff --git a/Corale.Colore/Core/Keypad.Obsoletes.cs b/Corale.Colore/Core/Keypad.Obsoletes.cs index 5bfc991c..9f7b407f 100644 --- a/Corale.Colore/Core/Keypad.Obsoletes.cs +++ b/Corale.Colore/Core/Keypad.Obsoletes.cs @@ -38,6 +38,16 @@ namespace Corale.Colore.Core /// public sealed partial class Keypad : Device, IKeypad { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) + { + SetAll(color); + } + /// /// Sets an effect without any parameters. /// Currently, this only works for the effect. diff --git a/Corale.Colore/Core/Mouse.Obsoletes.cs b/Corale.Colore/Core/Mouse.Obsoletes.cs index 4a64889f..24041d02 100644 --- a/Corale.Colore/Core/Mouse.Obsoletes.cs +++ b/Corale.Colore/Core/Mouse.Obsoletes.cs @@ -40,6 +40,16 @@ namespace Corale.Colore.Core /// public sealed partial class Mouse { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) + { + SetAll(color); + } + /// /// Sets the color of a specific LED on the mouse. /// diff --git a/Corale.Colore/Core/Mousepad.Obsoletes.cs b/Corale.Colore/Core/Mousepad.Obsoletes.cs index 29478b6d..6bb492c2 100644 --- a/Corale.Colore/Core/Mousepad.Obsoletes.cs +++ b/Corale.Colore/Core/Mousepad.Obsoletes.cs @@ -38,6 +38,16 @@ namespace Corale.Colore.Core /// public sealed partial class Mousepad { + /// + /// Sets the color of all components on this device. + /// + /// Color to set. + [Obsolete("Set is deprecated, please use SetAll(Effect).", false)] + public override void Set(Color color) + { + SetAll(color); + } + /// /// Sets an effect without any parameters. /// Currently, this only works for the effect.