[Title] modified arch define & etc
authorgiwoong.kim <giwoong.kim@samsung.com>
Wed, 25 Jul 2012 11:32:37 +0000 (20:32 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Wed, 25 Jul 2012 11:38:20 +0000 (20:38 +0900)
[Type] feature
[Module] Emulator
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/emulator.c
tizen/src/maru_sdl.c
tizen/src/skin/maruskin_client.c
tizen/src/skin/maruskin_server.c

index e2578d06ad9586d206d36327560787a05b14a73c..204a011508294d5fcd42bcd7b43aabd3df0301b0 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "maru_common.h"
 #include <stdlib.h>
+#ifdef CONFIG_SDL
 #include <SDL.h>
-#include "maru_common.h"
+#endif
 #include "emulator.h"
 #include "sdb.h"
 #include "string.h"
 #include <glib.h>
 #include <glib/gstdio.h>
 
-#if defined( _WIN32)
+#if defined(CONFIG_WIN32)
 #include <windows.h>
-#elif defined(__linux__)
+#elif defined(CONFIG_LINUX)
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <sys/sysinfo.h>
 #include <sys/ipc.h>  
 #include <sys/shm.h>
-
 #endif
 
 #include "mloop_event.h"
@@ -81,16 +81,14 @@ static char** skin_argv = NULL;
 static int qemu_argc = 0;
 static char** qemu_argv = NULL;
 
-extern void maruskin_sdl_quit(void);
+extern void maru_display_fini(void);
 void exit_emulator(void)
 {
-    cleanup_multi_touch_state();
-
     mloop_ev_stop();
     shutdown_skin_server();
     shutdown_guest_server();
 
-    maruskin_sdl_quit();
+    maru_display_fini();
 }
 
 static int check_port_bind_listen(u_int port)
@@ -119,7 +117,7 @@ static int check_port_bind_listen(u_int port)
         INFO( "check port(%d) bind listen  ok \n", port);
     }
 
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
     closesocket(s);
 #else
     close(s);
@@ -393,7 +391,7 @@ void set_image_and_log_path(char* qemu_argv)
 
     strcpy(logpath, tizen_target_path);
     strcat(logpath, LOGS_SUFFIX);
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
     if(access(g_win32_locale_filename_from_utf8(logpath), R_OK) != 0) {
        g_mkdir(g_win32_locale_filename_from_utf8(logpath), 0755); 
     }
index 54d2289858a8b27710a897ae9b3d1c264a1ac1c6..ed3bc4ded8a4e72a79a773c2bc4961f7041c4998 100644 (file)
@@ -456,6 +456,7 @@ void maruskin_sdl_quit(void)
     /* remove multi-touch finger points */
     get_emul_multi_touch_state()->multitouch_enable = 0;
     clear_finger_slot();
+    cleanup_multi_touch_state();
 
     if (sdl_opengl == 1) {
         glDeleteTextures(1, &texture);
index 50e60c49124a18a30c1b84b6179fb170ac6a7c1f..4158264214a5db7fa237e38c842baaaeea7648db 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 
+#include "maru_common.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include "sdb.h"
 #include "debug_ch.h"
 
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
 #include "maru_err_table.h"
 #include <windows.h>
 #endif
 
-MULTI_DEBUG_CHANNEL(qemu, maruskin_client);
+MULTI_DEBUG_CHANNEL(qemu, skin_client);
 
 
 #define SKIN_SERVER_READY_TIME 3 // second
@@ -106,7 +107,7 @@ static void* run_skin_client(void* arg)
         argv );
     INFO( "command for swt : %s\n", cmd );
 
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
     //WinExec( cmd, SW_SHOW );
     {
         STARTUPINFO sti = { 0 };
@@ -164,7 +165,7 @@ static void* run_skin_client(void* arg)
         }
     }
 
