/*! 
    \page qaxserver-demo-opengl.html

    \title OpenGL in an HTML page

    \input examples/activeqt/opengl-demo.qdocinc
*/

/*!
    \example activeqt/opengl
    \title OpenGL Example (ActiveQt)

    The OpenGL example demonstrates the use of the default factory
    and  QAxFactory::isServer(), and the implementation of an
    additional COM interface using QAxBindable and QAxAggregated.
    The server executable  can run both as an ActiveX server and as a
    stand-alone application.

    The ActiveX control in this example uses the QGlWidget class in
    Qt to render an OpenGL scene in an ActiveX. The control exposes a few
    methods to change the scene.

    \quotefromfile activeqt/opengl/main.cpp
    \skipto <QAxFactory>
    The application uses the default factory as provided by the 
    QAXFACTORY_DEFAULT macro to expose the \c GLBox widget as an ActiveX 
    control.
    \printto /*
    The implementation of \c main initializes the QApplication object,
    and uses \c QAxFactory::isServer() to determine whether or not it is
    appropriate to create and show the application interface.
    \printuntil return a.
    \printuntil return a.
    \printuntil }

    \quotefromfile activeqt/opengl/glbox.h
    \skipuntil #include
    The \c GLBox class inherits from both the \l QGLWidget class to be able
    to render OpenGL, and from \l QAxBindable.
    \printuntil Q_OBJECT
    The class reimplements the \l QAxBindable::createAggregate() function from QAxBindable
    to return the pointer to a \l QAxAggregated object.
    \printuntil setXRotation
    The rest of the class declaration and the implementation of the OpenGL
    rendering is identical to the original "box" example.

    \quotefromfile activeqt/opengl/glbox.cpp
    \skipto objsafe.h
    The implementation file of the \c GLBox class includes the \c objsafe.h
    system header, in which the \c IObjectSafety COM interface is defined.
    \printuntil objsafe.h
    \skipto ObjectSafetyImpl
    A class \c ObjectSafetyImpl is declared using multiple inheritance
    to subclass the QAxAggregated class, and to implement the IObjectSafety
    interface.
    \printuntil public:
    The class declares a default constructor, and implements the queryInterface
    function to support the IObjectSafety interface.
    \printto QAXAGG_IUNKNOWN
    Since every COM interface inherits \c IUnknown the \c QAXAGG_IUNKNOWN macro
    is used to provide the default implementation of the \c IUnknown interface.
    The macro is defined to delegate all calls to \c QueryInterface, \c AddRef
    and \c Release to the interface returned by the controllingUnknown() function.
    \printto GetInterfaceSafetyOptions
    The implementation of the \c IObjectSafety interface provides the caller
    with information about supported and enabled safety options, and returns 
    \c S_OK for all calls to indicate that the ActiveX control is safe.
    \printuntil };
    The implementation of the \c createAggregate() function just returns a new
    \c ObjectSafetyImpl object.
    \printuntil }

    To build the example you must first build the QAxServer library.
    Then run \c qmake and your make tool in  \c
    examples/activeqt/wrapper.

    The \l{qaxserver-demo-opengl.html}{demonstration} requires your
    WebBrowser to support ActiveX controls, and scripting to be
    enabled.

    In contrast to the other QAxServer examples Internet Explorer will not
    open a dialog box to ask the user whether or not the scripting of the GLBox
    control should be allowed (the exact browser behaviour depends on the security 
    settings in the Internet Options dialog).

    \quotefromfile examples/activeqt/opengl-demo.qdocinc
    \skipto <SCRIPT
    \printto endraw
*/
