source/QtScript: updated

source/QtScript: updated

Modified:
source/QtScript/QScriptEngineClass.prg

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
REQUEST QSCRIPTVALUE
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngine
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngine>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QStringList>

/*
QScriptEngine ()
*/
void QScriptEngine_new1 ()
{
  QScriptEngine * o = new QScriptEngine ();
  _qt4xhb_returnNewObject( o, false );
}

/*
QScriptEngine ( QObject * parent )
*/
void QScriptEngine_new2 ()
{
  QScriptEngine * o = new QScriptEngine ( PQOBJECT(1) );
  _qt4xhb_returnNewObject( o, false );
}

//[1]QScriptEngine ()
//[2]QScriptEngine ( QObject * parent )

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QSCRIPTENGINE_DELETE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void abortEvaluation ( const QScriptValue & result = QScriptValue() )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_ABORTEVALUATION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQSCRIPTVALUE(1)||ISNIL(1)) )
    {
#endif
      obj->abortEvaluation ( ISNIL(1)? QScriptValue() : *(QScriptValue *) _qt4xhb_itemGetPtr(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptEngineAgent * agent () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_AGENT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptEngineAgent * ptr = obj->agent ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTENGINEAGENT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableExtensions () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_AVAILABLEEXTENSIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableExtensions () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearExceptions ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CLEAREXCEPTIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clearExceptions ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void collectGarbage ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_COLLECTGARBAGE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->collectGarbage ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptContext * currentContext () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CURRENTCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptContext * ptr = obj->currentContext ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTCONTEXT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue defaultPrototype ( int metaTypeId ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_DEFAULTPROTOTYPE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->defaultPrototype ( PINT(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
*/
void QScriptEngine_evaluate1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->evaluate ( PQSTRING(1), OPQSTRING(2,QString()), OPINT(3,1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue evaluate ( const QScriptProgram & program )
*/
void QScriptEngine_evaluate2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->evaluate ( *PQSCRIPTPROGRAM(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
//[2]QScriptValue evaluate ( const QScriptProgram & program )

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && (ISCHAR(2)||ISNIL(2)) && (ISNUM(3)||ISNUM(3)) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue globalObject () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_GLOBALOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->globalObject () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool hasUncaughtException () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_HASUNCAUGHTEXCEPTION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->hasUncaughtException () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue importExtension ( const QString & extension )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_IMPORTEXTENSION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->importExtension ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList importedExtensions () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_IMPORTEDEXTENSIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->importedExtensions () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void installTranslatorFunctions ( const QScriptValue & object = QScriptValue() )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_INSTALLTRANSLATORFUNCTIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQSCRIPTVALUE(1)||ISNIL(1)) )
    {
#endif
      obj->installTranslatorFunctions ( ISNIL(1)? QScriptValue() : *(QScriptValue *) _qt4xhb_itemGetPtr(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool isEvaluating () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_ISEVALUATING )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->isEvaluating () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue newArray ( uint length = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_NEWARRAY )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && ISOPTNUM(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->newArray ( OPUINT(1,0) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue newRegExp ( const QRegExp & regexp )
*/
void QScriptEngine_newRegExp1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newRegExp ( *PQREGEXP(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue newRegExp ( const QString & pattern, const QString & flags )
*/
void QScriptEngine_newRegExp2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newRegExp ( PQSTRING(1), PQSTRING(2) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue newRegExp ( const QRegExp & regexp )
//[2]QScriptValue newRegExp ( const QString & pattern, const QString & flags )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue newVariant ( const QVariant & value )
*/
void QScriptEngine_newVariant1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newVariant ( *PQVARIANT(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )
*/
void QScriptEngine_newVariant2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newVariant ( *PQSCRIPTVALUE(1), *PQVARIANT(2) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue newVariant ( const QVariant & value )
//[2]QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue nullValue ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_NULLVALUE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->nullValue () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void popContext ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_POPCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->popContext ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
int processEventsInterval () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_PROCESSEVENTSINTERVAL )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->processEventsInterval () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptContext * pushContext ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_PUSHCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptContext * ptr = obj->pushContext ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTCONTEXT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void reportAdditionalMemoryCost ( int size )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_REPORTADDITIONALMEMORYCOST )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->reportAdditionalMemoryCost ( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAgent ( QScriptEngineAgent * agent )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETAGENT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTENGINEAGENT(1) )
    {
#endif
      obj->setAgent ( PQSCRIPTENGINEAGENT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setDefaultPrototype ( int metaTypeId, const QScriptValue & prototype )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETDEFAULTPROTOTYPE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(2) && ISNUM(1) && ISQSCRIPTVALUE(2) )
    {
#endif
      obj->setDefaultPrototype ( PINT(1), *PQSCRIPTVALUE(2) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setGlobalObject ( const QScriptValue & object )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETGLOBALOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTVALUE(1) )
    {
#endif
      obj->setGlobalObject ( *PQSCRIPTVALUE(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setProcessEventsInterval ( int interval )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETPROCESSEVENTSINTERVAL )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setProcessEventsInterval ( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptValue toObject ( const QScriptValue & value )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_TOOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTVALUE(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->toObject ( *PQSCRIPTVALUE(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptString toStringHandle ( const QString & str )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_TOSTRINGHANDLE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      QScriptString * ptr = new QScriptString( obj->toStringHandle ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTSTRING", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue uncaughtException () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->uncaughtException () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList uncaughtExceptionBacktrace () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTIONBACKTRACE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->uncaughtExceptionBacktrace () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
int uncaughtExceptionLineNumber () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTIONLINENUMBER )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->uncaughtExceptionLineNumber () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue undefinedValue ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNDEFINEDVALUE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->undefinedValue () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
static QScriptSyntaxCheckResult checkSyntax ( const QString & program )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CHECKSYNTAX )
{
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
  {
#endif
      QScriptSyntaxCheckResult * ptr = new QScriptSyntaxCheckResult( QScriptEngine::checkSyntax ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTSYNTAXCHECKRESULT", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
#endif
}

void QScriptEngineSlots_connect_signal ( const QString & signal, const QString & slot );

HB_FUNC_STATIC( QSCRIPTENGINE_ONSIGNALHANDLEREXCEPTION )
{
  QScriptEngineSlots_connect_signal( "signalHandlerException(QScriptValue)", "signalHandlerException(QScriptValue)" );
}

#pragma ENDDUMP

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
REQUEST QSCRIPTCONTEXT
REQUEST QSCRIPTENGINEAGENT
REQUEST QSCRIPTSTRING
REQUEST QSCRIPTSYNTAXCHECKRESULT
REQUEST QSCRIPTVALUE
#endif

CLASS QScriptEngine INHERIT QObject

   METHOD new
   METHOD delete
   METHOD abortEvaluation
   METHOD agent
   METHOD availableExtensions
   METHOD clearExceptions
   METHOD collectGarbage
   METHOD currentContext
   METHOD defaultPrototype
   METHOD evaluate
   METHOD globalObject
   METHOD hasUncaughtException
   METHOD importExtension
   METHOD importedExtensions
   METHOD installTranslatorFunctions
   METHOD isEvaluating
   METHOD newArray
   METHOD newRegExp
   METHOD newVariant
   METHOD nullValue
   METHOD popContext
   METHOD processEventsInterval
   METHOD pushContext
   METHOD reportAdditionalMemoryCost
   METHOD setAgent
   METHOD setDefaultPrototype
   METHOD setGlobalObject
   METHOD setProcessEventsInterval
   METHOD toObject
   METHOD toStringHandle
   METHOD uncaughtException
   METHOD uncaughtExceptionBacktrace
   METHOD uncaughtExceptionLineNumber
   METHOD undefinedValue
   METHOD checkSyntax

   METHOD onSignalHandlerException

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject () CLASS QScriptEngine
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QScriptEngine>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

#include <QStringList>

/*
QScriptEngine ()
*/
void QScriptEngine_new1 ()
{
  QScriptEngine * o = new QScriptEngine ();
  _qt4xhb_returnNewObject( o, false );
}

/*
QScriptEngine ( QObject * parent )
*/
void QScriptEngine_new2 ()
{
  QScriptEngine * o = new QScriptEngine ( PQOBJECT(1) );
  _qt4xhb_returnNewObject( o, false );
}

//[1]QScriptEngine ()
//[2]QScriptEngine ( QObject * parent )

HB_FUNC_STATIC( QSCRIPTENGINE_NEW )
{
  if( ISNUMPAR(0) )
  {
    QScriptEngine_new1();
  }
  else if( ISNUMPAR(1) && ISQOBJECT(1) )
  {
    QScriptEngine_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QSCRIPTENGINE_DELETE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void abortEvaluation ( const QScriptValue & result = QScriptValue() )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_ABORTEVALUATION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQSCRIPTVALUE(1)||ISNIL(1)) )
    {
#endif
      obj->abortEvaluation ( ISNIL(1)? QScriptValue() : *(QScriptValue *) _qt4xhb_itemGetPtr(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptEngineAgent * agent () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_AGENT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptEngineAgent * ptr = obj->agent ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTENGINEAGENT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList availableExtensions () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_AVAILABLEEXTENSIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->availableExtensions () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void clearExceptions ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CLEAREXCEPTIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clearExceptions ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void collectGarbage ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_COLLECTGARBAGE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->collectGarbage ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptContext * currentContext () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CURRENTCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptContext * ptr = obj->currentContext ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTCONTEXT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue defaultPrototype ( int metaTypeId ) const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_DEFAULTPROTOTYPE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->defaultPrototype ( PINT(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
*/
void QScriptEngine_evaluate1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->evaluate ( PQSTRING(1), OPQSTRING(2,QString()), OPINT(3,1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue evaluate ( const QScriptProgram & program )
*/
void QScriptEngine_evaluate2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->evaluate ( *PQSCRIPTPROGRAM(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
//[2]QScriptValue evaluate ( const QScriptProgram & program )

HB_FUNC_STATIC( QSCRIPTENGINE_EVALUATE )
{
  if( ISBETWEEN(1,3) && ISCHAR(1) && (ISCHAR(2)||ISNIL(2)) && (ISNUM(3)||ISNUM(3)) )
  {
    QScriptEngine_evaluate1();
  }
  else if( ISNUMPAR(1) && ISQSCRIPTPROGRAM(1) )
  {
    QScriptEngine_evaluate2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue globalObject () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_GLOBALOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->globalObject () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
bool hasUncaughtException () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_HASUNCAUGHTEXCEPTION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->hasUncaughtException () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue importExtension ( const QString & extension )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_IMPORTEXTENSION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->importExtension ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList importedExtensions () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_IMPORTEDEXTENSIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->importedExtensions () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void installTranslatorFunctions ( const QScriptValue & object = QScriptValue() )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_INSTALLTRANSLATORFUNCTIONS )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && (ISQSCRIPTVALUE(1)||ISNIL(1)) )
    {
#endif
      obj->installTranslatorFunctions ( ISNIL(1)? QScriptValue() : *(QScriptValue *) _qt4xhb_itemGetPtr(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
bool isEvaluating () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_ISEVALUATING )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RBOOL( obj->isEvaluating () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue newArray ( uint length = 0 )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_NEWARRAY )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,1) && ISOPTNUM(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->newArray ( OPUINT(1,0) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue newRegExp ( const QRegExp & regexp )
*/
void QScriptEngine_newRegExp1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newRegExp ( *PQREGEXP(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue newRegExp ( const QString & pattern, const QString & flags )
*/
void QScriptEngine_newRegExp2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newRegExp ( PQSTRING(1), PQSTRING(2) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue newRegExp ( const QRegExp & regexp )
//[2]QScriptValue newRegExp ( const QString & pattern, const QString & flags )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWREGEXP )
{
  if( ISNUMPAR(1) && ISQREGEXP(1) )
  {
    QScriptEngine_newRegExp1();
  }
  else if( ISNUMPAR(2) && ISCHAR(1) && ISCHAR(2) )
  {
    QScriptEngine_newRegExp2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue newVariant ( const QVariant & value )
*/
void QScriptEngine_newVariant1 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newVariant ( *PQVARIANT(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

/*
QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )
*/
void QScriptEngine_newVariant2 ()
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
      QScriptValue * ptr = new QScriptValue( obj->newVariant ( *PQSCRIPTVALUE(1), *PQVARIANT(2) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
  }
}

//[1]QScriptValue newVariant ( const QVariant & value )
//[2]QScriptValue newVariant ( const QScriptValue & object, const QVariant & value )

HB_FUNC_STATIC( QSCRIPTENGINE_NEWVARIANT )
{
  if( ISNUMPAR(1) && ISQVARIANT(1) )
  {
    QScriptEngine_newVariant1();
  }
  else if( ISNUMPAR(2) && ISQSCRIPTVALUE(1) && ISQVARIANT(2) )
  {
    QScriptEngine_newVariant2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
QScriptValue nullValue ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_NULLVALUE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->nullValue () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void popContext ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_POPCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->popContext ();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
int processEventsInterval () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_PROCESSEVENTSINTERVAL )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->processEventsInterval () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptContext * pushContext ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_PUSHCONTEXT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptContext * ptr = obj->pushContext ();
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTCONTEXT", false );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
void reportAdditionalMemoryCost ( int size )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_REPORTADDITIONALMEMORYCOST )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->reportAdditionalMemoryCost ( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setAgent ( QScriptEngineAgent * agent )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETAGENT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTENGINEAGENT(1) )
    {
#endif
      obj->setAgent ( PQSCRIPTENGINEAGENT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setDefaultPrototype ( int metaTypeId, const QScriptValue & prototype )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETDEFAULTPROTOTYPE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(2) && ISNUM(1) && ISQSCRIPTVALUE(2) )
    {
#endif
      obj->setDefaultPrototype ( PINT(1), *PQSCRIPTVALUE(2) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setGlobalObject ( const QScriptValue & object )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETGLOBALOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTVALUE(1) )
    {
#endif
      obj->setGlobalObject ( *PQSCRIPTVALUE(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void setProcessEventsInterval ( int interval )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_SETPROCESSEVENTSINTERVAL )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setProcessEventsInterval ( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
QScriptValue toObject ( const QScriptValue & value )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_TOOBJECT )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQSCRIPTVALUE(1) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->toObject ( *PQSCRIPTVALUE(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptString toStringHandle ( const QString & str )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_TOSTRINGHANDLE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISCHAR(1) )
    {
#endif
      QScriptString * ptr = new QScriptString( obj->toStringHandle ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTSTRING", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue uncaughtException () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTION )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->uncaughtException () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QStringList uncaughtExceptionBacktrace () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTIONBACKTRACE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RQSTRINGLIST( obj->uncaughtExceptionBacktrace () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
int uncaughtExceptionLineNumber () const
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNCAUGHTEXCEPTIONLINENUMBER )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->uncaughtExceptionLineNumber () );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
QScriptValue undefinedValue ()
*/
HB_FUNC_STATIC( QSCRIPTENGINE_UNDEFINEDVALUE )
{
  QScriptEngine * obj = (QScriptEngine *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QScriptValue * ptr = new QScriptValue( obj->undefinedValue () );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTVALUE", true );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
}

/*
static QScriptSyntaxCheckResult checkSyntax ( const QString & program )
*/
HB_FUNC_STATIC( QSCRIPTENGINE_CHECKSYNTAX )
{
    if( ISNUMPAR(1) && ISCHAR(1) )
  {
      QScriptSyntaxCheckResult * ptr = new QScriptSyntaxCheckResult( QScriptEngine::checkSyntax ( PQSTRING(1) ) );
      _qt4xhb_createReturnClass ( ptr, "QSCRIPTSYNTAXCHECKRESULT", true );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

void QScriptEngineSlots_connect_signal ( const QString & signal, const QString & slot );

HB_FUNC_STATIC( QSCRIPTENGINE_ONSIGNALHANDLEREXCEPTION )
{
  QScriptEngineSlots_connect_signal( "signalHandlerException(QScriptValue)", "signalHandlerException(QScriptValue)" );
}

#pragma ENDDUMP


codegen/QtWinExtras: updated

codegen/QtWinExtras: updated

Modified:
codegen/QtWinExtras/QtWin.prg

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=

$addMethods

$endClass

$destructor

#pragma BEGINDUMP

$includes=5,2,0

$prototype=static HBITMAP createMask(const QBitmap &bitmap)
$staticMethod=5,2,0|HBITMAP|createMask|const QBitmap &

$prototype=static HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha)
$staticMethod=5,2,0|HBITMAP|toHBITMAP|const QPixmap &,QtWin::HBitmapFormat=QtWin::HBitmapNoAlpha

$prototype=static QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha)
$staticMethod=5,2,0|QPixmap|fromHBITMAP|HBITMAP,QtWin::HBitmapFormat=QtWin::HBitmapNoAlpha

$prototype=static HICON toHICON(const QPixmap &p)
$staticMethod=5,2,0|HICON|toHICON|const QPixmap &

$prototype=static QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height)
$staticMethod=5,2,0|QImage|imageFromHBITMAP|HDC,HBITMAP,int,int

$prototype=static QPixmap fromHICON(HICON icon)
$staticMethod=5,2,0|QPixmap|fromHICON|HICON

$prototype=static HRGN toHRGN(const QRegion &region)
$staticMethod=5,2,0|HRGN|toHRGN|const QRegion &

$prototype=static QRegion fromHRGN(HRGN hrgn)
$staticMethod=5,2,0|QRegion|fromHRGN|HRGN

$prototype=static QString stringFromHresult(HRESULT hresult)
$staticMethod=5,2,0|QString|stringFromHresult|HRESULT|#ifndef Q_OS_WIN64

$prototype=static QString errorStringFromHresult(HRESULT hresult)
$staticMethod=5,2,0|QString|errorStringFromHresult|HRESULT|#ifndef Q_OS_WIN64

$prototype=static QColor colorizationColor(bool *opaqueBlend = 0)
$staticMethod=5,2,0|QColor|colorizationColor|bool *=0

$prototype=static QColor realColorizationColor()
$staticMethod=5,2,0|QColor|realColorizationColor|

$prototype=static void setWindowExcludedFromPeek(QWindow *window, bool exclude)
$staticMethod=5,2,0|void|setWindowExcludedFromPeek|QWindow *,bool

$prototype=static bool isWindowExcludedFromPeek(QWindow *window)
$staticMethod=5,2,0|bool|isWindowExcludedFromPeek|QWindow *

$prototype=static void setWindowDisallowPeek(QWindow *window, bool disallow)
$staticMethod=5,2,0|void|setWindowDisallowPeek|QWindow *,bool

$prototype=static bool isWindowPeekDisallowed(QWindow *window)
$staticMethod=5,2,0|bool|isWindowPeekDisallowed|QWindow *

$prototype=static void setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy)
$staticMethod=5,2,0|void|setWindowFlip3DPolicy|QWindow *,QtWin::WindowFlip3DPolicy

$prototype=static WindowFlip3DPolicy windowFlip3DPolicy(QWindow *)
$staticMethod=5,2,0|QtWin::WindowFlip3DPolicy|windowFlip3DPolicy|QWindow *

$prototype=static void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
$internalStaticMethod=5,2,0|void|extendFrameIntoClientArea,extendFrameIntoClientArea1|QWindow *,int,int,int,int

$prototype=static void extendFrameIntoClientArea(QWindow *window, const QMargins &margins)
$internalStaticMethod=5,2,0|void|extendFrameIntoClientArea,extendFrameIntoClientArea2|QWindow *,const QMargins &

//[1]void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
//[2]void extendFrameIntoClientArea(QWindow *window, const QMargins &margins)

HB_FUNC_STATIC( QTWIN_EXTENDFRAMEINTOCLIENTAREA )
{
  if( ISNUMPAR(5) && ISQWINDOW(1) && ISNUM(2) && ISNUM(3) && ISNUM(4) && ISNUM(5) )
  {
    QtWin_extendFrameIntoClientArea1();
  }
  else if( ISNUMPAR(2) && ISQWINDOW(1) && ISQMARGINS(2) )
  {
    QtWin_extendFrameIntoClientArea2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=extendFrameIntoClientArea

$prototype=static void resetExtendedFrame(QWindow *window)
$staticMethod=5,2,0|void|resetExtendedFrame|QWindow *

$prototype=static void enableBlurBehindWindow(QWindow *window, const QRegion &region)
$internalStaticMethod=5,2,0|void|enableBlurBehindWindow,enableBlurBehindWindow1|QWindow *,const QRegion &

$prototype=static void enableBlurBehindWindow(QWindow *window)
$internalStaticMethod=5,2,0|void|enableBlurBehindWindow,enableBlurBehindWindow2|QWindow *

//[1]void enableBlurBehindWindow(QWindow *window, const QRegion &region)
//[2]void enableBlurBehindWindow(QWindow *window)

HB_FUNC_STATIC( QTWIN_ENABLEBLURBEHINDWINDOW )
{
  if( ISNUMPAR(1) && ISQWINDOW(1) && ISQREGION(2) )
  {
    QtWin_enableBlurBehindWindow1();
  }
  else if( ISNUMPAR(1) && ISQWINDOW(1) )
  {
    QtWin_enableBlurBehindWindow2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=enableBlurBehindWindow

$prototype=static void disableBlurBehindWindow(QWindow *window)
$staticMethod=5,2,0|void|disableBlurBehindWindow|QWindow *

$prototype=static bool isCompositionEnabled()
$staticMethod=5,2,0|bool|isCompositionEnabled|

$prototype=static void setCompositionEnabled(bool enabled)
$staticMethod=5,2,0|void|setCompositionEnabled|bool

$prototype=static bool isCompositionOpaque()
$staticMethod=5,2,0|bool|isCompositionOpaque|

$prototype=static void setCurrentProcessExplicitAppUserModelID(const QString &id)
$staticMethod=5,2,0|void|setCurrentProcessExplicitAppUserModelID|const QString &

$prototype=static void markFullscreenWindow(QWindow *, bool fullscreen = true)
$staticMethod=5,2,0|void|markFullscreenWindow|QWindow *,bool=true

$prototype=static void taskbarActivateTab(QWindow *)
$staticMethod=5,2,0|void|taskbarActivateTab|QWindow *

$prototype=static void taskbarActivateTabAlt(QWindow *)
$staticMethod=5,2,0|void|taskbarActivateTabAlt|QWindow *

$prototype=static void taskbarAddTab(QWindow *)
$staticMethod=5,2,0|void|taskbarAddTab|QWindow *

$prototype=static void taskbarDeleteTab(QWindow *)
$staticMethod=5,2,0|void|taskbarDeleteTab|QWindow *

$extraMethods

#pragma ENDDUMP

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

$addRequests

$beginClassFrom=

$addMethods

$endClass

$destructor

#pragma BEGINDUMP

$includes=5,2,0

$prototype=static HBITMAP createMask(const QBitmap &bitmap)
$staticMethod=5,2,0|HBITMAP|createMask|const QBitmap &

$prototype=static HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha)
$staticMethod=5,2,0|HBITMAP|toHBITMAP|const QPixmap &,QtWin::HBitmapFormat=QtWin::HBitmapNoAlpha

$prototype=static QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha)
$staticMethod=5,2,0|QPixmap|fromHBITMAP|HBITMAP,QtWin::HBitmapFormat=QtWin::HBitmapNoAlpha

$prototype=static HICON toHICON(const QPixmap &p)
$staticMethod=5,2,0|HICON|toHICON|const QPixmap &

$prototype=static QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height)
$staticMethod=5,2,0|QImage|imageFromHBITMAP|HDC,HBITMAP,int,int

$prototype=static QPixmap fromHICON(HICON icon)
$staticMethod=5,2,0|QPixmap|fromHICON|HICON

$prototype=static HRGN toHRGN(const QRegion &region)
$staticMethod=5,2,0|HRGN|toHRGN|const QRegion &

$prototype=static QRegion fromHRGN(HRGN hrgn)
$staticMethod=5,2,0|QRegion|fromHRGN|HRGN

$prototype=static QString stringFromHresult(HRESULT hresult)
$staticMethod=5,2,0|QString|stringFromHresult|HRESULT|#ifndef Q_OS_WIN64

$prototype=static QString errorStringFromHresult(HRESULT hresult)
$staticMethod=5,2,0|QString|errorStringFromHresult|HRESULT|#ifndef Q_OS_WIN64

$prototype=static QColor colorizationColor(bool *opaqueBlend = 0)
$staticMethod=5,2,0|QColor|colorizationColor|bool *=0

$prototype=static QColor realColorizationColor()
$staticMethod=5,2,0|QColor|realColorizationColor|

$prototype=static void setWindowExcludedFromPeek(QWindow *window, bool exclude)
$staticMethod=5,2,0|void|setWindowExcludedFromPeek|QWindow *,bool

$prototype=static bool isWindowExcludedFromPeek(QWindow *window)
$staticMethod=5,2,0|bool|isWindowExcludedFromPeek|QWindow *

$prototype=static void setWindowDisallowPeek(QWindow *window, bool disallow)
$staticMethod=5,2,0|void|setWindowDisallowPeek|QWindow *,bool

$prototype=static bool isWindowPeekDisallowed(QWindow *window)
$staticMethod=5,2,0|bool|isWindowPeekDisallowed|QWindow *

$prototype=static void setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy)
$staticMethod=5,2,0|void|setWindowFlip3DPolicy|QWindow *,QtWin::WindowFlip3DPolicy

$prototype=static WindowFlip3DPolicy windowFlip3DPolicy(QWindow *)
$staticMethod=5,2,0|QtWin::WindowFlip3DPolicy|windowFlip3DPolicy|QWindow *

$prototype=static void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
$staticMethod=5,2,0|void|extendFrameIntoClientArea,extendFrameIntoClientArea1|QWindow *,int,int,int,int

$prototype=static void extendFrameIntoClientArea(QWindow *window, const QMargins &margins)
$staticMethod=5,2,0|void|extendFrameIntoClientArea,extendFrameIntoClientArea2|QWindow *,const QMargins &

//[1]void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom)
//[2]void extendFrameIntoClientArea(QWindow *window, const QMargins &margins)

HB_FUNC_STATIC( QTWIN_EXTENDFRAMEINTOCLIENTAREA )
{
  if( ISNUMPAR(5) && ISQWINDOW(1) && ISNUM(2) && ISNUM(3) && ISNUM(4) && ISNUM(5) )
  {
    HB_FUNC_EXEC( QTWIN_EXTENDFRAMEINTOCLIENTAREA1 );
  }
  else if( ISNUMPAR(2) && ISQWINDOW(1) && ISQMARGINS(2) )
  {
    HB_FUNC_EXEC( QTWIN_EXTENDFRAMEINTOCLIENTAREA2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=extendFrameIntoClientArea

$prototype=static void resetExtendedFrame(QWindow *window)
$staticMethod=5,2,0|void|resetExtendedFrame|QWindow *

$prototype=static void enableBlurBehindWindow(QWindow *window, const QRegion &region)
$staticMethod=5,2,0|void|enableBlurBehindWindow,enableBlurBehindWindow1|QWindow *,const QRegion &

$prototype=static void enableBlurBehindWindow(QWindow *window)
$staticMethod=5,2,0|void|enableBlurBehindWindow,enableBlurBehindWindow2|QWindow *

//[1]void enableBlurBehindWindow(QWindow *window, const QRegion &region)
//[2]void enableBlurBehindWindow(QWindow *window)

HB_FUNC_STATIC( QTWIN_ENABLEBLURBEHINDWINDOW )
{
  if( ISNUMPAR(1) && ISQWINDOW(1) && ISQREGION(2) )
  {
    HB_FUNC_EXEC( QTWIN_ENABLEBLURBEHINDWINDOW1 );
  }
  else if( ISNUMPAR(1) && ISQWINDOW(1) )
  {
    HB_FUNC_EXEC( QTWIN_ENABLEBLURBEHINDWINDOW2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}
$addMethod=enableBlurBehindWindow

$prototype=static void disableBlurBehindWindow(QWindow *window)
$staticMethod=5,2,0|void|disableBlurBehindWindow|QWindow *

$prototype=static bool isCompositionEnabled()
$staticMethod=5,2,0|bool|isCompositionEnabled|

$prototype=static void setCompositionEnabled(bool enabled)
$staticMethod=5,2,0|void|setCompositionEnabled|bool

$prototype=static bool isCompositionOpaque()
$staticMethod=5,2,0|bool|isCompositionOpaque|

$prototype=static void setCurrentProcessExplicitAppUserModelID(const QString &id)
$staticMethod=5,2,0|void|setCurrentProcessExplicitAppUserModelID|const QString &

$prototype=static void markFullscreenWindow(QWindow *, bool fullscreen = true)
$staticMethod=5,2,0|void|markFullscreenWindow|QWindow *,bool=true

$prototype=static void taskbarActivateTab(QWindow *)
$staticMethod=5,2,0|void|taskbarActivateTab|QWindow *

$prototype=static void taskbarActivateTabAlt(QWindow *)
$staticMethod=5,2,0|void|taskbarActivateTabAlt|QWindow *

$prototype=static void taskbarAddTab(QWindow *)
$staticMethod=5,2,0|void|taskbarAddTab|QWindow *

$prototype=static void taskbarDeleteTab(QWindow *)
$staticMethod=5,2,0|void|taskbarDeleteTab|QWindow *

$extraMethods

#pragma ENDDUMP


[VODesigners] A few improvements on images in toolbox

USING System.Windows.Forms
USING System.Drawing
USING System.Collections.Generic
USING System.Reflection
USING System.IO

INTERNAL CLASS ToolBoxButton INHERIT Button
	PROTECT oTemplate AS VOControlTemplate
	PROTECT oDragPoint AS Point
	CONSTRUCTOR()
		SUPER()
		SELF:Text := "Pointer"
		SELF:Dock := DockStyle.Top
		SELF:TextAlign := ContentAlignment.MiddleLeft
		SELF:FlatStyle := FlatStyle.Flat
	RETURN
	CONSTRUCTOR(_oTemplate AS VOControlTemplate)
		SUPER()
		SELF:oTemplate := _oTemplate
		SELF:Text := SELF:oTemplate:cName
		SELF:Dock := DockStyle.Top
		SELF:TextAlign := ContentAlignment.MiddleLeft
		SELF:FlatStyle := FlatStyle.Flat
		SELF:ImageAlign := ContentAlignment.MiddleLeft
		SELF:TextImageRelation := TextImageRelation.ImageBeforeText
	RETURN
	ACCESS Template AS VOControlTemplate
	RETURN SELF:oTemplate
	PROTECTED METHOD OnMouseDown(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseDown(e)
		SELF:oDragPoint := e:Location
	RETURN
	PROTECTED METHOD OnMouseUp(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseUp(e)
		SELF:oDragPoint := Point.Empty
	RETURN
	PROTECTED METHOD OnMouseMove(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseMove(e)
		IF SELF:oTemplate == NULL .or. SELF:oDragPoint == Point.Empty
			RETURN
		ENDIF
		IF Math.Abs(e:X - SELF:oDragPoint:X) > 2 .or. Math.Abs(e:Y - SELF:oDragPoint:Y) > 2
			SELF:DoDragDrop(SELF:oTemplate , DragDropEffects.Move)
			SELF:oDragPoint := Point.Empty
		ENDIF
	RETURN

END CLASS

CLASS ToolBox INHERIT Panel
	INTERNAL oCurrent AS ToolBoxButton
	PROTECT eCurrentMode AS ViewMode
	CONSTRUCTOR()

		SUPER()

		LOCAL oTemplate AS VOControlTemplate
		LOCAL oButton AS ToolBoxButton
		LOCAL oImageList AS ImageList
		LOCAL n AS INT

		SELF:AutoScroll := TRUE
		SELF:Dock := DockStyle.Fill

		IF !VOWindowEditorTemplate.Loaded
			RETURN
		ENDIF

		LOCAL oAssembly AS Assembly
		oAssembly := TypeOf(System.Windows.Forms.Form):Assembly
		oImageList := ImageList{}
		oImageList:TransparentColor := Color.Fuchsia

		FOR n := VOWindowEditorTemplate.Count - 1 DOWNTO 0
			oTemplate := VOWindowEditorTemplate.Get(n)
			IF (!oTemplate:lUse .or. oTemplate:lForm) //.and. n != 0
				LOOP
			ENDIF
			oButton := ToolBoxButton{oTemplate}
			oImageList:Images:Add((Bitmap)Image.FromStream(oAssembly:GetManifestResourceStream(SELF:ImageNameFromTemplate(oTemplate))))
			oButton:ImageList := oImageList
			oButton:ImageIndex := oImageList:Images:Count - 1
			oButton:Text := "   " + oButton:Text

			oButton:Click += EventHandler{ SELF , @ButtonClicked() }
			SELF:Controls:Add(oButton)
		NEXT

		LOCAL aStandard AS STRING[]
		aStandard := <STRING>{"FIXEDTEXT","PUSHBUTTON","CHECKBOX","RADIOBUTTON","SINGLELINEEDIT","MULTILINEEDIT","COMBOBOX","LISTBOX","LISTVIEW","TREEVIEW","GROUPBOX","RADIOBUTTONGROUP"}
		n := 0
		DO WHILE n < SELF:Controls:Count
//		FOR n := 0 UPTO SELF:Controls:Count - 1
			LOCAL m AS INT
			oButton := (ToolBoxButton)SELF:Controls[n]
			IF oButton:Template != NULL
				oTemplate := oButton:Template
				FOR m := 1 UPTO aStandard:Length
					IF aStandard[m] == oTemplate:cControl:ToUpper()
						IF SELF:Controls:GetChildIndex(oButton) != SELF:Controls:Count - m
							SELF:Controls:SetChildIndex(oButton , SELF:Controls:Count - m)
							n --
							EXIT
						END IF
					ENDIF
				NEXT
			ENDIF
			n ++
//		NEXT
		ENDDO

		TRY
			oButton := ToolBoxButton{VOWindowEditorTemplate.Get("SINGLELINEEDIT")}
		CATCH
			oButton := ToolBoxButton{}
		END TRY
		oButton:Text := "DataColumn"
		oButton:Click += EventHandler{ SELF , @ButtonClicked() }
		SELF:Controls:Add(oButton)

		oButton := ToolBoxButton{}
		oButton:Click += EventHandler{ SELF , @ButtonClicked() }
		SELF:Controls:Add(oButton)

		SELF:SetViewMode(ViewMode.Form)
		SELF:SelectPointer()
	RETURN
	PROTECTED METHOD ImageNameFromTemplate(oTemplate AS VOControlTemplate) AS STRING
		LOCAL cRet AS STRING
		LOCAL cClass AS STRING
		cClass := oTemplate:cFullClass:ToUpperInvariant()
		DO CASE
		CASE cClass:StartsWith("CONTROL:CUSTOMCONTROL:BBROWSER")
			cRet := "System.Windows.Forms.DataGridView.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BASELISTBOX:COMBOBOX")
			cRet := "System.Windows.Forms.ComboBox.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BASELISTBOX:LISTBOX")
			cRet := "System.Windows.Forms.ListBox.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:LISTVIEW")
			cRet := "System.Windows.Forms.ListView.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:TREEVIEW")
			cRet := "System.Windows.Forms.TreeView.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:TABCONTROL")
			cRet := "System.Windows.Forms.TabControl.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:MONTHCALENDAR")
			cRet := "System.Windows.Forms.MonthCalendar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:DATETIMEPICKER")
			cRet := "System.Windows.Forms.DateTimePicker.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:PROGRESSBAR")
			cRet := "System.Windows.Forms.ProgressBar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:GROUPBOX") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:RADIOBUTTONGROUP")
			cRet := "System.Windows.Forms.GroupBox.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:FIXEDTEXT")
			cRet := "System.Windows.Forms.Label.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:RADIOBUTTON")
			cRet := "System.Windows.Forms.RadioButton.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:PUSHBUTTON")
			cRet := "System.Windows.Forms.Button.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:ANIMATIONCONTROL")
			cRet := "System.Windows.Forms.NotifyIcon.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:CHECKBOX")
			cRet := "System.Windows.Forms.CheckBox.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:VERTICALSCROLLBAR")
			cRet := "System.Windows.Forms.VScrollBar.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:HORIZONTALSCROLLBAR")
			cRet := "System.Windows.Forms.HScrollBar.bmp"
		CASE cClass:StartsWith("CONTROL:FIXEDBITMAP") .or. ;
			cClass:StartsWith("CONTROL:FIXEDICON")
			cRet := "System.Windows.Forms.PictureBox.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:MULTILINEEDIT:RICHEDIT")
			cRet := "System.Windows.Forms.RichTextBox.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:SPINNER:HORIZONTALSPINNER") .or. ;
			cClass:StartsWith("CONTROL:SCROLLBAR:SPINNER:VERTICALSPINNER")
			cRet := "System.Windows.Forms.NumericUpDown.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:SLIDER:VERTICALSLIDER") .or. ;
			cClass:StartsWith("CONTROL:SCROLLBAR:SLIDER:HORIZONTALSLIDER")
			cRet := "System.Windows.Forms.TrackBar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:IPADDRESS") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:HOTKEYEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:MULTILINEEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:SINGLELINEEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:IPADDRESS")
			cRet := "System.Windows.Forms.TextBox.bmp"
		OTHERWISE
			cRet := "System.Windows.Forms.Panel.bmp"
		END CASE
	RETURN cRet

	METHOD SetViewMode(eViewMode AS ViewMode) AS VOID
		LOCAL n AS INT
		IF eViewMode == ViewMode.Auto
			eViewMode := ViewMode.Form
		END IF
		IF SELF:eCurrentMode != eViewMode
			SELF:eCurrentMode := eViewMode
			FOR n := 0 UPTO SELF:Controls:Count - 2
				SELF:Controls[n]:Visible := SELF:eCurrentMode == ViewMode.Form
			NEXT
			SELF:Controls[SELF:Controls:Count - 2]:Visible := SELF:eCurrentMode == ViewMode.Browse
		END IF
	RETURN

	ACCESS Selected() AS VOControlTemplate
		IF SELF:oCurrent == NULL
			RETURN NULL
		ENDIF
	RETURN SELF:oCurrent:Template
	ACCESS PointerSelected() AS LOGIC
	RETURN SELF:oCurrent == NULL .or. SELF:oCurrent:Template == NULL
	METHOD SelectPointer() AS VOID
		LOCAL oPointer AS ToolBoxButton
		IF SELF:Controls:Count == 0
			RETURN
		ENDIF
		oPointer := (ToolBoxButton)SELF:Controls[SELF:Controls:Count - 1]
		SELF:SelectButton(oPointer)
		SELF:ScrollControlIntoView(oPointer)
		oPointer:Select()
	RETURN
	METHOD ButtonClicked(o AS OBJECT , e AS EventArgs) AS VOID
		SELF:SelectButton((ToolBoxButton)o)
	RETURN
	INTERNAL METHOD SelectButton(oButton AS ToolBoxButton) AS VOID
		IF SELF:oCurrent != NULL
			SELF:oCurrent:BackColor := Color.FromKnownColor(KnownColor.Control)
			SELF:oCurrent:ForeColor := Color.Black
		ENDIF
		oButton:BackColor := Color.White
		oButton:ForeColor := Color.Red
		SELF:oCurrent := oButton
	RETURN

END CLASS

USING System.Windows.Forms
USING System.Drawing
USING System.Collections.Generic
USING System.Reflection
USING System.IO

INTERNAL CLASS ToolBoxButton INHERIT Button
	PROTECT oTemplate AS VOControlTemplate
	PROTECT oDragPoint AS Point
	CONSTRUCTOR()
		SUPER()
		SELF:Text := "Pointer"
		SELF:Dock := DockStyle.Top
		SELF:TextAlign := ContentAlignment.MiddleLeft
		SELF:FlatStyle := FlatStyle.Flat
	RETURN
	CONSTRUCTOR(_oTemplate AS VOControlTemplate)
		SUPER()
		SELF:oTemplate := _oTemplate
		SELF:Text := SELF:oTemplate:cName
		SELF:Dock := DockStyle.Top
		SELF:TextAlign := ContentAlignment.MiddleLeft
		SELF:FlatStyle := FlatStyle.Flat
		SELF:ImageAlign := ContentAlignment.MiddleLeft
		SELF:TextImageRelation := TextImageRelation.ImageBeforeText
	RETURN
	ACCESS Template AS VOControlTemplate
	RETURN SELF:oTemplate
	PROTECTED METHOD OnMouseDown(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseDown(e)
		SELF:oDragPoint := e:Location
	RETURN
	PROTECTED METHOD OnMouseUp(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseUp(e)
		SELF:oDragPoint := Point.Empty
	RETURN
	PROTECTED METHOD OnMouseMove(e AS MouseEventArgs) AS VOID
		SUPER:OnMouseMove(e)
		IF SELF:oTemplate == NULL .or. SELF:oDragPoint == Point.Empty
			RETURN
		ENDIF
		IF Math.Abs(e:X - SELF:oDragPoint:X) > 2 .or. Math.Abs(e:Y - SELF:oDragPoint:Y) > 2
			SELF:DoDragDrop(SELF:oTemplate , DragDropEffects.Move)
			SELF:oDragPoint := Point.Empty
		ENDIF
	RETURN

END CLASS

CLASS ToolBox INHERIT Panel
	INTERNAL oCurrent AS ToolBoxButton
	PROTECT eCurrentMode AS ViewMode
	CONSTRUCTOR()

		SUPER()

		LOCAL oTemplate AS VOControlTemplate
		LOCAL oButton AS ToolBoxButton
		LOCAL oImageList AS ImageList
		LOCAL n AS INT

		SELF:AutoScroll := TRUE
		SELF:Dock := DockStyle.Fill

		IF !VOWindowEditorTemplate.Loaded
			RETURN
		ENDIF

		LOCAL oAssembly AS Assembly
		oAssembly := TypeOf(System.Windows.Forms.Form):Assembly
		oImageList := ImageList{}
		oImageList:TransparentColor := Color.Fuchsia

		FOR n := VOWindowEditorTemplate.Count - 1 DOWNTO 0
			oTemplate := VOWindowEditorTemplate.Get(n)
			IF (!oTemplate:lUse .or. oTemplate:lForm) //.and. n != 0
				LOOP
			ENDIF
			oButton := ToolBoxButton{oTemplate}
			oImageList:Images:Add((Bitmap)Image.FromStream(oAssembly:GetManifestResourceStream(SELF:ImageNameFromTemplate(oTemplate))))
			oButton:ImageList := oImageList
			oButton:ImageIndex := oImageList:Images:Count - 1
			oButton:Text := "   " + oButton:Text

			oButton:Click += EventHandler{ SELF , @ButtonClicked() }
			SELF:Controls:Add(oButton)
		NEXT

		LOCAL aStandard AS STRING[]
		aStandard := <STRING>{"FIXEDTEXT","PUSHBUTTON","CHECKBOX","RADIOBUTTON","SINGLELINEEDIT","MULTILINEEDIT","COMBOBOX","LISTBOX","LISTVIEW","TREEVIEW","GROUPBOX","RADIOBUTTONGROUP"}
		n := 0
		DO WHILE n < SELF:Controls:Count
//		FOR n := 0 UPTO SELF:Controls:Count - 1
			LOCAL m AS INT
			oButton := (ToolBoxButton)SELF:Controls[n]
			IF oButton:Template != NULL
				oTemplate := oButton:Template
				FOR m := 1 UPTO aStandard:Length
					IF aStandard[m] == oTemplate:cControl:ToUpper()
						IF SELF:Controls:GetChildIndex(oButton) != SELF:Controls:Count - m
							SELF:Controls:SetChildIndex(oButton , SELF:Controls:Count - m)
							n --
							EXIT
						END IF
					ENDIF
				NEXT
			ENDIF
			n ++
//		NEXT
		ENDDO

		TRY
			oButton := ToolBoxButton{VOWindowEditorTemplate.Get("SINGLELINEEDIT")}
		CATCH
			oButton := ToolBoxButton{}
		END TRY
		oButton:Text := "DataColumn"
		oButton:Click += EventHandler{ SELF , @ButtonClicked() }
		SELF:Controls:Add(oButton)

		oButton := ToolBoxButton{}
		oButton:Click += EventHandler{ SELF , @ButtonClicked() }
		SELF:Controls:Add(oButton)

		SELF:SetViewMode(ViewMode.Form)
		SELF:SelectPointer()
	RETURN
	PROTECTED METHOD ImageNameFromTemplate(oTemplate AS VOControlTemplate) AS STRING
		LOCAL cRet AS STRING
		LOCAL cClass AS STRING
		cClass := oTemplate:cFullClass:ToUpperInvariant()
		DO CASE
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BASELISTBOX:COMBOBOX")
			cRet := "System.Windows.Forms.ComboBox.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BASELISTBOX:LISTBOX")
			cRet := "System.Windows.Forms.ListBox.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:LISTVIEW")
			cRet := "System.Windows.Forms.ListView.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:TREEVIEW")
			cRet := "System.Windows.Forms.TreeView.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:TABCONTROL")
			cRet := "System.Windows.Forms.TabControl.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:MONTHCALENDAR")
			cRet := "System.Windows.Forms.MonthCalendar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:DATETIMEPICKER")
			cRet := "System.Windows.Forms.DateTimePicker.bmp"
		CASE cClass:StartsWith("CONTROL:COMMONCONTROL:PROGRESSBAR")
			cRet := "System.Windows.Forms.ProgressBar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:GROUPBOX") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:RADIOBUTTONGROUP")
			cRet := "System.Windows.Forms.GroupBox.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:FIXEDTEXT")
			cRet := "System.Windows.Forms.Label.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:RADIOBUTTON")
			cRet := "System.Windows.Forms.RadioButton.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:PUSHBUTTON")
			cRet := "System.Windows.Forms.Button.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:BUTTON:CHECKBOX")
			cRet := "System.Windows.Forms.Button.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:VERTICALSCROLLBAR")
			cRet := "System.Windows.Forms.VScrollBar.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:HORIZONTALSCROLLBAR")
			cRet := "System.Windows.Forms.HScrollBar.bmp"
		CASE cClass:StartsWith("CONTROL:FIXEDBITMAP") .or. ;
			cClass:StartsWith("CONTROL:FIXEDICON")
			cRet := "System.Windows.Forms.PictureBox.bmp"
/*		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:MULTILINEEDIT:RICHEDIT")
			cRet := "System.Windows.Forms.RichEdit.bmp"*/
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:SPINNER:HORIZONTALSPINNER") .or. ;
			cClass:StartsWith("CONTROL:SCROLLBAR:SPINNER:VERTICALSPINNER")
			cRet := "System.Windows.Forms.NumericUpDown.bmp"
		CASE cClass:StartsWith("CONTROL:SCROLLBAR:SLIDER:VERTICALSLIDER") .or. ;
			cClass:StartsWith("CONTROL:SCROLLBAR:SLIDER:HORIZONTALSLIDER")
			cRet := "System.Windows.Forms.TrackBar.bmp"
		CASE cClass:StartsWith("CONTROL:TEXTCONTROL:IPADDRESS") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:HOTKEYEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:MULTILINEEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:EDIT:SINGLELINEEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:HOTKEYEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:HOTKEYEDIT") .or. ;
			cClass:StartsWith("CONTROL:TEXTCONTROL:IPADDRESS")
			cRet := "System.Windows.Forms.TextBox.bmp"
		OTHERWISE
			MessageBox.Show(oTemplate:cFullClass)
			cRet := "System.Windows.Forms.Panel.bmp"
		END CASE
	RETURN cRet

	METHOD SetViewMode(eViewMode AS ViewMode) AS VOID
		LOCAL n AS INT
		IF eViewMode == ViewMode.Auto
			eViewMode := ViewMode.Form
		END IF
		IF SELF:eCurrentMode != eViewMode
			SELF:eCurrentMode := eViewMode
			FOR n := 0 UPTO SELF:Controls:Count - 2
				SELF:Controls[n]:Visible := SELF:eCurrentMode == ViewMode.Form
			NEXT
			SELF:Controls[SELF:Controls:Count - 2]:Visible := SELF:eCurrentMode == ViewMode.Browse
		END IF
	RETURN

	ACCESS Selected() AS VOControlTemplate
		IF SELF:oCurrent == NULL
			RETURN NULL
		ENDIF
	RETURN SELF:oCurrent:Template
	ACCESS PointerSelected() AS LOGIC
	RETURN SELF:oCurrent == NULL .or. SELF:oCurrent:Template == NULL
	METHOD SelectPointer() AS VOID
		LOCAL oPointer AS ToolBoxButton
		IF SELF:Controls:Count == 0
			RETURN
		ENDIF
		oPointer := (ToolBoxButton)SELF:Controls[SELF:Controls:Count - 1]
		SELF:SelectButton(oPointer)
		SELF:ScrollControlIntoView(oPointer)
		oPointer:Select()
	RETURN
	METHOD ButtonClicked(o AS OBJECT , e AS EventArgs) AS VOID
		SELF:SelectButton((ToolBoxButton)o)
	RETURN
	INTERNAL METHOD SelectButton(oButton AS ToolBoxButton) AS VOID
		IF SELF:oCurrent != NULL
			SELF:oCurrent:BackColor := Color.FromKnownColor(KnownColor.Control)
			SELF:oCurrent:ForeColor := Color.Black
		ENDIF
		oButton:BackColor := Color.White
		oButton:ForeColor := Color.Red
		SELF:oCurrent := oButton
	RETURN

END CLASS


QtQuickWidgets: data for code generation updated

Modified:
codegen/QtQuickWidgets/QQuickWidget.prg

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QURL
REQUEST QQMLENGINE
REQUEST QQMLCONTEXT
REQUEST QQUICKITEM
REQUEST QQMLERROR
REQUEST QSIZE
REQUEST QSURFACEFORMAT
#endif

CLASS QQuickWidget INHERIT QWidget

   METHOD new
   METHOD delete
   METHOD source
   METHOD setSource
   METHOD engine
   METHOD rootContext
   METHOD rootObject
   METHOD resizeMode
   METHOD setResizeMode
   METHOD status
   METHOD errors
   METHOD sizeHint
   METHOD initialSize
   METHOD setContent
   METHOD format
   METHOD setFormat

   METHOD onStatusChanged
   METHOD onSceneGraphError

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes=5,3,0

#include <QQmlError>
#include <QQmlEngine>
#include <QQmlContext>
#include <QQuickItem>

$prototype=explicit QQuickWidget(QWidget *parent = 0)
$internalConstructor=5,3,0|new1|QWidget *=0

$prototype=QQuickWidget(QQmlEngine* engine, QWidget *parent)
$internalConstructor=5,3,0|new2|QQmlEngine *,QWidget *

$prototype=QQuickWidget(const QUrl &source, QWidget *parent = 0)
$internalConstructor=5,3,0|new3|const QUrl &,QWidget *=0

//[1]explicit QQuickWidget(QWidget *parent = 0)
//[2]QQuickWidget(QQmlEngine* engine, QWidget *parent)
//[3]QQuickWidget(const QUrl &source, QWidget *parent = 0)

HB_FUNC_STATIC( QQUICKWIDGET_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  if( ISBETWEEN(0,1) && ISOPTQWIDGET(1) )
  {
    QQuickWidget_new1();
  }
  else if( ISNUMPAR(2) && ISQQMLENGINE(1) && ISQWIDGET(2) )
  {
    QQuickWidget_new2();
  }
  else if( ISBETWEEN(1,2) && ISQURL(1) && ISOPTQWIDGET(2) )
  {
    QQuickWidget_new3();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
#endif
}

$deleteMethod=5,3,0

$prototype=QUrl source() const
$method=5,3,0|QUrl|source|

$prototype=void setSource(const QUrl&)
$method=5,3,0|void|setSource|const QUrl &

$prototype=QQmlEngine* engine() const
$method=5,3,0|QQmlEngine *|engine|

$prototype=QQmlContext* rootContext() const
$method=5,3,0|QQmlContext *|rootContext|

$prototype=QQuickItem *rootObject() const
$method=5,3,0|QQuickItem *|rootObject|

$prototype=ResizeMode resizeMode() const
$method=5,3,0|QQuickWidget::ResizeMode|resizeMode|

$prototype=void setResizeMode(ResizeMode)
$method=5,3,0|void|setResizeMode|QQuickWidget::ResizeMode

$prototype=Status status() const
$method=5,3,0|QQuickWidget::Status|status|

$prototype=QList<QQmlError> errors() const
$method=5,3,0|QList<QQmlError>|errors|

$prototype=QSize sizeHint() const
$method=5,3,0|QSize|sizeHint|

$prototype=QSize initialSize() const
$method=5,3,0|QSize|initialSize|

$prototype=void setContent(const QUrl& url, QQmlComponent *component, QObject *item)
$method=5,3,0|void|setContent|const QUrl &,QQmlComponent *,QObject *

$prototype=QSurfaceFormat format() const
$method=5,3,0|QSurfaceFormat|format|

$prototype=void setFormat(const QSurfaceFormat &format)
$method=5,3,0|void|setFormat|const QSurfaceFormat &

$beginSignals
$signal=5,3,0|statusChanged(QQuickWidget::Status)
$signal=5,3,0|sceneGraphError(QQuickWindow::SceneGraphError,QString)
$endSignals

#pragma ENDDUMP

%%
%% Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5
%%
%% Copyright (C) 2018 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>
%%

$header

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QURL
REQUEST QQMLENGINE
REQUEST QQMLCONTEXT
REQUEST QQUICKITEM
REQUEST QQMLERROR
REQUEST QSIZE
REQUEST QSURFACEFORMAT
#endif

CLASS QQuickWidget INHERIT QWidget

   METHOD new
   METHOD delete
   METHOD source
   METHOD setSource
   METHOD engine
   METHOD rootContext
   METHOD rootObject
   METHOD resizeMode
   METHOD setResizeMode
   METHOD status
   METHOD errors
   METHOD sizeHint
   METHOD initialSize
   METHOD setContent
   METHOD format
   METHOD setFormat

   METHOD onStatusChanged
   METHOD onSceneGraphError

   DESTRUCTOR destroyObject

END CLASS

$destructor

#pragma BEGINDUMP

$includes=5,3,0

#include <QQmlError>
#include <QQmlEngine>
#include <QQmlContext>
#include <QQuickItem>

$prototype=explicit QQuickWidget(QWidget *parent = 0)
$internalConstructor=5,3,0|new1|QWidget *=0

$prototype=QQuickWidget(QQmlEngine* engine, QWidget *parent)
$internalConstructor=5,3,0|new2|QQmlEngine *,QWidget *

$prototype=QQuickWidget(const QUrl &source, QWidget *parent = 0)
$internalConstructor=5,3,0|new3|const QUrl &,QWidget *=0

//[1]explicit QQuickWidget(QWidget *parent = 0)
//[2]QQuickWidget(QQmlEngine* engine, QWidget *parent)
//[3]QQuickWidget(const QUrl &source, QWidget *parent = 0)

HB_FUNC_STATIC( QQUICKWIDGET_NEW )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
  if( ISBETWEEN(0,1) && ISOPTQWIDGET(1) )
  {
    QQuickWidget_new1();
  }
  else if( ISNUMPAR(2) && ISQQMLENGINE(1) && ISQWIDGET(2) )
  {
    QQuickWidget_new2();
  }
  else if( ISBETWEEN(1,2) && ISQURL(1) && ISOPTQWIDGET(2) )
  {
    QQuickWidget_new3();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
#endif
}

$deleteMethod=5,3,0

$prototype=QUrl source() const
$method=5,3,0|QUrl|source|

$prototype=void setSource(const QUrl&)
$method=5,3,0|void|setSource|const QUrl &

$prototype=QQmlEngine* engine() const
$method=5,3,0|QQmlEngine *|engine|

$prototype=QQmlContext* rootContext() const
$method=5,3,0|QQmlContext *|rootContext|

$prototype=QQuickItem *rootObject() const
$method=5,3,0|QQuickItem *|rootObject|

$prototype=ResizeMode resizeMode() const
$method=5,3,0|QQuickWidget::ResizeMode|resizeMode|

$prototype=void setResizeMode(ResizeMode)
$method=5,3,0|void|setResizeMode|QQuickWidget::ResizeMode

$prototype=Status status() const
$method=5,3,0|QQuickWidget::Status|status|

$prototype=QList<QQmlError> errors() const
$method=5,3,0|QList<QQmlError>|errors|

$prototype=QSize sizeHint() const
$method=5,3,0|QSize|sizeHint|

$prototype=QSize initialSize() const
$method=5,3,0|QSize|initialSize|

$prototype=void setContent(const QUrl& url, QQmlComponent *component, QObject *item)
$method=5,3,0|void|setContent|const QUrl &,QQmlComponent *,QObject *

$prototype=QSurfaceFormat format() const
$method=5,3,0|QSurfaceFormat|format|

$prototype=void setFormat(const QSurfaceFormat &format)
$method=5,3,0|void|setFormat|const QSurfaceFormat &

$beginSignals
$signalMethod=5,3,0|statusChanged(QQuickWidget::Status)
$signalMethod=5,3,0|sceneGraphError(QQuickWindow::SceneGraphError,QString)
$endSignals

#pragma ENDDUMP