skin: added a folding button to general skin
authorgiwoong.kim <giwoong.kim@samsung.com>
Wed, 31 Oct 2012 10:42:57 +0000 (19:42 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 1 Nov 2012 02:44:01 +0000 (11:44 +0900)
Now, Emulator can foding a HW keys region in general skin.
And I coverted SkinMode class to SkinInformation class.

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java
tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java
tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java [new file with mode: 0644]
tizen/src/skin/client/src/org/tizen/emulator/skin/mode/SkinMode.java [deleted file]
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java

index e4bf4b5609985ffbe9761cc6c261e7be2295ba2c..3250a35d372d5b9dc873b539bea8177d39328ef3 100644 (file)
@@ -36,8 +36,8 @@ import org.eclipse.swt.SWT;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.exception.ScreenShotException;
 import org.tizen.emulator.skin.image.ImageRegistry.IconName;
+import org.tizen.emulator.skin.info.SkinInformation;
 import org.tizen.emulator.skin.log.SkinLogger;
-import org.tizen.emulator.skin.mode.SkinMode;
 import org.tizen.emulator.skin.screenshot.SdlScreenShotWindow;
 import org.tizen.emulator.skin.util.SkinUtil;
 import org.tizen.emulator.skin.util.SwtUtil;
@@ -49,8 +49,8 @@ public class EmulatorSdlSkin extends EmulatorSkin {
        /**
         *  Constructor
         */
-       public EmulatorSdlSkin(EmulatorConfig config, SkinMode mode, boolean isOnTop) {
-               super(config, mode, isOnTop);
+       public EmulatorSdlSkin(EmulatorConfig config, SkinInformation skinInfo, boolean isOnTop) {
+               super(config, skinInfo, isOnTop);
        }
 
        public long compose() {
index ea825dec99d528a328ee9f16ab7a4fec77a300bc..310344858dbda1e5387e67adeba9ecbfb15f3747 100644 (file)
@@ -42,8 +42,8 @@ import org.eclipse.swt.widgets.Display;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.exception.ScreenShotException;
 import org.tizen.emulator.skin.image.ImageRegistry.IconName;
+import org.tizen.emulator.skin.info.SkinInformation;
 import org.tizen.emulator.skin.log.SkinLogger;
-import org.tizen.emulator.skin.mode.SkinMode;
 import org.tizen.emulator.skin.screenshot.ShmScreenShotWindow;
 import org.tizen.emulator.skin.util.SkinUtil;
 
@@ -131,8 +131,8 @@ public class EmulatorShmSkin extends EmulatorSkin {
        /**
         *  Constructor
         */
-       public EmulatorShmSkin(EmulatorConfig config, SkinMode mode, boolean isOnTop) {
-               super(config, mode, isOnTop);
+       public EmulatorShmSkin(EmulatorConfig config, SkinInformation skinInfo, boolean isOnTop) {
+               super(config, skinInfo, isOnTop);
 
                this.paletteData = new PaletteData(RED_MASK, GREEN_MASK, BLUE_MASK);
        }
index aaae5f6839b66bded441430c2632891002e4c1a0..437a252bba70d3426d9c49750ae14e04f5132dc4 100644 (file)
@@ -103,8 +103,8 @@ import org.tizen.emulator.skin.dialog.RamdumpDialog;
 import org.tizen.emulator.skin.image.ImageRegistry;
 import org.tizen.emulator.skin.image.ImageRegistry.IconName;
 import org.tizen.emulator.skin.image.ImageRegistry.ImageType;
+import org.tizen.emulator.skin.info.SkinInformation;
 import org.tizen.emulator.skin.log.SkinLogger;
-import org.tizen.emulator.skin.mode.SkinMode;
 import org.tizen.emulator.skin.screenshot.ScreenShotDialog;
 import org.tizen.emulator.skin.util.SkinRegion;
 import org.tizen.emulator.skin.util.SkinRotation;
@@ -148,7 +148,7 @@ public class EmulatorSkin {
        protected Shell shell;
        protected ImageRegistry imageRegistry;
        protected Canvas lcdCanvas;
-       private SkinMode skinMode;
+       private SkinInformation skinInfo;
        private Image currentImage;
        private Image currentKeyPressedImage;
        private Color hoverColor;
@@ -175,6 +175,8 @@ public class EmulatorSkin {
        private SkinWindow controlPanel;
        protected ScreenShotDialog screenShotDialog;
        private Menu contextMenu;
+       private Button foldingButton; //TODO:
+       private Decorations decoration; //TODO:
 
        protected SocketCommunicator communicator;
        protected long windowHandleId;
@@ -203,9 +205,9 @@ public class EmulatorSkin {
         * @param config : configuration of emulator skin
         * @param isOnTop : always on top flag
        */
-       protected EmulatorSkin(EmulatorConfig config, SkinMode mode, boolean isOnTop) {
+       protected EmulatorSkin(EmulatorConfig config, SkinInformation skinInfo, boolean isOnTop) {
                this.config = config;
-               this.skinMode = mode;
+               this.skinInfo = skinInfo;
                this.isDefaultHoverColor = true;
                this.isOnTop = isOnTop;
                this.pressedKeyEventList = new LinkedList<KeyEventData>();
@@ -214,7 +216,7 @@ public class EmulatorSkin {
                this.pressedHWKeyCode = 0;
                
                int style = SWT.NO_TRIM;
-               if (skinMode == SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape() == false) {
                        style = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.BORDER;
                }
 
@@ -270,7 +272,7 @@ public class EmulatorSkin {
 
                arrangeSkin(resolutionW, resolutionH, scale, rotationId);
 
-               if (skinMode != SkinMode.GENERAL && null == currentImage) {
+               if (skinInfo.isPhoneShape() && null == currentImage) {
                        logger.severe("Failed to load initial skin image file. Kill this skin process.");
                        SkinUtil.openMessage(shell, null,
                                        "Failed to load Skin image file.", SWT.ICON_ERROR, config);
@@ -382,6 +384,11 @@ public class EmulatorSkin {
 
        }
 
+       private void rearrangeSkin() {
+               logger.info("rearrange the skin (" + skinInfo.getSkinOption() + ")");
+               arrangeSkin(currentLcdWidth, currentLcdHeight, currentScale, currentRotationId);
+       }
+
        private void arrangeSkin(int resolutionW, int resolutionH, int scale, short rotationId) {
 
                this.currentLcdWidth = resolutionW;
@@ -390,78 +397,103 @@ public class EmulatorSkin {
                this.currentRotationId = rotationId;
                this.currentAngle = SkinRotation.getAngle( rotationId );
 
-               if (skinMode == SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape() == false) {
                        /* folding button */
-                       Button foldingButton = new Button(shell, SWT.PUSH);
-                       foldingButton.setText(">");
+                       if (foldingButton == null) {
+                               foldingButton = new Button(shell, SWT.PUSH);
+                               foldingButton.setText(">");
+
+                               FormData dataFoldingButton = new FormData();
+                               dataFoldingButton.left = new FormAttachment(lcdCanvas, 0);
+                               dataFoldingButton.top = new FormAttachment(0, 0);
+                               foldingButton.setLayoutData(dataFoldingButton);
+
+                               foldingButton.addMouseListener(new MouseListener() {
+                                       @Override
+                                       public void mouseDown(MouseEvent e) {
+                                               /* do nothing */
+                                       }
 
-                       FormData dataFoldingButton = new FormData();
-                       dataFoldingButton.left = new FormAttachment(lcdCanvas, 0);
-                       dataFoldingButton.top = new FormAttachment(0, 0);
-                       foldingButton.setLayoutData(dataFoldingButton);
+                                       @Override
+                                       public void mouseUp(MouseEvent e) {
+                                               if (skinInfo.getSkinOption() == 0) {
+                                                       skinInfo.setSkinOption(1);
 
-                       foldingButton.addMouseListener(new MouseListener() {
-                               @Override
-                               public void mouseDown(MouseEvent e) {
-                                       /* do nothing */
-                               }
-
-                               @Override
-                               public void mouseUp(MouseEvent e) {
-                                       //TODO:
-                               }
+                                                       foldingButton.setText("<");
+                                               } else {
+                                                       skinInfo.setSkinOption(0);
 
-                               @Override
-                               public void mouseDoubleClick(MouseEvent e) {
-                                       /* do nothing */
-                               }
-                       });
-
-                       /* HW keys region */
-                       Decorations decoration = new Decorations(shell, SWT.BORDER);
-                       decoration.setLayout(new GridLayout(1, true));
-
-                       RotationType rotation = SkinRotation.getRotation(currentRotationId);
-                       List<KeyMapType> keyMapList = rotation.getKeyMapList().getKeyMap();
-
-                       // TODO: function
-                       if (keyMapList != null && keyMapList.isEmpty() == false) {
-                               for (KeyMapType keyEntry : keyMapList) {
-                                       Button hardKeyButton = new Button(decoration, SWT.FLAT);
-                                       hardKeyButton.setText(keyEntry.getEventInfo().getKeyName());
-                                       hardKeyButton.setToolTipText(keyEntry.getTooltip());
-
-                                       hardKeyButton.setLayoutData(new GridData(SWT.FILL,      SWT.FILL, true, false));
-
-                                       final int keycode = keyEntry.getEventInfo().getKeyCode();
-                                       hardKeyButton.addMouseListener(new MouseListener() {
-                                               @Override
-                                               public void mouseDown(MouseEvent e) {
-                                                       KeyEventData keyEventData = new KeyEventData(
-                                                                       KeyEventType.PRESSED.value(), keycode, 0, 0);
-                                                       communicator.sendToQEMU(SendCommand.SEND_HARD_KEY_EVENT, keyEventData);
+                                                       foldingButton.setText(">");
                                                }
 
-                                               @Override
-                                               public void mouseUp(MouseEvent e) {
-                                                       KeyEventData keyEventData = new KeyEventData(
-                                                                       KeyEventType.RELEASED.value(), keycode, 0, 0);
-                                                       communicator.sendToQEMU(SendCommand.SEND_HARD_KEY_EVENT,
-                                                                                       keyEventData);
-                                               }
+                                               shell.getDisplay().syncExec(new Runnable() {
+                                                       public void run() {
+                                                               rearrangeSkin();
+                                                       }
+                                               });
+                                       }
+
+                                       @Override
+                                       public void mouseDoubleClick(MouseEvent e) {
+                                               /* do nothing */
+                                       }
+                               });
+                       }
+
+                       if (skinInfo.getSkinOption() == 0) {
+                               /* HW keys region */
+                               if (decoration == null) {
+                                       decoration = new Decorations(shell, SWT.BORDER);
+                                       decoration.setLayout(new GridLayout(1, true));
+
+                                       RotationType rotation = SkinRotation.getRotation(currentRotationId);
+                                       List<KeyMapType> keyMapList = rotation.getKeyMapList().getKeyMap();
+
+                                       // TODO: function
+                                       if (keyMapList != null && keyMapList.isEmpty() == false) {
+                                               for (KeyMapType keyEntry : keyMapList) {
+                                                       Button hardKeyButton = new Button(decoration, SWT.FLAT);
+                                                       hardKeyButton.setText(keyEntry.getEventInfo().getKeyName());
+                                                       hardKeyButton.setToolTipText(keyEntry.getTooltip());
+
+                                                       hardKeyButton.setLayoutData(new GridData(SWT.FILL,      SWT.FILL, true, false));
+
+                                                       final int keycode = keyEntry.getEventInfo().getKeyCode();
+                                                       hardKeyButton.addMouseListener(new MouseListener() {
+                                                               @Override
+                                                               public void mouseDown(MouseEvent e) {
+                                                                       KeyEventData keyEventData = new KeyEventData(
+                                                                                       KeyEventType.PRESSED.value(), keycode, 0, 0);
+                                                                       communicator.sendToQEMU(SendCommand.SEND_HARD_KEY_EVENT, keyEventData);
+                                                               }
+
+                                                               @Override
+                                                               public void mouseUp(MouseEvent e) {
+                                                                       KeyEventData keyEventData = new KeyEventData(
+                                                                                       KeyEventType.RELEASED.value(), keycode, 0, 0);
+                                                                       communicator.sendToQEMU(SendCommand.SEND_HARD_KEY_EVENT, keyEventData);
+                                                               }
 
-                                               @Override
-                                               public void mouseDoubleClick(MouseEvent e) {
-                                                       /* do nothing */
+                                                               @Override
+                                                               public void mouseDoubleClick(MouseEvent e) {
+                                                                       /* do nothing */
+                                                               }
+                                                       });
                                                }
-                                       });
+                                       }
+
+                                       FormData dataDecoration = new FormData();
+                                       dataDecoration.left = new FormAttachment(foldingButton, 0);
+                                       dataDecoration.top = new FormAttachment(0, 0);
+                                       decoration.setLayoutData(dataDecoration);
+                               }
+                       } else {
+                               if (decoration != null) {
+                                       decoration.dispose();
+                                       decoration = null;
                                }
                        }
 
-                       FormData dataDecoration = new FormData();
-                       dataDecoration.left = new FormAttachment(foldingButton, 0);
-                       dataDecoration.top = new FormAttachment(0, 0);
-                       decoration.setLayoutData(dataDecoration);
                } else {
                        Image tempImage = null;
                        Image tempKeyPressedImage = null;
@@ -491,7 +523,7 @@ public class EmulatorSkin {
 
                /* arrange the lcd */
                SkinUtil.adjustLcdGeometry(lcdCanvas, currentLcdWidth, currentLcdHeight,
-                               scale, rotationId, skinMode);
+                               scale, rotationId, skinInfo.isPhoneShape());
 
                /* set window size */
                if (null != currentImage) {
@@ -589,7 +621,7 @@ public class EmulatorSkin {
                        }
                };
 
-               if (skinMode != SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape()) {
                        shell.addPaintListener(shellPaintListener);
                }
 
@@ -643,7 +675,7 @@ public class EmulatorSkin {
 
                };
 
-               if (skinMode != SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape()) {
                        shell.addMouseTrackListener(shellMouseTrackListener);
                }
 
@@ -709,7 +741,7 @@ public class EmulatorSkin {
                        } //end of mouseMove
                };
 
-               if (skinMode != SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape()) {
                        shell.addMouseMoveListener(shellMouseMoveListener);
                }
 
@@ -822,7 +854,7 @@ public class EmulatorSkin {
                        }
                };
 
-               if (skinMode != SkinMode.GENERAL) {
+               if (skinInfo.isPhoneShape()) {
                        shell.addMouseListener(shellMouseListener);
                }
 
index 1ea69d15bae3d8ece6d745c8630161c44dbe6705..b4b4a1390c90dd1683a9c940361545ebeebe2c74 100644 (file)
@@ -52,9 +52,9 @@ import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants;
 import org.tizen.emulator.skin.dbi.EmulatorUI;
 import org.tizen.emulator.skin.exception.JaxbException;
 import org.tizen.emulator.skin.image.ImageRegistry;
+import org.tizen.emulator.skin.info.SkinInformation;
 import org.tizen.emulator.skin.log.SkinLogger;
 import org.tizen.emulator.skin.log.SkinLogger.SkinLogLevel;
-import org.tizen.emulator.skin.mode.SkinMode;
 import org.tizen.emulator.skin.util.IOUtil;
 import org.tizen.emulator.skin.util.JaxbUtil;
 import org.tizen.emulator.skin.util.StringUtil;
@@ -116,19 +116,19 @@ public class EmulatorSkinMain {
                        Map<String, String> argsMap = parsArgs(args);
 
                        /* emulator resolution */
-                       int resolutionW = Integer.parseInt(
+                       /*int resolutionW = Integer.parseInt(
                                        argsMap.get(ArgsConstants.RESOLUTION_WIDTH));
                        int resolutionH = Integer.parseInt(
-                                       argsMap.get(ArgsConstants.RESOLUTION_HEIGHT));
+                                       argsMap.get(ArgsConstants.RESOLUTION_HEIGHT));*/
 
                        /* get skin path from startup argument */
                        String skinPath = ImageRegistry.getSkinPath(
-                                       (String) argsMap.get(ArgsConstants.SKIN_PATH), resolutionW, resolutionH);
+                                       (String) argsMap.get(ArgsConstants.SKIN_PATH));
 
                        /* set skin information */
                        String skinInfoFilePath = skinPath + File.separator + SKIN_INFO_FILE_NAME;
-                       Properties skinInfo = loadProperties(skinInfoFilePath, false);
-                       if (null == skinInfo) {
+                       Properties skinInfoProperties = loadProperties(skinInfoFilePath, false);
+                       if (null == skinInfoProperties) {
                                logger.severe("Fail to load skin information file.");
 
                                Shell temp = new Shell(Display.getDefault());
@@ -142,14 +142,18 @@ public class EmulatorSkinMain {
 
                                System.exit(-1);
                        } else {
-                               logger.info("skin info:" + skinInfo);
+                               logger.info("skin info:" + skinInfoProperties); //TODO:
                        }
 
-                       SkinMode skinMode = SkinMode.STANDARD;
-                       if (skinInfo.getProperty(SkinInfoConstants.RESOLUTION_WIDTH).equalsIgnoreCase("all") ||
-                                       skinInfo.getProperty(SkinInfoConstants.RESOLUTION_HEIGHT).equalsIgnoreCase("all")) {
-                               skinMode = SkinMode.GENERAL;
+                       boolean skinPhoneShape = true;
+                       String skinInfoResolutionW = skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_WIDTH);
+                       String skinInfoResolutionH = skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_HEIGHT);
+                       if (skinInfoResolutionW.equalsIgnoreCase("all") ||
+                                       skinInfoResolutionH.equalsIgnoreCase("all")) {
+                               skinPhoneShape = false;
                        }
+                       SkinInformation skinInfo = new SkinInformation(
+                                       skinInfoProperties.getProperty(SkinInfoConstants.SKIN_NAME), skinPhoneShape);
 
                        /* set emulator window skin property */
                        String skinPropFilePath = vmPath + File.separator + SKIN_PROPERTIES_FILE_NAME;
@@ -202,9 +206,9 @@ public class EmulatorSkinMain {
                        /* create skin */
                        EmulatorSkin skin;
                        if (SwtUtil.isMacPlatform()) {
-                               skin = new EmulatorShmSkin(config, skinMode, isOnTop);
+                               skin = new EmulatorShmSkin(config, skinInfo, isOnTop);
                        } else { // linux & windows
-                               skin = new EmulatorSdlSkin(config, skinMode, isOnTop);
+                               skin = new EmulatorSdlSkin(config, skinInfo, isOnTop);
                        }
 
                        long windowHandleId = skin.compose();
index 2eccc4c505bb4a7fcd3322ae578f2363a0e7b6ce..c90a041e51fa841c00480a39310b6e2ab7224cd4 100644 (file)
@@ -48,7 +48,6 @@ 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.log.SkinLogger;
-import org.tizen.emulator.skin.mode.SkinMode;
 import org.tizen.emulator.skin.util.IOUtil;
 import org.tizen.emulator.skin.util.SkinRotation;
 
@@ -151,8 +150,7 @@ public class ImageRegistry {
 
        }
 
-       public static String getSkinPath(String argSkinPath,
-                       int resolutionX, int resolutionY) {
+       public static String getSkinPath(String argSkinPath) {
                /* When emulator has a invalid skin path,
                 emulator uses default skin path instead of it */
                String defaultSkinPath = ".." + //TODO:
@@ -204,7 +202,7 @@ public class ImageRegistry {
                                return null;
                        }
 
-                       String skinPath = getSkinPath(argSkinPath, resolutionWidth, resolutionHeight);
+                       String skinPath = getSkinPath(argSkinPath);
                        logger.info("get image data of skin from " + skinPath);
 
                        RotationType targetRotation = SkinRotation.getRotation( id );
diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java
new file mode 100644 (file)
index 0000000..434ea15
--- /dev/null
@@ -0,0 +1,60 @@
+/**
+ * 
+ *
+ * Copyright (C) 2011 - 2012 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
+ *
+ */
+
+package org.tizen.emulator.skin.info;
+
+/*
+ * 
+ */
+public class SkinInformation {
+       private String skinName;
+       private boolean skinPhoneShape;
+       private int skinOption;
+
+       public SkinInformation(String skinName, boolean skinPhoneShape) {
+               this.skinName = skinName;
+               this.skinPhoneShape = skinPhoneShape;
+               this.skinOption = 0;
+       }
+
+       public String getSkinName() {
+               return skinName;
+       }
+
+       public boolean isPhoneShape() {
+               return skinPhoneShape;
+       }
+       
+       public int getSkinOption() {
+               return skinOption;
+       }
+
+       public void setSkinOption(int option) {
+               this.skinOption = option;
+       }
+}
diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/mode/SkinMode.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/mode/SkinMode.java
deleted file mode 100644 (file)
index a9dc104..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * 
- *
- * Copyright (C) 2011 - 2012 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
- *
- */
-
-package org.tizen.emulator.skin.mode;
-
-/**
- *
- */
-public enum SkinMode {
-       GENERAL("general"),
-       FULLSCREEN("fullscreen"), /* not used yet */
-       STANDARD("standard"),
-       CUSTOM("custom"); /* not used yet */
-
-       private String value;
-
-       SkinMode(String value) {
-               this.value = value;
-       }
-
-       public String value() {
-               return this.value;
-       }
-       
-       public static SkinMode getValue(String val) {
-               SkinMode[] values = SkinMode.values();
-               for (int i = 0; i < values.length; i++) {
-                       if (values[i].value.equalsIgnoreCase(val) == true) {
-                               return values[i];
-                       }
-               }
-
-               return SkinMode.STANDARD;
-       }
-}
-
index 02b1f08049e27a04212cc9e25081fadfc0292468..169ecc1ae400181b6a11d3dc360e2979d736fb40 100644 (file)
@@ -53,7 +53,6 @@ import org.tizen.emulator.skin.dbi.RegionType;
 import org.tizen.emulator.skin.dbi.RotationType;
 import org.tizen.emulator.skin.image.ImageRegistry;
 import org.tizen.emulator.skin.image.ImageRegistry.ImageType;
-import org.tizen.emulator.skin.mode.SkinMode;
 
 
 /**
@@ -113,12 +112,12 @@ public class SkinUtil {
 
        public static void adjustLcdGeometry(
                        Canvas lcdCanvas, int resolutionW, int resolutionH,
-                       int scale, short rotationId, SkinMode mode) {
+                       int scale, short rotationId, boolean isPhoneShape) {
 
                float convertedScale = convertScale(scale);
                int l = 0, t = 0, w = 0, h = 0;
 
-               if (mode == SkinMode.GENERAL) {
+               if (isPhoneShape == false) {
                        RotationInfo rotation = RotationInfo.getValue(rotationId);
 
                        /* resoultion, that is lcd size in general skin mode */