display: added display masking 54/35254/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 18 Dec 2014 10:48:03 +0000 (19:48 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 13 Feb 2015 05:40:42 +0000 (21:40 -0800)
Change-Id: Ice619c0988b7528d381a745f5ee1709b833f9a07
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/DisplayType.java
tizen/src/skin/client/src/org/tizen/emulator/skin/image/ProfileSkinImageRegistry.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java
tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd

index 01e5208..8a37e76 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SangHo Park <sangho1206.park@samsung.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,7 +30,7 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.07.11 at 12:12:25 PM KST 
+// Generated on: 2014.12.18 at 11:23:37 AM KST 
 //
 
 
@@ -54,6 +54,7 @@ import javax.xml.bind.annotation.XmlType;
  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       &lt;all>
  *         &lt;element name="region" type="{http://www.tizen.org/emulator/skin/dbi}regionType"/>
+ *         &lt;element name="maskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
  *       &lt;/all>
  *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
  *     &lt;/restriction>
@@ -71,6 +72,7 @@ public class DisplayType {
 
     @XmlElement(required = true)
     protected RegionType region;
+    protected String maskImage;
     @XmlAttribute(name = "id", required = true)
     protected int id;
 
@@ -99,6 +101,30 @@ public class DisplayType {
     }
 
     /**
+     * Gets the value of the maskImage property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getMaskImage() {
+        return maskImage;
+    }
+
+    /**
+     * Sets the value of the maskImage property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setMaskImage(String value) {
+        this.maskImage = value;
+    }
+
+    /**
      * Gets the value of the id property.
      * 
      */
index b83bfa7..c435c42 100644 (file)
@@ -45,6 +45,7 @@ import org.tizen.emulator.skin.dbi.RotationsType;
 import org.tizen.emulator.skin.layout.rotation.Rotation;
 import org.tizen.emulator.skin.layout.rotation.SkinRotations;
 import org.tizen.emulator.skin.log.SkinLogger;
+import org.tizen.emulator.skin.util.StringUtil;
 
 public class ProfileSkinImageRegistry {
        private static Logger logger = SkinLogger.getSkinLogger(
@@ -52,7 +53,8 @@ public class ProfileSkinImageRegistry {
 
        public enum SkinImageType {
                PROFILE_IMAGE_TYPE_NORMAL,
-               PROFILE_IMAGE_TYPE_PRESSED
+               PROFILE_IMAGE_TYPE_PRESSED,
+               DISPLAY_MASK_IMAGE
        }
 
        private Display display;
@@ -101,17 +103,29 @@ public class ProfileSkinImageRegistry {
                                        continue;
                                }
 
-                               String mainImage = imageList.getMainImage();
-                               String keyPressedImage = imageList.getKeyPressedImage();
-
                                if (targetRotation.getName().value().equals(rotation.getName().value())) {
-                                       String mainKey = makeKey(id, SkinImageType.PROFILE_IMAGE_TYPE_NORMAL);
-                                       skinImageMap.put(mainKey,
-                                                       new Image(display, skinPath + File.separator + mainImage));
-
-                                       String pressedKey = makeKey(id, SkinImageType.PROFILE_IMAGE_TYPE_PRESSED);
-                                       skinImageMap.put(pressedKey,
-                                                       new Image(display, skinPath + File.separator + keyPressedImage));
+                                       if (SkinImageType.PROFILE_IMAGE_TYPE_NORMAL == imageType) {
+                                               String mainImage = imageList.getMainImage();
+
+                                               String mainKey = makeKey(id, imageType);
+                                               skinImageMap.put(mainKey,
+                                                               new Image(display, skinPath + File.separator + mainImage));
+                                       } else if (SkinImageType.PROFILE_IMAGE_TYPE_PRESSED == imageType) {
+                                               String keyPressedImage = imageList.getKeyPressedImage();
+
+                                               String pressedKey = makeKey(id, imageType);
+                                               skinImageMap.put(pressedKey,
+                                                               new Image(display, skinPath + File.separator + keyPressedImage));
+                                       } else if (SkinImageType.DISPLAY_MASK_IMAGE == imageType) {
+                                               String displayMaskImage = rotation.getDisplay().getMaskImage();
+                                               if (StringUtil.isEmpty(StringUtil.nvl(displayMaskImage))) {
+                                                       return null;
+                                               }
+
+                                               String displayMaskKey = makeKey(id, imageType);
+                                               skinImageMap.put(displayMaskKey,
+                                                               new Image(display, skinPath + File.separator + displayMaskImage));
+                                       }
 
                                        break;
                                }
index c44ac49..226e5b7 100644 (file)
@@ -196,6 +196,19 @@ public class ProfileSpecificSkinComposer implements ISkinComposer {
                }
                logger.info("display bounds : " + displayBounds);
 
+               Image mask = imageRegistry.getSkinImage(rotationId, SkinImageType.DISPLAY_MASK_IMAGE);
+               if (mask != null) {
+                       logger.info("display masking");
+
+                       mask = SkinUtil.createScaledImage(
+                                       shell.getDisplay(), mask, rotationId, scale);
+                       lcdCanvas.setRegion(SkinUtil.getTrimmedRegion(mask));
+
+                       mask.dispose();
+               } else {
+                       lcdCanvas.setRegion(null);
+               }
+
                /* make profile skin */
                Image originSkin = imageRegistry.getSkinImage(
                                rotationId, SkinImageType.PROFILE_IMAGE_TYPE_NORMAL);
index 8c966cf..6f80b33 100644 (file)
@@ -48,6 +48,7 @@ xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified
        <complexType name="displayType">
                <all>
                        <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"> </element>
+                       <element name="maskImage" type="string" minOccurs="0" maxOccurs="1"> </element>
                </all>
                <attribute name="id" type="int" use="required"> </attribute>
        </complexType>