static unsigned int sdl_skip_update;
static unsigned int sdl_skip_count;
+
+static bool blank_guide_enable;
static unsigned int blank_cnt;
#define MAX_BLANK_FRAME_CNT 10
#define BLANK_GUIDE_IMAGE_PATH "../images/"
/* do nothing */
return;
} else if (blank_cnt == MAX_BLANK_FRAME_CNT) {
- /* draw guide image */
- INFO("draw a blank guide image\n");
-
- SDL_Surface *guide = get_blank_guide_image();
- if (guide != NULL && get_emul_skin_enable() == 1) {
- int dst_x = 0; int dst_y = 0;
- int dst_w = 0; int dst_h = 0;
-
- if (current_scale_factor != 1.0) {
- /* guide image scaling */
- SDL_Surface *scaled_guide = SDL_CreateRGBSurface(
- SDL_SWSURFACE,
- guide->w * current_scale_factor,
- guide->h * current_scale_factor,
- get_emul_sdl_bpp(),
- guide->format->Rmask, guide->format->Gmask,
- guide->format->Bmask, guide->format->Amask);
-
- scaled_guide = maru_do_pixman_scale(guide, scaled_guide);
-
- dst_w = scaled_guide->w;
- dst_h = scaled_guide->h;
- dst_x = (surface_screen->w - dst_w) / 2;
- dst_y = (surface_screen->h - dst_h) / 2;
- SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h };
-
- SDL_BlitSurface(scaled_guide, NULL,
- surface_screen, &dst_rect);
- SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
-
- SDL_FreeSurface(scaled_guide);
- } else {
- dst_w = guide->w;
- dst_h = guide->h;
- dst_x = (surface_screen->w - dst_w) / 2;
- dst_y = (surface_screen->h - dst_h) / 2;
- SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h };
-
- SDL_BlitSurface(guide, NULL,
- surface_screen, &dst_rect);
- SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
+ if (blank_guide_enable == true) {
+ INFO("draw a blank guide image\n");
+
+ SDL_Surface *guide = get_blank_guide_image();
+ if (guide != NULL && get_emul_skin_enable() == 1) {
+ /* draw guide image */
+ int dst_x = 0; int dst_y = 0;
+ int dst_w = 0; int dst_h = 0;
+
+ if (current_scale_factor != 1.0) {
+ /* guide image scaling */
+ SDL_Surface *scaled_guide = SDL_CreateRGBSurface(
+ SDL_SWSURFACE,
+ guide->w * current_scale_factor,
+ guide->h * current_scale_factor,
+ get_emul_sdl_bpp(),
+ guide->format->Rmask, guide->format->Gmask,
+ guide->format->Bmask, guide->format->Amask);
+
+ scaled_guide = maru_do_pixman_scale(guide, scaled_guide);
+
+ dst_w = scaled_guide->w;
+ dst_h = scaled_guide->h;
+ dst_x = (surface_screen->w - dst_w) / 2;
+ dst_y = (surface_screen->h - dst_h) / 2;
+ SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h };
+
+ SDL_BlitSurface(scaled_guide, NULL,
+ surface_screen, &dst_rect);
+ SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
+
+ SDL_FreeSurface(scaled_guide);
+ } else {
+ dst_w = guide->w;
+ dst_h = guide->h;
+ dst_x = (surface_screen->w - dst_w) / 2;
+ dst_y = (surface_screen->h - dst_h) / 2;
+ SDL_Rect dst_rect = { dst_x, dst_y, dst_w, dst_h };
+
+ SDL_BlitSurface(guide, NULL,
+ surface_screen, &dst_rect);
+ SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
+ }
}
}
} else if (blank_cnt == 0) {
{
gchar SDL_windowhack[32] = { 0, };
long window_id = swt_handle;
+ blank_guide_enable = blank_guide;
INFO("maru sdl init\n");
set_emul_sdl_bpp(SDL_BPP);
init_multi_touch_state();
+ if (blank_guide_enable == true) {
+ INFO("blank guide is on\n");
+ }
+
qemu_bh_schedule(sdl_init_bh);
}
static int shm_skip_update;
static int shm_skip_count;
+
+static bool blank_guide_enable;
static int blank_cnt;
#define MAX_BLANK_FRAME_CNT 10
/* do nothing */
return;
} else if (blank_cnt == MAX_BLANK_FRAME_CNT) {
- /* draw guide image */
- INFO("draw a blank guide image\n");
+ if (blank_guide_enable == true) {
+ INFO("draw a blank guide image\n");
- if (get_emul_skin_enable() == 1) {
- notify_draw_blank_guide();
+ if (get_emul_skin_enable() == 1) {
+ /* draw guide image */
+ notify_draw_blank_guide();
+ }
}
} else if (blank_cnt == 0) {
INFO("skipping of the display updating is started\n");
unsigned int display_width, unsigned int display_height,
bool blank_guide)
{
+ blank_guide_enable = blank_guide;
+
INFO("maru shm init\n");
set_emul_lcd_size(display_width, display_height);
set_emul_sdl_bpp(32);
+ if (blank_guide_enable == true) {
+ INFO("blank guide is on\n");
+ }
+
/* byte */
int shm_size =
get_emul_lcd_width() * get_emul_lcd_height() * 4;
--- /dev/null
+/**
+ * XML Binding
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.09.16 at 11:45:09 AM KST
+//
+
+
+package org.tizen.emulator.skin.dbi;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for blankGuideType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="blankGuideType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "blankGuideType")
+public class BlankGuideType {
+
+ @XmlAttribute(name = "visible")
+ protected Boolean visible;
+
+ /**
+ * Gets the value of the visible property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isVisible() {
+ if (visible == null) {
+ return true;
+ } else {
+ return visible;
+ }
+ }
+
+ /**
+ * Sets the value of the visible property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setVisible(Boolean value) {
+ this.visible = value;
+ }
+
+}
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2013.07.11 at 12:12:25 PM KST
+// Generated on: 2013.09.16 at 11:45:09 AM KST
//
* <element name="rotations" type="{http://www.tizen.org/emulator/skin/dbi}rotationsType"/>
* <element name="hover" type="{http://www.tizen.org/emulator/skin/dbi}hoverType" minOccurs="0"/>
* <element name="popupMenu" type="{http://www.tizen.org/emulator/skin/dbi}popupMenuType" minOccurs="0"/>
+ * <element name="option" type="{http://www.tizen.org/emulator/skin/dbi}optionType" minOccurs="0"/>
* </all>
* </restriction>
* </complexContent>
protected RotationsType rotations;
protected HoverType hover;
protected PopupMenuType popupMenu;
+ protected OptionType option;
/**
* Gets the value of the dbiVersion property.
this.popupMenu = value;
}
+ /**
+ * Gets the value of the option property.
+ *
+ * @return
+ * possible object is
+ * {@link OptionType }
+ *
+ */
+ public OptionType getOption() {
+ return option;
+ }
+
+ /**
+ * Sets the value of the option property.
+ *
+ * @param value
+ * allowed object is
+ * {@link OptionType }
+ *
+ */
+ public void setOption(OptionType value) {
+ this.option = value;
+ }
+
}
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2013.07.11 at 12:12:25 PM KST
+// Generated on: 2013.09.16 at 11:45:09 AM KST
//
return new PopupMenuType();
}
+ /**
+ * Create an instance of {@link OptionType }
+ *
+ */
+ public OptionType createOptionType() {
+ return new OptionType();
+ }
+
/**
* Create an instance of {@link EventInfoType }
*
return new DisplayType();
}
+ /**
+ * Create an instance of {@link BlankGuideType }
+ *
+ */
+ public BlankGuideType createBlankGuideType() {
+ return new BlankGuideType();
+ }
+
/**
* Create an instance of {@link MenuItemType }
*
--- /dev/null
+/**
+ * XML Binding
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.09.16 at 11:45:09 AM KST
+//
+
+
+package org.tizen.emulator.skin.dbi;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for optionType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="optionType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <all>
+ * <element name="blankGuide" type="{http://www.tizen.org/emulator/skin/dbi}blankGuideType" minOccurs="0"/>
+ * </all>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "optionType", propOrder = {
+
+})
+public class OptionType {
+
+ protected BlankGuideType blankGuide;
+
+ /**
+ * Gets the value of the blankGuide property.
+ *
+ * @return
+ * possible object is
+ * {@link BlankGuideType }
+ *
+ */
+ public BlankGuideType getBlankGuide() {
+ return blankGuide;
+ }
+
+ /**
+ * Sets the value of the blankGuide property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BlankGuideType }
+ *
+ */
+ public void setBlankGuide(BlankGuideType value) {
+ this.blankGuide = value;
+ }
+
+}
<keywindowItem visible="true" />
<shellItem visible="true" />
</popupMenu>
+ <option>
+ <blankGuide visible="true" />
+ </option>
</EmulatorUI>
/**
- *
+ * communticate with Qemu
*
* Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
import org.tizen.emulator.skin.comm.sock.data.StartData;
import org.tizen.emulator.skin.config.EmulatorConfig;
import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
+import org.tizen.emulator.skin.dbi.OptionType;
import org.tizen.emulator.skin.image.ImageRegistry.ResourceImageName;
import org.tizen.emulator.skin.log.SkinLogger;
import org.tizen.emulator.skin.util.IOUtil;
short rotation = EmulatorConfig.DEFAULT_WINDOW_ROTATION;
boolean isBlankGuide = true;
- // TODO:
+ OptionType option = config.getDbiContents().getOption();
+ if (option != null) {
+ isBlankGuide = (option.getBlankGuide() == null) ?
+ true : option.getBlankGuide().isVisible();
+ }
StartData startData = new StartData(initialData,
width, height, scale, rotation, isBlankGuide);
}
- private byte[] readData( DataInputStream is, int length ) throws IOException {
-
- if ( 0 >= length ) {
+ private byte[] readData(
+ DataInputStream is, int length) throws IOException {
+ if (0 >= length) {
return null;
}
- BufferedInputStream bfis = new BufferedInputStream( is, length );
+ BufferedInputStream bfis = new BufferedInputStream(is, length);
byte[] data = new byte[length];
int read = 0;
int total = 0;
- while ( true ) {
-
- if ( total == length ) {
+ while (true) {
+ if (total == length) {
break;
}
- read = bfis.read( data, total, length - total );
+ read = bfis.read(data, total, length - total);
- if ( 0 > read ) {
- if ( total < length ) {
+ if (0 > read) {
+ if (total < length) {
continue;
}
} else {
total += read;
}
-
}
- logger.info( "finished reading stream. read:" + total );
+ logger.info("finished reading stream. read:" + total);
return data;
-
}
private DataTranfer resetDataTransfer(final DataTranfer dataTransfer) {
timer.schedule(timerTask, dataTransfer.maxWaitTime + 1000);
return dataTransfer;
-
}
-
}
public synchronized DataTranfer sendDataToQEMU(
}
- public byte[] getReceivedData( DataTranfer dataTranfer ) {
-
+ public byte[] getReceivedData(DataTranfer dataTranfer) {
if (null == dataTranfer) {
return null;
}
synchronized (dataTranfer) {
-
int count = 0;
byte[] receivedData = null;
long sleep = dataTranfer.sleep;
long maxWaitTime = dataTranfer.maxWaitTime;
- int limitCount = (int) ( maxWaitTime / sleep );
+ int limitCount = (int) (maxWaitTime / sleep);
- while ( dataTranfer.isTransferState ) {
+ while (dataTranfer.isTransferState) {
+ if (limitCount < count) {
+ logger.severe("time out for receiving data from skin server.");
- if ( limitCount < count ) {
- logger.severe( "time out for receiving data from skin server." );
dataTranfer.receivedData = null;
break;
}
try {
- dataTranfer.wait( sleep );
- } catch ( InterruptedException e ) {
- logger.log( Level.SEVERE, e.getMessage(), e );
+ dataTranfer.wait(sleep);
+ } catch (InterruptedException e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
}
count++;
- logger.info( "wait data... count:" + count );
-
+ logger.info("wait data... count : " + count);
}
receivedData = dataTranfer.receivedData;
dataTranfer.receivedData = null;
return receivedData;
-
}
-
}
public Socket getSocket() {
skin.shutdown();
}
}
-
- public void resetSkin( EmulatorSkin skin ) {
- synchronized ( this ) {
- this.skin = skin;
- }
- }
-
}
class SkinSendData {
<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>
<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