[Title] convert type of swt canvas handle
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 8 Jun 2012 08:22:22 +0000 (17:22 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 8 Jun 2012 08:39:43 +0000 (17:39 +0900)
[Type]
[Module] Emulator / skin
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause] support 64bit machine
[Solution] int -> uint64
[TestCase]

tizen/src/maru_sdl.c
tizen/src/maru_sdl.h
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/AbstractSendData.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/data/StartData.java
tizen/src/skin/maruskin_operation.c
tizen/src/skin/maruskin_operation.h
tizen/src/skin/maruskin_server.c

index 0957e1432b7051bb2fdd3ec8f74cb3381e285ed3..55574e58cb10ccbf9b701550f70ee6e7728aeaab 100644 (file)
@@ -308,7 +308,7 @@ void maruskin_display_init(DisplayState *ds)
 #endif
 }
 
-void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height)
+void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height)
 {
     int w, h;
     gchar SDL_windowhack[32];
index 359a39a11be1bdbb170e050660168b39e11e3307..9b6ef1580748aa8ffc6343161969eb9807ec7182 100644 (file)
@@ -47,7 +47,7 @@
 #define SDL_USER_EVENT_CODE_HARDKEY 1
 
 void maruskin_display_init(DisplayState *ds);
-void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height);
+void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height);
 void maruskin_sdl_resize(void);
 
 DisplaySurface* get_qemu_display_surface( void );
