EX-Display
EX-Display
Loading...
Searching...
No Matches
MockInput.h
Go to the documentation of this file.
1
/*
2
* © 2024 Peter Cole
3
*
4
* This is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* It is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this code. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef MOCKINPUT_H
19
#define MOCKINPUT_H
20
21
#include "
InputInterface.h
"
22
#include <gmock/gmock.h>
23
25
class
MockInput
:
public
InputInterface
{
26
public
:
27
MockInput
() {}
28
29
MockInput
(
int
needsDisplay
) {
_needsDisplay
=
needsDisplay
; }
30
31
MOCK_METHOD
(
void
,
begin
, (), (
override
));
32
33
MOCK_METHOD
(
void
,
check
, (), (
override
));
34
35
void
setIsCalibrating
(
bool
isCalibrating
) {
_isCalibrating
=
isCalibrating
; }
36
37
void
setNeedsDisplay
(
int
displayId) {
_needsDisplay
= displayId; }
38
39
static
MockInput
*
create
(
int
needsDisplay
) {
40
MockInput
*newInput =
new
MockInput
(
needsDisplay
);
41
return
newInput;
42
}
43
};
44
45
#endif
// MOCKINPUT_H
InputInterface.h
InputInterface
Class to abstract away all physical input implementatio to enable multiple input types Default return...
Definition
InputInterface.h:28
InputInterface::needsDisplay
int needsDisplay()
Test if this InputInterface requires a display instance - needed for TFT_eSPI as it shares the instan...
Definition
InputInterface.cpp:26
InputInterface::begin
virtual void begin()=0
Perform any initial once off setup or configuration here and call only once.
InputInterface::_isCalibrating
bool _isCalibrating
Flag if the input interface is undergoing calibration - needed for touch screens.
Definition
InputInterface.h:79
InputInterface::_needsDisplay
int _needsDisplay
Display ID if this input interface requires a display instance - needed for TFT_eSPI as it shares the...
Definition
InputInterface.h:82
InputInterface::isCalibrating
bool isCalibrating()
Test if this InputInterface is undergoing calibration as required by touch screens.
Definition
InputInterface.cpp:24
InputInterface::check
virtual void check()=0
Call this method at least once per main loop to monitor for input actions Any actions should call the...
MockInput
Mock physical input class.
Definition
MockInput.h:25
MockInput::create
static MockInput * create(int needsDisplay)
Definition
MockInput.h:39
MockInput::MockInput
MockInput()
Definition
MockInput.h:27
MockInput::setNeedsDisplay
void setNeedsDisplay(int displayId)
Definition
MockInput.h:37
MockInput::MockInput
MockInput(int needsDisplay)
Definition
MockInput.h:29
MockInput::MOCK_METHOD
MOCK_METHOD(void, check,(),(override))
MockInput::setIsCalibrating
void setIsCalibrating(bool isCalibrating)
Definition
MockInput.h:35
MockInput::MOCK_METHOD
MOCK_METHOD(void, begin,(),(override))
test
mocks
MockInput.h
Generated by
1.9.8