public long initLayout() {
imageRegistry = ImageRegistry.getInstance();
+ /* set emulator states */
+ currentState.setCurrentResolutionWidth(
+ config.getArgInt(ArgsConstants.RESOLUTION_WIDTH));
+ currentState.setCurrentResolutionHeight(
+ config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT));
+
+ int scale = SkinUtil.getValidScale(config);
+ currentState.setCurrentScale(scale);
+
+ short rotationId = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
+ currentState.setCurrentRotationId(rotationId);
+ currentState.setCurrentAngle(SkinRotation.getAngle(rotationId));
+
/* create and attach a popup menu */
isOnKbd = false;
popupMenu = new PopupMenu(config, this, shell, imageRegistry);
*
*/
public class ImageRegistry {
- public static final String GENERAL_FOLDER = "emul-general-3btn";
public static final String ICON_FOLDER = "icons";
public static final String IMAGES_FOLDER = "images";
public static final String KEYWINDOW_FOLDER = "key-window";
int vmIndex =
config.getArgInt(ArgsConstants.VM_BASE_PORT) % 100;
-
int x = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_X,
EmulatorConfig.DEFAULT_WINDOW_X + vmIndex);
int y = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_Y,
EmulatorConfig.DEFAULT_WINDOW_Y + vmIndex);
- currentState.setCurrentResolutionWidth(
- config.getArgInt(ArgsConstants.RESOLUTION_WIDTH));
- currentState.setCurrentResolutionHeight(
- config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT));
-
- int scale = SkinUtil.getValidScale(config);
- short rotationId = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
+ int scale = currentState.getCurrentScale();
+ short rotationId = currentState.getCurrentRotationId();
composeInternal(displayCanvas, x, y, scale, rotationId);
logger.info("resolution : " + currentState.getCurrentResolution() +
public Canvas compose(int style) {
lcdCanvas = new Canvas(shell, style);
+ int vmIndex =
+ config.getArgInt(ArgsConstants.VM_BASE_PORT) % 100;
int x = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_X,
- EmulatorConfig.DEFAULT_WINDOW_X);
+ EmulatorConfig.DEFAULT_WINDOW_X + vmIndex);
int y = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_Y,
- EmulatorConfig.DEFAULT_WINDOW_Y);
-
- currentState.setCurrentResolutionWidth(
- config.getArgInt(ArgsConstants.RESOLUTION_WIDTH));
- currentState.setCurrentResolutionHeight(
- config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT));
-
- int scale = SkinUtil.getValidScale(config);
-// int rotationId = config.getPropertyShort( PropertiesConstants.WINDOW_ROTATION,
-// EmulatorConfig.DEFAULT_WINDOW_ROTATION );
- // has to be portrait mode at first booting time
- short rotationId = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
+ EmulatorConfig.DEFAULT_WINDOW_Y + vmIndex);
+
+ int scale = currentState.getCurrentScale();
+ short rotationId = currentState.getCurrentRotationId();
composeInternal(lcdCanvas, x, y, scale, rotationId);
logger.info("resolution : " + currentState.getCurrentResolution() +