-#else //ifndef _WIN32
+#else //ifndef CONFIG_WIN32
     int ret = system(cmd);
 
     if (ret == 127) {
@@ -206,7 +207,7 @@ int start_skin_client(int argc, char* argv[])
         } else {
             count++;
             INFO( "sleep for ready. count:%d\n", count );
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
         Sleep( SKIN_SERVER_SLEEP_TIME );
 #else
         usleep( 1000 * SKIN_SERVER_SLEEP_TIME );
@@ -249,7 +250,7 @@ int start_simple_client(char* msg) {
     snprintf(cmd, len, "%s %s %s %s=\"%s\"", JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE_PATH, JAVA_SIMPLEMODE_OPTION, msg);
     INFO("command for swt : %s\n", cmd);
 
-#ifdef __WIN32
+#ifdef CONFIG_WIN32
     ret = WinExec(cmd, SW_SHOW);
 #else
     ret = system(cmd);
index cb94e976c3fd160732a72a8796288b974ab0f522..e8187e7c316442d2787a74865570fb841ecb9c9f 100644 (file)
  *
  */
 
+
+#include "maru_common.h"
+
+#ifdef CONFIG_DARWIN
+//shared memory
+#define USE_SHM
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -42,7 +50,7 @@
 #include "maruskin_client.h"
 #include "emulator.h"
 #include "debug_ch.h"
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
 #include <windows.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
@@ -52,7 +60,7 @@
 #include <sys/socket.h>
 #endif
 
-MULTI_DEBUG_CHANNEL( qemu, skin_server );
+MULTI_DEBUG_CHANNEL(qemu, skin_server);
 
 #define MAX_REQ_ID 0x7fffffff
 #define RECV_BUF_SIZE 32
@@ -194,7 +202,7 @@ void shutdown_skin_server( void ) {
                 INFO( "skin client sent normal shutdown response.\n" );
                 break;
             } else {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
                 Sleep( 1 ); // 1ms
 #else
                 usleep( 1000 ); // 1ms
@@ -208,7 +216,7 @@ void shutdown_skin_server( void ) {
     is_force_close_client = 1;
 
     if ( client_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
         closesocket( client_sock );
 #else
         close( client_sock );
@@ -218,7 +226,7 @@ void shutdown_skin_server( void ) {
     if ( close_server_socket ) {
         INFO( "skin client did not send normal shutdown response.\n" );
         if ( server_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
             closesocket( server_sock );
 #else
             close( server_sock );
@@ -253,7 +261,7 @@ static void parse_skinconfig_prop( void ) {
 
     memset( skin_config_path, 0, target_path_len + 32 );
     strcpy( skin_config_path, tizen_target_path );
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
     strcat( skin_config_path, "\\" );
 #else
     strcat( skin_config_path, "/" );
@@ -361,7 +369,7 @@ static void parse_skin_args( void ) {
 
             free( arg );
 
-        }else {
+        } else {
             ERR( "fail to strdup." );
         }
 
@@ -700,7 +708,9 @@ static void* run_skin_server( void* args ) {
                         do_rotation_event( rotation_type );
                     }
 
-                    maruskin_sdl_resize(); //send sdl event
+#ifndef USE_SHM
+                    maruskin_sdl_resize(); // send sdl event
+#endif
                     break;
                 }
                 case RECV_SCREEN_SHOT: {
@@ -799,7 +809,7 @@ static void* run_skin_server( void* args ) {
 
 cleanup:
     if ( server_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
         closesocket( server_sock );
 #else
         close( server_sock );
@@ -1040,7 +1050,7 @@ static void* do_heart_beat( void* args ) {
 
                     is_force_close_client = 1;
                     if ( client_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
                         closesocket( client_sock );
 #else
                         close( client_sock );
@@ -1063,7 +1073,7 @@ static void* do_heart_beat( void* args ) {
 
         is_force_close_client = 1;
         if ( client_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
             closesocket( client_sock );
 #else
             close( client_sock );
@@ -1072,7 +1082,7 @@ static void* do_heart_beat( void* args ) {
 
         stop_server = 1;
         if ( server_sock ) {
-#ifdef _WIN32
+#ifdef CONFIG_WIN32
             closesocket( server_sock );
 #else
             close( server_sock );