diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 788d96e0a4..3c4d98bd49 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-20 14:28 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/contrib/hbcairo/pdf.c + * harbour/contrib/hbcairo/png.c + * updated harbour level functions to be available, but return error + result, if it is not supported by some version of cairo library + * harbour/contrib/hbcairo/image.c + * comment typo + 2010-01-19 17:46 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_hbqsyntaxhighlighter.cpp * contrib/hbqt/hbqt_hbqsyntaxhighlighter.h diff --git a/harbour/contrib/hbcairo/image.c b/harbour/contrib/hbcairo/image.c index 9a26fcf75f..bc0db71080 100644 --- a/harbour/contrib/hbcairo/image.c +++ b/harbour/contrib/hbcairo/image.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Cairo library: pdf + * Cairo library: image * * Copyright 2009 Mindaugas Kavaliauskas * www - http://www.harbour-project.org diff --git a/harbour/contrib/hbcairo/pdf.c b/harbour/contrib/hbcairo/pdf.c index 26d83c3aa0..97ab7cd82b 100644 --- a/harbour/contrib/hbcairo/pdf.c +++ b/harbour/contrib/hbcairo/pdf.c @@ -55,19 +55,24 @@ #include "cairo-pdf.h" -#ifdef CAIRO_HAS_PDF_SURFACE - HB_FUNC( CAIRO_PDF_SURFACE_CREATE ) { +#ifdef CAIRO_HAS_PDF_SURFACE hb_cairo_surface_ret( cairo_pdf_surface_create( hb_parc( 1 ), hb_parnd( 2 ), hb_parnd( 3 ) ) ); +#else + hb_retptr( NULL ); +#endif } HB_FUNC( CAIRO_PDF_SURFACE_SET_SIZE ) { +#ifdef CAIRO_HAS_PDF_SURFACE cairo_surface_t * pSurface = hb_cairo_surface_param( 1 ); if( pSurface ) cairo_pdf_surface_set_size( pSurface, hb_parnd( 2 ), hb_parnd( 3 ) ); +#else + /* Just paramter validation */ + hb_cairo_surface_param( 1 ); +#endif } - -#endif /* CAIRO_HAS_PDF_SURFACE */ diff --git a/harbour/contrib/hbcairo/png.c b/harbour/contrib/hbcairo/png.c index d5c36548dd..80d7fd2ba8 100644 --- a/harbour/contrib/hbcairo/png.c +++ b/harbour/contrib/hbcairo/png.c @@ -54,17 +54,25 @@ #include "hbcairo.h" -#ifdef CAIRO_HAS_PNG_FUNCTIONS - HB_FUNC( CAIRO_IMAGE_SURFACE_CREATE_FROM_PNG ) { +#ifdef CAIRO_HAS_PNG_FUNCTIONS hb_cairo_surface_ret( cairo_image_surface_create_from_png( hb_parc( 1 ) ) ); +#else + hb_retptr( NULL ); +#endif } HB_FUNC( CAIRO_SURFACE_WRITE_TO_PNG ) { - hb_retni( cairo_surface_write_to_png( hb_cairo_surface_param( 1 ), hb_parc( 2 ) ) ); +#ifdef CAIRO_HAS_PNG_FUNCTIONS + cairo_surface_t * pSurface = hb_cairo_surface_param( 1 ); + if( pSurface ) + hb_retni( cairo_surface_write_to_png( pSurface, hb_parc( 2 ) ) ); +#else + hb_cairo_surface_param( 1 ); /* Parameter validation */ + hb_retni( -1 ); /* There is no good CAIRO_STATUS_* for this */ +#endif } -#endif /* CAIRO_HAS_PNG_FUNCTIONS */