Files
harbour-core/harbour/contrib/hbqt/QLinearGradient.cpp
Pritpal Bedi e612f92599 2009-07-08 16:50 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbqt/hbqt.ch

  * harbour/contrib/hbqt/QBitmap.cpp
  * harbour/contrib/hbqt/QBrush.cpp
  * harbour/contrib/hbqt/QCursor.cpp
  * harbour/contrib/hbqt/QImage.cpp
  * harbour/contrib/hbqt/QLine.cpp
  * harbour/contrib/hbqt/QLinearGradient.cpp
  * harbour/contrib/hbqt/QPicture.cpp
  * harbour/contrib/hbqt/QPixmap.cpp
  * harbour/contrib/hbqt/QPoint.cpp
  * harbour/contrib/hbqt/QPointF.cpp
  * harbour/contrib/hbqt/QRadialGradient.cpp
  * harbour/contrib/hbqt/QRect.cpp
  * harbour/contrib/hbqt/QRectF.cpp
  * harbour/contrib/hbqt/QRegion.cpp
  * harbour/contrib/hbqt/QSizeF.cpp

  * harbour/contrib/hbqt/TQBitmap.prg
  * harbour/contrib/hbqt/TQImage.prg
  * harbour/contrib/hbqt/TQLine.prg
  * harbour/contrib/hbqt/TQLinearGradient.prg
  * harbour/contrib/hbqt/TQPicture.prg
  * harbour/contrib/hbqt/TQPixmap.prg
  * harbour/contrib/hbqt/TQPoint.prg
  * harbour/contrib/hbqt/TQPointF.prg
  * harbour/contrib/hbqt/TQRadialGradient.prg
  * harbour/contrib/hbqt/TQRect.prg
  * harbour/contrib/hbqt/TQRectF.prg
  * harbour/contrib/hbqt/TQRegion.prg
  * harbour/contrib/hbqt/TQSizeF.prg

  * harbour/contrib/hbqt/qth/QBitmap.qth
  * harbour/contrib/hbqt/qth/QBrush.qth
  * harbour/contrib/hbqt/qth/QCursor.qth
  * harbour/contrib/hbqt/qth/QImage.qth
  * harbour/contrib/hbqt/qth/QLine.qth
  * harbour/contrib/hbqt/qth/QLinearGradient.qth
  * harbour/contrib/hbqt/qth/QPalette.qth
  * harbour/contrib/hbqt/qth/QPicture.qth
  * harbour/contrib/hbqt/qth/QPixmap.qth
  * harbour/contrib/hbqt/qth/QPoint.qth
  * harbour/contrib/hbqt/qth/QPointF.qth
  * harbour/contrib/hbqt/qth/QRadialGradient.qth
  * harbour/contrib/hbqt/qth/QRect.qth
  * harbour/contrib/hbqt/qth/QRectF.qth
  * harbour/contrib/hbqt/qth/QRegion.qth
  * harbour/contrib/hbqt/qth/QSizeF.qth

  ! Updated for exact constructor parameters.
    If the constructor accepts parameters with identical .prg supplied values,
    a new parameter is inserted as a first argument and then resolved in .cpp.
        
      oBrush := QBrush():new( "QPixmap"  , pQPixmap )
      oBrush := QBrush():new( "QImage"   , pQImage )
      oBrush := QBrush():new( "QGradient", pQGradient )
           
          Note that constructor fetches only one argument, a pointer to relevant
          object, which at prg to cpp level can never be differed so this 
          mechanism was necessary. The first parameter will be matched exact
          and hence it is case sensitive. If this parameter is of the same type
          object is being created then it call will only supply pointer:
  
      oBrush := QBrush():new( pQBrush_other )
2009-07-08 23:57:56 +00:00

144 lines
4.6 KiB
C++

/*
* $Id$
*/
/*
* Harbour Project source code:
* QT wrapper main header
*
* Copyright 2009 Marcos Antonio Gambeta <marcosgambeta at gmail dot com>
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/*----------------------------------------------------------------------*/
#include "hbapi.h"
#include "hbqt.h"
/*----------------------------------------------------------------------*/
#if QT_VERSION >= 0x040500
/*----------------------------------------------------------------------*/
#include <QtGui/QLinearGradient>
/*
* QLinearGradient ()
* QLinearGradient ( const QPointF & start, const QPointF & finalStop )
* QLinearGradient ( qreal x1, qreal y1, qreal x2, qreal y2 )
*/
HB_FUNC( QT_QLINEARGRADIENT )
{
if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) )
{
hb_retptr( ( QLinearGradient* ) new QLinearGradient( *hbqt_par_QLinearGradient( 1 ) ) );
}
else if( hb_pcount() == 2 && HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) )
{
hb_retptr( ( QLinearGradient* ) new QLinearGradient( *hbqt_par_QPoint( 1 ), *hbqt_par_QPoint( 2 ) ) );
}
else if( hb_pcount() == 4 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) )
{
hb_retptr( ( QLinearGradient* ) new QLinearGradient( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ) ) );
}
else
{
hb_retptr( ( QLinearGradient* ) new QLinearGradient() );
}
}
/*
* QPointF finalStop () const
*/
HB_FUNC( QT_QLINEARGRADIENT_FINALSTOP )
{
hb_retptr( new QPointF( hbqt_par_QLinearGradient( 1 )->finalStop() ) );
}
/*
* void setFinalStop ( const QPointF & stop )
*/
HB_FUNC( QT_QLINEARGRADIENT_SETFINALSTOP )
{
hbqt_par_QLinearGradient( 1 )->setFinalStop( *hbqt_par_QPointF( 2 ) );
}
/*
* void setFinalStop ( qreal x, qreal y )
*/
HB_FUNC( QT_QLINEARGRADIENT_SETFINALSTOP_1 )
{
hbqt_par_QLinearGradient( 1 )->setFinalStop( hb_parnd( 2 ), hb_parnd( 3 ) );
}
/*
* void setStart ( const QPointF & start )
*/
HB_FUNC( QT_QLINEARGRADIENT_SETSTART )
{
hbqt_par_QLinearGradient( 1 )->setStart( *hbqt_par_QPointF( 2 ) );
}
/*
* void setStart ( qreal x, qreal y )
*/
HB_FUNC( QT_QLINEARGRADIENT_SETSTART_1 )
{
hbqt_par_QLinearGradient( 1 )->setStart( hb_parnd( 2 ), hb_parnd( 3 ) );
}
/*
* QPointF start () const
*/
HB_FUNC( QT_QLINEARGRADIENT_START )
{
hb_retptr( new QPointF( hbqt_par_QLinearGradient( 1 )->start() ) );
}
/*----------------------------------------------------------------------*/
#endif /* #if QT_VERSION >= 0x040500 */
/*----------------------------------------------------------------------*/