skin: modified variable name
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 8 Nov 2012 12:04:27 +0000 (21:04 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 12 Nov 2012 03:20:53 +0000 (12:20 +0900)
currentLcdWidth -> currentResolutionWidth

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java

index 310344858dbda1e5387e67adeba9ecbfb15f3747..b04124a5ef784d39a29e277fe9a704daddb2351e 100644 (file)
@@ -144,10 +144,12 @@ public class EmulatorShmSkin extends EmulatorSkin {
        public long compose() {
                super.compose();
 
-               int result = shmget(currentLcdWidth * currentLcdHeight); //initialize shared memory
+               /* initialize shared memory */
+               int result = shmget(currentResolutionWidth * currentResolutionHeight);
                //logger.info("shmget navtive function returned " + result);
 
-               pollThread = new PollFBThread(currentLcdWidth, currentLcdHeight); //update lcd thread
+               /* update lcd thread */
+               pollThread = new PollFBThread(currentResolutionWidth, currentResolutionHeight);
 
                lcdCanvas.addPaintListener(new PaintListener() {
                        public void paintControl(PaintEvent e) {
index 3c0a436dcff076e26f2f8a266e0664ffaf264f88..59a918ffed739952774e06c8cd44798d60da4df0 100644 (file)
@@ -158,8 +158,8 @@ public class EmulatorSkin {
        protected int currentScale;
        protected short currentRotationId;
        protected int currentAngle;
-       protected int currentLcdWidth;
-       protected int currentLcdHeight;
+       protected int currentResolutionWidth;
+       protected int currentResolutionHeight;
        protected SkinRegion currentHoverRegion;
        protected SkinRegion currentPressedRegion;
 
@@ -238,23 +238,23 @@ public class EmulatorSkin {
                int y = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_Y,
                                EmulatorConfig.DEFAULT_WINDOW_Y);
 
-               int resolutionW = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
-               int resolutionH = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
+               currentResolutionWidth = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
+               currentResolutionHeight = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
                int scale = SkinUtil.getValidScale(config);
 //             int rotationId = config.getPropertyShort( PropertiesConstants.WINDOW_ROTATION,
 //                             EmulatorConfig.DEFAULT_WINDOW_ROTATION );
                // has to be portrait mode at first booting time
                short rotationId = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
 
-               composeInternal(lcdCanvas, x, y, resolutionW, resolutionH, scale, rotationId, false);
-               logger.info("resolution : " + resolutionW + "x" + resolutionH + ", scale : " + scale);
+               composeInternal(lcdCanvas, x, y, scale, rotationId, false);
+               logger.info("resolution : " +
+                               currentResolutionWidth + "x" + currentResolutionHeight + ", scale : " + scale);
 
                return 0;
        }
 
        private void composeInternal(Canvas lcdCanvas,
-                       int x, int y, int resolutionW, int resolutionH,
-                       int scale, short rotationId, boolean isOnKbd) {
+                       int x, int y, int scale, short rotationId, boolean isOnKbd) {
 
                //shell.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK));
                shell.setLocation(x, y);
@@ -271,7 +271,7 @@ public class EmulatorSkin {
                        shell.setImage(imageRegistry.getIcon(IconName.EMULATOR_TITLE));
                }
 
-               arrangeSkin(resolutionW, resolutionH, scale, rotationId);
+               arrangeSkin(scale, rotationId);
 
                if (skinInfo.isPhoneShape() && null == currentImage) {
                        logger.severe("Failed to load initial skin image file. Kill this skin process.");
@@ -387,20 +387,17 @@ public class EmulatorSkin {
 
        private void rearrangeSkin() {
                logger.info("rearrange the skin (" + skinInfo.getSkinOption() + ")");
-               arrangeSkin(currentLcdWidth, currentLcdHeight, currentScale, currentRotationId);
+               arrangeSkin(currentScale, currentRotationId);
        }
 
-       private void arrangeSkin(int resolutionW, int resolutionH, int scale, short rotationId) {
-
-               this.currentLcdWidth = resolutionW;
-               this.currentLcdHeight = resolutionH;
+       private void arrangeSkin(int scale, short rotationId) {
                this.currentScale = scale;
                this.currentRotationId = rotationId;
                this.currentAngle = SkinRotation.getAngle(rotationId);
 
                /* arrange the lcd */
                Rectangle lcdBounds = SkinUtil.adjustLcdGeometry(
-                               lcdCanvas, currentLcdWidth, currentLcdHeight, scale, rotationId,
+                               lcdCanvas, currentResolutionWidth, currentResolutionHeight, scale, rotationId,
                                skinInfo.isPhoneShape());
                if (lcdBounds == null) {
                        logger.severe("Failed to lcd information for phone shape skin.");
@@ -410,6 +407,7 @@ public class EmulatorSkin {
                                        SWT.ICON_ERROR, config);
                        System.exit(-1);
                }
+               logger.info("lcd bounds : " + lcdBounds);
 
                FormData dataCanvas = new FormData();
                dataCanvas.left = new FormAttachment(0, lcdBounds.x);
@@ -984,8 +982,9 @@ public class EmulatorSkin {
                                                EmulatorSkin.this.isDragStartedInLCD = false;
                                        }
 
-                                       int[] geometry = SkinUtil.convertMouseGeometry( e.x, e.y, currentLcdWidth, currentLcdHeight,
-                                                       currentScale, currentAngle );
+                                       int[] geometry = SkinUtil.convertMouseGeometry(
+                                                       e.x, e.y, currentResolutionWidth, currentResolutionHeight,
+                                                       currentScale, currentAngle);
 
                                        MouseEventData mouseEventData = new MouseEventData(
                                                        MouseButtonType.LEFT.value(), eventType,
@@ -1004,8 +1003,9 @@ public class EmulatorSkin {
                        public void mouseUp( MouseEvent e ) {
                                if ( 1 == e.button ) { // left button
 
-                                       int[] geometry = SkinUtil.convertMouseGeometry( e.x, e.y, currentLcdWidth, currentLcdHeight,
-                                                       currentScale, currentAngle );
+                                       int[] geometry = SkinUtil.convertMouseGeometry(
+                                                       e.x, e.y, currentResolutionWidth, currentResolutionHeight,
+                                                       currentScale, currentAngle);
                                        logger.info( "mouseUp in LCD" + " x:" + geometry[0] + " y:" + geometry[1] );
 
                                        MouseEventData mouseEventData = new MouseEventData(
@@ -1025,8 +1025,9 @@ public class EmulatorSkin {
                        public void mouseDown( MouseEvent e ) {
                                if ( 1 == e.button ) { // left button
 
-                                       int[] geometry = SkinUtil.convertMouseGeometry( e.x, e.y, currentLcdWidth, currentLcdHeight,
-                                                       currentScale, currentAngle );
+                                       int[] geometry = SkinUtil.convertMouseGeometry(
+                                                       e.x, e.y, currentResolutionWidth, currentResolutionHeight,
+                                                       currentScale, currentAngle);
                                        logger.info( "mouseDown in LCD" + " x:" + geometry[0] + " y:" + geometry[1] );
 
                                        MouseEventData mouseEventData = new MouseEventData(
@@ -1052,9 +1053,11 @@ public class EmulatorSkin {
 
                        @Override
                        public void mouseScrolled(MouseEvent e) {
-                               int[] geometry = SkinUtil.convertMouseGeometry(e.x, e.y, currentLcdWidth, currentLcdHeight,
+                               int[] geometry = SkinUtil.convertMouseGeometry(
+                                               e.x, e.y, currentResolutionWidth, currentResolutionHeight,
                                                currentScale, currentAngle);
-                               logger.info("mousewheel in LCD" + " x:" + geometry[0] + " y:" + geometry[1] + " value:" + e.count);
+                               logger.info("mousewheel in LCD" +
+                                               " x:" + geometry[0] + " y:" + geometry[1] + " value:" + e.count);
 
                                int eventType;
                                if (e.count < 0) {
@@ -2101,7 +2104,7 @@ public class EmulatorSkin {
 
                                short rotationId = ( (Short) item.getData() );
 
-                               arrangeSkin( currentLcdWidth, currentLcdHeight, currentScale, rotationId );
+                               arrangeSkin(currentScale, rotationId);
                                LcdStateData lcdStateData = new LcdStateData( currentScale, rotationId );
                                communicator.sendToQEMU( SendCommand.CHANGE_LCD_STATE, lcdStateData );
                        }
@@ -2155,7 +2158,7 @@ public class EmulatorSkin {
 
                                int scale = ( (Scale) item.getData() ).value();
 
-                               arrangeSkin( currentLcdWidth, currentLcdHeight, scale, currentRotationId );
+                               arrangeSkin(scale, currentRotationId);
                                LcdStateData lcdStateData = new LcdStateData( scale, currentRotationId );
                                communicator.sendToQEMU( SendCommand.CHANGE_LCD_STATE, lcdStateData );