2010-01-18 14:36 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* hbwin/hbwapi.h
  * hbwin/win_prn1.c
    + Added HFONT GC interface.
This commit is contained in:
Viktor Szakats
2010-01-18 13:37:42 +00:00
parent 0ef977b36e
commit 5a3c61ba54
3 changed files with 30 additions and 10 deletions

View File

@@ -17,6 +17,11 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-18 14:36 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* hbwin/hbwapi.h
* hbwin/win_prn1.c
+ Added HFONT GC interface.
2010-01-18 13:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/win_prn1.c
* contrib/hbwin/hbwapi.h

View File

@@ -104,9 +104,11 @@ HB_EXPORT DWORD hbwapi_GetLastError( void );
HB_EXPORT HDC hbwapi_par_HDC( int iParam );
HB_EXPORT HPEN hbwapi_par_HPEN( int iParam );
HB_EXPORT HFONT hbwapi_par_HFONT( int iParam );
HB_EXPORT void hbwapi_ret_HDC( HDC p );
HB_EXPORT void hbwapi_ret_HPEN( HPEN p );
HB_EXPORT void hbwapi_ret_HFONT( HFONT p );
HB_EXTERN_END

View File

@@ -185,6 +185,27 @@ static const HB_GC_FUNCS s_gc_HFONT_funcs =
hb_gcDummyMark
};
void hbwapi_ret_HFONT( HFONT p )
{
if( p )
{
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HFONT * ), &s_gc_HFONT_funcs );
*ph = p;
hb_retptrGC( ph );
}
else
hb_retptr( NULL );
}
HFONT hbwapi_par_HFONT( int iParam )
{
void ** ph = ( void ** ) hb_parptrGC( &s_gc_HFONT_funcs, iParam );
return ph ? ( HFONT ) * ph : ( HFONT ) hb_parptr( iParam );
}
HB_FUNC( WIN_CREATEDC )
{
if( HB_ISCHAR( 1 ) )
@@ -428,18 +449,10 @@ HB_FUNC( WIN_CREATEFONT )
hb_strfree( hFontFace );
hbwapi_ret_HFONT( hFont );
if( hFont )
{
void ** ph = ( void ** ) hb_gcAllocate( sizeof( HFONT * ), &s_gc_HFONT_funcs );
*ph = hFont;
hb_retptrGC( ph );
SelectObject( hDC, hFont );
}
else
hb_retptr( NULL );
}
else
hb_retptr( NULL );