-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathSimulateTouch.h
48 lines (38 loc) · 1.49 KB
/
SimulateTouch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Name: libSimulateTouch (kr.iolate.simulatetouch)
* Author: iolate <[email protected]>
*
* http://api.iolate.kr/simulatetouch/
*
*/
/*
typedef enum {
UIInterfaceOrientationPortrait = 1,//UIDeviceOrientationPortrait,
UIInterfaceOrientationPortraitUpsideDown = 2,//UIDeviceOrientationPortraitUpsideDown,
UIInterfaceOrientationLandscapeLeft = 4,//UIDeviceOrientationLandscapeRight,
UIInterfaceOrientationLandscapeRight = 3,//UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;
*/
typedef enum {
STTouchMove = 0,
STTouchDown,
STTouchUp,
// For these types, (int)point_x denotes button type
STButtonUp,
STButtonDown
} STTouchType;
//Library - libsimulatetouch.dylib
@interface SimulateTouch
// Screen point: Absolute point (Portrait point)
// Window point: Orientated point
// Sreen point to window point. Portrait to 'orientation'
+(CGPoint)STScreenToWindowPoint:(CGPoint)point withOrientation:(int)orientation;
// Window point to screen point. 'orientation' to Portrait.
+(CGPoint)STWindowToScreenPoint:(CGPoint)point withOrientation:(int)orientation;
// if pathIndex is 0, SimulateTouch alloc its pathIndex.
// retrun value is pathIndex. if 0, touch was failed.
// Class methods' point is screen point.
+(int)simulateButton:(int)button state:(int)state;
+(int)simulateTouch:(int)pathIndex atPoint:(CGPoint)point withType:(STTouchType)type;
+(int)simulateSwipeFromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint duration:(float)duration;
@end