/****************************************************************************
**
** 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-vnc.html
    \brief A guide to using Qt for Embedded Linux applications as VNC servers
    and clients.

    \title The VNC Protocol and Qt for Embedded Linux
    \ingroup qt-embedded

    VNC (Virtual Network Computing) software makes it possible to view
    and interact with one computer (the "server") from any other
    computer or mobile device (the "viewer") anywhere on a network.

    \image qt-embedded-vnc-screen.png

    VNC clients are available for a vast array of display systems, including
    X11, Mac OS X and Windows.

    \section1 Configuring Qt with VNC Capabilities

    To run a \l{Qt for Embedded Linux} application using the VNC protocol, the
    \l{Qt for Embedded Linux} library must be configured and compiled with the
    \c -qt-gfx-vnc option:

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

    \section1 Running a Server Application

    Start a server application by specifying the \c -qws command
    line option when running the application. (This can also be
    specified in the application's source code.)
    Use the \c -display command line option to specify the VNC server's
    driver and the virtual screen to use. For example:

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

    The application will act as a VNC server which can be accessed using
    an ordinary VNC client, either on the development machine or from a
    different machine on a network.

    For example, using the X11 VNC client to view the application from the
    same machine:

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

    To interact with the application from another machine on the network,
    run a VNC client pointing to the machine that is running the server
    application.

    \l{Qt for Embedded Linux} will create a 640 by 480 pixel display by
    default. Alternatively, the \c QWS_SIZE environment variable can be
    used to set another size; e.g., \c{QWS_SIZE=240x320}.

    \section1 Running Client Applications

    If you want to run more than one application on the same display, you
    only need to start the first one as a server application, using the
    \c -qws command line option to indicate that it will manage other
    windows.

    \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc Starting server

    Subsequent client applications can be started \e without the \c -qws
    option, but will each require the same \c -display option and argument
    as those used for the server.

    \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc Starting clients

    However, for the clients, this option will not cause a new VNC server
    to be started, but only indicates that their windows will appear on the
    virtual screen managed by the server application.

    \section1 Related Resources

    It is not always necessary to specify the \c -qws command line option
    when running a server application as long as the QApplication object
    used by the application has been constructed with the
    QApplication::GuiServer flag.

    See the \l{Running Qt for Embedded Linux Applications}{running applications}
    documentation for more details about server and client applications.

    \table
    \row
    \o \bold {The Virtual Framebuffer}

    The \l{The Virtual Framebuffer}{virtual framebuffer} is
    an alternative technique recommended for development and debugging
    purposes.

    The virtual framebuffer emulates a framebuffer using a shared
    memory region and the \c qvfb tool to display the framebuffer in a
    window.

    Its use of shared memory makes the virtual framebuffer much faster
    and smoother than using the VNC protocol, but it does not operate
    over a network.

    \o \inlineimage qt-embedded-virtualframebuffer.png
    \endtable
*/
