diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0fe31cc58b..1737b3b251 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-11 21:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtcore/hbqt_pointer.cpp + * contrib/hbqt/qtcore/hbqt.h + + Added int hbqt_IsObjectType( int iParam, int iType ). + [Francesco Perillo - with some of my mods] + 2011-02-11 19:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/base64d.c ! Err... diff --git a/harbour/contrib/hbqt/qtcore/hbqt.h b/harbour/contrib/hbqt/qtcore/hbqt.h index 5d17520446..bb3a355918 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt.h +++ b/harbour/contrib/hbqt/qtcore/hbqt.h @@ -93,6 +93,7 @@ extern HB_EXPORT void * hbqt_gcpointer( int iParam ); extern HB_EXPORT void * hbqt_detachgcpointer( int iParam ); extern HB_EXPORT const HB_GC_FUNCS * hbqt_gcFuncs( void ); extern HB_EXPORT void * hbqt_pPtrFromObj( int iParam ); +extern HB_EXPORT int hbqt_IsObjectType( int iParam, int iType ); extern HB_EXPORT void hbqt_errRT_ARG( void ); HB_EXTERN_END diff --git a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp index fb424f14b0..4d127d0986 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp +++ b/harbour/contrib/hbqt/qtcore/hbqt_pointer.cpp @@ -186,6 +186,36 @@ void * hbqt_pPtrFromObj( int iParam ) } } +int hbqt_IsObjectType( int iParam, int iType ) +{ + PHB_ITEM pItem; + + HB_TRACE( HB_TR_DEBUG, ( "hbqt_IsObjectType( %d )", iParam ) ); + + if( ( pItem = hb_param( iParam, HB_IT_OBJECT ) ) != NULL ) + { + HBQT_GC_T * p; + + hb_vmPushSymbol( hb_dynsymSymbol( hb_dynsymFindName( "PPTR" ) ) ); + hb_vmPush( pItem ); + hb_vmSend( 0 ); + + pItem = hb_param( -1, HB_IT_POINTER ); + + if( pItem ) + { + p = ( HBQT_GC_T * ) hb_itemGetPtrGC( pItem, hbqt_gcFuncs() ); + + if( p && p->ph ) + return p->type == iType; + } + } + + /* hbqt_errRT_ARG(); */ /* NOTE: Could not check type for whatever reason */ + + return HB_FALSE; +} + HB_FUNC( HBQT_ISOBJECT ) { PHB_ITEM pParam = hb_param( 1, HB_IT_OBJECT );