2008-06-22 10:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* common.mak
+ utils/hbpp/hbpragma.c
- utils/hbpp/pragma.c
* utils/hbpp/Makefile
! Renamed one file to not collide with contrib.
[1.0.0RC1 ONLY]
(this was solved in a different way in main branch)
* contrib/hbwhat32/Makefile
! Fixed to compile using GNU make system. This
contrib needs xhb header in order to compile.
(solved with an ugly hack)
[1.0.0RC1]
* contrib/hbfimage/Makefile
! Fixed to compile with MinGW.
[1.0.0RC1]
* doc/whatsnew.txt
+ Some updates.
[1.0.0RC1]
* contrib/hbwhat32/commctrl.ch
* contrib/hbwhat32/commdlg.ch
* contrib/hbwhat32/wingdi.ch
* contrib/hbwhat32/wininet.ch
! Pulled from MinGW distribution.
; TODO: Refinement for UNICODE version which I realized a little later.
[1.0.0RC1]
* source/pp/hbppgen.c
! Fixed to escape strings in generated hbverbld.h.
[1.0.0RC1]
* contrib/hbw32ddr/Makefile
! Fixed to compile with GNU make.
! Found a way to compile with MingW.
[1.0.0RC1]
* contrib/hbtpathy/Makefile
! Fixed to work at all.
[1.0.0RC1]
- contrib/hbw32ddr/w32_ddrw.h
* contrib/hbw32ddr/w32_ddrw.cpp
* Cleanups, removing unneeded fluffs.
[1.0.0RC1]
* contrib/hbziparch/hbcomprs.c
* contrib/hbziparch/zip.c
* contrib/hbziparch/ziparchive.cpp
* contrib/hbziparch/include/zip.h
* contrib/hbziparch/include/ziparchive.h
* contrib/hbziparch/include/unzip.h
* contrib/hbziparch/include/zipinternalinfo.h
- contrib/hbziparch/include/hbcomprs.h
- contrib/hbziparch/include/zutil.h
- contrib/hbziparch/include/zconf.h
! Stripped an old version (1.1.4) of ZLIB embedded in this
contrib. Some warnings and even more security problems
fixed this way. Users of this lib should link hbzlib.lib
from now on.
! Fixed some warnings after recent update.
NOTE: One is still there (unused ..HBZIPCLEANUP function).
; NOTE: The quality of this code is not up to Harbour
standard. It compiles with a large amount of warnings
on all (BCC, MSVC, GCC) compilers. Also the included
ziparch source is dated.
Anybody volunteering to clear these up?
; NOTE: Please test these changes, I'm not a user of this
contrib.
[1.0.0RC1]
This commit is contained in:
@@ -8,6 +8,80 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-06-22 10:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* common.mak
|
||||
+ utils/hbpp/hbpragma.c
|
||||
- utils/hbpp/pragma.c
|
||||
* utils/hbpp/Makefile
|
||||
! Renamed one file to not collide with contrib.
|
||||
[1.0.0RC1 ONLY]
|
||||
(this was solved in a different way in main branch)
|
||||
|
||||
* contrib/hbwhat32/Makefile
|
||||
! Fixed to compile using GNU make system. This
|
||||
contrib needs xhb header in order to compile.
|
||||
(solved with an ugly hack)
|
||||
[1.0.0RC1]
|
||||
|
||||
* contrib/hbfimage/Makefile
|
||||
! Fixed to compile with MinGW.
|
||||
[1.0.0RC1]
|
||||
|
||||
* doc/whatsnew.txt
|
||||
+ Some updates.
|
||||
[1.0.0RC1]
|
||||
|
||||
* contrib/hbwhat32/commctrl.ch
|
||||
* contrib/hbwhat32/commdlg.ch
|
||||
* contrib/hbwhat32/wingdi.ch
|
||||
* contrib/hbwhat32/wininet.ch
|
||||
! Pulled from MinGW distribution.
|
||||
; TODO: Refinement for UNICODE version which I realized a little later.
|
||||
[1.0.0RC1]
|
||||
|
||||
* source/pp/hbppgen.c
|
||||
! Fixed to escape strings in generated hbverbld.h.
|
||||
[1.0.0RC1]
|
||||
|
||||
* contrib/hbw32ddr/Makefile
|
||||
! Fixed to compile with GNU make.
|
||||
! Found a way to compile with MingW.
|
||||
[1.0.0RC1]
|
||||
|
||||
* contrib/hbtpathy/Makefile
|
||||
! Fixed to work at all.
|
||||
[1.0.0RC1]
|
||||
|
||||
- contrib/hbw32ddr/w32_ddrw.h
|
||||
* contrib/hbw32ddr/w32_ddrw.cpp
|
||||
* Cleanups, removing unneeded fluffs.
|
||||
[1.0.0RC1]
|
||||
|
||||
* contrib/hbziparch/hbcomprs.c
|
||||
* contrib/hbziparch/zip.c
|
||||
* contrib/hbziparch/ziparchive.cpp
|
||||
* contrib/hbziparch/include/zip.h
|
||||
* contrib/hbziparch/include/ziparchive.h
|
||||
* contrib/hbziparch/include/unzip.h
|
||||
* contrib/hbziparch/include/zipinternalinfo.h
|
||||
- contrib/hbziparch/include/hbcomprs.h
|
||||
- contrib/hbziparch/include/zutil.h
|
||||
- contrib/hbziparch/include/zconf.h
|
||||
! Stripped an old version (1.1.4) of ZLIB embedded in this
|
||||
contrib. Some warnings and even more security problems
|
||||
fixed this way. Users of this lib should link hbzlib.lib
|
||||
from now on.
|
||||
! Fixed some warnings after recent update.
|
||||
NOTE: One is still there (unused ..HBZIPCLEANUP function).
|
||||
; NOTE: The quality of this code is not up to Harbour
|
||||
standard. It compiles with a large amount of warnings
|
||||
on all (BCC, MSVC, GCC) compilers. Also the included
|
||||
ziparch source is dated.
|
||||
Anybody volunteering to clear these up?
|
||||
; NOTE: Please test these changes, I'm not a user of this
|
||||
contrib.
|
||||
[1.0.0RC1]
|
||||
|
||||
2008-06-21 12:29 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* xhb/Makefile
|
||||
* xhb/common.mak
|
||||
|
||||
@@ -1044,7 +1044,7 @@ HBPP_EXE_OBJS = \
|
||||
$(OBJ_DIR)\hbpptbl$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbppcomp$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbppcore$(OBJEXT) \
|
||||
$(OBJ_DIR)\pragma$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbpragma$(OBJEXT) \
|
||||
|
||||
# $(OBJ_DIR)\hbpplib$(OBJEXT) \
|
||||
|
||||
|
||||
@@ -16,3 +16,5 @@ PRG_HEADERS=\
|
||||
LIBNAME=hbfimage
|
||||
|
||||
include $(TOP)$(ROOT)config/lib.cf
|
||||
|
||||
CFLAGS := $(CFLAGS) -D_WINDOWS_
|
||||
|
||||
@@ -9,15 +9,22 @@ ifneq ($(HB_ARCHITECTURE),dos)
|
||||
ifeq ($(HB_ARCHITECTURE),linux)
|
||||
C_SOURCES=\
|
||||
tplinux.c \
|
||||
else ($(HB_ARCHITECTURE),win32)
|
||||
tpcommon.c \
|
||||
|
||||
endif
|
||||
ifeq ($(HB_ARCHITECTURE),win32)
|
||||
C_SOURCES=\
|
||||
tpwin32.c \
|
||||
else
|
||||
tpcommon.c \
|
||||
|
||||
endif
|
||||
ifeq ($(HB_ARCHITECTURE),os2)
|
||||
C_SOURCES=\
|
||||
tpos2.c \
|
||||
endif
|
||||
tpcommon.c \
|
||||
|
||||
endif
|
||||
|
||||
PRG_SOURCES=\
|
||||
telepath.prg \
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# Needs Windows official ddraw.h to be copied to this directory,
|
||||
# in order to compile under MingW. [vszakats]
|
||||
|
||||
ifeq ($(HB_ARCHITECTURE),w32)
|
||||
|
||||
ROOT = ../../
|
||||
|
||||
C_SOURCES=\
|
||||
CPP_SOURCES=\
|
||||
w32_ddrw.cpp \
|
||||
|
||||
PRG_SOURCES=\
|
||||
@@ -12,3 +17,7 @@ PRG_SOURCES=\
|
||||
LIBNAME=hbw32ddr
|
||||
|
||||
include $(TOP)$(ROOT)config/lib.cf
|
||||
|
||||
CFLAGS := $(CFLAGS) -I.
|
||||
|
||||
endif
|
||||
|
||||
@@ -27,11 +27,14 @@
|
||||
|
||||
#define INITGUID
|
||||
|
||||
#include "w32_ddrw.h"
|
||||
#define HB_OS_WIN_32_USED
|
||||
|
||||
HB_EXTERN_BEGIN
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
|
||||
BOOL hb_dd_g_handling_events = FALSE; // painting?
|
||||
/* DDraw initialize */
|
||||
|
||||
#include "ddraw.h"
|
||||
|
||||
#define HB_DD_TIMER_ID 1
|
||||
#define HB_DD_TIMER_RATE 100
|
||||
@@ -39,11 +42,11 @@ BOOL hb_dd_g_handling_events = FALSE; // painting?
|
||||
// DDRAW MANAGEMENT
|
||||
// Global Data
|
||||
|
||||
LPDIRECTDRAW4 hb_dd_g_pDD = NULL; // DirectDraw object
|
||||
HWND hb_dd_g_DDHwnd; // Our hWnd
|
||||
|
||||
long hb_dd_g_xWindow = 0;
|
||||
long hb_dd_g_yWindow = 0;
|
||||
BOOL hb_dd_g_handling_events = FALSE; // painting?
|
||||
LPDIRECTDRAW4 hb_dd_g_pDD = NULL; // DirectDraw object
|
||||
HWND hb_dd_g_DDHwnd; // Our hWnd
|
||||
long hb_dd_g_xWindow = 0;
|
||||
long hb_dd_g_yWindow = 0;
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// Management Structs for surfaces...
|
||||
@@ -52,7 +55,7 @@ long hb_dd_g_yWindow = 0;
|
||||
|
||||
LPDIRECTDRAWSURFACE4 hb_dd_g_DDSFaces[ MAX_DDSURFACES + 1 ];
|
||||
|
||||
long hb_dd_g_DDSFaceCount=0;
|
||||
long hb_dd_g_DDSFaceCount = 0;
|
||||
|
||||
//------------------------------------------------------------------------------//
|
||||
// Sprites Management
|
||||
@@ -100,203 +103,36 @@ long hb_dd_g_SpritesCount = 0;
|
||||
|
||||
short int hb_dd_g_KeyDown[ 256 ];
|
||||
|
||||
HB_FUNC( DD_ISKEYPRESSED )
|
||||
{
|
||||
if( hb_dd_g_KeyDown[ hb_parnl( 1 ) ] )
|
||||
hb_retl( 1 );
|
||||
else
|
||||
hb_retl( 0 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPGETXY )
|
||||
long hb_dd_checkError( HRESULT hr )
|
||||
{
|
||||
// This function is Broken ( hb_stornl fail );
|
||||
long p = 0;
|
||||
|
||||
long n = hb_parnl( 1 );
|
||||
|
||||
hb_reta( 2 );
|
||||
|
||||
hb_stornl( hb_dd_Sprites[ n ].x, -1, 0 );
|
||||
hb_stornl( hb_dd_Sprites[ n ].y, -1, 1 );
|
||||
}
|
||||
|
||||
HB_FUNC( DD_SPGETX )
|
||||
{
|
||||
hb_retnl( hb_dd_Sprites[ hb_parnl( 1 ) ].x );
|
||||
}
|
||||
|
||||
HB_FUNC( DD_SPGETY )
|
||||
{
|
||||
hb_retnl( hb_dd_Sprites[ hb_parnl( 1 ) ].y );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPGETVISIBLE )
|
||||
{
|
||||
hb_retl( hb_dd_Sprites[ hb_parnl( 1 ) ].Visible );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETVISIBLE )
|
||||
{
|
||||
hb_dd_Sprites[ hb_parnl( 1 ) ].Visible = ( int ) hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONRENDER )
|
||||
{
|
||||
hb_dd_Sprites[ hb_parnl( 1 ) ].OnRender = hb_strdup( hb_parc(1) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPCLEARDIRECTION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].xIncrement = 0;
|
||||
hb_dd_Sprites[ n ].yIncrement = 0;
|
||||
hb_dd_Sprites[ n ].Direction = -1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETSOLID )
|
||||
{
|
||||
hb_dd_Sprites[hb_parnl( 1 ) ].Solid = hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETMASKED )
|
||||
{
|
||||
hb_dd_Sprites[hb_parnl( 1 ) ].Masked = hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETDIRECTION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
|
||||
hb_dd_Sprites[ n ].Direction = hb_parnl( 2 );
|
||||
hb_dd_Sprites[ n ].xIncrement += hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].yIncrement += hb_parnl( 4 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONFIRSTFRAME )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnFirstFrame = hb_strdup( hb_parc(2) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONOUTSCREEN )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnOutScreen = hb_strdup( hb_parc(2) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONCOLLISION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnCollision = hb_strdup( hb_parc(2) );
|
||||
hb_dd_Sprites[ n ].lCollision = 1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATESPRITE )
|
||||
{
|
||||
long n = hb_dd_g_SpritesCount;
|
||||
|
||||
ZeroMemory( &hb_dd_Sprites[ n ], sizeof( struct st_Sprites ) );
|
||||
|
||||
hb_dd_Sprites[ n ].Surface = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].cName = hb_strdup( hb_parc( 2 ) );
|
||||
hb_dd_Sprites[ n ].Width = hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].Height = hb_parnl( 4 );
|
||||
hb_dd_Sprites[ n ].Images = hb_parnl( 5 );
|
||||
hb_dd_Sprites[ n ].zOrder = hb_parnl( 6 );
|
||||
hb_dd_Sprites[ n ].Visible = hb_parl( 7 );
|
||||
hb_dd_Sprites[ n ].FrameSpeed = hb_parnl( 8 );
|
||||
|
||||
hb_dd_g_SpritesCount++;
|
||||
|
||||
hb_retnl( n );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETXY )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
long x = hb_parnl( 2 );
|
||||
long y = hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].x = x;
|
||||
hb_dd_Sprites[ n ].y = y;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETINVERTED )
|
||||
{
|
||||
LPDIRECTDRAWSURFACE4 pdds;
|
||||
long n = hb_parnl( 1 );
|
||||
RECT rt;
|
||||
DDBLTFX todo;
|
||||
|
||||
long dir = hb_parnl( 2 );
|
||||
if( dir != hb_dd_Sprites[ n ].DrawInverted )
|
||||
switch( hr )
|
||||
{
|
||||
rt.top = 0;
|
||||
rt.left = 0;
|
||||
rt.bottom= hb_dd_Sprites[ n ].Height;
|
||||
rt.right = hb_dd_Sprites[ n ].Width * hb_dd_Sprites[ n ].Images;
|
||||
ZeroMemory( &todo, sizeof( DDBLTFX ) );
|
||||
|
||||
hb_dd_Sprites[ n ].DrawInverted = dir;
|
||||
todo.dwSize = sizeof( DDBLTFX );
|
||||
todo.dwDDFX = DDBLTFX_MIRRORLEFTRIGHT;
|
||||
pdds = hb_dd_g_DDSFaces[ hb_dd_Sprites[ n ].Surface ];
|
||||
pdds->Blt(&rt, pdds, &rt, DDBLT_DDFX ,&todo );
|
||||
case DDERR_EXCEPTION : p++;break;
|
||||
case DDERR_GENERIC : p++;break;
|
||||
case DDERR_INVALIDOBJECT : p++;break;
|
||||
case DDERR_INVALIDPARAMS : p++;break;
|
||||
case DDERR_INVALIDRECT : p++;break;
|
||||
case DDERR_NOBLTHW : p++;break;
|
||||
case DDERR_SURFACEBUSY : p++;break;
|
||||
case DDERR_SURFACELOST : p++;break;
|
||||
case DDERR_UNSUPPORTED : p++;break;
|
||||
case DDERR_WASSTILLDRAWING : p++;break;
|
||||
case DDERR_NOOVERLAYHW : p++;break;
|
||||
case DDERR_NOTAOVERLAYSURFACE : p++;break;
|
||||
case DDERR_INVALIDSURFACETYPE : p++;break;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_MSGBOX )
|
||||
void hb_dd_g_Error( char *, long , char *)
|
||||
{
|
||||
char *m1;
|
||||
char *m2;
|
||||
char deftitle [100] = "";
|
||||
char defmsg [2] = "";
|
||||
|
||||
if( hb_pcount() > 0 )
|
||||
m1 = hb_parc( 1 );
|
||||
else
|
||||
m1 = defmsg;
|
||||
|
||||
if( hb_pcount() > 1 )
|
||||
m2 = hb_parc( 2 );
|
||||
else
|
||||
m2 = deftitle;
|
||||
|
||||
MessageBox( hb_dd_g_DDHwnd, m1, m2, NULL);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
void hb_dd_WinError( void )
|
||||
{
|
||||
LPVOID lpMsgBuf;FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
@@ -312,6 +148,32 @@ void hb_dd_WinError( void )
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
void hb_dd_ReleaseAllObjects(void)
|
||||
{
|
||||
long t;
|
||||
if( hb_dd_g_pDD != NULL )
|
||||
{
|
||||
if( hb_dd_g_DDSFaces[ 0 ] != NULL )
|
||||
{
|
||||
hb_dd_g_DDSFaces[ 0 ]->Release();
|
||||
hb_dd_g_DDSFaces[ 0 ] = NULL;
|
||||
}
|
||||
|
||||
for( t = 2; t < MAX_DDSURFACES; t++ )
|
||||
{
|
||||
if( hb_dd_g_DDSFaces[ t ] != NULL )
|
||||
{
|
||||
hb_dd_g_DDSFaces[ t ]->Release();
|
||||
hb_dd_g_DDSFaces[ t ] = NULL;
|
||||
}
|
||||
}
|
||||
hb_dd_g_pDD->Release();
|
||||
hb_dd_g_pDD = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
DWORD hb_dd_DDColorMatch(IDirectDrawSurface4 * pdds, COLORREF rgb)
|
||||
{
|
||||
COLORREF rgbT;
|
||||
@@ -574,43 +436,6 @@ long _stdcall hb_dd_DDWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATEWINDOW )
|
||||
{
|
||||
HWND m_hWnd;
|
||||
HINSTANCE m_hInstance = GetModuleHandle(NULL);
|
||||
long x,y;
|
||||
|
||||
x= hb_pcount() > 10 ?hb_parnl( 1 ) : GetSystemMetrics(SM_CXSCREEN);
|
||||
y= hb_pcount() > 11 ?hb_parnl( 2 ) : GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
hb_dd_g_xWindow = x;
|
||||
hb_dd_g_yWindow = y;
|
||||
|
||||
|
||||
WNDCLASS wndClass = { CS_HREDRAW | CS_VREDRAW, hb_dd_DDWndProc, 0, 0, m_hInstance,
|
||||
NULL,
|
||||
LoadCursor(NULL, IDC_ARROW),
|
||||
(HBRUSH)GetStockObject(BLACK_BRUSH),
|
||||
NULL,
|
||||
TEXT("4dNow") };
|
||||
|
||||
RegisterClass( &wndClass );
|
||||
|
||||
m_hWnd = CreateWindow( TEXT("4dNow"), TEXT("4dNow"),
|
||||
WS_POPUP, 0,
|
||||
0, x,y, NULL, NULL, m_hInstance, 0L );
|
||||
|
||||
if( !m_hWnd )
|
||||
hb_dd_WinError();
|
||||
|
||||
ShowWindow( m_hWnd,SW_SHOWMAXIMIZED );
|
||||
|
||||
hb_dd_DDrawStartup( m_hWnd );
|
||||
hb_retnl( ( long ) m_hWnd );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
int hb_dd_InitFail( HWND hWnd, HRESULT hRet, LPCTSTR szError, ... )
|
||||
{
|
||||
char szBuff[ 128 ];
|
||||
@@ -626,63 +451,6 @@ int hb_dd_InitFail( HWND hWnd, HRESULT hRet, LPCTSTR szError, ... )
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_LOADBMPINTOSURFACE )
|
||||
{
|
||||
long nSurface = hb_parnl( 1 );
|
||||
char * cBitmap = hb_parc ( 2 );
|
||||
long x = hb_parnl( 3 );
|
||||
long y = hb_parnl( 4 );
|
||||
long dx = hb_parnl( 5 );
|
||||
long dy = hb_parnl( 6 );
|
||||
|
||||
HBITMAP hbm;
|
||||
|
||||
// Load our bitmap resource.
|
||||
|
||||
hbm = (HBITMAP) LoadImage(GetModuleHandle(NULL), cBitmap, IMAGE_BITMAP, 0,
|
||||
0, LR_CREATEDIBSECTION | LR_LOADFROMFILE);
|
||||
|
||||
if( hbm == NULL )
|
||||
hb_dd_g_Error( "Can't load Bitmap.",100,cBitmap );
|
||||
|
||||
if( hb_dd_g_DDSFaces[ nSurface ] == NULL )
|
||||
hb_dd_g_Error( "Invalid Surface",nSurface,"LoadBmpIntoSurface");
|
||||
|
||||
if( DD_OK != hb_dd_DDCopyBitmap( hb_dd_g_DDSFaces[ nSurface ], hbm, x,y, dx, dy ) )
|
||||
hb_dd_g_Error( "DDCopyBitmap",nSurface,"LoadBmpIntoSurface");
|
||||
|
||||
DeleteObject( hbm );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATEOFFSCREENBITMAP )
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
HRESULT hRet;
|
||||
|
||||
if( ! hb_dd_g_pDD )
|
||||
hb_dd_g_Error("No DDraw Initialized",1000,"");
|
||||
|
||||
if( hb_dd_g_DDSFaceCount >= MAX_DDSURFACES )
|
||||
hb_dd_g_Error( "No more DDSurfaces -> Limit reached -> CreateDDSurface()",1000,"DDraw extend sys");
|
||||
else
|
||||
{
|
||||
ZeroMemory(&ddsd, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH ;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||
ddsd.dwHeight = hb_dd_g_yWindow;
|
||||
ddsd.dwWidth = hb_dd_g_xWindow;
|
||||
hRet = hb_dd_g_pDD->CreateSurface(&ddsd, &hb_dd_g_DDSFaces[ hb_dd_g_DDSFaceCount ], NULL);
|
||||
if( hRet != DD_OK )
|
||||
hb_dd_InitFail( hb_dd_g_DDHwnd, hRet, "CreateSurface FAILED" );
|
||||
}
|
||||
|
||||
hb_retnl( hb_dd_g_DDSFaceCount );
|
||||
hb_dd_g_DDSFaceCount++;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
void hb_RestoreAll(void)
|
||||
@@ -701,32 +469,6 @@ void hb_RestoreAll(void)
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
void hb_dd_ReleaseAllObjects(void)
|
||||
{
|
||||
long t;
|
||||
if( hb_dd_g_pDD != NULL )
|
||||
{
|
||||
if( hb_dd_g_DDSFaces[ 0 ] != NULL )
|
||||
{
|
||||
hb_dd_g_DDSFaces[ 0 ]->Release();
|
||||
hb_dd_g_DDSFaces[ 0 ] = NULL;
|
||||
}
|
||||
|
||||
for( t = 2; t < MAX_DDSURFACES; t++ )
|
||||
{
|
||||
if( hb_dd_g_DDSFaces[ t ] != NULL )
|
||||
{
|
||||
hb_dd_g_DDSFaces[ t ]->Release();
|
||||
hb_dd_g_DDSFaces[ t ] = NULL;
|
||||
}
|
||||
}
|
||||
hb_dd_g_pDD->Release();
|
||||
hb_dd_g_pDD = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
@@ -789,25 +531,6 @@ void hb_dd_DDrawStartup( HWND hWnd )
|
||||
hb_dd_g_DDSFaceCount = 2;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_STARTWINDOW )
|
||||
{
|
||||
MSG msg;
|
||||
BOOL loop = TRUE;
|
||||
|
||||
while( loop )
|
||||
{
|
||||
if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
if( WM_CLOSE == msg.message )
|
||||
loop = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
HRESULT hb_dd_DDCopyBitmap(IDirectDrawSurface4 * pdds, HBITMAP hbm, int x, int y,
|
||||
int dx, int dy)
|
||||
@@ -847,32 +570,313 @@ HRESULT hb_dd_DDCopyBitmap(IDirectDrawSurface4 * pdds, HBITMAP hbm, int x, int y
|
||||
return hr;
|
||||
}
|
||||
|
||||
long hb_dd_checkError( HRESULT hr )
|
||||
{
|
||||
long p = 0;
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
switch( hr )
|
||||
HB_FUNC( DD_ISKEYPRESSED )
|
||||
{
|
||||
if( hb_dd_g_KeyDown[ hb_parnl( 1 ) ] )
|
||||
hb_retl( 1 );
|
||||
else
|
||||
hb_retl( 0 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPGETXY )
|
||||
{
|
||||
// This function is Broken ( hb_stornl fail );
|
||||
|
||||
long n = hb_parnl( 1 );
|
||||
|
||||
hb_reta( 2 );
|
||||
|
||||
hb_stornl( hb_dd_Sprites[ n ].x, -1, 0 );
|
||||
hb_stornl( hb_dd_Sprites[ n ].y, -1, 1 );
|
||||
}
|
||||
|
||||
HB_FUNC( DD_SPGETX )
|
||||
{
|
||||
hb_retnl( hb_dd_Sprites[ hb_parnl( 1 ) ].x );
|
||||
}
|
||||
|
||||
HB_FUNC( DD_SPGETY )
|
||||
{
|
||||
hb_retnl( hb_dd_Sprites[ hb_parnl( 1 ) ].y );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPGETVISIBLE )
|
||||
{
|
||||
hb_retl( hb_dd_Sprites[ hb_parnl( 1 ) ].Visible );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETVISIBLE )
|
||||
{
|
||||
hb_dd_Sprites[ hb_parnl( 1 ) ].Visible = ( int ) hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONRENDER )
|
||||
{
|
||||
hb_dd_Sprites[ hb_parnl( 1 ) ].OnRender = hb_strdup( hb_parc(1) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPCLEARDIRECTION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].xIncrement = 0;
|
||||
hb_dd_Sprites[ n ].yIncrement = 0;
|
||||
hb_dd_Sprites[ n ].Direction = -1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETSOLID )
|
||||
{
|
||||
hb_dd_Sprites[hb_parnl( 1 ) ].Solid = hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETMASKED )
|
||||
{
|
||||
hb_dd_Sprites[hb_parnl( 1 ) ].Masked = hb_parl( 2 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETDIRECTION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
|
||||
hb_dd_Sprites[ n ].Direction = hb_parnl( 2 );
|
||||
hb_dd_Sprites[ n ].xIncrement += hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].yIncrement += hb_parnl( 4 );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONFIRSTFRAME )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnFirstFrame = hb_strdup( hb_parc(2) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONOUTSCREEN )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnOutScreen = hb_strdup( hb_parc(2) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPONCOLLISION )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].OnCollision = hb_strdup( hb_parc(2) );
|
||||
hb_dd_Sprites[ n ].lCollision = 1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATESPRITE )
|
||||
{
|
||||
long n = hb_dd_g_SpritesCount;
|
||||
|
||||
ZeroMemory( &hb_dd_Sprites[ n ], sizeof( struct st_Sprites ) );
|
||||
|
||||
hb_dd_Sprites[ n ].Surface = hb_parnl( 1 );
|
||||
hb_dd_Sprites[ n ].cName = hb_strdup( hb_parc( 2 ) );
|
||||
hb_dd_Sprites[ n ].Width = hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].Height = hb_parnl( 4 );
|
||||
hb_dd_Sprites[ n ].Images = hb_parnl( 5 );
|
||||
hb_dd_Sprites[ n ].zOrder = hb_parnl( 6 );
|
||||
hb_dd_Sprites[ n ].Visible = hb_parl( 7 );
|
||||
hb_dd_Sprites[ n ].FrameSpeed = hb_parnl( 8 );
|
||||
|
||||
hb_dd_g_SpritesCount++;
|
||||
|
||||
hb_retnl( n );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETXY )
|
||||
{
|
||||
long n = hb_parnl( 1 );
|
||||
long x = hb_parnl( 2 );
|
||||
long y = hb_parnl( 3 );
|
||||
hb_dd_Sprites[ n ].x = x;
|
||||
hb_dd_Sprites[ n ].y = y;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_SPSETINVERTED )
|
||||
{
|
||||
LPDIRECTDRAWSURFACE4 pdds;
|
||||
long n = hb_parnl( 1 );
|
||||
RECT rt;
|
||||
DDBLTFX todo;
|
||||
|
||||
long dir = hb_parnl( 2 );
|
||||
if( dir != hb_dd_Sprites[ n ].DrawInverted )
|
||||
{
|
||||
case DDERR_EXCEPTION : p++;break;
|
||||
case DDERR_GENERIC : p++;break;
|
||||
case DDERR_INVALIDOBJECT : p++;break;
|
||||
case DDERR_INVALIDPARAMS : p++;break;
|
||||
case DDERR_INVALIDRECT : p++;break;
|
||||
case DDERR_NOBLTHW : p++;break;
|
||||
case DDERR_SURFACEBUSY : p++;break;
|
||||
case DDERR_SURFACELOST : p++;break;
|
||||
case DDERR_UNSUPPORTED : p++;break;
|
||||
case DDERR_WASSTILLDRAWING : p++;break;
|
||||
case DDERR_NOOVERLAYHW : p++;break;
|
||||
case DDERR_NOTAOVERLAYSURFACE : p++;break;
|
||||
case DDERR_INVALIDSURFACETYPE : p++;break;
|
||||
rt.top = 0;
|
||||
rt.left = 0;
|
||||
rt.bottom= hb_dd_Sprites[ n ].Height;
|
||||
rt.right = hb_dd_Sprites[ n ].Width * hb_dd_Sprites[ n ].Images;
|
||||
ZeroMemory( &todo, sizeof( DDBLTFX ) );
|
||||
|
||||
hb_dd_Sprites[ n ].DrawInverted = dir;
|
||||
todo.dwSize = sizeof( DDBLTFX );
|
||||
todo.dwDDFX = DDBLTFX_MIRRORLEFTRIGHT;
|
||||
pdds = hb_dd_g_DDSFaces[ hb_dd_Sprites[ n ].Surface ];
|
||||
pdds->Blt(&rt, pdds, &rt, DDBLT_DDFX ,&todo );
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_MSGBOX )
|
||||
{
|
||||
char *m1;
|
||||
char *m2;
|
||||
char deftitle [100] = "";
|
||||
char defmsg [2] = "";
|
||||
|
||||
if( hb_pcount() > 0 )
|
||||
m1 = hb_parc( 1 );
|
||||
else
|
||||
m1 = defmsg;
|
||||
|
||||
if( hb_pcount() > 1 )
|
||||
m2 = hb_parc( 2 );
|
||||
else
|
||||
m2 = deftitle;
|
||||
|
||||
MessageBox( hb_dd_g_DDHwnd, m1, m2, NULL);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATEWINDOW )
|
||||
{
|
||||
HWND m_hWnd;
|
||||
HINSTANCE m_hInstance = GetModuleHandle(NULL);
|
||||
long x,y;
|
||||
|
||||
x= hb_pcount() > 10 ?hb_parnl( 1 ) : GetSystemMetrics(SM_CXSCREEN);
|
||||
y= hb_pcount() > 11 ?hb_parnl( 2 ) : GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
hb_dd_g_xWindow = x;
|
||||
hb_dd_g_yWindow = y;
|
||||
|
||||
|
||||
WNDCLASS wndClass = { CS_HREDRAW | CS_VREDRAW, hb_dd_DDWndProc, 0, 0, m_hInstance,
|
||||
NULL,
|
||||
LoadCursor(NULL, IDC_ARROW),
|
||||
(HBRUSH)GetStockObject(BLACK_BRUSH),
|
||||
NULL,
|
||||
TEXT("4dNow") };
|
||||
|
||||
RegisterClass( &wndClass );
|
||||
|
||||
m_hWnd = CreateWindow( TEXT("4dNow"), TEXT("4dNow"),
|
||||
WS_POPUP, 0,
|
||||
0, x,y, NULL, NULL, m_hInstance, 0L );
|
||||
|
||||
if( !m_hWnd )
|
||||
hb_dd_WinError();
|
||||
|
||||
ShowWindow( m_hWnd,SW_SHOWMAXIMIZED );
|
||||
|
||||
hb_dd_DDrawStartup( m_hWnd );
|
||||
hb_retnl( ( long ) m_hWnd );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_LOADBMPINTOSURFACE )
|
||||
{
|
||||
long nSurface = hb_parnl( 1 );
|
||||
char * cBitmap = hb_parc ( 2 );
|
||||
long x = hb_parnl( 3 );
|
||||
long y = hb_parnl( 4 );
|
||||
long dx = hb_parnl( 5 );
|
||||
long dy = hb_parnl( 6 );
|
||||
|
||||
HBITMAP hbm;
|
||||
|
||||
// Load our bitmap resource.
|
||||
|
||||
hbm = (HBITMAP) LoadImage(GetModuleHandle(NULL), cBitmap, IMAGE_BITMAP, 0,
|
||||
0, LR_CREATEDIBSECTION | LR_LOADFROMFILE);
|
||||
|
||||
if( hbm == NULL )
|
||||
hb_dd_g_Error( "Can't load Bitmap.",100,cBitmap );
|
||||
|
||||
if( hb_dd_g_DDSFaces[ nSurface ] == NULL )
|
||||
hb_dd_g_Error( "Invalid Surface",nSurface,"LoadBmpIntoSurface");
|
||||
|
||||
if( DD_OK != hb_dd_DDCopyBitmap( hb_dd_g_DDSFaces[ nSurface ], hbm, x,y, dx, dy ) )
|
||||
hb_dd_g_Error( "DDCopyBitmap",nSurface,"LoadBmpIntoSurface");
|
||||
|
||||
DeleteObject( hbm );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_CREATEOFFSCREENBITMAP )
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
HRESULT hRet;
|
||||
|
||||
if( ! hb_dd_g_pDD )
|
||||
hb_dd_g_Error("No DDraw Initialized",1000,"");
|
||||
|
||||
if( hb_dd_g_DDSFaceCount >= MAX_DDSURFACES )
|
||||
hb_dd_g_Error( "No more DDSurfaces -> Limit reached -> CreateDDSurface()",1000,"DDraw extend sys");
|
||||
else
|
||||
{
|
||||
ZeroMemory(&ddsd, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH ;
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||
ddsd.dwHeight = hb_dd_g_yWindow;
|
||||
ddsd.dwWidth = hb_dd_g_xWindow;
|
||||
hRet = hb_dd_g_pDD->CreateSurface(&ddsd, &hb_dd_g_DDSFaces[ hb_dd_g_DDSFaceCount ], NULL);
|
||||
if( hRet != DD_OK )
|
||||
hb_dd_InitFail( hb_dd_g_DDHwnd, hRet, "CreateSurface FAILED" );
|
||||
}
|
||||
|
||||
return p;
|
||||
hb_retnl( hb_dd_g_DDSFaceCount );
|
||||
hb_dd_g_DDSFaceCount++;
|
||||
}
|
||||
|
||||
void hb_dd_g_Error( char *, long , char *)
|
||||
//------------------------------------------------------------------//
|
||||
|
||||
HB_FUNC( DD_STARTWINDOW )
|
||||
{
|
||||
}
|
||||
MSG msg;
|
||||
BOOL loop = TRUE;
|
||||
|
||||
HB_EXTERN_END
|
||||
while( loop )
|
||||
{
|
||||
if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
if( WM_CLOSE == msg.message )
|
||||
loop = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright(C) 1999 by Jesus Salas
|
||||
*
|
||||
* 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 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to:
|
||||
*
|
||||
* The Free Software Foundation, Inc.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* You can contact me at: jsalas@gruposp.com jsalas@sp-editores.es
|
||||
*
|
||||
*/
|
||||
|
||||
#define INITGUID
|
||||
|
||||
#include "windows.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
|
||||
#include "errno.h"
|
||||
#include "objbase.h"
|
||||
#include "tchar.h"
|
||||
#include "stdio.h"
|
||||
#include "math.h"
|
||||
#include "string.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#include "ddraw.h"
|
||||
|
||||
HB_EXTERN_BEGIN
|
||||
|
||||
/* Main Message Loop */
|
||||
|
||||
long _stdcall hb_dd_DDWndProc( HWND , UINT , WPARAM , LPARAM );
|
||||
|
||||
/* DDraw initialize */
|
||||
|
||||
void hb_dd_DDrawStartup( HWND );
|
||||
void hb_dd_StartWindow( void );
|
||||
void hb_dd_CreateWindow( void );
|
||||
void hb_dd_CreateOffScreenBitmap( void );
|
||||
void hb_dd_ReleaseAllObjects( void );
|
||||
void hb_dd_RestoreAll( void );
|
||||
long hb_dd_checkError( HRESULT );
|
||||
HRESULT hb_dd_DDCopyBitmap( IDirectDrawSurface4 * pdds, HBITMAP hbm, int x, int y, int dx, int dy);
|
||||
void hb_dd_RenderSprites( long );
|
||||
DWORD hb_dd_DDColorMatch( IDirectDrawSurface4 * pdds, COLORREF rgb );
|
||||
void hb_dd_WinError( void );
|
||||
void hb_dd_g_Error( char *, long , char *);
|
||||
|
||||
HB_EXTERN_END
|
||||
@@ -2,6 +2,8 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
ifeq ($(HB_ARCHITECTURE),w32)
|
||||
|
||||
ROOT = ../../
|
||||
|
||||
C_SOURCES = \
|
||||
@@ -81,4 +83,10 @@ PRG_HEADERS= \
|
||||
|
||||
LIBNAME=hbwhat32
|
||||
|
||||
# This lib needs xhb headers to compile, and this is
|
||||
# the hack to help Harbour find them.
|
||||
PRG_USR := $(PRG_USR) -I../../../xhb
|
||||
|
||||
include $(TOP)$(ROOT)config/lib.cf
|
||||
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,494 +2,177 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
* Automatically translated from commdlg.h by hConvert.EXE
|
||||
* (Copyright PC Wise Technology) AJ Wos (andrwos@global.co.za) 1998-2000
|
||||
* Fitness for any particular purpose is not guaranteed nor implied.
|
||||
* It is recommended to verify the correctness of the file before use.
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* commdlg.h -- This module defines the 32-Bit Common Dialog APIs *
|
||||
* *
|
||||
* Copyright (c) 1992-1999, Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _COMMDLG_H
|
||||
|
||||
#define _COMMDLG_H
|
||||
|
||||
#define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)
|
||||
#define OPENFILENAME_SIZE_VERSION_400W CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
|
||||
|
||||
#ifdef UNICODE
|
||||
#define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400W
|
||||
#else
|
||||
#define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400A
|
||||
#endif // !UNICODE
|
||||
|
||||
|
||||
#define OFN_READONLY 1
|
||||
#define OFN_OVERWRITEPROMPT 2
|
||||
#define OFN_HIDEREADONLY 4
|
||||
#define OFN_NOCHANGEDIR 8
|
||||
#define OFN_SHOWHELP 16
|
||||
#define OFN_ENABLEHOOK 32
|
||||
#define OFN_ENABLETEMPLATE 64
|
||||
#define OFN_ENABLETEMPLATEHANDLE 128
|
||||
#define OFN_NOVALIDATE 256
|
||||
#define OFN_ALLOWMULTISELECT 512
|
||||
#define OFN_EXTENSIONDIFFERENT 1024
|
||||
#define OFN_PATHMUSTEXIST 2048
|
||||
#define OFN_FILEMUSTEXIST 4096
|
||||
#define OFN_CREATEPROMPT 8192
|
||||
#define OFN_SHAREAWARE 16384
|
||||
#define OFN_NOREADONLYRETURN 32768
|
||||
#define OFN_NOTESTFILECREATE 65536
|
||||
#define OFN_NONETWORKBUTTON 131072
|
||||
#define OFN_NOLONGNAMES 262144 // force no long names for 4.x modules
|
||||
#define OFN_EXPLORER 524288 // new look commdlg
|
||||
#define OFN_NODEREFERENCELINKS 1048576
|
||||
#define OFN_LONGNAMES 2097152 // force long names for 3.x modules
|
||||
#define OFN_ENABLEINCLUDENOTIFY 4194304 // send include message to callback
|
||||
#define OFN_ENABLESIZING 8388608
|
||||
#define OFN_DONTADDTORECENT 33554432
|
||||
#define OFN_FORCESHOWHIDDEN 268435456 // Show All files including System and hidden files
|
||||
|
||||
|
||||
|
||||
// Return values for the registered message sent to the hook function
|
||||
// when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
|
||||
// filename to be accepted, OFN_SHARENOWARN rejects the name but puts
|
||||
// up no warning (returned when the app has already put up a warning
|
||||
// message), and OFN_SHAREWARN puts up the default warning message
|
||||
// for sharing violations.
|
||||
//
|
||||
// Note: Undefined return values map to OFN_SHAREWARN, but are
|
||||
// reserved for future use.
|
||||
|
||||
#define OFN_SHAREFALLTHROUGH 2
|
||||
#define OFN_SHARENOWARN 1
|
||||
#define OFN_SHAREWARN 0
|
||||
|
||||
// Notifications from Open or Save dialog
|
||||
#define CDN_INITDONE (CDN_FIRST - 0)
|
||||
#define CDN_SELCHANGE (CDN_FIRST - 1)
|
||||
#define CDN_FOLDERCHANGE (CDN_FIRST - 2)
|
||||
#define CDN_SHAREVIOLATION (CDN_FIRST - 3)
|
||||
#define CDN_HELP (CDN_FIRST - 4)
|
||||
#define CDN_FILEOK (CDN_FIRST - 5)
|
||||
#define CDN_TYPECHANGE (CDN_FIRST - 6)
|
||||
#define CDN_INCLUDEITEM (CDN_FIRST - 7)
|
||||
|
||||
|
||||
#define CDM_FIRST (WM_USER + 100)
|
||||
#define CDM_LAST (WM_USER + 200)
|
||||
|
||||
// Messages to query information from the Open or Save dialogs
|
||||
|
||||
// lParam = pointer to text buffer that gets filled in
|
||||
// wParam = max number of characters of the text buffer (including NULL)
|
||||
// return = < 0 if error; number of characters needed (including NULL)
|
||||
#define CDM_GETSPEC (CDM_FIRST + 0)
|
||||
|
||||
// lParam = pointer to text buffer that gets filled in
|
||||
// wParam = max number of characters of the text buffer (including NULL)
|
||||
// return = < 0 if error; number of characters needed (including NULL)
|
||||
#define CDM_GETFILEPATH (CDM_FIRST + 1)
|
||||
|
||||
// lParam = pointer to text buffer that gets filled in
|
||||
// wParam = max number of characters of the text buffer (including NULL)
|
||||
// return = < 0 if error; number of characters needed (including NULL)
|
||||
#define CDM_GETFOLDERPATH (CDM_FIRST + 2)
|
||||
|
||||
// lParam = pointer to ITEMIDLIST buffer that gets filled in
|
||||
// wParam = size of the ITEMIDLIST buffer
|
||||
// return = < 0 if error; length of buffer needed
|
||||
#define CDM_GETFOLDERIDLIST (CDM_FIRST + 3)
|
||||
|
||||
|
||||
// lParam = pointer to a string
|
||||
// wParam = ID of control to change
|
||||
// return = not used
|
||||
#define CDM_SETCONTROLTEXT (CDM_FIRST + 4)
|
||||
|
||||
|
||||
// lParam = not used
|
||||
// wParam = ID of control to change
|
||||
// return = not used
|
||||
#define CDM_HIDECONTROL (CDM_FIRST + 5)
|
||||
|
||||
|
||||
// lParam = pointer to default extension (no dot)
|
||||
// wParam = not used
|
||||
// return = not used
|
||||
#define CDM_SETDEFEXT (CDM_FIRST + 6)
|
||||
|
||||
|
||||
#define CC_RGBINIT 1
|
||||
#define CC_FULLOPEN 2
|
||||
#define CC_PREVENTFULLOPEN 4
|
||||
#define CC_SHOWHELP 8
|
||||
#define CC_ENABLEHOOK 16
|
||||
#define CC_ENABLETEMPLATE 32
|
||||
#define CC_ENABLETEMPLATEHANDLE 64
|
||||
#define CC_SOLIDCOLOR 128
|
||||
#define CC_ANYCOLOR 256
|
||||
|
||||
|
||||
#define FR_DOWN 1
|
||||
#define FR_WHOLEWORD 2
|
||||
#define FR_MATCHCASE 4
|
||||
#define FR_FINDNEXT 8
|
||||
#define FR_REPLACE 16
|
||||
#define FR_REPLACEALL 32
|
||||
#define FR_DIALOGTERM 64
|
||||
#define FR_SHOWHELP 128
|
||||
#define FR_ENABLEHOOK 256
|
||||
#define FR_ENABLETEMPLATE 512
|
||||
#define FR_NOUPDOWN 1024
|
||||
#define FR_NOMATCHCASE 2048
|
||||
#define FR_NOWHOLEWORD 4096
|
||||
#define FR_ENABLETEMPLATEHANDLE 8192
|
||||
#define FR_HIDEUPDOWN 16384
|
||||
#define FR_HIDEMATCHCASE 32768
|
||||
#define FR_HIDEWHOLEWORD 65536
|
||||
#define FR_RAW 131072
|
||||
#define FR_MATCHDIAC 536870912
|
||||
#define FR_MATCHKASHIDA 1073741824
|
||||
#define FR_MATCHALEFHAMZA 2147483648
|
||||
|
||||
|
||||
#define CF_SCREENFONTS 1
|
||||
#define CF_PRINTERFONTS 2
|
||||
#define CF_BOTH (CF_SCREENFONTS + CF_PRINTERFONTS)
|
||||
#define CF_SHOWHELP 4
|
||||
#define CF_ENABLEHOOK 8
|
||||
#define CF_ENABLETEMPLATE 16
|
||||
#define CF_ENABLETEMPLATEHANDLE 32
|
||||
#define CF_INITTOLOGFONTSTRUCT 64
|
||||
#define CF_USESTYLE 128
|
||||
#define CF_EFFECTS 256
|
||||
#define CF_APPLY 512
|
||||
#define CF_ANSIONLY 1024
|
||||
#define CF_SCRIPTSONLY CF_ANSIONLY
|
||||
#define CF_NOVECTORFONTS 2048
|
||||
#define CF_NOOEMFONTS CF_NOVECTORFONTS
|
||||
#define CF_NOSIMULATIONS 4096
|
||||
#define CF_LIMITSIZE 8192
|
||||
#define CF_FIXEDPITCHONLY 16384
|
||||
#define CF_WYSIWYG 32768 // must also have CF_SCREENFONTS & CF_PRINTERFONTS
|
||||
#define CF_FORCEFONTEXIST 65536
|
||||
#define CF_SCALABLEONLY 131072
|
||||
#define CF_TTONLY 262144
|
||||
#define CF_NOFACESEL 524288
|
||||
#define CF_NOSTYLESEL 1048576
|
||||
#define CF_NOSIZESEL 2097152
|
||||
#define CF_SELECTSCRIPT 4194304
|
||||
#define CF_NOSCRIPTSEL 8388608
|
||||
#define CF_NOVERTFONTS 16777216
|
||||
|
||||
// these are extra nFontType bits that are added to what is returned to the
|
||||
// EnumFonts callback routine
|
||||
|
||||
#define SIMULATED_FONTTYPE 32768
|
||||
#define PRINTER_FONTTYPE 16384
|
||||
#define SCREEN_FONTTYPE 8192
|
||||
#define BOLD_FONTTYPE 256
|
||||
#define ITALIC_FONTTYPE 512
|
||||
#define REGULAR_FONTTYPE 1024
|
||||
|
||||
// EnumFonts callback routine only uses these bits, so we can use the rest
|
||||
|
||||
// #define RASTER_FONTTYPE 0x001
|
||||
// #define DEVICE_FONTTYPE 0x002
|
||||
// #define TRUETYPE_FONTTYPE 0x004
|
||||
|
||||
#ifdef WINNT
|
||||
#define PS_OPENTYPE_FONTTYPE 65536
|
||||
#define TT_OPENTYPE_FONTTYPE 131072
|
||||
#define TYPE1_FONTTYPE 262144
|
||||
#endif
|
||||
|
||||
#define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
|
||||
#define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)
|
||||
#define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)
|
||||
|
||||
// strings used to obtain unique window message for communication
|
||||
// between dialog and caller
|
||||
|
||||
#define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
|
||||
#define SHAREVISTRINGA "commdlg_ShareViolation"
|
||||
#define FILEOKSTRINGA "commdlg_FileNameOK"
|
||||
#define COLOROKSTRINGA "commdlg_ColorOK"
|
||||
#define SETRGBSTRINGA "commdlg_SetRGBColor"
|
||||
#define HELPMSGSTRINGA "commdlg_help"
|
||||
#define FINDMSGSTRINGA "commdlg_FindReplace"
|
||||
|
||||
#define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
|
||||
#define SHAREVISTRINGW L"commdlg_ShareViolation"
|
||||
#define FILEOKSTRINGW L"commdlg_FileNameOK"
|
||||
#define COLOROKSTRINGW L"commdlg_ColorOK"
|
||||
#define SETRGBSTRINGW L"commdlg_SetRGBColor"
|
||||
#define HELPMSGSTRINGW L"commdlg_help"
|
||||
#define FINDMSGSTRINGW L"commdlg_FindReplace"
|
||||
|
||||
#define LBSELCHSTRING LBSELCHSTRINGW
|
||||
#define SHAREVISTRING SHAREVISTRINGW
|
||||
#define FILEOKSTRING FILEOKSTRINGW
|
||||
#define COLOROKSTRING COLOROKSTRINGW
|
||||
#define SETRGBSTRING SETRGBSTRINGW
|
||||
#define HELPMSGSTRING HELPMSGSTRINGW
|
||||
#define FINDMSGSTRING FINDMSGSTRINGW
|
||||
|
||||
// HIWORD values for lParam of commdlg_LBSelChangeNotify message
|
||||
#define CD_LBSELNOITEMS -1
|
||||
#define CD_LBSELCHANGE 0
|
||||
#define CD_LBSELSUB 1
|
||||
#define CD_LBSELADD 2
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// IPrintDialogCallback Interface
|
||||
//
|
||||
// IPrintDialogCallback::InitDone()
|
||||
// This function is called by PrintDlgEx when the system has finished
|
||||
// initializing the main page of the print dialog. This function
|
||||
// should return S_OK if it has processed the action or S_FALSE to let
|
||||
// PrintDlgEx perform the default action.
|
||||
//
|
||||
// IPrintDialogCallback::SelectionChange()
|
||||
// This function is called by PrintDlgEx when a selection change occurs
|
||||
// in the list view that displays the currently installed printers.
|
||||
// This function should return S_OK if it has processed the action or
|
||||
// S_FALSE to let PrintDlgEx perform the default action.
|
||||
//
|
||||
// IPrintDialogCallback::HandleMessage(hDlg, uMsg, wParam, lParam, pResult)
|
||||
// This function is called by PrintDlgEx when a message is sent to the
|
||||
// child window of the main page of the print dialog. This function
|
||||
// should return S_OK if it has processed the action or S_FALSE to let
|
||||
// PrintDlgEx perform the default action.
|
||||
//
|
||||
// IObjectWithSite::SetSite(punkSite)
|
||||
// IPrintDialogCallback usually paired with IObjectWithSite.
|
||||
// Provides the IUnknown pointer of the site to QI for the
|
||||
// IPrintDialogServices interface.
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// IPrintDialogServices Interface
|
||||
//
|
||||
// IPrintDialogServices::GetCurrentDevMode(pDevMode, pcbSize)
|
||||
// Returns the DEVMODE structure for the currently selected printer.
|
||||
//
|
||||
// IPrintDialogServices::GetCurrentPrinterName(pPrinterName, pcchSize)
|
||||
// Returns the printer name for the currently selected printer.
|
||||
//
|
||||
// IPrintDialogServices::GetCurrentPortName(pPortName, pcchSize)
|
||||
// Returns the port name for the currently selected printer.
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Flags for PrintDlg and PrintDlgEx.
|
||||
//
|
||||
#define PD_ALLPAGES 0
|
||||
#define PD_SELECTION 1
|
||||
#define PD_PAGENUMS 2
|
||||
#define PD_NOSELECTION 4
|
||||
#define PD_NOPAGENUMS 8
|
||||
#define PD_COLLATE 16
|
||||
#define PD_PRINTTOFILE 32
|
||||
#define PD_PRINTSETUP 64
|
||||
#define PD_NOWARNING 128
|
||||
#define PD_RETURNDC 256
|
||||
#define PD_RETURNIC 512
|
||||
#define PD_RETURNDEFAULT 1024
|
||||
#define PD_SHOWHELP 2048
|
||||
#define PD_ENABLEPRINTHOOK 4096
|
||||
#define PD_ENABLESETUPHOOK 8192
|
||||
#define PD_ENABLEPRINTTEMPLATE 16384
|
||||
#define PD_ENABLESETUPTEMPLATE 32768
|
||||
#define PD_ENABLEPRINTTEMPLATEHANDLE 65536
|
||||
#define PD_ENABLESETUPTEMPLATEHANDLE 131072
|
||||
#define PD_USEDEVMODECOPIES 262144
|
||||
#define PD_USEDEVMODECOPIESANDCOLLATE 262144
|
||||
#define PD_DISABLEPRINTTOFILE 524288
|
||||
#define PD_HIDEPRINTTOFILE 1048576
|
||||
#define PD_NONETWORKBUTTON 2097152
|
||||
#define PD_CURRENTPAGE 4194304
|
||||
#define PD_NOCURRENTPAGE 8388608
|
||||
#define PD_EXCLUSIONFLAGS 16777216
|
||||
#define PD_USELARGETEMPLATE 268435456
|
||||
|
||||
|
||||
//
|
||||
// Exclusion flags for PrintDlgEx.
|
||||
//
|
||||
#define PD_EXCL_COPIESANDCOLLATE (DM_COPIES + DM_COLLATE)
|
||||
|
||||
|
||||
//
|
||||
// Define the start page for the print dialog when using PrintDlgEx.
|
||||
//
|
||||
#define START_PAGE_GENERAL 4294967295
|
||||
|
||||
|
||||
//
|
||||
// Result action ids for PrintDlgEx.
|
||||
//
|
||||
#define PD_RESULT_CANCEL 0
|
||||
#define PD_RESULT_PRINT 1
|
||||
#define PD_RESULT_APPLY 2
|
||||
|
||||
|
||||
//
|
||||
// Device Names structure for PrintDlg and PrintDlgEx.
|
||||
//
|
||||
|
||||
|
||||
#define DN_DEFAULTPRN 1
|
||||
|
||||
|
||||
#define WM_PSD_PAGESETUPDLG (WM_USER )
|
||||
#define WM_PSD_FULLPAGERECT (WM_USER+1)
|
||||
#define WM_PSD_MINMARGINRECT (WM_USER+2)
|
||||
#define WM_PSD_MARGINRECT (WM_USER+3)
|
||||
#define WM_PSD_GREEKTEXTRECT (WM_USER+4)
|
||||
#define WM_PSD_ENVSTAMPRECT (WM_USER+5)
|
||||
#define WM_PSD_YAFULLPAGERECT (WM_USER+6)
|
||||
|
||||
|
||||
#define PSD_DEFAULTMINMARGINS 0 // default (printer's)
|
||||
#define PSD_INWININIINTLMEASURE 0 // 1st of 4 possible
|
||||
|
||||
#define PSD_MINMARGINS 1 // use caller's
|
||||
#define PSD_MARGINS 2 // use caller's
|
||||
#define PSD_INTHOUSANDTHSOFINCHES 4 // 2nd of 4 possible
|
||||
#define PSD_INHUNDREDTHSOFMILLIMETERS 8 // 3rd of 4 possible
|
||||
#define PSD_DISABLEMARGINS 16
|
||||
#define PSD_DISABLEPRINTER 32
|
||||
#define PSD_NOWARNING 128 // must be same as PD_*
|
||||
#define PSD_DISABLEORIENTATION 256
|
||||
#define PSD_RETURNDEFAULT 1024 // must be same as PD_*
|
||||
#define PSD_DISABLEPAPER 512
|
||||
#define PSD_SHOWHELP 2048 // must be same as PD_*
|
||||
#define PSD_ENABLEPAGESETUPHOOK 8192 // must be same as PD_*
|
||||
#define PSD_ENABLEPAGESETUPTEMPLATE 32768 // must be same as PD_*
|
||||
#define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 131072 // must be same as PD_*
|
||||
#define PSD_ENABLEPAGEPAINTHOOK 262144
|
||||
#define PSD_DISABLEPAGEPAINTING 524288
|
||||
#define PSD_NONETWORKBUTTON 2097152 // must be same as PD_*
|
||||
|
||||
|
||||
// SHBrowseForFolder()
|
||||
|
||||
// Browsing for directory.
|
||||
#define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching
|
||||
#define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
|
||||
#define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
|
||||
// this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
|
||||
// rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
|
||||
// all three lines of text.
|
||||
#define BIF_RETURNFSANCESTORS 0x0008
|
||||
#define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
|
||||
#define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL)
|
||||
|
||||
#define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
|
||||
// Caller needs to call OleInitialize() before using this API
|
||||
|
||||
#define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
|
||||
|
||||
#define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
|
||||
|
||||
#define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
|
||||
#define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
|
||||
#define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
|
||||
#define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
|
||||
|
||||
// message from browser
|
||||
#define BFFM_INITIALIZED 1
|
||||
#define BFFM_SELCHANGED 2
|
||||
#define BFFM_VALIDATEFAILED 3 // lParam:szPath ret:1(cont),0(EndDialog)
|
||||
|
||||
// messages to browser
|
||||
#define BFFM_SETSTATUSTEXT (WM_USER + 100)
|
||||
#define BFFM_ENABLEOK (WM_USER + 101)
|
||||
#define BFFM_SETSELECTION (WM_USER + 102)
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// SHGetSpecialFolderLocation
|
||||
//
|
||||
// Caller should use SHGetMalloc to obtain an allocator that can free the pidl
|
||||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// registry entries for special paths are kept in :
|
||||
#define REGSTR_PATH_SPECIAL_FOLDERS REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
|
||||
|
||||
|
||||
#define CSIDL_DESKTOP 0x0000 // <desktop>
|
||||
#define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop)
|
||||
#define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
|
||||
#define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel
|
||||
#define CSIDL_PRINTERS 0x0004 // My Computer\Printers
|
||||
#define CSIDL_PERSONAL 0x0005 // My Documents
|
||||
#define CSIDL_FAVORITES 0x0006 // <user name>\Favorites
|
||||
#define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup
|
||||
#define CSIDL_RECENT 0x0008 // <user name>\Recent
|
||||
#define CSIDL_SENDTO 0x0009 // <user name>\SendTo
|
||||
#define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle Bin
|
||||
#define CSIDL_STARTMENU 0x000b // <user name>\Start Menu
|
||||
#define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
|
||||
#define CSIDL_DRIVES 0x0011 // My Computer
|
||||
#define CSIDL_NETWORK 0x0012 // Network Neighborhood
|
||||
#define CSIDL_NETHOOD 0x0013 // <user name>\nethood
|
||||
#define CSIDL_FONTS 0x0014 // windows\fonts
|
||||
#define CSIDL_TEMPLATES 0x0015
|
||||
#define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu
|
||||
#define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Programs
|
||||
#define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
|
||||
#define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
|
||||
#define CSIDL_APPDATA 0x001a // <user name>\Application Data
|
||||
#define CSIDL_PRINTHOOD 0x001b // <user name>\PrintHood
|
||||
#define CSIDL_LOCAL_APPDATA 0x001c // <user name>\Local Settings\Applicaiton Data (non roaming)
|
||||
#define CSIDL_ALTSTARTUP 0x001d // non localized startup
|
||||
#define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup
|
||||
#define CSIDL_COMMON_FAVORITES 0x001f
|
||||
#define CSIDL_INTERNET_CACHE 0x0020
|
||||
#define CSIDL_COOKIES 0x0021
|
||||
#define CSIDL_HISTORY 0x0022
|
||||
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
|
||||
#define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
|
||||
#define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
|
||||
#define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
|
||||
#define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures
|
||||
#define CSIDL_PROFILE 0x0028 // USERPROFILE
|
||||
#define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC
|
||||
#define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC
|
||||
#define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
|
||||
#define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC
|
||||
#define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates
|
||||
#define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
|
||||
#define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools
|
||||
#define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start Menu\Programs\Administrative Tools
|
||||
#define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections
|
||||
|
||||
#define CSIDL_FLAG_CREATE 0x8000 // combine with CSIDL_ value to force folder creation in SHGetFolderPath()
|
||||
#define CSIDL_FLAG_DONT_VERIFY 0x4000 // combine with CSIDL_ value to return an unverified folder path
|
||||
#define CSIDL_FLAG_MASK 0xFF00 // mask for all possible flag values
|
||||
|
||||
#endif
|
||||
#define CDN_FIRST (-601) /* also in commctrl.h */
|
||||
#define CDN_LAST (-699)
|
||||
#define CDN_INITDONE CDN_FIRST
|
||||
#define CDN_SELCHANGE (CDN_FIRST-1U)
|
||||
#define CDN_FOLDERCHANGE (CDN_FIRST-2U)
|
||||
#define CDN_SHAREVIOLATION (CDN_FIRST-3U)
|
||||
#define CDN_HELP (CDN_FIRST-4U)
|
||||
#define CDN_FILEOK (CDN_FIRST-5U)
|
||||
#define CDN_TYPECHANGE (CDN_FIRST-6U)
|
||||
#define CDM_FIRST (WM_USER+100)
|
||||
#define CDM_LAST (WM_USER+200)
|
||||
#define CDM_GETSPEC CDM_FIRST
|
||||
#define CDM_GETFILEPATH (CDM_FIRST+1)
|
||||
#define CDM_GETFOLDERPATH (CDM_FIRST+2)
|
||||
#define CDM_GETFOLDERIDLIST (CDM_FIRST+3)
|
||||
#define CDM_SETCONTROLTEXT (CDM_FIRST+4)
|
||||
#define CDM_HIDECONTROL (CDM_FIRST+5)
|
||||
#define CDM_SETDEFEXT (CDM_FIRST+6)
|
||||
#define CC_RGBINIT 1
|
||||
#define CC_FULLOPEN 2
|
||||
#define CC_PREVENTFULLOPEN 4
|
||||
#define CC_SHOWHELP 8
|
||||
#define CC_ENABLEHOOK 16
|
||||
#define CC_ENABLETEMPLATE 32
|
||||
#define CC_ENABLETEMPLATEHANDLE 64
|
||||
#define CC_SOLIDCOLOR 128
|
||||
#define CC_ANYCOLOR 256
|
||||
#define CF_SCREENFONTS 1
|
||||
#define CF_PRINTERFONTS 2
|
||||
#define CF_BOTH 3
|
||||
#define CF_SHOWHELP 4
|
||||
#define CF_ENABLEHOOK 8
|
||||
#define CF_ENABLETEMPLATE 16
|
||||
#define CF_ENABLETEMPLATEHANDLE 32
|
||||
#define CF_INITTOLOGFONTSTRUCT 64
|
||||
#define CF_USESTYLE 128
|
||||
#define CF_EFFECTS 256
|
||||
#define CF_APPLY 512
|
||||
#define CF_ANSIONLY 1024
|
||||
#define CF_SCRIPTSONLY CF_ANSIONLY
|
||||
#define CF_NOVECTORFONTS 2048
|
||||
#define CF_NOOEMFONTS 2048
|
||||
#define CF_NOSIMULATIONS 4096
|
||||
#define CF_LIMITSIZE 8192
|
||||
#define CF_FIXEDPITCHONLY 16384
|
||||
#define CF_WYSIWYG 32768
|
||||
#define CF_FORCEFONTEXIST 65536
|
||||
#define CF_SCALABLEONLY 131072
|
||||
#define CF_TTONLY 262144
|
||||
#define CF_NOFACESEL 524288
|
||||
#define CF_NOSTYLESEL 1048576
|
||||
#define CF_NOSIZESEL 2097152
|
||||
#define CF_SELECTSCRIPT 4194304
|
||||
#define CF_NOSCRIPTSEL 8388608
|
||||
#define CF_NOVERTFONTS 0x1000000
|
||||
#define SIMULATED_FONTTYPE 0x8000
|
||||
#define PRINTER_FONTTYPE 0x4000
|
||||
#define SCREEN_FONTTYPE 0x2000
|
||||
#define BOLD_FONTTYPE 0x100
|
||||
#define ITALIC_FONTTYPE 0x0200
|
||||
#define REGULAR_FONTTYPE 0x0400
|
||||
#define WM_CHOOSEFONT_GETLOGFONT (WM_USER+1)
|
||||
#define WM_CHOOSEFONT_SETLOGFONT (WM_USER+101)
|
||||
#define WM_CHOOSEFONT_SETFLAGS (WM_USER+102)
|
||||
#define OFN_ALLOWMULTISELECT 512
|
||||
#define OFN_CREATEPROMPT 0x2000
|
||||
#define OFN_ENABLEHOOK 32
|
||||
#define OFN_ENABLESIZING 0x800000
|
||||
#define OFN_ENABLETEMPLATE 64
|
||||
#define OFN_ENABLETEMPLATEHANDLE 128
|
||||
#define OFN_EXPLORER 0x80000
|
||||
#define OFN_EXTENSIONDIFFERENT 0x400
|
||||
#define OFN_FILEMUSTEXIST 0x1000
|
||||
#define OFN_HIDEREADONLY 4
|
||||
#define OFN_LONGNAMES 0x200000
|
||||
#define OFN_NOCHANGEDIR 8
|
||||
#define OFN_NODEREFERENCELINKS 0x100000
|
||||
#define OFN_NOLONGNAMES 0x40000
|
||||
#define OFN_NONETWORKBUTTON 0x20000
|
||||
#define OFN_NOREADONLYRETURN 0x8000
|
||||
#define OFN_NOTESTFILECREATE 0x10000
|
||||
#define OFN_NOVALIDATE 256
|
||||
#define OFN_OVERWRITEPROMPT 2
|
||||
#define OFN_PATHMUSTEXIST 0x800
|
||||
#define OFN_READONLY 1
|
||||
#define OFN_SHAREAWARE 0x4000
|
||||
#define OFN_SHOWHELP 16
|
||||
#define OFN_SHAREFALLTHROUGH 2
|
||||
#define OFN_SHARENOWARN 1
|
||||
#define OFN_SHAREWARN 0
|
||||
#define OFN_DONTADDTORECENT 0x02000000
|
||||
#define FR_DIALOGTERM 64
|
||||
#define FR_DOWN 1
|
||||
#define FR_ENABLEHOOK 256
|
||||
#define FR_ENABLETEMPLATE 512
|
||||
#define FR_ENABLETEMPLATEHANDLE 0x2000
|
||||
#define FR_FINDNEXT 8
|
||||
#define FR_HIDEUPDOWN 0x4000
|
||||
#define FR_HIDEMATCHCASE 0x8000
|
||||
#define FR_HIDEWHOLEWORD 0x10000
|
||||
#define FR_MATCHALEFHAMZA 0x80000000
|
||||
#define FR_MATCHCASE 4
|
||||
#define FR_MATCHDIAC 0x20000000
|
||||
#define FR_MATCHKASHIDA 0x40000000
|
||||
#define FR_NOMATCHCASE 0x800
|
||||
#define FR_NOUPDOWN 0x400
|
||||
#define FR_NOWHOLEWORD 4096
|
||||
#define FR_REPLACE 16
|
||||
#define FR_REPLACEALL 32
|
||||
#define FR_SHOWHELP 128
|
||||
#define FR_WHOLEWORD 2
|
||||
#define PD_ALLPAGES 0x00000000
|
||||
#define PD_SELECTION 0x00000001
|
||||
#define PD_PAGENUMS 0x00000002
|
||||
#define PD_NOSELECTION 0x00000004
|
||||
#define PD_NOPAGENUMS 0x00000008
|
||||
#define PD_COLLATE 0x00000010
|
||||
#define PD_PRINTTOFILE 0x00000020
|
||||
#define PD_PRINTSETUP 0x00000040
|
||||
#define PD_NOWARNING 0x00000080
|
||||
#define PD_RETURNDC 0x00000100
|
||||
#define PD_RETURNIC 0x00000200
|
||||
#define PD_RETURNDEFAULT 0x00000400
|
||||
#define PD_SHOWHELP 0x00000800
|
||||
#define PD_ENABLEPRINTHOOK 0x00001000
|
||||
#define PD_ENABLESETUPHOOK 0x00002000
|
||||
#define PD_ENABLEPRINTTEMPLATE 0x00004000
|
||||
#define PD_ENABLESETUPTEMPLATE 0x00008000
|
||||
#define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
|
||||
#define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
|
||||
#define PD_USEDEVMODECOPIES 0x00040000
|
||||
#define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
|
||||
#define PD_DISABLEPRINTTOFILE 0x00080000
|
||||
#define PD_HIDEPRINTTOFILE 0x00100000
|
||||
#define PD_NONETWORKBUTTON 0x00200000
|
||||
#define PD_CURRENTPAGE 0x00400000
|
||||
#define PD_NOCURRENTPAGE 0x00800000
|
||||
#define PD_EXCLUSIONFLAGS 0x01000000
|
||||
#define PD_USELARGETEMPLATE 0x10000000
|
||||
#define PD_RESULT_CANCEL 0
|
||||
#define PD_RESULT_PRINT 1
|
||||
#define PD_RESULT_APPLY 2
|
||||
#define START_PAGE_GENERAL 0XFFFFFFFF
|
||||
#define PSD_DEFAULTMINMARGINS 0
|
||||
#define PSD_INWININIINTLMEASURE 0
|
||||
#define PSD_MINMARGINS 1
|
||||
#define PSD_MARGINS 2
|
||||
#define PSD_INTHOUSANDTHSOFINCHES 4
|
||||
#define PSD_INHUNDREDTHSOFMILLIMETERS 8
|
||||
#define PSD_DISABLEMARGINS 16
|
||||
#define PSD_DISABLEPRINTER 32
|
||||
#define PSD_NOWARNING 128
|
||||
#define PSD_DISABLEORIENTATION 256
|
||||
#define PSD_DISABLEPAPER 512
|
||||
#define PSD_RETURNDEFAULT 1024
|
||||
#define PSD_SHOWHELP 2048
|
||||
#define PSD_ENABLEPAGESETUPHOOK 8192
|
||||
#define PSD_ENABLEPAGESETUPTEMPLATE 0x8000
|
||||
#define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x20000
|
||||
#define PSD_ENABLEPAGEPAINTHOOK 0x40000
|
||||
#define PSD_DISABLEPAGEPAINTING 0x80000
|
||||
#define WM_PSD_PAGESETUPDLG WM_USER
|
||||
#define WM_PSD_FULLPAGERECT (WM_USER+1)
|
||||
#define WM_PSD_MINMARGINRECT (WM_USER+2)
|
||||
#define WM_PSD_MARGINRECT (WM_USER+3)
|
||||
#define WM_PSD_GREEKTEXTRECT (WM_USER+4)
|
||||
#define WM_PSD_ENVSTAMPRECT (WM_USER+5)
|
||||
#define WM_PSD_YAFULLPAGERECT (WM_USER+6)
|
||||
#define CD_LBSELNOITEMS (-1)
|
||||
#define CD_LBSELCHANGE 0
|
||||
#define CD_LBSELSUB 1
|
||||
#define CD_LBSELADD 2
|
||||
#define DN_DEFAULTPRN 1
|
||||
#define OPENFILENAME_SIZE_VERSION_400 76
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -41,9 +41,7 @@
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#ifndef _ZCONF_H
|
||||
#define _ZCONF_H
|
||||
|
||||
/*
|
||||
#if _MSC_VER > 1000
|
||||
#pragma warning (disable : 4131)
|
||||
#pragma warning (disable : 4115)
|
||||
#pragma warning (disable : 4127)
|
||||
#pragma warning (disable : 4100)
|
||||
#pragma warning (disable : 4244)
|
||||
#pragma warning (disable : 4702)
|
||||
#pragma warning (disable : 4206)
|
||||
#endif // _MSC_VER > 1000
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateParams z_deflateParams
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateReset z_inflateReset
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
# define WIN32
|
||||
#endif
|
||||
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
|
||||
# ifndef __32BIT__
|
||||
# define __32BIT__
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#if defined(MSDOS) && !defined(__32BIT__)
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
|
||||
# define STDC
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#endif
|
||||
|
||||
/* Old Borland C incorrectly complains about missing returns: */
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
|
||||
# define NEED_DUMMY_RETURN
|
||||
#endif
|
||||
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
# define MAX_MEM_LEVEL 8
|
||||
# else
|
||||
# define MAX_MEM_LEVEL 9
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||
* created by gzip. (Files created by minigzip can still be extracted by
|
||||
* gzip.)
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* The memory requirements for deflate are (in bytes):
|
||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||
the default memory requirements from 256K to 128K, compile with
|
||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
#ifdef OF
|
||||
#undef OF
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef OF
|
||||
# ifdef STDC
|
||||
*/
|
||||
# define OF(args) args
|
||||
/*
|
||||
# else
|
||||
# define OF(args) ()
|
||||
# endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
# ifndef __32BIT__
|
||||
# define SMALL_MEDIUM
|
||||
# define FAR _far
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Compile with -DZLIB_DLL for Windows DLL support */
|
||||
#if defined(ZLIB_DLL)
|
||||
# if defined(_WINDOWS) || defined(WINDOWS)
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR _cdecl _export
|
||||
# endif
|
||||
# endif
|
||||
# if defined (__BORLANDC__)
|
||||
# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
|
||||
# include <windows.h>
|
||||
# define ZEXPORT __declspec(dllexport) WINAPI
|
||||
# define ZEXPORTRVA __declspec(dllexport) WINAPIV
|
||||
# else
|
||||
# if defined (_Windows) && defined (__DLL__)
|
||||
# define ZEXPORT _export
|
||||
# define ZEXPORTVA _export
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# if defined (ZLIB_DLL)
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(MACOS) && !defined(TARGET_OS_MAC)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
typedef unsigned long uLong; /* 32 bits or more */
|
||||
|
||||
#ifdef SMALL_MEDIUM
|
||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||
# define Bytef Byte FAR
|
||||
#else
|
||||
typedef Byte FAR Bytef;
|
||||
#endif
|
||||
typedef char FAR charf;
|
||||
typedef int FAR intf;
|
||||
typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# define z_off_t off_t
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(inflate_blocks,"INBL")
|
||||
# pragma map(inflate_blocks_new,"INBLNE")
|
||||
# pragma map(inflate_blocks_free,"INBLFR")
|
||||
# pragma map(inflate_blocks_reset,"INBLRE")
|
||||
# pragma map(inflate_codes_free,"INCOFR")
|
||||
# pragma map(inflate_codes,"INCO")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_flush,"INFLU")
|
||||
# pragma map(inflate_mask,"INMA")
|
||||
# pragma map(inflate_set_dictionary,"INSEDI2")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
# pragma map(inflate_trees_bits,"INTRBI")
|
||||
# pragma map(inflate_trees_dynamic,"INTRDY")
|
||||
# pragma map(inflate_trees_fixed,"INTRFI")
|
||||
# pragma map(inflate_trees_free,"INTRFR")
|
||||
#endif
|
||||
|
||||
#endif /* _ZCONF_H */
|
||||
@@ -46,9 +46,8 @@
|
||||
#define _zip_H
|
||||
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -83,9 +83,7 @@
|
||||
//#ifdef __cplusplus
|
||||
//extern "C" {
|
||||
//#endif
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
//#ifdef __cplusplus
|
||||
//}
|
||||
//#endif
|
||||
|
||||
@@ -22,11 +22,7 @@
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
#include "zipautobuffer.h"
|
||||
#include "zconf.h"
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
/**
|
||||
The purpose of this structure is to hold the data that allow communication
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
/* zutil.h -- internal interface and configuration of the compression library
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#ifndef _Z_UTIL_H
|
||||
#define _Z_UTIL_H
|
||||
|
||||
#include "hbcomprs.h"
|
||||
|
||||
#ifdef STDC
|
||||
# include <stddef.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef NO_ERRNO_H
|
||||
extern int errno;
|
||||
#else
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef local
|
||||
# define local static
|
||||
#endif
|
||||
/* compile with -Dlocal if your debugger can't find static symbols */
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef uch FAR uchf;
|
||||
typedef unsigned short ush;
|
||||
typedef ush FAR ushf;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
/* (size given to avoid silly warnings with Visual C++) */
|
||||
|
||||
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
||||
|
||||
#define ERR_RETURN(strm,err) \
|
||||
return (strm->msg = (char*)ERR_MSG(err), (err))
|
||||
/* To be used only when the state is known to be valid */
|
||||
|
||||
/* common constants */
|
||||
|
||||
#ifndef DEF_WBITS
|
||||
# define DEF_WBITS MAX_WBITS
|
||||
#endif
|
||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
||||
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#else
|
||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||
#endif
|
||||
/* default memLevel */
|
||||
|
||||
#define STORED_BLOCK 0
|
||||
#define STATIC_TREES 1
|
||||
#define DYN_TREES 2
|
||||
/* The three kinds of block type */
|
||||
|
||||
#define MIN_MATCH 3
|
||||
#define MAX_MATCH 258
|
||||
/* The minimum and maximum match lengths */
|
||||
|
||||
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
|
||||
|
||||
/* target dependencies */
|
||||
|
||||
#ifdef MSDOS
|
||||
# define OS_CODE 0x00
|
||||
# if defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
|
||||
/* Allow compilation with ANSI keywords only enabled */
|
||||
void _Cdecl farfree( void *block );
|
||||
void *_Cdecl farmalloc( unsigned long nbytes );
|
||||
# else
|
||||
# include <alloc.h>
|
||||
# endif
|
||||
# else /* MSC or DJGPP */
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
# define OS_CODE 0x06
|
||||
#endif
|
||||
|
||||
#ifdef WIN32 /* Window 95 & Windows NT */
|
||||
# define OS_CODE 0x0b
|
||||
#endif
|
||||
|
||||
#if defined(VAXC) || defined(VMS)
|
||||
# define OS_CODE 0x02
|
||||
# define F_OPEN(name, mode) \
|
||||
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
|
||||
#endif
|
||||
|
||||
#ifdef AMIGA
|
||||
# define OS_CODE 0x01
|
||||
#endif
|
||||
|
||||
#if defined(ATARI) || defined(atarist)
|
||||
# define OS_CODE 0x05
|
||||
#endif
|
||||
|
||||
#if defined(MACOS) || defined(TARGET_OS_MAC)
|
||||
# define OS_CODE 0x07
|
||||
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
|
||||
# include <unix.h> /* for fdopen */
|
||||
# else
|
||||
# ifndef fdopen
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __50SERIES /* Prime/PRIMOS */
|
||||
# define OS_CODE 0x0F
|
||||
#endif
|
||||
|
||||
#ifdef TOPS20
|
||||
# define OS_CODE 0x0a
|
||||
#endif
|
||||
|
||||
#if defined(_BEOS_) || defined(RISCOS)
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER > 600))
|
||||
# define fdopen(fd,type) _fdopen(fd,type)
|
||||
#endif
|
||||
|
||||
|
||||
/* Common defaults */
|
||||
|
||||
#ifndef OS_CODE
|
||||
# define OS_CODE 0x03 /* assume Unix */
|
||||
#endif
|
||||
|
||||
#ifndef F_OPEN
|
||||
# define F_OPEN(name, mode) fopen((name), (mode))
|
||||
#endif
|
||||
|
||||
/* functions */
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
extern char *strerror OF((int));
|
||||
# define zstrerror(errnum) strerror(errnum)
|
||||
#else
|
||||
# define zstrerror(errnum) ""
|
||||
#endif
|
||||
|
||||
#if defined(pyr)
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
|
||||
/* Use our own functions for small and medium model with MSC <= 5.0.
|
||||
* You may have to use the same strategy for Borland C (untested).
|
||||
* The __SC__ check is for Symantec.
|
||||
*/
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
|
||||
# define HAVE_MEMCPY
|
||||
#endif
|
||||
#ifdef HAVE_MEMCPY
|
||||
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
|
||||
# define zmemcpy _fmemcpy
|
||||
# define zmemcmp _fmemcmp
|
||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||
# else
|
||||
# define zmemcpy memcpy
|
||||
# define zmemcmp memcmp
|
||||
# define zmemzero(dest, len) memset(dest, 0, len)
|
||||
# endif
|
||||
#else
|
||||
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
|
||||
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
|
||||
extern void zmemzero OF((Bytef* dest, uInt len));
|
||||
#endif
|
||||
|
||||
/* Diagnostic functions */
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
extern int z_verbose;
|
||||
extern void z_error OF((char *m));
|
||||
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
|
||||
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
|
||||
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
|
||||
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
|
||||
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
|
||||
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
|
||||
#else
|
||||
# define Assert(cond,msg)
|
||||
# define Trace(x)
|
||||
# define Tracev(x)
|
||||
# define Tracevv(x)
|
||||
# define Tracec(c,x)
|
||||
# define Tracecv(c,x)
|
||||
#endif
|
||||
|
||||
typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, uInt len));
|
||||
|
||||
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
|
||||
void zcfree OF((voidpf opaque, voidpf ptr));
|
||||
|
||||
#define ZALLOC(strm, items, size) (*((strm)->zalloc))((strm)->opaque, (items), (size))
|
||||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
|
||||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
|
||||
|
||||
#endif /* _Z_UTIL_H */
|
||||
@@ -98,7 +98,7 @@ static void ResetAttribs( void )
|
||||
hb_itemRelease( FileToZip );
|
||||
}
|
||||
|
||||
static void UnzipCreateArray( char *szZipFileName, char *szSkleton, int uiOption)
|
||||
static void UnzipCreateArray( char *szSkleton, int uiOption)
|
||||
{
|
||||
int ul;
|
||||
char * szEntry;
|
||||
@@ -713,7 +713,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
{
|
||||
if( HB_IS_STRING( pUnzip ) )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, hb_itemGetCPtr( pUnzip ), 1 );
|
||||
UnzipCreateArray( hb_itemGetCPtr( pUnzip ), 1 );
|
||||
}
|
||||
else if( HB_IS_ARRAY( pUnzip ) )
|
||||
{
|
||||
@@ -726,7 +726,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
|
||||
if ( szUnzip )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, szUnzip, 1 );
|
||||
UnzipCreateArray( szUnzip, 1 );
|
||||
hb_xfree( szUnzip );
|
||||
}
|
||||
}
|
||||
@@ -735,7 +735,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
else
|
||||
{
|
||||
//s.r. change "*.*" to "*" because file without extension were ignored
|
||||
UnzipCreateArray( szZipFileName, (char*) "*", 1 );
|
||||
UnzipCreateArray( (char*) "*", 1 );
|
||||
}
|
||||
if ( hb_arrayLen(UnzipFiles) > 0 )
|
||||
{
|
||||
@@ -802,7 +802,7 @@ HB_FUNC( HB_ZIPDELETEFILES )
|
||||
{
|
||||
if ( hb_itemGetCLen( pDelZip ) > 0 )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, hb_itemGetCPtr( pDelZip ), 2 );
|
||||
UnzipCreateArray( hb_itemGetCPtr( pDelZip ), 2 );
|
||||
}
|
||||
}
|
||||
else if ( HB_IS_ARRAY( pDelZip ) )
|
||||
@@ -820,7 +820,7 @@ HB_FUNC( HB_ZIPDELETEFILES )
|
||||
|
||||
if( szInput )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, szInput, 2 );
|
||||
UnzipCreateArray( szInput, 2 );
|
||||
hb_xfree( szInput );
|
||||
}
|
||||
}
|
||||
@@ -1011,14 +1011,13 @@ HB_FUNC(HB_UNZIPALLFILE)
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC_EXIT(HBZIPCLEANUP)
|
||||
HB_FUNC_EXIT( HBZIPCLEANUP )
|
||||
{
|
||||
if ( ChangeDiskBlock )
|
||||
if( ChangeDiskBlock )
|
||||
{
|
||||
hb_itemRelease( ChangeDiskBlock );
|
||||
ChangeDiskBlock = NULL ;
|
||||
ChangeDiskBlock = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1026,12 +1025,13 @@ HB_FUNC_EXIT(HBZIPCLEANUP)
|
||||
|
||||
int GetFileAttributes( char *szEntry )
|
||||
{
|
||||
struct stat sStat;
|
||||
stat( szEntry, &sStat );
|
||||
return (int) sStat.st_mode;
|
||||
struct stat sStat;
|
||||
stat( szEntry, &sStat );
|
||||
return (int) sStat.st_mode;
|
||||
}
|
||||
void SetFileAttributes( char * szEntry,ULONG ulAttr)
|
||||
{
|
||||
chmod(szEntry,ulAttr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "hbcomprs.h"
|
||||
#include "stdafx.h"
|
||||
#include "ziparchive.h"
|
||||
// #include "ZipPathComponent.h"
|
||||
|
||||
@@ -297,6 +297,35 @@ static int hb_pp_preprocesfile( PHB_PP_STATE pState, char * szRuleFile )
|
||||
return iResult;
|
||||
}
|
||||
|
||||
/* NOTE: Caller should free the pointer. */
|
||||
static char * hb_pp_escapeString( char * szString )
|
||||
{
|
||||
int iPos;
|
||||
int iCountBackslash = 0;
|
||||
int iLen = strlen( szString );
|
||||
int iResult;
|
||||
char * szResult;
|
||||
|
||||
for( iPos = 0; iPos < iLen; iPos++ )
|
||||
{
|
||||
if( szString[ iPos ] == '\\' )
|
||||
++iCountBackslash;
|
||||
}
|
||||
|
||||
szResult = ( char * ) hb_xgrab( iLen + iCountBackslash + 1 );
|
||||
|
||||
for( iPos = 0, iResult = 0; iPos < iLen; iPos++ )
|
||||
{
|
||||
szResult[ iResult++ ] = szString[ iPos ];
|
||||
if( szString[ iPos ] == '\\' )
|
||||
szResult[ iResult++ ] = '\\';
|
||||
}
|
||||
|
||||
szResult[ iResult ] = '\0';
|
||||
|
||||
return szResult;
|
||||
}
|
||||
|
||||
static int hb_pp_generateVerInfo( char * szVerFile, int iSVNID, char * szChangeLogID, char * szLastEntry )
|
||||
{
|
||||
int iResult = 0;
|
||||
@@ -313,6 +342,8 @@ static int hb_pp_generateVerInfo( char * szVerFile, int iSVNID, char * szChangeL
|
||||
}
|
||||
else
|
||||
{
|
||||
char * pszEscaped;
|
||||
|
||||
fprintf( fout, "/*\n * $Id$\n */\n\n/*\n"
|
||||
" * Harbour Project source code:\n"
|
||||
" * Version information and build time switches.\n"
|
||||
@@ -328,29 +359,43 @@ static int hb_pp_generateVerInfo( char * szVerFile, int iSVNID, char * szChangeL
|
||||
fprintf( fout, "\n#define HB_VER_SVNID %d\n", iSVNID );
|
||||
|
||||
if( szChangeLogID )
|
||||
fprintf( fout, "\n#define HB_VER_CHLID \"%s\"\n", szChangeLogID );
|
||||
{
|
||||
pszEscaped = hb_pp_escapeString( szChangeLogID );
|
||||
fprintf( fout, "\n#define HB_VER_CHLID \"%s\"\n", pszEscaped );
|
||||
hb_xfree( pszEscaped );
|
||||
}
|
||||
|
||||
if( szLastEntry )
|
||||
fprintf( fout, "\n#define HB_VER_LENTRY \"%s\"\n", szLastEntry );
|
||||
{
|
||||
pszEscaped = hb_pp_escapeString( szChangeLogID );
|
||||
fprintf( fout, "\n#define HB_VER_LENTRY \"%s\"\n", pszEscaped );
|
||||
hb_xfree( pszEscaped );
|
||||
}
|
||||
|
||||
pszEnv = hb_getenv( "C_USR" );
|
||||
if( pszEnv )
|
||||
{
|
||||
fprintf( fout, "\n#define HB_VER_C_USR \"%s\"\n", pszEnv );
|
||||
pszEscaped = hb_pp_escapeString( pszEnv );
|
||||
fprintf( fout, "\n#define HB_VER_C_USR \"%s\"\n", pszEscaped );
|
||||
hb_xfree( pszEscaped );
|
||||
hb_xfree( pszEnv );
|
||||
}
|
||||
|
||||
pszEnv = hb_getenv( "L_USR" );
|
||||
if( pszEnv )
|
||||
{
|
||||
fprintf( fout, "\n#define HB_VER_L_USR \"%s\"\n", pszEnv );
|
||||
pszEscaped = hb_pp_escapeString( pszEnv );
|
||||
fprintf( fout, "\n#define HB_VER_L_USR \"%s\"\n", pszEscaped );
|
||||
hb_xfree( pszEscaped );
|
||||
hb_xfree( pszEnv );
|
||||
}
|
||||
|
||||
pszEnv = hb_getenv( "PRG_USR" );
|
||||
if( pszEnv )
|
||||
{
|
||||
fprintf( fout, "\n#define HB_VER_PRG_USR \"%s\"\n", pszEnv );
|
||||
pszEscaped = hb_pp_escapeString( pszEnv );
|
||||
fprintf( fout, "\n#define HB_VER_PRG_USR \"%s\"\n", pszEscaped );
|
||||
hb_xfree( pszEscaped );
|
||||
hb_xfree( pszEnv );
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ ROOT = ../../
|
||||
C_SOURCES=\
|
||||
hbppcore.c \
|
||||
hbppcomp.c \
|
||||
hbpptbl.c \
|
||||
pragma.c \
|
||||
hbpptbl.c \
|
||||
hbpragma.c \
|
||||
|
||||
C_MAIN=hbpp.c
|
||||
|
||||
|
||||
Reference in New Issue
Block a user