summaryrefslogtreecommitdiff
path: root/tizen/src/emul_state.h
blob: 988d748ad846b8cef55ac7d8edbd4a0da5df97fb (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
 * Emulator State Information
 *
 * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact:
 * SeokYeon Hwang <syeon.hwang@samsung.com>
 * MunKyu Im <munkyu.im@samsung.com>
 * GiWoong Kim <giwoong.kim@samsung.com>
 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
 * HyunJun Son
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Contributors:
 * - S-Core Co., Ltd
 *
 */


#ifndef __EMUL_STATE_H__
#define __EMUL_STATE_H__

#include "emulator_common.h"
#include "hw/maru_device_ids.h"

#define MAX_ADDR_LEN    256
#define MAX_PORT_LEN    256

#define MAX_HDS_PATH    256
#define MAX_PROFILE     256

#define DEFAULT_STATIC_HDS_ID   "fsdef0"

enum {
    RESET = 0,
    BOOT_COMPLETED = 1,
};

/* keep it consistent with emulator-skin definition */
enum {
    HARD_KEY_HOME = 139,
    HARD_KEY_POWER = 116,
    HARD_KEY_VOL_UP = 115,
    HARD_KEY_VOL_DOWN = 114,
};

/* keep it consistent with emulator-skin definition */
enum {
    MOUSE_DOWN = 1,
    MOUSE_UP = 2,
    MOUSE_DRAG = 3,
    MOUSE_WHEELUP = 4,
    MOUSE_WHEELDOWN = 5,
    MOUSE_MOVE = 6,
    MOUSE_DOUBLECLICK = 7,
    PS2_DOWN = 8,
    PS2_UP = 9,
};

/* keep it consistent with emulator-skin definition */
enum {
    KEY_PRESSED = 1,
    KEY_RELEASED = 2,
};

enum {
    HOST_CAPSLOCK_KEY = 1,
    HOST_NUMLOCK_KEY = 2,
};

typedef  struct EmulatorConfigInfo {
    const char *skin_path;
    const char *file_sharing_path;
    /* add here */
} EmulatorConfigInfo;

typedef struct EmulatorConfigState {
    int emulator_condition;
    int emuld_condition;
    int multitouch_enable;
    /* add here */
    char emulator_profile[MAX_PROFILE];
    bool emuld_connection;
    bool sdb_connection;
} EmulatorConfigState;

/* setter */
void set_emulator_condition(int state);
void set_emul_tap_enable(bool enable);
void set_emuld_connection(bool connected);
void set_sdb_connection(bool connected);

/* getter */
const char* get_emul_skin_path(void);
bool get_emul_cpu_accel(void);

int get_emulator_condition(void);
bool get_emuld_connection(void);
bool get_sdb_connection(void);
int get_max_touch_point(void);

/* multi-touch */
void set_multi_touch_enable(int mode);
int get_multi_touch_enable(void);

// cleaned-up
extern const char *launch_conf_file;
extern const char *bin_path;
extern int initial_resolution_width;
extern int initial_resolution_height;
extern int vm_base_port;

char const *get_bin_path(void);
char const *get_log_redirect_file(void);
char const *get_kernel_log_redirect_file(void);
const char *get_drive_image_file(void);
const char *get_drive_image_ver(void);
const char *get_swap_image_file(void);
const char *get_kernel_file(void);
const char *get_http_proxy_addr(void);
const char *get_vm_name(void);
const char *get_profile_name(void);
const char *get_vm_data_path(void);
const char *get_sdcard_image_path(void);
const char* get_host_directory_sharing_path(void);

bool is_gpu_accel_enabled(void);
bool is_pci_device_enabled(int device_id);
bool is_mouse_enabled(void);
bool is_touchscreen_enabled(void);
bool is_netclient_tap_attached(void);

uint64_t get_ram_size(void);

int get_vm_base_port(void);
int get_vm_device_serial_number(void);
int get_vm_spice_port(void);

void set_guest_ip(const char *ip);
void set_host_ip(const char *ip);
const char* get_guest_ip(void);
const char* get_host_ip(void);

void set_initial_display_resolution(int width, int height);
int get_display_resolution_width(void);
int get_display_resolution_height(void);

void init_emul_state(void);
#endif /* __EMUL_STATE_H__ */