Don't look up pid/tid on YAGL_LOG_FUNC_SET
[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 #include "emulator_common.h"
37 #include "hw/maru_device_ids.h"
38
39 #define MAX_ADDR_LEN    256
40 #define MAX_PORT_LEN    256
41
42 #define MAX_HDS_PATH    256
43 #define MAX_PROFILE     256
44
45 #define DEFAULT_STATIC_HDS_ID   "fsdef0"
46
47 enum {
48     RESET = 0,
49     BOOT_COMPLETED = 1,
50 };
51
52 /* keep it consistent with emulator-skin definition */
53 enum {
54     HARD_KEY_HOME = 139,
55     HARD_KEY_POWER = 116,
56     HARD_KEY_VOL_UP = 115,
57     HARD_KEY_VOL_DOWN = 114,
58 };
59
60 /* keep it consistent with emulator-skin definition */
61 enum {
62     MOUSE_DOWN = 1,
63     MOUSE_UP = 2,
64     MOUSE_DRAG = 3,
65     MOUSE_WHEELUP = 4,
66     MOUSE_WHEELDOWN = 5,
67     MOUSE_MOVE = 6,
68     MOUSE_DOUBLECLICK = 7,
69     PS2_DOWN = 8,
70     PS2_UP = 9,
71 };
72
73 /* keep it consistent with emulator-skin definition */
74 enum {
75     KEY_PRESSED = 1,
76     KEY_RELEASED = 2,
77 };
78
79 enum {
80     HOST_CAPSLOCK_KEY = 1,
81     HOST_NUMLOCK_KEY = 2,
82 };
83
84 typedef  struct EmulatorConfigInfo {
85     const char *skin_path;
86     const char *file_sharing_path;
87     /* add here */
88 } EmulatorConfigInfo;
89
90 typedef struct EmulatorConfigState {
91     int emulator_condition;
92     int emuld_condition;
93     int multitouch_enable;
94     /* add here */
95     char emulator_profile[MAX_PROFILE];
96     bool emuld_connection;
97     bool sdb_connection;
98 } EmulatorConfigState;
99
100 /* setter */
101 void set_emulator_condition(int state);
102 void set_emul_tap_enable(bool enable);
103 void set_emuld_connection(bool connected);
104 void set_sdb_connection(bool connected);
105 void set_emul_guest_home_path(char *home_path);
106
107 /* getter */
108 const char* get_emul_skin_path(void);
109 const char* get_emul_guest_home_path(void);
110 bool get_emul_cpu_accel(void);
111
112 int get_emulator_condition(void);
113 bool get_emuld_connection(void);
114 bool get_sdb_connection(void);
115 int get_max_touch_point(void);
116
117 // cleaned-up
118 extern const char *launch_conf_file;
119 extern const char *bin_path;
120 extern int initial_resolution_width;
121 extern int initial_resolution_height;
122 extern int vm_base_port;
123
124 char const *get_bin_path(void);
125 char const *get_log_redirect_file(void);
126 char const *get_kernel_log_redirect_file(void);
127 const char *get_drive_image_file(void);
128 const char *get_drive_image_ver(void);
129 const char *get_swap_image_file(void);
130 const char *get_kernel_file(void);
131 const char *get_https_proxy_addr(void);
132 const char *get_vm_name(void);
133 const char *get_profile_name(void);
134 const char *get_platform_version(void);
135 const char *get_vm_data_path(void);
136 const char *get_sdcard_image_path(void);
137 const char* get_host_directory_sharing_path(void);
138
139 bool is_gpu_accel_enabled(void);
140 bool is_pci_device_enabled(int device_id);
141 bool is_mouse_enabled(void);
142 bool is_touchscreen_enabled(void);
143 bool is_netclient_tap_attached(void);
144
145 uint64_t get_ram_size(void);
146
147 int get_vm_base_port(void);
148 int get_vm_device_serial_number(void);
149 int get_vm_spice_port(void);
150
151 void set_guest_ip(const char *ip);
152 void set_host_ip(const char *ip);
153 const char* get_guest_ip(void);
154 const char* get_host_ip(void);
155
156 void set_initial_display_resolution(int width, int height);
157 int get_display_resolution_width(void);
158 int get_display_resolution_height(void);
159
160 const char* get_platform_default_home(void);
161 void set_platform_default_home(const char *path);
162
163 void init_emul_state(void);
164 #endif /* __EMUL_STATE_H__ */