I added general skin dbi file.
And modified skin mode name. (default -> standard)
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorUI xmlns="http://www.tizen.org/emulator/skin/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <dbi version="2.0"/>
+ <rotations>
+ <rotation name="Portrait">
+ <lcd id="0">
+ <region height="800" left="35" top="86" width="480"/>
+ </lcd>
+ <imageList>
+ <mainImage>default_0.png</mainImage>
+ <keyPressedImage>default_0_p.png</keyPressedImage>
+ </imageList>
+ <keyMapList>
+ <keyMap>
+ <region height="74" left="238" top="887" width="74"/>
+ <eventInfo>
+ <keyCode>101</keyCode>
+ <keyName>HOME</keyName>
+ </eventInfo>
+ <tooltip>Home</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="74" left="541" top="819" width="20"/>
+ <eventInfo>
+ <keyCode>103</keyCode>
+ <keyName>POWER</keyName>
+ </eventInfo>
+ <tooltip>Power</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="74" left="541" top="81" width="20"/>
+ <eventInfo>
+ <keyCode>115</keyCode>
+ <keyName>VOLUME UP</keyName>
+ </eventInfo>
+ <tooltip>Volume-up</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="74" left="541" top="167" width="20"/>
+ <eventInfo>
+ <keyCode>114</keyCode>
+ <keyName>VOLUME DOWN</keyName>
+ </eventInfo>
+ <tooltip>Volume-down</tooltip>
+ </keyMap>
+ </keyMapList>
+ </rotation>
+ <rotation name="Landscape">
+ <lcd id="0">
+ <region height="480" left="86" top="46" width="800"/>
+ </lcd>
+ <imageList>
+ <mainImage>default_L90.png</mainImage>
+ <keyPressedImage>default_L90_p.png</keyPressedImage>
+ </imageList>
+ <keyMapList>
+ <keyMap>
+ <region height="74" left="887" top="249" width="74"/>
+ <eventInfo>
+ <keyCode>101</keyCode>
+ <keyName>HOME</keyName>
+ </eventInfo>
+ <tooltip>Home</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="20" left="818" top="2" width="74"/>
+ <eventInfo>
+ <keyCode>103</keyCode>
+ <keyName>POWER</keyName>
+ </eventInfo>
+ <tooltip>Power</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="20" left="80" top="2" width="74"/>
+ <eventInfo>
+ <keyCode>115</keyCode>
+ <keyName>VOLUME UP</keyName>
+ </eventInfo>
+ <tooltip>Volume-up</tooltip>
+ </keyMap>
+ <keyMap>
+ <region height="20" left="165" top="2" width="74"/>
+ <eventInfo>
+ <keyCode>114</keyCode>
+ <keyName></keyName>
+ </eventInfo>
+ <tooltip>Volume-down</tooltip>
+ </keyMap>
+ </keyMapList>
+ </rotation>
+ <rotation name="Reverse Portrait">
+ <lcd id="0">
+ <region left="46" top="89" width="480" height="800"/>
+ </lcd>
+ <imageList>
+ <mainImage>default_180.png</mainImage>
+ <keyPressedImage>default_180_p.png</keyPressedImage>
+ </imageList>
+ <keyMapList>
+ <keyMap>
+ <region left="249" top="14" width="74" height="74"/>
+ <eventInfo>
+ <keyCode>101</keyCode>
+ <keyName>HOME</keyName>
+ </eventInfo>
+ <tooltip>Home</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="2" top="84" width="20" height="74"/>
+ <eventInfo>
+ <keyCode>103</keyCode>
+ <keyName>POWER</keyName>
+ </eventInfo>
+ <tooltip>Power</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="2" top="821" width="20" height="74"/>
+ <eventInfo>
+ <keyCode>115</keyCode>
+ <keyName>VOLUME UP</keyName>
+ </eventInfo>
+ <tooltip>Volume-up</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="2" top="735" width="20" height="74"/>
+ <eventInfo>
+ <keyCode>114</keyCode>
+ <keyName>VOLUME DOWN</keyName>
+ </eventInfo>
+ <tooltip>Volume-down</tooltip>
+ </keyMap>
+ </keyMapList>
+ </rotation>
+ <rotation name="Reverse Landscape">
+ <lcd id="0">
+ <region left="90" top="35" width="800" height="480"/>
+ </lcd>
+ <imageList>
+ <mainImage>default_R90.png</mainImage>
+ <keyPressedImage>default_R90_p.png</keyPressedImage>
+ </imageList>
+ <keyMapList>
+ <keyMap>
+ <region left="15" top="239" width="74" height="74"/>
+ <eventInfo>
+ <keyCode>101</keyCode>
+ <keyName>HOME</keyName>
+ </eventInfo>
+ <tooltip>Home</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="84" top="539" width="74" height="20"/>
+ <eventInfo>
+ <keyCode>103</keyCode>
+ <keyName>POWER</keyName>
+ </eventInfo>
+ <tooltip>Power</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="822" top="539" width="74" height="20"/>
+ <eventInfo>
+ <keyCode>115</keyCode>
+ <keyName>VOLUME UP</keyName>
+ </eventInfo>
+ <tooltip>Volume-up</tooltip>
+ </keyMap>
+ <keyMap>
+ <region left="735" top="539" width="74" height="20"/>
+ <eventInfo>
+ <keyCode>114</keyCode>
+ <keyName>VOLUME DOWN</keyName>
+ </eventInfo>
+ <tooltip>Volume-down</tooltip>
+ </keyMap>
+ </keyMapList>
+ </rotation>
+ </rotations>
+ <colors>
+ <hoverColor B="255" G="255" R="255" />
+ </colors>
+</EmulatorUI>
final Menu menu = new Menu(shell, SWT.DROP_DOWN);
/* Control Panel menu */
- /*final MenuItem panelItem = new MenuItem(menu, SWT.PUSH);
+ final MenuItem panelItem = new MenuItem(menu, SWT.PUSH);
panelItem.setText("&Control Panel");
//panelItem.setImage(imageRegistry.getIcon(IconName.XXX));
panelItem.addSelectionListener(new SelectionAdapter() {
controlPanel = null;
}
}
- } );*/
+ } );
/* Screen shot menu */
final MenuItem screenshotItem = new MenuItem(menu, SWT.PUSH);
/* set emulator window config property */
String configPropFilePath = vmPath + File.separator + CONFIG_PROPERTIES_FILE_NAME;
- Properties configProperties = loadProperties( configPropFilePath, false );
+ Properties configProperties = loadProperties(configPropFilePath, false);
- // able to use log file after loading properties
- initLog( argsMap, configProperties );
+ /* able to use log file after loading properties */
+ initLog(argsMap, configProperties);
- EmulatorConfig.validateArgs( argsMap );
- EmulatorConfig.validateSkinProperties( skinProperties );
- EmulatorConfig.validateSkinConfigProperties( configProperties );
+ /* validation check */
+ EmulatorConfig.validateArgs(argsMap);
+ EmulatorConfig.validateSkinProperties(skinProperties);
+ EmulatorConfig.validateSkinConfigProperties(configProperties);
+ /* emulator resolution */
int resolutionW = Integer.parseInt(
argsMap.get(ArgsConstants.RESOLUTION_WIDTH));
int resolutionH = Integer.parseInt(
argsMap.get(ArgsConstants.RESOLUTION_HEIGHT));
+ /* get skin path from startup argument */
String argSkinPath = (String) argsMap.get(ArgsConstants.SKIN_PATH);
+ /* determine skin mode */
+ SkinMode skinMode = SkinMode.getValue(argsMap.get(ArgsConstants.SKIN_MODE));
+ logger.info("skin mode is " + skinMode);
+
/* load dbi file */
- EmulatorUI dbiContents = loadDbi(argSkinPath, resolutionW, resolutionH);
+ EmulatorUI dbiContents = loadDbi(argSkinPath, skinMode, resolutionW, resolutionH);
if ( null == dbiContents ) {
logger.severe( "Fail to load dbi file." );
/* load image resource */
ImageRegistry.getInstance().initialize(config);
+ /* load Always on Top value */
String onTopVal = config.getSkinProperty(
SkinPropertiesConstants.WINDOW_ONTOP, Boolean.FALSE.toString());
boolean isOnTop = Boolean.parseBoolean(onTopVal);
- /* determine skin mode */
- SkinMode skinMode = SkinMode.getValue(argsMap.get(ArgsConstants.SKIN_MODE));
- logger.info("skin mode is " + skinMode);
-
/* create skin */
EmulatorSkin skin;
if (SwtUtil.isMacPlatform()) {
}
- private static EmulatorUI loadDbi(String argSkinPath, int resolutionW, int resolutionH) {
+ private static EmulatorUI loadDbi(String argSkinPath, SkinMode skinMode,
+ int resolutionW, int resolutionH) {
String skinPath =
- ImageRegistry.getSkinPath(argSkinPath, resolutionW, resolutionH) +
+ ImageRegistry.getSkinPath(argSkinPath, skinMode, resolutionW, resolutionH) +
File.separator + DBI_FILE_NAME;
+ logger.info("load dbi file from " + skinPath);
FileInputStream fis = null;
EmulatorUI emulatorUI = null;
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;
this.display = Display.getDefault();
- int lcdWidth = config.getArgInt( ArgsConstants.RESOLUTION_WIDTH );
- int lcdHeight = config.getArgInt( ArgsConstants.RESOLUTION_HEIGHT );
- this.argSkinPath = config.getArg( ArgsConstants.SKIN_PATH );
+ int resolutionW = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
+ int resolutionH = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
+ this.argSkinPath = config.getArg(ArgsConstants.SKIN_PATH);
- this.resolutionWidth = lcdWidth;
- this.resolutionHeight = lcdHeight;
+ this.resolutionWidth = resolutionW;
+ this.resolutionHeight = resolutionH;
this.dbiContents = config.getDbiContents();
this.skinImageMap = new HashMap<String, Image>();
this.iconMap = new HashMap<String, Image>();
}
- public static String getSkinPath( String argSkinPath, int lcdWidth, int lcdHeight ) {
- String skinPath = ".." + File.separator + SKIN_FOLDER + File.separator +
- IMAGE_FOLDER_PREFIX + lcdWidth + "x" + lcdHeight;
-
- if ( argSkinPath == null ) {
- return skinPath;
+ public static String getSkinPath(String argSkinPath, SkinMode skinMode,
+ int resolutionX, int resolutionY) {
+ /* When emulator has a invalid skin path,
+ emulator uses default skin path instead of it */
+ String defaultSkinPath =
+ ".." + File.separator + SKIN_FOLDER + File.separator +
+ ((skinMode == SkinMode.GENERAL) ?
+ "emul-general" :
+ IMAGE_FOLDER_PREFIX + resolutionX + "x" + resolutionY);
+
+ if (argSkinPath == null) {
+ return defaultSkinPath;
}
- File f = new File( argSkinPath );
- if ( f.isDirectory() == false ) {
- return skinPath;
+ File f = new File(argSkinPath);
+ if (f.isDirectory() == false) {
+ return defaultSkinPath;
}
return argSkinPath;
return null;
}
- String skinPath = getSkinPath( argSkinPath, resolutionWidth, resolutionHeight );
+ String skinPath = getSkinPath(argSkinPath, null, resolutionWidth, resolutionHeight);
+ logger.info("get image data of skin from " + skinPath);
RotationType targetRotation = SkinRotation.getRotation( id );
public enum SkinMode {
GENERAL("general"),
FULLSCREEN("fullscreen"), /* not used yet */
- DEFAULT("default"),
+ STANDARD("standard"),
CUSTOM("custom"); /* not used yet */
private String value;
}
}
- return SkinMode.DEFAULT;
+ return SkinMode.STANDARD;
}
}
float convertedScale = convertScale(scale);
if (mode == SkinMode.GENERAL) {
- lcdCanvas.setBounds(0, 0,
- (int)(resolutionW * convertedScale),
- (int)(resolutionH * convertedScale));
+ /* resoultion, that is lcd size in general skin mode */
+ if (RotationInfo.LANDSCAPE == RotationInfo.getValue(rotationId) ||
+ RotationInfo.REVERSE_LANDSCAPE == RotationInfo.getValue(rotationId)) {
+ lcdCanvas.setBounds(0, 0,
+ (int)(resolutionH * convertedScale),
+ (int)(resolutionW * convertedScale));
+ } else {
+ lcdCanvas.setBounds(0, 0,
+ (int)(resolutionW * convertedScale),
+ (int)(resolutionH * convertedScale));
+ }
+
return;
}
- LcdType lcd = rotation.getLcd();
+ LcdType lcd = rotation.getLcd(); /* from dbi */
RegionType region = lcd.getRegion();
Integer left = region.getLeft();