/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file.  Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/

/*!
    \page qt-embedded-running.html

    \title Running Qt for Embedded Linux Applications
    \ingroup qt-embedded

    A \l{Qt for Embedded Linux} application requires a server application to be
    running, or to be the server application itself. Any \l{Qt for Embedded Linux}
    application can be the server application by constructing the QApplication
    object with the QApplication::GuiServer type, or by running the application
    with the \c -qws command line option.

    Applications can run using both single and multiple displays, and
    various command line options are available.

    Note that this document assumes that you either are using the
    \l{The Virtual Framebuffer} or that you are running \l{Qt for Embedded Linux}
    using the \l {The VNC Protocol and Qt for Embedded Linux}{VNC} protocol,
    \e or that you have the Linux framebuffer configured
    correctly and that no server process is running. (To test that the
    Linux framebuffer is set up correctly, use the program provided by
    the \l {Testing the Linux Framebuffer} document.)

    \tableofcontents

    \section1 Using a Single Display

    To run the application using a single display, change to a Linux
    console and select an application to run, e.g. \l {Text
    Edit}{demos/textedit}.  Run the application with the \c -qws
    option:

    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 0

    \table 100%
    \row
    \o
    Provided that the environment variables are adjusted properly
    during the \l {Installing Qt for Embedded Linux}{installation process}, you
    should see the \l {Text Edit} demo appear.

    It might be that the hardware drivers must be specified explicitly
    to make everything work properly. For more information, please
    consult the following documentation:

    \list
        \o \l{Qt for Embedded Linux Pointer Handling}{Pointer Handling}
        \o \l{Qt for Embedded Linux Character Input}{Character Input}
        \o \l{Qt for Embedded Linux Display Management}{Display Management}
    \endlist

    \o
    \inlineimage qt-embedded-runningapplication.png
    \endtable

    Additional applications can be run as clients, i.e., by running
    these applications \e without the \c -qws option they will connect
    to the existing server as clients. You can exit the server
    application at any time using \gui{Ctrl+Alt+Backspace}.

    \section1 Using Multiple Displays

    Qt for Embedded Linux also allows multiple displays to be used
    simultaneously. There are two ways of achieving this: Either run
    multiple Qt for Embedded Linux server processes, or use the
    ready-made \c Multi screen driver.

    When running multiple server processes, the screen driver (and
    display number) must be specified for each process using the \c
    -display command line option or by setting the QWS_DISPLAY
    environment variable. For example:

    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 1

    See the \l {Qt for Embedded Linux Display Management}{display management}
    documentation for more details on how to specify a screen
    driver. Note that you must also specify the display (i.e., server
    process) when starting client applications:

    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 2

    There is no way of moving a client from one display to another
    when running multiple server processes. Using the \c Multi screen
    driver, on the other hand, applications can easiliy be moved
    between the various screens.

    The \c Multi screen driver can be specified just like any other
    screen driver by using the \c -display command line option or by
    setting the QWS_DISPLAY environment variable. For example:

    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 3

    See the \l {Qt for Embedded Linux Display Management}{display management}
    documentation for details regarding arguments.

    \section1 Command Line Options

    \table 100%
    \header
    \o Option \o Description
    \row
    \o \bold -fn <font>
    \o
    Defines the application font. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 4
    The font should be specified using an X logical font description.
    \row
    \o \bold -bg <color>
    \o
    Sets the default application background color. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 5
    The color-name must be one of the names recognized by the QColor constructor.
    \row
    \o \bold -btn <color> \o
    Sets the default button color. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 6
    The color-name must be one of the names recognized by the QColor constructor.
    \row
    \o \bold -fg <color> \o
    Sets the default application foreground color. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 7
    The color-name must be one of the names recognized by the QColor constructor.
    \row
    \o \bold -name <objectname> \o
    Sets the application name, i.e. the application object's object name. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 8
    \row
    \o \bold -title <title> \o
    Sets the application's title. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 9
    \row
    \o \bold -geometry <width>x<height>+<Xoffset>+<Yoffset> \o
    Sets the client geometry of the first window that is shown. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 10
    \row
    \o \bold -keyboard \o
    Enables the keyboard.

    See also: \l {Qt for Embedded Linux Character Input}.
    \row
    \o \bold -nokeyboard \o
    Disables the keyboard.
    \row
    \o \bold -mouse \o
    Enables the mouse cursor.

    See also: \l {Qt for Embedded Linux Pointer Handling}.
    \row
    \o \bold -nomouse \o
    Disables the mouse cursor.
    \row
    \o \bold -qws \o
    Runs the application as a server application, i.e. constructs a
    QApplication object of the QApplication::GuiServer type.
    \row
    \o \bold -display \o
    Specifies the screen driver.

    See also: \l {Qt for Embedded Linux Display Management}.
    \row
    \o \bold -decoration <style>\o
    Sets the application decoration. For example:
    \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 11
    The supported styles are \c windows, \c default and \c styled.

    See also QDecoration.

    \endtable
*/
