1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Windows - Added input provider

Debugger - Fixed data model list display
This commit is contained in:
Robert 2021-12-06 00:44:25 +01:00
parent d594ed7951
commit b801de1f30
25 changed files with 1941 additions and 288 deletions

View File

@ -27,7 +27,7 @@ namespace Artemis.Core
/// <summary> /// <summary>
/// The base path for Artemis application data folder /// The base path for Artemis application data folder
/// </summary> /// </summary>
public static readonly string BaseFolder = Environment.GetFolderPath(OperatingSystem.IsWindows() ? Environment.SpecialFolder.ApplicationData : Environment.SpecialFolder.LocalApplicationData); public static readonly string BaseFolder = Environment.GetFolderPath(OperatingSystem.IsWindows() ? Environment.SpecialFolder.CommonApplicationData : Environment.SpecialFolder.LocalApplicationData);
/// <summary> /// <summary>
/// The full path to the Artemis data folder /// The full path to the Artemis data folder

View File

@ -25,7 +25,11 @@ namespace Artemis.Core.Services
public void Dispose() public void Dispose()
{ {
while (_inputProviders.Any()) while (_inputProviders.Any())
RemoveInputProvider(_inputProviders.First()); {
InputProvider provider = _inputProviders.First();
RemoveInputProvider(provider);
provider.Dispose();
}
} }
#endregion #endregion

View File

@ -374,67 +374,39 @@
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelEventViewModel.ToString"> <member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelEventViewModel.ToString">
<inheritdoc /> <inheritdoc />
</member> </member>
<member name="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel"> <member name="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel">
<summary>
Represents a view model that wraps a regular <see cref="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelPropertiesViewModel" /> but contained in
a <see cref="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListViewModel" />
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.Index">
<summary>
Gets the index of the element within the list
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.ListType">
<summary>
Gets the type of elements contained in the list
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.DisplayValue">
<summary>
Gets the value of the property that is being visualized
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.DisplayViewModel">
<summary>
Gets the view model that handles displaying the property
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.DisplayPath">
<inheritdoc />
</member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.Update(Artemis.UI.Shared.Services.Interfaces.IDataModelUIService,Artemis.UI.Shared.DataModelVisualization.Shared.DataModelUpdateConfiguration)">
<inheritdoc />
</member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.GetCurrentValue">
<inheritdoc />
</member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertiesViewModel.ToString">
<inheritdoc />
</member>
<member name="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel">
<summary> <summary>
Represents a view model that visualizes a single data model property contained in a Represents a view model that visualizes a single data model property contained in a
<see cref="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListViewModel" /> <see cref="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListViewModel" />
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel.Index"> <member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.DisplayViewModel">
<summary>
Gets the view model used to display the display value
</summary>
</member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.Index">
<summary> <summary>
Gets the index of the element within the list Gets the index of the element within the list
</summary> </summary>
</member> </member>
<member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel.ListType"> <member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.ListType">
<summary> <summary>
Gets the type of elements contained in the list Gets the type of elements contained in the list
</summary> </summary>
</member> </member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel.GetCurrentValue"> <member name="P:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.DisplayValue">
<summary>
Gets the value of the property that is being visualized
</summary>
</member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.GetCurrentValue">
<inheritdoc /> <inheritdoc />
</member> </member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel.Update(Artemis.UI.Shared.Services.Interfaces.IDataModelUIService,Artemis.UI.Shared.DataModelVisualization.Shared.DataModelUpdateConfiguration)"> <member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.Update(Artemis.UI.Shared.Services.Interfaces.IDataModelUIService,Artemis.UI.Shared.DataModelVisualization.Shared.DataModelUpdateConfiguration)">
<inheritdoc /> <inheritdoc />
</member> </member>
<member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListPropertyViewModel.ToString"> <member name="M:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListItemViewModel.ToString">
<inheritdoc /> <inheritdoc />
</member> </member>
<member name="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListViewModel"> <member name="T:Artemis.UI.Shared.DataModelVisualization.Shared.DataModelListViewModel">

View File

@ -9,22 +9,33 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
/// Represents a view model that visualizes a single data model property contained in a /// Represents a view model that visualizes a single data model property contained in a
/// <see cref="DataModelListViewModel" /> /// <see cref="DataModelListViewModel" />
/// </summary> /// </summary>
public class DataModelListPropertyViewModel : DataModelPropertyViewModel public class DataModelListItemViewModel : DataModelVisualizationViewModel
{ {
private int _index; private int _index;
private Type? _listType; private Type? _listType;
private object? _displayValue;
private DataModelDisplayViewModel? _displayViewModel;
internal DataModelListPropertyViewModel(Type listType, DataModelDisplayViewModel displayViewModel, string? name) : base(null, null, null) internal DataModelListItemViewModel(Type listType, DataModelDisplayViewModel displayViewModel, string? name) : base(null, null, null)
{ {
ListType = listType; ListType = listType;
DisplayViewModel = displayViewModel; DisplayViewModel = displayViewModel;
} }
internal DataModelListPropertyViewModel(Type listType, string? name) : base(null, null, null) internal DataModelListItemViewModel(Type listType, string? name) : base(null, null, null)
{ {
ListType = listType; ListType = listType;
} }
/// <summary>
/// Gets the view model used to display the display value
/// </summary>
public DataModelDisplayViewModel? DisplayViewModel
{
get => _displayViewModel;
internal set => this.RaiseAndSetIfChanged(ref _displayViewModel, value);
}
/// <summary> /// <summary>
/// Gets the index of the element within the list /// Gets the index of the element within the list
/// </summary> /// </summary>
@ -43,6 +54,15 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
private set => this.RaiseAndSetIfChanged(ref _listType, value); private set => this.RaiseAndSetIfChanged(ref _listType, value);
} }
/// <summary>
/// Gets the value of the property that is being visualized
/// </summary>
public object? DisplayValue
{
get => _displayValue;
internal set => this.RaiseAndSetIfChanged(ref _displayValue, value);
}
/// <inheritdoc /> /// <inheritdoc />
public override object? GetCurrentValue() public override object? GetCurrentValue()
{ {
@ -66,7 +86,7 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
/// <inheritdoc /> /// <inheritdoc />
public override string ToString() public override string ToString()
{ {
return $"[List item {Index}] {DisplayPath ?? Path} - {DisplayValue}"; return $"[List item {Index}]";
} }
} }
} }

