Meego Wiki
Views

SDK/Docs/Emulator Skin

From MeeGo wiki
< SDK | Docs
Revision as of 07:01, 7 April 2011 by Juntian (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to use MeeGo emulator

Qemu screen.jpg

1. Rotate the skin (F9): You can press this button to rotate the skin of the emulator.
2. Zoom in the emulator (F11): This button is for zooming in the emulator screen.
3. Zoom out the emulator (F12): This button is for zooming out the emulator screen.
4. Actual size of the screen (F8): This button recover the screen to actual size.
5. Power off the emulator (F7): Power off the emulator.

Configuration Skin

We provide a tool to manage the skin configuration for MeeGo target. You can list current resolution of the specified target and change the resolution to other predefined resolutions.

  • List the installed runtimes, you can change the resolution of the installed runtimes.
$ mad list
 Runtimes:
meego-handset-ia32-qemu-1.1.20110110.1026-runtime          (installable)
meego-handset-ia32-qemu-1.1.20110118.1010-runtime          (installable)
meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime      (installable)
meego-handset-ia32-w32-qemu-1.1.20101031.2201-sda-runtime  (installable)
meego-handset-ia32-qemu-1.1.90.3.20110215.10-runtime       (installable)
meego-netbook-ia32-qemu-1.1.20110110.1049-runtime          (installable)
meego-netbook-ia32-qemu-1.1.20110118.1020-runtime          (installable)
meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime      (installable)
meego-netbook-ia32-w32-qemu-1.1.20101031.2037-sda-runtime  (installable)
meego-tablet-ia32-qemu-1.1.90.8.20110322.1-sda-runtime     (installed)
meego-tablet-ia32-sdk-1.1.90.2.20110207.22-sda-runtime     (installed)
  • Display current resolution of the installed runtime, for example:
$ cd /usr/lib/madde/linux-i686/tools/qemu-meego/skin
$ ./setresolution -c -r meego-tablet-ia32-qemu-1.1.90.8.20110322.1-sda-runtime
  • Change the runtime to new resolution
$ ./setresolution -s 864x480 -r meego-tablet-ia32-qemu-1.1.90.8.20110322.1-sda-runtime


Make your own emulator skin

MeeGo emulator is based on QEMU with OpenGL, device skin & device simulation. It contains predefined configuration files for several MeeGo devices. You also can add devices by creating configuration files that specify the skin resources. Those basic elements of the skin resources could be included in the configuration file.

  • The screen background image, it display as the skin of the device. The image must be PNG format
  • The size of the area on which QEMU draws the OS screen, you need specify the position of the screen within the background image
  • If add buttons on the skin, you need specify the button image & the offset of the button image
  • If it supports keyboard, you also need configure the keyboard image, key value & offset, etc
  • In order to rotate the skin of the device, you should specify both the landscape and portrait parameters of the skin.

The graphics and settings for the device models are stored in the MeeGo emulator directory. The default skin path of MeeGo SDK is /opt/meego/qemu-gl/share/meego/skin. To add a new device, create a subfolder and put a <your device name>.xml file with skin resources into it. It is easiest to copy and modify one of the existing files.

The skin of MeeGo device is defined by XML file. This is a sample code of a very simple skin configuration file:

<root>
   <landscape>
       <skin width="1138" height="643"/>
       <bgcolor red="255" blue="255" green="255"/>
       <background image="background.png" posx="0" posy="50"/>
       <screen width="864" height="480" posx="134" posy="107"/>
       <button image="rotate.png" posx="10" posy="4" action="Rotate device (F9)" keycode="67"/> 
       <button image="plus.png" posx="55" posy="4" action="Emulator zoom in (F11)" keycode="87"/> 
       <button image="minus.png" posx="100" posy="4" action="Emulator zoom out (F12)" keycode="88"/> 
       <button image="actual.png" posx="145" posy="4" action="Emulator actual size (F8)" keycode="66"/> 
       <button image="poweroff.png" posx="190" posy="4" action="Emulator power off (F7)" keycode="65"/> 
   </landscape>
   <portrait>
       <skin width="602" height="1183"/>
       <bgcolor red="255" blue="255" green="255"/>
       <background image="background_p.png" posx="0" posy="50"/>
       <screen width="864" height="480" posx="63" posy="184"/>
       <button image="rotate.png" posx="10" posy="4" action="Rotate device (F9)" keycode="67"/> 
       <button image="plus.png" posx="55" posy="4" action="Emulator zoom in (F11)" keycode="87"/> 
       <button image="minus.png" posx="100" posy="4" action="Emulator zoom out (F12)" keycode="88"/> 
       <button image="actual.png" posx="145" posy="4" action="Emulator actual size (F8)" keycode="66"/> 
       <button image="poweroff.png" posx="190" posy="4" action="Emulator power off (F7)" keycode="65"/> 
   </portrait>
</root>

Qemu screen2.jpg

  • <root> </root>

The configuration file begin with a <root> label and end with a </root> label. All of the configurations include in a pair of root labels to describe the whole emulator window.

  • <landscape> </landscape> && <portrait> </portrait>

In order to support skin rotation, the configuration has landscape mode and portrait mode. The two kinds of configurations include in the different sections.

  • <skin width="1138" height="643"/>

This defines the skin width and height, it represent the window size of the emulator. If you don't define any buttons in the emulator window, the skin size is the same to the size of skin background image.

  • <bgcolor red="255" blue="255" green="255"/>

bgcolor defines the background color of the emulator, the color is defined by RGB value. This line means using white background color.

  • <background image="background.png" posx="0" posy="50"/>

background label specify the background image of the skin. posx and posy is the beginning coordinate of the skin image.

  • <screen width="864" height="480" posx="134" posy="107"/>

screen label defines the size and offset of the guest os display. The above line defines a 864x480 resolution screen of handset device. posx and posy are the offset coordinates of the emulator screen.

  • <button image="rotate.png" posx="10" posy="4" action="Rotate device (F9)" keycode="67"/>

This line defines a button for rotation. The button background image is rotate.png file, the offset of the button is (10,4), the keycode pass to the emulator is 67 and the shortcut for rotation is F9.

Personal tools