menu: added XML schema for scale menu 20/12620/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Wed, 20 Nov 2013 05:41:12 +0000 (14:41 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Thu, 21 Nov 2013 06:10:01 +0000 (15:10 +0900)
1. To constitute the scale menu's factor array
through XML, I declared "factorItem" element.
2. declare "blankGuide" element directly

Change-Id: I478cb1a187917d111c3b2a34e1e01f69150dbd18
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/emul_state.c
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/BlankGuideType.java [deleted file]
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ObjectFactory.java
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/OptionType.java
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/PopupMenuType.java
tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java [new file with mode: 0644]
tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java
tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd
tizen/src/skin/client/xsd/SpecialKeyWindow-layout.xsd

index 71d1be3ff5e2e99de2a2f9f3e956043901edf5bc..147dea92c9995747b50f3007ccb0d6d4b3e1a983 100644 (file)
@@ -174,7 +174,7 @@ void set_emulator_condition(int state)
 /* emulator window scale */
 void set_emul_win_scale(double scale_factor)
 {
-    if (scale_factor < 0.0 || scale_factor > 1.0) {
+    if (scale_factor < 0.0 || scale_factor > 2.0) {
         INFO("scale_factor is out of range : %f\n", scale_factor);
         scale_factor = 1.0;
     }
diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/BlankGuideType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/BlankGuideType.java
deleted file mode 100644 (file)
index 57315c9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * XML Binding
- *
- * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-//
-// 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.09.16 at 11:45:09 AM KST 
-//
-
-
-package org.tizen.emulator.skin.dbi;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for blankGuideType complex type.
- * 
- * <p>The following schema fragment specifies the expected content contained within this class.
- * 
- * <pre>
- * &lt;complexType name="blankGuideType">
- *   &lt;complexContent>
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     &lt;/restriction>
- *   &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- * 
- * 
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "blankGuideType")
-public class BlankGuideType {
-
-    @XmlAttribute(name = "visible")
-    protected Boolean visible;
-
-    /**
-     * Gets the value of the visible property.
-     * 
-     * @return
-     *     possible object is
-     *     {@link Boolean }
-     *     
-     */
-    public boolean isVisible() {
-        if (visible == null) {
-            return true;
-        } else {
-            return visible;
-        }
-    }
-
-    /**
-     * Sets the value of the visible property.
-     * 
-     * @param value
-     *     allowed object is
-     *     {@link Boolean }
-     *     
-     */
-    public void setVisible(Boolean value) {
-        this.visible = value;
-    }
-
-}
index 4ca04e9000cc254b3059bdb38c32699f2c92bcef..8aca4a8011866a2893c0a235fa957623ee8eb565 100644 (file)
@@ -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.09.16 at 11:45:09 AM KST 
+// Generated on: 2013.11.20 at 02:29:25 PM KST 
 //
 
 
@@ -64,6 +64,22 @@ public class ObjectFactory {
     public ObjectFactory() {
     }
 
+    /**
+     * Create an instance of {@link ScaleItemType }
+     * 
+     */
+    public ScaleItemType createScaleItemType() {
+        return new ScaleItemType();
+    }
+
+    /**
+     * Create an instance of {@link OptionType }
+     * 
+     */
+    public OptionType createOptionType() {
+        return new OptionType();
+    }
+
     /**
      * Create an instance of {@link EmulatorUI }
      * 
@@ -96,14 +112,6 @@ public class ObjectFactory {
         return new PopupMenuType();
     }
 
-    /**
-     * Create an instance of {@link OptionType }
-     * 
-     */
-    public OptionType createOptionType() {
-        return new OptionType();
-    }
-
     /**
      * Create an instance of {@link EventInfoType }
      * 
@@ -160,14 +168,6 @@ public class ObjectFactory {
         return new DisplayType();
     }
 
-    /**
-     * Create an instance of {@link BlankGuideType }
-     * 
-     */
-    public BlankGuideType createBlankGuideType() {
-        return new BlankGuideType();
-    }
-
     /**
      * Create an instance of {@link MenuItemType }
      * 
@@ -184,4 +184,20 @@ public class ObjectFactory {
         return new ImageListType();
     }
 
+    /**
+     * Create an instance of {@link ScaleItemType.FactorItem }
+     * 
+     */
+    public ScaleItemType.FactorItem createScaleItemTypeFactorItem() {
+        return new ScaleItemType.FactorItem();
+    }
+
+    /**
+     * Create an instance of {@link OptionType.BlankGuide }
+     * 
+     */
+    public OptionType.BlankGuide createOptionTypeBlankGuide() {
+        return new OptionType.BlankGuide();
+    }
+
 }
index 570d2d2af4a57dd511152eb0c56fdbf1c7701a0a..eb498d83a610357fbf62fe9a7b0e5755059c70ab 100644 (file)
@@ -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.09.16 at 11:45:09 AM KST 
+// Generated on: 2013.11.20 at 02:29:25 PM KST 
 //
 
 
@@ -38,6 +38,7 @@ package org.tizen.emulator.skin.dbi;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlType;
 
 
@@ -51,7 +52,15 @@ import javax.xml.bind.annotation.XmlType;
  *   &lt;complexContent>
  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       &lt;all>
- *         &lt;element name="blankGuide" type="{http://www.tizen.org/emulator/skin/dbi}blankGuideType" minOccurs="0"/>
+ *         &lt;element name="blankGuide" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
  *       &lt;/all>
  *     &lt;/restriction>
  *   &lt;/complexContent>
@@ -66,17 +75,17 @@ import javax.xml.bind.annotation.XmlType;
 })
 public class OptionType {
 
-    protected BlankGuideType blankGuide;
+    protected OptionType.BlankGuide blankGuide;
 
     /**
      * Gets the value of the blankGuide property.
      * 
      * @return
      *     possible object is
-     *     {@link BlankGuideType }
+     *     {@link OptionType.BlankGuide }
      *     
      */
-    public BlankGuideType getBlankGuide() {
+    public OptionType.BlankGuide getBlankGuide() {
         return blankGuide;
     }
 
@@ -85,11 +94,66 @@ public class OptionType {
      * 
      * @param value
      *     allowed object is
-     *     {@link BlankGuideType }
+     *     {@link OptionType.BlankGuide }
      *     
      */
-    public void setBlankGuide(BlankGuideType value) {
+    public void setBlankGuide(OptionType.BlankGuide value) {
         this.blankGuide = value;
     }
 
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "")
+    public static class BlankGuide {
+
+        @XmlAttribute(name = "visible")
+        protected Boolean visible;
+
+        /**
+         * Gets the value of the visible property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link Boolean }
+         *     
+         */
+        public boolean isVisible() {
+            if (visible == null) {
+                return true;
+            } else {
+                return visible;
+            }
+        }
+
+        /**
+         * Sets the value of the visible property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link Boolean }
+         *     
+         */
+        public void setVisible(Boolean value) {
+            this.visible = value;
+        }
+
+    }
+
 }
index 6a7ff8a956e23297ae81255212b6bc9c4fa62ad0..cd45d17ff128e397d0b9c4058bbfd5257faea9aa 100644 (file)
@@ -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.11.14 at 01:04:55 PM KST 
+// Generated on: 2013.11.20 at 02:29:25 PM KST 
 //
 
 
@@ -53,7 +53,7 @@ import javax.xml.bind.annotation.XmlType;
  *       &lt;all>
  *         &lt;element name="topmostItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
  *         &lt;element name="rotateItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
- *         &lt;element name="scaleItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
+ *         &lt;element name="scaleItem" type="{http://www.tizen.org/emulator/skin/dbi}scaleItemType" minOccurs="0"/>
  *         &lt;element name="keywindowItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
  *         &lt;element name="hostKeyboardItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
  *         &lt;element name="shellItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
@@ -73,7 +73,7 @@ public class PopupMenuType {
 
     protected MenuItemType topmostItem;
     protected MenuItemType rotateItem;
-    protected MenuItemType scaleItem;
+    protected ScaleItemType scaleItem;
     protected MenuItemType keywindowItem;
     protected MenuItemType hostKeyboardItem;
     protected MenuItemType shellItem;
@@ -131,10 +131,10 @@ public class PopupMenuType {
      * 
      * @return
      *     possible object is
-     *     {@link MenuItemType }
+     *     {@link ScaleItemType }
      *     
      */
-    public MenuItemType getScaleItem() {
+    public ScaleItemType getScaleItem() {
         return scaleItem;
     }
 
@@ -143,10 +143,10 @@ public class PopupMenuType {
      * 
      * @param value
      *     allowed object is
-     *     {@link MenuItemType }
+     *     {@link ScaleItemType }
      *     
      */
-    public void setScaleItem(MenuItemType value) {
+    public void setScaleItem(ScaleItemType value) {
         this.scaleItem = value;
     }
 
diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/ScaleItemType.java
new file mode 100644 (file)
index 0000000..a1ed3af
--- /dev/null
@@ -0,0 +1,249 @@
+/**
+ * XML Binding
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+//
+// 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.11.20 at 02:29:25 PM KST 
+//
+
+
+package org.tizen.emulator.skin.dbi;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for scaleItemType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="scaleItemType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="factorItem" maxOccurs="unbounded" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+ *                 &lt;attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *       &lt;attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "scaleItemType", propOrder = {
+    "factorItem"
+})
+public class ScaleItemType {
+
+    protected List<ScaleItemType.FactorItem> factorItem;
+    @XmlAttribute(name = "itemName")
+    protected String itemName;
+    @XmlAttribute(name = "visible")
+    protected Boolean visible;
+
+    /**
+     * Gets the value of the factorItem property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the factorItem property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getFactorItem().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ScaleItemType.FactorItem }
+     * 
+     * 
+     */
+    public List<ScaleItemType.FactorItem> getFactorItem() {
+        if (factorItem == null) {
+            factorItem = new ArrayList<ScaleItemType.FactorItem>();
+        }
+        return this.factorItem;
+    }
+
+    /**
+     * Gets the value of the itemName property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getItemName() {
+        if (itemName == null) {
+            return "";
+        } else {
+            return itemName;
+        }
+    }
+
+    /**
+     * Sets the value of the itemName property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setItemName(String value) {
+        this.itemName = value;
+    }
+
+    /**
+     * Gets the value of the visible property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Boolean }
+     *     
+     */
+    public boolean isVisible() {
+        if (visible == null) {
+            return true;
+        } else {
+            return visible;
+        }
+    }
+
+    /**
+     * Sets the value of the visible property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Boolean }
+     *     
+     */
+    public void setVisible(Boolean value) {
+        this.visible = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+     *       &lt;attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class FactorItem {
+
+        @XmlValue
+        protected int value;
+        @XmlAttribute(name = "itemName")
+        protected String itemName;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         */
+        public int getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         */
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the itemName property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getItemName() {
+            if (itemName == null) {
+                return "";
+            } else {
+                return itemName;
+            }
+        }
+
+        /**
+         * Sets the value of the itemName property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setItemName(String value) {
+            this.itemName = value;
+        }
+
+    }
+
+}
index ea611aacd37bbc594e9c927bad676aebffafa829..0b3790205a638d7c797f3be350b5cd9829d2e4e5 100644 (file)
@@ -31,6 +31,8 @@ package org.tizen.emulator.skin.menu;
 import java.io.File;
 import java.io.FileFilter;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.logging.Logger;
 
 import org.eclipse.swt.SWT;
@@ -42,6 +44,7 @@ import org.tizen.emulator.skin.EmulatorSkin;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.dbi.MenuItemType;
 import org.tizen.emulator.skin.dbi.PopupMenuType;
+import org.tizen.emulator.skin.dbi.ScaleItemType;
 import org.tizen.emulator.skin.image.ImageRegistry;
 import org.tizen.emulator.skin.image.ImageRegistry.IconName;
 import org.tizen.emulator.skin.log.SkinLogger;
@@ -147,12 +150,23 @@ public class PopupMenu {
 
                /* Scale menu */
                if (itemProperties == null || itemProperties.getScaleItem() == null) {
-                       createScaleItem(menu, SCALE_MENUITEM_NAME);
+                       createScaleItem(menu, SCALE_MENUITEM_NAME, null);
                } else {
-                       MenuItemType scaleMenuType = itemProperties.getScaleItem();
+                       ScaleItemType scaleMenuType = itemProperties.getScaleItem();
                        if (scaleMenuType.isVisible() == true) {
-                               createScaleItem(menu, (scaleMenuType.getItemName().isEmpty()) ?
-                                               SCALE_MENUITEM_NAME : scaleMenuType.getItemName());
+                               String menuName = (scaleMenuType.getItemName().isEmpty()) ?
+                                               SCALE_MENUITEM_NAME : scaleMenuType.getItemName();
+
+                               List<ScaleItemType.FactorItem> factors = scaleMenuType.getFactorItem();
+                               if (factors == null || factors.size() == 0) {
+                                       logger.info("create a default Scale menu");
+
+                                       createScaleItem(menu, menuName, null);
+                               } else {
+                                       logger.info("create a custom Scale menu");
+
+                                       createScaleItem(menu, menuName, factors);
+                               }
                        }
                }
 
@@ -268,7 +282,8 @@ public class PopupMenu {
                rotateItem.setMenu(rotateSubMenu);
        }
 
-       private void createScaleItem(Menu menu, String name) {
+       private void createScaleItem(Menu menu, String name,
+                       List<ScaleItemType.FactorItem> factors) {
                scaleItem = new MenuItem(menu, SWT.CASCADE);
                scaleItem.setText(name);
                scaleItem.setImage(imageRegistry.getIcon(IconName.SCALE));
@@ -277,41 +292,39 @@ public class PopupMenu {
 
                Menu scaleSubMenu = new Menu(menu.getShell(), SWT.DROP_DOWN);
                {
-                       MenuItem scaleOneItem = new MenuItem(scaleSubMenu, SWT.RADIO);
-                       scaleOneItem.setText("1x");
-                       scaleOneItem.setData(100);
-                       if (skin.getEmulatorSkinState().getCurrentScale()
-                                       == (Integer)scaleOneItem.getData()) {
-                               scaleOneItem.setSelection(true);
-                       }
-                       scaleOneItem.addSelectionListener(scaleListener);
-
-                       MenuItem scaleThreeQtrItem = new MenuItem(scaleSubMenu, SWT.RADIO);
-                       scaleThreeQtrItem.setText("3/4x");
-                       scaleThreeQtrItem.setData(75);
-                       if (skin.getEmulatorSkinState().getCurrentScale()
-                                       == (Integer) scaleThreeQtrItem.getData()) {
-                               scaleThreeQtrItem.setSelection(true);
-                       }
-                       scaleThreeQtrItem.addSelectionListener(scaleListener);
-
-                       MenuItem scalehalfItem = new MenuItem(scaleSubMenu, SWT.RADIO);
-                       scalehalfItem.setText("1/2x");
-                       scalehalfItem.setData(50);
-                       if (skin.getEmulatorSkinState().getCurrentScale()
-                                       == (Integer) scalehalfItem.getData()) {
-                               scalehalfItem.setSelection(true);
+                       if (factors == null) {
+                               /* use default factor array */
+                               ScaleItemType.FactorItem actual = new ScaleItemType.FactorItem();
+                               actual.setItemName("1x");
+                               actual.setValue(100);
+
+                               ScaleItemType.FactorItem threeQuater = new ScaleItemType.FactorItem();
+                               threeQuater.setItemName("3/4x");
+                               threeQuater.setValue(75);
+
+                               ScaleItemType.FactorItem half = new ScaleItemType.FactorItem();
+                               half.setItemName("1/2x");
+                               half.setValue(50);
+
+                               ScaleItemType.FactorItem quater = new ScaleItemType.FactorItem();
+                               quater.setItemName("1/4x");
+                               quater.setValue(25);
+
+                               factors = Arrays.asList(actual, threeQuater, half, quater);
                        }
-                       scalehalfItem.addSelectionListener(scaleListener);
-
-                       MenuItem scaleOneQtrItem = new MenuItem(scaleSubMenu, SWT.RADIO);
-                       scaleOneQtrItem.setText("1/4x");
-                       scaleOneQtrItem.setData(25);
-                       if (skin.getEmulatorSkinState().getCurrentScale()
-                                       == (Integer) scaleOneQtrItem.getData()) {
-                               scaleOneQtrItem.setSelection(true);
+
+                       for (ScaleItemType.FactorItem factor : factors) {
+                               final MenuItem menuItem = new MenuItem(scaleSubMenu, SWT.RADIO);
+                               menuItem.setText(factor.getItemName());
+                               menuItem.setData(factor.getValue());
+
+                               if (skin.getEmulatorSkinState().getCurrentScale()
+                                               == (Integer) menuItem.getData()) {
+                                       menuItem.setSelection(true);
+                               }
+
+                               menuItem.addSelectionListener(scaleListener);
                        }
-                       scaleOneQtrItem.addSelectionListener(scaleListener);
                }
 
                scaleItem.setMenu(scaleSubMenu);
index ac6cb73e8745b591009cf728876b6527b3215584..2b5c8b4643289069673e8140379bd8bc377b4b06 100644 (file)
@@ -97,7 +97,7 @@ xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified
                <all>
                        <element name="topmostItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
                        <element name="rotateItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
-                       <element name="scaleItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
+                       <element name="scaleItem" type="dbi:scaleItemType" minOccurs="0" maxOccurs="1"> </element>
                        <element name="keywindowItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
                        <element name="hostKeyboardItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
                        <element name="shellItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"> </element>
@@ -109,13 +109,30 @@ xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified
                <attribute name="visible" type="boolean" default="true" use="optional"> </attribute>
        </complexType>
 
+       <complexType name="scaleItemType">
+               <sequence>
+                       <element name="factorItem" minOccurs="0" maxOccurs="unbounded">
+                               <complexType>
+                                       <simpleContent>
+                                               <extension base="int">
+                                                       <attribute name="itemName" type="string" default="" use="optional" />
+                                               </extension>
+                                       </simpleContent>
+                               </complexType>
+                       </element>
+               </sequence>
+               <attribute name="itemName" type="string" default="" use="optional"> </attribute>
+               <attribute name="visible" type="boolean" default="true" use="optional"> </attribute>
+       </complexType>
+
        <complexType name="optionType">
                <all>
-                       <element name="blankGuide" type="dbi:blankGuideType" minOccurs="0" maxOccurs="1"> </element>
+                       <element name="blankGuide" minOccurs="0" maxOccurs="1">
+                               <complexType>
+                                       <attribute name="visible" type="boolean" default="true" use="optional"> </attribute>
+                               </complexType>
+                       </element>
                </all>
        </complexType>
 
-       <complexType name="blankGuideType">
-               <attribute name="visible" type="boolean" default="true" use="optional"> </attribute>
-       </complexType>
-</schema>
\ No newline at end of file
+</schema>
index 1ea4d646eb0d66f0008250e0f20583935c605488..f53abc03547a4c1090ee1220bf5ab235d0c6c4ab 100644 (file)
@@ -59,4 +59,5 @@ xmlns:dbi="http://www.tizen.org/emulator/skin/keywindow/dbi" elementFormDefault=
                <attribute name="G" type="unsignedInt"> </attribute>
                <attribute name="B" type="unsignedInt"> </attribute>
        </complexType>
-</schema>
\ No newline at end of file
+
+</schema>