Fission FSN
Loading...
Searching...
No Matches
gfCAutoTestPointer.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCAutoTestPointer.h
4*
5* Purpose: Auto play input - real pointer events, taps and drags
6*
7*********************************************************************/
8
9#ifndef gfCAutoTestPointerhdr
10#define gfCAutoTestPointerhdr
11
12#include <fsCore/fsBaseTypes.h>
13#include <fsCore/fsPoint.h>
14
15class fsCEntity;
16class fsCUniqueId;
17class fsIComponent;
19
20
21// Positions are pointer space, which is screen space: sPointerMsgParam::mPos
22// goes straight to hitTest(), so aiming at screenPositionGet() needs no conversion.
24{
25public:
26
27 gfCAutoTestPointer(const fsIComponent& pOwner, gfCAutoTestOverlay& pOverlay, fsS32 pDragSteps);
28
29 void tap(const fsPoint& pPos);
30
31 // Drags run a step per update - keyOver() tests the dragged sprite's matrix,
32 // which only refreshes once per update walk. pKeyEnt is the draggable being
33 // picked up, if known, so the drop can be aimed by its icon.
34 void dragBegin(const fsPoint& pFrom, const fsPoint& pTo, fsCEntity* pKeyEnt = nullptr);
35 // True on the step the drag drops.
37 // Changes where the drag in flight will drop - before its first step.
38 void dragRetarget(const fsPoint& pTo);
39 // Lets the drag run out where it started rather than cutting it short.
40 void dragHold();
41 // Releases an in-flight drag rather than stranding a half-open gesture.
42 void dragAbandon();
43 fsBool dragActiveGet() const { return mDragActive; }
44
45private:
46
47 void event(const fsCUniqueId& pMessageType, const fsPoint& pPos, fsBool pDown);
48 void dragOffsetCompensate();
49
50 const fsIComponent& mOwner;
51 gfCAutoTestOverlay& mOverlay;
52
53 const fsS32 mDragSteps;
54
55 fsBool mDragActive;
56 fsPoint mDragFrom;
57 fsPoint mDragTo;
58 fsPoint mDragLastPos;
59 fsS32 mDragStep;
60 fsCEntity* mDragKeyEnt;
61};
62
63#endif
Definition fsCEntity.h:39
Definition fsCUniqueId.h:21
Definition fsIComponent.h:26
Definition gfCAutoTestOverlay.h:22
fsBool dragStepAdvance()
Definition gfCAutoTestPointer.cpp:82
fsBool dragActiveGet() const
Definition gfCAutoTestPointer.h:43
void dragBegin(const fsPoint &pFrom, const fsPoint &pTo, fsCEntity *pKeyEnt=nullptr)
Definition gfCAutoTestPointer.cpp:29
void dragHold()
Definition gfCAutoTestPointer.cpp:47
void tap(const fsPoint &pPos)
Definition gfCAutoTestPointer.cpp:19
void dragAbandon()
Definition gfCAutoTestPointer.cpp:52
gfCAutoTestPointer(const fsIComponent &pOwner, gfCAutoTestOverlay &pOverlay, fsS32 pDragSteps)
Definition gfCAutoTestPointer.cpp:105
void dragRetarget(const fsPoint &pTo)
Definition gfCAutoTestPointer.cpp:42
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17