From 2aa3c558ce24883da3ffaeaf02242538ae97265f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 13 Nov 2012 02:04:22 +0000 Subject: [PATCH] 2012-11-13 03:03 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbfimage/fi_winfu.c * missed to include it in one of the recent entries: FI_LOADFROMMEM() has been renamed to FI_LOADFROMMEMORY() to be in sync with original FreeImage function name. Update your apps accordingly. INCOMPATIBLE. * contrib/hbfimage/tests/fitest.prg ! synced with above lib change * contrib/hbfimage/fi_winfu.c * contrib/hbfimage/fi_wrp.c * contrib/hbgd/gdwrp.c * contrib/hbgd/gd.prg * deleted excessive {} and () operators * eliminated split lines where only one char was present in a line % replaced RTE generator calls to more compact ones % dropped pcount() checks where HB_IS*() checks were present anyway * merged separate var declarations and initializations in wrapper code % eliminated local variables where it didn't make code less obvious % adujsted a few var scopes * deleted repetitive comments % protected hb_parcx() calls changed to hb_parc() ! GDIMAGESTRING(), GDIMAGESTRINGUP(), GDIMAGECHAR(), GDIMAGECHARUP() fixed for 1 character long strings. Code tried to retrieve a character by using hb_parni() which (purposefully) isn't supported in Harbour. The current effect is the same, with negligibly performance loss for one long strings. % GDIMAGECHAR(), GDIMAGECHARUP() now use C level forwarder. % using hb_parnintdef() ! fixed typo in RTE message % using hb_default() in gd.prg % number of LOC, source size (-24KB) and generated binary code greatly reduced by the above. * src/rtl/tclass.prg * src/rtl/tobject.prg * commented code changed to #if 0 blocks ! some commented code fixed * some obsolete comments deleted * utils/hbmk2/hbmk2.prg + added following options to .hbc files: keywords= licenses= repository= all only informational, they do nothing ATM. --- harbour/ChangeLog | 51 + harbour/contrib/hbfimage/fi_winfu.c | 71 +- harbour/contrib/hbfimage/fi_wrp.c | 1718 ++++----------------- harbour/contrib/hbfimage/tests/fitest.prg | 2 +- harbour/contrib/hbgd/gd.prg | 84 +- harbour/contrib/hbgd/gdwrp.c | 1370 ++++------------ harbour/src/rtl/tclass.prg | 24 +- harbour/src/rtl/tobject.prg | 82 +- harbour/utils/hbmk2/hbmk2.prg | 12 + 9 files changed, 783 insertions(+), 2631 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6fc49bea4b..e48fe78d03 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,57 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-13 03:03 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/hbfimage/fi_winfu.c + * missed to include it in one of the recent entries: + FI_LOADFROMMEM() has been renamed to FI_LOADFROMMEMORY() + to be in sync with original FreeImage function name. + Update your apps accordingly. INCOMPATIBLE. + + * contrib/hbfimage/tests/fitest.prg + ! synced with above lib change + + * contrib/hbfimage/fi_winfu.c + * contrib/hbfimage/fi_wrp.c + * contrib/hbgd/gdwrp.c + * contrib/hbgd/gd.prg + * deleted excessive {} and () operators + * eliminated split lines where only one char was present in a line + % replaced RTE generator calls to more compact ones + % dropped pcount() checks where HB_IS*() checks were + present anyway + * merged separate var declarations and initializations in + wrapper code + % eliminated local variables where it didn't make code + less obvious + % adujsted a few var scopes + * deleted repetitive comments + % protected hb_parcx() calls changed to hb_parc() + ! GDIMAGESTRING(), GDIMAGESTRINGUP(), GDIMAGECHAR(), GDIMAGECHARUP() + fixed for 1 character long strings. Code tried to retrieve a character + by using hb_parni() which (purposefully) isn't supported in Harbour. + The current effect is the same, with negligibly performance + loss for one long strings. + % GDIMAGECHAR(), GDIMAGECHARUP() now use C level forwarder. + % using hb_parnintdef() + ! fixed typo in RTE message + % using hb_default() in gd.prg + % number of LOC, source size (-24KB) and generated binary + code greatly reduced by the above. + + * src/rtl/tclass.prg + * src/rtl/tobject.prg + * commented code changed to #if 0 blocks + ! some commented code fixed + * some obsolete comments deleted + + * utils/hbmk2/hbmk2.prg + + added following options to .hbc files: + keywords= + licenses= + repository= + all only informational, they do nothing ATM. + 2012-11-12 16:35 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/include/hbexpra.c ! fixed recently added error in macrocompiler mode diff --git a/harbour/contrib/hbfimage/fi_winfu.c b/harbour/contrib/hbfimage/fi_winfu.c index 3ac7d39964..5f61544b66 100644 --- a/harbour/contrib/hbfimage/fi_winfu.c +++ b/harbour/contrib/hbfimage/fi_winfu.c @@ -73,9 +73,7 @@ HB_FUNC( FI_WINCONVTODIB ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { #if ! defined( HB_OS_WIN_CE ) FIBITMAP * dib; @@ -98,33 +96,22 @@ HB_FUNC( FI_WINCONVTODIB ) #endif } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Convert from HBITMAP to FreeImage */ HB_FUNC( FI_WINCONVFROMDIB ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { #if ! defined( HB_OS_WIN_CE ) - FIBITMAP * dib; - HBITMAP bitmap; - - /* Retrieve parameters */ - bitmap = ( HBITMAP ) hb_parptr( 1 ); - - /* run function */ - dib = NULL; + HBITMAP bitmap = ( HBITMAP ) hb_parptr( 1 ); if( bitmap ) { + FIBITMAP * dib; + BITMAP bm; HDC hDC; @@ -134,38 +121,31 @@ HB_FUNC( FI_WINCONVFROMDIB ) GetDIBits( hDC, bitmap, 0, FreeImage_GetHeight( dib ), FreeImage_GetBits( dib ), FreeImage_GetInfo( dib ), DIB_RGB_COLORS ); ReleaseDC( NULL, hDC ); - } - /* return value */ - if( dib ) - hb_retptr( dib ); + /* return value */ + if( dib ) + hb_retptr( dib ); + } #endif } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Draw an image in a window Box */ HB_FUNC( FI_WINDRAW ) { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { FIBITMAP * dib; HDC hDC; RECT rcDest; - int scanlines; /* Retrieve parameters */ dib = ( FIBITMAP * ) hb_parptr( 1 ); @@ -180,24 +160,17 @@ HB_FUNC( FI_WINDRAW ) SetStretchBltMode( hDC, COLORONCOLOR ); #endif - scanlines = StretchDIBits( hDC, rcDest.left, - rcDest.top, - rcDest.right - rcDest.left, - rcDest.bottom - rcDest.top, - 0, 0, FreeImage_GetWidth( dib ), FreeImage_GetHeight( dib ), - FreeImage_GetBits( dib ), FreeImage_GetInfo( dib ), - DIB_RGB_COLORS, SRCCOPY ); - - /* return value */ - hb_retni( scanlines ); + /* return scanlines */ + hb_retni( StretchDIBits( hDC, rcDest.left, + rcDest.top, + rcDest.right - rcDest.left, + rcDest.bottom - rcDest.top, + 0, 0, FreeImage_GetWidth( dib ), FreeImage_GetHeight( dib ), + FreeImage_GetBits( dib ), FreeImage_GetInfo( dib ), + DIB_RGB_COLORS, SRCCOPY ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), - hb_paramError( 4 ), hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #else diff --git a/harbour/contrib/hbfimage/fi_wrp.c b/harbour/contrib/hbfimage/fi_wrp.c index 75e80a87ef..1b517fd802 100644 --- a/harbour/contrib/hbfimage/fi_wrp.c +++ b/harbour/contrib/hbfimage/fi_wrp.c @@ -81,34 +81,26 @@ static void * s_pErrorHandler = NULL; /* Init / Error routines */ /* --------------------- */ -/* DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE)); */ HB_FUNC( FI_INITIALISE ) { - /* Run function */ - FreeImage_Initialise( hb_fi_parl( 1 ) ); + FreeImage_Initialise( hb_fi_parl( 1 ) /* load_local_plugins_only */ ); } -/* DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void); */ HB_FUNC( FI_DEINITIALISE ) { - /* Run function */ FreeImage_DeInitialise(); } /* Version routines */ /* ---------------- */ -/* DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void); */ HB_FUNC( FI_GETVERSION ) { - /* Run function & return value */ hb_retc( FreeImage_GetVersion() ); } -/* DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void); */ HB_FUNC( FI_GETCOPYRIGHTMESSAGE ) { - /* Run function & return value */ hb_retc( FreeImage_GetCopyrightMessage() ); } @@ -123,7 +115,6 @@ HB_FUNC( FI_GETCOPYRIGHTMESSAGE ) /* implementation: void FreeImage_SetOutputMessage( pFunctionPointer ) */ /** - FreeImage error handler @param fif Format / Plugin responsible for the error @param message Error message */ @@ -131,8 +122,6 @@ static void FreeImageErrorHandler( FREE_IMAGE_FORMAT fif, const char * message ) { if( s_pErrorHandler ) { - /*TraceLog( NULL, "ErrorHandle %p\n\r", s_pErrorHandler );*/ - if( hb_vmRequestReenter() ) { const char * format = FreeImage_GetFormatFromFIF( fif ); @@ -147,7 +136,7 @@ static void FreeImageErrorHandler( FREE_IMAGE_FORMAT fif, const char * message ) hb_vmRequestRestore(); } else - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, "FreeImageErrorHandler", 1, hb_paramError( 1 ) ); + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, "FreeImageErrorHandler", HB_ERR_ARGS_BASEPARAMS ); } } @@ -156,27 +145,11 @@ HB_FUNC( FI_SETOUTPUTMESSAGE ) s_pErrorHandler = NULL; FreeImage_SetOutputMessage( FreeImageErrorHandler ); -/* TraceLog( NULL, "PCount = %i\n\r", hb_pcount() ); */ - - if( hb_pcount() == 1 ) - { - if( HB_ISPOINTER( 1 ) ) - { - /* Set the pointer */ - s_pErrorHandler = hb_parptr( 1 ); - } - else if( HB_ISNIL( 1 ) ) - { - /* do nothing */ - } - else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } - } + if( HB_ISPOINTER( 1 ) ) + /* Set the pointer */ + s_pErrorHandler = hb_parptr( 1 ); + else if( ! HB_ISNIL( 1 ) ) + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Allocate / Clone / Unload routines */ @@ -185,120 +158,64 @@ HB_FUNC( FI_SETOUTPUTMESSAGE ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Allocate(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); */ HB_FUNC( FI_ALLOCATE ) { - if( hb_pcount() >= 3 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - int width, height, bpp; - unsigned red_mask, green_mask, blue_mask; + int width = hb_parni( 1 ); + int height = hb_parni( 2 ); + int bpp = hb_parni( 3 ); + unsigned red_mask = ( unsigned ) hb_parni( 4 ); + unsigned green_mask = ( unsigned ) hb_parni( 5 ); + unsigned blue_mask = ( unsigned ) hb_parni( 6 ); - /* Retrieve parameters */ - width = hb_parni( 1 ); - height = hb_parni( 2 ); - bpp = hb_parni( 3 ); - red_mask = ( unsigned ) hb_parni( 4 ); - green_mask = ( unsigned ) hb_parni( 5 ); - blue_mask = ( unsigned ) hb_parni( 6 ); - - /* run function & return value */ hb_retptr( FreeImage_Allocate( width, height, bpp, red_mask, green_mask, blue_mask ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateT(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); */ HB_FUNC( FI_ALLOCATET ) { - if( hb_pcount() >= 3 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FREE_IMAGE_TYPE type; - int width, height, bpp; - unsigned red_mask, green_mask, blue_mask; + FREE_IMAGE_TYPE type = ( FREE_IMAGE_TYPE ) hb_parni( 1 ); + int width = hb_parni( 2 ); + int height = hb_parni( 3 ); + int bpp = hb_parni( 3 ); + unsigned red_mask = ( unsigned ) hb_parni( 4 ); + unsigned green_mask = ( unsigned ) hb_parni( 5 ); + unsigned blue_mask = ( unsigned ) hb_parni( 6 ); - /* Retrieve parameters */ - type = ( FREE_IMAGE_TYPE ) hb_parni( 1 ); - width = hb_parni( 2 ); - height = hb_parni( 3 ); - bpp = hb_parni( 3 ); - red_mask = ( unsigned ) hb_parni( 4 ); - green_mask = ( unsigned ) hb_parni( 5 ); - blue_mask = ( unsigned ) hb_parni( 6 ); - - /* run function & return value */ hb_retptr( FreeImage_AllocateT( type, width, height, bpp, red_mask, green_mask, blue_mask ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib); */ HB_FUNC( FI_CLONE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - FIBITMAP * dib; - FIBITMAP * fiClonePtr; + FIBITMAP * fiClonePtr = FreeImage_Clone( ( FIBITMAP * ) hb_parptr( 1 ) ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function */ - fiClonePtr = FreeImage_Clone( dib ); - - /* return value */ if( fiClonePtr ) hb_retptr( fiClonePtr ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib); */ HB_FUNC( FI_UNLOAD ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function */ - FreeImage_Unload( dib ); - - /* return value */ - } + if( HB_ISPOINTER( 1 ) ) + FreeImage_Unload( ( FIBITMAP * ) hb_parptr( 1 ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Load / Save routines */ @@ -309,72 +226,43 @@ HB_FUNC( FI_UNLOAD ) /* DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream); */ HB_FUNC( FI_LOADFROMMEMORY ) { - if( hb_pcount() == 3 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FIBITMAP * dib; - FREE_IMAGE_FORMAT fif; - FIMEMORY * stream; - const char * szImage; - int flags; + FREE_IMAGE_FORMAT fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); + const char * szImage = hb_parc( 2 ); + int flags = hb_parni( 3 ); - /* Retrieve parameters */ - fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); - szImage = hb_parcx( 2 ); - flags = hb_parni( 3 ); - - /* run function */ - stream = FreeImage_OpenMemory( ( BYTE * ) szImage, ( DWORD ) hb_parclen( 2 ) ); - dib = FreeImage_LoadFromMemory( fif, stream, flags ); + FIMEMORY * stream = FreeImage_OpenMemory( ( BYTE * ) szImage, ( DWORD ) hb_parclen( 2 ) ); + FIBITMAP * dib = FreeImage_LoadFromMemory( fif, stream, flags ); FreeImage_CloseMemory( stream ); - /* return value */ if( dib ) hb_retptr( dib ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0)); */ HB_FUNC( FI_LOAD ) { - if( hb_pcount() == 3 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FIBITMAP * dib; - FREE_IMAGE_FORMAT fif; - const char * filename; - int flags; + FREE_IMAGE_FORMAT fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); + const char * filename = hb_parc( 2 ); + int flags = hb_parni( 3 ); - /* Retrieve parameters */ - fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); - filename = hb_parcx( 2 ); - flags = hb_parni( 3 ); + FIBITMAP * dib = FreeImage_Load( fif, filename, flags ); - /* run function */ - dib = FreeImage_Load( fif, filename, flags ); - - /* return value */ if( dib ) hb_retptr( dib ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0)); */ @@ -383,33 +271,20 @@ HB_FUNC( FI_LOAD ) /* DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0)); */ HB_FUNC( FI_SAVE ) { - if( hb_pcount() == 4 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) && HB_ISCHAR( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { - FREE_IMAGE_FORMAT fif; - FIBITMAP * dib; - const char * filename; - int flags; + FREE_IMAGE_FORMAT fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 2 ); + const char * filename = hb_parc( 3 ); + int flags = hb_parni( 4 ); - /* Retrieve parameters */ - fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); - dib = ( FIBITMAP * ) hb_parptr( 2 ); - filename = hb_parcx( 3 ); - flags = hb_parni( 4 ); - - /* run function & return value */ hb_fi_retl( FreeImage_Save( fif, dib, filename, flags ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0)); */ @@ -459,254 +334,148 @@ HB_FUNC( FI_SAVE ) /* DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT fif, const char *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0)); */ HB_FUNC( FI_OPENMULTIBITMAP ) { - if( hb_pcount() >= 4 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISCHAR( 2 ) && HB_ISLOG( 3 ) && - HB_ISLOG( 4 ) - ) + HB_ISLOG( 4 ) ) { - FIMULTIBITMAP * dib; - FREE_IMAGE_FORMAT fif; - const char * filename; - BOOL create_new; - BOOL read_only; - BOOL keep_cache_in_memory; - int flags; + FREE_IMAGE_FORMAT fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); + const char * filename = hb_parc( 2 ); + BOOL create_new = hb_fi_parl( 3 ); + BOOL read_only = hb_fi_parl( 4 ); + BOOL keep_cache_in_memory = hb_fi_parl( 5 ); + int flags = hb_parni( 6 ); - /* Retrieve parameters */ - fif = ( FREE_IMAGE_FORMAT ) hb_parni( 1 ); - filename = hb_parcx( 2 ); - create_new = hb_fi_parl( 3 ); - read_only = hb_fi_parl( 4 ); - keep_cache_in_memory = hb_fi_parl( 5 ); - flags = hb_parni( 6 ); + FIMULTIBITMAP * dib = FreeImage_OpenMultiBitmap( fif, filename, create_new, read_only, keep_cache_in_memory, flags ); - /* run function */ - dib = FreeImage_OpenMultiBitmap( fif, filename, create_new, read_only, keep_cache_in_memory, flags ); - - /* return value */ if( dib ) hb_retptr( dib ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0)); */ HB_FUNC( FI_CLOSEMULTIBITMAP ) { - if( hb_pcount() >= 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - FIMULTIBITMAP * bitmap; - int flags; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + int flags = hb_parni( 2 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - flags = hb_parni( 2 ); - - /* run function & return value */ hb_fi_retl( FreeImage_CloseMultiBitmap( bitmap, flags ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap); */ HB_FUNC( FI_GETPAGECOUNT ) { - if( hb_pcount() >= 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - FIMULTIBITMAP * bitmap; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ hb_retni( FreeImage_GetPageCount( bitmap ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data); */ HB_FUNC( FI_APPENDPAGE ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISPOINTER( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISPOINTER( 2 ) ) { - FIMULTIBITMAP * bitmap; - FIBITMAP * data; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + FIBITMAP * data = ( FIBITMAP * ) hb_parptr( 2 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - data = ( FIBITMAP * ) hb_parptr( 2 ); - - /* run function & return value */ FreeImage_AppendPage( bitmap, data ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data); */ HB_FUNC( FI_INSERTPAGE ) { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISPOINTER( 3 ) - ) + HB_ISPOINTER( 3 ) ) { - FIMULTIBITMAP * bitmap; - int page; - FIBITMAP * data; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + int page = hb_parni( 2 ) - 1; /* 0-based index */ + FIBITMAP * data = ( FIBITMAP * ) hb_parptr( 3 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - page = hb_parni( 2 ) - 1; /* 0-based index */ - data = ( FIBITMAP * ) hb_parptr( 3 ); - - /* run function & return value */ FreeImage_InsertPage( bitmap, page, data ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page); */ HB_FUNC( FI_DELETEPAGE ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIMULTIBITMAP * bitmap; - int page; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + int page = hb_parni( 2 ) - 1; /* 0-based index */ - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - page = hb_parni( 2 ) - 1; /* 0-based index */ - - /* run function & return value */ FreeImage_DeletePage( bitmap, page ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page); */ HB_FUNC( FI_LOCKPAGE ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIMULTIBITMAP * bitmap; - int page; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + int page = hb_parni( 2 ) - 1; /* 0-based index */ - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - page = hb_parni( 2 ) - 1; /* 0-based index */ - - /* run function & return value */ hb_retptr( FreeImage_LockPage( bitmap, page ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *page, BOOL changed); */ HB_FUNC( FI_UNLOCKPAGE ) { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISLOG( 3 ) - ) + HB_ISLOG( 3 ) ) { - FIMULTIBITMAP * bitmap; - FIBITMAP * page; - BOOL changed; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + FIBITMAP * page = ( FIBITMAP * ) hb_parptr( 2 ); + BOOL changed = hb_fi_parl( 3 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - page = ( FIBITMAP * ) hb_parptr( 2 ); - changed = hb_fi_parl( 3 ); - - /* run function & return value */ FreeImage_UnlockPage( bitmap, page, changed ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source); */ HB_FUNC( FI_MOVEPAGE ) { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FIMULTIBITMAP * bitmap; - int target, source; + FIMULTIBITMAP * bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); + int target = hb_parni( 2 ); + int source = hb_parni( 3 ); - /* Retrieve parameters */ - bitmap = ( FIMULTIBITMAP * ) hb_parptr( 1 ); - target = hb_parni( 2 ); - source = hb_parni( 3 ); - - /* run function & return value */ hb_fi_retl( FreeImage_MovePage( bitmap, target, source ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count); */ @@ -717,26 +486,15 @@ HB_FUNC( FI_MOVEPAGE ) /* DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0)); */ HB_FUNC( FI_GETFILETYPE ) { - if( hb_pcount() >= 1 && - HB_ISCHAR( 1 ) - ) + if( HB_ISCHAR( 1 ) ) { - const char * filename; - int size; + const char * filename = hb_parc( 1 ); + int size = ( int ) hb_parclen( 1 ); - /* Retrieve parameters */ - filename = hb_parcx( 1 ); - size = ( int ) hb_parclen( 1 ); - - /* run function & return value */ hb_retni( FreeImage_GetFileType( filename, size ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0)); */ @@ -744,55 +502,28 @@ HB_FUNC( FI_GETFILETYPE ) /* DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0)); */ HB_FUNC( FI_GETFILETYPEFROMMEMORY ) { - if( hb_pcount() >= 1 && - HB_ISCHAR( 1 ) - ) + if( HB_ISCHAR( 1 ) ) { - const char * szImage; - FIMEMORY * stream; - int size; + FIMEMORY * stream = FreeImage_OpenMemory( ( BYTE * ) hb_parc( 1 ), ( int ) hb_parclen( 1 ) ); + int size = hb_parni( 1 ); - /* Retrieve parameters */ - szImage = hb_parcx( 1 ); - stream = FreeImage_OpenMemory( ( BYTE * ) szImage, ( int ) hb_parclen( 1 ) ); - size = hb_parni( 1 ); - - /* run function & return value */ hb_retni( FreeImage_GetFileTypeFromMemory( stream, size ) ); + FreeImage_CloseMemory( stream ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Image type request routine */ /* -------------------------- */ -/* DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib); */ HB_FUNC( FI_GETIMAGETYPE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetImageType( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetImageType( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* FreeImage helper routines */ @@ -801,7 +532,6 @@ HB_FUNC( FI_GETIMAGETYPE ) /* DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void); */ HB_FUNC( FI_ISLITTLEENDIAN ) { - /* run function & return value */ hb_fi_retl( FreeImage_IsLittleEndian() ); } @@ -812,53 +542,27 @@ HB_FUNC( FI_ISLITTLEENDIAN ) /* Pixel access routines */ /* --------------------- */ -/* DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib); */ HB_FUNC( FI_GETBITS ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_GetBits( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_GetBits( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline); */ HB_FUNC( FI_GETSCANLINE ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - int scanline; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + int scanline = hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - scanline = hb_parni( 2 ); - - /* run function & return value */ hb_retptr( FreeImage_GetScanLine( dib, scanline ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* @@ -871,619 +575,261 @@ HB_FUNC( FI_GETSCANLINE ) /* DIB info routines */ /* ----------------- */ -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib); */ HB_FUNC( FI_GETCOLORSUSED ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetColorsUsed( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetColorsUsed( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib); */ HB_FUNC( FI_GETBPP ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetBPP( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetBPP( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib); */ HB_FUNC( FI_GETWIDTH ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetWidth( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetWidth( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib); */ HB_FUNC( FI_GETHEIGHT ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetHeight( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetHeight( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib); */ HB_FUNC( FI_GETLINE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetLine( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetLine( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib); */ HB_FUNC( FI_GETPITCH ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetPitch( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetPitch( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib); */ HB_FUNC( FI_GETDIBSIZE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetDIBSize( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetDIBSize( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib); */ HB_FUNC( FI_GETPALETTE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_GetPalette( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_GetPalette( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib); */ HB_FUNC( FI_GETDOTSPERMETERX ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetDotsPerMeterX( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetDotsPerMeterX( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib); */ HB_FUNC( FI_GETDOTSPERMETERY ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retnl( FreeImage_GetDotsPerMeterY( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retnl( FreeImage_GetDotsPerMeterY( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res); */ HB_FUNC( FI_SETDOTSPERMETERX ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - unsigned res; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + unsigned res = ( unsigned ) hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - res = ( unsigned ) hb_parni( 2 ); - - /* run function & return value */ FreeImage_SetDotsPerMeterX( dib, res ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res); */ HB_FUNC( FI_SETDOTSPERMETERY ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - unsigned res; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + unsigned res = ( unsigned ) hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - res = ( unsigned ) hb_parni( 2 ); - - /* run function & return value */ FreeImage_SetDotsPerMeterY( dib, res ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib); */ HB_FUNC( FI_GETINFOHEADER ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; + if( HB_ISPOINTER( 1 ) ) /* We need not worry about Memory Management - will be automatically released! */ - /*BITMAPINFOHEADER * bmpinfoheader = (BITMAPINFOHEADER *) hb_xgrab( sizeof( BITMAPINFOHEADER ) );*/ - BITMAPINFOHEADER * bmpinfoheader; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - bmpinfoheader = FreeImage_GetInfoHeader( dib ); - - /*hb_retclenAdoptRaw( (char *) bmpinfoheader, sizeof( BITMAPINFOHEADER ) );*/ - hb_retptr( bmpinfoheader ); - } + hb_retptr( FreeImage_GetInfoHeader( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib); */ HB_FUNC( FI_GETINFO ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - BITMAPINFO * bmpinfo; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - bmpinfo = FreeImage_GetInfo( dib ); - - hb_retptr( bmpinfo ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_GetInfo( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib); */ HB_FUNC( FI_GETCOLORTYPE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetColorType( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetColorType( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib); */ HB_FUNC( FI_GETREDMASK ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetRedMask( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetRedMask( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib); */ HB_FUNC( FI_GETGREENMASK ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetGreenMask( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetGreenMask( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib); */ HB_FUNC( FI_GETBLUEMASK ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetBlueMask( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetBlueMask( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib); */ HB_FUNC( FI_GETTRANSPARENCYCOUNT ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retni( FreeImage_GetTransparencyCount( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retni( FreeImage_GetTransparencyCount( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib); */ HB_FUNC( FI_GETTRANSPARENCYTABLE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_GetTransparencyTable( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_GetTransparencyTable( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled); */ HB_FUNC( FI_SETTRANSPARENT ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISLOG( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISLOG( 2 ) ) { - FIBITMAP * dib; - BOOL enabled; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + BOOL enabled = hb_fi_parl( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - enabled = hb_fi_parl( 2 ); - - /* run function & return value */ FreeImage_SetTransparent( dib, enabled ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count); */ HB_FUNC( FI_SETTRANSPARENCYTABLE ) { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FIBITMAP * dib; - BYTE * table; - int count; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + BYTE * table = ( BYTE * ) hb_parptr( 2 ); + int count = hb_parni( 3 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - table = ( BYTE * ) hb_parptr( 2 ); - count = hb_parni( 3 ); - - /* run function & return value */ FreeImage_SetTransparencyTable( dib, table, count ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib); */ HB_FUNC( FI_ISTRANSPARENT ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_fi_retl( FreeImage_IsTransparent( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_fi_retl( FreeImage_IsTransparent( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib); */ HB_FUNC( FI_HASBACKGROUNDCOLOR ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_fi_retl( FreeImage_HasBackgroundColor( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_fi_retl( FreeImage_HasBackgroundColor( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor); */ HB_FUNC( FI_GETBACKGROUNDCOLOR ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) /*&& HB_ISCHAR( 2 )*/ - ) + if( HB_ISPOINTER( 1 ) + /* && HB_ISCHAR( 2 ) */ ) { FIBITMAP * dib; RGBQUAD * bkcolor = NULL; /* Retrieve parameters */ dib = ( FIBITMAP * ) hb_parptr( 1 ); - /*bkcolor = ( RGBQUAD * ) hb_param( 2, HB_IT_STRING )->item.asString.value;*/ - /*bkcolor = ( RGBQUAD * ) hb_parptr( 2 );*/ + /* bkcolor = ( RGBQUAD * ) hb_parc( 2 ); */ + /* bkcolor = ( RGBQUAD * ) hb_parptr( 2 ); */ - /* run function & return value */ - /*hb_fi_retl( FreeImage_GetBackgroundColor(dib, bkcolor) );*/ + /* hb_fi_retl( FreeImage_GetBackgroundColor(dib, bkcolor) ); */ FreeImage_GetBackgroundColor( dib, bkcolor ); - /*hb_storptr( bkcolor, 2 );*/ + /* hb_storptr( bkcolor, 2 ); */ hb_retptr( bkcolor ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor); */ HB_FUNC( FI_SETBACKGROUNDCOLOR ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - /*HB_ISPOINTER( 2 )*/ - HB_ISCHAR( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + /* HB_ISPOINTER( 2 ) */ + HB_ISCHAR( 2 ) ) { FIBITMAP * dib; RGBQUAD * bkcolor; @@ -1491,98 +837,50 @@ HB_FUNC( FI_SETBACKGROUNDCOLOR ) /* Retrieve parameters */ dib = ( FIBITMAP * ) hb_parptr( 1 ); bkcolor = ( RGBQUAD * ) hb_itemGetCPtr( hb_param( 2, HB_IT_STRING ) ); - /*bkcolor = ( RGBQUAD * ) hb_parptr( 2 );*/ + /* bkcolor = ( RGBQUAD * ) hb_parptr( 2 ); */ - /* run function & return value */ hb_fi_retl( FreeImage_SetBackgroundColor( dib, bkcolor ) ); /* FreeImage_GetBackgroundColor(dib, bkcolor); */ /* hb_retptr( bkcolor ); */ } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* ICC profile routines */ /* -------------------- */ -/* DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib); */ HB_FUNC( FI_GETICCPROFILE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_GetICCProfile( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_GetICCProfile( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size); */ HB_FUNC( FI_CREATEICCPROFILE ) { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { - FIBITMAP * dib; - void * data; - long size; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + void * data = hb_parptr( 2 ); + long size = hb_parnl( 3 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - data = hb_parptr( 2 ); - size = hb_parnl( 3 ); - - /* run function & return value */ hb_retptr( FreeImage_CreateICCProfile( dib, data, size ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib); */ HB_FUNC( FI_DESTROYICCPROFILE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - FreeImage_DestroyICCProfile( dib ); - } + if( HB_ISPOINTER( 1 ) ) + FreeImage_DestroyICCProfile( ( FIBITMAP * ) hb_parptr( 1 ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* Line conversion routines */ @@ -1630,199 +928,75 @@ HB_FUNC( FI_DESTROYICCPROFILE ) /* Smart conversion routines */ /* ------------------------- */ -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO4BITS ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo4Bits( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo4Bits( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO8BITS ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo8Bits( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo8Bits( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTOGREYSCALE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertToGreyscale( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertToGreyscale( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO16BITS555 ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo16Bits555( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo16Bits555( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO16BITS565 ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo16Bits565( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo16Bits565( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO24BITS ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo24Bits( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo24Bits( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTO32BITS ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertTo32Bits( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertTo32Bits( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize); */ HB_FUNC( FI_COLORQUANTIZE ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - FREE_IMAGE_QUANTIZE quantize; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + FREE_IMAGE_QUANTIZE quantize = ( FREE_IMAGE_QUANTIZE ) hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - quantize = ( FREE_IMAGE_QUANTIZE ) hb_parni( 2 ); - - /* run function & return value */ hb_retptr( FreeImage_ColorQuantize( dib, quantize ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize FI_DEFAULT(FIQ_WUQUANT), int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL)); */ @@ -1831,110 +1005,57 @@ HB_FUNC( FI_COLORQUANTIZE ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm); */ HB_FUNC( FI_DITHER ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - FREE_IMAGE_DITHER algorithm; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + FREE_IMAGE_DITHER algorithm = ( FREE_IMAGE_DITHER ) hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - algorithm = ( FREE_IMAGE_DITHER ) hb_parni( 2 ); - - /* run function & return value */ hb_retptr( FreeImage_Dither( dib, algorithm ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBits(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE)); */ /* DLL_API void DLL_CALLCONV FreeImage_ConvertToRawBits(BYTE *bits, FIBITMAP *dib, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE)); */ -/* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib); */ HB_FUNC( FI_CONVERTTORGBF ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_retptr( FreeImage_ConvertToRGBF( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_retptr( FreeImage_ConvertToRGBF( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE)); */ HB_FUNC( FI_CONVERTTOSTANDARDTYPE ) { - if( hb_pcount() >= 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - FIBITMAP * dib; - BOOL scale_linear; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + BOOL scale_linear = HB_ISLOG( 2 ) ? hb_fi_parl( 2 ) : TRUE; - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - scale_linear = ( HB_ISLOG( 2 ) ) ? hb_fi_parl( 2 ) : TRUE; - - /* run function & return value */ hb_retptr( FreeImage_ConvertToStandardType( dib, scale_linear ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE)); */ HB_FUNC( FI_CONVERTTOTYPE ) { - if( hb_pcount() >= 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - FREE_IMAGE_TYPE dst_type; - BOOL scale_linear; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + FREE_IMAGE_TYPE dst_type = ( FREE_IMAGE_TYPE ) hb_parni( 2 ); + BOOL scale_linear = HB_ISLOG( 3 ) ? hb_fi_parl( 3 ) : TRUE; - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - dst_type = ( FREE_IMAGE_TYPE ) hb_parni( 2 ); - scale_linear = ( HB_ISLOG( 3 ) ) ? hb_fi_parl( 3 ) : TRUE; - - /* run function & return value */ hb_retptr( FreeImage_ConvertToType( dib, dst_type, scale_linear ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* tone mapping operators */ @@ -1999,112 +1120,57 @@ HB_FUNC( FI_CONVERTTOTYPE ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle); */ HB_FUNC( FI_ROTATECLASSIC ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - double angle; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + double angle = hb_parnd( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - angle = hb_parnd( 2 ); - - /* run function & return value */ hb_retptr( FreeImage_RotateClassic( dib, angle ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask); */ HB_FUNC( FI_ROTATEEX ) { - if( hb_pcount() == 7 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && HB_ISNUM( 6 ) && - HB_ISLOG( 7 ) - ) + HB_ISLOG( 7 ) ) { - FIBITMAP * dib; - double angle, x_shift, y_shift, x_origin, y_origin; - BOOL use_mask; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + double angle = hb_parnd( 2 ); + double x_shift = hb_parnd( 3 ); + double y_shift = hb_parnd( 4 ); + double x_origin = hb_parnd( 5 ); + double y_origin = hb_parnd( 6 ); + BOOL use_mask = hb_fi_parl( 7 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - angle = hb_parnd( 2 ); - x_shift = hb_parnd( 3 ); - y_shift = hb_parnd( 4 ); - x_origin = hb_parnd( 5 ); - y_origin = hb_parnd( 6 ); - use_mask = hb_fi_parl( 7 ); - - /* run function & return value */ hb_retptr( FreeImage_RotateEx( dib, angle, x_shift, y_shift, x_origin, y_origin, use_mask ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 7, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib); */ HB_FUNC( FI_FLIPHORIZONTAL ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_fi_retl( FreeImage_FlipHorizontal( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_fi_retl( FreeImage_FlipHorizontal( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib); */ HB_FUNC( FI_FLIPVERTICAL ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_fi_retl( FreeImage_FlipVertical( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_fi_retl( FreeImage_FlipVertical( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); */ @@ -2115,33 +1181,20 @@ HB_FUNC( FI_FLIPVERTICAL ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter); */ HB_FUNC( FI_RESCALE ) { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { - FIBITMAP * dib; - int dst_width, dst_height; - FREE_IMAGE_FILTER filter; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + int dst_width = hb_parni( 2 ); + int dst_height = hb_parni( 3 ); + FREE_IMAGE_FILTER filter = ( FREE_IMAGE_FILTER ) hb_parni( 4 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - dst_width = hb_parni( 2 ); - dst_height = hb_parni( 3 ); - filter = ( FREE_IMAGE_FILTER ) hb_parni( 4 ); - - /* run function & return value */ hb_retptr( FreeImage_Rescale( dib, dst_width, dst_height, filter ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* color manipulation routines (point operations) */ @@ -2152,106 +1205,54 @@ HB_FUNC( FI_RESCALE ) /* DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma); */ HB_FUNC( FI_ADJUSTGAMMA ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - double gamma; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + double gamma = hb_parnd( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - gamma = hb_parnd( 2 ); - - /* run function & return value */ hb_fi_retl( FreeImage_AdjustGamma( dib, gamma ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage); */ HB_FUNC( FI_ADJUSTBRIGHTNESS ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - double percentage; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + double percentage = hb_parnd( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - percentage = hb_parnd( 2 ); - - /* run function & return value */ hb_fi_retl( FreeImage_AdjustBrightness( dib, percentage ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage); */ HB_FUNC( FI_ADJUSTCONTRAST ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - double percentage; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + double percentage = hb_parnd( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - percentage = hb_parnd( 2 ); - - /* run function & return value */ hb_fi_retl( FreeImage_AdjustContrast( dib, percentage ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib); */ HB_FUNC( FI_INVERT ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) - { - FIBITMAP * dib; - - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - - /* run function & return value */ - hb_fi_retl( FreeImage_Invert( dib ) ); - } + if( HB_ISPOINTER( 1 ) ) + hb_fi_retl( FreeImage_Invert( ( FIBITMAP * ) hb_parptr( 1 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK)); */ @@ -2262,28 +1263,16 @@ HB_FUNC( FI_INVERT ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel); */ HB_FUNC( FI_GETCHANNEL ) { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - FIBITMAP * dib; - FREE_IMAGE_COLOR_CHANNEL channel; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + FREE_IMAGE_COLOR_CHANNEL channel = ( FREE_IMAGE_COLOR_CHANNEL ) hb_parni( 2 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - channel = ( FREE_IMAGE_COLOR_CHANNEL ) hb_parni( 2 ); - - /* run function & return value */ hb_retptr( FreeImage_GetChannel( dib, channel ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel); */ @@ -2296,70 +1285,43 @@ HB_FUNC( FI_GETCHANNEL ) /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom); */ HB_FUNC( FI_COPY ) { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { - FIBITMAP * dib; - int left, top, right, bottom; + FIBITMAP * dib = ( FIBITMAP * ) hb_parptr( 1 ); + int left = hb_parni( 2 ); + int top = hb_parni( 3 ); + int right = hb_parni( 4 ); + int bottom = hb_parni( 5 ); - /* Retrieve parameters */ - dib = ( FIBITMAP * ) hb_parptr( 1 ); - left = hb_parni( 2 ); - top = hb_parni( 3 ); - right = hb_parni( 4 ); - bottom = hb_parni( 5 ); - - /* run function & return value */ hb_retptr( FreeImage_Copy( dib, left, top, right, bottom ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha); */ HB_FUNC( FI_PASTE ) { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { - FIBITMAP * dst; - FIBITMAP * src; - int left, top, alpha; + FIBITMAP * dst = ( FIBITMAP * ) hb_parptr( 1 ); + FIBITMAP * src = ( FIBITMAP * ) hb_parptr( 2 ); + int left = hb_parni( 3 ); + int top = hb_parni( 4 ); + int alpha = hb_parni( 5 ); - /* Retrieve parameters */ - dst = ( FIBITMAP * ) hb_parptr( 1 ); - src = ( FIBITMAP * ) hb_parptr( 2 ); - left = hb_parni( 3 ); - top = hb_parni( 4 ); - alpha = hb_parni( 5 ); - - /* run function & return value */ hb_fi_retl( FreeImage_Paste( dst, src, left, top, alpha ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) - ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL)); */ diff --git a/harbour/contrib/hbfimage/tests/fitest.prg b/harbour/contrib/hbfimage/tests/fitest.prg index e8903129c2..e2ef3c18f3 100644 --- a/harbour/contrib/hbfimage/tests/fitest.prg +++ b/harbour/contrib/hbfimage/tests/fitest.prg @@ -221,7 +221,7 @@ PROCEDURE Main() FClose( nH ) ? "Load JPEG from memory" - im := fi_LoadFromMem( FIF_JPEG, cStr, JPEG_DEFAULT ) + im := fi_LoadFromMemory( FIF_JPEG, cStr, JPEG_DEFAULT ) ? "Pointer :", ValToPrg( im ) ? "Image Type :", fi_GetImageType( im ) diff --git a/harbour/contrib/hbgd/gd.prg b/harbour/contrib/hbgd/gd.prg index 5ec89cae94..8e7a8c951c 100644 --- a/harbour/contrib/hbgd/gd.prg +++ b/harbour/contrib/hbgd/gd.prg @@ -50,12 +50,6 @@ * */ -FUNCTION gdImageChar( im, font, x, y, char, color ) - RETURN gdImageString( im, font, x, y, char, color ) - -FUNCTION gdImageCharUp( im, font, x, y, char, color ) - RETURN gdImageStringUp( im, font, x, y, char, color ) - FUNCTION gdImageCircle( im, cx, cy, w, color ) RETURN gdImageArc( im, cx, cy, w, w, 0, 360, color ) @@ -158,7 +152,6 @@ FUNCTION gdImageFromFile( cFile ) cMime := "image/jpeg" oImage := GDImage():LoadFromJpeg( cFile ) EXIT - CASE ".gif" hFile[ "file" ] := cFile hFile[ "path" ] := cPath @@ -169,7 +162,6 @@ FUNCTION gdImageFromFile( cFile ) cMime := "image/gif" oImage := GDImage():LoadFromGif( cFile ) EXIT - CASE ".png" hFile[ "file" ] := cFile hFile[ "path" ] := cPath @@ -180,9 +172,7 @@ FUNCTION gdImageFromFile( cFile ) cMime := "image/png" oImage := GDImage():LoadFromPng( cFile ) EXIT - ENDSWITCH - ENDIF RETURN { oImage, hFile, cType, cMime } @@ -191,20 +181,18 @@ FUNCTION gdImageToString( oImage ) LOCAL cString - IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) - IF oImage:cType != NIL - SWITCH oImage:cType - CASE "jpeg" - cString := oImage:ToStringJpeg() - EXIT - CASE "gif" - cString := oImage:ToStringGif() - EXIT - CASE "png" - cString := oImage:ToStringPng() - EXIT - ENDSWITCH - ENDIF + IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) .AND. oImage:cType != NIL + SWITCH oImage:cType + CASE "jpeg" + cString := oImage:ToStringJpeg() + EXIT + CASE "gif" + cString := oImage:ToStringGif() + EXIT + CASE "png" + cString := oImage:ToStringPng() + EXIT + ENDSWITCH ENDIF RETURN cString @@ -213,31 +201,27 @@ PROCEDURE gdImageToFile( oImage, cFile ) LOCAL cString, cExt - IF ! HB_ISSTRING( cFile ) - cFile := "image" - ENDIF + hb_default( @cFile, "image" ) - IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) - IF oImage:cType != NIL - SWITCH oImage:cType - CASE "jpeg" - cString := oImage:ToStringJpeg() - cExt := ".jpg" - EXIT - CASE "gif" - cString := oImage:ToStringGif() - cExt := ".gif" - EXIT - CASE "png" - cString := oImage:ToStringPng() - cExt := ".png" - EXIT - OTHERWISE - cExt := "" - ENDSWITCH - IF cString != NIL - hb_MemoWrit( cFile + cExt, cString ) - ENDIF + IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) .AND. oImage:cType != NIL + SWITCH oImage:cType + CASE "jpeg" + cString := oImage:ToStringJpeg() + cExt := ".jpg" + EXIT + CASE "gif" + cString := oImage:ToStringGif() + cExt := ".gif" + EXIT + CASE "png" + cString := oImage:ToStringPng() + cExt := ".png" + EXIT + OTHERWISE + cExt := "" + ENDSWITCH + IF cString != NIL + hb_MemoWrit( cFile + cExt, cString ) ENDIF ENDIF @@ -245,9 +229,7 @@ PROCEDURE gdImageToFile( oImage, cFile ) PROCEDURE gdImageToHandle( oImage, nHandle ) - IF ! HB_ISNUMERIC( nHandle ) - nHandle := 1 - ENDIF + hb_default( @nHandle, 1 ) IF HB_ISOBJECT( oImage ) .AND. ( oImage:ClassName == "GDIMAGE" .OR. oImage:IsDerivedFrom( "GDIMAGE" ) ) IF oImage:cType != NIL diff --git a/harbour/contrib/hbgd/gdwrp.c b/harbour/contrib/hbgd/gdwrp.c index e41b8d9f40..87cc40687d 100644 --- a/harbour/contrib/hbgd/gdwrp.c +++ b/harbour/contrib/hbgd/gdwrp.c @@ -84,10 +84,7 @@ #define IMAGE_WBMP 4 #define IMAGE_GD 5 - -/* - */ /* Internal functions */ -/* - */ /* ******************* @@ -128,8 +125,6 @@ static const HB_GC_FUNCS s_gcGDimageFuncs = }; -/* - */ - /* function returns gdImage pointer or NULL when wrong variable is * passed or gdImage was freed before */ @@ -144,8 +139,6 @@ static gdImagePtr hb_parGdImage( int iParam ) return NULL; } -/* - */ - /* function create in HVM stack return value item with gdImage pointer */ static void hb_retGdImage( gdImagePtr im ) @@ -158,8 +151,6 @@ static void hb_retGdImage( gdImagePtr im ) hb_retptrGC( ( void * ) imPtr ); } -/* - */ - #if 0 /* function returns PHB_ITEM with gdImage pointer */ @@ -206,8 +197,6 @@ static const HB_GC_FUNCS s_gcGDfontFuncs = hb_gcDummyMark }; -/* - */ - /* function returns gdFont pointer or NULL when wrong variable is * passed or gdFont was freed before */ @@ -222,8 +211,6 @@ static gdFontPtr hb_parGdFont( int iParam ) return NULL; } -/* - */ - /* function create in HVM stack return value item with gdFont pointer */ static void hb_retGdFont( gdFontPtr font ) @@ -236,8 +223,6 @@ static void hb_retGdFont( gdFontPtr font ) hb_retptrGC( ( void * ) fontPtr ); } -/* - */ - #if 0 /* function returns PHB_ITEM with gdFont pointer */ @@ -252,14 +237,12 @@ static PHB_ITEM hb_gdFontItemNew( gdFontPtr font ) } #endif -/* - */ - static void * LoadImageFromHandle( HB_FHANDLE fhandle, int sz ) { void * iptr; if( ! fhandle ) - fhandle = 0; /* 0 = std input */ + fhandle = 0; /* std input */ /* Read file */ iptr = hb_xgrab( sz ); @@ -269,8 +252,6 @@ static void * LoadImageFromHandle( HB_FHANDLE fhandle, int sz ) } -/* - */ - static void * LoadImageFromFile( const char * szFile, int * sz ) { void * iptr; @@ -301,19 +282,15 @@ static void * LoadImageFromFile( const char * szFile, int * sz ) } -/* - */ - static void SaveImageToHandle( HB_FHANDLE fhandle, const void * iptr, int sz ) { if( ! fhandle ) - fhandle = 1; /* 1 = std output */ + fhandle = 1; /* std output */ /* Write Image */ hb_fsWriteLarge( fhandle, iptr, ( HB_SIZE ) sz ); } -/* - */ - static void SaveImageToFile( const char * szFile, const void * iptr, int sz ) { HB_FHANDLE fhandle; @@ -328,56 +305,38 @@ static void SaveImageToFile( const char * szFile, const void * iptr, int sz ) } } -/* - */ - static void GDImageCreateFrom( int nType ) { - gdImagePtr im = NULL; - const char * szFile; - int sz; - void * iptr; + gdImagePtr im = NULL; + int sz; + void * iptr; - if( hb_pcount() == 1 && - ( HB_ISCHAR( 1 ) ) - ) + if( HB_ISCHAR( 1 ) ) { - /* Retrieve file name */ - szFile = hb_parcx( 1 ); - /* Retrieve image */ - iptr = LoadImageFromFile( szFile, &sz ); + /* Retrieve image from file name */ + iptr = LoadImageFromFile( hb_parc( 1 ), &sz ); } - /* From Image Pointer + size */ - else if( hb_pcount() == 2 && - ( HB_ISPOINTER( 1 ) ) && - ( HB_ISNUM( 2 ) ) - ) + else if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { - - /* Retrieve image pointer */ - iptr = hb_parGdImage( 1 ); /* Retrieve image size */ sz = hb_parni( 2 ); - } - /* From file handle */ - else if( hb_pcount() == 2 && - ( HB_ISNUM( 1 ) ) && - ( HB_ISNUM( 2 ) ) - ) - { - /* Retrieve file handle */ - HB_FHANDLE fhandle = HB_ISNUM( 1 ) ? hb_numToHandle( hb_parnint( 1 ) ) : 0; /* 0 = std input */ + /* Retrieve image pointer + size */ + iptr = hb_parGdImage( 1 ); + } + else if( HB_ISNUM( 1 ) && + HB_ISNUM( 2 ) ) + { /* Retrieve image size */ sz = hb_parni( 2 ); /* retrieve image from handle */ - iptr = LoadImageFromHandle( fhandle, sz ); + iptr = LoadImageFromHandle( hb_numToHandle( hb_parnintdef( 1, 0 /* std input */ ) ), sz ); } else { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); return; } @@ -411,13 +370,9 @@ static void GDImageCreateFrom( int nType ) } } -/* - */ - static void GDImageSaveTo( int nType ) { - if( hb_pcount() >= 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; int sz = 0; @@ -441,10 +396,11 @@ static void GDImageSaveTo( int nType ) /* Retrieve compression level */ /* check if is numeric */ - if( ! ( HB_ISNIL( 3 ) || HB_ISNUM( 3 ) ) ) + if( ! ( HB_ISNIL( 3 ) || + HB_ISNUM( 3 ) ) ) { hb_errRT_BASE_SubstR( EG_ARG, 0, - "Tirdh argument must be NIL or numeric.", + "Third argument must be NIL or numeric.", HB_ERR_FUNCNAME, 1, hb_paramError( 3 ) ); return; @@ -478,7 +434,7 @@ static void GDImageSaveTo( int nType ) } else if( nType == IMAGE_WBMP ) { - if( ! ( HB_ISNUM( 3 ) ) ) + if( ! HB_ISNUM( 3 ) ) { hb_errRT_BASE_SubstR( EG_ARG, 0, "Foreground color nedeed", @@ -515,36 +471,30 @@ static void GDImageSaveTo( int nType ) /* If i get a file name */ if( HB_ISCHAR( 2 ) ) - SaveImageToFile( hb_parcx( 2 ), iptr, sz ); + SaveImageToFile( hb_parc( 2 ), iptr, sz ); - /* Write to file handle (1 = std output) */ + /* Write to file handle */ else if( HB_ISNUM( 2 ) ) { /* Write to std output or to a passed file */ HB_FHANDLE fhandle = hb_numToHandle( hb_parnint( 2 ) ); if( fhandle == FS_ERROR ) - fhandle = 1; /* 1 = std output */ + fhandle = 1; /* std output */ /* Write Image */ SaveImageToHandle( fhandle, iptr, sz ); } /* Return image as string) */ else - { /* Return as string */ hb_retclen( ( const char * ) iptr, ( HB_SIZE ) sz ); - } /* Free memory */ gdFree( iptr ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } /* ************************* WRAPPED FUNCTIONS ****************************** */ @@ -573,14 +523,11 @@ HB_FUNC( GDVERSIONNUMBER ) #endif } -/* - */ /* IMAGE CREATION, DESTRUCTION, LOADING AND SAVING */ -/* - */ HB_FUNC( GDIMAGECREATE ) /* gdImagePtr gdImageCreate(sx, sy) */ { - if( hb_pcount() == 2 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { gdImagePtr im; @@ -597,24 +544,15 @@ HB_FUNC( GDIMAGECREATE ) /* gdImagePtr gdImageCreate(sx, sy) */ hb_retGdImage( im ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - /* Alias of GDCreate() */ HB_FUNC_TRANSLATE( GDIMAGECREATEPALETTE, GDIMAGECREATE ) /* gdImagePtr gdImageCreatePalette(sx, sy) */ -/* - */ - -HB_FUNC( GDIMAGECREATETRUECOLOR ) /* gdImageCreateTrueColor(sx, sy) */ +HB_FUNC( GDIMAGECREATETRUECOLOR ) /* gdImageCreateTrueColor(sx, sy) */ { - if( hb_pcount() == 2 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) ) { gdImagePtr im; @@ -631,66 +569,39 @@ HB_FUNC( GDIMAGECREATETRUECOLOR ) /* gdImageCreateTrueColor(sx, sy) */ hb_retGdImage( im ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } - -/* - */ - HB_FUNC( GDIMAGECREATEFROMJPEG ) /* gdImageCreateFromJpegPtr(int size, void *data) */ { /* implementation: gdImagePtr gdImageCreateFromJpeg( char *szFile ) */ GDImageCreateFrom( IMAGE_JPEG ); } - -/* - */ - HB_FUNC( GDIMAGECREATEFROMGIF ) /* gdImageCreateFromGifPtr(int size, void *data) */ { /* implementation: gdImagePtr gdImageCreateFromGif( char *szFile ) */ GDImageCreateFrom( IMAGE_GIF ); } - -/* - */ - HB_FUNC( GDIMAGECREATEFROMPNG ) /* gdImageCreateFromPngPtr(int size, void *data) */ { /* implementation: gdImagePtr gdImageCreateFromPng( char *szFile ) */ GDImageCreateFrom( IMAGE_PNG ); } - -/* - */ - HB_FUNC( GDIMAGECREATEFROMWBMP ) /* gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data) */ { /* implementation: gdImagePtr gdImageCreateFromWBMP ( char *szFile ) */ GDImageCreateFrom( IMAGE_WBMP ); } - -/* - */ - HB_FUNC( GDIMAGECREATEFROMGD ) /* gdImagePtr gdImageCreateFromGdPtr (int size, void *data) */ { /* implementation: gdImagePtr gdImageCreateFromGd ( char *szFile ) */ GDImageCreateFrom( IMAGE_GD ); } - -/* - */ - -/* - */ - HB_FUNC( GDIMAGEJPEG ) /* original: void gdImageJpeg(gdImagePtr im, FILE *out) */ { /* implementation: void gdImageJpeg(gdImagePtr im, char *szFile) */ GDImageSaveTo( IMAGE_JPEG ); } - -/* - */ - HB_FUNC( GDIMAGEGIF ) /* original: void gdImageGif(gdImagePtr im, FILE *out) */ { /* implementation: void gdImageGif(gdImagePtr im, char *szFile) */ GDImageSaveTo( IMAGE_GIF ); @@ -701,26 +612,18 @@ HB_FUNC( GDIMAGEPNG ) /* original: void gdImagePngEx(gdImagePtr im, FILE *out, i GDImageSaveTo( IMAGE_PNG ); } -/* - */ - HB_FUNC( GDIMAGEWBMP ) /* original: void gdImageWBMP(gdImagePtr im, FILE *out) */ { /* implementation: void gdImageWBMP(gdImagePtr im, char *szFile, int fg) */ GDImageSaveTo( IMAGE_WBMP ); } - -/* - */ - HB_FUNC( GDIMAGEGD ) /* original: void gdImageGD(gdImagePtr im, FILE *out) */ { /* implementation: void gdImageGD(gdImagePtr im, char *szFile) */ GDImageSaveTo( IMAGE_GD ); } - #if defined( HB_LEGACY_LEVEL4 ) -/* - */ - /* After Przemek changes on hb_*ptr() functions, this is a void function holded only for compatibility with GD library. @@ -731,20 +634,14 @@ HB_FUNC( GDIMAGEDESTROY ) /* gdImageDestroy(gdImagePtr im) */ #endif -/* - */ - -/* - */ /* DRAWING FUNCTIONS */ -/* - */ HB_FUNC( GDIMAGESETPIXEL ) /* void gdImageSetPixel(gdImagePtr im, int x, int y, int color) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int x, y; @@ -764,25 +661,17 @@ HB_FUNC( GDIMAGESETPIXEL ) /* void gdImageSetPixel(gdImagePtr im, int x, int y, gdImageSetPixel( im, x, y, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGELINE ) /* void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */ { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -804,26 +693,17 @@ HB_FUNC( GDIMAGELINE ) /* void gdImageLine(gdImagePtr im, int x1, int y1, int x2 gdImageLine( im, x1, y1, x2, y2, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEDASHEDLINE ) /* void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */ { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -845,23 +725,14 @@ HB_FUNC( GDIMAGEDASHEDLINE ) /* void gdImageDashedLine(gdImagePtr im, int x1, in gdImageDashedLine( im, x1, y1, x2, y2, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */ { /* implementation: void gdImagePolygon(gdImagePtr im, gdPointPtr points, int color) */ - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISARRAY( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; /*gdPointPtr points; */ @@ -900,22 +771,15 @@ HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPoin hb_xfree( points ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */ { /* implementation: void gdImageOpenPolygon(gdImagePtr im, gdPointPtr points, int color) */ #if HB_GD_VERS( 2, 0, 33 ) - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISARRAY( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; /*gdPointPtr points; */ @@ -954,26 +818,19 @@ HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im hb_xfree( points ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + #endif /* ( GD_VERS >= 2033 ) */ } -/* - */ - HB_FUNC( GDIMAGERECTANGLE ) /* void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */ { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -995,23 +852,14 @@ HB_FUNC( GDIMAGERECTANGLE ) /* void gdImageRectangle(gdImagePtr im, int x1, int gdImageRectangle( im, x1, y1, x2, y2, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEFILLEDPOLYGON ) /* original: void gdImageFilledPolygon(gdImagePtr im, gdPointPtr points, int pointsTotal, int color) */ { /* implementation: void gdImageFilledPolygon(gdImagePtr im, gdPointPtr points, int color) */ - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISARRAY( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; /*gdPointPtr points; */ @@ -1047,25 +895,17 @@ HB_FUNC( GDIMAGEFILLEDPOLYGON ) /* original: void gdImageFilledPolygon(gdImagePt gdImageFilledPolygon( im, ( gdPointPtr ) points, pointsTotal, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEFILLEDRECTANGLE ) /* void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color) */ { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -1087,28 +927,19 @@ HB_FUNC( GDIMAGEFILLEDRECTANGLE ) /* void gdImageFilledRectangle(gdImagePtr im, gdImageFilledRectangle( im, x1, y1, x2, y2, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEARC ) /* void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) */ { - if( hb_pcount() == 8 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && - HB_ISNUM( 8 ) - ) + HB_ISNUM( 8 ) ) { gdImagePtr im; int cx, cy, w, h, s, e, color; @@ -1132,28 +963,19 @@ HB_FUNC( GDIMAGEARC ) /* void gdImageArc(gdImagePtr im, int cx, int cy, int w, i gdImageArc( im, cx, cy, w, h, s, e, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 8, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEFILLEDARC ) /* void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color[, int style]) */ { - if( hb_pcount() >= 8 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && - HB_ISNUM( 8 ) - ) + HB_ISNUM( 8 ) ) { gdImagePtr im; int cx, cy, w, h, s, e, color, style; @@ -1180,27 +1002,17 @@ HB_FUNC( GDIMAGEFILLEDARC ) /* void gdImageFilledArc(gdImagePtr im, int cx, int gdImageFilledArc( im, cx, cy, w, h, s, e, color, style ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 9, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEFILLEDELLIPSE ) /* void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color) */ { - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int cx, cy, w, h, color; @@ -1221,25 +1033,16 @@ HB_FUNC( GDIMAGEFILLEDELLIPSE ) /* void gdImageFilledEllipse(gdImagePtr im, int gdImageFilledEllipse( im, cx, cy, w, h, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEFILLTOBORDER ) /* void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color) */ { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { gdImagePtr im; int x, y, border, color; @@ -1259,29 +1062,21 @@ HB_FUNC( GDIMAGEFILLTOBORDER ) /* void gdImageFillToBorder(gdImagePtr im, int x, gdImageFillToBorder( im, x, y, border, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ /* Disabled, because there is a .prg implementation which works with all gd lib versions. [vszakats] */ #if 0 HB_FUNC( GDIMAGEELLIPSE ) /* void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color) */ { #if HB_GD_VERS( 2, 0, 35 ) - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { gdImagePtr im; int cx, cy, w, h, color; @@ -1302,26 +1097,18 @@ HB_FUNC( GDIMAGEELLIPSE ) /* void gdImageEllipse(gdImagePtr im, int cx, int cy, gdImageEllipse( im, cx, cy, w, h, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + #endif /* ( GD_VERS >= 2035 ) */ } #endif -/* - */ - HB_FUNC( GDIMAGEFILL ) /* void gdImageFill(gdImagePtr im, int x, int y, int color) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int x, y, color; @@ -1339,21 +1126,13 @@ HB_FUNC( GDIMAGEFILL ) /* void gdImageFill(gdImagePtr im, int x, int y, int colo gdImageFill( im, x, y, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETANTIALIASED ) /* void gdImageSetAntiAliased(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -1368,22 +1147,14 @@ HB_FUNC( GDIMAGESETANTIALIASED ) /* void gdImageSetAntiAliased(gdImagePtr im, in gdImageSetAntiAliased( im, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETANTIALIASEDDONTBLEND ) /* void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int color; @@ -1402,21 +1173,13 @@ HB_FUNC( GDIMAGESETANTIALIASEDDONTBLEND ) /* void gdImageSetAntiAliasedDontBlend gdImageSetAntiAliasedDontBlend( im, color, dont_blend ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETBRUSH ) /* void gdImageSetBrush(gdImagePtr im, gdImagePtr brush) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISPOINTER( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISPOINTER( 2 ) ) { gdImagePtr im; gdImagePtr brush; @@ -1431,21 +1194,13 @@ HB_FUNC( GDIMAGESETBRUSH ) /* void gdImageSetBrush(gdImagePtr im, gdImagePtr bru gdImageSetBrush( im, brush ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETTILE ) /* void gdImageSetTile(gdImagePtr im, gdImagePtr tile) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISPOINTER( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISPOINTER( 2 ) ) { gdImagePtr im; gdImagePtr tile; @@ -1460,21 +1215,13 @@ HB_FUNC( GDIMAGESETTILE ) /* void gdImageSetTile(gdImagePtr im, gdImagePtr tile) gdImageSetTile( im, tile ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int *style, int styleLength) */ { /* implementation: void gdImageSetStyle(gdImagePtr im, int *style) */ - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISARRAY( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISARRAY( 2 ) ) { gdImagePtr im; PHB_ITEM pStyles; @@ -1493,9 +1240,7 @@ HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int styles = ( int * ) hb_xgrab( sizeof( int ) * styleLength ); for( i = 0; i < styleLength; i++ ) - { styles[ i ] = hb_arrayGetNI( pStyles, i + 1 ); - } /* Set style */ gdImageSetStyle( im, ( int * ) styles, styleLength ); @@ -1503,21 +1248,13 @@ HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int hb_xfree( styles ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETTHICKNESS ) /* void gdImageSetThickness(gdImagePtr im, int thickness) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int thickness; @@ -1539,21 +1276,13 @@ HB_FUNC( GDIMAGESETTHICKNESS ) /* void gdImageSetThickness(gdImagePtr im, int th hb_retni( oldthick ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEALPHABLENDING ) /* void gdImageAlphaBlending(gdImagePtr im, int blending) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISLOG( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISLOG( 2 ) ) { gdImagePtr im; int blending; @@ -1568,21 +1297,13 @@ HB_FUNC( GDIMAGEALPHABLENDING ) /* void gdImageAlphaBlending(gdImagePtr im, int gdImageAlphaBlending( im, blending ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESAVEALPHA ) /* void gdImageSaveAlpha(gdImagePtr im, int saveFlag) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISLOG( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISLOG( 2 ) ) { gdImagePtr im; int saveFlag; @@ -1597,24 +1318,16 @@ HB_FUNC( GDIMAGESAVEALPHA ) /* void gdImageSaveAlpha(gdImagePtr im, int saveFlag gdImageSaveAlpha( im, saveFlag ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESETCLIP ) /* void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2) */ { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -1632,21 +1345,12 @@ HB_FUNC( GDIMAGESETCLIP ) /* void gdImageSetClip(gdImagePtr im, int x1, int y1, gdImageSetClip( im, x1, y1, x2, y2 ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGETCLIP ) /* original: void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) */ { /* implementation: array gdImageGetClip(gdImagePtr im) */ - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; int x1, y1, x2, y2; @@ -1669,24 +1373,14 @@ HB_FUNC( GDIMAGEGETCLIP ) /* original: void gdImageGetClip(gdImagePtr im, int *x hb_itemReturnRelease( pClipArray ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - -/* - */ /* QUERY FUNCTIONS */ -/* - */ HB_FUNC( GDIMAGECOLORSTOTAL ) /* int gdImageColorsTotal(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1697,21 +1391,13 @@ HB_FUNC( GDIMAGECOLORSTOTAL ) /* int gdImageColorsTotal(gdImagePtr im) */ hb_retni( gdImageColorsTotal( im ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEALPHA ) /* int gdImageAlpha(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -1726,21 +1412,13 @@ HB_FUNC( GDIMAGEALPHA ) /* int gdImageAlpha(gdImagePtr im, int color) */ hb_retni( gdImageAlpha( im, color ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGERED ) /* int gdImageRed(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -1755,21 +1433,13 @@ HB_FUNC( GDIMAGERED ) /* int gdImageRed(gdImagePtr im, int color) */ hb_retni( gdImageRed( im, color ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGREEN ) /* int gdImageGreen(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -1784,21 +1454,13 @@ HB_FUNC( GDIMAGEGREEN ) /* int gdImageGreen(gdImagePtr im, int color) */ hb_retni( gdImageGreen( im, color ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEBLUE ) /* int gdImageBlue(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -1813,20 +1475,12 @@ HB_FUNC( GDIMAGEBLUE ) /* int gdImageBlue(gdImagePtr im, int color) */ hb_retni( gdImageBlue( im, color ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESX ) /* int gdImageSX(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1837,20 +1491,12 @@ HB_FUNC( GDIMAGESX ) /* int gdImageSX(gdImagePtr im) */ hb_retni( gdImageSX( im ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESY ) /* int gdImageSX(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1861,22 +1507,14 @@ HB_FUNC( GDIMAGESY ) /* int gdImageSX(gdImagePtr im) */ hb_retni( gdImageSY( im ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGETPIXEL ) /* int gdImageGetPixel(gdImagePtr im, int x, int y) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int x, y; @@ -1892,22 +1530,14 @@ HB_FUNC( GDIMAGEGETPIXEL ) /* int gdImageGetPixel(gdImagePtr im, int x, int y) * hb_retni( gdImageGetPixel( im, x, y ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEBOUNDSSAFE ) /* int gdImageBoundsSafe(gdImagePtr im, int x, int y) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int x, y; @@ -1923,20 +1553,12 @@ HB_FUNC( GDIMAGEBOUNDSSAFE ) /* int gdImageBoundsSafe(gdImagePtr im, int x, int hb_retl( gdImageBoundsSafe( im, x, y ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGETINTERLACED ) /* int gdImageGetInterlaced(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1947,20 +1569,12 @@ HB_FUNC( GDIMAGEGETINTERLACED ) /* int gdImageGetInterlaced(gdImagePtr im) */ hb_retl( gdImageGetInterlaced( im ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGETTRANSPARENT ) /* int gdImageGetTransparent(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1971,20 +1585,12 @@ HB_FUNC( GDIMAGEGETTRANSPARENT ) /* int gdImageGetTransparent(gdImagePtr im) */ hb_retl( gdImageGetTransparent( im ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGETRUECOLOR ) /* int gdImageTrueColor(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -1996,22 +1602,14 @@ HB_FUNC( GDIMAGETRUECOLOR ) /* int gdImageTrueColor(gdImagePtr im) */ } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGETRUECOLORTOPALETTE ) /* void gdImageTrueColorToPalette (gdImagePtr im, int ditherFlag, int colorsWanted) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISLOG( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int ditherFlag, colorsWanted; @@ -2029,22 +1627,14 @@ HB_FUNC( GDIMAGETRUECOLORTOPALETTE ) /* void gdImageTrueColorToPalette (gdImageP gdImageTrueColorToPalette( im, ditherFlag, colorsWanted ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECREATEPALETTEFROMTRUECOLOR ) /* gdImagePtr gdImageCreatePaletteFromTrueColor(gdImagePtr im, int ditherFlag, int colorsWanted) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISLOG( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; gdImagePtr imNew; @@ -2066,22 +1656,14 @@ HB_FUNC( GDIMAGECREATEPALETTEFROMTRUECOLOR ) /* gdImagePtr gdImageCreatePaletteF hb_retGdImage( imNew ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEPALETTEPIXEL ) /* int gdImagePalettePixel(gdImagePtr im, int x, int y) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int x, y; @@ -2097,22 +1679,14 @@ HB_FUNC( GDIMAGEPALETTEPIXEL ) /* int gdImagePalettePixel(gdImagePtr im, int x, hb_retni( gdImagePalettePixel( im, x, y ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGETRUECOLORPIXEL ) /* int gdImageTrueColorPixel(gdImagePtr im, int x, int y) */ { - if( hb_pcount() == 3 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { gdImagePtr im; int x, y; @@ -2128,20 +1702,12 @@ HB_FUNC( GDIMAGETRUECOLORPIXEL ) /* int gdImageTrueColorPixel(gdImagePtr im, int hb_retni( gdImageTrueColorPixel( im, x, y ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEGETTHICKNESS ) /* void gdImageGetThickness(gdImagePtr im) */ { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { gdImagePtr im; @@ -2152,104 +1718,73 @@ HB_FUNC( GDIMAGEGETTHICKNESS ) /* void gdImageGetThickness(gdImagePtr im) */ hb_retni( im->thick ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - -/* - */ /* FONTS AND TEXT-HANDLING FUNCTIONS */ -/* - */ HB_FUNC( GDFONTGETSMALL ) /* gdFontPtr gdFontGetSmall(void) */ { - gdFontPtr font; - /* Get font pointer */ - font = gdFontGetSmall(); + gdFontPtr font = gdFontGetSmall(); /* Return font pointer */ hb_retGdFont( font ); - /*hb_retptr( font ); */ + /* hb_retptr( font ); */ } -/* - */ - HB_FUNC( GDFONTGETLARGE ) /* gdFontPtr gdFontGetLarge(void) */ { - gdFontPtr font; - /* Get font pointer */ - font = gdFontGetLarge(); + gdFontPtr font = gdFontGetLarge(); /* Return font pointer */ hb_retGdFont( font ); - /*hb_retptr( font ); */ + /* hb_retptr( font ); */ } -/* - */ - HB_FUNC( GDFONTGETMEDIUMBOLD ) /* gdFontPtr gdFontGetMediumBold(void) */ { - gdFontPtr font; - /* Get font pointer */ - font = gdFontGetMediumBold(); + gdFontPtr font = gdFontGetMediumBold(); /* Return font pointer */ hb_retGdFont( font ); - /*hb_retptr( font ); */ + /* hb_retptr( font ); */ } -/* - */ - HB_FUNC( GDFONTGETGIANT ) /* gdFontPtr gdFontGetGiant(void) */ { - gdFontPtr font; - /* Get font pointer */ - font = gdFontGetGiant(); + gdFontPtr font = gdFontGetGiant(); /* Return font pointer */ hb_retGdFont( font ); - /*hb_retptr( font ); */ + /* hb_retptr( font ); */ } -/* - */ - HB_FUNC( GDFONTGETTINY ) /* gdFontPtr gdFontGetTiny(void) */ { - gdFontPtr font; - /* Get font pointer */ - font = gdFontGetTiny(); + gdFontPtr font = gdFontGetTiny(); /* Return font pointer */ hb_retGdFont( font ); - /*hb_retptr( font ); */ + /* hb_retptr( font ); */ } -/* - */ - HB_FUNC( GDIMAGESTRING ) /* void gdImageChar(gdImagePtr im, gdFontPtr font, int x, int y, int c, int color) */ { /* void gdImageString(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color) */ - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISCHAR( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { - gdImagePtr im; - gdFontPtr font; - int x, y, c, color; - unsigned char * s; + gdImagePtr im; + gdFontPtr font; + int x, y, color; /* Retrieve image pointer */ im = hb_parGdImage( 1 ); @@ -2264,46 +1799,27 @@ HB_FUNC( GDIMAGESTRING ) /* void gdImageChar(gdImagePtr im, gdFontPtr font, int /* Retrieve color value */ color = hb_parni( 6 ); - /* Write char */ - if( hb_parclen( 5 ) == 1 ) - { - /* Retrieve char value */ - c = hb_parni( 5 ); - gdImageChar( im, font, x, y, c, color ); - } - else - { - /* Retrieve string value */ - s = ( unsigned char * ) hb_parcx( 5 ); - gdImageString( im, font, x, y, s, color ); - } + /* Write string */ + gdImageString( im, font, x, y, ( unsigned char * ) hb_parc( 5 ), color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ +HB_FUNC_TRANSLATE( GDIMAGECHAR, GDIMAGESTRING ) HB_FUNC( GDIMAGESTRINGUP ) /* void gdImageCharUp(gdImagePtr im, gdFontPtr font, int x, int y, int c, int color) */ { /* void gdImageStringUp(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color) */ - if( hb_pcount() == 6 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISCHAR( 5 ) && - HB_ISNUM( 6 ) - ) + HB_ISNUM( 6 ) ) { - gdImagePtr im; - gdFontPtr font; - int x, y, c, color; - unsigned char * s; + gdImagePtr im; + gdFontPtr font; + int x, y, color; /* Retrieve image pointer */ im = hb_parGdImage( 1 ); @@ -2318,36 +1834,20 @@ HB_FUNC( GDIMAGESTRINGUP ) /* void gdImageCharUp(gdImagePtr im, gdFontPtr font, /* Retrieve color value */ color = hb_parni( 6 ); - /* Write char */ - if( hb_parclen( 5 ) == 1 ) - { - /* Retrieve char value */ - c = hb_parni( 5 ); - gdImageCharUp( im, font, x, y, c, color ); - } - else - { - /* Retrieve string value */ - s = ( unsigned char * ) hb_parcx( 5 ); - gdImageStringUp( im, font, x, y, s, color ); - } + /* Write string */ + gdImageStringUp( im, font, x, y, ( unsigned char * ) hb_parc( 5 ), color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 6, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ +HB_FUNC_TRANSLATE( GDIMAGECHARUP, GDIMAGESTRINGUP ) + /* char *gdImageStringFTEx(gdImagePtr im, int *brect, int fg, char *fontname, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex) */ /* implementation: cError := gdImageStringFTEx( im, aRect, int fg, cFontname, nPtSize, nAngle, x, y, cString, nLinespacing, nCharmap, nResolution ) */ HB_FUNC( GDIMAGESTRINGFTEX ) { - if( hb_pcount() >= 9 && - ( HB_ISNIL( 1 ) || HB_ISPOINTER( 1 ) ) && + if( ( HB_ISNIL( 1 ) || HB_ISPOINTER( 1 ) ) && HB_ISARRAY( 2 ) && HB_ISNUM( 3 ) && HB_ISCHAR( 4 ) && @@ -2355,8 +1855,7 @@ HB_FUNC( GDIMAGESTRINGFTEX ) HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && - HB_ISCHAR( 9 ) - ) + HB_ISCHAR( 9 ) ) { gdImagePtr im; gdFTStringExtra extra; @@ -2379,9 +1878,7 @@ HB_FUNC( GDIMAGESTRINGFTEX ) /* Retrieve rectangle array */ pRect = hb_param( 2, HB_IT_ARRAY ); for( i = 0; i < 8; i++ ) - { aRect[ i ] = hb_arrayGetNI( pRect, i + 1 ); - } /* Retrieve foreground color value */ fg = hb_parni( 3 ); @@ -2400,7 +1897,7 @@ HB_FUNC( GDIMAGESTRINGFTEX ) y = hb_parni( 8 ); /* Retrieve string value */ - string = hb_parcx( 9 ); + string = hb_parc( 9 ); /* EXTENDED FLAGS */ flags = 0; @@ -2431,7 +1928,7 @@ HB_FUNC( GDIMAGESTRINGFTEX ) flags |= gdFTEX_RESOLUTION; } - if( ! ( flags == 0 ) ) + if( flags != 0 ) { extra.flags = flags; extra.linespacing = ( flags & gdFTEX_LINESPACE ? linespacing : 1.05 ); @@ -2442,36 +1939,25 @@ HB_FUNC( GDIMAGESTRINGFTEX ) /* Write string */ err = gdImageStringFTEx( im, &aRect[ 0 ], fg, ( char * ) fontname, ptsize, angle, x, y, ( char * ) string, ( ! ( flags == 0 ) ? &extra : 0 ) ); - if( ! ( err ) ) + if( ! err ) { /* Save in array the correct text rectangle dimensions */ PHB_ITEM pArray; pArray = hb_itemArrayNew( 8 ); for( i = 0; i < 8; i++ ) - { hb_itemPutNI( hb_arrayGetItemPtr( pArray, i + 1 ), aRect[ i ] ); - } hb_itemCopy( pRect, pArray ); hb_itemRelease( pArray ); } hb_retc( err ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 12, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ), hb_paramError( 10 ), hb_paramError( 11 ), hb_paramError( 12 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, int cx, int cy, double radius, double textRadius, double fillPortion, char *font, double points, char *top, char *bottom, int fgcolor) */ { - if( hb_pcount() == 11 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -2481,8 +1967,7 @@ HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, i HB_ISNUM( 8 ) && ( HB_ISNIL( 9 ) || HB_ISCHAR( 9 ) ) && ( HB_ISNIL( 10 ) || HB_ISCHAR( 10 ) ) && - HB_ISNUM( 11 ) - ) + HB_ISNUM( 11 ) ) { gdImagePtr im; int cx, cy; @@ -2491,7 +1976,6 @@ HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, i const char * bottom; int fgcolor; const char * font; - char * err; /* Retrieve image pointer */ im = hb_parGdImage( 1 ); @@ -2510,7 +1994,7 @@ HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, i fillPortion = hb_parnd( 6 ); /* Retrieve fontname value */ - font = hb_parcx( 7 ); + font = hb_parc( 7 ); /* Retrieve points value */ points = hb_parnd( 8 ); @@ -2525,97 +2009,56 @@ HB_FUNC( GDIMAGESTRINGFTCIRCLE ) /* char *gdImageStringFTCircle(gdImagePtr im, i fgcolor = hb_parni( 11 ); /* Write string */ - err = gdImageStringFTCircle( im, cx, cy, radius, textRadius, fillPortion, ( char * ) font, points, ( char * ) top, ( char * ) bottom, fgcolor ); - hb_retc( err ); + hb_retc( gdImageStringFTCircle( im, cx, cy, radius, textRadius, fillPortion, ( char * ) font, points, ( char * ) top, ( char * ) bottom, fgcolor ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 11, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ), hb_paramError( 10 ), hb_paramError( 11 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDFONTCACHESETUP ) /* int gdFontCacheSetup (void) */ { /* This function initializes the font cache for freetype text output functions */ hb_retl( gdFontCacheSetup() ); } -/* - */ - HB_FUNC( GDFONTCACHESHUTDOWN ) /* void gdFontCacheShutdown (void) */ { /* This function initializes the font cache for freetype text output functions */ gdFontCacheShutdown(); } -/* - */ - HB_FUNC( GDFONTGETWIDTH ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - gdFontPtr font; + gdFontPtr font = hb_parGdFont( 1 ); - /* Retrieve font pointer */ - font = hb_parGdFont( 1 ); - - /* Return value */ hb_retni( font->w ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDFONTGETHEIGHT ) { - if( hb_pcount() == 1 && - HB_ISPOINTER( 1 ) - ) + if( HB_ISPOINTER( 1 ) ) { - gdFontPtr font; + gdFontPtr font = hb_parGdFont( 1 ); - /* Retrieve font pointer */ - font = hb_parGdFont( 1 ); - - /* Return value */ hb_retni( font->h ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - -/* - */ /* COLOR HANDLING FUNCTIONS */ -/* - */ HB_FUNC( GDIMAGECOLORALLOCATE ) /* int gdImageColorAllocate(gdImagePtr im, int r, int g, int b) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int r, g, b; @@ -2636,21 +2079,13 @@ HB_FUNC( GDIMAGECOLORALLOCATE ) /* int gdImageColorAllocate(gdImagePtr im, int r hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORDEALLOCATE ) /* void gdImageColorDeallocate(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -2665,24 +2100,16 @@ HB_FUNC( GDIMAGECOLORDEALLOCATE ) /* void gdImageColorDeallocate(gdImagePtr im, gdImageColorDeallocate( im, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORALLOCATEALPHA ) /* int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a) */ { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { gdImagePtr im; int r, g, b; @@ -2707,24 +2134,15 @@ HB_FUNC( GDIMAGECOLORALLOCATEALPHA ) /* int gdImageColorAllocateAlpha(gdImagePtr hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORCLOSEST ) /* int gdImageColorClosest(gdImagePtr im, int r, int g, int b) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int r, g, b; @@ -2745,24 +2163,16 @@ HB_FUNC( GDIMAGECOLORCLOSEST ) /* int gdImageColorClosest(gdImagePtr im, int r, hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORCLOSESTALPHA ) /* int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a) */ { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { gdImagePtr im; int r, g, b; @@ -2787,24 +2197,15 @@ HB_FUNC( GDIMAGECOLORCLOSESTALPHA ) /* int gdImageColorClosestAlpha(gdImagePtr i hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORCLOSESTHWB ) /* gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int r, g, b; @@ -2825,23 +2226,15 @@ HB_FUNC( GDIMAGECOLORCLOSESTHWB ) /* gdImageColorClosestHWB(gdImagePtr im, int hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLOREXACT ) /* int gdImageColorExact(gdImagePtr im, int r, int g, int b) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int r, g, b; @@ -2862,23 +2255,15 @@ HB_FUNC( GDIMAGECOLOREXACT ) /* int gdImageColorExact(gdImagePtr im, int r, int hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORRESOLVE ) /* int gdImageColorResolve(gdImagePtr im, int r, int g, int b) */ { - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; int r, g, b; @@ -2899,24 +2284,16 @@ HB_FUNC( GDIMAGECOLORRESOLVE ) /* int gdImageColorResolve(gdImagePtr im, int r, hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORRESOLVEALPHA ) /* int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a) */ { - if( hb_pcount() == 5 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && - HB_ISNUM( 5 ) - ) + HB_ISNUM( 5 ) ) { gdImagePtr im; int r, g, b; @@ -2941,22 +2318,13 @@ HB_FUNC( GDIMAGECOLORRESOLVEALPHA ) /* int gdImageColorResolveAlpha(gdImagePtr i hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 5, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOLORTRANSPARENT ) /* void gdImageColorTransparent(gdImagePtr im, int color) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int color; @@ -2971,22 +2339,14 @@ HB_FUNC( GDIMAGECOLORTRANSPARENT ) /* void gdImageColorTransparent(gdImagePtr im gdImageColorTransparent( im, color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDTRUECOLOR ) /* int gdTrueColor(int red, int green, int blue) */ { - if( hb_pcount() == 3 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && - HB_ISNUM( 3 ) - ) + HB_ISNUM( 3 ) ) { int r, g, b; int color; @@ -3003,23 +2363,15 @@ HB_FUNC( GDTRUECOLOR ) /* int gdTrueColor(int red, int green, int blue) */ hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDTRUECOLORALPHA ) /* int gdTrueColorAlpha(int red, int green, int blue, int alpha) */ { - if( hb_pcount() == 4 && - HB_ISNUM( 1 ) && + if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { int r, g, b, a; int color; @@ -3037,31 +2389,21 @@ HB_FUNC( GDTRUECOLORALPHA ) /* int gdTrueColorAlpha(int red, int green, int blue hb_retni( color ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 4, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - -/* - */ /* COPY AND RESIZING FUNCTIONS */ -/* - */ HB_FUNC( GDIMAGECOPY ) /* void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) */ { - if( hb_pcount() == 8 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && - HB_ISNUM( 8 ) - ) + HB_ISNUM( 8 ) ) { gdImagePtr dst, src; int dstX, dstY, srcX, srcY, w, h; @@ -3090,20 +2432,12 @@ HB_FUNC( GDIMAGECOPY ) /* void gdImageCopy(gdImagePtr dst, gdImagePtr src, int d gdImageCopy( dst, src, dstX, dstY, srcX, srcY, w, h ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 8, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOPYRESIZED ) /* void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) */ { - if( hb_pcount() == 10 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -3112,8 +2446,7 @@ HB_FUNC( GDIMAGECOPYRESIZED ) /* void gdImageCopyResized(gdImagePtr dst, gdImage HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && HB_ISNUM( 9 ) && - HB_ISNUM( 10 ) - ) + HB_ISNUM( 10 ) ) { gdImagePtr dst, src; int dstX, dstY, srcX, srcY; @@ -3149,21 +2482,12 @@ HB_FUNC( GDIMAGECOPYRESIZED ) /* void gdImageCopyResized(gdImagePtr dst, gdImage gdImageCopyResized( dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 10, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ), hb_paramError( 10 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOPYRESAMPLED ) /* void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) */ { - if( hb_pcount() == 10 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -3172,8 +2496,7 @@ HB_FUNC( GDIMAGECOPYRESAMPLED ) /* void gdImageCopyResampled(gdImagePtr dst, gdI HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && HB_ISNUM( 9 ) && - HB_ISNUM( 10 ) - ) + HB_ISNUM( 10 ) ) { gdImagePtr dst, src; int dstX, dstY, srcX, srcY; @@ -3209,21 +2532,12 @@ HB_FUNC( GDIMAGECOPYRESAMPLED ) /* void gdImageCopyResampled(gdImagePtr dst, gdI gdImageCopyResampled( dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 10, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ), hb_paramError( 10 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOPYROTATED ) /* void gdImageCopyRotated(gdImagePtr dst, gdImagePtr src, double dstX, double dstY, int srcX, int srcY, int srcW, int srcH, int angle) */ { - if( hb_pcount() == 9 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -3231,8 +2545,7 @@ HB_FUNC( GDIMAGECOPYROTATED ) /* void gdImageCopyRotated(gdImagePtr dst, gdImage HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && - HB_ISNUM( 9 ) - ) + HB_ISNUM( 9 ) ) { gdImagePtr dst, src; double dstX, dstY; @@ -3265,21 +2578,12 @@ HB_FUNC( GDIMAGECOPYROTATED ) /* void gdImageCopyRotated(gdImagePtr dst, gdImage gdImageCopyRotated( dst, src, dstX, dstY, srcX, srcY, srcW, srcH, angle ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 9, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOPYMERGE ) /* void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) */ { - if( hb_pcount() == 9 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -3287,8 +2591,7 @@ HB_FUNC( GDIMAGECOPYMERGE ) /* void gdImageCopyMerge(gdImagePtr dst, gdImagePtr HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && - HB_ISNUM( 9 ) - ) + HB_ISNUM( 9 ) ) { gdImagePtr dst, src; int dstX, dstY, srcX, srcY, w, h, pct; @@ -3320,21 +2623,12 @@ HB_FUNC( GDIMAGECOPYMERGE ) /* void gdImageCopyMerge(gdImagePtr dst, gdImagePtr gdImageCopyMerge( dst, src, dstX, dstY, srcX, srcY, w, h, pct ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 9, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGECOPYMERGEGRAY ) /* void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) */ { - if( hb_pcount() == 9 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && HB_ISPOINTER( 2 ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && @@ -3342,8 +2636,7 @@ HB_FUNC( GDIMAGECOPYMERGEGRAY ) /* void gdImageCopyMergeGray(gdImagePtr dst, gdI HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && HB_ISNUM( 8 ) && - HB_ISNUM( 9 ) - ) + HB_ISNUM( 9 ) ) { gdImagePtr dst, src; int dstX, dstY, srcX, srcY, w, h, pct; @@ -3375,23 +2668,13 @@ HB_FUNC( GDIMAGECOPYMERGEGRAY ) /* void gdImageCopyMergeGray(gdImagePtr dst, gdI gdImageCopyMergeGray( dst, src, dstX, dstY, srcX, srcY, w, h, pct ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 9, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ), - hb_paramError( 9 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEPALETTECOPY ) /* void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISPOINTER( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISPOINTER( 2 ) ) { gdImagePtr dst, src; @@ -3405,21 +2688,13 @@ HB_FUNC( GDIMAGEPALETTECOPY ) /* void gdImagePaletteCopy(gdImagePtr dst, gdImage gdImagePaletteCopy( dst, src ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESQUARETOCIRCLE ) /* void gdImageSquareToCircle(gdImagePtr im, int radius) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int radius; @@ -3433,21 +2708,13 @@ HB_FUNC( GDIMAGESQUARETOCIRCLE ) /* void gdImageSquareToCircle(gdImagePtr im, in hb_retGdImage( gdImageSquareToCircle( im, radius ) ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGESHARPEN ) /* void gdImageSharpen(gdImagePtr im, int pct) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISNUM( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISNUM( 2 ) ) { gdImagePtr im; int pct; @@ -3462,51 +2729,26 @@ HB_FUNC( GDIMAGESHARPEN ) /* void gdImageSharpen(gdImagePtr im, int pct) */ gdImageSharpen( im, pct ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ /* MISCELLANEOUS FUNCTIONS */ -/* - */ HB_FUNC( GDIMAGECOMPARE ) /* int gdImageCompare(gdImagePtr im1, gdImagePtr im2) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISPOINTER( 2 ) - ) - { - gdImagePtr dst, src; - - /* Retrieve destination image pointer */ - dst = hb_parGdImage( 1 ); - - /* Retrieve source image pointer */ - src = hb_parGdImage( 2 ); - + if( HB_ISPOINTER( 1 ) && + HB_ISPOINTER( 2 ) ) /* Compare images - if return <> 0 check value for infos */ - hb_retni( gdImageCompare( dst, src ) ); - } + hb_retni( gdImageCompare( hb_parGdImage( 1 ), + hb_parGdImage( 2 ) ) ); else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - HB_FUNC( GDIMAGEINTERLACE ) /* void gdImageInterlace(gdImagePtr im, int interlace) */ { - if( hb_pcount() == 2 && - HB_ISPOINTER( 1 ) && - HB_ISLOG( 2 ) - ) + if( HB_ISPOINTER( 1 ) && + HB_ISLOG( 2 ) ) { gdImagePtr im; int interlace; @@ -3521,15 +2763,9 @@ HB_FUNC( GDIMAGEINTERLACE ) /* void gdImageInterlace(gdImagePtr im, int interlac gdImageInterlace( im, interlace ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 2, - hb_paramError( 1 ), hb_paramError( 2 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -/* - */ - #if HB_GD_VERS( 2, 0, 33 ) static void AddImageToFile( const char * szFile, const void * iptr, int sz ) @@ -3556,12 +2792,10 @@ static void AddImageToFile( const char * szFile, const void * iptr, int sz ) HB_FUNC( GDIMAGEGIFANIMBEGIN ) { #if HB_GD_VERS( 2, 0, 33 ) - if( hb_pcount() == 4 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && ( HB_ISCHAR( 2 ) || HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) && HB_ISNUM( 3 ) && - HB_ISNUM( 4 ) - ) + HB_ISNUM( 4 ) ) { gdImagePtr im; void * iptr; @@ -3582,43 +2816,28 @@ HB_FUNC( GDIMAGEGIFANIMBEGIN ) /* Check if 2nd parameter is a file name or an handle */ if( HB_ISCHAR( 2 ) ) - { - SaveImageToFile( hb_parcx( 2 ), iptr, size ); - } + SaveImageToFile( hb_parc( 2 ), iptr, size ); else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) - { - /* Retrieve file handle */ - HB_FHANDLE fhandle = HB_ISNUM( 2 ) ? hb_numToHandle( hb_parnint( 2 ) ) : 1; /* 1 = std output */ - - SaveImageToHandle( fhandle, iptr, size ); - } + SaveImageToHandle( hb_numToHandle( hb_parnintdef( 2, 1 /* std output */ ) ), iptr, size ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 3, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); #endif } -/* - */ - /*BGD_DECLARE(void *) gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); */ /* implementation: (void *) gdImageGifAnimAdd( gdImagePtr im, cFile | nHandle, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); */ HB_FUNC( GDIMAGEGIFANIMADD ) { #if HB_GD_VERS( 2, 0, 33 ) - if( hb_pcount() == 8 && - HB_ISPOINTER( 1 ) && + if( HB_ISPOINTER( 1 ) && ( HB_ISCHAR( 2 ) || HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) && HB_ISNUM( 3 ) && HB_ISNUM( 4 ) && HB_ISNUM( 5 ) && HB_ISNUM( 6 ) && HB_ISNUM( 7 ) && - ( HB_ISPOINTER( 8 ) || HB_ISNIL( 8 ) ) - ) + ( HB_ISPOINTER( 8 ) || HB_ISNIL( 8 ) ) ) { gdImagePtr im, previm; void * iptr; @@ -3640,37 +2859,21 @@ HB_FUNC( GDIMAGEGIFANIMADD ) /* Check if 2nd parameter is a file name or an handle */ if( HB_ISCHAR( 2 ) ) - { - AddImageToFile( hb_parcx( 2 ), iptr, size ); - } + AddImageToFile( hb_parc( 2 ), iptr, size ); else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) - { - /* Retrieve file handle */ - HB_FHANDLE fhandle = HB_ISNUM( 2 ) ? hb_numToHandle( hb_parnint( 2 ) ) : 1; /* 1 = std output */ - - SaveImageToHandle( fhandle, iptr, size ); - } + SaveImageToHandle( hb_numToHandle( hb_parnintdef( 2, 1 /* std output */ ) ), iptr, size ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 8, - hb_paramError( 1 ), hb_paramError( 2 ), hb_paramError( 3 ), hb_paramError( 4 ), - hb_paramError( 5 ), hb_paramError( 6 ), hb_paramError( 7 ), hb_paramError( 8 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); #endif } -/* - */ - /*BGD_DECLARE(void *) gdImageGifAnimEndPtr(int *size); */ /* implementation: gdImageGifAnimEnd( cFile | nHandle ); */ HB_FUNC( GDIMAGEGIFANIMEND ) { #if HB_GD_VERS( 2, 0, 33 ) - if( hb_pcount() == 1 && - ( HB_ISCHAR( 1 ) || HB_ISNUM( 1 ) || HB_ISNIL( 1 ) ) - ) + if( HB_ISCHAR( 1 ) || HB_ISNUM( 1 ) || HB_ISNIL( 1 ) ) { void * iptr; int size; @@ -3680,28 +2883,15 @@ HB_FUNC( GDIMAGEGIFANIMEND ) /* Check if 1st parameter is a file name or an handle */ if( HB_ISCHAR( 1 ) ) - { - AddImageToFile( hb_parcx( 1 ), iptr, size ); - } + AddImageToFile( hb_parc( 1 ), iptr, size ); else if( HB_ISNUM( 2 ) || HB_ISNIL( 2 ) ) - { - /* Retrieve file handle */ - HB_FHANDLE fhandle = HB_ISNUM( 1 ) ? hb_numToHandle( hb_parnint( 1 ) ) : 1; /* 1 = std output */ - - SaveImageToHandle( fhandle, iptr, size ); - } + SaveImageToHandle( hb_numToHandle( hb_parnintdef( 1, 1 /* std output */ ) ), iptr, size ); } else - { - hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, - HB_ERR_FUNCNAME, 1, - hb_paramError( 1 ) ); - } + hb_errRT_BASE_SubstR( EG_ARG, 0, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); #endif } -/* - */ - HB_FUNC( HB_GD_VERSION ) { hb_storni( GD_MAJOR_VERSION, 1 ); diff --git a/harbour/src/rtl/tclass.prg b/harbour/src/rtl/tclass.prg index 1183f4ea78..d749df1038 100644 --- a/harbour/src/rtl/tclass.prg +++ b/harbour/src/rtl/tclass.prg @@ -92,8 +92,11 @@ FUNCTION HBClass() BEGIN SEQUENCE +#if 0 + hClass := __clsNew( "HBCLASS", 17,, @HBClass() ) +#else hClass := __clsNew( "HBCLASS", 16,, @HBClass() ) -/* hClass := __clsNew( "HBCLASS", 17,, @HBClass()) */ +#endif __clsAddMsg( hClass, "New" , @New() , HB_OO_MSG_METHOD ) __clsAddMsg( hClass, "Create" , @Create() , HB_OO_MSG_METHOD ) @@ -146,8 +149,10 @@ FUNCTION HBClass() __clsAddMsg( hClass, "_asFriendFunc" , 15, HB_OO_MSG_ASSIGN ) __clsAddMsg( hClass, "sClassFunc" , 16, HB_OO_MSG_ACCESS ) __clsAddMsg( hClass, "_sClassFunc" , 16, HB_OO_MSG_ASSIGN ) - /* __clsAddMsg( hClass, "class" , 17, HB_OO_MSG_ACCESS ) - __clsAddMsg( hClass, "_class" , 17, HB_OO_MSG_ASSIGN ) */ +#if 0 + __clsAddMsg( hClass, "class" , 17, HB_OO_MSG_ACCESS ) + __clsAddMsg( hClass, "_class" , 17, HB_OO_MSG_ASSIGN ) +#endif ALWAYS @@ -212,7 +217,9 @@ STATIC PROCEDURE Create( /* MetaClass */ ) LOCAL hClass LOCAL ahSuper := {} -/* Self:Class := MetaClass */ +#if 0 + Self:Class := MetaClass +#endif FOR EACH n IN ::asSuper hClass := __clsInstSuper( n ) /* Super handle available */ @@ -232,12 +239,13 @@ STATIC PROCEDURE Create( /* MetaClass */ ) ENDIF __clsAddMsg( hClass, "REALCLASS", 0, HB_OO_MSG_REALCLASS, 0, HB_OO_CLSTP_EXPORTED ) +#if 0 // We will work here on the MetaClass object to add the Class Method // as needed - // FOR EACH n IN ::aClsMethods - // // do it - // NEXT - // // + FOR EACH n IN ::aClsMethods + // do it + NEXT +#endif /* local messages... */ diff --git a/harbour/src/rtl/tobject.prg b/harbour/src/rtl/tobject.prg index 023effa700..7168f49117 100644 --- a/harbour/src/rtl/tobject.prg +++ b/harbour/src/rtl/tobject.prg @@ -6,7 +6,7 @@ * Harbour Project source code: * Base Object from which all object finally inherit * - * Copyright 2000 JfL&RaC , + * Copyright 2000 J. Lefebvre & RA. Cuylen * www - http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -50,24 +50,6 @@ * */ -/* - * The following parts are Copyright of the individual authors. - * www - http://harbour-project.org - * - * Copyright 2000 J. Lefebvre & RA. Cuylen - * 1.40 07/13/2000 JFL&RAC - * Now supporting of New and Init method as Class(y) use it - * So oMyObj:new(Var1, Var2) will call oMyObj:Init(Var1, Var2) - * Currently limited to 20 params - * - * 1.41 07/18/2000 JFL&RAC - * Improving class(y) compatibility - * adding messages :error() and ::MsgNotFound() - * - * See COPYING for licensing terms. - * - */ - /* WARNING: Can not use the preprocessor, otherwise it will auto inherit from itself. */ @@ -85,12 +67,6 @@ FUNCTION HBObject() oClass := HBClass():New( "HBObject",, @HBObject() ) - /* Those Five worked fine but their C version from classes.c are probably better in term of speed */ - /*oClass:AddInline( "CLASSNAME" , {| Self | __OBJGETCLSNAME( Self ) }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "CLASSH" , {| Self | __CLASSH( Self ) }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "CLASSSEL" , {| Self | __CLASSSEL( Self:CLASSH() ) }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "EVAL" , {| Self | __EVAL( Self ) }, HB_OO_CLSTP_EXPORTED ) */ - #ifndef HB_CLP_STRICT oClass:AddInline( "ISDERIVEDFROM" , {| Self, xPar1 | __ObjDerivedFrom( Self, xPar1 ) }, HB_OO_CLSTP_EXPORTED ) /* Xbase++ compatibility */ #endif @@ -106,42 +82,39 @@ FUNCTION HBObject() oClass:AddInline( "MSGNOTFOUND" , {| Self, cMsg | ::Error( "Message not found", Self:className, cMsg, iif( Left( cMsg, 1 ) == "_", 1005, 1004 ) ) }, HB_OO_CLSTP_EXPORTED ) - /*oClass:AddMultiData( , , HB_OO_CLSTP_EXPORTED, { "CLASS" }, .F. ) */ +#if 0 + oClass:AddMultiData( , , HB_OO_CLSTP_EXPORTED, { "CLASS" }, .F. ) - /*oClass:AddInline( "ADDMETHOD" , {| Self, cMeth, pFunc, nScopeMeth | __clsAddMsg( __CLASSH( Self ) , cMeth , pFunc ,HB_OO_MSG_METHOD , NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "ADDVAR" , {| Self, cVAR, nScopeMeth, uiData, hClass | __clsAddMsg( hClass:=__CLASSH( Self ) , cVar , uidata := __CLS_INCDATA( hClass ), HB_OO_MSG_ACCESS, NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) , ; */ - /* __clsAddMsg( hClass , "_"+cVar , uiData , HB_OO_MSG_ASSIGN, NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "ADDMETHOD" , {| Self, cMeth, pFunc, nScopeMeth | __clsAddMsg( __CLASSH( Self ) , cMeth , pFunc ,HB_OO_MSG_METHOD , NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "ADDVAR" , {| Self, cVAR, nScopeMeth, uiData, hClass | __clsAddMsg( hClass:=__CLASSH( Self ) , cVar , uidata := __CLS_INCDATA( hClass ), HB_OO_MSG_ACCESS, NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) , ; + __clsAddMsg( hClass , "_"+cVar , uiData , HB_OO_MSG_ASSIGN, NIL, iif( nScopeMeth == NIL, 1, nScopeMeth ) ) }, HB_OO_CLSTP_EXPORTED ) - /* Those one exist within Class(y), so we will probably try to implement it */ + /* These ones exist within Class(y), so we will probably try to implement it */ - /*oClass:AddInline( "asString" , {| Self | ::class:name + " object" }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "asExpStr" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "basicSize" , {| Self | Len( Self ) }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "become" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "isEqual" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "isScalar" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "copy" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "deepCopy" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "asString" , {| Self | ::class:name + " object" }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "asExpStr" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "basicSize" , {| Self | Len( Self ) }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "become" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "isEqual" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "isScalar" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "copy" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "deepCopy" , {| Self | }, HB_OO_CLSTP_EXPORTED ) - /*oClass:AddInline( "deferred" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "deferred" , {| Self | }, HB_OO_CLSTP_EXPORTED ) - /*oClass:AddInline( "exec" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "error , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "hash" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "null" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "size" , {| Self | Len( Self ) }, HB_OO_CLSTP_EXPORTED ) */ - - /* Those three are already treated within Classes.c */ - /*oClass:AddInline( "protectErr" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "hiddenErr" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "readOnlyErr" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "exec" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "error" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "hash" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "null" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "size" , {| Self | Len( Self ) }, HB_OO_CLSTP_EXPORTED ) /* No idea when those two could occur !!? */ - /*oClass:AddInline( "wrongClass" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ - /*oClass:AddInline( "badMethod" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "wrongClass" , {| Self | }, HB_OO_CLSTP_EXPORTED ) + oClass:AddInline( "badMethod" , {| Self | }, HB_OO_CLSTP_EXPORTED ) /* this one exist within VO and seem to be Auto Called when object ran out of scope */ - /*oClass:AddInline( "Axit" , {| Self | }, HB_OO_CLSTP_EXPORTED ) */ + oClass:AddInline( "Axit" , {| Self | }, HB_OO_CLSTP_EXPORTED ) +#endif oClass:Create() @@ -153,11 +126,12 @@ FUNCTION HBObject() ENDIF -/* +#if 0 oInstance := s_oClass:Instance() oInstance:class := s_oClass + RETURN oInstance -*/ +#endif RETURN s_oClass:Instance() diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index c26939e2b5..25baa6c704 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -10355,6 +10355,18 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel ) /* Silently ignore */ + CASE Lower( Left( cLine, Len( "keywords=" ) ) ) == "keywords=" ; cLine := SubStr( cLine, Len( "keywords=" ) + 1 ) + + /* Silently ignore */ + + CASE Lower( Left( cLine, Len( "licences=" ) ) ) == "licenses=" ; cLine := SubStr( cLine, Len( "licences=" ) + 1 ) + + /* Silently ignore */ + + CASE Lower( Left( cLine, Len( "repository=" ) ) ) == "repository=" ; cLine := SubStr( cLine, Len( "repository=" ) + 1 ) + + /* Silently ignore */ + ENDCASE NEXT