/* 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;
}
+++ /dev/null
-/**
- * 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>
- * <complexType name="blankGuideType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- * </restriction>
- * </complexContent>
- * </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;
- }
-
-}
// 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
//
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 }
*
return new PopupMenuType();
}
- /**
- * Create an instance of {@link OptionType }
- *
- */
- public OptionType createOptionType() {
- return new OptionType();
- }
-
/**
* Create an instance of {@link EventInfoType }
*
return new DisplayType();
}
- /**
- * Create an instance of {@link BlankGuideType }
- *
- */
- public BlankGuideType createBlankGuideType() {
- return new BlankGuideType();
- }
-
/**
* Create an instance of {@link MenuItemType }
*
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();
+ }
+
}
// 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
//
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <all>
- * <element name="blankGuide" type="{http://www.tizen.org/emulator/skin/dbi}blankGuideType" minOccurs="0"/>
+ * <element name="blankGuide" minOccurs="0">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
* </all>
* </restriction>
* </complexContent>
})
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;
}
*
* @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>
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ * </restriction>
+ * </complexContent>
+ * </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;
+ }
+
+ }
+
}
// 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
//
* <all>
* <element name="topmostItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
* <element name="rotateItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
- * <element name="scaleItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
+ * <element name="scaleItem" type="{http://www.tizen.org/emulator/skin/dbi}scaleItemType" minOccurs="0"/>
* <element name="keywindowItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
* <element name="hostKeyboardItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
* <element name="shellItem" type="{http://www.tizen.org/emulator/skin/dbi}menuItemType" minOccurs="0"/>
protected MenuItemType topmostItem;
protected MenuItemType rotateItem;
- protected MenuItemType scaleItem;
+ protected ScaleItemType scaleItem;
protected MenuItemType keywindowItem;
protected MenuItemType hostKeyboardItem;
protected MenuItemType shellItem;
*
* @return
* possible object is
- * {@link MenuItemType }
+ * {@link ScaleItemType }
*
*/
- public MenuItemType getScaleItem() {
+ public ScaleItemType getScaleItem() {
return scaleItem;
}
*
* @param value
* allowed object is
- * {@link MenuItemType }
+ * {@link ScaleItemType }
*
*/
- public void setScaleItem(MenuItemType value) {
+ public void setScaleItem(ScaleItemType value) {
this.scaleItem = value;
}
--- /dev/null
+/**
+ * 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>
+ * <complexType name="scaleItemType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="factorItem" maxOccurs="unbounded" minOccurs="0">
+ * <complexType>
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>int">
+ * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ * </restriction>
+ * </complexContent>
+ * </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>
+ * <complexType>
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>int">
+ * <attribute name="itemName" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ * </extension>
+ * </simpleContent>
+ * </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;
+ }
+
+ }
+
+}
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;
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;
/* 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);
+ }
}
}
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));
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);
<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>
<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>
<attribute name="G" type="unsignedInt"> </attribute>
<attribute name="B" type="unsignedInt"> </attribute>
</complexType>
-</schema>
\ No newline at end of file
+
+</schema>