View File

@ -1,83 +0,0 @@
using System;
using System.Linq;
using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.Interfaces;
using ReactiveUI;
namespace Artemis.UI.Shared.DataModelVisualization.Shared
{
/// <summary>
/// Represents a view model that wraps a regular <see cref="DataModelPropertiesViewModel" /> but contained in
/// a <see cref="DataModelListViewModel" />
/// </summary>
public class DataModelListPropertiesViewModel : DataModelPropertiesViewModel
{
private object? _displayValue;
private int _index;
private Type? _listType;
internal DataModelListPropertiesViewModel(Type listType, string? name) : base(null, null, null)
{
ListType = listType;
}
/// <summary>
/// Gets the index of the element within the list
/// </summary>
public int Index
{
get => _index;
set => this.RaiseAndSetIfChanged(ref _index, value);
}
/// <summary>
/// Gets the type of elements contained in the list
/// </summary>
public Type? ListType
{
get => _listType;
set => this.RaiseAndSetIfChanged(ref _listType, value);
}
/// <summary>
/// Gets the value of the property that is being visualized
/// </summary>
public new object? DisplayValue
{
get => _displayValue;
set => this.RaiseAndSetIfChanged(ref _displayValue, value);
}
/// <summary>
/// Gets the view model that handles displaying the property
/// </summary>
public DataModelVisualizationViewModel? DisplayViewModel => Children.FirstOrDefault();
/// <inheritdoc />
public override string? DisplayPath => null;
/// <inheritdoc />
public override void Update(IDataModelUIService dataModelUIService, DataModelUpdateConfiguration? configuration)
{
PopulateProperties(dataModelUIService, configuration);
if (DisplayViewModel == null)
return;
if (IsVisualizationExpanded && !DisplayViewModel.IsVisualizationExpanded)
DisplayViewModel.IsVisualizationExpanded = IsVisualizationExpanded;
DisplayViewModel.Update(dataModelUIService, null);
}
/// <inheritdoc />
public override object? GetCurrentValue()
{
return DisplayValue;
}
/// <inheritdoc />
public override string ToString()
{
return $"[List item {Index}] {DisplayPath ?? Path}";
}
}
}

View File

@ -98,22 +98,15 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
ListChildren.Add(child); ListChildren.Add(child);
} }
else else
{
child = ListChildren[index]; child = ListChildren[index];
}
if (child is DataModelListPropertiesViewModel dataModelListClassViewModel) if (child is DataModelListItemViewModel dataModelListPropertyViewModel)
{
dataModelListClassViewModel.DisplayValue = item;
dataModelListClassViewModel.Index = index;
}
else if (child is DataModelListPropertyViewModel dataModelListPropertyViewModel)
{ {
dataModelListPropertyViewModel.DisplayValue = item; dataModelListPropertyViewModel.DisplayValue = item;
dataModelListPropertyViewModel.Index = index; dataModelListPropertyViewModel.Index = index;
dataModelListPropertyViewModel.Update(dataModelUIService, configuration);
} }
child.Update(dataModelUIService, configuration);
index++; index++;
} }
@ -135,16 +128,10 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
{ {
// If a display VM was found, prefer to use that in any case // If a display VM was found, prefer to use that in any case
DataModelDisplayViewModel? typeViewModel = dataModelUIService.GetDataModelDisplayViewModel(listType, PropertyDescription); DataModelDisplayViewModel? typeViewModel = dataModelUIService.GetDataModelDisplayViewModel(listType, PropertyDescription);
if (typeViewModel != null)
return new DataModelListPropertyViewModel(listType, typeViewModel, name);
// For primitives, create a property view model, it may be null that is fine
if (listType.IsPrimitive || listType.IsEnum || listType == typeof(string))
return new DataModelListPropertyViewModel(listType, name);
// For other value types create a child view model
if (listType.IsClass || listType.IsStruct())
return new DataModelListPropertiesViewModel(listType, name);
return null; return typeViewModel != null
? new DataModelListItemViewModel(listType, typeViewModel, name)
: new DataModelListItemViewModel(listType, name);
} }
} }
} }

View File

