Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# Customizing a Skin for QVFB

- Introduction
- Understanding the .skin File
  - Coordinates
  - defaultbuttons.conf
- Specifying Screen Size Independent of Skin

## Introduction

This document explains how to customize the QVFB skin for a specific project.

The virtual framebuffer is located in `$QTDIR/tools/qvfb`.

QVFB is a development tool only. No security issues have been considered in the virtual framebuffer design. It should not be used in a production environment and `QT_NO_QWS_VFB` should always be defined in production libraries.

## Understanding the .skin File

The `.skin` file consists of the following:

- it specifies 2 files, one for the "normal" skin and one for the "activated" skin.
- the next 2 lines specify the offset and size of the virtual screen.
- last comes the button definition. There is a number to specify how many buttons are available followed by the buttons. The format is name, keycode, coordinates.

### Coordinates

The coordinates are a list of at least 2 points in a clockwise order that define a shape for the button. Two points are treated as opposite edges of a rectangle. Any click inside the points will be treated as a click on that button. While pressed, the pixels for the button are redrawn from the "activated" skin.

You can examine `SmartPhone.skin` and `SmartPhone2.skin` in $QTDIR/tools/QVFB to get an idea of how it all works.

### defaultbuttons.conf

You can also include a `defaultbuttons.conf` file. This file customizes the launch screen applications and the ordering of the soft keys. There are also input method hints in this file.

## Specifying Screen Size Independent of Skin

QVFB allows the screen size to be specified independently of the skin. For example, you can use the SmartPhone.skin but specify a screen size of 240x320 pixels. The skin (if command-line arguments are used) or screen (if Configure is used) will be scaled accordingly. For example:

     QVFB -skin SmartPhone.skin -width 240 -height 320 -zoom 0.7

The above example uses the SmartPhone.skin (screen area 176x208 skin pixels) but with a 240x320 pixel virtual framebuffer (ie. what Qtopia draws to). The screen is scaled down by 0.7 resulting in a display that is a smooth-scaled 168x224 pixels.

Note that the SmartPhone.skin is 176x208, not 3:4 which means that 3:4 pixel screens are slightly distorted (but still pixel-correct).