[Title] recover the loss of commit
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 7 Jun 2012 11:59:22 +0000 (20:59 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 7 Jun 2012 11:59:22 +0000 (20:59 +0900)
[Type]
[Module] Emulator / skin
[Priority]
[Jira#]
[Redmine#]
[Problem] trim code is missing
[Cause]
[Solution]
[TestCase]

tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java [changed mode: 0755->0644]
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java

old mode 100755 (executable)
new mode 100644 (file)
index ce8b3c0..ab49103
@@ -1,5 +1,5 @@
 /**
- * 
+ * Emulator Skin Process
  *
  * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
  *
@@ -173,6 +173,11 @@ public class EmulatorSkin {
 
        private EmulatorSkin reopenSkin;
        
+       /**
+        * @brief constructor
+        * @param config : configuration of emulator skin
+        * @param isOnTop : always on top flag
+       */
        protected EmulatorSkin( EmulatorConfig config, boolean isOnTop ) {
                this.config = config;
                this.isDefaultHoverColor = true;
@@ -595,6 +600,8 @@ public class EmulatorSkin {
                                                        }
                                                }
                                                
+                                               SkinUtil.trimShell( shell, currentImage );
+
                                                KeyEventData keyEventData = new KeyEventData( KeyEventType.RELEASED.value(), keyCode, 0 );
                                                communicator.sendToQEMU( SendCommand.SEND_HARD_KEY_EVENT, keyEventData );
                                        }
@@ -623,6 +630,8 @@ public class EmulatorSkin {
                                                                        region.height - 1, // src
                                                                        region.x + 1, region.y + 1, region.width - 1, region.height - 1 ); // dst
                                                        gc.dispose();
+
+                                                       SkinUtil.trimShell( shell, currentKeyPressedImage, region.x, region.y, region.width, region.height );
                                                }
 
                                                KeyEventData keyEventData = new KeyEventData( KeyEventType.PRESSED.value(), keyCode, 0 );
index 047226d..c538e54 100644 (file)
@@ -265,6 +265,35 @@ public class SkinUtil {
 
        }
 
+       public static void trimShell(Shell shell, Image image, int left, int top,
+               int width, int height) {
+
+               if (null == image) {
+                       return;
+               }
+
+               ImageData imageData = image.getImageData();
+
+               int right = left + width;
+               int bottom = top + height;
+
+               Region region = shell.getRegion();
+               if (region == null) {
+                       return;
+               }
+
+               for (int i = left; i < right; i++) {
+                       for (int j = top; j < bottom; j++) {
+                               int alpha = imageData.getAlpha(i, j);
+                               if (0 == alpha) {
+                                       region.subtract(i, j, 1, 1);
+                               }
+                       }
+               }
+
+               shell.setRegion(region);
+       }
+
        public static int[] convertMouseGeometry( int originalX, int originalY, int lcdWidth, int lcdHeight, int scale,
                        int angle ) {