| 1 |
/* |
| 2 |
* Copyright (C) 2024 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "input/mouse/interfaces/IMouseDriverHandler.h" |
| 12 |
|
| 13 |
#include <memory> |
| 14 |
|
| 15 |
namespace PERIPHERALS |
| 16 |
{ |
| 17 |
class CPeripheral; |
| 18 |
} // namespace PERIPHERALS |
| 19 |
|
| 20 |
namespace KODI |
| 21 |
{ |
| 22 |
namespace JOYSTICK |
| 23 |
{ |
| 24 |
class IButtonMap; |
| 25 |
} // namespace JOYSTICK |
| 26 |
|
| 27 |
namespace MOUSE |
| 28 |
{ |
| 29 |
class IMouseInputHandler; |
| 30 |
|
| 31 |
class CDefaultMouseHandling : public IMouseDriverHandler |
| 32 |
{ |
| 33 |
public: |
| 34 |
CDefaultMouseHandling(PERIPHERALS::CPeripheral* peripheral, IMouseInputHandler* handler); |
| 35 |
|
| 36 |
~CDefaultMouseHandling() override; |
| 37 |
|
| 38 |
bool Load(); |
| 39 |
|
| 40 |
// Implementation of IMouseDriverHandler |
| 41 |
bool OnPosition(int x, int y) override; |
| 42 |
bool OnButtonPress(BUTTON_ID button) override; |
| 43 |
void OnButtonRelease(BUTTON_ID button) override; |
| 44 |
|
| 45 |
private: |
| 46 |
// Construction parameters |
| 47 |
PERIPHERALS::CPeripheral* const m_peripheral; |
| 48 |
IMouseInputHandler* const m_inputHandler; |
| 49 |
|
| 50 |
// Input parameters |
| 51 |
std::unique_ptr<IMouseDriverHandler> m_driverHandler; |
| 52 |
std::unique_ptr<JOYSTICK::IButtonMap> m_buttonMap; |
| 53 |
}; |
| 54 |
} // namespace MOUSE |
| 55 |
} // namespace KODI |