#include "skin/maruskin_operation.h"
#include "skin/maruskin_server.h"
#include "util/maru_device_hotplug.h"
-#include "emulator.h"
#include "emul_state.h"
#include "debug_ch.h"
*/
char *get_tizen_sdk_data_path(void)
{
- char *emul_bin_path = NULL;
+ char const *emul_bin_path = NULL;
char *sdk_info_file_path = NULL;
char *tizen_sdk_data_path = NULL;
#ifndef CONFIG_WIN32
*/
#include "emul_state.h"
+#include "emulator_options.h"
#include "skin/maruskin_server.h"
-#include "debug_ch.h"
+#include "util/new_debug_ch.h"
#if defined(CONFIG_LINUX)
#include <X11/XKBlib.h>
#include <windows.h>
#endif
-MULTI_DEBUG_CHANNEL(qemu, emul_state);
-
+DECLARE_DEBUG_CHANNEL(emul_state);
static EmulatorConfigInfo _emul_info = {0,};
static EmulatorConfigState _emul_state;
+/* misc */
+char bin_path[PATH_MAX] = { 0, };
+#ifdef SUPPORT_LEGACY_ARGS
+// for compatibility
+char log_path[PATH_MAX] = { 0, };
+#endif
+
+
+const char *get_bin_path(void)
+{
+ return bin_path;
+}
+
+const char *get_log_path(void)
+{
+#ifdef SUPPORT_LEGACY_ARGS
+ if (log_path[0]) {
+ return log_path;
+ }
+#endif
+ char *log_path = get_variable("log_path");
+
+ // if "log_path" is not exist, make it first
+ if (!log_path) {
+ char *vms_path = get_variable("vms_path");
+ char *vm_name = get_variable("vm_name");
+ if (!vms_path || !vm_name) {
+ log_path = NULL;
+ }
+ else {
+ log_path = g_strdup_printf("%s/%s/logs", vms_path, vm_name);
+ }
+
+ set_variable("log_path", log_path, false);
+ }
+
+ return log_path;
+}
+
+
/* start_skin_client or not ? */
void set_emul_skin_enable(bool enable)
{
_emul_info.resolution_w = width;
_emul_info.resolution_h = height;
- INFO("emulator graphic resolution : %dx%d\n",
+ LOG_INFO("emulator graphic resolution : %dx%d\n",
_emul_info.resolution_w, _emul_info.resolution_h);
}
_emul_info.sdl_bpp = bpp;
if (_emul_info.sdl_bpp != 32) {
- INFO("sdl bpp : %d\n", _emul_info.sdl_bpp);
+ LOG_INFO("sdl bpp : %d\n", _emul_info.sdl_bpp);
}
}
_emul_info.input_mouse_enable = on;
if (_emul_info.input_mouse_enable == true) {
- INFO("set_emul_input_mouse_enable\n");
+ LOG_INFO("set_emul_input_mouse_enable\n");
}
}
_emul_info.input_touch_enable = on;
if (_emul_info.input_touch_enable == true) {
- INFO("set_emul_input_touch_enable\n");
+ LOG_INFO("set_emul_input_touch_enable\n");
}
}
}
_emul_info.max_touch_point = cnt;
- INFO("set max touch point : %d\n", cnt);
+ LOG_INFO("set max touch point : %d\n", cnt);
}
int get_emul_max_touch_point(void)
void set_emulator_condition(int state)
{
if (state == BOOT_COMPLETED) {
- INFO("boot completed!\n");
+ LOG_INFO("boot completed!\n");
// TODO:
} else if (state == RESET) {
- INFO("reset emulator!\n");
+ LOG_INFO("reset emulator!\n");
notify_emul_reset();
}
void set_emul_win_scale(double scale_factor)
{
if (scale_factor < 0.0 || scale_factor > 2.0) {
- INFO("scale_factor is out of range : %f\n", scale_factor);
+ LOG_INFO("scale_factor is out of range : %f\n", scale_factor);
scale_factor = 1.0;
}
_emul_state.scale_factor = scale_factor;
- INFO("emulator window scale_factor : %f\n", _emul_state.scale_factor);
+ LOG_INFO("emulator window scale_factor : %f\n", _emul_state.scale_factor);
}
double get_emul_win_scale(void)
{
if (rotation_type < ROTATION_PORTRAIT ||
rotation_type > ROTATION_REVERSE_LANDSCAPE) {
- INFO("rotation type is out of range : %d\n", rotation_type);
+ LOG_INFO("rotation type is out of range : %d\n", rotation_type);
rotation_type = ROTATION_PORTRAIT;
}
_emul_state.rotation_type = rotation_type;
- INFO("emulator rotation type : %d\n", _emul_state.rotation_type);
+ LOG_INFO("emulator rotation type : %d\n", _emul_state.rotation_type);
}
short get_emul_rotation(void)
#include "display/maru_finger.h"
+#define SUPPORT_LEGACY_ARGS
+
enum {
RESET = 0,
BOOT_COMPLETED = 1,
/* add here */
} EmulatorConfigState;
+/* misc */
+extern gchar bin_path[];
+#ifdef SUPPORT_LEGACY_ARGS
+extern gchar log_path[];
+#endif
+
+char const *get_bin_path(void);
+char const *get_log_path(void);
/* setter */
void set_emul_skin_enable(bool enable);
#include <stdlib.h>
#include <getopt.h>
+#include <libgen.h>
#include "qemu/config-file.h"
#include "qemu/sockets.h"
#include <SDL.h>
#endif
-#ifdef CONFIG_WIN32
-#include <libgen.h>
-#endif
-
#ifdef CONFIG_DARWIN
-#include <libgen.h>
#include "ns_event.h"
int thread_running = 1; /* Check if we need exit main */
#endif
DECLARE_DEBUG_CHANNEL(main);
-#define SUPPORT_LEGACY_ARGS
-
#define ARGS_LIMIT 128
#define LEN_MARU_KERNEL_CMDLINE 512
char maru_kernel_cmdline[LEN_MARU_KERNEL_CMDLINE];
-char bin_path[PATH_MAX] = { 0, };
-
char tizen_target_path[PATH_MAX];
char tizen_target_img_path[PATH_MAX];
int _qemu_argc;
char **_qemu_argv;
-const char *get_log_path(void)
-{
-#ifdef SUPPORT_LEGACY_ARGS
- if (log_path[0]) {
- return log_path;
- }
-#endif
- char *log_path = get_variable("log_path");
-
- // if "log_path" is not exist, make it first
- if (!log_path) {
- char *vms_path = get_variable("vms_path");
- char *vm_name = get_variable("vm_name");
- if (!vms_path || !vm_name) {
- log_path = NULL;
- }
- else {
- log_path = g_strdup_printf("%s/%s/logs", vms_path, vm_name);
- }
-
- set_variable("log_path", log_path, false);
- }
-
- return log_path;
-}
-
void emulator_add_exit_notifier(Notifier *notify)
{
qemu_add_exit_notifier(notify);
get_host_proxy_os(http_proxy, https_proxy, ftp_proxy, socks_proxy);
}
-static void set_bin_path(gchar * exec_argv)
+static void set_bin_path(char const *const exec_argv)
{
set_bin_path_os(exec_argv);
}
-gchar * get_bin_path(void)
-{
- return bin_path;
-}
-
static void check_vm_lock(void)
{
check_vm_lock_os();
}
#endif
-const gchar *prepare_maru(const gchar * const kernel_cmdline)
+const char *prepare_maru(const gchar * const kernel_cmdline)
{
LOG_INFO("Prepare maru specified feature\n");
#include "qemu/option.h"
#include "sysemu/sysemu.h"
-extern gchar bin_path[];
-extern gchar log_path[];
-
-char *get_bin_path(void);
-const gchar * prepare_maru(const gchar * const kernel_cmdline);
+const char *prepare_maru(const gchar * const kernel_cmdline);
void start_skin(void);
-const gchar * get_log_path(void);
-
void emulator_add_exit_notifier(Notifier *notify);
#endif /* __EMULATOR_H__ */
#define MIDBUF 128
#define LEN_MARU_KERNEL_CMDLINE 512
-// for compatibility
-gchar log_path[PATH_MAX] = { 0, };
-
extern gchar maru_kernel_cmdline[LEN_MARU_KERNEL_CMDLINE];
extern char tizen_target_path[PATH_MAX];
#include "qemu/queue.h"
#include "emulator_options.h"
-#include "emulator.h"
+#include "emul_state.h"
#define LINE_LIMIT 1024
#define TOKEN_LIMIT 128
strcpy(JAVA_EXEFILE_PATH, "java");
}
- char* bin_dir = get_bin_path();
+ char const* bin_dir = get_bin_path();
int bin_len = strlen(bin_dir);
char bin_dir_win[bin_len];
strcpy(bin_dir_win, bin_dir);
bin_dir_win[strlen(bin_dir_win) -1] = '\0';
#else
- char* bin_dir = get_bin_path();
+ char const* bin_dir = get_bin_path();
#endif
INFO("bin directory : %s\n", bin_dir);
strcpy(JAVA_EXEFILE_PATH, "java");
}
- char* bin_dir = get_bin_path();
+ char const* bin_dir = get_bin_path();
int bin_dir_len = strlen(bin_dir);
char bin_dir_win[bin_dir_len];
strcpy(bin_dir_win, bin_dir);
bin_dir_win[strlen(bin_dir_win) -1] = '\0';
#else
- char* bin_dir = get_bin_path();
+ char const* bin_dir = get_bin_path();
#endif
INFO("bin directory : %s\n", bin_dir);
#include "qemu-common.h"
-#include "emulator.h"
+#include "emul_state.h"
#include "util/new_debug_ch.h"
#include "util/osutil.h"
}
}
-void set_bin_path_os(gchar * exec_argv)
+void set_bin_path_os(char const *const exec_argv)
{
gchar *file_name = NULL;
}
-void set_bin_path_os(gchar * exec_argv)
+void set_bin_path_os(char const *const exec_argv)
{
gchar link_path[PATH_MAX] = { 0, };
char *file_name = NULL;
}
-void set_bin_path_os(gchar * exec_argv)
+void set_bin_path_os(char const *const exec_argv)
{
gchar link_path[PATH_MAX] = { 0, };
gchar *file_name = NULL;
void make_vm_lock_os(void);
void remove_vm_lock_os(void);
-void set_bin_path_os(gchar *);
+void set_bin_path_os(char const *const);
void print_system_info_os(void);