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]
This commit is contained in:
Viktor Szakats
2011-02-11 20:34:11 +00:00
parent 31f4547614
commit 69d2cfd4a7
3 changed files with 37 additions and 0 deletions

View File

@@ -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...

View File

@@ -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

View File

@@ -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 );