skin: modified Key Window name & etc 37/10637/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 30 Sep 2013 08:57:05 +0000 (17:57 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 8 Oct 2013 06:12:27 +0000 (15:12 +0900)
KeyWindow -> GeneralKeyWindow

Change-Id: I9671a0980315f7c04e0a3b19a5d2ef021c672e3e
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
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/custom/GeneralKeyWindow.java [moved from tizen/src/skin/client/src/org/tizen/emulator/skin/custom/KeyWindow.java with 99% similarity]
tizen/src/skin/client/src/org/tizen/emulator/skin/image/ImageRegistry.java
tizen/src/skin/client/src/org/tizen/emulator/skin/info/SkinInformation.java
tizen/src/skin/client/src/org/tizen/emulator/skin/menu/KeyWindowKeeper.java
tizen/src/skin/client/src/org/tizen/emulator/skin/menu/PopupMenu.java
tizen/src/skin/client/xsd/dbi.xsd [deleted file]

index d4235b5..b39ee05 100755 (executable)
@@ -63,7 +63,6 @@ import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType;
 import org.tizen.emulator.skin.comm.ICommunicator.MouseButtonType;
@@ -246,7 +245,7 @@ public class EmulatorSkin {
 
                /* create and attach a popup menu */
                isOnKbd = false;
-               popupMenu = new PopupMenu(config, this, shell, imageRegistry);
+               popupMenu = new PopupMenu(config, this);
 
                getKeyWindowKeeper().determineLayout();
 
index bb18d39..ab111fc 100644 (file)
@@ -265,28 +265,10 @@ public class EmulatorSkinMain {
                                                new Thread(communicator, "communicator");
                                communicatorThread.start();
 
-//                             SkinReopenPolicy reopenPolicy = skin.open();
-//                             
-//                             while( true ) {
-//
-//                                     if( null != reopenPolicy ) {
-//                                             
-//                                             if( reopenPolicy.isReopen() ) {
-//                                                     
-//                                                     EmulatorSkin reopenSkin = reopenPolicy.getReopenSkin();
-//                                                     logger.info( "Reopen skin dialog." );
-//                                                     reopenPolicy = reopenSkin.open();
-//                                                     
-//                                             }else {
-//                                                     break;
-//                                             }
-//                                             
-//                                     }else {
-//                                             break;
-//                                     }
-//
-//                             }
-                               
+                               /* Moves the receiver to the top of the drawing order for
+                                the display on which it was created, marks it visible,
+                                sets the focus and asks the window manager to make the
+                                shell active */
                                skin.open();
                                
                        } else {
@@ -61,7 +61,7 @@ import org.tizen.emulator.skin.image.ImageRegistry.KeyWindowImageName;
 import org.tizen.emulator.skin.layout.SkinPatches;
 import org.tizen.emulator.skin.util.SwtUtil;
 
-public class KeyWindow extends SkinWindow {
+public class GeneralKeyWindow extends SkinWindow {
        private static final String PATCH_IMAGES_PATH = "images/key-window/";
        private static final int SHELL_MARGIN_BOTTOM = 3;
        private static final int PAIRTAG_CIRCLE_SIZE = 8;
@@ -96,12 +96,12 @@ public class KeyWindow extends SkinWindow {
        private boolean isGrabbedShell;
        private Point grabPosition;
 
-       public KeyWindow(EmulatorSkin skin, Shell parent,
+       public GeneralKeyWindow(EmulatorSkin skin, Shell parent,
                        SocketCommunicator communicator, List<KeyMapType> keyMapList) {
                super(parent, SWT.RIGHT | SWT.CENTER);
 
                this.skin = skin;
-               this.shell = new Shell(Display.getDefault(),
+               this.shell = new Shell(parent,
                                SWT.NO_TRIM | SWT.RESIZE | SWT.TOOL);
                this.frameMaker = new SkinPatches(PATCH_IMAGES_PATH);
 
index b74ea39..e659e35 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * image resources management
+ * Image Resource Management
  *
  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
@@ -155,6 +155,9 @@ public class ImageRegistry {
        private static ImageRegistry instance;
        private static boolean isInitialized;
 
+       /**
+        *  Constructor
+        */
        private ImageRegistry() {
                /* do nothing */
        }
@@ -382,7 +385,7 @@ public class ImageRegistry {
                        }
                }
 
-               /* key window image */
+               /* general key window image */
                if (null != keyWindowImageMap) {
                        images = keyWindowImageMap.values();
 
index c31f5f6..50c66fe 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ * Skin Information
  *
  * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
 
 package org.tizen.emulator.skin.info;
 
+import java.util.logging.Logger;
+
+import org.tizen.emulator.skin.log.SkinLogger;
+
 /*
  * 
  */
 public class SkinInformation {
+       private static Logger logger =
+                       SkinLogger.getSkinLogger(SkinInformation.class).getLogger();
+
        private String skinName;
        private String skinPath;
        private boolean isGeneralSkin;
@@ -45,6 +52,12 @@ public class SkinInformation {
                this.skinPath = skinPath;
                this.isGeneralSkin = isGeneralSkin;
                this.skinOption = 0;
+
+               if (isGeneralPurposeSkin() == true) {
+                       logger.info("This skin has a general purpose layout");
+               } else {
+                       logger.info("This skin has a profile specific layout");
+               }
        }
 
        public String getSkinName() {
@@ -58,7 +71,7 @@ public class SkinInformation {
        public boolean isGeneralPurposeSkin() {
                return isGeneralSkin;
        }
-       
+
        public int getSkinOption() {
                return skinOption;
        }
index aa7f0f7..113ccce 100644 (file)
@@ -34,7 +34,7 @@ import java.util.logging.Logger;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.MenuItem;
 import org.tizen.emulator.skin.EmulatorSkin;
-import org.tizen.emulator.skin.custom.KeyWindow;
+import org.tizen.emulator.skin.custom.GeneralKeyWindow;
 import org.tizen.emulator.skin.custom.SkinWindow;
 import org.tizen.emulator.skin.custom.SpecialKeyWindow;
 import org.tizen.emulator.skin.dbi.KeyMapType;
@@ -94,7 +94,7 @@ public class KeyWindowKeeper {
                                return;
                        }
 
-                       keyWindow = new KeyWindow(
+                       keyWindow = new GeneralKeyWindow(
                                        skin, skin.getShell(), skin.communicator, keyMapList);
                } else {
                        // TODO:
index 6f61e83..cce151e 100644 (file)
@@ -97,12 +97,11 @@ public class PopupMenu {
        /**
         *  Constructor
         */
-       public PopupMenu(EmulatorConfig config, EmulatorSkin skin,
-                       Shell shell, ImageRegistry imageRegistry) {
+       public PopupMenu(EmulatorConfig config, EmulatorSkin skin) {
                this.config = config;
                this.skin = skin;
-               this.shell = shell;
-               this.imageRegistry = imageRegistry;
+               this.shell = skin.getShell();
+               this.imageRegistry = skin.getImageRegistry();
 
                createMenu();
        }
@@ -199,6 +198,7 @@ public class PopupMenu {
 
                if (keywindowMenuType == null ||
                                (keywindowMenuType != null && keywindowMenuType.isVisible() == true)) {
+                       /* load Key Window layout */
                        String pathLayoutRoot = skin.skinInfo.getSkinPath() +
                                        File.separator + KEYWINDOW_LAYOUT_ROOT;
                        ArrayList<File> layouts = getKeyWindowLayoutList(pathLayoutRoot);
diff --git a/tizen/src/skin/client/xsd/dbi.xsd b/tizen/src/skin/client/xsd/dbi.xsd
deleted file mode 100644 (file)
index dec922b..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.tizen.org/emulator/skin/dbi"
-xmlns:dbi="http://www.tizen.org/emulator/skin/dbi" elementFormDefault="qualified">
-
-       <element name="EmulatorUI" >
-               <complexType>
-                       <all>
-                               <element name="dbi_version" type="float" minOccurs="1" maxOccurs="1"></element>
-                               <element name="rotations" type="dbi:rotationsType" minOccurs="1" maxOccurs="1"></element>
-                               <element name="hover" type="dbi:hoverType" minOccurs="0" maxOccurs="1"></element>
-                               <element name="popupMenu" type="dbi:popupMenuType" minOccurs="0" maxOccurs="1"></element>
-                               <element name="option" type="dbi:optionType" minOccurs="0" maxOccurs="1"></element>
-                       </all>
-               </complexType>
-       </element>
-
-       <complexType name="rotationsType">
-               <sequence>
-                       <element name="rotation" type="dbi:rotationType" minOccurs="1" maxOccurs="unbounded" ></element>
-               </sequence>
-       </complexType>
-
-       <complexType name="rotationType">
-               <sequence>
-                       <element name="display" type="dbi:displayType" minOccurs="1" maxOccurs="1"></element>
-                       <element name="imageList" type="dbi:imageListType" minOccurs="1" maxOccurs="1" ></element>
-                       <element name="keyMapList" type="dbi:keyMapListType" minOccurs="1" maxOccurs="1" ></element>
-               </sequence>
-               <attribute name="name" type="dbi:rotationNameType" use="required"></attribute>
-       </complexType>
-
-    <simpleType name="rotationNameType">
-        <restriction base="string">
-            <enumeration value="Portrait"></enumeration>
-            <enumeration value="Landscape"></enumeration>
-            <enumeration value="Reverse Portrait"></enumeration>
-            <enumeration value="Reverse Landscape"></enumeration>
-        </restriction>
-    </simpleType>
-
-       <complexType name="imageListType">
-               <all>
-                       <element name="mainImage" type="string" minOccurs="1" maxOccurs="1"></element>
-                       <element name="keyPressedImage" type="string" minOccurs="0" maxOccurs="1"></element>
-               </all>
-       </complexType>
-
-       <complexType name="displayType">
-               <all>
-                       <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"></element>
-               </all>
-               <attribute name="id" type="int" use="required"></attribute>
-       </complexType>
-
-       <complexType name="keyMapListType">
-               <sequence>
-                       <element name="keyMap" type="dbi:keyMapType" minOccurs="0" maxOccurs="unbounded"></element>
-               </sequence>
-       </complexType>
-
-       <complexType name="keyMapType">
-               <sequence>
-                       <element name="region" type="dbi:regionType" minOccurs="1" maxOccurs="1"></element>
-                       <element name="eventInfo" type="dbi:eventInfoType" minOccurs="0" maxOccurs="1"></element>
-                       <element name="tooltip" type="string" minOccurs="0" maxOccurs="1"></element>
-               </sequence>
-       </complexType>
-
-       <complexType name="eventInfoType">
-               <all>
-            <element name="keyCode" type="int" minOccurs="1" maxOccurs="1"></element>
-            <element name="keyName" type="string" minOccurs="1" maxOccurs="1"></element>
-               </all>
-       </complexType>
-
-       <complexType name="regionType">
-               <attribute name="left" type="int" ></attribute>
-               <attribute name="top" type="int" ></attribute>
-               <attribute name="width" type="int" ></attribute>
-               <attribute name="height" type="int" ></attribute>
-       </complexType>
-
-       <complexType name="hoverType">
-               <all>
-                       <element name="color" type="dbi:rgbType" minOccurs="0" maxOccurs="1"></element>
-               </all>
-       </complexType>
-
-       <complexType name="rgbType" >
-               <attribute name="R" type="unsignedInt"></attribute>
-               <attribute name="G" type="unsignedInt"></attribute>
-               <attribute name="B" type="unsignedInt"></attribute>
-       </complexType>
-
-       <complexType name="popupMenuType">
-               <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="keywindowItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"></element>
-                       <element name="shellItem" type="dbi:menuItemType" minOccurs="0" maxOccurs="1"></element>
-               </all>
-       </complexType>
-
-       <complexType name="menuItemType">
-               <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>
-               </all>
-       </complexType>
-
-       <complexType name="blankGuideType">
-               <attribute name="visible" type="boolean" default="true" use="optional"></attribute>
-       </complexType>
-</schema>
\ No newline at end of file