}
}
- DisplayStateData lcdStateData = new DisplayStateData(
+ DisplayStateData stateData = new DisplayStateData(
currentState.getCurrentScale(),
currentState.getCurrentRotationId());
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
}
});
- DisplayStateData lcdStateData = new DisplayStateData(
+ DisplayStateData stateData = new DisplayStateData(
currentState.getCurrentScale(), rotationId);
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
}
});
- DisplayStateData lcdStateData = new DisplayStateData(scale,
+ DisplayStateData stateData = new DisplayStateData(scale,
currentState.getCurrentRotationId());
communicator.sendToQEMU(SendCommand.SEND_DISPLAY_STATE,
- lcdStateData, false);
+ stateData, false);
}
};
import org.tizen.emulator.skin.dbi.ImageListType;
import org.tizen.emulator.skin.dbi.RotationType;
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;
logger.info("get skin image from " + skinPath);
- RotationType targetRotation = SkinRotations.getRotation(id);
+ Rotation targetRotation = SkinRotations.getRotation(id);
if (targetRotation == null) {
return null;
}
package org.tizen.emulator.skin.layout;
-import org.tizen.emulator.skin.util.HWKeyRegion;
import org.tizen.emulator.skin.util.SkinUtil;
public class HWKey {
--- /dev/null
+/**
+ * Hardware Key Region
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * HyunJun Son
+ *
+ * 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
+ *
+ */
+
+package org.tizen.emulator.skin.layout;
+
+/**
+ *
+ *
+ */
+public class HWKeyRegion {
+ public int x;
+ public int y;
+ public int width;
+ public 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;
+ }
+}
import org.tizen.emulator.skin.custom.CustomProgressBar;
import org.tizen.emulator.skin.dbi.DisplayType;
import org.tizen.emulator.skin.dbi.RegionType;
-import org.tizen.emulator.skin.dbi.RotationType;
import org.tizen.emulator.skin.image.ImageRegistry.IconName;
import org.tizen.emulator.skin.image.ProfileSkinImageRegistry;
import org.tizen.emulator.skin.image.ProfileSkinImageRegistry.SkinImageType;
import org.tizen.emulator.skin.info.EmulatorSkinState;
+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.menu.KeyWindowKeeper;
import org.tizen.emulator.skin.menu.PopupMenu;
-import org.tizen.emulator.skin.util.HWKeyRegion;
import org.tizen.emulator.skin.util.SkinUtil;
import org.tizen.emulator.skin.util.SwtUtil;
Rectangle displayBounds = new Rectangle(0, 0, 0, 0);
float convertedScale = SkinUtil.convertScale(scale);
- RotationType rotation = SkinRotations.getRotation(rotationId);
+ Rotation rotation = SkinRotations.getRotation(rotationId);
if (rotation == null) {
return null;
}
}
final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y,
- currentState.getCurrentRotationId(), currentState.getCurrentScale());
+ currentState.getCurrentScale(),
+ currentState.getCurrentRotationId());
if (hwKey == null) {
shell.setToolTipText(null);
/* HW key handling */
final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y,
- currentState.getCurrentRotationId(), currentState.getCurrentScale());
+ currentState.getCurrentScale(),
+ currentState.getCurrentRotationId());
if (hwKey == null) {
logger.info("mouseDown in Skin : " + e.x + ", " + e.y);
package org.tizen.emulator.skin.layout.rotation;
+import java.util.List;
+
+import org.tizen.emulator.skin.dbi.KeyMapListType;
+import org.tizen.emulator.skin.dbi.KeyMapType;
import org.tizen.emulator.skin.dbi.RotationType;
public class Rotation extends RotationType {
private int angle;
+ private List<KeyMapType> listHWKey;
+
+ public int getAngle() {
+ return angle;
+ }
public void setAngle(int degree) {
this.angle = degree;
}
- public int getAngle() {
- return angle;
+ public List<KeyMapType> getListHWKey() {
+ if (listHWKey == null) {
+ KeyMapListType list = getKeyMapList();
+ if (list == null) {
+ /* try to using a KeyMapList of portrait */
+ Rotation rotation = SkinRotations.getRotation(SkinRotations.PORTRAIT_ID);
+ if (rotation == null) {
+ return null;
+ }
+
+ list = rotation.getKeyMapList();
+ if (list == null) {
+ return null;
+ }
+ }
+
+ listHWKey = list.getKeyMap();
+ }
+
+ return listHWKey;
}
}
import org.tizen.emulator.skin.keywindow.dbi.KeyWindowUI;
import org.tizen.emulator.skin.keywindow.dbi.RegionType;
import org.tizen.emulator.skin.layout.HWKey;
-import org.tizen.emulator.skin.util.HWKeyRegion;
+import org.tizen.emulator.skin.layout.HWKeyRegion;
import org.tizen.emulator.skin.util.IOUtil;
import org.tizen.emulator.skin.util.JaxbUtil;
import org.tizen.emulator.skin.util.SkinUtil;
+++ /dev/null
-/**
- * Hardware Key Region
- *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * HyunJun Son
- *
- * 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
- *
- */
-
-package org.tizen.emulator.skin.util;
-
-/**
- *
- *
- */
-public class HWKeyRegion {
- public int x;
- public int y;
- public int width;
- public 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;
- }
-}
import org.tizen.emulator.skin.config.EmulatorConfig;
import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
import org.tizen.emulator.skin.dbi.EventInfoType;
-import org.tizen.emulator.skin.dbi.KeyMapListType;
import org.tizen.emulator.skin.dbi.KeyMapType;
import org.tizen.emulator.skin.dbi.RegionType;
-import org.tizen.emulator.skin.dbi.RotationType;
import org.tizen.emulator.skin.layout.HWKey;
+import org.tizen.emulator.skin.layout.HWKeyRegion;
+import org.tizen.emulator.skin.layout.rotation.Rotation;
import org.tizen.emulator.skin.layout.rotation.SkinRotations;
import org.tizen.emulator.skin.log.SkinLogger;
}
public static List<KeyMapType> getHWKeyMapList(short rotationId) {
- RotationType rotation = SkinRotations.getRotation(rotationId);
+ Rotation rotation = SkinRotations.getRotation(rotationId);
if (rotation == null) {
return null;
}
- KeyMapListType list = rotation.getKeyMapList();
- if (list == null) {
- /* try to using a KeyMapList of portrait */
- rotation = SkinRotations.getRotation(SkinRotations.PORTRAIT_ID);
- if (rotation == null) {
- return null;
- }
-
- list = rotation.getKeyMapList();
- if (list == null) {
- return null;
- }
- }
-
- return list.getKeyMap();
+ return rotation.getListHWKey();
}
- public static HWKey getHWKey(
- int currentX, int currentY, short rotationId, int scale) {
+ public static HWKey getHWKey(int currentX, int currentY,
+ int scale, short rotationId) {
float convertedScale = convertScale(scale);
List<KeyMapType> keyMapList = getHWKeyMapList(rotationId);
return null;
}
+ RegionType region = null;
for (KeyMapType keyEntry : keyMapList) {
- RegionType region = keyEntry.getRegion();
+ region = keyEntry.getRegion();
int scaledX = (int) (region.getLeft() * convertedScale);
int scaledY = (int) (region.getTop() * convertedScale);