@ -215,7 +215,7 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared
foreach (PropertyInfo propertyInfo in modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance).OrderBy(t => t.MetadataToken)) foreach (PropertyInfo propertyInfo in modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance).OrderBy(t => t.MetadataToken))
{ {
string childPath = AppendToPath(propertyInfo.Name); string childPath = AppendToPath(propertyInfo.Name);
if (Children.Any(c => c.Path != null && c.Path.Equals(childPath))) if (Children.Any(c => c?.Path != null && c.Path.Equals(childPath)))
continue; continue;
if (propertyInfo.GetCustomAttribute<DataModelIgnoreAttribute>() != null) if (propertyInfo.GetCustomAttribute<DataModelIgnoreAttribute>() != null)
continue; continue;

View File

@ -13,16 +13,7 @@
Margin="0 0 5 0" /> Margin="0 0 5 0" />
<!-- Value --> <!-- Value -->
<TextBlock Grid.Column="1" <TextBlock Grid.Column="1" Text="{Binding Display, Mode=OneWay}" HorizontalAlignment="Right"/>
Text="{Binding DisplayValue, Mode=OneWay}"
HorizontalAlignment="Right"
IsVisible="{Binding ShowToString}"/>
<TextBlock Grid.Column="1"
Text="null"
FontFamily="Consolas"
HorizontalAlignment="Right"
Foreground="{DynamicResource MaterialDesignCheckBoxDisabled}"
IsVisible="{Binding ShowNull}"/>
<!-- Affix --> <!-- Affix -->
<TextBlock Grid.Column="2" <TextBlock Grid.Column="2"

View File

@ -1,6 +1,7 @@
using System; using System;
using Artemis.Core; using Artemis.Core;
using Artemis.UI.Shared.DataModelVisualization; using Artemis.UI.Shared.DataModelVisualization;
using Newtonsoft.Json;
using ReactiveUI; using ReactiveUI;
namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display
@ -11,33 +12,32 @@ namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display
/// </summary> /// </summary>
internal class DefaultDataModelDisplayViewModel : DataModelDisplayViewModel<object> internal class DefaultDataModelDisplayViewModel : DataModelDisplayViewModel<object>
{ {
private bool _showNull; private readonly JsonSerializerSettings _serializerSettings;
private bool _showToString; private string _display;
internal DefaultDataModelDisplayViewModel() public DefaultDataModelDisplayViewModel()
{ {
ShowNull = true; _serializerSettings = new JsonSerializerSettings()
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
PreserveReferencesHandling = PreserveReferencesHandling.None
};
} }
public bool ShowToString public string Display
{ {
get => _showToString; get => _display;
private set => this.RaiseAndSetIfChanged(ref _showToString, value); set => this.RaiseAndSetIfChanged(ref _display, value);
}
public bool ShowNull
{
get => _showNull;
set => this.RaiseAndSetIfChanged(ref _showNull, value);
} }
protected override void OnDisplayValueUpdated() protected override void OnDisplayValueUpdated()
{ {
if (DisplayValue is Enum enumDisplayValue) if (DisplayValue is Enum enumDisplayValue)
DisplayValue = EnumUtilities.HumanizeValue(enumDisplayValue); Display = EnumUtilities.HumanizeValue(enumDisplayValue);
else if (DisplayValue is not string)
ShowToString = DisplayValue != null; Display = JsonConvert.SerializeObject(DisplayValue, _serializerSettings);
ShowNull = DisplayValue == null; else
Display = DisplayValue?.ToString() ?? "null";
} }
} }
} }

View File

@ -13,7 +13,9 @@
<!-- Add Styles Here --> <!-- Add Styles Here -->
<Style Selector="ListBox.sidebar-listbox ListBoxItem"> <Style Selector="ListBox.sidebar-listbox ListBoxItem">
<Setter Property="Margin" Value="0 2.5" />
<Setter Property="MinHeight" Value="35" /> <Setter Property="MinHeight" Value="35" />
</Style> </Style>
<Style Selector="ListBox.sidebar-listbox ContentPresenter">
<Setter Property="Margin" Value="0" />
</Style>
</Styles> </Styles>

View File

@ -1,3 +1,6 @@
using Artemis.Core.Services;
using Artemis.UI.Windows.Providers;
using Artemis.UI.Windows.Providers.Input;
using Avalonia; using Avalonia;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
@ -9,16 +12,13 @@ namespace Artemis.UI.Windows
{ {
public class App : Application public class App : Application
{ {
// ReSharper disable NotAccessedField.Local
private StandardKernel? _kernel;
private ApplicationStateManager? _applicationStateManager;
// ReSharper restore NotAccessedField.Local
public override void Initialize() public override void Initialize()
{ {
_kernel = ArtemisBootstrapper.Bootstrap(this); _kernel = ArtemisBootstrapper.Bootstrap(this);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance; RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
RegisterProviders(_kernel);
} }
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()
@ -27,5 +27,17 @@ namespace Artemis.UI.Windows
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
_applicationStateManager = new ApplicationStateManager(_kernel!, desktop.Args); _applicationStateManager = new ApplicationStateManager(_kernel!, desktop.Args);
} }
private void RegisterProviders(StandardKernel standardKernel)
{
IInputService inputService = standardKernel.Get<IInputService>();
inputService.AddInputProvider(standardKernel.Get<WindowsInputProvider>());
}
// ReSharper disable NotAccessedField.Local
private StandardKernel? _kernel;
private ApplicationStateManager? _applicationStateManager;
// ReSharper restore NotAccessedField.Local
} }
} }

View File

@ -14,6 +14,9 @@
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.10" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.10" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.10" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.10" />
<PackageReference Include="Avalonia.Win32" Version="0.10.10" />
<PackageReference Include="Microsoft.Win32" Version="2.0.1" />
<PackageReference Include="RawInput.Sharp" Version="0.0.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\..\Artemis.Core\Artemis.Core.csproj" />

