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;
/* create and attach a popup menu */
isOnKbd = false;
- popupMenu = new PopupMenu(config, this, shell, imageRegistry);
+ popupMenu = new PopupMenu(config, this);
getKeyWindowKeeper().determineLayout();
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 {
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;
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);
/**
- * image resources management
+ * Image Resource Management
*
* Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
private static ImageRegistry instance;
private static boolean isInitialized;
+ /**
+ * Constructor
+ */
private ImageRegistry() {
/* do nothing */
}
}
}
- /* key window image */
+ /* general key window image */
if (null != keyWindowImageMap) {
images = keyWindowImageMap.values();
/**
- *
+ * 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;
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() {
public boolean isGeneralPurposeSkin() {
return isGeneralSkin;
}
-
+
public int getSkinOption() {
return skinOption;
}
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;
return;
}
- keyWindow = new KeyWindow(
+ keyWindow = new GeneralKeyWindow(
skin, skin.getShell(), skin.communicator, keyMapList);
} else {
// TODO:
/**
* 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();
}
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);
+++ /dev/null
-<?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