From ee534499c03e4f967e09e91701e7c386891f1ce9 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Tue, 29 Oct 2013 17:38:12 +0900 Subject: [PATCH] skin: no need to setRegion for entire pressed HW keys Change-Id: I47785ef2c690dc6048c877813bbbc2d0362fb477 Signed-off-by: GiWoong Kim --- .../org/tizen/emulator/skin/dbi/RegionType.java | 35 ++++++++++++++++++++-- .../org/tizen/emulator/skin/dbi/RgbType.java | 2 +- .../client/skins/mobile-320x480-1btn/default.dbi | 24 +++++++-------- .../client/skins/mobile-480x800-3btn/default.dbi | 24 +++++++-------- .../client/skins/mobile-540x960-3btn/default.dbi | 26 ++++++++-------- .../client/skins/mobile-600x1024-1btn/default.dbi | 24 +++++++-------- .../client/skins/mobile-720x1280-3btn/default.dbi | 24 +++++++-------- .../emulator/skin/custom/SpecialKeyWindow.java | 4 +-- .../src/org/tizen/emulator/skin/layout/HWKey.java | 10 +++---- .../skin/layout/ProfileSpecificSkinComposer.java | 4 +-- .../util/{SkinRegion.java => HWKeyRegion.java} | 24 +++++++++++---- .../src/org/tizen/emulator/skin/util/SkinUtil.java | 3 +- .../skin/client/xsd/ProfileSpecificSkin-layout.xsd | 1 + 13 files changed, 126 insertions(+), 79 deletions(-) rename tizen/src/skin/client/src/org/tizen/emulator/skin/util/{SkinRegion.java => HWKeyRegion.java} (75%) diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java index 8685466..9a6cd3a 100644 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java +++ b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RegionType.java @@ -1,4 +1,3 @@ -// /** * XML Binding * @@ -27,10 +26,11 @@ * */ +// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See http://java.sun.com/xml/jaxb // 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: 2013.10.29 at 04:58:23 PM KST // @@ -55,6 +55,7 @@ import javax.xml.bind.annotation.XmlType; * <attribute name="top" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="width" type="{http://www.w3.org/2001/XMLSchema}int" /> * <attribute name="height" type="{http://www.w3.org/2001/XMLSchema}int" /> + * <attribute name="update" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /> * </restriction> * </complexContent> * </complexType> @@ -74,6 +75,8 @@ public class RegionType { protected Integer width; @XmlAttribute(name = "height") protected Integer height; + @XmlAttribute(name = "update") + protected Boolean update; /** * Gets the value of the left property. @@ -171,4 +174,32 @@ public class RegionType { this.height = value; } + /** + * Gets the value of the update property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isUpdate() { + if (update == null) { + return false; + } else { + return update; + } + } + + /** + * Sets the value of the update property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setUpdate(Boolean value) { + this.update = value; + } + } diff --git a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java index 2225e78..3a6abf2 100644 --- a/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java +++ b/tizen/src/skin/client/jaxb_src/org/tizen/emulator/skin/dbi/RgbType.java @@ -1,4 +1,3 @@ -// /** * XML Binding * @@ -27,6 +26,7 @@ * */ +// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. diff --git a/tizen/src/skin/client/skins/mobile-320x480-1btn/default.dbi b/tizen/src/skin/client/skins/mobile-320x480-1btn/default.dbi index f1ce9ca..834c690 100644 --- a/tizen/src/skin/client/skins/mobile-320x480-1btn/default.dbi +++ b/tizen/src/skin/client/skins/mobile-320x480-1btn/default.dbi @@ -20,7 +20,7 @@ Home - + 116 Power @@ -28,7 +28,7 @@ Power - + 115 Volume + @@ -36,7 +36,7 @@ Volume + - + 114 Volume - @@ -63,7 +63,7 @@ Home - + 116 Power @@ -71,7 +71,7 @@ Power - + 115 Volume + @@ -79,7 +79,7 @@ Volume + - + 114 Volume - @@ -106,7 +106,7 @@ Home - + 116 Power @@ -114,7 +114,7 @@ Power - + 115 Volume + @@ -122,7 +122,7 @@ Volume + - + 114 Volume - @@ -149,7 +149,7 @@ Home - + 116 Power @@ -157,7 +157,7 @@ Power - + 115 Volume + @@ -165,7 +165,7 @@ Volume + - + 114 Volume - diff --git a/tizen/src/skin/client/skins/mobile-480x800-3btn/default.dbi b/tizen/src/skin/client/skins/mobile-480x800-3btn/default.dbi index 6b39a7b..2c560f9 100644 --- a/tizen/src/skin/client/skins/mobile-480x800-3btn/default.dbi +++ b/tizen/src/skin/client/skins/mobile-480x800-3btn/default.dbi @@ -36,7 +36,7 @@ Back - + 116 Power @@ -44,7 +44,7 @@ Power - + 115 Volume + @@ -52,7 +52,7 @@ Volume + - + 114 Volume - @@ -95,7 +95,7 @@ Back - + 116 Power @@ -103,7 +103,7 @@ Power - + 115 Volume + @@ -111,7 +111,7 @@ Volume + - + 114 Volume - @@ -154,7 +154,7 @@ Back - + 116 Power @@ -162,7 +162,7 @@ Power - + 115 Volume + @@ -170,7 +170,7 @@ Volume + - + 114 Volume - @@ -213,7 +213,7 @@ Back - + 116 Power @@ -221,7 +221,7 @@ Power - + 115 Volume + @@ -229,7 +229,7 @@ Volume + - + 114 Volume - diff --git a/tizen/src/skin/client/skins/mobile-540x960-3btn/default.dbi b/tizen/src/skin/client/skins/mobile-540x960-3btn/default.dbi index ba7af21..1d1fe21 100644 --- a/tizen/src/skin/client/skins/mobile-540x960-3btn/default.dbi +++ b/tizen/src/skin/client/skins/mobile-540x960-3btn/default.dbi @@ -1,6 +1,6 @@ - + @@ -36,7 +36,7 @@ Back - + 116 Power @@ -44,7 +44,7 @@ Power - + 115 Volume + @@ -52,7 +52,7 @@ Volume + - + 114 Volume - @@ -95,7 +95,7 @@ Back - + 116 Power @@ -103,7 +103,7 @@ Power - + 115 Volume + @@ -111,7 +111,7 @@ Volume + - + 114 Volume - @@ -154,7 +154,7 @@ Back - + 116 Power @@ -162,7 +162,7 @@ Power - + 115 Volume + @@ -170,7 +170,7 @@ Volume + - + 114 Volume - @@ -213,7 +213,7 @@ Back - + 116 Power @@ -221,7 +221,7 @@ Power - + 115 Volume + @@ -229,7 +229,7 @@ Volume + - + 114 Volume - diff --git a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi index c012813..2bf96a5 100644 --- a/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi +++ b/tizen/src/skin/client/skins/mobile-600x1024-1btn/default.dbi @@ -20,7 +20,7 @@ Home - + 116 Power @@ -28,7 +28,7 @@ Power - + 115 Volume + @@ -36,7 +36,7 @@ Volume + - + 114 Volume - @@ -63,7 +63,7 @@ Home - + 116 Power @@ -71,7 +71,7 @@ Power - + 115 Volume + @@ -79,7 +79,7 @@ Volume + - + 114 Volume - @@ -106,7 +106,7 @@ Home - + 116 Power @@ -114,7 +114,7 @@ Power - + 115 Volume + @@ -122,7 +122,7 @@ Volume + - + 114 Volume - @@ -149,7 +149,7 @@ Home - + 116 Power @@ -157,7 +157,7 @@ Power - + 115 Volume + @@ -165,7 +165,7 @@ Volume + - + 114 Volume - diff --git a/tizen/src/skin/client/skins/mobile-720x1280-3btn/default.dbi b/tizen/src/skin/client/skins/mobile-720x1280-3btn/default.dbi index 7c7187d..e9d9a7e 100644 --- a/tizen/src/skin/client/skins/mobile-720x1280-3btn/default.dbi +++ b/tizen/src/skin/client/skins/mobile-720x1280-3btn/default.dbi @@ -36,7 +36,7 @@ Back - + 116 Power @@ -44,7 +44,7 @@ Power - + 115 Volume + @@ -52,7 +52,7 @@ Volume + - + 114 Volume - @@ -95,7 +95,7 @@ Back - + 116 Power @@ -103,7 +103,7 @@ Power - + 115 Volume + @@ -111,7 +111,7 @@ Volume + - + 114 Volume - @@ -154,7 +154,7 @@ Back - + 116 Power @@ -162,7 +162,7 @@ Power - + 115 Volume + @@ -170,7 +170,7 @@ Volume + - + 114 Volume - @@ -213,7 +213,7 @@ Back - + 116 Power @@ -221,7 +221,7 @@ Power - + 115 Volume + @@ -229,7 +229,7 @@ Volume + - + 114 Volume - diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SpecialKeyWindow.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SpecialKeyWindow.java index 0cc657f..40b9fca 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SpecialKeyWindow.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/SpecialKeyWindow.java @@ -69,7 +69,7 @@ import org.tizen.emulator.skin.keywindow.dbi.RegionType; import org.tizen.emulator.skin.layout.HWKey; import org.tizen.emulator.skin.util.IOUtil; import org.tizen.emulator.skin.util.JaxbUtil; -import org.tizen.emulator.skin.util.SkinRegion; +import org.tizen.emulator.skin.util.HWKeyRegion; import org.tizen.emulator.skin.util.SkinUtil; import org.tizen.emulator.skin.util.SwtUtil; @@ -194,7 +194,7 @@ public class SpecialKeyWindow extends SkinWindow { HWKey hwKey = new HWKey( eventInfo.getKeyName(), eventInfo.getKeyCode(), - new SkinRegion(scaledX, scaledY, scaledWidth, scaledHeight), + new HWKeyRegion(scaledX, scaledY, scaledWidth, scaledHeight), keyEntry.getTooltip()); return hwKey; diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java index 257f476..23ba4ab 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/HWKey.java @@ -28,13 +28,13 @@ package org.tizen.emulator.skin.layout; -import org.tizen.emulator.skin.util.SkinRegion; +import org.tizen.emulator.skin.util.HWKeyRegion; import org.tizen.emulator.skin.util.SkinUtil; public class HWKey { private String name; private int keyCode; - private SkinRegion region; + private HWKeyRegion region; private String tooltip; /** @@ -45,7 +45,7 @@ public class HWKey { this.keyCode = SkinUtil.UNKNOWN_KEYCODE; } - public HWKey(String name, int keyCode, SkinRegion region, String tooltip) { + public HWKey(String name, int keyCode, HWKeyRegion region, String tooltip) { this.name = name; this.keyCode = keyCode; this.region = region; @@ -71,11 +71,11 @@ public class HWKey { } /* region */ - public SkinRegion getRegion() { + public HWKeyRegion getRegion() { return region; } - public void setRegion(SkinRegion region) { + public void setRegion(HWKeyRegion region) { this.region = region; } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java index 9abcc3f..afe649a 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java @@ -485,7 +485,7 @@ public class ProfileSpecificSkinComposer implements ISkinComposer { pressedHWKey.getRegion().width, pressedHWKey.getRegion().height, false); /* roll back HW key region */ - if (pressedHWKey.getKeyCode() != 101) { // TODO: not necessary for home key + if (pressedHWKey.getRegion().isNeedUpdate() == true) { SkinUtil.trimShell(shell, currentState.getCurrentImage(), pressedHWKey.getRegion().x, pressedHWKey.getRegion().y, pressedHWKey.getRegion().width, pressedHWKey.getRegion().height); @@ -529,7 +529,7 @@ public class ProfileSpecificSkinComposer implements ISkinComposer { hwKey.getRegion().width, hwKey.getRegion().height, false); /* set pressed HW key region */ - if (hwKey.getKeyCode() != 101) { // TODO: not necessary for home key + if (hwKey.getRegion().isNeedUpdate() == true) { SkinUtil.trimShell(shell, currentState.getCurrentKeyPressedImage(), hwKey.getRegion().x, hwKey.getRegion().y, hwKey.getRegion().width, hwKey.getRegion().height); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinRegion.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/HWKeyRegion.java similarity index 75% rename from tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinRegion.java rename to tizen/src/skin/client/src/org/tizen/emulator/skin/util/HWKeyRegion.java index 5c5d1dc..140d736 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinRegion.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/HWKeyRegion.java @@ -1,5 +1,5 @@ /** - * + * Hardware Key Region * * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * @@ -33,17 +33,31 @@ package org.tizen.emulator.skin.util; * * */ -public class SkinRegion { +public class HWKeyRegion { public int x; public int y; public int width; public int height; - - public SkinRegion( int x, int y, int width, int height ) { + private boolean update; + + public HWKeyRegion(int x, int y, int width, int height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + this.update = false; + } + + public HWKeyRegion(int x, int y, int width, int height, + boolean update) { this.x = x; this.y = y; this.width = width; this.height = height; + this.update = update; + } + + public boolean isNeedUpdate() { + return update; } - } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java index 308584c..1dc2170 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java @@ -175,7 +175,8 @@ public class SkinUtil { HWKey hwKey = new HWKey( eventInfo.getKeyName(), eventInfo.getKeyCode(), - new SkinRegion(scaledX, scaledY, scaledWidth, scaledHeight), + new HWKeyRegion(scaledX, scaledY, scaledWidth, scaledHeight, + keyEntry.getRegion().isUpdate()), keyEntry.getTooltip()); return hwKey; diff --git a/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd b/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd index 0c88f58..fdf541e 100644 --- a/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd +++ b/tizen/src/skin/client/xsd/ProfileSpecificSkin-layout.xsd @@ -78,6 +78,7 @@ xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified + -- 2.7.4