Tizen 2.1 base
[sdk/emulator/qemu.git] / tizen / src / maru_finger.h
1 /*
2  * Multi-touch processing
3  *
4  * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: 
7  * GiWoong Kim <giwoong.kim@samsung.com>
8  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
9  * HyunJun Son
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  *
25  * Contributors:
26  * - S-Core Co., Ltd
27  *
28  */
29
30
31 #ifndef __MARU_FINGER_H__
32 #define __MARU_FINGER_H__
33
34
35 /* definitions relating to multi-touch */
36 #define MAX_FINGER_CNT 10
37 #define DEFAULT_FINGER_POINT_SIZE 32
38 #define DEFAULT_FINGER_POINT_COLOR 0x7E0F0F0F
39 #define DEFAULT_FINGER_POINT_OUTLINE_COLOR 0xDDDDDDDD
40
41 typedef struct FingerPoint {
42     int id;
43     int origin_x;
44     int origin_y;
45     int x;
46     int y;
47 } FingerPoint;
48
49 typedef struct MultiTouchState {
50     int multitouch_enable;
51     int finger_cnt;
52     int finger_cnt_max;
53     FingerPoint *finger_slot;
54
55     int finger_point_size;
56     int finger_point_color;
57     int finger_point_outline_color;
58     void *finger_point_surface; //SDL_Surface
59 } MultiTouchState;
60
61
62 void init_multi_touch_state(void);
63 void set_multi_touch_enable(int enable);
64 int get_multi_touch_enable(void);
65 FingerPoint *get_finger_point_from_slot(int index);
66 FingerPoint *get_finger_point_search(int x, int y);
67 int add_finger_point(int origin_x, int origin_y, int x, int y);
68
69 void maru_finger_processing_1(int touch_type, int origin_x, int origin_y, int x, int y);
70 void maru_finger_processing_2(int touch_type, int origin_x, int origin_y, int x, int y);
71 int rearrange_finger_points(int lcd_w, int lcd_h, double scale_factor, int rotaton_type);
72 void clear_finger_slot(void);
73 void cleanup_multi_touch_state(void);
74
75
76 #endif /* __MARU_FINGER_H__ */