From 6f039d671ff8c640a46ff0c085fd523fa98a3946 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 31 Aug 2024 12:59:42 +0100 Subject: [PATCH] event_noop: rename from event_dummy --- event/event_dummy.go | 21 --------------------- event/event_noop.go | 24 ++++++++++++++++++++++++ event/event_test.go | 2 +- 3 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 event/event_dummy.go create mode 100644 event/event_noop.go diff --git a/event/event_dummy.go b/event/event_dummy.go deleted file mode 100644 index b5780c3..0000000 --- a/event/event_dummy.go +++ /dev/null @@ -1,21 +0,0 @@ -package event - -type DummyEvHandler struct{} - -func (e *DummyEvHandler) Workspace(WorkspaceName) {} -func (e *DummyEvHandler) FocusedMonitor(FocusedMonitor) {} -func (e *DummyEvHandler) ActiveWindow(ActiveWindow) {} -func (e *DummyEvHandler) Fullscreen(bool) {} -func (e *DummyEvHandler) MonitorRemoved(MonitorName) {} -func (e *DummyEvHandler) MonitorAdded(MonitorName) {} -func (e *DummyEvHandler) CreateWorkspace(WorkspaceName) {} -func (e *DummyEvHandler) DestroyWorkspace(WorkspaceName) {} -func (e *DummyEvHandler) MoveWorkspace(MoveWorkspace) {} -func (e *DummyEvHandler) ActiveLayout(ActiveLayout) {} -func (e *DummyEvHandler) OpenWindow(OpenWindow) {} -func (e *DummyEvHandler) CloseWindow(CloseWindow) {} -func (e *DummyEvHandler) MoveWindow(MoveWindow) {} -func (e *DummyEvHandler) OpenLayer(OpenLayer) {} -func (e *DummyEvHandler) CloseLayer(CloseLayer) {} -func (e *DummyEvHandler) SubMap(SubMap) {} -func (e *DummyEvHandler) Screencast(Screencast) {} diff --git a/event/event_noop.go b/event/event_noop.go new file mode 100644 index 0000000..b8dd0cc --- /dev/null +++ b/event/event_noop.go @@ -0,0 +1,24 @@ +package event + +// NoopEventHandler is an implementation of [EventHandler] interface with all +// methods doing nothing. It is a good starting point to be embedded your own +// struct to be extended. +type NoopEventHandler struct{} + +func (e *NoopEventHandler) Workspace(WorkspaceName) {} +func (e *NoopEventHandler) FocusedMonitor(FocusedMonitor) {} +func (e *NoopEventHandler) ActiveWindow(ActiveWindow) {} +func (e *NoopEventHandler) Fullscreen(bool) {} +func (e *NoopEventHandler) MonitorRemoved(MonitorName) {} +func (e *NoopEventHandler) MonitorAdded(MonitorName) {} +func (e *NoopEventHandler) CreateWorkspace(WorkspaceName) {} +func (e *NoopEventHandler) DestroyWorkspace(WorkspaceName) {} +func (e *NoopEventHandler) MoveWorkspace(MoveWorkspace) {} +func (e *NoopEventHandler) ActiveLayout(ActiveLayout) {} +func (e *NoopEventHandler) OpenWindow(OpenWindow) {} +func (e *NoopEventHandler) CloseWindow(CloseWindow) {} +func (e *NoopEventHandler) MoveWindow(MoveWindow) {} +func (e *NoopEventHandler) OpenLayer(OpenLayer) {} +func (e *NoopEventHandler) CloseLayer(CloseLayer) {} +func (e *NoopEventHandler) SubMap(SubMap) {} +func (e *NoopEventHandler) Screencast(Screencast) {} diff --git a/event/event_test.go b/event/event_test.go index b3b56b3..7cc8da9 100644 --- a/event/event_test.go +++ b/event/event_test.go @@ -16,7 +16,7 @@ type FakeEventClient struct { } type FakeEventHandler struct { - DummyEvHandler + NoopEventHandler } func (f *FakeEventClient) Receive() ([]ReceivedData, error) {