GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.
feat(domain): created WindowsHookHandler for subscribing to emitted window hooks
Lars6d558d520c0b
diff --git a/LarsWM.Domain/Windows/WindowHooksHandler.cs b/LarsWM.Domain/Windows/WindowHooksHandler.csnew file mode 100644index 00000000..e22f1835--- /dev/null+++ b/LarsWM.Domain/Windows/WindowHooksHandler.cs@@ -0,0 +1,51 @@+using LarsWM.Infrastructure.WindowsApi;+using LarsWM.Infrastructure.WindowsApi.Enums;+using System;+using System.Collections.Generic;+using System.Diagnostics;+using System.Text;++namespace LarsWM.Domain.Windows+{+ // TODO: Rename to WindowService once respository classes are created.+ public class WindowHooksHandler+ {+ private WindowEventService _windowEventService { get; }++ public WindowHooksHandler(WindowEventService windowEventService)+ {+ _windowEventService = windowEventService;+ }++ public void Configure()+ {+ _windowEventService.WindowHookSubject.Subscribe(observer =>+ {+ switch (observer.EventType)+ {+ case EventConstant.EVENT_OBJECT_SHOW:+ Debug.WriteLine("show");+ break;+ case EventConstant.EVENT_OBJECT_DESTROY:+ Debug.WriteLine("destroy");+ break;+ case EventConstant.EVENT_OBJECT_CLOAKED:+ Debug.WriteLine("cloaked");+ break;+ case EventConstant.EVENT_OBJECT_UNCLOAKED:+ Debug.WriteLine("decloaked");+ break;+ case EventConstant.EVENT_SYSTEM_MINIMIZESTART:+ Debug.WriteLine("minimize start");+ break;+ case EventConstant.EVENT_SYSTEM_MINIMIZEEND:+ Debug.WriteLine("minimize end");+ break;+ case EventConstant.EVENT_SYSTEM_FOREGROUND:+ Debug.WriteLine("foreground");+ break;+ }+ });+ }+ }+}