}
void maruskin_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height)
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide)
{
#ifndef CONFIG_USE_SHM
- maruskin_sdl_init(swt_handle, lcd_size_width, lcd_size_height);
+ maruskin_sdl_init(swt_handle,
+ display_width, display_height, blank_guide);
#else
- maruskin_shm_init(swt_handle, lcd_size_width, lcd_size_height);
+ maruskin_shm_init(swt_handle,
+ display_width, display_height, blank_guide);
#endif
}
void maru_display_init(DisplayState *ds);
void maru_display_fini(void);
void maruskin_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height);
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide);
MaruScreenshot *get_maru_screenshot(void);
void set_maru_screenshot(DisplaySurface *surface);
}
void maruskin_sdl_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height)
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide)
{
gchar SDL_windowhack[32] = { 0, };
long window_id = swt_handle;
INFO("register SDL environment variable. "
"(SDL_WINDOWID = %s)\n", SDL_windowhack);
- set_emul_lcd_size(lcd_size_width, lcd_size_height);
+ set_emul_lcd_size(display_width, display_height);
set_emul_sdl_bpp(SDL_BPP);
init_multi_touch_state();
extern DisplayChangeListenerOps maru_dcl_ops;
void maruskin_sdl_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height);
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide);
void maruskin_sdl_resize(void);
void maruskin_sdl_quit(void);
};
void maruskin_shm_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height)
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide)
{
INFO("maru shm init\n");
- set_emul_lcd_size(lcd_size_width, lcd_size_height);
+ set_emul_lcd_size(display_width, display_height);
set_emul_sdl_bpp(32);
/* byte */
extern DisplayChangeListenerOps maru_dcl_ops;
void maruskin_shm_init(uint64 swt_handle,
- int lcd_size_width, int lcd_size_height);
+ unsigned int display_width, unsigned int display_height,
+ bool blank_guide);
void maruskin_shm_resize(void);
void maruskin_shm_quit(void);
int answer = SkinUtil.openMessage(shell, null,
"If you force stop an emulator, it may cause some problems.\n"
- + "Are you sure you want to contiue?",
+ + "Are you sure you want to continue?",
SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL, config);
if (answer == SWT.OK) {
try {
dis = new DataInputStream(socket.getInputStream());
dos = new DataOutputStream(socket.getOutputStream());
-
- sendThread.setDaemon(true);
- sendThread.start();
-
- int width = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
- int height = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
- int scale = SkinUtil.getValidScale(config);
-// short rotation = config.getSkinPropertyShort( SkinPropertiesConstants.WINDOW_ROTATION,
-// EmulatorConfig.DEFAULT_WINDOW_ROTATION );
- // has to be portrait mode at first booting time
- short rotation = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
-
- StartData startData =
- new StartData(initialData, width, height, scale, rotation);
- logger.info("StartData" + startData);
-
- sendToQEMU(SendCommand.SEND_START, startData, false);
-
} catch (IOException e) {
logger.log(Level.SEVERE, e.getMessage(), e);
terminate();
return;
}
+ sendThread.setDaemon(true);
+ sendThread.start();
+
+ int width = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
+ int height = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
+ int scale = SkinUtil.getValidScale(config);
+ short rotation = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
+
+ boolean isBlankGuide = true;
+ // TODO:
+
+ StartData startData = new StartData(initialData,
+ width, height, scale, rotation, isBlankGuide);
+ logger.info("" + startData);
+
+ sendToQEMU(SendCommand.SEND_START, startData, false);
+
boolean ignoreHeartbeat =
config.getArgBoolean(ArgsConstants.HEART_BEAT_IGNORE);
/**
- *
+ * initial data for Qemu
*
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* GiWoong Kim <giwoong.kim@samsung.com>
*
*/
public class StartData extends AbstractSendData {
-
private long windowHandleId;
- private int lcdSizeWidth;
- private int lcdSizeHeight;
+ private int displayWidth;
+ private int displayHeight;
private int scale;
private short rotation;
+ private boolean isBlankGuide;
- public StartData(long windowHandleId, int lcdSizeWidth, int lcdSizeHeight, int scale, short rotation ) {
+ public StartData(long windowHandleId,
+ int displayWidth, int displayHeight, int scale, short rotation,
+ boolean isBlankGuide) {
this.windowHandleId = windowHandleId;
- this.lcdSizeWidth = lcdSizeWidth;
- this.lcdSizeHeight = lcdSizeHeight;
+ this.displayWidth = displayWidth;
+ this.displayHeight = displayHeight;
this.scale = scale;
this.rotation = rotation;
+ this.isBlankGuide = isBlankGuide;
}
@Override
protected void write() throws IOException {
- writeLong( windowHandleId );
- writeInt( lcdSizeWidth );
- writeInt( lcdSizeHeight );
- writeInt( scale );
- writeShort( rotation );
+ writeLong(windowHandleId);
+ writeInt(displayWidth);
+ writeInt(displayHeight);
+ writeInt(scale);
+ writeShort(rotation);
+
+ if (isBlankGuide == true) {
+ writeShort(1);
+ } else {
+ writeShort(0);
+ }
}
@Override
StringBuilder builder = new StringBuilder();
builder.append("StartData [windowHandleId=");
builder.append(windowHandleId);
- builder.append(", lcd size " + lcdSizeWidth +"x" + lcdSizeHeight);
+ builder.append(", display size " + displayWidth + "x" + displayHeight);
builder.append(", scale=");
builder.append(scale);
builder.append(", rotation=");
builder.append(rotation);
+ builder.append(", blank guide=");
+ builder.append(isBlankGuide);
builder.append("]");
return builder.toString();
}
/* attach HW keys */
if (keyMapList != null && keyMapList.isEmpty() == false) {
for (KeyMapType keyEntry : keyMapList) {
- CustomButton HWKeyButton = new CustomButton(composite,
+ final CustomButton HWKeyButton = new CustomButton(composite,
SWT.NO_FOCUS, imageNormal, imageHover, imagePushed);
HWKeyButton.setText(keyEntry.getEventInfo().getKeyName());
HWKeyButton.setToolTipText(keyEntry.getTooltip());
HWKeyButton.addMouseListener(new MouseListener() {
@Override
public void mouseDown(MouseEvent e) {
+ logger.info(HWKeyButton.getText() + " key is pressed");
+
KeyEventData keyEventData = new KeyEventData(
KeyEventType.PRESSED.value(), keycode, 0, 0);
communicator.sendToQEMU(
@Override
public void mouseUp(MouseEvent e) {
+ logger.info(HWKeyButton.getText() + " key is released");
+
KeyEventData keyEventData = new KeyEventData(
KeyEventType.RELEASED.value(), keycode, 0, 0);
communicator.sendToQEMU(
void start_display(uint64 handle_id,
- int lcd_size_width, int lcd_size_height,
- double scale_factor, short rotation_type)
+ unsigned int display_width, unsigned int display_height,
+ double scale_factor, short rotation_type, bool blank_guide)
{
- INFO("start_display handle_id:%ld, display size:%dx%d, \
-scale_factor:%f, rotation_type:%d\n",
- (long) handle_id, lcd_size_width, lcd_size_height,
- scale_factor, rotation_type);
+ INFO("start display : handle_id=%ld, display size=%dx%d, "
+ "scale factor=%f, rotation=%d, blank guide=%d\n",
+ (long) handle_id, display_width, display_height,
+ scale_factor, rotation_type, blank_guide);
set_emul_win_scale(scale_factor);
- maruskin_init(handle_id, lcd_size_width, lcd_size_height);
+ maruskin_init(handle_id,
+ display_width, display_height, blank_guide);
}
void do_mouse_event(int button_type, int event_type,
};
typedef struct DetailInfo DetailInfo;
-void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height,
- double scale_factor, short rotation_type);
+void start_display(uint64 handle_id,
+ unsigned int display_width, unsigned int display_height,
+ double scale_factor, short rotation_type, bool blank_guide);
void do_mouse_event(int button_type, int event_type,
int origin_x, int origin_y, int x, int y, int z);
}
- switch ( cmd ) {
+ switch (cmd) {
case RECV_START: {
- log_cnt += sprintf( log_buf + log_cnt, "RECV_START ==\n" );
- INFO( log_buf );
+ log_cnt += sprintf(log_buf + log_cnt, "RECV_START ==\n");
+ INFO(log_buf);
- if ( 0 >= length ) {
- ERR( "there is no data looking at 0 length." );
+ if (0 >= length) {
+ ERR("there is no data looking at 0 length.");
continue;
}
/* keep it consistent with emulator-skin definition */
uint64 handle_id = 0;
- int lcd_size_width = 0;
- int lcd_size_height = 0;
+ int display_width = 0;
+ int display_height = 0;
int scale = 0;
double scale_ratio = 0.0;
short rotation = 0;
+ short blank_guide = 0;
char* p = recvbuf;
- memcpy( &handle_id, p, sizeof( handle_id ) );
- p += sizeof( handle_id );
- memcpy( &lcd_size_width, p, sizeof( lcd_size_width ) );
- p += sizeof( lcd_size_width );
- memcpy( &lcd_size_height, p, sizeof( lcd_size_height ) );
- p += sizeof( lcd_size_height );
- memcpy( &scale, p, sizeof( scale ) );
- p += sizeof( scale );
- memcpy( &rotation, p, sizeof( rotation ) );
+ memcpy(&handle_id, p, sizeof(handle_id));
+ p += sizeof(handle_id);
+ memcpy(&display_width, p, sizeof(display_width));
+ p += sizeof(display_width);
+ memcpy(&display_height, p, sizeof(display_height));
+ p += sizeof(display_height);
+ memcpy(&scale, p, sizeof(scale));
+ p += sizeof(scale);
+ memcpy(&rotation, p, sizeof(rotation));
+ p += sizeof(rotation);
+ memcpy(&blank_guide, p, sizeof(blank_guide));
int low_id = (int)handle_id;
int high_id = (int)(handle_id >> 32);
handle_id = high_id;
handle_id = (handle_id << 32) | low_id;
- lcd_size_width = ntohl( lcd_size_width );
- lcd_size_height = ntohl( lcd_size_height );
- scale = ntohl( scale );
- scale_ratio = ( (double) scale ) / 100;
- rotation = ntohs( rotation );
+ display_width = ntohl(display_width);
+ display_height = ntohl(display_height);
+ scale = ntohl(scale);
+ scale_ratio = ((double) scale) / 100;
+ rotation = ntohs(rotation);
+ blank_guide = ntohs(blank_guide);
- set_emul_win_scale( scale_ratio );
+ set_emul_win_scale(scale_ratio);
- start_display( handle_id, lcd_size_width, lcd_size_height, scale_ratio, rotation );
+ start_display(handle_id,
+ display_width, display_height, scale_ratio, rotation,
+ (blank_guide == 1) ? true : false);
break;
}