diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d088a496a4..8851800e6a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,53 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-18 08:52 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + + contrib/hbhpdf/Makefile + + contrib/hbhpdf/make_b32.bat + + contrib/hbhpdf/make_vc.bat + + contrib/hbhpdf/make_gcc.sh + + contrib/hbhpdf/common.mak + + contrib/hbhpdf/tests/bld_b32.bat + + contrib/hbhpdf/tests/bld_vc.bat + + Added build/make files. + ; Please test GNU make files. + + * contrib/make_b32_all.bat + * contrib/make_gcc_all.sh + * contrib/make_vc_all.bat + + Added hbhpdf to 'all' make files. + (not yet to GNU make files though) + + - contrib/hbhpdf/tests/ + + contrib/hbhpdf/tests/files/ + * Data files needed for test app moved + to a subdir. + + * contrib/hbhpdf/tests/harupdf.prg + ! Absolute paths changed to relative ones + (for both input and output ones). + ! NumToHex() -> hb_NumToHex() + + hbct added to liblist because test program + uses SIN()/COS()/TAN() from it. + + - contrib/hbhpdf/tests/harupdf.ch + + contrib/hbhpdf/harupdf.ch + * Moved to main dir. + + - contrib/hbhpdf/hpdf.h + - Removed original libharu header. This + will be picked up from the package dir, + along with the rest of the .h files. + + * contrib/hbhpdf/harupdf.ch + + Added self-guard. + + * contrib/hbhpdf/harupdf.c + ! Fixed a few BCC warnings. It now builds cleanly. + ; NOTE: There are a lot MSVC casting warnings and errors left. + + ; Many thanks for this contrib to Pritpal Bedi. + 2008-05-17 18:45 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com) + harbour/contrib/hbhpdf + harbour/contrib/hbhpdf/harupdf.c diff --git a/harbour/contrib/hbhpdf/Makefile b/harbour/contrib/hbhpdf/Makefile new file mode 100644 index 0000000000..b64e1dc426 --- /dev/null +++ b/harbour/contrib/hbhpdf/Makefile @@ -0,0 +1,24 @@ +# +# $Id$ +# + +ROOT = ../../ + +C_SOURCES=\ + harupdf.c \ + +PRG_HEADERS=\ + harupdf.ch \ + +PRG_SOURCES=\ + +LIBNAME=hbhpdf + +CFLAGS := $(CFLAGS) -I/usr/include + +include $(TOP)$(ROOT)config/header.cf +INSTALL_RULE_HEADERS := $(INSTALL_RULE) +include $(TOP)$(ROOT)config/lib.cf + +install:: + $(INSTALL_RULE_HEADERS) diff --git a/harbour/contrib/hbhpdf/common.mak b/harbour/contrib/hbhpdf/common.mak new file mode 100644 index 0000000000..7a41074511 --- /dev/null +++ b/harbour/contrib/hbhpdf/common.mak @@ -0,0 +1,16 @@ +# +# $Id$ +# + +LIBNAME = $(LIBPREF)hbhpdf + +LIB_PATH = $(LIB_DIR)$(LIBNAME)$(LIBEXT) + +PRG_HEADERS = \ + harupdf.ch \ + +LIB_OBJS = \ + $(OBJ_DIR)harupdf$(OBJEXT) \ + +all: \ + $(LIB_PATH) \ diff --git a/harbour/contrib/hbhpdf/harupdf.c b/harbour/contrib/hbhpdf/harupdf.c index e620b57c02..0f461abb4d 100644 --- a/harbour/contrib/hbhpdf/harupdf.c +++ b/harbour/contrib/hbhpdf/harupdf.c @@ -1,6 +1,7 @@ /* * $Id$ */ + /* * Copyright 2008 Pritpal Bedi * @@ -45,6 +46,7 @@ * If you do not wish that, delete this exception notice. * */ + //----------------------------------------------------------------------// //----------------------------------------------------------------------// //----------------------------------------------------------------------// @@ -132,7 +134,7 @@ HB_FUNC( HPDF_GETSTREAMSIZE ) HB_FUNC( HPDF_READFROMSTREAM ) { HPDF_UINT32 size = strlen( hb_parc( 2 ) ); - HPDF_ReadFromStream( (HPDF_Doc) hb_parnl( 1 ), hb_parc( 2 ), &size ); + HPDF_ReadFromStream( (HPDF_Doc) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), &size ); hb_retnl( size ); } //----------------------------------------------------------------------// @@ -407,7 +409,7 @@ HB_FUNC( HPDF_LOADRAWIMAGEFROMFILE ) // HB_FUNC( HPDF_LOADRAWIMAGEFROMMEM ) { - hb_retnl( (long) HPDF_LoadRawImageFromMem( (HPDF_Doc) hb_parnl( 1 ), hb_parc( 2 ), hb_parni( 3 ), hb_parni( 4 ), (HPDF_ColorSpace) hb_parni( 5 ), hb_parni( 6 ) ) ); + hb_retnl( (long) HPDF_LoadRawImageFromMem( (HPDF_Doc) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), hb_parni( 3 ), hb_parni( 4 ), (HPDF_ColorSpace) hb_parni( 5 ), hb_parni( 6 ) ) ); } //----------------------------------------------------------------------// // HPdf_LoadJPEGImageFromFile( hDoc, cHPEGFileName ) -> hImage @@ -1481,7 +1483,7 @@ HB_FUNC( HPDF_FONT_TEXTWIDTH ) PHB_ITEM info = hb_itemArrayNew( 4 ); PHB_ITEM temp = hb_itemNew( NULL ); - tw = HPDF_Font_TextWidth( (HPDF_Font) hb_parnl( 1 ), hb_parc( 2 ), hb_parni( 3 ) ); + tw = HPDF_Font_TextWidth( (HPDF_Font) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), hb_parni( 3 ) ); hb_arraySet( info, 1, hb_itemPutNI( temp, tw.numchars ) ); hb_arraySet( info, 2, hb_itemPutNI( temp, tw.numwords ) ); @@ -1498,14 +1500,14 @@ HB_FUNC( HPDF_FONT_TEXTWIDTH ) HB_FUNC( HPDF_FONT_MEASURETEXT ) { hb_retni( HPDF_Font_MeasureText( (HPDF_Font) hb_parnl( 1 ), - hb_parc ( 2 ), - hb_parni( 3 ), - hb_parnd( 4 ), - hb_parnd( 5 ), - hb_parnd( 6 ), - hb_parnd( 7 ), - hb_parl ( 8 ), - NULL ) ); + (HPDF_BYTE*) hb_parc ( 2 ), + hb_parni( 3 ), + hb_parnd( 4 ), + hb_parnd( 5 ), + hb_parnd( 6 ), + hb_parnd( 7 ), + hb_parl ( 8 ), + NULL ) ); } //----------------------------------------------------------------------// //----------------------------------------------------------------------// diff --git a/harbour/contrib/hbhpdf/tests/harupdf.ch b/harbour/contrib/hbhpdf/harupdf.ch similarity index 99% rename from harbour/contrib/hbhpdf/tests/harupdf.ch rename to harbour/contrib/hbhpdf/harupdf.ch index 8a78b4f41e..6affec2f1a 100644 --- a/harbour/contrib/hbhpdf/tests/harupdf.ch +++ b/harbour/contrib/hbhpdf/harupdf.ch @@ -1,7 +1,13 @@ /* * $Id$ */ + /* + * Harbour level header for hbhpdf/libharu Library. + * + * Copyright 2008 {list of individual authors and e-mail addresses} + * www - http://www.harbour-project.org + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option ) @@ -42,6 +48,7 @@ * If you do not wish that, delete this exception notice. * */ + //----------------------------------------------------------------------// //----------------------------------------------------------------------// //----------------------------------------------------------------------// @@ -52,6 +59,9 @@ //----------------------------------------------------------------------// //----------------------------------------------------------------------// +#ifndef _HARUPDF_CH +#define _HARUPDF_CH + // HPDF_InfoType #define HPDF_INFO_CREATION_DATE 0 #define HPDF_INFO_MOD_DATE 1 @@ -800,3 +810,5 @@ #define HPDF_GMODE_EXTERNAL_OBJECT 0x0040 //----------------------------------------------------------------------// + +#endif // _HARUPDF_CH diff --git a/harbour/contrib/hbhpdf/hpdf.h b/harbour/contrib/hbhpdf/hpdf.h deleted file mode 100644 index c849db8aac..0000000000 --- a/harbour/contrib/hbhpdf/hpdf.h +++ /dev/null @@ -1,1227 +0,0 @@ -/* - * << Haru Free PDF Library 2.0.8 >> -- hpdf.h - * - * URL http://libharu.sourceforge.net/ - * - * Copyright (c) 1999-2006 Takeshi Kanno - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. - * It is provided "as is" without express or implied warranty. - * - */ - -#ifndef _HPDF_H -#define _HPDF_H - -#ifdef HPDF_DLL_MAKE -# define HPDF_EXPORT(A) __declspec(dllexport) A __stdcall -#else -# ifdef HPDF_DLL_MAKE_CDECL -# define HPDF_EXPORT(A) __declspec(dllexport) A -# else -# ifdef HPDF_SHARED_MAKE -# define HPDF_EXPORT(A) extern A -# endif /* HPDF_SHARED_MAKE */ -# endif /* HPDF_DLL_MAKE_CDECL */ -#endif /* HPDF_DLL_MAKE */ - -#ifdef HPDF_DLL -# define HPDF_SHARED -# define HPDF_EXPORT(A) __declspec(dllimport) A __stdcall -#else -# ifdef HPDF_DLL_CDECL -# define HPDF_SHARED -# define HPDF_EXPORT(A) __declspec(dllimport) A -# endif /* HPDF_DLL_CDECL */ -#endif /* HPDF_DLL */ - -#ifdef HPDF_SHARED - -#ifndef HPDF_EXPORT -#define HPDF_EXPORT(A) extern A -#endif /* HPDF_EXPORT */ - -#include "hpdf_consts.h" -#include "hpdf_types.h" - -typedef void *HPDF_HANDLE; -typedef HPDF_HANDLE HPDF_Doc; -typedef HPDF_HANDLE HPDF_Page; -typedef HPDF_HANDLE HPDF_Pages; -typedef HPDF_HANDLE HPDF_Stream; -typedef HPDF_HANDLE HPDF_Image; -typedef HPDF_HANDLE HPDF_Font; -typedef HPDF_HANDLE HPDF_Outline; -typedef HPDF_HANDLE HPDF_Encoder; -typedef HPDF_HANDLE HPDF_Destination; -typedef HPDF_HANDLE HPDF_XObject; -typedef HPDF_HANDLE HPDF_Annotation; -typedef HPDF_HANDLE HPDF_ExtGState; - -#else - -#ifndef HPDF_EXPORT -#define HPDF_EXPORT(A) A -#endif /* HPDF_EXPORT */ - -#include "hpdf_consts.h" -#include "hpdf_doc.h" - -#endif /* HPDF_SHARED */ - -#ifdef __cplusplus -extern "C" { -#endif - -HPDF_EXPORT(const char *) -HPDF_GetVersion (void); - - -HPDF_EXPORT(HPDF_Doc) -HPDF_NewEx (HPDF_Error_Handler user_error_fn, - HPDF_Alloc_Func user_alloc_fn, - HPDF_Free_Func user_free_fn, - HPDF_UINT mem_pool_buf_size, - void *user_data); - -HPDF_EXPORT(HPDF_Doc) -HPDF_New (HPDF_Error_Handler user_error_fn, - void *user_data); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetErrorHandler (HPDF_Doc pdf, - HPDF_Error_Handler user_error_fn); - - -HPDF_EXPORT(void) -HPDF_Free (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_NewDoc (HPDF_Doc pdf); - - -HPDF_EXPORT(void) -HPDF_FreeDoc (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_BOOL) -HPDF_HasDoc (HPDF_Doc pdf); - - -HPDF_EXPORT(void) -HPDF_FreeDocAll (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SaveToStream (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_UINT32) -HPDF_GetStreamSize (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_ReadFromStream (HPDF_Doc pdf, - HPDF_BYTE *buf, - HPDF_UINT32 *size); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_ResetStream (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SaveToFile (HPDF_Doc pdf, - const char *file_name); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_GetError (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_GetErrorDetail (HPDF_Doc pdf); - -HPDF_EXPORT(void) -HPDF_ResetError (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetPagesConfiguration (HPDF_Doc pdf, - HPDF_UINT page_per_pages); - - -HPDF_EXPORT(HPDF_Page) -HPDF_GetPageByIndex (HPDF_Doc pdf, - HPDF_UINT index); - - -/*---------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_PageLayout) -HPDF_GetPageLayout (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetPageLayout (HPDF_Doc pdf, - HPDF_PageLayout layout); - - -HPDF_EXPORT(HPDF_PageMode) -HPDF_GetPageMode (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetPageMode (HPDF_Doc pdf, - HPDF_PageMode mode); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_GetViewerPreference (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetViewerPreference (HPDF_Doc pdf, - HPDF_UINT value); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetOpenAction (HPDF_Doc pdf, - HPDF_Destination open_action); - - -/*---------------------------------------------------------------------------*/ -/*----- page handling -------------------------------------------------------*/ - - -HPDF_EXPORT(HPDF_Page) -HPDF_GetCurrentPage (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_Page) -HPDF_AddPage (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_Page) -HPDF_InsertPage (HPDF_Doc pdf, - HPDF_Page page); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetWidth (HPDF_Page page, - HPDF_REAL value); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetHeight (HPDF_Page page, - HPDF_REAL value); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetSize (HPDF_Page page, - HPDF_PageSizes size, - HPDF_PageDirection direction); - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetRotate (HPDF_Page page, - HPDF_UINT16 angle); - -/*---------------------------------------------------------------------------*/ -/*----- font handling -------------------------------------------------------*/ - - -HPDF_EXPORT(HPDF_Font) -HPDF_GetFont (HPDF_Doc pdf, - const char *font_name, - const char *encoding_name); - - -HPDF_EXPORT(const char*) -HPDF_LoadType1FontFromFile (HPDF_Doc pdf, - const char *afm_file_name, - const char *data_file_name); - - -HPDF_EXPORT(const char*) -HPDF_LoadTTFontFromFile (HPDF_Doc pdf, - const char *file_name, - HPDF_BOOL embedding); - - -HPDF_EXPORT(const char*) -HPDF_LoadTTFontFromFile2 (HPDF_Doc pdf, - const char *file_name, - HPDF_UINT index, - HPDF_BOOL embedding); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_AddPageLabel (HPDF_Doc pdf, - HPDF_UINT page_num, - HPDF_PageNumStyle style, - HPDF_UINT first_page, - const char *prefix); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseJPFonts (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseKRFonts (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseCNSFonts (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseCNTFonts (HPDF_Doc pdf); - - -/*--------------------------------------------------------------------------*/ -/*----- outline ------------------------------------------------------------*/ - - -HPDF_EXPORT(HPDF_Outline) -HPDF_CreateOutline (HPDF_Doc pdf, - HPDF_Outline parent, - const char *title, - HPDF_Encoder encoder); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Outline_SetOpened (HPDF_Outline outline, - HPDF_BOOL opened); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Outline_SetDestination (HPDF_Outline outline, - HPDF_Destination dst); - - -/*--------------------------------------------------------------------------*/ -/*----- destination --------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_Destination) -HPDF_Page_CreateDestination (HPDF_Page page); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetXYZ (HPDF_Destination dst, - HPDF_REAL left, - HPDF_REAL top, - HPDF_REAL zoom); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFit (HPDF_Destination dst); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitH (HPDF_Destination dst, - HPDF_REAL top); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitV (HPDF_Destination dst, - HPDF_REAL left); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitR (HPDF_Destination dst, - HPDF_REAL left, - HPDF_REAL bottom, - HPDF_REAL right, - HPDF_REAL top); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitB (HPDF_Destination dst); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitBH (HPDF_Destination dst, - HPDF_REAL top); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Destination_SetFitBV (HPDF_Destination dst, - HPDF_REAL left); - -/*--------------------------------------------------------------------------*/ -/*----- encoder ------------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_Encoder) -HPDF_GetEncoder (HPDF_Doc pdf, - const char *encoding_name); - - -HPDF_EXPORT(HPDF_Encoder) -HPDF_GetCurrentEncoder (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetCurrentEncoder (HPDF_Doc pdf, - const char *encoding_name); - - -HPDF_EXPORT(HPDF_EncoderType) -HPDF_Encoder_GetType (HPDF_Encoder encoder); - - -HPDF_EXPORT(HPDF_ByteType) -HPDF_Encoder_GetByteType (HPDF_Encoder encoder, - const char *text, - HPDF_UINT index); - - -HPDF_EXPORT(HPDF_UNICODE) -HPDF_Encoder_GetUnicode (HPDF_Encoder encoder, - HPDF_UINT16 code); - - -HPDF_EXPORT(HPDF_WritingMode) -HPDF_Encoder_GetWritingMode (HPDF_Encoder encoder); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseJPEncodings (HPDF_Doc pdf); - - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseKREncodings (HPDF_Doc pdf); - - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseCNSEncodings (HPDF_Doc pdf); - - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_UseCNTEncodings (HPDF_Doc pdf); - - -/*--------------------------------------------------------------------------*/ -/*----- annotation ---------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_Annotation) -HPDF_Page_CreateTextAnnot (HPDF_Page page, - HPDF_Rect rect, - const char *text, - HPDF_Encoder encoder); - - -HPDF_EXPORT(HPDF_Annotation) -HPDF_Page_CreateLinkAnnot (HPDF_Page page, - HPDF_Rect rect, - HPDF_Destination dst); - - -HPDF_EXPORT(HPDF_Annotation) -HPDF_Page_CreateURILinkAnnot (HPDF_Page page, - HPDF_Rect rect, - const char *uri); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot, - HPDF_AnnotHighlightMode mode); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot, - HPDF_REAL width, - HPDF_UINT16 dash_on, - HPDF_UINT16 dash_off); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_TextAnnot_SetIcon (HPDF_Annotation annot, - HPDF_AnnotIcon icon); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_TextAnnot_SetOpened (HPDF_Annotation annot, - HPDF_BOOL opened); - - - -/*--------------------------------------------------------------------------*/ -/*----- image data ---------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_Image) -HPDF_LoadPngImageFromFile (HPDF_Doc pdf, - const char *filename); - - -HPDF_EXPORT(HPDF_Image) -HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf, - const char *filename); - - -HPDF_EXPORT(HPDF_Image) -HPDF_LoadJpegImageFromFile (HPDF_Doc pdf, - const char *filename); - - -HPDF_EXPORT(HPDF_Image) -HPDF_LoadRawImageFromFile (HPDF_Doc pdf, - const char *filename, - HPDF_UINT width, - HPDF_UINT height, - HPDF_ColorSpace color_space); - - -HPDF_EXPORT(HPDF_Image) -HPDF_LoadRawImageFromMem (HPDF_Doc pdf, - const HPDF_BYTE *buf, - HPDF_UINT width, - HPDF_UINT height, - HPDF_ColorSpace color_space, - HPDF_UINT bits_per_component); - - -HPDF_EXPORT(HPDF_Point) -HPDF_Image_GetSize (HPDF_Image image); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Image_GetSize2 (HPDF_Image image, HPDF_Point *size); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Image_GetWidth (HPDF_Image image); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Image_GetHeight (HPDF_Image image); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Image_GetBitsPerComponent (HPDF_Image image); - - -HPDF_EXPORT(const char*) -HPDF_Image_GetColorSpace (HPDF_Image image); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Image_SetColorMask (HPDF_Image image, - HPDF_UINT rmin, - HPDF_UINT rmax, - HPDF_UINT gmin, - HPDF_UINT gmax, - HPDF_UINT bmin, - HPDF_UINT bmax); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Image_SetMaskImage (HPDF_Image image, - HPDF_Image mask_image); - - -/*--------------------------------------------------------------------------*/ -/*----- info dictionary ----------------------------------------------------*/ - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetInfoAttr (HPDF_Doc pdf, - HPDF_InfoType type, - const char *value); - - -HPDF_EXPORT(const char*) -HPDF_GetInfoAttr (HPDF_Doc pdf, - HPDF_InfoType type); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetInfoDateAttr (HPDF_Doc pdf, - HPDF_InfoType type, - HPDF_Date value); - - -/*--------------------------------------------------------------------------*/ -/*----- encryption ---------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetPassword (HPDF_Doc pdf, - const char *owner_passwd, - const char *user_passwd); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetPermission (HPDF_Doc pdf, - HPDF_UINT permission); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetEncryptionMode (HPDF_Doc pdf, - HPDF_EncryptMode mode, - HPDF_UINT key_len); - - -/*--------------------------------------------------------------------------*/ -/*----- compression --------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_STATUS) -HPDF_SetCompressionMode (HPDF_Doc pdf, - HPDF_UINT mode); - - -/*--------------------------------------------------------------------------*/ -/*----- font ---------------------------------------------------------------*/ - -HPDF_EXPORT(const char*) -HPDF_Font_GetFontName (HPDF_Font font); - - -HPDF_EXPORT(const char*) -HPDF_Font_GetEncodingName (HPDF_Font font); - - -HPDF_EXPORT(HPDF_INT) -HPDF_Font_GetUnicodeWidth (HPDF_Font font, - HPDF_UNICODE code); - -HPDF_EXPORT(HPDF_Box) -HPDF_Font_GetBBox (HPDF_Font font); - - -HPDF_EXPORT(HPDF_INT) -HPDF_Font_GetAscent (HPDF_Font font); - - -HPDF_EXPORT(HPDF_INT) -HPDF_Font_GetDescent (HPDF_Font font); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Font_GetXHeight (HPDF_Font font); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Font_GetCapHeight (HPDF_Font font); - - -HPDF_EXPORT(HPDF_TextWidth) -HPDF_Font_TextWidth (HPDF_Font font, - const HPDF_BYTE *text, - HPDF_UINT len); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Font_MeasureText (HPDF_Font font, - const HPDF_BYTE *text, - HPDF_UINT len, - HPDF_REAL width, - HPDF_REAL font_size, - HPDF_REAL char_space, - HPDF_REAL word_space, - HPDF_BOOL wordwrap, - HPDF_REAL *real_width); - - -/*--------------------------------------------------------------------------*/ -/*----- extended graphics state --------------------------------------------*/ - -HPDF_EXPORT(HPDF_ExtGState) -HPDF_CreateExtGState (HPDF_Doc pdf); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_ExtGState_SetAlphaStroke (HPDF_ExtGState ext_gstate, - HPDF_REAL value); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_ExtGState_SetAlphaFill (HPDF_ExtGState ext_gstate, - HPDF_REAL value); - - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_ExtGState_SetBlendMode (HPDF_ExtGState ext_gstate, - HPDF_BlendMode mode); - - -/*--------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------*/ - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_TextWidth (HPDF_Page page, - const char *text); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Page_MeasureText (HPDF_Page page, - const char *text, - HPDF_REAL width, - HPDF_BOOL wordwrap, - HPDF_REAL *real_width); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetWidth (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetHeight (HPDF_Page page); - - -HPDF_EXPORT(HPDF_UINT16) -HPDF_Page_GetGMode (HPDF_Page page); - - -HPDF_EXPORT(HPDF_Point) -HPDF_Page_GetCurrentPos (HPDF_Page page); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_GetCurrentPos2 (HPDF_Page page, - HPDF_Point *pos); - - -HPDF_EXPORT(HPDF_Point) -HPDF_Page_GetCurrentTextPos (HPDF_Page page); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_GetCurrentTextPos2 (HPDF_Page page, - HPDF_Point *pos); - - -HPDF_EXPORT(HPDF_Font) -HPDF_Page_GetCurrentFont (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetCurrentFontSize (HPDF_Page page); - - -HPDF_EXPORT(HPDF_TransMatrix) -HPDF_Page_GetTransMatrix (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetLineWidth (HPDF_Page page); - - -HPDF_EXPORT(HPDF_LineCap) -HPDF_Page_GetLineCap (HPDF_Page page); - - -HPDF_EXPORT(HPDF_LineJoin) -HPDF_Page_GetLineJoin (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetMiterLimit (HPDF_Page page); - - -HPDF_EXPORT(HPDF_DashMode) -HPDF_Page_GetDash (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetFlat (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetCharSpace (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetWordSpace (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetHorizontalScalling (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetTextLeading (HPDF_Page page); - - -HPDF_EXPORT(HPDF_TextRenderingMode) -HPDF_Page_GetTextRenderingMode (HPDF_Page page); - - -/* This function is obsolete. Use HPDF_Page_GetTextRise. */ -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetTextRaise (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetTextRise (HPDF_Page page); - - -HPDF_EXPORT(HPDF_RGBColor) -HPDF_Page_GetRGBFill (HPDF_Page page); - - -HPDF_EXPORT(HPDF_RGBColor) -HPDF_Page_GetRGBStroke (HPDF_Page page); - - -HPDF_EXPORT(HPDF_CMYKColor) -HPDF_Page_GetCMYKFill (HPDF_Page page); - - -HPDF_EXPORT(HPDF_CMYKColor) -HPDF_Page_GetCMYKStroke (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetGrayFill (HPDF_Page page); - - -HPDF_EXPORT(HPDF_REAL) -HPDF_Page_GetGrayStroke (HPDF_Page page); - - -HPDF_EXPORT(HPDF_ColorSpace) -HPDF_Page_GetStrokingColorSpace (HPDF_Page page); - - -HPDF_EXPORT(HPDF_ColorSpace) -HPDF_Page_GetFillingColorSpace (HPDF_Page page); - - -HPDF_EXPORT(HPDF_TransMatrix) -HPDF_Page_GetTextMatrix (HPDF_Page page); - - -HPDF_EXPORT(HPDF_UINT) -HPDF_Page_GetGStateDepth (HPDF_Page page); - - -/*--------------------------------------------------------------------------*/ -/*----- GRAPHICS OPERATORS -------------------------------------------------*/ - - -/*--- General graphics state ---------------------------------------------*/ - -/* w */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetLineWidth (HPDF_Page page, - HPDF_REAL line_width); - -/* J */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetLineCap (HPDF_Page page, - HPDF_LineCap line_cap); - -/* j */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetLineJoin (HPDF_Page page, - HPDF_LineJoin line_join); - -/* M */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetMiterLimit (HPDF_Page page, - HPDF_REAL miter_limit); - -/* d */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetDash (HPDF_Page page, - const HPDF_UINT16 *dash_ptn, - HPDF_UINT num_param, - HPDF_UINT phase); - - - -/* ri --not implemented yet */ - -/* i */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetFlat (HPDF_Page page, - HPDF_REAL flatness); - -/* gs */ - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetExtGState (HPDF_Page page, - HPDF_ExtGState ext_gstate); - - -/*--- Special graphic state operator --------------------------------------*/ - -/* q */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_GSave (HPDF_Page page); - -/* Q */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_GRestore (HPDF_Page page); - -/* cm */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Concat (HPDF_Page page, - HPDF_REAL a, - HPDF_REAL b, - HPDF_REAL c, - HPDF_REAL d, - HPDF_REAL x, - HPDF_REAL y); - -/*--- Path construction operator ------------------------------------------*/ - -/* m */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_MoveTo (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y); - -/* l */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_LineTo (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y); - -/* c */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_CurveTo (HPDF_Page page, - HPDF_REAL x1, - HPDF_REAL y1, - HPDF_REAL x2, - HPDF_REAL y2, - HPDF_REAL x3, - HPDF_REAL y3); - -/* v */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_CurveTo2 (HPDF_Page page, - HPDF_REAL x2, - HPDF_REAL y2, - HPDF_REAL x3, - HPDF_REAL y3); - -/* y */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_CurveTo3 (HPDF_Page page, - HPDF_REAL x1, - HPDF_REAL y1, - HPDF_REAL x3, - HPDF_REAL y3); - -/* h */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ClosePath (HPDF_Page page); - -/* re */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Rectangle (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y, - HPDF_REAL width, - HPDF_REAL height); - - -/*--- Path painting operator ---------------------------------------------*/ - -/* S */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Stroke (HPDF_Page page); - -/* s */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ClosePathStroke (HPDF_Page page); - -/* f */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Fill (HPDF_Page page); - -/* f* */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Eofill (HPDF_Page page); - -/* B */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_FillStroke (HPDF_Page page); - -/* B* */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_EofillStroke (HPDF_Page page); - -/* b */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ClosePathFillStroke (HPDF_Page page); - -/* b* */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ClosePathEofillStroke (HPDF_Page page); - -/* n */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_EndPath (HPDF_Page page); - - -/*--- Clipping paths operator --------------------------------------------*/ - -/* W */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Clip (HPDF_Page page); - -/* W* */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Eoclip (HPDF_Page page); - - -/*--- Text object operator -----------------------------------------------*/ - -/* BT */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_BeginText (HPDF_Page page); - -/* ET */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_EndText (HPDF_Page page); - -/*--- Text state ---------------------------------------------------------*/ - -/* Tc */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetCharSpace (HPDF_Page page, - HPDF_REAL value); - -/* Tw */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetWordSpace (HPDF_Page page, - HPDF_REAL value); - -/* Tz */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetHorizontalScalling (HPDF_Page page, - HPDF_REAL value); - -/* TL */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetTextLeading (HPDF_Page page, - HPDF_REAL value); - -/* Tf */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetFontAndSize (HPDF_Page page, - HPDF_Font font, - HPDF_REAL size); - -/* Tr */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetTextRenderingMode (HPDF_Page page, - HPDF_TextRenderingMode mode); - -/* Ts */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetTextRise (HPDF_Page page, - HPDF_REAL value); - -/* This function is obsolete. Use HPDF_Page_SetTextRise. */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetTextRaise (HPDF_Page page, - HPDF_REAL value); - -/*--- Text positioning ---------------------------------------------------*/ - -/* Td */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_MoveTextPos (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y); - -/* TD */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_MoveTextPos2 (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y); - -/* Tm */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetTextMatrix (HPDF_Page page, - HPDF_REAL a, - HPDF_REAL b, - HPDF_REAL c, - HPDF_REAL d, - HPDF_REAL x, - HPDF_REAL y); - - -/* T* */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_MoveToNextLine (HPDF_Page page); - -/*--- Text showing -------------------------------------------------------*/ - -/* Tj */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ShowText (HPDF_Page page, - const char *text); - -/* TJ */ - -/* ' */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ShowTextNextLine (HPDF_Page page, - const char *text); - -/* " */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ShowTextNextLineEx (HPDF_Page page, - HPDF_REAL word_space, - HPDF_REAL char_space, - const char *text); - - -/*--- Color showing ------------------------------------------------------*/ - -/* cs --not implemented yet */ -/* CS --not implemented yet */ -/* sc --not implemented yet */ -/* scn --not implemented yet */ -/* SC --not implemented yet */ -/* SCN --not implemented yet */ - -/* g */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetGrayFill (HPDF_Page page, - HPDF_REAL gray); - -/* G */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetGrayStroke (HPDF_Page page, - HPDF_REAL gray); - -/* rg */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetRGBFill (HPDF_Page page, - HPDF_REAL r, - HPDF_REAL g, - HPDF_REAL b); - -/* RG */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetRGBStroke (HPDF_Page page, - HPDF_REAL r, - HPDF_REAL g, - HPDF_REAL b); - -/* k */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetCMYKFill (HPDF_Page page, - HPDF_REAL c, - HPDF_REAL m, - HPDF_REAL y, - HPDF_REAL k); - -/* K */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetCMYKStroke (HPDF_Page page, - HPDF_REAL c, - HPDF_REAL m, - HPDF_REAL y, - HPDF_REAL k); - -/*--- Shading patterns ---------------------------------------------------*/ - -/* sh --not implemented yet */ - -/*--- In-line images -----------------------------------------------------*/ - -/* BI --not implemented yet */ -/* ID --not implemented yet */ -/* EI --not implemented yet */ - -/*--- XObjects -----------------------------------------------------------*/ - -/* Do */ -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_ExecuteXObject (HPDF_Page page, - HPDF_XObject obj); - -/*--- Marked content -----------------------------------------------------*/ - -/* BMC --not implemented yet */ -/* BDC --not implemented yet */ -/* EMC --not implemented yet */ -/* MP --not implemented yet */ -/* DP --not implemented yet */ - -/*--- Compatibility ------------------------------------------------------*/ - -/* BX --not implemented yet */ -/* EX --not implemented yet */ - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_DrawImage (HPDF_Page page, - HPDF_Image image, - HPDF_REAL x, - HPDF_REAL y, - HPDF_REAL width, - HPDF_REAL height); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Circle (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y, - HPDF_REAL ray); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Ellipse (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y, - HPDF_REAL xray, - HPDF_REAL yray); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_Arc (HPDF_Page page, - HPDF_REAL x, - HPDF_REAL y, - HPDF_REAL ray, - HPDF_REAL ang1, - HPDF_REAL ang2); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_TextOut (HPDF_Page page, - HPDF_REAL xpos, - HPDF_REAL ypos, - const char *text); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_TextRect (HPDF_Page page, - HPDF_REAL left, - HPDF_REAL top, - HPDF_REAL right, - HPDF_REAL bottom, - const char *text, - HPDF_TextAlignment align, - HPDF_UINT *len); - - -HPDF_EXPORT(HPDF_STATUS) -HPDF_Page_SetSlideShow (HPDF_Page page, - HPDF_TransitionStyle type, - HPDF_REAL disp_time, - HPDF_REAL trans_time); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _HPDF_H */ - diff --git a/harbour/contrib/hbhpdf/make_b32.bat b/harbour/contrib/hbhpdf/make_b32.bat new file mode 100644 index 0000000000..6639b72617 --- /dev/null +++ b/harbour/contrib/hbhpdf/make_b32.bat @@ -0,0 +1,62 @@ +@echo off +rem +rem $Id$ +rem + +if not "%LIBHARU_DIR%" == "" goto DIR_OK + +echo --------------------------------------------------------------- +echo IMPORTANT: You'll need Haru Free PDF Library (libharu) DLL package +echo from www.libharu.org and this envvar to be set to +echo successfully build this library: +echo set LIBHARU_DIR=-IC:\libharu +echo --------------------------------------------------------------- +goto POST_EXIT + +:DIR_OK + +set CFLAGS=-I%LIBHARU_DIR%\include +set HB_DLL_NAME=libhpdf +set HB_DLL_DIR=%LIBHARU_DIR% + +rem --------------------------------------------------------------- + +call ..\mtpl_b32.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 + +rem --------------------------------------------------------------- + +set _HB_INSTALL_PREFIX=%HB_INSTALL_PREFIX% +if "%_HB_INSTALL_PREFIX%" == "" set _HB_INSTALL_PREFIX=..\.. +set _HB_LIB_INSTALL=%HB_LIB_INSTALL% +if "%_HB_LIB_INSTALL%" == "" set _HB_LIB_INSTALL=%_HB_INSTALL_PREFIX%\lib + +if "%1" == "clean" goto POST_CLEAN +if "%1" == "Clean" goto POST_CLEAN +if "%1" == "CLEAN" goto POST_CLEAN +if "%1" == "install" goto POST_INSTALL +if "%1" == "Install" goto POST_INSTALL +if "%1" == "INSTALL" goto POST_INSTALL + +:POST_BUILD + + implib ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %HB_DLL_DIR%\%HB_DLL_NAME%.dll + goto POST_EXIT + +:POST_CLEAN + + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp > nul + if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib > nul + goto POST_EXIT + +:POST_INSTALL + + if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %_HB_LIB_INSTALL% + goto POST_EXIT + +:POST_EXIT + +set CFLAGS= +set HB_DLL_NAME= +set HB_DLL_DIR= \ No newline at end of file diff --git a/harbour/contrib/hbhpdf/make_gcc.sh b/harbour/contrib/hbhpdf/make_gcc.sh new file mode 100644 index 0000000000..15a531ea26 --- /dev/null +++ b/harbour/contrib/hbhpdf/make_gcc.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# +# $Id$ +# + +if [ "${LIBHARU_INC}" == "" ] +then + echo "---------------------------------------------------------------" + echo "IMPORTANT: You will need Haru Free PDF Library (libharu) DLL + echo " package installed and this envvar to be set to" + echo " successfully build this library:" + echo " export LIBHARU_INC=C:/libharu/include" + echo " or" + echo " export LIBHARU_INC=/usr/include/libharu" + echo "---------------------------------------------------------------" + exit 1 +fi + +export CFLAGS= +for I in ${LIBHARU_INC}; do + CFLAGS="${CFLAGS} -I${I}" +done +../mtpl_gcc.sh $1 $2 $3 $4 $5 $6 $7 $8 $9 +unset CFLAGS diff --git a/harbour/contrib/hbhpdf/make_vc.bat b/harbour/contrib/hbhpdf/make_vc.bat new file mode 100644 index 0000000000..9bffd74b68 --- /dev/null +++ b/harbour/contrib/hbhpdf/make_vc.bat @@ -0,0 +1,63 @@ +@echo off +rem +rem $Id$ +rem + +if not "%LIBHARU_DIR%" == "" goto DIR_OK + +echo --------------------------------------------------------------- +echo IMPORTANT: You'll need Haru Free PDF Library (libharu) DLL package +echo from www.libharu.org and this envvar to be set to +echo successfully build this library: +echo set LIBHARU_DIR=-IC:\libharu +echo --------------------------------------------------------------- +goto POST_EXIT + +:DIR_OK + +set CFLAGS=-I%LIBHARU_DIR%\include +set HB_DLL_NAME=libhpdf +set HB_DLL_DIR=%LIBHARU_DIR% + +rem --------------------------------------------------------------- + +call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 + +rem --------------------------------------------------------------- + +set _HB_INSTALL_PREFIX=%HB_INSTALL_PREFIX% +if "%_HB_INSTALL_PREFIX%" == "" set _HB_INSTALL_PREFIX=..\.. +set _HB_LIB_INSTALL=%HB_LIB_INSTALL% +if "%_HB_LIB_INSTALL%" == "" set _HB_LIB_INSTALL=%_HB_INSTALL_PREFIX%\lib + +if "%1" == "clean" goto POST_CLEAN +if "%1" == "Clean" goto POST_CLEAN +if "%1" == "CLEAN" goto POST_CLEAN +if "%1" == "install" goto POST_INSTALL +if "%1" == "Install" goto POST_INSTALL +if "%1" == "INSTALL" goto POST_INSTALL + +:POST_BUILD + + rem Use supplied .lib file. + if not exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy %LIBHARU_DIR%\%HB_DLL_NAME%.lib ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul + goto POST_EXIT + +:POST_CLEAN + + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp > nul + if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib > nul + goto POST_EXIT + +:POST_INSTALL + + if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib + if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %_HB_LIB_INSTALL% + goto POST_EXIT + +:POST_EXIT + +set CFLAGS= +set HB_DLL_NAME= +set HB_DLL_DIR= diff --git a/harbour/contrib/hbhpdf/tests/bld_b32.bat b/harbour/contrib/hbhpdf/tests/bld_b32.bat new file mode 100644 index 0000000000..37cab235c0 --- /dev/null +++ b/harbour/contrib/hbhpdf/tests/bld_b32.bat @@ -0,0 +1,22 @@ +@echo off +rem +rem $Id$ +rem + +rem --------------------------------------------------------------- +rem This is a generic template file, if it doesn't fit your own needs +rem please DON'T MODIFY IT. +rem +rem Instead, make a local copy and modify that one, or make a call to +rem this batch file from your customized one. [vszakats] +rem --------------------------------------------------------------- + +set HB_BIN_INSTALL=..\..\..\bin +set HB_INC_INSTALL=..\..\..\include +set HB_LIB_INSTALL=..\..\..\lib + +set HB_ARCHITECTURE=w32 +set HB_COMPILER=bcc32 +set HB_USER_LIBS=hbhpdf.lib libhpdf.lib hbct.lib + +call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/harbour/contrib/hbhpdf/tests/bld_vc.bat b/harbour/contrib/hbhpdf/tests/bld_vc.bat new file mode 100644 index 0000000000..2dbdef26f5 --- /dev/null +++ b/harbour/contrib/hbhpdf/tests/bld_vc.bat @@ -0,0 +1,22 @@ +@echo off +rem +rem $Id$ +rem + +rem --------------------------------------------------------------- +rem This is a generic template file, if it doesn't fit your own needs +rem please DON'T MODIFY IT. +rem +rem Instead, make a local copy and modify that one, or make a call to +rem this batch file from your customized one. [vszakats] +rem --------------------------------------------------------------- + +set HB_BIN_INSTALL=..\..\..\bin +set HB_INC_INSTALL=..\..\..\include +set HB_LIB_INSTALL=..\..\..\lib + +set HB_ARCHITECTURE=w32 +set HB_COMPILER=msvc +set HB_USER_LIBS=hbhpdf.lib libhpdf.lib hbct.lib + +call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/harbour/contrib/hbhpdf/tests/32_32_2color.dat b/harbour/contrib/hbhpdf/tests/files/32_32_2color.dat similarity index 100% rename from harbour/contrib/hbhpdf/tests/32_32_2color.dat rename to harbour/contrib/hbhpdf/tests/files/32_32_2color.dat diff --git a/harbour/contrib/hbhpdf/tests/32_32_gray.dat b/harbour/contrib/hbhpdf/tests/files/32_32_gray.dat similarity index 100% rename from harbour/contrib/hbhpdf/tests/32_32_gray.dat rename to harbour/contrib/hbhpdf/tests/files/32_32_gray.dat diff --git a/harbour/contrib/hbhpdf/tests/32_32_rgb.dat b/harbour/contrib/hbhpdf/tests/files/32_32_rgb.dat similarity index 100% rename from harbour/contrib/hbhpdf/tests/32_32_rgb.dat rename to harbour/contrib/hbhpdf/tests/files/32_32_rgb.dat diff --git a/harbour/contrib/hbhpdf/tests/a010013l.afm b/harbour/contrib/hbhpdf/tests/files/a010013l.afm similarity index 100% rename from harbour/contrib/hbhpdf/tests/a010013l.afm rename to harbour/contrib/hbhpdf/tests/files/a010013l.afm diff --git a/harbour/contrib/hbhpdf/tests/a010013l.pfb b/harbour/contrib/hbhpdf/tests/files/a010013l.pfb similarity index 100% rename from harbour/contrib/hbhpdf/tests/a010013l.pfb rename to harbour/contrib/hbhpdf/tests/files/a010013l.pfb diff --git a/harbour/contrib/hbhpdf/tests/basn0g01.png b/harbour/contrib/hbhpdf/tests/files/basn0g01.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn0g01.png rename to harbour/contrib/hbhpdf/tests/files/basn0g01.png diff --git a/harbour/contrib/hbhpdf/tests/basn0g02.png b/harbour/contrib/hbhpdf/tests/files/basn0g02.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn0g02.png rename to harbour/contrib/hbhpdf/tests/files/basn0g02.png diff --git a/harbour/contrib/hbhpdf/tests/basn0g04.png b/harbour/contrib/hbhpdf/tests/files/basn0g04.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn0g04.png rename to harbour/contrib/hbhpdf/tests/files/basn0g04.png diff --git a/harbour/contrib/hbhpdf/tests/basn0g08.png b/harbour/contrib/hbhpdf/tests/files/basn0g08.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn0g08.png rename to harbour/contrib/hbhpdf/tests/files/basn0g08.png diff --git a/harbour/contrib/hbhpdf/tests/basn0g16.png b/harbour/contrib/hbhpdf/tests/files/basn0g16.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn0g16.png rename to harbour/contrib/hbhpdf/tests/files/basn0g16.png diff --git a/harbour/contrib/hbhpdf/tests/basn2c08.png b/harbour/contrib/hbhpdf/tests/files/basn2c08.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn2c08.png rename to harbour/contrib/hbhpdf/tests/files/basn2c08.png diff --git a/harbour/contrib/hbhpdf/tests/basn2c16.png b/harbour/contrib/hbhpdf/tests/files/basn2c16.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn2c16.png rename to harbour/contrib/hbhpdf/tests/files/basn2c16.png diff --git a/harbour/contrib/hbhpdf/tests/basn3p01.png b/harbour/contrib/hbhpdf/tests/files/basn3p01.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn3p01.png rename to harbour/contrib/hbhpdf/tests/files/basn3p01.png diff --git a/harbour/contrib/hbhpdf/tests/basn3p02.png b/harbour/contrib/hbhpdf/tests/files/basn3p02.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn3p02.png rename to harbour/contrib/hbhpdf/tests/files/basn3p02.png diff --git a/harbour/contrib/hbhpdf/tests/basn3p04.png b/harbour/contrib/hbhpdf/tests/files/basn3p04.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn3p04.png rename to harbour/contrib/hbhpdf/tests/files/basn3p04.png diff --git a/harbour/contrib/hbhpdf/tests/basn3p08.png b/harbour/contrib/hbhpdf/tests/files/basn3p08.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn3p08.png rename to harbour/contrib/hbhpdf/tests/files/basn3p08.png diff --git a/harbour/contrib/hbhpdf/tests/basn4a08.png b/harbour/contrib/hbhpdf/tests/files/basn4a08.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn4a08.png rename to harbour/contrib/hbhpdf/tests/files/basn4a08.png diff --git a/harbour/contrib/hbhpdf/tests/basn4a16.png b/harbour/contrib/hbhpdf/tests/files/basn4a16.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn4a16.png rename to harbour/contrib/hbhpdf/tests/files/basn4a16.png diff --git a/harbour/contrib/hbhpdf/tests/basn6a08.png b/harbour/contrib/hbhpdf/tests/files/basn6a08.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn6a08.png rename to harbour/contrib/hbhpdf/tests/files/basn6a08.png diff --git a/harbour/contrib/hbhpdf/tests/basn6a16.png b/harbour/contrib/hbhpdf/tests/files/basn6a16.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/basn6a16.png rename to harbour/contrib/hbhpdf/tests/files/basn6a16.png diff --git a/harbour/contrib/hbhpdf/tests/cp932.txt b/harbour/contrib/hbhpdf/tests/files/cp932.txt similarity index 100% rename from harbour/contrib/hbhpdf/tests/cp932.txt rename to harbour/contrib/hbhpdf/tests/files/cp932.txt diff --git a/harbour/contrib/hbhpdf/tests/cp936.txt b/harbour/contrib/hbhpdf/tests/files/cp936.txt similarity index 100% rename from harbour/contrib/hbhpdf/tests/cp936.txt rename to harbour/contrib/hbhpdf/tests/files/cp936.txt diff --git a/harbour/contrib/hbhpdf/tests/elic_jp.txt b/harbour/contrib/hbhpdf/tests/files/elic_jp.txt similarity index 100% rename from harbour/contrib/hbhpdf/tests/elic_jp.txt rename to harbour/contrib/hbhpdf/tests/files/elic_jp.txt diff --git a/harbour/contrib/hbhpdf/tests/euc.txt b/harbour/contrib/hbhpdf/tests/files/euc.txt similarity index 100% rename from harbour/contrib/hbhpdf/tests/euc.txt rename to harbour/contrib/hbhpdf/tests/files/euc.txt diff --git a/harbour/contrib/hbhpdf/tests/gray.jpg b/harbour/contrib/hbhpdf/tests/files/gray.jpg similarity index 100% rename from harbour/contrib/hbhpdf/tests/gray.jpg rename to harbour/contrib/hbhpdf/tests/files/gray.jpg diff --git a/harbour/contrib/hbhpdf/tests/maskimage.png b/harbour/contrib/hbhpdf/tests/files/maskimage.png similarity index 100% rename from harbour/contrib/hbhpdf/tests/maskimage.png rename to harbour/contrib/hbhpdf/tests/files/maskimage.png diff --git a/harbour/contrib/hbhpdf/tests/penguinattack.ttf b/harbour/contrib/hbhpdf/tests/files/penguinattack.ttf similarity index 100% rename from harbour/contrib/hbhpdf/tests/penguinattack.ttf rename to harbour/contrib/hbhpdf/tests/files/penguinattack.ttf diff --git a/harbour/contrib/hbhpdf/tests/rgb.jpg b/harbour/contrib/hbhpdf/tests/files/rgb.jpg similarity index 100% rename from harbour/contrib/hbhpdf/tests/rgb.jpg rename to harbour/contrib/hbhpdf/tests/files/rgb.jpg diff --git a/harbour/contrib/hbhpdf/tests/sjis.txt b/harbour/contrib/hbhpdf/tests/files/sjis.txt similarity index 100% rename from harbour/contrib/hbhpdf/tests/sjis.txt rename to harbour/contrib/hbhpdf/tests/files/sjis.txt diff --git a/harbour/contrib/hbhpdf/tests/harupdf.prg b/harbour/contrib/hbhpdf/tests/harupdf.prg index f36c156e0f..82e1b4db9f 100644 --- a/harbour/contrib/hbhpdf/tests/harupdf.prg +++ b/harbour/contrib/hbhpdf/tests/harupdf.prg @@ -1,6 +1,7 @@ /* * $Id$ */ + /* * Copyright 2008 Pritpal Bedi * @@ -45,6 +46,7 @@ * If you do not wish that, delete this exception notice. * */ + //----------------------------------------------------------------------// //----------------------------------------------------------------------// //----------------------------------------------------------------------// @@ -66,7 +68,7 @@ Function Main( cFileToSave ) if empty( cFileToSave ) - cFileToSave := CurDrive()+'\myharu.pdf' + cFileToSave := 'myharu.pdf' endif if DesignHaruPDF( cFileToSave ) @@ -968,7 +970,7 @@ static function show_description( page, x, y, text ) Static function Page_CodePages( pdf ) Local page, outline, font2, font_name, root, i, font, dst, fname - Local cResPath := "c:\harbour\contrib\hbhpdf\tests\" + Local cResPath := "files\" Local cAfm := cResPath+"a010013l.afm" Local cPfb := cResPath+"a010013l.pfb" Local encodings := { ; @@ -1062,7 +1064,7 @@ static function draw_graph( page ) if (i > 0 .and. i <= 16) HPDF_Page_BeginText(page) HPDF_Page_MoveTextPos(page, x + 5, PAGE_HEIGHT - 75) - buf := NumToHex( i-1 ) + buf := hb_NumToHex( i-1 ) HPDF_Page_ShowText(page, buf) HPDF_Page_EndText(page) endif @@ -1079,7 +1081,7 @@ static function draw_graph( page ) if (i < 14) HPDF_Page_BeginText(page) HPDF_Page_MoveTextPos(page, 45, y + 5) - buf := NumToHex( 15-i ) + buf := hb_NumToHex( 15-i ) HPDF_Page_ShowText(page, buf) HPDF_Page_EndText(page) endif @@ -1279,7 +1281,7 @@ Static Function Page_Annotation( pdf ) Static function Page_Images( pdf ) Local font, page, dst, image, image1, image2, image3 Local x, y, angle, angle1, angle2, rad, rad1, rad2, iw, ih - Local cImagePath := "c:\harbour\contrib\hbhpdf\tests\" + Local cImagePath := "files\" /* create default-font */ font := HPDF_GetFont(pdf, "Helvetica", NULL) diff --git a/harbour/contrib/make_b32_all.bat b/harbour/contrib/make_b32_all.bat index facc131475..4b69a14fcb 100644 --- a/harbour/contrib/make_b32_all.bat +++ b/harbour/contrib/make_b32_all.bat @@ -54,6 +54,7 @@ if not "%MYSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbmysql if not "%PGSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbpgsql if not "%ADS_DIR%" == "" set _HB_DIRS=%_HB_DIRS% rddads if not "%ZLIB_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbzlib +if not "%LIBHARU_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbhpdf for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 rem ******************************************************* diff --git a/harbour/contrib/make_gcc_all.sh b/harbour/contrib/make_gcc_all.sh index 6784d32b30..5449b18e81 100755 --- a/harbour/contrib/make_gcc_all.sh +++ b/harbour/contrib/make_gcc_all.sh @@ -56,6 +56,7 @@ if [ "${MYSQL_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbmysql "; fi; if [ "${PGSQL_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbpgsql "; fi; if [ "${ZLIB_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbzlib "; fi; if [ "${ADS_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} rddads "; fi; +if [ "${LIBHARU_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbhpdf "; fi; _HB_DIRS="${_HB_DIRS} ${_HB_DIRS_ADD}" diff --git a/harbour/contrib/make_vc_all.bat b/harbour/contrib/make_vc_all.bat index 796c80856b..5d07ebb597 100644 --- a/harbour/contrib/make_vc_all.bat +++ b/harbour/contrib/make_vc_all.bat @@ -54,6 +54,7 @@ if not "%MYSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbmysql if not "%PGSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbpgsql if not "%ADS_DIR%" == "" set _HB_DIRS=%_HB_DIRS% rddads if not "%ZLIB_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbzlib +if not "%LIBHARU_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbhpdf for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 rem *******************************************************