refactor: remove IEventJob
This commit is contained in:
parent
bcb6c368b1
commit
347cb46f15
3 changed files with 5 additions and 30 deletions
|
|
@ -17,7 +17,6 @@ add_library(base STATIC
|
||||||
FunctionEventJob.h
|
FunctionEventJob.h
|
||||||
FunctionJob.cpp
|
FunctionJob.cpp
|
||||||
FunctionJob.h
|
FunctionJob.h
|
||||||
IEventJob.h
|
|
||||||
IEventQueue.h
|
IEventQueue.h
|
||||||
IEventQueueBuffer.h
|
IEventQueueBuffer.h
|
||||||
IJob.h
|
IJob.h
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
* Deskflow -- mouse and keyboard sharing utility
|
||||||
|
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
||||||
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
|
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
||||||
|
|
@ -7,21 +8,19 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/IEventJob.h"
|
class Event;
|
||||||
|
|
||||||
//! Use a function as an event job
|
//! Use a function as an event job
|
||||||
/*!
|
/*!
|
||||||
An event job class that invokes a function.
|
An event job class that invokes a function.
|
||||||
*/
|
*/
|
||||||
class FunctionEventJob : public IEventJob
|
class FunctionEventJob
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! run() invokes \c func(arg)
|
//! run() invokes \c func(arg)
|
||||||
explicit FunctionEventJob(void (*func)(const Event &, void *), void *arg = nullptr);
|
explicit FunctionEventJob(void (*func)(const Event &, void *), void *arg = nullptr);
|
||||||
~FunctionEventJob() override = default;
|
~FunctionEventJob() = default;
|
||||||
|
void run(const Event &);
|
||||||
// IEventJob overrides
|
|
||||||
void run(const Event &) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void (*m_func)(const Event &, void *);
|
void (*m_func)(const Event &, void *);
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* Deskflow -- mouse and keyboard sharing utility
|
|
||||||
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
|
||||||
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
|
||||||
* SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
|
|
||||||
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
class Event;
|
|
||||||
|
|
||||||
//! Event handler interface
|
|
||||||
/*!
|
|
||||||
An event job is an interface for executing a event handler.
|
|
||||||
*/
|
|
||||||
class IEventJob
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~IEventJob() = default;
|
|
||||||
//! Run the job
|
|
||||||
virtual void run(const Event &) = 0;
|
|
||||||
};
|
|
||||||
Loading…
Reference in a new issue