index ab49103d1669c6fe262c5a61d5eca8a4acf1b349..cd2306a04bdd6bf2f9758bce99749e9ea9d48b59 100644 (file)
@@ -157,7 +157,7 @@ public class EmulatorSkin {
        private ScreenShotDialog screenShotDialog;
 
        private SocketCommunicator communicator;
-       private int windowHandleId;
+       private long windowHandleId;
 
        private Listener shellCloseListener;
        private PaintListener shellPaintListener;
@@ -192,7 +192,7 @@ public class EmulatorSkin {
                this.communicator = communicator;
        }
 
-       public int compose() {
+       public long compose() {
 
                this.lcdCanvas = new Canvas( shell, SWT.EMBEDDED );
 
@@ -298,15 +298,15 @@ public class EmulatorSkin {
 //
 //     }
 
-       private int getWindowHandleId() {
+       private long getWindowHandleId() {
 
-               int windowHandleId = 0;
+               long windowHandleId = 0;
 
                if ( SkinUtil.isLinuxPlatform() ) {
 
                        try {
                                Field field = lcdCanvas.getClass().getField( "embeddedHandle" );
-                               windowHandleId = field.getInt( lcdCanvas );
+                               windowHandleId = field.getLong( lcdCanvas );
                                logger.info( "lcdCanvas.embeddedHandle:" + windowHandleId );
                        } catch ( IllegalArgumentException e ) {
                                logger.log( Level.SEVERE, e.getMessage(), e );
index b13e45ae4e1350bf8975c9388953bcb55bb31d9a..8510ca3711ac0778cb0fdf849dd807c8b5d1e089 100644 (file)
@@ -149,7 +149,7 @@ public class EmulatorSkinMain {
                        boolean isOnTop = Boolean.parseBoolean( onTopVal );
 
                        EmulatorSkin skin = new EmulatorSkin( config, isOnTop );
-                       int windowHandleId = skin.compose();
+                       long windowHandleId = skin.compose();
 
                        int uid = config.getArgInt( ArgsConstants.UID );
                        communicator = new SocketCommunicator( config, uid, windowHandleId, skin );
index 51c49499cc57d8f6a69dd80cd59c5624ebaf9b12..46b2508d04074a0a75d26bc6d245902c696d6e9d 100644 (file)
@@ -101,7 +101,7 @@ public class SocketCommunicator implements ICommunicator {
 
        private EmulatorConfig config;
        private int uId;
-       private int windowHandleId;
+       private long windowHandleId;
        private EmulatorSkin skin;
 
        private Socket socket;
@@ -119,7 +119,7 @@ public class SocketCommunicator implements ICommunicator {
        private Thread sendThread;
        private LinkedList<SkinSendData> sendQueue;
 
-       public SocketCommunicator( EmulatorConfig config, int uId, int windowHandleId, EmulatorSkin skin ) {
+       public SocketCommunicator( EmulatorConfig config, int uId, long windowHandleId, EmulatorSkin skin ) {
 
                this.config = config;
                this.uId = uId;
@@ -217,6 +217,7 @@ public class SocketCommunicator implements ICommunicator {
                        // has to be portrait mode at first booting time
                        short rotation = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
                        StartData startData = new StartData( windowHandleId, width, height, scale, rotation );
+                       logger.info("StartData" + startData);
 
                        sendToQEMU( SendCommand.SEND_START, startData );
 
index a3e639c416c9fee2f8138f369e91d98fd6003ed0..7ecfc5e12003e0bb622fc24bfcd1188c2f481240 100644 (file)
@@ -63,7 +63,7 @@ public abstract class AbstractSendData implements ISendData {
                dos.writeInt( val );
        }
 
-       protected void writeLong ( int val ) throws IOException {
+       protected void writeLong ( long val ) throws IOException {
                dos.writeLong( val );
        }
 
index 0edbf37c51da135c2a06ce9c086e34ae300923a4..c23d271b2e0a3e97aab4eab3deff690b57ecdbf6 100644 (file)
@@ -37,13 +37,13 @@ import java.io.IOException;
  */
 public class StartData extends AbstractSendData {
 
-       private int windowHandleId;
+       private long windowHandleId;
        private int lcdSizeWidth;
        private int lcdSizeHeight;
        private int scale;
        private short rotation;
        
-       public StartData(int windowHandleId, int lcdSizeWidth, int lcdSizeHeight, int scale, short rotation ) {
+       public StartData(long windowHandleId, int lcdSizeWidth, int lcdSizeHeight, int scale, short rotation ) {
                this.windowHandleId = windowHandleId;
                this.lcdSizeWidth = lcdSizeWidth;
                this.lcdSizeHeight = lcdSizeHeight;
@@ -53,7 +53,7 @@ public class StartData extends AbstractSendData {
 
        @Override
        protected void write() throws IOException {
-               writeInt( windowHandleId );
+               writeLong( windowHandleId );
                writeInt( lcdSizeWidth );
                writeInt( lcdSizeHeight );
                writeInt( scale );
index b98fb23dca900cb9e09c3cff23a9fe1373e036a6..7a0ce1a32f0bde34b2dec5c670d2969d33eb7cd4 100644 (file)
@@ -42,7 +42,6 @@
 #include "maruskin_keymap.h"
 #include "emul_state.h"
 #include "hw/maru_pm.h"
-#include "qemu-common.h"
 #include "sysemu.h"
 
 #ifdef _WIN32
@@ -62,9 +61,9 @@ static int requested_shutdown_qemu_gracefully = 0;
 static void* run_timed_shutdown_thread( void* args );
 static void send_to_emuld( const char* request_type, int request_size, const char* send_buf, int buf_size );
 
-void start_display( int handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type )
+void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type)
 {
-    INFO( "start_display handle_id:%d, lcd size:%dx%d, scale_factor:%lf, rotation_type:%d\n",
+    INFO( "start_display handle_id:%ld, lcd size:%dx%d, scale_factor:%lf, rotation_type:%d\n",
         handle_id, lcd_size_width, lcd_size_height, scale_factor, rotation_type );
 
     set_emul_win_scale(scale_factor);
index 04c4ad1b9884bc20239996f13bfd7ee375d67a0e..43427e28e93438576f7c6468bbb96cb9d1fb7390 100644 (file)
@@ -30,6 +30,9 @@
 #ifndef MARUSKIN_OPERATION_H_
 #define MARUSKIN_OPERATION_H_
 
+#include "qemu-common.h"
+
+
 extern int ret_hax_init;
 
 struct QemuSurfaceInfo {
@@ -44,7 +47,7 @@ struct DetailInfo {
 };
 typedef struct DetailInfo DetailInfo;
 
-void start_display( int handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type );
+void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type);
 
 void do_mouse_event( int event_type, int x, int y, int z );
 
index d5b14e4b9600e375c3f81ddff7e1d083fdd846a9..fb15c466abef5438c38b11a48b2614e3acfcd50d 100644 (file)
@@ -540,7 +540,7 @@ static void* run_skin_server( void* args ) {
                     }
 
                     /* keep it consistent with emulator-skin definition */
-                    int handle_id = 0;
+                    uint64 handle_id = 0;
                     int lcd_size_width = 0;
                     int lcd_size_height = 0;
                     int scale = 0;
@@ -558,7 +558,13 @@ static void* run_skin_server( void* args ) {
                     p += sizeof( scale );
                     memcpy( &rotation, p, sizeof( rotation ) );
 
-                    handle_id = ntohl( handle_id );
+                    int low_id = (int)handle_id;
+                    int high_id = (int)(handle_id >> 32);
+                    low_id = ntohl(high_id);
+                    high_id = ntohl(low_id);
+                    handle_id = high_id;
+                    handle_id = (handle_id << 32) | low_id;
+
                     lcd_size_width = ntohl( lcd_size_width );
                     lcd_size_height = ntohl( lcd_size_height );
                     scale = ntohl( scale );