Hi
wapi_gdi32.c OR wapi_gdi.c ( removing 32, may contain gdi32 or gdi++
functions )
hbwapi.h
=======
#define wapi_parwparam( n ) ( ( WPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parlparam( n ) ( ( LPARAM ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parhandle( n ) ( ( HANDLE ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parhwnd( n ) ( ( HWND ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parwndproc( n ) ( ( WNDPROC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parhdc( n ) ( ( HDC ) ( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parcolor( n ) ( ( COLORREF )( HB_PTRDIFF ) hb_parnint( n ) )
#define wapi_parstruct( n ) ( hb_parc( n ) )
#define wapi_rethandle( n ) ( hb_retnint( ( HB_PTRDIFF ) n ) )
#define wapi_retstruct( x ) ( hb_retc( x ) )
#define wapi_more_most_often_used_types( x ) (...)
#define HB_HWND HWND
#define HB_COLORREF COLORREF
#define HB_HDC HDC
// etc.
/* IMO, we must avoid the direct API types at the API level */
wapi_gdi.c
========
/*
All functions prefixed with WAPI_* will accept parameters in
the same order and types, including structures. Only in cases
where a complex structure is involved, an array of same number
of elements corresponding members of the structure. If both
can be implemented, the better it could be.
*/
#include <windows.h>
#include <gdi32.h>
#include "hbwapi.h"
HB_FUNC( WAPI_PRINTDLG )
{
PRINTDLG *pd = hb_parc( 1 ); // structure WHEREEVER possible
...
wapi_retstruct( pd );
}
win_printing.c // depending upon the functions classification
==========
#include <windows.h>
#include <gdi32.h>
#include "hbwapi.h"
#include "win_printing.h" // If any
HB_FUNC( WIN_PRINTDLG )
{
HB_HWND hwnd = wapi_parhwnd( 1 );
HB_INT iCopies = hb_parni( 2 );
}
HB_FUNC( WIN_GETDEFAULTPRINTER )
{
...
...
hb_retl( GetDefaultPrinter( ... ) );
}
A rough draft.
Continue...
Regards
Pritpal Bedi
--
View this message in context:
http://www.nabble.com/SF.net-SVN%3A-harbour-project%3A-10164--trunk-harbour-tp21821360p21842486.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour