#pragma once #include "../helpers/memory/Memory.hpp" #include "../helpers/signal/Signal.hpp" #include "../helpers/math/Math.hpp" #include "../devices/IPointer.hpp" #include "../devices/IKeyboard.hpp" #include "../devices/Tablet.hpp" #include "../devices/ITouch.hpp" #include "../desktop/DesktopTypes.hpp" #include "../SharedDefs.hpp" namespace Desktop { enum eFocusReason : uint8_t; } namespace Event { struct SCallbackInfo { bool cancelled = false; /* on cancellable events, will cancel the event. */ }; class CEventBus { public: CEventBus() = default; ~CEventBus() = default; template using Event = CSignalT; template using Cancellable = CSignalT; struct { Event<> ready; Event<> tick; struct { Event open; Event openEarly; Event destroy; Event close; Event kill; Event active; Event urgent; Event title; Event class_; Event pin; Event fullscreen; Event updateRules; Event moveToWorkspace; } window; struct { Event opened; Event closed; Event updateRules; } layer; struct { struct { Cancellable move; Cancellable button; Cancellable axis; } mouse; struct { Cancellable key; Event, const std::string&> layout; Event> focus; } keyboard; struct { Cancellable axis; Cancellable button; Cancellable proximity; Cancellable tip; } tablet; struct { Cancellable cancel; Cancellable down; Cancellable up; Cancellable motion; } touch; } input; struct { Event pre; Event stage; } render; struct { Event state; } screenshare; struct { struct { Cancellable begin; Cancellable end; Cancellable update; } swipe; struct { Cancellable begin; Cancellable end; Cancellable update; } pinch; } gesture; struct { Event newMon; Event preAdded; Event added; Event preRemoved; Event removed; Event preCommit; Event focused; Event<> layoutChanged; } monitor; struct { Event moveToMonitor; Event active; Event created; Event removed; } workspace; struct { Event<> preReload; Event<> reloaded; } config; struct { Event submap; } keybinds; } m_events; }; UP& bus(); };