View File

@ -0,0 +1,26 @@
using System;
using Avalonia.Win32;
namespace Artemis.UI.Windows.Providers.Input
{
public class SpongeWindow : WindowImpl
{
#region Overrides of WindowImpl
/// <inheritdoc />
protected override IntPtr WndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
OnWndProcCalled(new SpongeWindowEventArgs(hWnd, msg, wParam, lParam));
return base.WndProc(hWnd, msg, wParam, lParam);
}
#endregion
public event EventHandler<SpongeWindowEventArgs>? WndProcCalled;
protected virtual void OnWndProcCalled(SpongeWindowEventArgs e)
{
WndProcCalled?.Invoke(this, e);
}
}
}

View File

@ -0,0 +1,20 @@
using System;
namespace Artemis.UI.Windows.Providers.Input
{
public class SpongeWindowEventArgs : EventArgs
{
public IntPtr HWnd { get; }
public uint Msg { get; }
public IntPtr WParam { get; }
public IntPtr LParam { get; }
public SpongeWindowEventArgs(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
HWnd = hWnd;
Msg = msg;
WParam = wParam;
LParam = lParam;
}
}
}

View File

@ -0,0 +1,281 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Timers;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Windows.Utilities;
using Linearstar.Windows.RawInput;
using Linearstar.Windows.RawInput.Native;
using Serilog;
using MouseButton = Artemis.Core.Services.MouseButton;
namespace Artemis.UI.Windows.Providers.Input
{
public class WindowsInputProvider : InputProvider
{
private const int WM_INPUT = 0x00FF;
private readonly IInputService _inputService;
private readonly ILogger _logger;
private DateTime _lastMouseUpdate;
private int _lastProcessId;
private SpongeWindow _sponge;
private readonly Timer _taskManagerTimer;
public WindowsInputProvider(ILogger logger, IInputService inputService)
{
_logger = logger;
_inputService = inputService;
_sponge = new SpongeWindow();
_sponge.WndProcCalled += SpongeOnWndProcCalled;
_taskManagerTimer = new Timer(500);
_taskManagerTimer.Elapsed += TaskManagerTimerOnElapsed;
_taskManagerTimer.Start();
RawInputDevice.RegisterDevice(HidUsageAndPage.Keyboard, RawInputDeviceFlags.InputSink, _sponge.Handle.Handle);
RawInputDevice.RegisterDevice(HidUsageAndPage.Mouse, RawInputDeviceFlags.InputSink, _sponge.Handle.Handle);
}
#region Overrides of InputProvider
/// <inheritdoc />
public override void OnKeyboardToggleStatusRequested()
{
UpdateToggleStatus();
}
#endregion
#region IDisposable
/// <inheritdoc />
protected override void Dispose(bool disposing)
{
if (disposing)
{
_sponge.Dispose();
_taskManagerTimer.Dispose();
}
base.Dispose(disposing);
}
#endregion
private void SpongeOnWndProcCalled(object? sender, SpongeWindowEventArgs message)
{
if (message.Msg != WM_INPUT)
return;
RawInputData data = RawInputData.FromHandle(message.LParam);
switch (data)
{
case RawInputMouseData mouse:
HandleMouseData(data, mouse);
break;
case RawInputKeyboardData keyboard:
HandleKeyboardData(data, keyboard);
break;
}
}
private void TaskManagerTimerOnElapsed(object sender, ElapsedEventArgs e)
{
int processId = WindowUtilities.GetActiveProcessId();
if (processId == _lastProcessId)
return;
_lastProcessId = processId;
// If task manager has focus then we can't track keys properly, release everything to avoid them getting stuck
// Same goes for Idle which is what you get when you press Ctrl+Alt+Del
Process active = Process.GetProcessById(processId);
if (active?.ProcessName == "Taskmgr" || active?.ProcessName == "Idle")
_inputService.ReleaseAll();
}
#region Keyboard
private void HandleKeyboardData(RawInputData data, RawInputKeyboardData keyboardData)
{
KeyboardKey key = InputUtilities.KeyFromVirtualKey(keyboardData.Keyboard.VirutalKey);
// Debug.WriteLine($"VK: {key} ({keyboardData.Keyboard.VirutalKey}), Flags: {keyboardData.Keyboard.Flags}, Scan code: {keyboardData.Keyboard.ScanCode}");
// Sometimes we get double hits and they resolve to None, ignore those
if (key == KeyboardKey.None)
return;
// Right alt triggers LeftCtrl with a different scan code for some reason, ignore those
if (key == KeyboardKey.LeftCtrl && keyboardData.Keyboard.ScanCode == 56)
return;
string identifier = data.Device?.DevicePath;
// Let the core know there is an identifier so it can store new identifications if applicable
if (identifier != null)
OnIdentifierReceived(identifier, InputDeviceType.Keyboard);
ArtemisDevice device = null;
if (identifier != null)
try
{
device = _inputService.GetDeviceByIdentifier(this, identifier, InputDeviceType.Keyboard);
}
catch (Exception e)
{
_logger.Warning(e, "Failed to retrieve input device by its identifier");
}
// Duplicate keys with different positions can be identified by the LeftKey flag (even though its set of the key that's physically on the right)
if (keyboardData.Keyboard.Flags == RawKeyboardFlags.KeyE0 || keyboardData.Keyboard.Flags == (RawKeyboardFlags.KeyE0 | RawKeyboardFlags.Up))
{
if (key == KeyboardKey.Enter)
key = KeyboardKey.NumPadEnter;
if (key == KeyboardKey.LeftCtrl)
key = KeyboardKey.RightCtrl;
if (key == KeyboardKey.LeftAlt)
key = KeyboardKey.RightAlt;
}
if (key == KeyboardKey.LeftShift && keyboardData.Keyboard.ScanCode == 54)
key = KeyboardKey.RightShift;
bool isDown = keyboardData.Keyboard.Flags != RawKeyboardFlags.Up &&
keyboardData.Keyboard.Flags != (RawKeyboardFlags.Up | RawKeyboardFlags.KeyE0) &&
keyboardData.Keyboard.Flags != (RawKeyboardFlags.Up | RawKeyboardFlags.KeyE1);
OnKeyboardDataReceived(device, key, isDown);
UpdateToggleStatus();
}
private void UpdateToggleStatus()
{
OnKeyboardToggleStatusReceived(new KeyboardToggleStatus(
InputUtilities.IsKeyToggled(KeyboardKey.NumLock),
InputUtilities.IsKeyToggled(KeyboardKey.CapsLock),
InputUtilities.IsKeyToggled(KeyboardKey.Scroll)
));
}
#endregion
#region Mouse
private int _mouseDeltaX;
private int _mouseDeltaY;
private void HandleMouseData(RawInputData data, RawInputMouseData mouseData)
{
// Only submit mouse movement 25 times per second but increment the delta
// This can create a small inaccuracy of course, but Artemis is not a shooter :')
if (mouseData.Mouse.Buttons == RawMouseButtonFlags.None)
{
_mouseDeltaX += mouseData.Mouse.LastX;
_mouseDeltaY += mouseData.Mouse.LastY;
if (DateTime.Now - _lastMouseUpdate < TimeSpan.FromMilliseconds(40))
return;
}
ArtemisDevice device = null;
string identifier = data.Device?.DevicePath;
if (identifier != null)
try
{
device = _inputService.GetDeviceByIdentifier(this, identifier, InputDeviceType.Keyboard);
}
catch (Exception e)
{
_logger.Warning(e, "Failed to retrieve input device by its identifier");
}
// Debug.WriteLine($"Buttons: {mouseData.Mouse.Buttons}, Data: {mouseData.Mouse.ButtonData}, Flags: {mouseData.Mouse.Flags}, XY: {mouseData.Mouse.LastX},{mouseData.Mouse.LastY}");
// Movement
if (mouseData.Mouse.Buttons == RawMouseButtonFlags.None)
{
Win32Point cursorPosition = GetCursorPosition();
OnMouseMoveDataReceived(device, cursorPosition.X, cursorPosition.Y, _mouseDeltaX, _mouseDeltaY);
_mouseDeltaX = 0;
_mouseDeltaY = 0;
_lastMouseUpdate = DateTime.Now;
return;
}
// Now we know its not movement, let the core know there is an identifier so it can store new identifications if applicable
if (identifier != null)
OnIdentifierReceived(identifier, InputDeviceType.Mouse);
// Scrolling
if (mouseData.Mouse.ButtonData != 0)
{
if (mouseData.Mouse.Buttons == RawMouseButtonFlags.MouseWheel)
OnMouseScrollDataReceived(device, MouseScrollDirection.Vertical, mouseData.Mouse.ButtonData);
else if (mouseData.Mouse.Buttons == RawMouseButtonFlags.MouseHorizontalWheel)
OnMouseScrollDataReceived(device, MouseScrollDirection.Horizontal, mouseData.Mouse.ButtonData);
return;
}
// Button presses
MouseButton button = MouseButton.Left;
bool isDown = false;
// Left
if (DetermineMouseButton(mouseData, RawMouseButtonFlags.LeftButtonDown, RawMouseButtonFlags.LeftButtonUp, ref isDown))
button = MouseButton.Left;
// Middle
else if (DetermineMouseButton(mouseData, RawMouseButtonFlags.MiddleButtonDown, RawMouseButtonFlags.MiddleButtonUp, ref isDown))
button = MouseButton.Middle;
// Right
else if (DetermineMouseButton(mouseData, RawMouseButtonFlags.RightButtonDown, RawMouseButtonFlags.RightButtonUp, ref isDown))
button = MouseButton.Right;
// Button 4
else if (DetermineMouseButton(mouseData, RawMouseButtonFlags.Button4Down, RawMouseButtonFlags.Button4Up, ref isDown))
button = MouseButton.Button4;
else if (DetermineMouseButton(mouseData, RawMouseButtonFlags.Button5Down, RawMouseButtonFlags.Button5Up, ref isDown))
button = MouseButton.Button5;
OnMouseButtonDataReceived(device, button, isDown);
}
private bool DetermineMouseButton(RawInputMouseData data, RawMouseButtonFlags downButton, RawMouseButtonFlags upButton, ref bool isDown)
{
if (data.Mouse.Buttons == downButton || data.Mouse.Buttons == upButton)
{
isDown = data.Mouse.Buttons == downButton;
return true;
}
isDown = false;
return false;
}
#endregion
#region Native
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetCursorPos(ref Win32Point pt);
[StructLayout(LayoutKind.Sequential)]
private struct Win32Point
{
public readonly int X;
public readonly int Y;
}
private static Win32Point GetCursorPosition()
{
Win32Point w32Mouse = new();
GetCursorPos(ref w32Mouse);
return w32Mouse;
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
using System;
using System.Runtime.InteropServices;
namespace Artemis.UI.Windows.Utilities
{
public static class WindowUtilities
{
public static int GetActiveProcessId()
{
// Get foreground window handle
IntPtr hWnd = GetForegroundWindow();
GetWindowThreadProcessId(hWnd, out uint processId);
return (int) processId;
}
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
}
}

View File

@ -53,6 +53,33 @@
"System.Reactive": "5.0.0" "System.Reactive": "5.0.0"
} }
}, },
"Avalonia.Win32": {
"type": "Direct",
"requested": "[0.10.10, )",
"resolved": "0.10.10",
"contentHash": "6AS6yIB+OS8+g96mj+ShJihjxqhVH6v7jfdqLwjQfGAsqqqN7zBNsFdvoVVCnutuVx0g/9FhCnBTIZyZDlwqkA==",
"dependencies": {
"Avalonia": "0.10.10",
"Avalonia.Angle.Windows.Natives": "2.1.0.2020091801",
"System.Drawing.Common": "4.5.0",
"System.Numerics.Vectors": "4.5.0"
}
},
"Microsoft.Win32": {
"type": "Direct",
"requested": "[2.0.1, )",
"resolved": "2.0.1",
"contentHash": "V1I3Mvj0g6YFoVywl0uoPh7fJ4y7xTewBGrW9FN70dr9LruFnC4rJ/bJ2wxIvZyeVrsj2JaqxvkuSw9fhk9UKA=="
},
"RawInput.Sharp": {
"type": "Direct",
"requested": "[0.0.4, )",
"resolved": "0.0.4",
"contentHash": "JAHC4oBBzvwvehjiWTUW0UAjptprQuX+21d/7LrsMAjBSrT9GB6q6JiEm0bQi69uTkBPohHNF7O8Wgcz3oVXkA==",
"dependencies": {
"NETStandard.Library": "1.6.1"
}
},
"Avalonia.Angle.Windows.Natives": { "Avalonia.Angle.Windows.Natives": {
"type": "Transitive", "type": "Transitive",
"resolved": "2.1.0.2020091801", "resolved": "2.1.0.2020091801",
@ -122,17 +149,6 @@
"Svg.Skia": "0.5.10" "Svg.Skia": "0.5.10"
} }
}, },
"Avalonia.Win32": {
"type": "Transitive",
"resolved": "0.10.10",
"contentHash": "6AS6yIB+OS8+g96mj+ShJihjxqhVH6v7jfdqLwjQfGAsqqqN7zBNsFdvoVVCnutuVx0g/9FhCnBTIZyZDlwqkA==",
"dependencies": {
"Avalonia": "0.10.10",
"Avalonia.Angle.Windows.Natives": "2.1.0.2020091801",
"System.Drawing.Common": "4.5.0",
"System.Numerics.Vectors": "4.5.0"
}
},
"Avalonia.X11": { "Avalonia.X11": {
"type": "Transitive", "type": "Transitive",
"resolved": "0.10.10", "resolved": "0.10.10",

View File

@ -1,8 +0,0 @@
using Artemis.Core.Services;
namespace Artemis.UI.Providers
{
public class AvaloniaInputProvider : InputProvider
{
}
}

View File

@ -2,6 +2,7 @@ using System;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using System.Reactive.Linq; using System.Reactive.Linq;
using Artemis.UI.Shared.Events; using Artemis.UI.Shared.Events;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI; using Avalonia.ReactiveUI;
@ -16,6 +17,10 @@ namespace Artemis.UI.Screens.Debugger
public DebugView() public DebugView()
{ {
InitializeComponent(); InitializeComponent();
#if DEBUG
this.AttachDevTools();
#endif
NavigationView navigation = this.Get<NavigationView>("Navigation"); NavigationView navigation = this.Get<NavigationView>("Navigation");
this.WhenActivated(d => this.WhenActivated(d =>

View File

@ -7,23 +7,25 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.DataModel.DataModelDebugView"> x:Class="Artemis.UI.Screens.Debugger.Tabs.DataModel.DataModelDebugView">
<UserControl.Resources> <UserControl.Resources>
<converters:TypeToStringConverter x:Key="TypeToStringConverter" /> <converters:TypeToStringConverter x:Key="TypeToStringConverter" />
</UserControl.Resources> </UserControl.Resources>
<StackPanel> <Grid RowDefinitions="Auto,*">
<TextBlock Classes="h3">Data Model</TextBlock> <StackPanel Grid.Row="0">
<TextBlock TextWrapping="Wrap"> <TextBlock Classes="h3">Data Model</TextBlock>
On this page you can view the contents of the Artemis data model. <TextBlock TextWrapping="Wrap">
</TextBlock> On this page you can view the contents of the Artemis data model.
<TextBlock TextWrapping="Wrap" Classes="subtitle" Margin="0 10"> </TextBlock>
Please note that having this window open can have a performance impact on your system. <TextBlock TextWrapping="Wrap" Classes="subtitle" Margin="0 10">
</TextBlock> Please note that having this window open can have a performance impact on your system.
</TextBlock>
</StackPanel>
<TreeView Items="{Binding MainDataModel.Children}"> <TreeView Grid.Row="1" Items="{Binding MainDataModel.Children}">
<TreeView.Styles> <TreeView.Styles>
<Style Selector="TreeViewItem"> <Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsVisualizationExpanded, Mode=TwoWay}" /> <Setter Property="IsExpanded" Value="{Binding IsVisualizationExpanded, Mode=TwoWay}" />
</Style> </Style>
</TreeView.Styles> </TreeView.Styles>
<TreeView.DataTemplates> <TreeView.DataTemplates>
<TreeDataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}" ItemsSource="{Binding Children}"> <TreeDataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}" ItemsSource="{Binding Children}">
<Grid ColumnDefinitions="Auto,Auto,*"> <Grid ColumnDefinitions="Auto,Auto,*">
@ -35,9 +37,9 @@
<TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" /> <TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" />
<TextBlock Grid.Column="2" <TextBlock Grid.Column="2"
Text="{Binding DisplayValue}" Text="{Binding DisplayValue}"
FontFamily="Consolas" FontFamily="Consolas"
HorizontalAlignment="Right" /> HorizontalAlignment="Right" />
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
@ -50,9 +52,9 @@
</StackPanel> </StackPanel>
<TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" /> <TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" />
<TextBlock Grid.Column="2" <TextBlock Grid.Column="2"
Text="{Binding CountDisplay, Mode=OneWay}" Text="{Binding CountDisplay, Mode=OneWay}"
FontFamily="Consolas" FontFamily="Consolas"
HorizontalAlignment="Right" /> HorizontalAlignment="Right" />
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
<TreeDataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}"> <TreeDataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}">
@ -70,22 +72,20 @@
<ContentControl Grid.Column="2" Content="{Binding DisplayViewModel}" FontFamily="Consolas" /> <ContentControl Grid.Column="2" Content="{Binding DisplayViewModel}" FontFamily="Consolas" />
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
<TreeDataTemplate DataType="{x:Type dataModel:DataModelListPropertyViewModel}"> <TreeDataTemplate DataType="{x:Type dataModel:DataModelListItemViewModel}">
<Grid ColumnDefinitions="Auto,Auto,*"> <Grid ColumnDefinitions="Auto,Auto,*">
<!-- Value description --> <!-- Value description -->
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="0 0 5 0"> <StackPanel Grid.Column="0" Orientation="Horizontal" Margin="0 0 5 0">
<TextBlock FontWeight="Bold">[</TextBlock> <TextBlock FontWeight="Bold">[</TextBlock>
<TextBlock FontWeight="Bold" Text="{Binding ListType, Converter={StaticResource TypeToStringConverter}, Mode=OneWay}" /> <TextBlock FontWeight="Bold" Text="{Binding ListType, Converter={StaticResource TypeToStringConverter}}" />
<TextBlock FontWeight="Bold">]</TextBlock> <TextBlock FontWeight="Bold">]</TextBlock>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0 0 5 0"> <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0 0 5 0">
<TextBlock>List item [</TextBlock> <TextBlock>List item #</TextBlock>
<TextBlock Text="{Binding Index, Mode=OneWay}" /> <TextBlock Text="{Binding Index, Mode=OneWay}" />
<TextBlock>]</TextBlock> </StackPanel>
</StackPanel>
<!-- Value display --> <!-- Value display -->
<ContentControl Grid.Column="2" Content="{Binding DisplayViewModel}" FontFamily="Consolas" /> <ContentControl Grid.Column="2" Content="{Binding DisplayViewModel}" FontFamily="Consolas" />
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
@ -99,20 +99,13 @@
</StackPanel> </StackPanel>
<TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" /> <TextBlock Grid.Column="1" Text="{Binding PropertyDescription.Name}" ToolTip.Tip="{Binding PropertyDescription.Description}" />
<TextBlock Grid.Column="2" <TextBlock Grid.Column="2"
Text="{Binding CountDisplay, Mode=OneWay}" Text="{Binding CountDisplay, Mode=OneWay}"
FontFamily="Consolas" FontFamily="Consolas"
HorizontalAlignment="Right" /> HorizontalAlignment="Right" />
</Grid> </Grid>
</TreeDataTemplate> </TreeDataTemplate>
</TreeView.DataTemplates>
</TreeView>
</Grid>
<TreeDataTemplate DataType="{x:Type dataModel:DataModelListPropertiesViewModel}" ItemsSource="{Binding DisplayViewModel.Children}">
<StackPanel Orientation="Horizontal">
<TextBlock>List item [</TextBlock>
<TextBlock Text="{Binding Index, Mode=OneWay}" />
<TextBlock>]</TextBlock>
</StackPanel>
</TreeDataTemplate>
</TreeView.DataTemplates>
</TreeView>
</StackPanel>
</UserControl> </UserControl>

View File

@ -5,22 +5,25 @@
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Tabs.Performance.PerformanceDebugView"> x:Class="Artemis.UI.Screens.Debugger.Tabs.Performance.PerformanceDebugView">
<StackPanel> <Grid RowDefinitions="Auto,*">
<TextBlock Classes="h3">Performance</TextBlock> <StackPanel Grid.Row="0">
<TextBlock TextWrapping="Wrap"> <TextBlock Classes="h3">Performance</TextBlock>
On this page you can see how much CPU time different plugin features are taking. If you are having performance issues, below you can find out which plugin might be the culprit. <TextBlock TextWrapping="Wrap">
</TextBlock> On this page you can see how much CPU time different plugin features are taking. If you are having performance issues, below you can find out which plugin might be the culprit.
<Grid ColumnDefinitions="*,Auto">
<TextBlock TextWrapping="Wrap" Classes="subtitle" Margin="0 10">
These performance stats are rather basic, for advanced performance profiling check out the wiki.
</TextBlock> </TextBlock>
<controls:HyperlinkButton Grid.Column="1" NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins/profiling"> <Grid ColumnDefinitions="*,Auto">
JetBrains Profiling Guide <TextBlock TextWrapping="Wrap" Classes="subtitle" Margin="0 10">
</controls:HyperlinkButton> These performance stats are rather basic, for advanced performance profiling check out the wiki.
</Grid> </TextBlock>
<controls:HyperlinkButton Grid.Column="1" NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins/profiling">
JetBrains Profiling Guide
</controls:HyperlinkButton>
</Grid>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<ItemsControl Items="{Binding Items}" Margin="0 0 10 0" />
</ScrollViewer>
</Grid>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl Items="{Binding Items}" Margin="0 0 10 0" />
</ScrollViewer>
</StackPanel>
</UserControl> </UserControl>

View File

@ -4,11 +4,7 @@ using System.Threading.Tasks;
using Artemis.Core; using Artemis.Core;
using Artemis.Core.Services; using Artemis.Core.Services;
using Artemis.UI.Ninject.Factories; using Artemis.UI.Ninject.Factories;
using Artemis.UI.Screens.Home;
using Artemis.UI.Screens.Root.Sidebar; using Artemis.UI.Screens.Root.Sidebar;
using Artemis.UI.Screens.Settings;
using Artemis.UI.Screens.SurfaceEditor;
using Artemis.UI.Screens.Workshop;
using Artemis.UI.Services.Interfaces; using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared; using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.Interfaces; using Artemis.UI.Shared.Services.Interfaces;
@ -18,21 +14,19 @@ using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Platform; using Avalonia.Platform;
using Avalonia.Threading; using Avalonia.Threading;
using Ninject;
using Ninject.Parameters;
using ReactiveUI; using ReactiveUI;
namespace Artemis.UI.Screens.Root namespace Artemis.UI.Screens.Root
{ {
public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvider public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvider
{ {
private readonly IClassicDesktopStyleApplicationLifetime _lifeTime;
private readonly ICoreService _coreService;
private readonly ISettingsService _settingsService;
private readonly IWindowService _windowService;
private readonly IDebugService _debugService;
private readonly IAssetLoader _assetLoader; private readonly IAssetLoader _assetLoader;
private readonly ICoreService _coreService;
private readonly IDebugService _debugService;
private readonly IClassicDesktopStyleApplicationLifetime _lifeTime;
private readonly ISettingsService _settingsService;
private readonly ISidebarVmFactory _sidebarVmFactory; private readonly ISidebarVmFactory _sidebarVmFactory;
private readonly IWindowService _windowService;
private SidebarViewModel? _sidebarViewModel; private SidebarViewModel? _sidebarViewModel;
private TrayIcon? _trayIcon; private TrayIcon? _trayIcon;
private TrayIcons? _trayIcons; private TrayIcons? _trayIcons;
@ -58,7 +52,6 @@ namespace Artemis.UI.Screens.Root
coreService.StartupArguments = _lifeTime.Args.ToList(); coreService.StartupArguments = _lifeTime.Args.ToList();
mainWindowService.ConfigureMainWindowProvider(this); mainWindowService.ConfigureMainWindowProvider(this);
registrationService.RegisterProviders();
DisplayAccordingToSettings(); DisplayAccordingToSettings();
Task.Run(coreService.Initialize); Task.Run(coreService.Initialize);
@ -70,9 +63,6 @@ namespace Artemis.UI.Screens.Root
set => this.RaiseAndSetIfChanged(ref _sidebarViewModel, value); set => this.RaiseAndSetIfChanged(ref _sidebarViewModel, value);
} }
/// <inheritdoc />
public RoutingState Router { get; }
private void CurrentMainWindowOnClosed(object? sender, EventArgs e) private void CurrentMainWindowOnClosed(object? sender, EventArgs e)
{ {
_lifeTime.MainWindow = null; _lifeTime.MainWindow = null;
@ -130,6 +120,9 @@ namespace Artemis.UI.Screens.Root
_trayIcons = null; _trayIcons = null;
} }
/// <inheritdoc />
public RoutingState Router { get; }
#region Tray commands #region Tray commands
public void OpenScreen(string displayName) public void OpenScreen(string displayName)

View File

@ -5,7 +5,6 @@
void RegisterBuiltInDataModelDisplays(); void RegisterBuiltInDataModelDisplays();
void RegisterBuiltInDataModelInputs(); void RegisterBuiltInDataModelInputs();
void RegisterBuiltInPropertyEditors(); void RegisterBuiltInPropertyEditors();
void RegisterProviders();
void RegisterControllers(); void RegisterControllers();
void ApplyPreferredGraphicsContext(); void ApplyPreferredGraphicsContext();
} }

View File

@ -1,5 +1,4 @@
using Artemis.Core.Services; using Artemis.Core.Services;
using Artemis.UI.Providers;
using Artemis.UI.Services.Interfaces; using Artemis.UI.Services.Interfaces;
namespace Artemis.UI.Services namespace Artemis.UI.Services
@ -24,11 +23,6 @@ namespace Artemis.UI.Services
{ {
} }
public void RegisterProviders()
{
_inputService.AddInputProvider(new AvaloniaInputProvider());
}
public void RegisterControllers() public void RegisterControllers()
{ {
} }