22 #ifndef ANDROID_TOUCHCONTROLS_H_ 23 #define ANDROID_TOUCHCONTROLS_H_ 25 #include "common/events.h" 29 virtual void touchControlNotifyChanged() = 0;
30 virtual void touchControlDraw(int16 x, int16 y, int16 w, int16 h,
const Common::Rect &clip) = 0;
50 void update(Action action,
int ptr,
int x,
int y);
55 int _screen_width, _screen_height;
59 kFunctionJoystick = 0,
64 Function getFunction(
int x,
int y);
67 Pointer() : id(-1), startX(-1), startY(-1),
68 currentX(-1), currentY(-1),
69 function(kFunctionNone), active(
false) {}
72 startX = startY = currentX = currentY = -1;
73 function = kFunctionNone;
78 uint16 startX, startY;
79 uint16 currentX, currentY;
84 enum { kNumPointers = 5 };
85 Pointer _pointers[kNumPointers];
87 Pointer *getPointerFromId(
int ptr,
bool createNotFound);
88 Pointer *findPointerFromFunction(Function
function);
90 struct FunctionState {
91 FunctionState() : main(Common::JOYSTICK_BUTTON_INVALID),
92 modifier(Common::JOYSTICK_BUTTON_INVALID) {}
94 main = Common::JOYSTICK_BUTTON_INVALID;
95 modifier = Common::JOYSTICK_BUTTON_INVALID;
104 FunctionState _functionStates[kFunctionMax + 1];
111 struct FunctionBehavior {
112 void (*touchToState)(int, int, TouchControls::FunctionState &);
117 static FunctionBehavior functionBehaviors[TouchControls::kFunctionMax + 1];
119 static void touchToJoystickState(
int dX,
int dY, FunctionState &state);
120 static void touchToCenterState(
int dX,
int dY, FunctionState &state);
121 static void touchToRightState(
int dX,
int dY, FunctionState &state);
Definition: touchcontrols.h:36
Definition: touchcontrols.h:27
JoystickButton
Definition: events.h:146