[Title] added lcdSize communication
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 15 Mar 2012 07:13:20 +0000 (16:13 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 15 Mar 2012 07:13:20 +0000 (16:13 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/maru_sdl.c
tizen/src/maru_sdl.h
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/StartData.java
tizen/src/skin/maruskin_operation.c [changed mode: 0755->0644]

index 987ec753a4ca01cc205dccdcd0cf53c799e3a327..c6a6062bf852b667bf2775e285271bc76c1812f7 100644 (file)
@@ -38,7 +38,7 @@ MULTI_DEBUG_CHANNEL(qemu, emul_state);
 
 static emulator_config_info _emul_info;
 
-void set_emul_info_resolution(int width, int height)
+void set_emul_lcd_size(int width, int height)
 {
     _emul_info.resolution_w = width;
     _emul_info.resolution_h = height;
@@ -46,12 +46,12 @@ void set_emul_info_resolution(int width, int height)
    INFO("emulator graphic resolution %dx%d\n", _emul_info.resolution_w,  _emul_info.resolution_h);
 }
 
-int get_emul_info_resolution_width(void)
+int get_emul_lcd_width(void)
 {
     return _emul_info.resolution_w;
 }
 
-int get_emul_info_resolution_height(void)
+int get_emul_lcd_height(void)
 {
     return _emul_info.resolution_h;
 }
index 51ed156e3200d58613e67fe933df218e1220d905..6db3e07dfeb87b91e497196d83dbeb32a408c834 100644 (file)
@@ -45,11 +45,11 @@ struct emulator_config_state {
 
 
 /* setter */
-void set_emul_info_resolution(int width, int height);
+void set_emul_lcd_size(int width, int height);
 
 /* getter */
-int get_emul_info_resolution_width(void);
-int get_emul_info_resolution_height(void);
+int get_emul_lcd_width(void);
+int get_emul_lcd_height(void);
 
 
 #endif /* __EMUL_STATE_H__ */
index 1a74c6a8cdebed95e55179346a33ff9fb926faa7..b396eaf3efe138074fbec1539846d06f926a1db3 100644 (file)
@@ -168,7 +168,7 @@ void maruskin_display_init(DisplayState *ds)
 #endif
 }
 
-void maruskin_sdl_init(int swt_handle)
+void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height)
 {
     gchar SDL_windowhack[32];
     SDL_SysWMinfo info;
@@ -184,8 +184,9 @@ void maruskin_sdl_init(int swt_handle)
     }
 
     INFO( "qemu_sdl_initialize\n");
-    surface_screen = SDL_SetVideoMode(480, 800,
+    surface_screen = SDL_SetVideoMode(lcd_size_width, lcd_size_height,
         0, SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME);
+    set_emul_lcd_size(lcd_size_width, lcd_size_height);
 
 #ifndef _WIN32
     SDL_VERSION(&info.version);
index 6415086f56e308c5cb540ef7868e38b1a7c90569..3ea67cd8817cc71efdc3dcb39a3873573f2bc6d4 100644 (file)
@@ -44,6 +44,6 @@
 #include <SDL_syswm.h>
 
 void maruskin_display_init(DisplayState *ds);
-void maruskin_sdl_init(int swt_handle);
+void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height);
 
 #endif /* MARU_SDL_H_ */
index 53e7cf67e2275bad1644fc592e1bc5dd142fdc5e..27bbd229df1d01b5af3683f3f426d3f584713f5e 100644 (file)
@@ -110,7 +110,11 @@ public class SocketCommunicator implements ICommunicator {
                        short scale = config.getPropertyShort(PropertiesConstants.WINDOW_SCALE, Scale.HALF.value() );
                        short rotation = config.getPropertyShort( PropertiesConstants.WINDOW_DIRECTION, (short) 0 );
                        
-                       sendToQEMU(SendCommand.SEND_START, new StartData(windowHandleId, scale, rotation));
+                       sendToQEMU(SendCommand.SEND_START,
+                                       new StartData(windowHandleId,
+                                                       Integer.parseInt( config.getArg(ArgsConstants.RESOLUTION_WIDTH) ),
+                                                       Integer.parseInt( config.getArg(ArgsConstants.RESOLUTION_HEIGHT) ),
+                                                       scale, rotation));
 
                } catch (IOException e) {
                        e.printStackTrace();
index b990a404b6b06d3a5689af6d9c34456f5c1798a7..9d776c83a76f78a7ee50509605f69547c9eb4daa 100644 (file)
@@ -38,11 +38,15 @@ import java.io.IOException;
 public class StartData extends AbstractSendData {
 
        private int windowHandleId;
+       private int lcdSizeWidth;
+       private int lcdSizeHeight;
        private short scale;
        private short rotation;
        
-       public StartData(int windowHandleId, short scale, short rotation ) {
+       public StartData(int windowHandleId, int lcdSizeWidth, int lcdSizeHeight, short scale, short rotation ) {
                this.windowHandleId = windowHandleId;
+               this.lcdSizeWidth = lcdSizeWidth;
+               this.lcdSizeHeight = lcdSizeHeight;
                this.scale = scale;
                this.rotation = rotation;
        }
@@ -50,6 +54,8 @@ public class StartData extends AbstractSendData {
        @Override
        protected void write() throws IOException {
                writeInt( windowHandleId );
+               writeInt( lcdSizeWidth );
+               writeInt( lcdSizeHeight );
                writeShort( scale );
                writeShort( rotation );
        }
@@ -59,6 +65,7 @@ public class StartData extends AbstractSendData {
                StringBuilder builder = new StringBuilder();
                builder.append("StartData [windowHandleId=");
                builder.append(windowHandleId);
+               builder.append(", lcd size " + lcdSizeWidth +"x" + lcdSizeHeight);
                builder.append(", scale=");
                builder.append(scale);
                builder.append(", rotation=");
old mode 100755 (executable)
new mode 100644 (file)
index c710c8a..e7de43f
@@ -78,7 +78,7 @@ void start_display( int handle_id, int lcd_size_width, int lcd_size_height, shor
     INFO( "start_display handle_id:%d, lcd size:%dx%d, scale:%d, rotation:%d\n",
         handle_id, lcd_size_width, lcd_size_height, scale, rotation );
 
-    maruskin_sdl_init(handle_id);
+    maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height);
 }
 
 void do_mouse_event( int event_type, int x, int y, int z ) {