79d9b8b8fd07a2144061c5fe92d252da014d2ff4
[sdk/emulator/qemu.git] / tizen / src / emul_state.h
1 /*
2  * Emulator State Information
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 "display/maru_finger.h"
38
39 #define SUPPORT_LEGACY_ARGS
40
41 enum {
42     RESET = 0,
43     BOOT_COMPLETED = 1,
44 };
45
46 /* keep it consistent with emulator-skin definition */
47 enum {
48     HARD_KEY_HOME = 139,
49     HARD_KEY_POWER = 116,
50     HARD_KEY_VOL_UP = 115,
51     HARD_KEY_VOL_DOWN = 114,
52 };
53
54 /* keep it consistent with emulator-skin definition */
55 enum {
56     MOUSE_DOWN = 1,
57     MOUSE_UP = 2,
58     MOUSE_DRAG = 3,
59     MOUSE_WHEELUP = 4,
60     MOUSE_WHEELDOWN = 5,
61     MOUSE_MOVE = 6,
62     MOUSE_DOUBLECLICK = 7,
63     PS2_DOWN = 8,
64     PS2_UP = 9,
65 };
66
67 /* keep it consistent with emulator-skin definition */
68 enum {
69     KEY_PRESSED = 1,
70     KEY_RELEASED = 2,
71 };
72
73 /* keep it consistent with emulator-skin definition */
74 enum {
75     ROTATION_PORTRAIT = 0,
76     ROTATION_LANDSCAPE = 1,
77     ROTATION_REVERSE_PORTRAIT = 2,
78     ROTATION_REVERSE_LANDSCAPE = 3,
79 };
80
81 enum {
82     HOST_CAPSLOCK_KEY = 1,
83     HOST_NUMLOCK_KEY = 2,
84 };
85
86
87 typedef  struct EmulatorConfigInfo {
88     bool skin_enable;
89     int resolution_w;
90     int resolution_h;
91     int sdl_bpp;
92     bool input_mouse_enable;
93     bool input_touch_enable;
94     int max_touch_point;
95     int vm_base_port;
96     int device_serial_number;
97     int ecs_port;
98     int spice_port;
99     int websocket_port;
100     char *vm_name;
101     /* add here */
102     int serial_port;
103 } EmulatorConfigInfo;
104
105 typedef struct EmulatorConfigState {
106     int emulator_condition; //TODO : enum
107     double scale_factor;
108     short rotation_type;
109     MultiTouchState qemu_mts;
110     int qemu_caps_lock;
111     int qemu_num_lock;
112     /* add here */
113 } EmulatorConfigState;
114
115 /* misc */
116 extern char remote_bin_path[];
117 #ifdef SUPPORT_LEGACY_ARGS
118 extern char log_path[];
119 #endif
120
121 char const *get_remote_bin_path(void);
122 char const *get_bin_path(void);
123 char const *get_log_path(void);
124
125 /* setter */
126 void set_emul_skin_enable(bool enable);
127 void set_emul_resolution(int width, int height);
128 void set_emul_win_scale(double scale);
129 void set_emul_sdl_bpp(int bpp);
130 void set_emul_input_mouse_enable(bool on);
131 void set_emul_input_touch_enable(bool on);
132 void set_emul_max_touch_point(int cnt);
133 void set_emul_vm_base_port(int port);
134 void set_emul_ecs_port(int port);
135
136 void set_emulator_condition(int state);
137 void set_emul_rotation(short rotation_type);
138 void set_emul_caps_lock_state(int state);
139 void set_emul_num_lock_state(int state);
140 void set_emul_vm_name(char *vm_name);
141
142 /* getter */
143 bool get_emul_skin_enable(void);
144 int get_emul_resolution_width(void);
145 int get_emul_resolution_height(void);
146 double get_emul_win_scale(void);
147 int get_emul_sdl_bpp(void);
148 bool is_emul_input_mouse_enable(void);
149 bool is_emul_input_touch_enable(void);
150 int get_emul_max_touch_point(void);
151 int get_emul_vm_base_port(void);
152 int get_device_serial_number(void);
153 int get_emul_ecs_port(void);
154 int get_emul_serial_port(void);
155 int get_emul_spice_port(void);
156 int get_emul_websocket_port(void);
157
158 int get_emulator_condition(void);
159 short get_emul_rotation(void);
160 MultiTouchState *get_emul_multi_touch_state(void);
161 int get_host_lock_key_state(int key);
162 int get_host_lock_key_state_darwin(int key);
163 int get_emul_caps_lock_state(void);
164 int get_emul_num_lock_state(void);
165 char* get_emul_vm_name(void);
166
167 #endif /* __EMUL_STATE_H__ */