515349b7f84a643ddf6ec18b5e18b3e325b487f0
[sdk/emulator/qemu.git] / tizen / src / emul_state.h
1 /*
2  * Emulator
3  *
4  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: 
7  * SeokYeon Hwang <syeon.hwang@samsung.com>
8  * MunKyu Im <munkyu.im@samsung.com>
9  * GiWoong Kim <giwoong.kim@samsung.com>
10  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
11  * HyunJun Son
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26  *
27  * Contributors:
28  * - S-Core Co., Ltd
29  *
30  */
31
32
33 #ifndef __EMUL_STATE_H__
34 #define __EMUL_STATE_H__
35
36
37 #include "maru_common.h"
38 #include "maru_finger.h"
39
40 /* keep it consistent with emulator-skin definition */
41 enum {
42     HARD_KEY_HOME = 139,
43     HARD_KEY_POWER = 116,
44     HARD_KEY_VOL_UP = 115,
45     HARD_KEY_VOL_DOWN = 114,
46 };
47
48 /* keep it consistent with emulator-skin definition */
49 enum {
50     MOUSE_DOWN = 1,
51     MOUSE_UP = 2,
52     MOUSE_DRAG = 3,
53     MOUSE_WHEELUP = 4,
54     MOUSE_WHEELDOWN = 5,
55     MOUSE_MOVE = 6,
56 };
57
58 /* keep it consistent with emulator-skin definition */
59 enum {
60     KEY_PRESSED = 1,
61     KEY_RELEASED = 2,
62 };
63
64 /* keep it consistent with emulator-skin definition */
65 enum {
66     ROTATION_PORTRAIT = 0,
67     ROTATION_LANDSCAPE = 1,
68     ROTATION_REVERSE_PORTRAIT = 2,
69     ROTATION_REVERSE_LANDSCAPE = 3,
70 };
71
72 enum {
73     HOST_CAPSLOCK_KEY = 1,
74     HOST_NUMLOCK_KEY = 2,
75 };
76
77
78 typedef  struct EmulatorConfigInfo {
79     int skin_enable;
80     int lcd_size_w;
81     int lcd_size_h;
82     int sdl_bpp;
83     bool input_mouse_enable;
84     bool input_touch_enable;
85     int max_touch_point;
86     int vm_base_port;
87     int device_serial_number;
88     char *vm_name;
89     /* add here */
90 } EmulatorConfigInfo;
91
92 typedef struct EmulatorConfigState {
93     int emulator_condition; //TODO : enum
94     double scale_factor;
95     short rotation_type;
96     MultiTouchState qemu_mts;
97     int qemu_caps_lock;
98     int qemu_num_lock;
99     /* add here */
100 } EmulatorConfigState;
101
102
103 /* setter */
104 void set_emul_skin_enable(int enable);
105 void set_emul_lcd_size(int width, int height);
106 void set_emul_win_scale(double scale);
107 void set_emul_sdl_bpp(int bpp);
108 void set_emul_input_mouse_enable(bool on);
109 void set_emul_input_touch_enable(bool on);
110 void set_emul_max_touch_point(int cnt);
111 void set_emul_vm_base_port(int port);
112
113 void set_emulator_condition(int state);
114 void set_emul_rotation(short rotation_type);
115 void set_emul_caps_lock_state(int state);
116 void set_emul_num_lock_state(int state);
117 void set_emul_vm_name(char *vm_name);
118
119 /* getter */
120 int get_emul_skin_enable(void);
121 int get_emul_lcd_width(void);
122 int get_emul_lcd_height(void);
123 double get_emul_win_scale(void);
124 int get_emul_sdl_bpp(void);
125 bool is_emul_input_mouse_enable(void);
126 bool is_emul_input_touch_enable(void);
127 int get_emul_max_touch_point(void);
128 int get_emul_vm_base_port(void);
129 int get_device_serial_number(void);
130
131 int get_emulator_condition(void);
132 short get_emul_rotation(void);
133 MultiTouchState *get_emul_multi_touch_state(void);
134 int get_host_lock_key_state(int key);
135 int get_host_lock_key_state_darwin(int key);
136 int get_emul_caps_lock_state(void);
137 int get_emul_num_lock_state(void);
138 char* get_emul_vm_name(void);
139
140 #endif /* __EMUL_STATE_H__ */