refactor: remove IEventJob
This commit is contained in:
@ -17,7 +17,6 @@ add_library(base STATIC
|
||||
FunctionEventJob.h
|
||||
FunctionJob.cpp
|
||||
FunctionJob.h
|
||||
IEventJob.h
|
||||
IEventQueue.h
|
||||
IEventQueueBuffer.h
|
||||
IJob.h
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@ -7,21 +8,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base/IEventJob.h"
|
||||
class Event;
|
||||
|
||||
//! Use a function as an event job
|
||||
/*!
|
||||
An event job class that invokes a function.
|
||||
*/
|
||||
class FunctionEventJob : public IEventJob
|
||||
class FunctionEventJob
|
||||
{
|
||||
public:
|
||||
//! run() invokes \c func(arg)
|
||||
explicit FunctionEventJob(void (*func)(const Event &, void *), void *arg = nullptr);
|
||||
~FunctionEventJob() override = default;
|
||||
|
||||
// IEventJob overrides
|
||||
void run(const Event &) override;
|
||||
~FunctionEventJob() = default;
|
||||
void run(const Event &);
|
||||
|
||||
private:
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user