Revision: 10707
          
http://harbour-project.svn.sourceforge.net/harbour-project/?rev=10707&view=rev
Author:   vouchcac
Date:     2009-03-27 09:45:51 +0000 (Fri, 27 Mar 2009)

Log Message:
-----------
2009-03-27 02:03 UTC-0800 Pritpal Bedi ([email protected])
  * harbour/contrib/hbqt/hbqt.h
  * harbour/contrib/hbqt/hbqt_qfont.cpp
    + Added more functions.

  + harbour/contrib/hbqt/generator
  + harbour/contrib/hbqt/generator/hbqtgen.prg
    + Implemented protocol to generate .cpp source file
      from QT Header definitions lifted from its help manual.
      It has lot more potentials to incorporate more features,
      it is just the begining.

  + harbour/contrib/hbqt/qth
  + harbour/contrib/hbqt/qth/QBrush.qth
  + harbour/contrib/hbqt/qth/QFont.qth
  + harbour/contrib/hbqt/qth/QPen.qth
  + harbour/contrib/hbqt/qth/QWidget.qth
    + Added .qth contining prototypes and user code to be embedded 
      into the resulting .cpp source file.

    /*  
       COMPILE  : hbmk2 hbqtgen
       USAGE    : hbqtgen -I<qthHeaderFilesPath> -O<cppSourceFilePath> 
<qthFile1.qth> <qthFile2.qth> <...>
                  hbqtgen -help
       EXAMPLE  : hbqtgen -Ic:\harbour\hbqt\qth  -Oc:\temp QFont.qth QWidget.qth

       NEXT     : hbqtgen @QtProjectFile.qtp

       OVERVIEW : .qth 
  

                     enum Capitalization { MixedCase, AllUppercase, 
AllLowercase, SmallCaps, Capitalize }
                     enum SpacingType { PercentageSpacing, AbsoluteSpacing }
                     enum Stretch { UltraCondensed, ExtraCondensed, Condensed, 
SemiCondensed, ..., UltraExpanded }
                     enum Style { StyleNormal, StyleItalic, StyleOblique }
                     enum StyleHint { AnyStyle, SansSerif, Helvetica, Serif, 
..., System }
                     enum StyleStrategy { PreferDefault, PreferBitmap, 
PreferDevice, PreferOutline, ..., PreferQuality }
                     enum Weight { Light, Normal, DemiBold, Bold, Black }


                     <CODE>

                     /*
                     QFont ()
                     QFont ( const QString & family, int pointSize = -1, int 
weight = -1, bool italic = false )
                     QFont ( const QFont & font, QPaintDevice * pd )
                     QFont ( const QFont & font )
                     */
                     HB_FUNC( QT_QFONT )
                     {
                        if( HB_IS_STRING( 1 ) )
                        {
                           hb_retptr( ( QFont* ) new QFont() );
                        }
                        else
                        {
                           hb_retptr( ( QFont* ) new QFont( hbqt_par_QString( 1 
),
                                                            HB_IS_NUMERIC( 2 ) 
? hb_parni( 2 ) : -1,
                                                            HB_IS_NUMERIC( 3 ) 
? hb_parni( 3 ) : -1,
                                                            hb_parl( 4 ) ) );
                        }
                     }

                     </CODE>



                     bool bold () const
                     Capitalization capitalization () const
                     QString defaultFamily () const
                     bool exactMatch () const
                     QString family () const
                     bool fixedPitch () const
                     FT_Face freetypeFace () const
                     bool fromString ( const QString & descrip )
                     HFONT handle () const
                     //bool isCopyOf ( const QFont & f ) const
                     bool italic () const
                     bool kerning () const
                     QString key () const
                     QString lastResortFamily () const
                     QString lastResortFont () const
                     qreal letterSpacing () const
                     SpacingType letterSpacingType () const
                     //quint32 macFontID () const
                     bool overline () const
                     int pixelSize () const
                     int pointSize () const
                     qreal pointSizeF () const
                     bool rawMode () const
                     QString rawName () const
                     QFont resolve ( const QFont & other ) const
                     void setBold ( bool enable )
                     void setCapitalization ( Capitalization caps )
                     void setFamily ( const QString & family )
                     void setFixedPitch ( bool enable )
                     void setItalic ( bool enable )
                     void setKerning ( bool enable )
                     void setLetterSpacing ( SpacingType type, qreal spacing )
                     void setOverline ( bool enable )
                     void setPixelSize ( int pixelSize )
                     void setPointSize ( int pointSize )
                     void setPointSizeF ( qreal pointSize )
                     void setRawMode ( bool enable )
                     void setRawName ( const QString & name )
                     void setStretch ( int factor )
                     void setStrikeOut ( bool enable )
                     void setStyle ( Style style )
                     void setStyleHint ( StyleHint hint, StyleStrategy strategy 
= PreferDefault )
                     void setStyleStrategy ( StyleStrategy s )
                     void setUnderline ( bool enable )
                     void setWeight ( int weight )
                     void setWordSpacing ( qreal spacing )
                     int stretch () const
                     bool strikeOut () const
                     Style style () const
                     StyleHint styleHint () const
                     StyleStrategy styleStrategy () const
                     QString toString () const
                     bool underline () const
                     int weight () const
                     qreal wordSpacing () const


       
       Comments   :  #  // 

       Enumerators: enum definitions must be included what exists in the 
                    help documenttaion. It has special significan while 
                    parsing the prototypes.
  
       UserCode   : Anything contained in <CODE> </CODE> construct will be 
                    written directly in the .cpp as is. Developer is responsible
                    to insert syntatically correct code. usually constructor
                    function goes here. And may be complex functions be
                    put under it. Also if some special #include command is 
needed.

       Prototype  : Not all prototypes are included in the source .cpp at the 
                    moment. I need more help on this front how we detect and 
                    format the parameters. I am struck specially at something
                    like   <const QFont & other> . Przemek?

                    Bottom line: Copy and Paste all prototypes from the docs,
                    generate the .cpp, compile it, check which function raises
                    error, comment it out in .qth with either "//" or "#",
                    regenerate .cpp until all errors are covered, copy .cpp 
                    into production folder.
                 
    */

Modified Paths:
--------------
    trunk/harbour/ChangeLog
    trunk/harbour/contrib/hbqt/hbqt.h
    trunk/harbour/contrib/hbqt/hbqt_qfont.cpp

Added Paths:
-----------
    trunk/harbour/contrib/hbqt/generator/
    trunk/harbour/contrib/hbqt/generator/hbqtgen.prg
    trunk/harbour/contrib/hbqt/qth/
    trunk/harbour/contrib/hbqt/qth/QBrush.qth
    trunk/harbour/contrib/hbqt/qth/QFont.qth
    trunk/harbour/contrib/hbqt/qth/QPen.qth
    trunk/harbour/contrib/hbqt/qth/QWidget.qth


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to