From 98177ed00b5601992d6680c91e53bd3288d79feb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 22 Jun 2008 08:36:37 +0000 Subject: [PATCH] 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] --- harbour-1.0.0RC1/ChangeLog | 74 + harbour-1.0.0RC1/common.mak | 2 +- harbour-1.0.0RC1/contrib/hbfimage/Makefile | 2 + harbour-1.0.0RC1/contrib/hbtpathy/Makefile | 13 +- harbour-1.0.0RC1/contrib/hbw32ddr/Makefile | 11 +- .../contrib/hbw32ddr/w32_ddrw.cpp | 714 +- harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.h | 67 - harbour-1.0.0RC1/contrib/hbwhat32/Makefile | 8 + harbour-1.0.0RC1/contrib/hbwhat32/commctrl.ch | 6150 +++++------------ harbour-1.0.0RC1/contrib/hbwhat32/commdlg.ch | 665 +- harbour-1.0.0RC1/contrib/hbwhat32/wingdi.ch | 3159 ++++----- harbour-1.0.0RC1/contrib/hbwhat32/wininet.ch | 1520 ++-- harbour-1.0.0RC1/contrib/hbziparch/hbcomprs.c | 4078 +---------- .../contrib/hbziparch/include/hbcomprs.h | 1006 --- .../contrib/hbziparch/include/unzip.h | 4 +- .../contrib/hbziparch/include/zconf.h | 302 - .../contrib/hbziparch/include/zip.h | 5 +- .../contrib/hbziparch/include/ziparchive.h | 4 +- .../hbziparch/include/zipinternalinfo.h | 6 +- .../contrib/hbziparch/include/zutil.h | 218 - harbour-1.0.0RC1/contrib/hbziparch/zip.c | 26 +- .../contrib/hbziparch/ziparchive.cpp | 1 - harbour-1.0.0RC1/source/pp/hbppgen.c | 55 +- harbour-1.0.0RC1/utils/hbpp/Makefile | 4 +- .../utils/hbpp/{pragma.c => hbpragma.c} | 0 25 files changed, 4301 insertions(+), 13793 deletions(-) delete mode 100644 harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.h delete mode 100644 harbour-1.0.0RC1/contrib/hbziparch/include/hbcomprs.h delete mode 100644 harbour-1.0.0RC1/contrib/hbziparch/include/zconf.h delete mode 100644 harbour-1.0.0RC1/contrib/hbziparch/include/zutil.h rename harbour-1.0.0RC1/utils/hbpp/{pragma.c => hbpragma.c} (100%) diff --git a/harbour-1.0.0RC1/ChangeLog b/harbour-1.0.0RC1/ChangeLog index 2c0ce82497..6dd513964e 100644 --- a/harbour-1.0.0RC1/ChangeLog +++ b/harbour-1.0.0RC1/ChangeLog @@ -8,6 +8,80 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +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 diff --git a/harbour-1.0.0RC1/common.mak b/harbour-1.0.0RC1/common.mak index 9897c69d19..349ef3531d 100644 --- a/harbour-1.0.0RC1/common.mak +++ b/harbour-1.0.0RC1/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) \ diff --git a/harbour-1.0.0RC1/contrib/hbfimage/Makefile b/harbour-1.0.0RC1/contrib/hbfimage/Makefile index 5de61606a7..8daf915711 100644 --- a/harbour-1.0.0RC1/contrib/hbfimage/Makefile +++ b/harbour-1.0.0RC1/contrib/hbfimage/Makefile @@ -16,3 +16,5 @@ PRG_HEADERS=\ LIBNAME=hbfimage include $(TOP)$(ROOT)config/lib.cf + +CFLAGS := $(CFLAGS) -D_WINDOWS_ diff --git a/harbour-1.0.0RC1/contrib/hbtpathy/Makefile b/harbour-1.0.0RC1/contrib/hbtpathy/Makefile index 7db0d7044e..0a1e7a419f 100644 --- a/harbour-1.0.0RC1/contrib/hbtpathy/Makefile +++ b/harbour-1.0.0RC1/contrib/hbtpathy/Makefile @@ -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 \ diff --git a/harbour-1.0.0RC1/contrib/hbw32ddr/Makefile b/harbour-1.0.0RC1/contrib/hbw32ddr/Makefile index 5802702a00..90ef254627 100644 --- a/harbour-1.0.0RC1/contrib/hbw32ddr/Makefile +++ b/harbour-1.0.0RC1/contrib/hbw32ddr/Makefile @@ -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 diff --git a/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.cpp b/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.cpp index 2c4932f94e..48b9ea1de1 100644 --- a/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.cpp +++ b/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.cpp @@ -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; + } +} diff --git a/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.h b/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.h deleted file mode 100644 index 1ba2da7430..0000000000 --- a/harbour-1.0.0RC1/contrib/hbw32ddr/w32_ddrw.h +++ /dev/null @@ -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 diff --git a/harbour-1.0.0RC1/contrib/hbwhat32/Makefile b/harbour-1.0.0RC1/contrib/hbwhat32/Makefile index f90d178c64..2ff5d2befe 100644 --- a/harbour-1.0.0RC1/contrib/hbwhat32/Makefile +++ b/harbour-1.0.0RC1/contrib/hbwhat32/Makefile @@ -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 diff --git a/harbour-1.0.0RC1/contrib/hbwhat32/commctrl.ch b/harbour-1.0.0RC1/contrib/hbwhat32/commctrl.ch index 1d2db13401..348ced35c3 100644 --- a/harbour-1.0.0RC1/contrib/hbwhat32/commctrl.ch +++ b/harbour-1.0.0RC1/contrib/hbwhat32/commctrl.ch @@ -2,4268 +2,1888 @@ * $Id$ */ -* Automatically translated from commctrl.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. - - -/*****************************************************************************\ -* * -* commctrl.h - - Interface for the Windows Common Controls * -* * -* Version 1.2 * -* * -* Copyright (c) 1991-1998, Microsoft Corp. All rights reserved. * -* * -\*****************************************************************************/ - - -#ifndef _INC_COMMCTRL - //P_O_Push - #define _INC_COMMCTRL - - #ifndef _HRESULT_DEFINED - #define _HRESULT_DEFINED - #endif // _HRESULT_DEFINED - - // - // Define API decoration for direct importing of DLL references. - // - #ifndef WINCOMMCTRLAPI - #define WINCOMMCTRLAPI - #endif // WINCOMMCTRLAPI - - // - // For compilers that don't support nameless unions - // - #ifndef DUMMYUNIONNAME - #ifdef NONAMELESSUNION - #define DUMMYUNIONNAME u - #define DUMMYUNIONNAME2 u2 - #define DUMMYUNIONNAME3 u3 - #define DUMMYUNIONNAME4 u4 - #define DUMMYUNIONNAME5 u5 - #else - #define DUMMYUNIONNAME - #define DUMMYUNIONNAME2 - #define DUMMYUNIONNAME3 - #define DUMMYUNIONNAME4 - #define DUMMYUNIONNAME5 - #endif - #endif // DUMMYUNIONNAME - - // - // Users of this header may define any number of these constants to avoid - // the definitions of each functional group. - // - // NOTOOLBAR Customizable bitmap-button toolbar control. - // NOUPDOWN Up and Down arrow increment/decrement control. - // NOSTATUSBAR Status bar control. - // NOMENUHELP APIs to help manage menus, especially with a status bar. - // NOTRACKBAR Customizable column-width tracking control. - // NODRAGLIST APIs to make a listbox source and sink drag&drop actions. - // NOPROGRESS Progress gas gauge. - // NOHOTKEY HotKey control - // NOHEADER Header bar control. - // NOIMAGEAPIS ImageList apis. - // NOLISTVIEW ListView control. - // NOTREEVIEW TreeView control. - // NOTABCONTROL Tab control. - // NOANIMATE Animate control. - // - //============================================================================= - - - - // size of this structure - // flags indicating which classes to be initialized - - #define ICC_LISTVIEW_CLASSES 1 // listview, header - #define ICC_TREEVIEW_CLASSES 2 // treeview, tooltips - #define ICC_BAR_CLASSES 4 // toolbar, statusbar, trackbar, tooltips - #define ICC_TAB_CLASSES 8 // tab, tooltips - #define ICC_UPDOWN_CLASS 16 // updown - #define ICC_PROGRESS_CLASS 32 // progress - #define ICC_HOTKEY_CLASS 64 // hotkey - #define ICC_ANIMATE_CLASS 128 // animate - #define ICC_WIN95_CLASSES 255 - #define ICC_DATE_CLASSES 256 // month picker, date picker, time picker, updown - #define ICC_USEREX_CLASSES 512 // comboex - #define ICC_COOL_CLASSES 1024 // rebar (coolbar) control - #define ICC_INTERNET_CLASSES 2048 - #define ICC_PAGESCROLLER_CLASS 4096 // page scroller - #define ICC_NATIVEFNTCTL_CLASS 8192 // native font control - - #define ODT_HEADER 100 - #define ODT_TAB 101 - #define ODT_LISTVIEW 102 - - - //====== Ranges for control message IDs ======================================= - - #define LVM_FIRST 4096 // ListView messages - #define TV_FIRST 4352 // TreeView messages - #define HDM_FIRST 4608 // Header messages - #define TCM_FIRST 4864 // Tab control messages - - #define PGM_FIRST 5120 // Pager control messages - #define CCM_FIRST 8192 // Common control shared messages - #define CCM_LAST (CCM_FIRST + 512) - - - #define CCM_SETBKCOLOR (CCM_FIRST + 1) // lParam is bkColor - - - // highlight color - // shadow color - - - #define CCM_SETCOLORSCHEME (CCM_FIRST + 2) // lParam is color scheme - #define CCM_GETCOLORSCHEME (CCM_FIRST + 3) // fills in COLORSCHEME pointed to by lParam - #define CCM_GETDROPTARGET (CCM_FIRST + 4) - #define CCM_SETUNICODEFORMAT (CCM_FIRST + 5) - #define CCM_GETUNICODEFORMAT (CCM_FIRST + 6) - - #define COMCTL32_VERSION 5 - #define CCM_SETVERSION (CCM_FIRST + 7) - #define CCM_GETVERSION (CCM_FIRST + 8) - #define CCM_SETNOTIFYWINDOW (CCM_FIRST + 9) // wParam == hwndParent. - - // for tooltips - #define INFOTIPSIZE 1024 - - //====== WM_NOTIFY Macros ===================================================== - - #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \ - - #define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \ - - - //====== Generic WM_NOTIFY notification codes ================================= - - #define NM_OUTOFMEMORY (NM_FIRST-1) - #define NM_CLICK (NM_FIRST-2) // uses NMCLICK struct - #define NM_DBLCLK (NM_FIRST-3) - #define NM_RETURN (NM_FIRST-4) - #define NM_RCLICK (NM_FIRST-5) // uses NMCLICK struct - #define NM_RDBLCLK (NM_FIRST-6) - #define NM_SETFOCUS (NM_FIRST-7) - #define NM_KILLFOCUS (NM_FIRST-8) - #define NM_CUSTOMDRAW (NM_FIRST-12) - #define NM_HOVER (NM_FIRST-13) - #define NM_NCHITTEST (NM_FIRST-14) // uses NMMOUSE struct - #define NM_KEYDOWN (NM_FIRST-15) // uses NMKEY struct - #define NM_RELEASEDCAPTURE (NM_FIRST-16) - #define NM_SETCURSOR (NM_FIRST-17) // uses NMMOUSE struct - #define NM_CHAR (NM_FIRST-18) // uses NMCHAR struct - #define NM_TOOLTIPSCREATED (NM_FIRST-19) // notify of when the tooltips window is create - #define NM_LDOWN (NM_FIRST-20) - #define NM_RDOWN (NM_FIRST-21) - - #ifndef CCSIZEOF_STRUCT - #define CCSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member)) - #endif - - //====== Generic WM_NOTIFY notification structures ============================ - - //====== WM_NOTIFY codes (NMHDR.code values) ================================== - - #define NM_FIRST (0U- 0U) // generic to all controls - #define NM_LAST (0U- 99U) - - #define LVN_FIRST (0U-100U) // listview - #define LVN_LAST (0U-199U) - - // Property sheet reserved (0U-200U) - (0U-299U) - see prsht.h - - #define HDN_FIRST (0U-300U) // header - #define HDN_LAST (0U-399U) - - #define TVN_FIRST (0U-400U) // treeview - #define TVN_LAST (0U-499U) - - #define TTN_FIRST (0U-520U) // tooltips - #define TTN_LAST (0U-549U) - - #define TCN_FIRST (0U-550U) // tab control - #define TCN_LAST (0U-580U) - - // Shell reserved (0U-580U) - (0U-589U) - - #define CDN_FIRST (0U-601U) // common dialog (new) - #define CDN_LAST (0U-699U) - - #define TBN_FIRST (0U-700U) // toolbar - #define TBN_LAST (0U-720U) - - #define UDN_FIRST (0U-721) // updown - #define UDN_LAST (0U-740) - #define MCN_FIRST (0U-750U) // monthcal - #define MCN_LAST (0U-759U) - - #define DTN_FIRST (0U-760U) // datetimepick - #define DTN_LAST (0U-799U) - - #define CBEN_FIRST (0U-800U) // combo box ex - #define CBEN_LAST (0U-830U) - - #define RBN_FIRST (0U-831U) // rebar - #define RBN_LAST (0U-859U) - - #define IPN_FIRST (0U-860U) // internet address - #define IPN_LAST (0U-879U) // internet address - - #define SBN_FIRST (0U-880U) // status bar - #define SBN_LAST (0U-899U) - - #define PGN_FIRST (0U-900U) // Pager Control - #define PGN_LAST (0U-950U) - - - #ifndef WMN_FIRST - #define WMN_FIRST (0U-1000U) - #define WMN_LAST (0U-1200U) - #endif - - #define MSGF_COMMCTRL_BEGINDRAG 16896 - #define MSGF_COMMCTRL_SIZEHEADER 16897 - #define MSGF_COMMCTRL_DRAGSELECT 16898 - #define MSGF_COMMCTRL_TOOLBARCUST 16899 - - //==================== CUSTOM DRAW ========================================== - - - // custom draw return flags - // values under 0x00010000 are reserved for global custom draw values. - // above that are for specific controls - #define CDRF_DODEFAULT 0x00000000 - #define CDRF_NEWFONT 0x00000002 - #define CDRF_SKIPDEFAULT 0x00000004 - - - #define CDRF_NOTIFYPOSTPAINT 16 - #define CDRF_NOTIFYITEMDRAW 32 - #define CDRF_NOTIFYSUBITEMDRAW 32 // flags are the same, we can distinguish by context - #define CDRF_NOTIFYPOSTERASE 64 - - // drawstage flags - // values under 0x00010000 are reserved for global custom draw values. - // above that are for specific controls - #define CDDS_PREPAINT 1 - #define CDDS_POSTPAINT 2 - #define CDDS_PREERASE 3 - #define CDDS_POSTERASE 4 - // the 0x000010000 bit means it's individual item specific - #define CDDS_ITEM 65536 - #define CDDS_ITEMPREPAINT (CDDS_ITEM + CDDS_PREPAINT) - #define CDDS_ITEMPOSTPAINT (CDDS_ITEM + CDDS_POSTPAINT) - #define CDDS_ITEMPREERASE (CDDS_ITEM + CDDS_PREERASE) - #define CDDS_ITEMPOSTERASE (CDDS_ITEM + CDDS_POSTERASE) - #define CDDS_SUBITEM 131072 - - - // itemState flags - #define CDIS_SELECTED 1 - #define CDIS_GRAYED 2 - #define CDIS_DISABLED 4 - #define CDIS_CHECKED 8 - #define CDIS_FOCUS 16 - #define CDIS_DEFAULT 32 - #define CDIS_HOT 64 - #define CDIS_MARKED 128 - #define CDIS_INDETERMINATE 256 - - - // this is control specific, but it's how to specify an item. valid only with CDDS_ITEM bit set - - - - - //====== IMAGE APIS =========================================================== - - #ifndef NOIMAGEAPIS - - #define CLR_NONE 4294967295 - #define CLR_DEFAULT 4278190080 - - - - #define ILC_MASK 1 - #define ILC_COLOR 0 - #define ILC_COLORDDB 254 - #define ILC_COLOR4 4 - #define ILC_COLOR8 8 - #define ILC_COLOR16 16 - #define ILC_COLOR24 24 - #define ILC_COLOR32 32 - #define ILC_PALETTE 2048 // (not implemented) - - - - //#define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon) - - #define ILD_NORMAL 0 - #define ILD_TRANSPARENT 1 - #define ILD_MASK 16 - #define ILD_IMAGE 32 - #define ILD_ROP 64 - #define ILD_BLEND25 2 - #define ILD_BLEND50 4 - #define ILD_OVERLAYMASK 3840 - #define INDEXTOOVERLAYMASK(i) ((i) << 8) - - #define ILD_SELECTED ILD_BLEND50 - #define ILD_FOCUS ILD_BLEND25 - #define ILD_BLEND ILD_BLEND50 - #define CLR_HILIGHT CLR_DEFAULT - - - - #ifdef UNICODE - #define ImageList_LoadImage ImageList_LoadImageW - #else - #define ImageList_LoadImage ImageList_LoadImageA - #endif - - #define ILCF_MOVE ( 0) - #define ILCF_SWAP ( 1) - - - #define ImageList_RemoveAll(himl) ImageList_Remove(himl, -1) - #define ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0) - #define ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0) - #endif - - //====== HEADER CONTROL ======================================================= - - #ifndef NOHEADER - - #define WC_HEADERA "SysHeader32" - #define WC_HEADERW L"SysHeader32" - - #ifdef UNICODE - #define WC_HEADER WC_HEADERW - #else - #define WC_HEADER WC_HEADERA - #endif - - // begin_r_commctrl - - #define HDS_HORZ 0 - #define HDS_BUTTONS 2 - #define HDS_HOTTRACK 4 - #define HDS_HIDDEN 8 - - #define HDS_DRAGDROP 64 - #define HDS_FULLDRAG 128 - #define HDS_FILTERBAR 256 - - // end_r_commctrl - - - #define HDFT_ISSTRING 0 // HD_ITEM.pvFilter points to a HD_TEXTFILTER - #define HDFT_ISNUMBER 1 // HD_ITEM.pvFilter points to a INT - - #define HDFT_HASNOVALUE 32768 // clear the filter, by setting this bit - - #ifdef UNICODE - #define HD_TEXTFILTER HD_TEXTFILTERW - #define HDTEXTFILTER HD_TEXTFILTERW - #define LPHD_TEXTFILTER LPHD_TEXTFILTERW - #define LPHDTEXTFILTER LPHD_TEXTFILTERW - #else - #define HD_TEXTFILTER HD_TEXTFILTERA - #define HDTEXTFILTER HD_TEXTFILTERA - #define LPHD_TEXTFILTER LPHD_TEXTFILTERA - #define LPHDTEXTFILTER LPHD_TEXTFILTERA - #endif - - - - //#define HDITEMW HD_ITEMW - //#define HDITEMA HD_ITEMA - //#define HD_ITEM HDITEM - - - #define HDITEMA_V1_SIZE CCSIZEOF_STRUCT(HDITEMA, lParam) - #define HDITEMW_V1_SIZE CCSIZEOF_STRUCT(HDITEMW, lParam) - - - //#ifdef UNICODE - //#define HDITEM HDITEMW - //#define LPHDITEM LPHDITEMW - //#define HDITEM_V1_SIZE HDITEMW_V1_SIZE - //#else - //#define HDITEM HDITEMA - //#define LPHDITEM LPHDITEMA - //#define HDITEM_V1_SIZE HDITEMA_V1_SIZE - //#endif - - - #define HDI_WIDTH 1 - #define HDI_HEIGHT HDI_WIDTH - #define HDI_TEXT 2 - #define HDI_FORMAT 4 - #define HDI_LPARAM 8 - #define HDI_BITMAP 16 - #define HDI_IMAGE 32 - #define HDI_DI_SETITEM 64 - #define HDI_ORDER 128 - #define HDI_FILTER 256 - - #define HDF_LEFT 0 - #define HDF_RIGHT 1 - #define HDF_CENTER 2 - #define HDF_JUSTIFYMASK 3 - #define HDF_RTLREADING 4 - - #define HDF_OWNERDRAW 32768 - #define HDF_STRING 16384 - #define HDF_BITMAP 8192 - #define HDF_BITMAP_ON_RIGHT 4096 - #define HDF_IMAGE 2048 - - #define HDM_GETITEMCOUNT (HDM_FIRST + 0) - //#define Header_GetItemCount(hwndHD) \ - - - #define HDM_INSERTITEMA (HDM_FIRST + 1) - #define HDM_INSERTITEMW (HDM_FIRST + 10) - - #ifdef UNICODE - #define HDM_INSERTITEM HDM_INSERTITEMW - #else - #define HDM_INSERTITEM HDM_INSERTITEMA - #endif - - //#define Header_InsertItem(hwndHD, i, phdi) \ - - - #define HDM_DELETEITEM (HDM_FIRST + 2) - //#define Header_DeleteItem(hwndHD, i) \ - - - #define HDM_GETITEMA (HDM_FIRST + 3) - #define HDM_GETITEMW (HDM_FIRST + 11) - - #ifdef UNICODE - #define HDM_GETITEM HDM_GETITEMW - #else - #define HDM_GETITEM HDM_GETITEMA - #endif - - //#define Header_GetItem(hwndHD, i, phdi) \ - - - #define HDM_SETITEMA (HDM_FIRST + 4) - #define HDM_SETITEMW (HDM_FIRST + 12) - - #ifdef UNICODE - #define HDM_SETITEM HDM_SETITEMW - #else - #define HDM_SETITEM HDM_SETITEMA - #endif - - //#define Header_SetItem(hwndHD, i, phdi) \ - - - #define HD_LAYOUT HDLAYOUT - - - #define HDM_LAYOUT (HDM_FIRST + 5) - //#define Header_Layout(hwndHD, playout) \ - - - #define HHT_NOWHERE 1 - #define HHT_ONHEADER 2 - #define HHT_ONDIVIDER 4 - #define HHT_ONDIVOPEN 8 - #define HHT_ONFILTER 16 - #define HHT_ONFILTERBUTTON 32 - #define HHT_ABOVE 256 - #define HHT_BELOW 512 - #define HHT_TORIGHT 1024 - #define HHT_TOLEFT 2048 - - #define HD_HITTESTINFO HDHITTESTINFO - - - #define HDM_HITTEST (HDM_FIRST + 6) - - - #define HDM_GETITEMRECT (HDM_FIRST + 7) - //#define Header_GetItemRect(hwnd, iItem, lprc) \ - - - #define HDM_SETIMAGELIST (HDM_FIRST + 8) - ////#define Header_SetImageList(hwnd, himl) \ - - - #define HDM_GETIMAGELIST (HDM_FIRST + 9) - //#define Header_GetImageList(hwnd) \ - - - #define HDM_ORDERTOINDEX (HDM_FIRST + 15) - //#define Header_OrderToIndex(hwnd, i) \ - - - #define HDM_CREATEDRAGIMAGE (HDM_FIRST + 16) // wparam = which item (by index) - //#define Header_CreateDragImage(hwnd, i) \ - - - #define HDM_GETORDERARRAY (HDM_FIRST + 17) - //#define Header_GetOrderArray(hwnd, iCount, lpi) \ - - - #define HDM_SETORDERARRAY (HDM_FIRST + 18) - //#define Header_SetOrderArray(hwnd, iCount, lpi) \ - - // lparam = int array of size HDM_GETITEMCOUNT - // the array specifies the order that all items should be displayed. - // e.g. { 2, 0, 1} - // says the index 2 item should be shown in the 0ths position - // index 0 should be shown in the 1st position - // index 1 should be shown in the 2nd position - - - #define HDM_SETHOTDIVIDER (HDM_FIRST + 19) - //#define Header_SetHotDivider(hwnd, fPos, dw) \ - - // convenience message for external dragdrop - // wParam = BOOL specifying whether the lParam is a dwPos of the cursor - // position or the index of which divider to hotlight - // lParam = depends on wParam (-1 and wParm = FALSE turns off hotlight) - - - #define HDM_SETBITMAPMARGIN (HDM_FIRST + 20) - //#define Header_SetBitmapMargin(hwnd, iWidth) \ - - - #define HDM_GETBITMAPMARGIN (HDM_FIRST + 21) - //#define Header_GetBitmapMargin(hwnd) \ - - - - #define HDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - //#define Header_SetUnicodeFormat(hwnd, fUnicode) \ - - - #define HDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - //#define Header_GetUnicodeFormat(hwnd) \ - - - #define HDM_SETFILTERCHANGETIMEOUT (HDM_FIRST+22) - //#define Header_SetFilterChangeTimeout(hwnd, i) \ - - - #define HDM_EDITFILTER (HDM_FIRST+23) - //#define Header_EditFilter(hwnd, i, fDiscardChanges) \ - - - // Clear filter takes -1 as a column value to indicate that all - // the filter should be cleared. When this happens you will - // only receive a single filter changed notification. - - #define HDM_CLEARFILTER (HDM_FIRST+24) - //#define Header_ClearFilter(hwnd, i) \ - - //#define Header_ClearAllFilters(hwnd) \ - - - #define HDN_ITEMCHANGINGA (HDN_FIRST-0) - #define HDN_ITEMCHANGINGW (HDN_FIRST-20) - #define HDN_ITEMCHANGEDA (HDN_FIRST-1) - #define HDN_ITEMCHANGEDW (HDN_FIRST-21) - #define HDN_ITEMCLICKA (HDN_FIRST-2) - #define HDN_ITEMCLICKW (HDN_FIRST-22) - #define HDN_ITEMDBLCLICKA (HDN_FIRST-3) - #define HDN_ITEMDBLCLICKW (HDN_FIRST-23) - #define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5) - #define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25) - #define HDN_BEGINTRACKA (HDN_FIRST-6) - #define HDN_BEGINTRACKW (HDN_FIRST-26) - #define HDN_ENDTRACKA (HDN_FIRST-7) - #define HDN_ENDTRACKW (HDN_FIRST-27) - #define HDN_TRACKA (HDN_FIRST-8) - #define HDN_TRACKW (HDN_FIRST-28) - #define HDN_GETDISPINFOA (HDN_FIRST-9) - #define HDN_GETDISPINFOW (HDN_FIRST-29) - #define HDN_BEGINDRAG (HDN_FIRST-10) - #define HDN_ENDDRAG (HDN_FIRST-11) - #define HDN_FILTERCHANGE (HDN_FIRST-12) - #define HDN_FILTERBTNCLICK (HDN_FIRST-13) - - #ifdef UNICODE - #define HDN_ITEMCHANGING HDN_ITEMCHANGINGW - #define HDN_ITEMCHANGED HDN_ITEMCHANGEDW - #define HDN_ITEMCLICK HDN_ITEMCLICKW - #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW - #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW - #define HDN_BEGINTRACK HDN_BEGINTRACKW - #define HDN_ENDTRACK HDN_ENDTRACKW - #define HDN_TRACK HDN_TRACKW - #define HDN_GETDISPINFO HDN_GETDISPINFOW - #else - #define HDN_ITEMCHANGING HDN_ITEMCHANGINGA - #define HDN_ITEMCHANGED HDN_ITEMCHANGEDA - #define HDN_ITEMCLICK HDN_ITEMCLICKA - #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA - #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA - #define HDN_BEGINTRACK HDN_BEGINTRACKA - #define HDN_ENDTRACK HDN_ENDTRACKA - #define HDN_TRACK HDN_TRACKA - #define HDN_GETDISPINFO HDN_GETDISPINFOA - #endif - - - //#define HD_NOTIFYA NMHEADERA - //#define HD_NOTIFYW NMHEADERW - #define HD_NOTIFY NMHEADER - - - //#ifdef UNICODE - //#define NMHEADER NMHEADERW - //#define LPNMHEADER LPNMHEADERW - //#else - //#define NMHEADER NMHEADERA - //#define LPNMHEADER LPNMHEADERA - //#endif - - - #ifdef UNICODE - #define NMHDDISPINFO NMHDDISPINFOW - #define LPNMHDDISPINFO LPNMHDDISPINFOW - #else - #define NMHDDISPINFO NMHDDISPINFOA - #define LPNMHDDISPINFO LPNMHDDISPINFOA - #endif - - #endif // NOHEADER - - - //====== TOOLBAR CONTROL ====================================================== - - #ifndef NOTOOLBAR - - #ifdef _WIN32 - #define TOOLBARCLASSNAMEW L"ToolbarWindow32" - #define TOOLBARCLASSNAMEA "ToolbarWindow32" - - #ifdef UNICODE - #define TOOLBARCLASSNAME TOOLBARCLASSNAMEW - #else - #define TOOLBARCLASSNAME TOOLBARCLASSNAMEA - #endif - - #else - #define TOOLBARCLASSNAME "ToolbarWindow" - #endif - - - - #define CMB_MASKED 2 - #define TBSTATE_CHECKED 1 - #define TBSTATE_PRESSED 2 - #define TBSTATE_ENABLED 4 - #define TBSTATE_HIDDEN 8 - #define TBSTATE_INDETERMINATE 16 - #define TBSTATE_WRAP 32 - #define TBSTATE_ELLIPSES 64 - #define TBSTATE_MARKED 128 - - #define TBSTYLE_BUTTON 0 // obsolete; use BTNS_BUTTON instead - #define TBSTYLE_SEP 1 // obsolete; use BTNS_SEP instead - #define TBSTYLE_CHECK 2 // obsolete; use BTNS_CHECK instead - #define TBSTYLE_GROUP 4 // obsolete; use BTNS_GROUP instead - #define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP + TBSTYLE_CHECK) // obsolete; use BTNS_CHECKGROUP instead - #define TBSTYLE_DROPDOWN 8 // obsolete; use BTNS_DROPDOWN instead - #define TBSTYLE_AUTOSIZE 16 // obsolete; use BTNS_AUTOSIZE instead - #define TBSTYLE_NOPREFIX 32 // obsolete; use BTNS_NOPREFIX instead - - #define TBSTYLE_TOOLTIPS 256 - #define TBSTYLE_WRAPABLE 512 - #define TBSTYLE_ALTDRAG 1024 - #define TBSTYLE_FLAT 2048 - #define TBSTYLE_LIST 4096 - #define TBSTYLE_CUSTOMERASE 8192 - #define TBSTYLE_REGISTERDROP 16384 - #define TBSTYLE_TRANSPARENT 32768 - #define TBSTYLE_EX_DRAWDDARROWS 1 - - #define BTNS_BUTTON TBSTYLE_BUTTON // 0x0000 - #define BTNS_SEP TBSTYLE_SEP // 0x0001 - #define BTNS_CHECK TBSTYLE_CHECK // 0x0002 - #define BTNS_GROUP TBSTYLE_GROUP // 0x0004 - #define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP // (TBSTYLE_GROUP | TBSTYLE_CHECK) - #define BTNS_DROPDOWN TBSTYLE_DROPDOWN // 0x0008 - #define BTNS_AUTOSIZE TBSTYLE_AUTOSIZE // 0x0010; automatically calculate the cx of the button - #define BTNS_NOPREFIX TBSTYLE_NOPREFIX // 0x0020; this button should not have accel prefix - #define BTNS_SHOWTEXT 64 // ignored unless TBSTYLE_EX_MIXEDBUTTONS is set - #define BTNS_WHOLEDROPDOWN 128 // draw drop-down arrow, but without split arrow section - - #define TBSTYLE_EX_MIXEDBUTTONS 8 - #define TBSTYLE_EX_HIDECLIPPEDBUTTONS 16 // don't show partially obscured buttons - - - // Custom Draw Structure - - - // For drawing lines on buttons - // For drawing lines on buttons - - // Color of text - // Color of text bk when marked. (only if TBSTATE_MARKED) - // Color of text when highlighted - // Background of the button - // 3D highlight - // In conjunction with fHighlightHotTrack - // will cause button to highlight like a menu - // Rect for text - - - // Toolbar custom draw return flags - #define TBCDRF_NOEDGES 65536 // Don't draw button edges - #define TBCDRF_HILITEHOTTRACK 131072 // Use color of the button bk when hottracked - #define TBCDRF_NOOFFSET 262144 // Don't offset button if pressed - #define TBCDRF_NOMARK 524288 // Don't draw default highlight of image/text for TBSTATE_MARKED - #define TBCDRF_NOETCHEDEFFECT 1048576 // Don't draw etched effect for disabled items - - #define TBCDRF_BLENDICON 2097152 // Use ILD_BLEND50 on the icon image - - - #define TB_ENABLEBUTTON (WM_USER + 1) - #define TB_CHECKBUTTON (WM_USER + 2) - #define TB_PRESSBUTTON (WM_USER + 3) - #define TB_HIDEBUTTON (WM_USER + 4) - #define TB_INDETERMINATE (WM_USER + 5) - #define TB_MARKBUTTON (WM_USER + 6) - #define TB_ISBUTTONENABLED (WM_USER + 9) - #define TB_ISBUTTONCHECKED (WM_USER + 10) - #define TB_ISBUTTONPRESSED (WM_USER + 11) - #define TB_ISBUTTONHIDDEN (WM_USER + 12) - #define TB_ISBUTTONINDETERMINATE (WM_USER + 13) - #define TB_ISBUTTONHIGHLIGHTED (WM_USER + 14) - #define TB_SETSTATE (WM_USER + 17) - #define TB_GETSTATE (WM_USER + 18) - #define TB_ADDBITMAP (WM_USER + 19) - - - #define HINST_COMMCTRL ((HINSTANCE)-1) - #define IDB_STD_SMALL_COLOR 0 - #define IDB_STD_LARGE_COLOR 1 - #define IDB_VIEW_SMALL_COLOR 4 - #define IDB_VIEW_LARGE_COLOR 5 - #define IDB_HIST_SMALL_COLOR 8 - #define IDB_HIST_LARGE_COLOR 9 - - // icon indexes for standard bitmap - - #define STD_CUT 0 - #define STD_COPY 1 - #define STD_PASTE 2 - #define STD_UNDO 3 - #define STD_REDOW 4 - #define STD_DELETE 5 - #define STD_FILENEW 6 - #define STD_FILEOPEN 7 - #define STD_FILESAVE 8 - #define STD_PRINTPRE 9 - #define STD_PROPERTIES 10 - #define STD_HELP 11 - #define STD_FIND 12 - #define STD_REPLACE 13 - #define STD_PRINT 14 - - // icon indexes for standard view bitmap - - #define VIEW_LARGEICONS 0 - #define VIEW_SMALLICONS 1 - #define VIEW_LIST 2 - #define VIEW_DETAILS 3 - #define VIEW_SORTNAME 4 - #define VIEW_SORTSIZE 5 - #define VIEW_SORTDATE 6 - #define VIEW_SORTTYPE 7 - #define VIEW_PARENTFOLDER 8 - #define VIEW_NETCONNECT 9 - #define VIEW_NETDISCONNECT 10 - #define VIEW_NEWFOLDER 11 - #define VIEW_VIEWMENU 12 - - #define HIST_BACK 0 - #define HIST_FORWARD 1 - #define HIST_FAVORITES 2 - #define HIST_ADDTOFAVORITES 3 - #define HIST_VIEWTREE 4 - - #define TB_ADDBUTTONSA (WM_USER + 20) - #define TB_INSERTBUTTONA (WM_USER + 21) - - #define TB_DELETEBUTTON (WM_USER + 22) - #define TB_GETBUTTON (WM_USER + 23) - #define TB_BUTTONCOUNT (WM_USER + 24) - #define TB_COMMANDTOINDEX (WM_USER + 25) - - - - #ifdef UNICODE - #define TBSAVEPARAMS TBSAVEPARAMSW - #define LPTBSAVEPARAMS LPTBSAVEPARAMSW - #else - #define TBSAVEPARAMS TBSAVEPARAMSA - #define LPTBSAVEPARAMS LPTBSAVEPARAMSA - #endif - - - #define TB_SAVERESTOREA (WM_USER + 26) - #define TB_SAVERESTOREW (WM_USER + 76) - #define TB_CUSTOMIZE (WM_USER + 27) - #define TB_ADDSTRINGA (WM_USER + 28) - #define TB_ADDSTRINGW (WM_USER + 77) - #define TB_GETITEMRECT (WM_USER + 29) - #define TB_BUTTONSTRUCTSIZE (WM_USER + 30) - #define TB_SETBUTTONSIZE (WM_USER + 31) - #define TB_SETBITMAPSIZE (WM_USER + 32) - #define TB_AUTOSIZE (WM_USER + 33) - #define TB_GETTOOLTIPS (WM_USER + 35) - #define TB_SETTOOLTIPS (WM_USER + 36) - #define TB_SETPARENT (WM_USER + 37) - #define TB_SETROWS (WM_USER + 39) - #define TB_GETROWS (WM_USER + 40) - #define TB_SETCMDID (WM_USER + 42) - #define TB_CHANGEBITMAP (WM_USER + 43) - #define TB_GETBITMAP (WM_USER + 44) - #define TB_GETBUTTONTEXTA (WM_USER + 45) - #define TB_GETBUTTONTEXTW (WM_USER + 75) - #define TB_REPLACEBITMAP (WM_USER + 46) - #define TB_SETINDENT (WM_USER + 47) - #define TB_SETIMAGELIST (WM_USER + 48) - #define TB_GETIMAGELIST (WM_USER + 49) - #define TB_LOADIMAGES (WM_USER + 50) - #define TB_GETRECT (WM_USER + 51) // wParam is the Cmd instead of index - #define TB_SETHOTIMAGELIST (WM_USER + 52) - #define TB_GETHOTIMAGELIST (WM_USER + 53) - #define TB_SETDISABLEDIMAGELIST (WM_USER + 54) - #define TB_GETDISABLEDIMAGELIST (WM_USER + 55) - #define TB_SETSTYLE (WM_USER + 56) - #define TB_GETSTYLE (WM_USER + 57) - #define TB_GETBUTTONSIZE (WM_USER + 58) - #define TB_SETBUTTONWIDTH (WM_USER + 59) - #define TB_SETMAXTEXTROWS (WM_USER + 60) - #define TB_GETTEXTROWS (WM_USER + 61) - - #ifdef UNICODE - #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW - #define TB_SAVERESTORE TB_SAVERESTOREW - #define TB_ADDSTRING TB_ADDSTRINGW - #else - #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA - #define TB_SAVERESTORE TB_SAVERESTOREA - #define TB_ADDSTRING TB_ADDSTRINGA - #endif - - #define TB_GETOBJECT (WM_USER + 62) // wParam == IID, lParam void **ppv - #define TB_GETHOTITEM (WM_USER + 71) - #define TB_SETHOTITEM (WM_USER + 72) // wParam == iHotItem - #define TB_SETANCHORHIGHLIGHT (WM_USER + 73) // wParam == TRUE/FALSE - #define TB_GETANCHORHIGHLIGHT (WM_USER + 74) - #define TB_MAPACCELERATORA (WM_USER + 78) // wParam == ch, lParam int * pidBtn - - - #define TBIMHT_AFTER 1 // TRUE = insert After iButton, otherwise before - #define TBIMHT_BACKGROUND 2 // TRUE iff missed buttons completely - - #define TB_GETINSERTMARK (WM_USER + 79) // lParam == LPTBINSERTMARK - #define TB_SETINSERTMARK (WM_USER + 80) // lParam == LPTBINSERTMARK - #define TB_INSERTMARKHITTEST (WM_USER + 81) // wParam == LPPOINT lParam == LPTBINSERTMARK - #define TB_MOVEBUTTON (WM_USER + 82) - #define TB_GETMAXSIZE (WM_USER + 83) // lParam == LPSIZE - #define TB_SETEXTENDEDSTYLE (WM_USER + 84) // For TBSTYLE_EX_* - #define TB_GETEXTENDEDSTYLE (WM_USER + 85) // For TBSTYLE_EX_* - #define TB_GETPADDING (WM_USER + 86) - #define TB_SETPADDING (WM_USER + 87) - #define TB_SETINSERTMARKCOLOR (WM_USER + 88) - #define TB_GETINSERTMARKCOLOR (WM_USER + 89) - - #define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParam is color scheme - #define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME // fills in COLORSCHEME pointed to by lParam - - #define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - - #define TB_MAPACCELERATORW (WM_USER + 90) // wParam == ch, lParam int * pidBtn - #ifdef UNICODE - #define TB_MAPACCELERATOR TB_MAPACCELERATORW - #else - #define TB_MAPACCELERATOR TB_MAPACCELERATORA - #endif - - #define TBBF_LARGE 1 - - #define TB_GETBITMAPFLAGS (WM_USER + 41) - - #define TBIF_IMAGE 1 - #define TBIF_TEXT 2 - #define TBIF_STATE 4 - #define TBIF_STYLE 8 - #define TBIF_LPARAM 16 - #define TBIF_COMMAND 32 - #define TBIF_SIZE 64 - - #define TBIF_BYINDEX 2147483648 // this specifies that the wparam in Get/SetButtonInfo is an index, not id - - - #ifdef UNICODE - #define TBBUTTONINFO TBBUTTONINFOW - #define LPTBBUTTONINFO LPTBBUTTONINFOW - #else - #define TBBUTTONINFO TBBUTTONINFOA - #define LPTBBUTTONINFO LPTBBUTTONINFOA - #endif - - - // BUTTONINFO APIs do NOT support the string pool. - #define TB_GETBUTTONINFOW (WM_USER + 63) - #define TB_SETBUTTONINFOW (WM_USER + 64) - #define TB_GETBUTTONINFOA (WM_USER + 65) - #define TB_SETBUTTONINFOA (WM_USER + 66) - #ifdef UNICODE - #define TB_GETBUTTONINFO TB_GETBUTTONINFOW - #define TB_SETBUTTONINFO TB_SETBUTTONINFOW - #else - #define TB_GETBUTTONINFO TB_GETBUTTONINFOA - #define TB_SETBUTTONINFO TB_SETBUTTONINFOA - #endif - - - #define TB_INSERTBUTTONW (WM_USER + 67) - #define TB_ADDBUTTONSW (WM_USER + 68) - - #define TB_HITTEST (WM_USER + 69) - - // New post Win95/NT4 for InsertButton and AddButton. if iString member - // is a pointer to a string, it will be handled as a string like listview - // (although LPSTR_TEXTCALLBACK is not supported). - #ifdef UNICODE - #define TB_INSERTBUTTON TB_INSERTBUTTONW - #define TB_ADDBUTTONS TB_ADDBUTTONSW - #else - #define TB_INSERTBUTTON TB_INSERTBUTTONA - #define TB_ADDBUTTONS TB_ADDBUTTONSA - #endif - - #define TB_SETDRAWTEXTFLAGS (WM_USER + 70) // wParam == mask lParam == bit values - - #define TB_GETSTRINGW (WM_USER + 91) - #define TB_GETSTRINGA (WM_USER + 92) - #ifdef UNICODE - #define TB_GETSTRING TB_GETSTRINGW - #else - #define TB_GETSTRING TB_GETSTRINGA - #endif - - - - - #define TBN_GETBUTTONINFOA (TBN_FIRST-0) - #define TBN_BEGINDRAG (TBN_FIRST-1) - #define TBN_ENDDRAG (TBN_FIRST-2) - #define TBN_BEGINADJUST (TBN_FIRST-3) - #define TBN_ENDADJUST (TBN_FIRST-4) - #define TBN_RESET (TBN_FIRST-5) - #define TBN_QUERYINSERT (TBN_FIRST-6) - #define TBN_QUERYDELETE (TBN_FIRST-7) - #define TBN_TOOLBARCHANGE (TBN_FIRST-8) - #define TBN_CUSTHELP (TBN_FIRST-9) - #define TBN_DROPDOWN (TBN_FIRST - 10) - #define TBN_GETOBJECT (TBN_FIRST - 12) - - // Structure for TBN_HOTITEMCHANGE notification - // - - - // HICF_* - - - // Hot item change flags - #define HICF_OTHER 0 - #define HICF_MOUSE 1 // Triggered by mouse - #define HICF_ARROWKEYS 2 // Triggered by arrow keys - #define HICF_ACCELERATOR 4 // Triggered by accelerator - #define HICF_DUPACCEL 8 // This accelerator is not unique - #define HICF_ENTERING 16 // idOld is invalid - #define HICF_LEAVING 32 // idNew is invalid - #define HICF_RESELECT 64 // hot item reselected - #define HICF_LMOUSE 128 // left mouse button selected - #define HICF_TOGGLEDROPDOWN 256 // Toggle button's dropdown state - - - #define TBN_HOTITEMCHANGE (TBN_FIRST - 13) - #define TBN_DRAGOUT (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button - #define TBN_DELETINGBUTTON (TBN_FIRST - 15) // uses TBNOTIFY - #define TBN_GETDISPINFOA (TBN_FIRST - 16) // This is sent when the toolbar needs some display information - #define TBN_GETDISPINFOW (TBN_FIRST - 17) // This is sent when the toolbar needs some display information - #define TBN_GETINFOTIPA (TBN_FIRST - 18) - #define TBN_GETINFOTIPW (TBN_FIRST - 19) - #define TBN_GETBUTTONINFOW (TBN_FIRST - 20) - #define TBN_RESTORE (TBN_FIRST - 21) - #define TBN_SAVE (TBN_FIRST - 22) - #define TBN_INITCUSTOMIZE (TBN_FIRST - 23) - #define TBNRF_HIDEHELP 1 - #define TBNRF_ENDCUSTOMIZE 2 - - - - #ifdef UNICODE - #define TBN_GETINFOTIP TBN_GETINFOTIPW - #define NMTBGETINFOTIP NMTBGETINFOTIPW - #define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW - #else - #define TBN_GETINFOTIP TBN_GETINFOTIPA - #define NMTBGETINFOTIP NMTBGETINFOTIPA - #define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA - #endif - - #define TBNF_IMAGE 1 - #define TBNF_TEXT 2 - #define TBNF_DI_SETITEM 268435456 - - - // [in] Specifies the values requested .[out] Client ask the data to be set for future use - // [in] id of button we're requesting info for - // [in] lParam of button - // [out] image index - // [out] new text for item - // [in] size of buffer pointed to by pszText - - - //[in] Specifies the values requested .[out] Client ask the data to be set for future use - // [in] id of button we're requesting info for - // [in] lParam of button - // [out] image index - // [out] new text for item - // [in] size of buffer pointed to by pszText - - - #ifdef UNICODE - #define TBN_GETDISPINFO TBN_GETDISPINFOW - #define NMTBDISPINFO NMTBDISPINFOW - #define LPNMTBDISPINFO LPNMTBDISPINFOW - #else - #define TBN_GETDISPINFO TBN_GETDISPINFOA - #define NMTBDISPINFO NMTBDISPINFOA - #define LPNMTBDISPINFO LPNMTBDISPINFOA - #endif - - // Return codes for TBN_DROPDOWN - #define TBDDRET_DEFAULT 0 - #define TBDDRET_NODEFAULT 1 - #define TBDDRET_TREATPRESSED 2 // Treat as a standard press button - - - - #ifdef UNICODE - #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW - #else - #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA - #endif - - #define TBNOTIFYA NMTOOLBARA - #define TBNOTIFYW NMTOOLBARW - #define LPTBNOTIFYA LPNMTOOLBARA - #define LPTBNOTIFYW LPNMTOOLBARW - - #define TBNOTIFY NMTOOLBAR - #define LPTBNOTIFY LPNMTOOLBAR - - - #ifdef UNICODE - #define NMTOOLBAR NMTOOLBARW - #define LPNMTOOLBAR LPNMTOOLBARW - #else - #define NMTOOLBAR NMTOOLBARA - #define LPNMTOOLBAR LPNMTOOLBARA - #endif - - #endif // NOTOOLBAR - - - //====== REBAR CONTROL ======================================================== - - #ifndef NOREBAR - - #define REBARCLASSNAMEW L"ReBarWindow32" - #define REBARCLASSNAMEA "ReBarWindow32" - - #ifdef UNICODE - #define REBARCLASSNAME REBARCLASSNAMEW - #else - #define REBARCLASSNAME REBARCLASSNAMEA - #endif - - - #define RBIM_IMAGELIST 1 - - // begin_r_commctrl - - #define RBS_TOOLTIPS 256 - #define RBS_VARHEIGHT 512 - #define RBS_BANDBORDERS 1024 - #define RBS_FIXEDORDER 2048 - #define RBS_REGISTERDROP 4096 - #define RBS_AUTOSIZE 8192 - #define RBS_VERTICALGRIPPER 16384 // this always has the vertical gripper (default for horizontal mode) - #define RBS_DBLCLKTOGGLE 32768 - - - // end_r_commctrl - - - - #define RBBS_BREAK 1 // break to new line - #define RBBS_FIXEDSIZE 2 // band can't be sized - #define RBBS_CHILDEDGE 4 // edge around top & bottom of child window - #define RBBS_HIDDEN 8 // don't show - #define RBBS_NOVERT 16 // don't show when vertical - #define RBBS_FIXEDBMP 32 // bitmap doesn't move during band resize - #define RBBS_VARIABLEHEIGHT 64 // allow autosizing of this child vertically - #define RBBS_GRIPPERALWAYS 128 // always show the gripper - #define RBBS_NOGRIPPER 256 // never show the gripper - #define RBBS_USECHEVRON 512 // display drop-down button for this band if it's sized smaller than ideal width - #define RBBS_HIDETITLE 1024 // keep band title hidden - - #define RBBIM_STYLE 1 - #define RBBIM_COLORS 2 - #define RBBIM_TEXT 4 - #define RBBIM_IMAGE 8 - #define RBBIM_CHILD 16 - #define RBBIM_CHILDSIZE 32 - #define RBBIM_SIZE 64 - #define RBBIM_BACKGROUND 128 - #define RBBIM_ID 256 - #define RBBIM_IDEALSIZE 512 - #define RBBIM_LPARAM 1024 - #define RBBIM_HEADERSIZE 2048 // control the size of the header - - - #define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID) - #define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID) - - - #ifdef UNICODE - #define REBARBANDINFO REBARBANDINFOW - #define LPREBARBANDINFO LPREBARBANDINFOW - #define LPCREBARBANDINFO LPCREBARBANDINFOW - #define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE - #else - #define REBARBANDINFO REBARBANDINFOA - #define LPREBARBANDINFO LPREBARBANDINFOA - #define LPCREBARBANDINFO LPCREBARBANDINFOA - #define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE - #endif - - #define RB_INSERTBANDA (WM_USER + 1) - #define RB_DELETEBAND (WM_USER + 2) - #define RB_GETBARINFO (WM_USER + 3) - #define RB_SETBARINFO (WM_USER + 4) - #define RB_SETBANDINFOA (WM_USER + 6) - #define RB_SETPARENT (WM_USER + 7) - #define RB_HITTEST (WM_USER + 8) - #define RB_GETRECT (WM_USER + 9) - #define RB_INSERTBANDW (WM_USER + 10) - #define RB_SETBANDINFOW (WM_USER + 11) - #define RB_GETBANDCOUNT (WM_USER + 12) - #define RB_GETROWCOUNT (WM_USER + 13) - #define RB_GETROWHEIGHT (WM_USER + 14) - #define RB_IDTOINDEX (WM_USER + 16) // wParam == id - #define RB_GETTOOLTIPS (WM_USER + 17) - #define RB_SETTOOLTIPS (WM_USER + 18) - #define RB_SETBKCOLOR (WM_USER + 19) // sets the default BK color - #define RB_GETBKCOLOR (WM_USER + 20) // defaults to CLR_NONE - #define RB_SETTEXTCOLOR (WM_USER + 21) - #define RB_GETTEXTCOLOR (WM_USER + 22) // defaults to 0x00000000 - #define RB_SIZETORECT (WM_USER + 23) // resize the rebar/break bands and such to this rect (lparam) - - #define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME // lParam is color scheme - #define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME // fills in COLORSCHEME pointed to by lParam - - #ifdef UNICODE - #define RB_INSERTBAND RB_INSERTBANDW - #define RB_SETBANDINFO RB_SETBANDINFOW - #else - #define RB_INSERTBAND RB_INSERTBANDA - #define RB_SETBANDINFO RB_SETBANDINFOA - #endif - - // for manual drag control - // lparam == cursor pos - // -1 means do it yourself. - // -2 means use what you had saved before - #define RB_BEGINDRAG (WM_USER + 24) - #define RB_ENDDRAG (WM_USER + 25) - #define RB_DRAGMOVE (WM_USER + 26) - #define RB_GETBARHEIGHT (WM_USER + 27) - #define RB_GETBANDINFOW (WM_USER + 28) - #define RB_GETBANDINFOA (WM_USER + 29) - - #ifdef UNICODE - #define RB_GETBANDINFO RB_GETBANDINFOW - #else - #define RB_GETBANDINFO RB_GETBANDINFOA - #endif - - #define RB_MINIMIZEBAND (WM_USER + 30) - #define RB_MAXIMIZEBAND (WM_USER + 31) - - #define RB_GETDROPTARGET (CCM_GETDROPTARGET) - - #define RB_GETBANDBORDERS (WM_USER + 34) // returns in lparam = lprc the amount of edges added to band wparam - - #define RB_SHOWBAND (WM_USER + 35) // show/hide band - #define RB_SETPALETTE (WM_USER + 37) - #define RB_GETPALETTE (WM_USER + 38) - #define RB_MOVEBAND (WM_USER + 39) - - #define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - - - #define RB_PUSHCHEVRON (WM_USER + 43) - - #define RBN_HEIGHTCHANGE (RBN_FIRST - 0) - - #define RBN_GETOBJECT (RBN_FIRST - 1) - #define RBN_LAYOUTCHANGED (RBN_FIRST - 2) - #define RBN_AUTOSIZE (RBN_FIRST - 3) - #define RBN_BEGINDRAG (RBN_FIRST - 4) - #define RBN_ENDDRAG (RBN_FIRST - 5) - #define RBN_DELETINGBAND (RBN_FIRST - 6) // Uses NMREBAR - #define RBN_DELETEDBAND (RBN_FIRST - 7) // Uses NMREBAR - #define RBN_CHILDSIZE (RBN_FIRST - 8) - - #define RBN_CHEVRONPUSHED (RBN_FIRST - 10) - - - #define RBN_MINMAX (RBN_FIRST - 21) - - - // RBNM_* - - - // Mask flags for NMREBAR - #define RBNM_ID 1 - #define RBNM_STYLE 2 - #define RBNM_LPARAM 4 - - - - #define RBHT_NOWHERE 1 - #define RBHT_CAPTION 2 - #define RBHT_CLIENT 3 - #define RBHT_GRABBER 4 - #define RBHT_CHEVRON 8 - - #endif // NOREBAR - - //====== TOOLTIPS CONTROL ===================================================== - - #ifndef NOTOOLTIPS - - #define TOOLTIPS_CLASSW L"tooltips_class32" - #define TOOLTIPS_CLASSA "tooltips_class32" - - #ifdef UNICODE - #define TOOLTIPS_CLASS TOOLTIPS_CLASSW - #else - #define TOOLTIPS_CLASS TOOLTIPS_CLASSA - #endif - - //#define LPTOOLINFOA LPTTTOOLINFOA - //#define LPTOOLINFOW LPTTTOOLINFOW - //#define TOOLINFOA TTTOOLINFOA - //#define TOOLINFOW TTTOOLINFOW - - //#define LPTOOLINFO LPTTTOOLINFO - //#define TOOLINFO TTTOOLINFO - - #define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText) - #define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText) - - - #ifdef UNICODE - #define TOOLINFO TOOLINFOW - #define PTOOLINFO PTOOLINFOW - #define LPTOOLINFO LPTOOLINFOW - #define TOOLINFO_V1_SIZE TOOLINFOW_V1_SIZE - #else - #define PTOOLINFO PTOOLINFOA - #define TOOLINFO TOOLINFOA - #define LPTOOLINFO LPTOOLINFOA - #define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE - #endif - - // begin_r_commctrl - - #define TTS_ALWAYSTIP 1 - #define TTS_NOPREFIX 2 - #define TTS_NOANIMATE 16 - #define TTS_NOFADE 32 - #define TTS_BALLOON 64 - #define TTS_CLOSE 128 - - // end_r_commctrl - - #define TTF_IDISHWND 1 - - // Use this to center around trackpoint in trackmode - // -OR- to center around tool in normal mode. - // Use TTF_ABSOLUTE to place the tip exactly at the track coords when - // in tracking mode. TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP - // to center the tip absolutely about the track point. - - #define TTF_CENTERTIP 2 - #define TTF_RTLREADING 4 - #define TTF_SUBCLASS 16 - #define TTF_TRACK 32 - #define TTF_ABSOLUTE 128 - #define TTF_TRANSPARENT 256 - #define TTF_DI_SETITEM 32768 // valid only on the TTN_NEEDTEXT callback - - #define TTDT_AUTOMATIC 0 - #define TTDT_RESHOW 1 - #define TTDT_AUTOPOP 2 - #define TTDT_INITIAL 3 - - // ToolTip Icons (Set with TTM_SETTITLE) - #define TTI_NONE 0 - #define TTI_INFO 1 - #define TTI_WARNING 2 - #define TTI_ERROR 3 - - // Tool Tip Messages - #define TTM_ACTIVATE (WM_USER + 1) - #define TTM_SETDELAYTIME (WM_USER + 3) - #define TTM_ADDTOOLA (WM_USER + 4) - #define TTM_ADDTOOLW (WM_USER + 50) - #define TTM_DELTOOLA (WM_USER + 5) - #define TTM_DELTOOLW (WM_USER + 51) - #define TTM_NEWTOOLRECTA (WM_USER + 6) - #define TTM_NEWTOOLRECTW (WM_USER + 52) - #define TTM_RELAYEVENT (WM_USER + 7) - - #define TTM_GETTOOLINFOA (WM_USER + 8) - #define TTM_GETTOOLINFOW (WM_USER + 53) - - #define TTM_SETTOOLINFOA (WM_USER + 9) - #define TTM_SETTOOLINFOW (WM_USER + 54) - - #define TTM_HITTESTA (WM_USER +10) - #define TTM_HITTESTW (WM_USER +55) - #define TTM_GETTEXTA (WM_USER +11) - #define TTM_GETTEXTW (WM_USER +56) - #define TTM_UPDATETIPTEXTA (WM_USER +12) - #define TTM_UPDATETIPTEXTW (WM_USER +57) - #define TTM_GETTOOLCOUNT (WM_USER +13) - #define TTM_ENUMTOOLSA (WM_USER +14) - #define TTM_ENUMTOOLSW (WM_USER +58) - #define TTM_GETCURRENTTOOLA (WM_USER + 15) - #define TTM_GETCURRENTTOOLW (WM_USER + 59) - #define TTM_WINDOWFROMPOINT (WM_USER + 16) - #define TTM_TRACKACTIVATE (WM_USER + 17) // wParam = TRUE/FALSE start end lparam = LPTOOLINFO - #define TTM_TRACKPOSITION (WM_USER + 18) // lParam = dwPos - #define TTM_SETTIPBKCOLOR (WM_USER + 19) - #define TTM_SETTIPTEXTCOLOR (WM_USER + 20) - #define TTM_GETDELAYTIME (WM_USER + 21) - #define TTM_GETTIPBKCOLOR (WM_USER + 22) - #define TTM_GETTIPTEXTCOLOR (WM_USER + 23) - #define TTM_SETMAXTIPWIDTH (WM_USER + 24) - #define TTM_GETMAXTIPWIDTH (WM_USER + 25) - #define TTM_SETMARGIN (WM_USER + 26) // lParam = lprc - #define TTM_GETMARGIN (WM_USER + 27) // lParam = lprc - #define TTM_POP (WM_USER + 28) - #define TTM_UPDATE (WM_USER + 29) - #define TTM_GETBUBBLESIZE (WM_USER + 30) - #define TTM_ADJUSTRECT (WM_USER + 31) - #define TTM_SETTITLEA (WM_USER + 32) // wParam = TTI_*, lParam = char* szTitle - #define TTM_SETTITLEW (WM_USER + 33) // wParam = TTI_*, lParam = wchar* szTitle - #define TTM_POPUP (WM_USER + 34) - - - #ifdef UNICODE - #define TTM_ADDTOOL TTM_ADDTOOLW - #define TTM_DELTOOL TTM_DELTOOLW - #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW - #define TTM_GETTOOLINFO TTM_GETTOOLINFOW - #define TTM_SETTOOLINFO TTM_SETTOOLINFOW - #define TTM_HITTEST TTM_HITTESTW - #define TTM_GETTEXT TTM_GETTEXTW - #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW - #define TTM_ENUMTOOLS TTM_ENUMTOOLSW - #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW - #define TTM_SETTITLE TTM_SETTITLEW - #else - #define TTM_ADDTOOL TTM_ADDTOOLA - #define TTM_DELTOOL TTM_DELTOOLA - #define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA - #define TTM_GETTOOLINFO TTM_GETTOOLINFOA - #define TTM_SETTOOLINFO TTM_SETTOOLINFOA - #define TTM_HITTEST TTM_HITTESTA - #define TTM_GETTEXT TTM_GETTEXTA - #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA - #define TTM_ENUMTOOLS TTM_ENUMTOOLSA - #define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA - #define TTM_SETTITLE TTM_SETTITLEA - #endif - - - #define LPHITTESTINFOW LPTTHITTESTINFOW - #define LPHITTESTINFOA LPTTHITTESTINFOA - - #define LPHITTESTINFO LPTTHITTESTINFO - - - #ifdef UNICODE - #define TTHITTESTINFO TTHITTESTINFOW - #define LPTTHITTESTINFO LPTTHITTESTINFOW - #else - #define TTHITTESTINFO TTHITTESTINFOA - #define LPTTHITTESTINFO LPTTHITTESTINFOA - #endif - - #define TTN_GETDISPINFOA (TTN_FIRST - 0) - #define TTN_GETDISPINFOW (TTN_FIRST - 10) - #define TTN_SHOW (TTN_FIRST - 1) - #define TTN_POP (TTN_FIRST - 2) - - #ifdef UNICODE - #define TTN_GETDISPINFO TTN_GETDISPINFOW - #else - #define TTN_GETDISPINFO TTN_GETDISPINFOA - #endif - - #define TTN_NEEDTEXT TTN_GETDISPINFO - #define TTN_NEEDTEXTA TTN_GETDISPINFOA - #define TTN_NEEDTEXTW TTN_GETDISPINFOW - - //#define TOOLTIPTEXTW NMTTDISPINFOW - //#define TOOLTIPTEXTA NMTTDISPINFOA - //#define LPTOOLTIPTEXTA LPNMTTDISPINFOA - //#define LPTOOLTIPTEXTW LPNMTTDISPINFOW - - //#define TOOLTIPTEXT NMTTDISPINFO - //#define LPTOOLTIPTEXT LPNMTTDISPINFO - - #define NMTTDISPINFOA_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags) - #define NMTTDISPINFOW_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags) - - - #ifdef UNICODE - #define NMTTDISPINFO NMTTDISPINFOW - #define LPNMTTDISPINFO LPNMTTDISPINFOW - #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE - #else - #define NMTTDISPINFO NMTTDISPINFOA - #define LPNMTTDISPINFO LPNMTTDISPINFOA - #define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE - #endif - - #endif // NOTOOLTIPS - - - //====== STATUS BAR CONTROL =================================================== - - #ifndef NOSTATUSBAR - - // begin_r_commctrl - - #define SBARS_SIZEGRIP 256 - #define SBARS_TOOLTIPS 2048 - - // this is a status bar flag, preference to SBARS_TOOLTIPS - #define SBT_TOOLTIPS 2048 - - // end_r_commctrl - - - //#ifdef UNICODE - //#define CreateStatusWindow CreateStatusWindowW - //#define DrawStatusText DrawStatusTextW - //#else - //#define CreateStatusWindow CreateStatusWindowA - //#define DrawStatusText DrawStatusTextA - //#endif - - #define STATUSCLASSNAMEW L"msctls_statusbar32" - #define STATUSCLASSNAMEA "msctls_statusbar32" - - #ifdef UNICODE - #define STATUSCLASSNAME STATUSCLASSNAMEW - #else - #define STATUSCLASSNAME STATUSCLASSNAMEA - #endif - - #define SB_SETTEXTA (WM_USER+1) - #define SB_SETTEXTW (WM_USER+11) - #define SB_GETTEXTA (WM_USER+2) - #define SB_GETTEXTW (WM_USER+13) - #define SB_GETTEXTLENGTHA (WM_USER+3) - #define SB_GETTEXTLENGTHW (WM_USER+12) - - #ifdef UNICODE - #define SB_GETTEXT SB_GETTEXTW - #define SB_SETTEXT SB_SETTEXTW - #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW - #define SB_SETTIPTEXT SB_SETTIPTEXTW - #define SB_GETTIPTEXT SB_GETTIPTEXTW - #else - #define SB_GETTEXT SB_GETTEXTA - #define SB_SETTEXT SB_SETTEXTA - #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA - #define SB_SETTIPTEXT SB_SETTIPTEXTA - #define SB_GETTIPTEXT SB_GETTIPTEXTA - #endif - - - #define SB_SETPARTS (WM_USER+4) - #define SB_GETPARTS (WM_USER+6) - #define SB_GETBORDERS (WM_USER+7) - #define SB_SETMINHEIGHT (WM_USER+8) - #define SB_SIMPLE (WM_USER+9) - #define SB_GETRECT (WM_USER+10) - #define SB_ISSIMPLE (WM_USER+14) - #define SB_SETICON (WM_USER+15) - #define SB_SETTIPTEXTA (WM_USER+16) - #define SB_SETTIPTEXTW (WM_USER+17) - #define SB_GETTIPTEXTA (WM_USER+18) - #define SB_GETTIPTEXTW (WM_USER+19) - #define SB_GETICON (WM_USER+20) - #define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - - #define SBT_OWNERDRAW 4096 - #define SBT_NOBORDERS 256 - #define SBT_POPOUT 512 - #define SBT_RTLREADING 1024 - #define SBT_NOTABPARSING 2048 - - #define SB_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor - - /// status bar notifications - #define SBN_SIMPLEMODECHANGE (SBN_FIRST - 0) - - // refers to the data saved for simple mode - #define SB_SIMPLEID 255 - - #endif // NOSTATUSBAR - - //====== MENU HELP ============================================================ - - #ifndef NOMENUHELP - - #define MINSYSCOMMAND SC_SIZE - - #endif - - - //====== TRACKBAR CONTROL ===================================================== - - #ifndef NOTRACKBAR - - #define TRACKBAR_CLASSA "msctls_trackbar32" - #define TRACKBAR_CLASSW L"msctls_trackbar32" - - #ifdef UNICODE - #define TRACKBAR_CLASS TRACKBAR_CLASSW - #else - #define TRACKBAR_CLASS TRACKBAR_CLASSA - #endif - - // begin_r_commctrl - - #define TBS_AUTOTICKS 1 - #define TBS_VERT 2 - #define TBS_HORZ 0 - #define TBS_TOP 4 - #define TBS_BOTTOM 0 - #define TBS_LEFT 4 - #define TBS_RIGHT 0 - #define TBS_BOTH 8 - #define TBS_NOTICKS 16 - #define TBS_ENABLESELRANGE 32 - #define TBS_FIXEDLENGTH 64 - #define TBS_NOTHUMB 128 - #define TBS_TOOLTIPS 256 - #define TBS_REVERSED 512 // Accessibility hint: the smaller number (usually the min value) means "high" and the larger number (usually the max value) means "low" - - // end_r_commctrl - - #define TBM_GETPOS (WM_USER) - #define TBM_GETRANGEMIN (WM_USER+1) - #define TBM_GETRANGEMAX (WM_USER+2) - #define TBM_GETTIC (WM_USER+3) - #define TBM_SETTIC (WM_USER+4) - #define TBM_SETPOS (WM_USER+5) - #define TBM_SETRANGE (WM_USER+6) - #define TBM_SETRANGEMIN (WM_USER+7) - #define TBM_SETRANGEMAX (WM_USER+8) - #define TBM_CLEARTICS (WM_USER+9) - #define TBM_SETSEL (WM_USER+10) - #define TBM_SETSELSTART (WM_USER+11) - #define TBM_SETSELEND (WM_USER+12) - #define TBM_GETPTICS (WM_USER+14) - #define TBM_GETTICPOS (WM_USER+15) - #define TBM_GETNUMTICS (WM_USER+16) - #define TBM_GETSELSTART (WM_USER+17) - #define TBM_GETSELEND (WM_USER+18) - #define TBM_CLEARSEL (WM_USER+19) - #define TBM_SETTICFREQ (WM_USER+20) - #define TBM_SETPAGESIZE (WM_USER+21) - #define TBM_GETPAGESIZE (WM_USER+22) - #define TBM_SETLINESIZE (WM_USER+23) - #define TBM_GETLINESIZE (WM_USER+24) - #define TBM_GETTHUMBRECT (WM_USER+25) - #define TBM_GETCHANNELRECT (WM_USER+26) - #define TBM_SETTHUMBLENGTH (WM_USER+27) - #define TBM_GETTHUMBLENGTH (WM_USER+28) - #define TBM_SETTOOLTIPS (WM_USER+29) - #define TBM_GETTOOLTIPS (WM_USER+30) - #define TBM_SETTIPSIDE (WM_USER+31) - // TrackBar Tip Side flags - #define TBTS_TOP 0 - #define TBTS_LEFT 1 - #define TBTS_BOTTOM 2 - #define TBTS_RIGHT 3 - - #define TBM_SETBUDDY (WM_USER+32) // wparam = BOOL fLeft; (or right) - #define TBM_GETBUDDY (WM_USER+33) // wparam = BOOL fLeft; (or right) - #define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - - - #define TB_LINEUP 0 - #define TB_LINEDOWN 1 - #define TB_PAGEUP 2 - #define TB_PAGEDOWN 3 - #define TB_THUMBPOSITION 4 - #define TB_THUMBTRACK 5 - #define TB_TOP 6 - #define TB_BOTTOM 7 - #define TB_ENDTRACK 8 - - - // custom draw item specs - #define TBCD_TICS 1 - #define TBCD_THUMB 2 - #define TBCD_CHANNEL 3 - - #endif // trackbar - - //====== DRAG LIST CONTROL ==================================================== - - #ifndef NODRAGLIST - - #define DL_BEGINDRAG (WM_USER+133) - #define DL_DRAGGING (WM_USER+134) - #define DL_DROPPED (WM_USER+135) - #define DL_CANCELDRAG (WM_USER+136) - - #define DL_CURSORSET 0 - #define DL_STOPCURSOR 1 - #define DL_COPYCURSOR 2 - #define DL_MOVECURSOR 3 - - #define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") - - #endif //nodraglist - - - //====== UPDOWN CONTROL ======================================================= - - #ifndef NOUPDOWN - - #define UPDOWN_CLASSA "msctls_updown32" - #define UPDOWN_CLASSW L"msctls_updown32" - - #ifdef UNICODE - #define UPDOWN_CLASS UPDOWN_CLASSW - #else - #define UPDOWN_CLASS UPDOWN_CLASSA - #endif - - - #define UD_MAXVAL 32767 - #define UD_MINVAL (-UD_MAXVAL) - - // begin_r_commctrl - - #define UDS_WRAP 1 - #define UDS_SETBUDDYINT 2 - #define UDS_ALIGNRIGHT 4 - #define UDS_ALIGNLEFT 8 - #define UDS_AUTOBUDDY 16 - #define UDS_ARROWKEYS 32 - #define UDS_HORZ 64 - #define UDS_NOTHOUSANDS 128 - #define UDS_HOTTRACK 256 - - // end_r_commctrl - - #define UDM_SETRANGE (WM_USER+101) - #define UDM_GETRANGE (WM_USER+102) - #define UDM_SETPOS (WM_USER+103) - #define UDM_GETPOS (WM_USER+104) - #define UDM_SETBUDDY (WM_USER+105) - #define UDM_GETBUDDY (WM_USER+106) - #define UDM_SETACCEL (WM_USER+107) - #define UDM_GETACCEL (WM_USER+108) - #define UDM_SETBASE (WM_USER+109) - #define UDM_GETBASE (WM_USER+110) - #define UDM_SETRANGE32 (WM_USER+111) - #define UDM_GETRANGE32 (WM_USER+112) // wParam & lParam are LPINT - #define UDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define UDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - #define UDM_SETPOS32 (WM_USER+113) - #define UDM_GETPOS32 (WM_USER+114) - - - #define NM_UPDOWN NMUPDOWN - #define LPNM_UPDOWN LPNMUPDOWN - - #define UDN_DELTAPOS (UDN_FIRST - 1) - - #endif // NOUPDOWN - - - //====== PROGRESS CONTROL ===================================================== - - #ifndef NOPROGRESS - - #define PROGRESS_CLASSA "msctls_progress32" - #define PROGRESS_CLASSW L"msctls_progress32" - - #ifdef UNICODE - #define PROGRESS_CLASS PROGRESS_CLASSW - #else - #define PROGRESS_CLASS PROGRESS_CLASSA - #endif - - // begin_r_commctrl - - #define PBS_SMOOTH 1 - #define PBS_VERTICAL 4 - - // end_r_commctrl - - #define PBM_SETRANGE (WM_USER+1) - #define PBM_SETPOS (WM_USER+2) - #define PBM_DELTAPOS (WM_USER+3) - #define PBM_SETSTEP (WM_USER+4) - #define PBM_STEPIT (WM_USER+5) - #define PBM_SETRANGE32 (WM_USER+6) // lParam = high, wParam = low - - - #define PBM_GETRANGE (WM_USER+7) // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL - #define PBM_GETPOS (WM_USER+8) - #define PBM_SETBARCOLOR (WM_USER+9) // lParam = bar color - #define PBM_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor - - #endif // NOPROGRESS - - - //====== HOTKEY CONTROL ======================================================= - - #ifndef NOHOTKEY - - #define HOTKEYF_SHIFT 1 - #define HOTKEYF_CONTROL 2 - #define HOTKEYF_ALT 4 - #define HOTKEYF_EXT 8 - - #define HKCOMB_NONE 1 - #define HKCOMB_S 2 - #define HKCOMB_C 4 - #define HKCOMB_A 8 - #define HKCOMB_SC 16 - #define HKCOMB_SA 32 - #define HKCOMB_CA 64 - #define HKCOMB_SCA 128 - - - #define HKM_SETHOTKEY (WM_USER+1) - #define HKM_GETHOTKEY (WM_USER+2) - #define HKM_SETRULES (WM_USER+3) - - #define HOTKEY_CLASSA "msctls_hotkey32" - #define HOTKEY_CLASSW L"msctls_hotkey32" - - #ifdef UNICODE - #define HOTKEY_CLASS HOTKEY_CLASSW - #else - #define HOTKEY_CLASS HOTKEY_CLASSA - #endif - - #endif // NOHOTKEY - - // begin_r_commctrl - - //====== COMMON CONTROL STYLES ================================================ - - #define CCS_TOP 1 - #define CCS_NOMOVEY 2 - #define CCS_BOTTOM 3 - #define CCS_NORESIZE 4 - #define CCS_NOPARENTALIGN 8 - #define CCS_ADJUSTABLE 32 - #define CCS_NODIVIDER 64 - #define CCS_VERT 128 - #define CCS_LEFT (CCS_VERT + CCS_TOP) - #define CCS_RIGHT (CCS_VERT + CCS_BOTTOM) - #define CCS_NOMOVEX (CCS_VERT + CCS_NOMOVEY) - - // end_r_commctrl - - //====== LISTVIEW CONTROL ===================================================== - - #ifndef NOLISTVIEW - - #define WC_LISTVIEWA "SysListView32" - #define WC_LISTVIEWW L"SysListView32" - - #ifdef UNICODE - #define WC_LISTVIEW WC_LISTVIEWW - #else - #define WC_LISTVIEW WC_LISTVIEWA - #endif - - // begin_r_commctrl - - #define LVS_ICON 0 - #define LVS_REPORT 1 - #define LVS_SMALLICON 2 - #define LVS_LIST 3 - #define LVS_TYPEMASK 3 - #define LVS_SINGLESEL 4 - #define LVS_SHOWSELALWAYS 8 - #define LVS_SORTASCENDING 16 - #define LVS_SORTDESCENDING 32 - #define LVS_SHAREIMAGELISTS 64 - #define LVS_NOLABELWRAP 128 - #define LVS_AUTOARRANGE 256 - #define LVS_EDITLABELS 512 - #define LVS_OWNERDATA 4096 - #define LVS_NOSCROLL 8192 - - #define LVS_TYPESTYLEMASK 64512 - - #define LVS_ALIGNTOP 0 - #define LVS_ALIGNLEFT 2048 - #define LVS_ALIGNMASK 3072 - - #define LVS_OWNERDRAWFIXED 1024 - #define LVS_NOCOLUMNHEADER 16384 - #define LVS_NOSORTHEADER 32768 - - // end_r_commctrl - - #define LVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - //#define ListView_SetUnicodeFormat(hwnd, fUnicode) \ - - - #define LVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - //#define ListView_GetUnicodeFormat(hwnd) \ - - - #define LVM_GETBKCOLOR (LVM_FIRST + 0) - //#define ListView_GetBkColor(hwnd) \ - - - #define LVM_SETBKCOLOR (LVM_FIRST + 1) - //#define ListView_SetBkColor(hwnd, clrBk) \ - - - #define LVM_GETIMAGELIST (LVM_FIRST + 2) - //#define ListView_GetImageList(hwnd, iImageList) \ - - - #define LVSIL_NORMAL 0 - #define LVSIL_SMALL 1 - #define LVSIL_STATE 2 - - #define LVM_SETIMAGELIST (LVM_FIRST + 3) - //#define ListView_SetImageList(hwnd, himl, iImageList) \ - - - #define LVM_GETITEMCOUNT (LVM_FIRST + 4) - //#define ListView_GetItemCount(hwnd) \ - - - #define LVIF_TEXT 1 - #define LVIF_IMAGE 2 - #define LVIF_PARAM 4 - #define LVIF_STATE 8 - #define LVIF_INDENT 16 - #define LVIF_NORECOMPUTE 2048 - - #define LVIS_FOCUSED 1 - #define LVIS_SELECTED 2 - #define LVIS_CUT 4 - #define LVIS_DROPHILITED 8 - #define LVIS_ACTIVATING 32 - - #define LVIS_OVERLAYMASK 3840 - #define LVIS_STATEIMAGEMASK 61440 - - #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) - - #define I_INDENTCALLBACK (-1) - #define LV_ITEMA LVITEMA - #define LV_ITEMW LVITEMW - - #define LV_ITEM LVITEM - - #define LVITEMA_V1_SIZE CCSIZEOF_STRUCT(LVITEMA, lParam) - #define LVITEMW_V1_SIZE CCSIZEOF_STRUCT(LVITEMW, lParam) - - - #ifdef UNICODE - #define LVITEM LVITEMW - #define LPLVITEM LPLVITEMW - #define LVITEM_V1_SIZE LVITEMW_V1_SIZE - #else - #define LVITEM LVITEMA - #define LPLVITEM LPLVITEMA - #define LVITEM_V1_SIZE LVITEMA_V1_SIZE - #endif - - - #define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) - #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) - #ifdef UNICODE - #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW - #else - #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA - #endif - - #define I_IMAGECALLBACK (-1) - #define I_IMAGENONE (-2) - - #define LVM_GETITEMA (LVM_FIRST + 5) - #define LVM_GETITEMW (LVM_FIRST + 75) - #ifdef UNICODE - #define LVM_GETITEM LVM_GETITEMW - #else - #define LVM_GETITEM LVM_GETITEMA - #endif - - //#define ListView_GetItem(hwnd, pitem) \ - - - #define LVM_SETITEMA (LVM_FIRST + 6) - #define LVM_SETITEMW (LVM_FIRST + 76) - #ifdef UNICODE - #define LVM_SETITEM LVM_SETITEMW - #else - #define LVM_SETITEM LVM_SETITEMA - #endif - - //#define ListView_SetItem(hwnd, pitem) \ - - - #define LVM_INSERTITEMA (LVM_FIRST + 7) - #define LVM_INSERTITEMW (LVM_FIRST + 77) - #ifdef UNICODE - #define LVM_INSERTITEM LVM_INSERTITEMW - #else - #define LVM_INSERTITEM LVM_INSERTITEMA - #endif - //#define ListView_InsertItem(hwnd, pitem) \ - - - #define LVM_DELETEITEM (LVM_FIRST + 8) - //#define ListView_DeleteItem(hwnd, i) \ - - - #define LVM_DELETEALLITEMS (LVM_FIRST + 9) - //#define ListView_DeleteAllItems(hwnd) \ - - - #define LVM_GETCALLBACKMASK (LVM_FIRST + 10) - //#define ListView_GetCallbackMask(hwnd) \ - - - #define LVM_SETCALLBACKMASK (LVM_FIRST + 11) - //#define ListView_SetCallbackMask(hwnd, mask) \ - - - #define LVNI_ALL 0 - #define LVNI_FOCUSED 1 - #define LVNI_SELECTED 2 - #define LVNI_CUT 4 - #define LVNI_DROPHILITED 8 - - #define LVNI_ABOVE 256 - #define LVNI_BELOW 512 - #define LVNI_TOLEFT 1024 - #define LVNI_TORIGHT 2048 - - - #define LVM_GETNEXTITEM (LVM_FIRST + 12) - //#define ListView_GetNextItem(hwnd, i, flags) \ - - - #define LVFI_PARAM 1 - #define LVFI_STRING 2 - #define LVFI_PARTIAL 8 - #define LVFI_WRAP 32 - #define LVFI_NEARESTXY 64 - - #define LV_FINDINFOA LVFINDINFOA - #define LV_FINDINFOW LVFINDINFOW - - #define LV_FINDINFO LVFINDINFO - - - #ifdef UNICODE - #define LVFINDINFO LVFINDINFOW - #else - #define LVFINDINFO LVFINDINFOA - #endif - - #define LVM_FINDITEMA (LVM_FIRST + 13) - #define LVM_FINDITEMW (LVM_FIRST + 83) - #ifdef UNICODE - #define LVM_FINDITEM LVM_FINDITEMW - #else - #define LVM_FINDITEM LVM_FINDITEMA - #endif - - //#define ListView_FindItem(hwnd, iStart, plvfi) \ - - - #define LVIR_BOUNDS 0 - #define LVIR_ICON 1 - #define LVIR_LABEL 2 - #define LVIR_SELECTBOUNDS 3 - - - #define LVM_GETITEMRECT (LVM_FIRST + 14) - //#define ListView_GetItemRect(hwnd, i, prc, code) \ - - - #define LVM_SETITEMPOSITION (LVM_FIRST + 15) - //#define ListView_SetItemPosition(hwndLV, i, x, y) \ - - - #define LVM_GETITEMPOSITION (LVM_FIRST + 16) - //#define ListView_GetItemPosition(hwndLV, i, ppt) \ - - - #define LVM_GETSTRINGWIDTHA (LVM_FIRST + 17) - #define LVM_GETSTRINGWIDTHW (LVM_FIRST + 87) - #ifdef UNICODE - #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW - #else - #define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA - #endif - - //#define ListView_GetStringWidth(hwndLV, psz) \ - - - #define LVHT_NOWHERE 1 - #define LVHT_ONITEMICON 2 - #define LVHT_ONITEMLABEL 4 - #define LVHT_ONITEMSTATEICON 8 - #define LVHT_ONITEM (LVHT_ONITEMICON + LVHT_ONITEMLABEL + LVHT_ONITEMSTATEICON) - - #define LVHT_ABOVE 8 - #define LVHT_BELOW 16 - #define LVHT_TORIGHT 32 - #define LVHT_TOLEFT 64 - - #define LV_HITTESTINFO LVHITTESTINFO - - #define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO, iItem) - - - #define LVM_HITTEST (LVM_FIRST + 18) - //#define ListView_HitTest(hwndLV, pinfo) \ - - - #define LVM_ENSUREVISIBLE (LVM_FIRST + 19) - //#define ListView_EnsureVisible(hwndLV, i, fPartialOK) \ - - - #define LVM_SCROLL (LVM_FIRST + 20) - //#define ListView_Scroll(hwndLV, dx, dy) \ - - - #define LVM_REDRAWITEMS (LVM_FIRST + 21) - //#define ListView_RedrawItems(hwndLV, iFirst, iLast) \ - - - #define LVA_DEFAULT 0 - #define LVA_ALIGNLEFT 1 - #define LVA_ALIGNTOP 2 - #define LVA_SNAPTOGRID 5 - - #define LVM_ARRANGE (LVM_FIRST + 22) - //#define ListView_Arrange(hwndLV, code) \ - - - #define LVM_EDITLABELA (LVM_FIRST + 23) - #define LVM_EDITLABELW (LVM_FIRST + 118) - #ifdef UNICODE - #define LVM_EDITLABEL LVM_EDITLABELW - #else - #define LVM_EDITLABEL LVM_EDITLABELA - #endif - - //#define ListView_EditLabel(hwndLV, i) \ - - - #define LVM_GETEDITCONTROL (LVM_FIRST + 24) - //#define ListView_GetEditControl(hwndLV) \ - - - #define LV_COLUMNA LVCOLUMNA - #define LV_COLUMNW LVCOLUMNW - - #define LV_COLUMN LVCOLUMN - - #define LVCOLUMNA_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem) - #define LVCOLUMNW_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem) - - - #ifdef UNICODE - #define LVCOLUMN LVCOLUMNW - #define LPLVCOLUMN LPLVCOLUMNW - #define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE - #else - #define LVCOLUMN LVCOLUMNA - #define LPLVCOLUMN LPLVCOLUMNA - #define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE - #endif - - - #define LVCF_FMT 1 - #define LVCF_WIDTH 2 - #define LVCF_TEXT 4 - #define LVCF_SUBITEM 8 - #define LVCF_IMAGE 16 - #define LVCF_ORDER 32 - - #define LVCFMT_LEFT 0 - #define LVCFMT_RIGHT 1 - #define LVCFMT_CENTER 2 - #define LVCFMT_JUSTIFYMASK 3 - - #define LVCFMT_IMAGE 2048 - #define LVCFMT_BITMAP_ON_RIGHT 4096 - #define LVCFMT_COL_HAS_IMAGES 32768 - - #define LVM_GETCOLUMNA (LVM_FIRST + 25) - #define LVM_GETCOLUMNW (LVM_FIRST + 95) - #ifdef UNICODE - #define LVM_GETCOLUMN LVM_GETCOLUMNW - #else - #define LVM_GETCOLUMN LVM_GETCOLUMNA - #endif - - //#define ListView_GetColumn(hwnd, iCol, pcol) \ - - - #define LVM_SETCOLUMNA (LVM_FIRST + 26) - #define LVM_SETCOLUMNW (LVM_FIRST + 96) - #ifdef UNICODE - #define LVM_SETCOLUMN LVM_SETCOLUMNW - #else - #define LVM_SETCOLUMN LVM_SETCOLUMNA - #endif - - //#define ListView_SetColumn(hwnd, iCol, pcol) \ - - - #define LVM_INSERTCOLUMN (LVM_FIRST + 27) - #define LVM_INSERTCOLUMNW (LVM_FIRST + 97) - - //#define ListView_InsertColumn(hwnd, iCol, pcol) \ - - - #define LVM_DELETECOLUMN (LVM_FIRST + 28) - //#define ListView_DeleteColumn(hwnd, iCol) \ - - - #define LVM_GETCOLUMNWIDTH (LVM_FIRST + 29) - //#define ListView_GetColumnWidth(hwnd, iCol) \ - - - #define LVSCW_AUTOSIZE -1 - #define LVSCW_AUTOSIZE_USEHEADER -2 - #define LVM_SETCOLUMNWIDTH (LVM_FIRST + 30) - - //#define ListView_SetColumnWidth(hwnd, iCol, cx) \ - - - #define LVM_GETHEADER (LVM_FIRST + 31) - //#define ListView_GetHeader(hwnd)\ - - #define LVM_CREATEDRAGIMAGE (LVM_FIRST + 33) - //#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \ - - #define LVM_GETVIEWRECT (LVM_FIRST + 34) - //#define ListView_GetViewRect(hwnd, prc) \ - - #define LVM_GETTEXTCOLOR (LVM_FIRST + 35) - //#define ListView_GetTextColor(hwnd) \ - - #define LVM_SETTEXTCOLOR (LVM_FIRST + 36) - //#define ListView_SetTextColor(hwnd, clrText) \ - - #define LVM_GETTEXTBKCOLOR (LVM_FIRST + 37) - //#define ListView_GetTextBkColor(hwnd) \ - - #define LVM_SETTEXTBKCOLOR (LVM_FIRST + 38) - //#define ListView_SetTextBkColor(hwnd, clrTextBk) \ - - #define LVM_GETTOPINDEX (LVM_FIRST + 39) - //#define ListView_GetTopIndex(hwndLV) \ - - #define LVM_GETCOUNTPERPAGE (LVM_FIRST + 40) - //#define ListView_GetCountPerPage(hwndLV) \ - - #define LVM_GETORIGIN (LVM_FIRST + 41) - //#define ListView_GetOrigin(hwndLV, ppt) \ - - #define LVM_UPDATE (LVM_FIRST + 42) - //#define ListView_Update(hwndLV, i) \ - - #define LVM_SETITEMSTATE (LVM_FIRST + 43) - //#define ListView_SetItemState(hwndLV, i, data, mask) \ - - //#define ListView_SetCheckState(hwndLV, i, fCheck) \ - - #define LVM_GETITEMSTATE (LVM_FIRST + 44) - //#define ListView_GetItemState(hwndLV, i, mask) \ - - - //#define ListView_GetCheckState(hwndLV, i) \ - - #define LVM_GETITEMTEXTA (LVM_FIRST + 45) - #define LVM_GETITEMTEXTW (LVM_FIRST + 115) - - #ifdef UNICODE - #define LVM_GETITEMTEXT LVM_GETITEMTEXTW - #else - #define LVM_GETITEMTEXT LVM_GETITEMTEXTA - #endif - - //#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \ - - - #define LVM_SETITEMTEXTA (LVM_FIRST + 46) - #define LVM_SETITEMTEXTW (LVM_FIRST + 116) - - #ifdef UNICODE - #define LVM_SETITEMTEXT LVM_SETITEMTEXTW - #else - #define LVM_SETITEMTEXT LVM_SETITEMTEXTA - #endif - - //#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \ - - - // these flags only apply to LVS_OWNERDATA listviews in report or list mode - #define LVSICF_NOINVALIDATEALL 1 - #define LVSICF_NOSCROLL 2 - - #define LVM_SETITEMCOUNT (LVM_FIRST + 47) - //#define ListView_SetItemCount(hwndLV, cItems) \ - - - //#define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \ - - - #define LVM_SORTITEMS (LVM_FIRST + 48) - //#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \ - - - #define LVM_SETITEMPOSITION32 (LVM_FIRST + 49) - //#define ListView_SetItemPosition32(hwndLV, i, x0, y0) \ - - - #define LVM_GETSELECTEDCOUNT (LVM_FIRST + 50) - //#define ListView_GetSelectedCount(hwndLV) \ - - - #define LVM_GETITEMSPACING (LVM_FIRST + 51) - //#define ListView_GetItemSpacing(hwndLV, fSmall) \ - - - #define LVM_GETISEARCHSTRINGA (LVM_FIRST + 52) - #define LVM_GETISEARCHSTRINGW (LVM_FIRST + 117) - - #ifdef UNICODE - #define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW - #else - #define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA - #endif - - //#define ListView_GetISearchString(hwndLV, lpsz) \ - - - #define LVM_SETICONSPACING (LVM_FIRST + 53) - // -1 for cx and cy means we'll use the default (system settings) - // 0 for cx or cy means use the current setting (allows you to change just one param) - //#define ListView_SetIconSpacing(hwndLV, cx, cy) \ - - - #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54) // optional wParam == mask - //#define ListView_SetExtendedListViewStyle(hwndLV, dw)\ - - //#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)\ - - #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55) - //#define ListView_GetExtendedListViewStyle(hwndLV)\ - - - #define LVS_EX_GRIDLINES 1 - #define LVS_EX_SUBITEMIMAGES 2 - #define LVS_EX_CHECKBOXES 4 - #define LVS_EX_TRACKSELECT 8 - #define LVS_EX_HEADERDRAGDROP 16 - #define LVS_EX_FULLROWSELECT 32 // applies to report mode only - #define LVS_EX_ONECLICKACTIVATE 64 - #define LVS_EX_TWOCLICKACTIVATE 128 - #define LVS_EX_FLATSB 256 - #define LVS_EX_REGIONAL 512 - #define LVS_EX_INFOTIP 1024 // listview does InfoTips for you - #define LVS_EX_UNDERLINEHOT 2048 - #define LVS_EX_UNDERLINECOLD 4096 - #define LVS_EX_MULTIWORKAREAS 8192 - - #define LVS_EX_LABELTIP 16384 // listview unfolds partly hidden labels if it does not have infotip text - - #define LVM_GETSUBITEMRECT (LVM_FIRST + 56) - //#define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \ - - - #define LVM_SUBITEMHITTEST (LVM_FIRST + 57) - //#define ListView_SubItemHitTest(hwnd, plvhti) \ - - - #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58) - //#define ListView_SetColumnOrderArray(hwnd, iCount, pi) \ - - - #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59) - //#define ListView_GetColumnOrderArray(hwnd, iCount, pi) \ - - - #define LVM_SETHOTITEM (LVM_FIRST + 60) - //#define ListView_SetHotItem(hwnd, i) \ - - - #define LVM_GETHOTITEM (LVM_FIRST + 61) - //#define ListView_GetHotItem(hwnd) \ - - - #define LVM_SETHOTCURSOR (LVM_FIRST + 62) - //#define ListView_SetHotCursor(hwnd, hcur) \ - - - #define LVM_GETHOTCURSOR (LVM_FIRST + 63) - //#define ListView_GetHotCursor(hwnd) \ - - - #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64) - //#define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \ - - #define LV_MAX_WORKAREAS 16 - #define LVM_SETWORKAREAS (LVM_FIRST + 65) - //#define ListView_SetWorkAreas(hwnd, nWorkAreas, prc) \ - - - #define LVM_GETWORKAREAS (LVM_FIRST + 70) - //#define ListView_GetWorkAreas(hwnd, nWorkAreas, prc) \ - - - #define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST + 73) - //#define ListView_GetNumberOfWorkAreas(hwnd, pnWorkAreas) \ - - - #define LVM_GETSELECTIONMARK (LVM_FIRST + 66) - //#define ListView_GetSelectionMark(hwnd) \ - - - #define LVM_SETSELECTIONMARK (LVM_FIRST + 67) - //#define ListView_SetSelectionMark(hwnd, i) \ - - - #define LVM_SETHOVERTIME (LVM_FIRST + 71) - //#define ListView_SetHoverTime(hwndLV, dwHoverTimeMs)\ - - - #define LVM_GETHOVERTIME (LVM_FIRST + 72) - //#define ListView_GetHoverTime(hwndLV)\ - - - #define LVM_SETTOOLTIPS (LVM_FIRST + 74) - //#define ListView_SetToolTips(hwndLV, hwndNewHwnd)\ - - - #define LVM_GETTOOLTIPS (LVM_FIRST + 78) - //#define ListView_GetToolTips(hwndLV)\ - - - #define LVM_SORTITEMSEX (LVM_FIRST + 81) - //#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm) \ - - - // LVBKIF_* - - - // LVBKIF_* - - - #define LVBKIF_SOURCE_NONE 0 - #define LVBKIF_SOURCE_HBITMAP 1 - #define LVBKIF_SOURCE_URL 2 - #define LVBKIF_SOURCE_MASK 3 - #define LVBKIF_STYLE_NORMAL 0 - #define LVBKIF_STYLE_TILE 16 - #define LVBKIF_STYLE_MASK 16 - - #define LVM_SETBKIMAGEA (LVM_FIRST + 68) - #define LVM_SETBKIMAGEW (LVM_FIRST + 138) - #define LVM_GETBKIMAGEA (LVM_FIRST + 69) - #define LVM_GETBKIMAGEW (LVM_FIRST + 139) - - #ifdef UNICODE - #define LVBKIMAGE LVBKIMAGEW - #define LPLVBKIMAGE LPLVBKIMAGEW - #define LVM_SETBKIMAGE LVM_SETBKIMAGEW - #define LVM_GETBKIMAGE LVM_GETBKIMAGEW - #else - #define LVBKIMAGE LVBKIMAGEA - #define LPLVBKIMAGE LPLVBKIMAGEA - #define LVM_SETBKIMAGE LVM_SETBKIMAGEA - #define LVM_GETBKIMAGE LVM_GETBKIMAGEA - #endif - - - //#define ListView_SetBkImage(hwnd, plvbki) \ - - - //#define ListView_GetBkImage(hwnd, plvbki) \ - - #define LPNM_LISTVIEW LPNMLISTVIEW - #define NM_LISTVIEW NMLISTVIEW - - - // NMITEMACTIVATE is used instead of NMLISTVIEW in IE >= 0x400 - // therefore all the fields are the same except for extra uKeyFlags - // they are used to store key flags at the time of the single click with - // delayed activation - because by the time the timer goes off a user may - // not hold the keys (shift, ctrl) any more - - - // key flags stored in uKeyFlags - #define LVKF_ALT 1 - #define LVKF_CONTROL 2 - #define LVKF_SHIFT 4 - - - #define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLVCUSTOMDRW, clrTextBk) - - - #define LPNM_CACHEHINT LPNMLVCACHEHINT - #define PNM_CACHEHINT LPNMLVCACHEHINT - #define NM_CACHEHINT NMLVCACHEHINT - - - #define PNM_FINDITEMA LPNMLVFINDITEMA - #define LPNM_FINDITEMA LPNMLVFINDITEMA - #define NM_FINDITEMA NMLVFINDITEMA - - #define PNM_FINDITEMW LPNMLVFINDITEMW - #define LPNM_FINDITEMW LPNMLVFINDITEMW - #define NM_FINDITEMW NMLVFINDITEMW - - #ifdef UNICODE - #define PNM_FINDITEM PNM_FINDITEMW - #define LPNM_FINDITEM LPNM_FINDITEMW - #define NM_FINDITEM NM_FINDITEMW - #define NMLVFINDITEM NMLVFINDITEMW - #define LPNMLVFINDITEM LPNMLVFINDITEMW - #else - #define PNM_FINDITEM PNM_FINDITEMA - #define LPNM_FINDITEM LPNM_FINDITEMA - #define NM_FINDITEM NM_FINDITEMA - #define NMLVFINDITEM NMLVFINDITEMA - #define LPNMLVFINDITEM LPNMLVFINDITEMA - #endif - - - #define PNM_ODSTATECHANGE LPNMLVODSTATECHANGE - #define LPNM_ODSTATECHANGE LPNMLVODSTATECHANGE - #define NM_ODSTATECHANGE NMLVODSTATECHANGE - - - #define LVN_ITEMCHANGING (LVN_FIRST-0) - #define LVN_ITEMCHANGED (LVN_FIRST-1) - #define LVN_INSERTITEM (LVN_FIRST-2) - #define LVN_DELETEITEM (LVN_FIRST-3) - #define LVN_DELETEALLITEMS (LVN_FIRST-4) - #define LVN_BEGINLABELEDITA (LVN_FIRST-5) - #define LVN_BEGINLABELEDITW (LVN_FIRST-75) - #define LVN_ENDLABELEDITA (LVN_FIRST-6) - #define LVN_ENDLABELEDITW (LVN_FIRST-76) - #define LVN_COLUMNCLICK (LVN_FIRST-8) - #define LVN_BEGINDRAG (LVN_FIRST-9) - #define LVN_BEGINRDRAG (LVN_FIRST-11) - - #define LVN_ODCACHEHINT (LVN_FIRST-13) - #define LVN_ODFINDITEMA (LVN_FIRST-52) - #define LVN_ODFINDITEMW (LVN_FIRST-79) - - #define LVN_ITEMACTIVATE (LVN_FIRST-14) - #define LVN_ODSTATECHANGED (LVN_FIRST-15) - - #ifdef UNICODE - #define LVN_ODFINDITEM LVN_ODFINDITEMW - #else - #define LVN_ODFINDITEM LVN_ODFINDITEMA - #endif - - - #define LVN_HOTTRACK (LVN_FIRST-21) - - #define LVN_GETDISPINFOA (LVN_FIRST-50) - #define LVN_GETDISPINFOW (LVN_FIRST-77) - #define LVN_SETDISPINFOA (LVN_FIRST-51) - #define LVN_SETDISPINFOW (LVN_FIRST-78) - - #ifdef UNICODE - #define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW - #define LVN_ENDLABELEDIT LVN_ENDLABELEDITW - #define LVN_GETDISPINFO LVN_GETDISPINFOW - #define LVN_SETDISPINFO LVN_SETDISPINFOW - #else - #define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA - #define LVN_ENDLABELEDIT LVN_ENDLABELEDITA - #define LVN_GETDISPINFO LVN_GETDISPINFOA - #define LVN_SETDISPINFO LVN_SETDISPINFOA - #endif - - - #define LVIF_DI_SETITEM 4096 - - #define LV_DISPINFOA NMLVDISPINFOA - #define LV_DISPINFOW NMLVDISPINFOW - - #define LV_DISPINFO NMLVDISPINFO - - - #ifdef UNICODE - #define NMLVDISPINFO NMLVDISPINFOW - #else - #define NMLVDISPINFO NMLVDISPINFOA - #endif - - #define LVN_KEYDOWN (LVN_FIRST-55) - - #define LV_KEYDOWN NMLVKEYDOWN - - #define LVN_MARQUEEBEGIN (LVN_FIRST-56) - - - // NMLVGETINFOTIPA.dwFlag values - - #define LVGIT_UNFOLDED 1 - - #define LVN_GETINFOTIPA (LVN_FIRST-57) - #define LVN_GETINFOTIPW (LVN_FIRST-58) - - #ifdef UNICODE - #define LVN_GETINFOTIP LVN_GETINFOTIPW - #define NMLVGETINFOTIP NMLVGETINFOTIPW - #define LPNMLVGETINFOTIP LPNMLVGETINFOTIPW - #else - #define LVN_GETINFOTIP LVN_GETINFOTIPA - #define NMLVGETINFOTIP NMLVGETINFOTIPA - #define LPNMLVGETINFOTIP LPNMLVGETINFOTIPA - #endif - - #endif // NOLISTVIEW - - //====== TREEVIEW CONTROL ===================================================== - - #ifndef NOTREEVIEW - - #define WC_TREEVIEWA "SysTreeView32" - #define WC_TREEVIEWW L"SysTreeView32" - - #ifdef UNICODE - #define WC_TREEVIEW WC_TREEVIEWW - #else - #define WC_TREEVIEW WC_TREEVIEWA - #endif - - // begin_r_commctrl - - #define TVS_HASBUTTONS 1 - #define TVS_HASLINES 2 - #define TVS_LINESATROOT 4 - #define TVS_EDITLABELS 8 - #define TVS_DISABLEDRAGDROP 16 - #define TVS_SHOWSELALWAYS 32 - #define TVS_RTLREADING 64 - - #define TVS_NOTOOLTIPS 128 - #define TVS_CHECKBOXES 256 - #define TVS_TRACKSELECT 512 - #define TVS_SINGLEEXPAND 1024 - #define TVS_INFOTIP 2048 - #define TVS_FULLROWSELECT 4096 - #define TVS_NOSCROLL 8192 - #define TVS_NONEVENHEIGHT 16384 - #define TVS_NOHSCROLL 32768 // TVS_NOSCROLL overrides this - - // end_r_commctrl - - - #define TVIF_TEXT 1 - #define TVIF_IMAGE 2 - #define TVIF_PARAM 4 - #define TVIF_STATE 8 - #define TVIF_HANDLE 16 - #define TVIF_SELECTEDIMAGE 32 - #define TVIF_CHILDREN 64 - #define TVIF_INTEGRAL 128 - #define TVIS_SELECTED 2 - #define TVIS_CUT 4 - #define TVIS_DROPHILITED 8 - #define TVIS_BOLD 16 - #define TVIS_EXPANDED 32 - #define TVIS_EXPANDEDONCE 64 - #define TVIS_EXPANDPARTIAL 128 - - #define TVIS_OVERLAYMASK 3840 - #define TVIS_STATEIMAGEMASK 61440 - #define TVIS_USERMASK 61440 - - #define I_CHILDRENCALLBACK (-1) - - #define LPTV_ITEMW LPTVITEMW - #define LPTV_ITEMA LPTVITEMA - #define TV_ITEMW TVITEMW - #define TV_ITEMA TVITEMA - - #define LPTV_ITEM LPTVITEM - #define TV_ITEM TVITEM - - - #ifdef UNICODE - #define TVITEM TVITEMW - #define LPTVITEM LPTVITEMW - #else - #define TVITEM TVITEMA - #define LPTVITEM LPTVITEMA - #endif - - #define TVI_ROOT (-0x10000) - #define TVI_FIRST (-0x0FFFF) - #define TVI_LAST (-0x0FFFE) - #define TVI_SORT (-0x0FFFD) - - #define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA - #define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW - #define TV_INSERTSTRUCTA TVINSERTSTRUCTA - #define TV_INSERTSTRUCTW TVINSERTSTRUCTW - - #define TV_INSERTSTRUCT TVINSERTSTRUCT - #define LPTV_INSERTSTRUCT LPTVINSERTSTRUCT - - - #define TVINSERTSTRUCTA_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item) - #define TVINSERTSTRUCTW_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item) - - - - #ifdef UNICODE - #define TVINSERTSTRUCT TVINSERTSTRUCTW - #define LPTVINSERTSTRUCT LPTVINSERTSTRUCTW - #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE - #else - #define TVINSERTSTRUCT TVINSERTSTRUCTA - #define LPTVINSERTSTRUCT LPTVINSERTSTRUCTA - #define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE - #endif - - #define TVM_INSERTITEMA (TV_FIRST + 0) - #define TVM_INSERTITEMW (TV_FIRST + 50) - #ifdef UNICODE - #define TVM_INSERTITEM TVM_INSERTITEMW - #else - #define TVM_INSERTITEM TVM_INSERTITEMA - #endif - - #define TreeView_InsertItem(hwnd, lpis) \ - - - #define TVM_DELETEITEM (TV_FIRST + 1) - #define TreeView_DeleteItem(hwnd, hitem) \ - - - #define TreeView_DeleteAllItems(hwnd) \ - - - #define TVM_EXPAND (TV_FIRST + 2) - #define TreeView_Expand(hwnd, hitem, code) \ - - - #define TVE_COLLAPSE 1 - #define TVE_EXPAND 2 - #define TVE_TOGGLE 3 - #define TVE_EXPANDPARTIAL 16384 - #define TVE_COLLAPSERESET 32768 - - - #define TVM_GETITEMRECT (TV_FIRST + 4) - #define TreeView_GetItemRect(hwnd, hitem, prc, code) \ - - - #define TVM_GETCOUNT (TV_FIRST + 5) - #define TreeView_GetCount(hwnd) \ - - - #define TVM_GETINDENT (TV_FIRST + 6) - #define TreeView_GetIndent(hwnd) \ - - - #define TVM_SETINDENT (TV_FIRST + 7) - #define TreeView_SetIndent(hwnd, indent) \ - - - #define TVM_GETIMAGELIST (TV_FIRST + 8) - #define TreeView_GetImageList(hwnd, iImage) \ - - - #define TVSIL_NORMAL 0 - #define TVSIL_STATE 2 - - - #define TVM_SETIMAGELIST (TV_FIRST + 9) - #define TreeView_SetImageList(hwnd, himl, iImage) \ - - - #define TVM_GETNEXTITEM (TV_FIRST + 10) - #define TreeView_GetNextItem(hwnd, hitem, code) \ - - - #define TVGN_ROOT 0 - #define TVGN_NEXT 1 - #define TVGN_PREVIOUS 2 - #define TVGN_PARENT 3 - #define TVGN_CHILD 4 - #define TVGN_FIRSTVISIBLE 5 - #define TVGN_NEXTVISIBLE 6 - #define TVGN_PREVIOUSVISIBLE 7 - #define TVGN_DROPHILITE 8 - #define TVGN_CARET 9 - #define TVGN_LASTVISIBLE 10 - - #define TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD) - #define TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT) - #define TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS) - #define TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT) - #define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE) - #define TreeView_GetNextVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE) - #define TreeView_GetPrevVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE) - #define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_CARET) - #define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE) - #define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT) - #define TreeView_GetLastVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE) - - - #define TVM_SELECTITEM (TV_FIRST + 11) - #define TreeView_Select(hwnd, hitem, code) \ - - - #define TreeView_SelectItem(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_CARET) - #define TreeView_SelectDropTarget(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_DROPHILITE) - #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE) - - #define TVM_GETITEMA (TV_FIRST + 12) - #define TVM_GETITEMW (TV_FIRST + 62) - - #ifdef UNICODE - #define TVM_GETITEM TVM_GETITEMW - #else - #define TVM_GETITEM TVM_GETITEMA - #endif - - #define TreeView_GetItem(hwnd, pitem) \ - - - #define TVM_SETITEMA (TV_FIRST + 13) - #define TVM_SETITEMW (TV_FIRST + 63) - - #ifdef UNICODE - #define TVM_SETITEM TVM_SETITEMW - #else - #define TVM_SETITEM TVM_SETITEMA - #endif - - #define TreeView_SetItem(hwnd, pitem) \ - - - #define TVM_EDITLABELA (TV_FIRST + 14) - #define TVM_EDITLABELW (TV_FIRST + 65) - #ifdef UNICODE - #define TVM_EDITLABEL TVM_EDITLABELW - #else - #define TVM_EDITLABEL TVM_EDITLABELA - #endif - - #define TreeView_EditLabel(hwnd, hitem) \ - - - #define TVM_GETEDITCONTROL (TV_FIRST + 15) - #define TreeView_GetEditControl(hwnd) \ - - - #define TVM_GETVISIBLECOUNT (TV_FIRST + 16) - #define TreeView_GetVisibleCount(hwnd) \ - - - #define TVM_HITTEST (TV_FIRST + 17) - - - #define LPTV_HITTESTINFO LPTVHITTESTINFO - #define TV_HITTESTINFO TVHITTESTINFO - - #define TVHT_NOWHERE 1 - #define TVHT_ONITEMICON 2 - #define TVHT_ONITEMLABEL 4 - #define TVHT_ONITEM (TVHT_ONITEMICON + TVHT_ONITEMLABEL + TVHT_ONITEMSTATEICON) - #define TVHT_ONITEMINDENT 8 - #define TVHT_ONITEMBUTTON 16 - #define TVHT_ONITEMRIGHT 32 - #define TVHT_ONITEMSTATEICON 64 - - #define TVHT_ABOVE 256 - #define TVHT_BELOW 512 - #define TVHT_TORIGHT 1024 - #define TVHT_TOLEFT 2048 - - - #define TVM_CREATEDRAGIMAGE (TV_FIRST + 18) - #define TreeView_CreateDragImage(hwnd, hitem) \ - - - #define TVM_SORTCHILDREN (TV_FIRST + 19) - #define TreeView_SortChildren(hwnd, hitem, recurse) \ - - - #define TVM_ENSUREVISIBLE (TV_FIRST + 20) - #define TreeView_EnsureVisible(hwnd, hitem) \ - - - #define TVM_SORTCHILDRENCB (TV_FIRST + 21) - #define TreeView_SortChildrenCB(hwnd, psort, recurse) \ - - - #define TVM_ENDEDITLABELNOW (TV_FIRST + 22) - #define TreeView_EndEditLabelNow(hwnd, fCancel) \ - - - #define TVM_GETISEARCHSTRINGA (TV_FIRST + 23) - #define TVM_GETISEARCHSTRINGW (TV_FIRST + 64) - - #ifdef UNICODE - #define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW - #else - #define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA - #endif - - #define TVM_SETTOOLTIPS (TV_FIRST + 24) - #define TreeView_SetToolTips(hwnd, hwndTT) \ - - #define TVM_GETTOOLTIPS (TV_FIRST + 25) - #define TreeView_GetToolTips(hwnd) \ - - #define TreeView_GetISearchString(hwndTV, lpsz) \ - - - #define TVM_SETINSERTMARK (TV_FIRST + 26) - #define TreeView_SetInsertMark(hwnd, hItem, fAfter) \ - - - #define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define TreeView_SetUnicodeFormat(hwnd, fUnicode) \ - - - #define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - #define TreeView_GetUnicodeFormat(hwnd) \ - - #define TVM_SETITEMHEIGHT (TV_FIRST + 27) - #define TreeView_SetItemHeight(hwnd, iHeight) \ - - #define TVM_GETITEMHEIGHT (TV_FIRST + 28) - #define TreeView_GetItemHeight(hwnd) \ - - - #define TVM_SETBKCOLOR (TV_FIRST + 29) - #define TreeView_SetBkColor(hwnd, clr) \ - - - #define TVM_SETTEXTCOLOR (TV_FIRST + 30) - #define TreeView_SetTextColor(hwnd, clr) \ - - - #define TVM_GETBKCOLOR (TV_FIRST + 31) - #define TreeView_GetBkColor(hwnd) \ - - - #define TVM_GETTEXTCOLOR (TV_FIRST + 32) - #define TreeView_GetTextColor(hwnd) \ - - - #define TVM_SETSCROLLTIME (TV_FIRST + 33) - #define TreeView_SetScrollTime(hwnd, uTime) \ - - - #define TVM_GETSCROLLTIME (TV_FIRST + 34) - #define TreeView_GetScrollTime(hwnd) \ - - - #define TVM_SETINSERTMARKCOLOR (TV_FIRST + 37) - #define TreeView_SetInsertMarkColor(hwnd, clr) \ - - #define TVM_GETINSERTMARKCOLOR (TV_FIRST + 38) - #define TreeView_GetInsertMarkColor(hwnd) \ - - - // tvm_?etitemstate only uses mask, state and stateMask. - // so unicode or ansi is irrelevant. - #define TreeView_SetItemState(hwndTV, hti, data, _mask) \ - - - #define TreeView_SetCheckState(hwndTV, hti, fCheck) \ - - - #define TVM_GETITEMSTATE (TV_FIRST + 39) - #define TreeView_GetItemState(hwndTV, hti, mask) \ - - - #define TreeView_GetCheckState(hwndTV, hti) \ - - - #define TVM_SETLINECOLOR (TV_FIRST + 40) - #define TreeView_SetLineColor(hwnd, clr) \ - - - #define TVM_GETLINECOLOR (TV_FIRST + 41) - #define TreeView_GetLineColor(hwnd) \ - - - #define LPTV_SORTCB LPTVSORTCB - #define TV_SORTCB TVSORTCB - - - #define LPNM_TREEVIEWA LPNMTREEVIEWA - #define LPNM_TREEVIEWW LPNMTREEVIEWW - #define NM_TREEVIEWW NMTREEVIEWW - #define NM_TREEVIEWA NMTREEVIEWA - - #define LPNM_TREEVIEW LPNMTREEVIEW - #define NM_TREEVIEW NMTREEVIEW - - - #ifdef UNICODE - #define NMTREEVIEW NMTREEVIEWW - #define LPNMTREEVIEW LPNMTREEVIEWW - #else - #define NMTREEVIEW NMTREEVIEWA - #define LPNMTREEVIEW LPNMTREEVIEWA - #endif - - - #define TVN_SELCHANGINGA (TVN_FIRST-1) - #define TVN_SELCHANGINGW (TVN_FIRST-50) - #define TVN_SELCHANGEDA (TVN_FIRST-2) - #define TVN_SELCHANGEDW (TVN_FIRST-51) - - #define TVC_UNKNOWN 0 - #define TVC_BYMOUSE 1 - #define TVC_BYKEYBOARD 2 - - #define TVN_GETDISPINFOA (TVN_FIRST-3) - #define TVN_GETDISPINFOW (TVN_FIRST-52) - #define TVN_SETDISPINFOA (TVN_FIRST-4) - #define TVN_SETDISPINFOW (TVN_FIRST-53) - - #define TVIF_DI_SETITEM 4096 - - #define TV_DISPINFOA NMTVDISPINFOA - #define TV_DISPINFOW NMTVDISPINFOW - - #define TV_DISPINFO NMTVDISPINFO - - - #ifdef UNICODE - #define NMTVDISPINFO NMTVDISPINFOW - #define LPNMTVDISPINFO LPNMTVDISPINFOW - #else - #define NMTVDISPINFO NMTVDISPINFOA - #define LPNMTVDISPINFO LPNMTVDISPINFOA - #endif - - #define TVN_ITEMEXPANDINGA (TVN_FIRST-5) - #define TVN_ITEMEXPANDINGW (TVN_FIRST-54) - #define TVN_ITEMEXPANDEDA (TVN_FIRST-6) - #define TVN_ITEMEXPANDEDW (TVN_FIRST-55) - #define TVN_BEGINDRAGA (TVN_FIRST-7) - #define TVN_BEGINDRAGW (TVN_FIRST-56) - #define TVN_BEGINRDRAGA (TVN_FIRST-8) - #define TVN_BEGINRDRAGW (TVN_FIRST-57) - #define TVN_DELETEITEMA (TVN_FIRST-9) - #define TVN_DELETEITEMW (TVN_FIRST-58) - #define TVN_BEGINLABELEDITA (TVN_FIRST-10) - #define TVN_BEGINLABELEDITW (TVN_FIRST-59) - #define TVN_ENDLABELEDITA (TVN_FIRST-11) - #define TVN_ENDLABELEDITW (TVN_FIRST-60) - #define TVN_KEYDOWN (TVN_FIRST-12) - - #define TVN_GETINFOTIPA (TVN_FIRST-13) - #define TVN_GETINFOTIPW (TVN_FIRST-14) - #define TVN_SINGLEEXPAND (TVN_FIRST-15) - - #define TVNRET_DEFAULT 0 - #define TVNRET_SKIPOLD 1 - #define TVNRET_SKIPNEW 2 - - - #define TV_KEYDOWN NMTVKEYDOWN - - - #ifdef UNICODE - #define TVN_SELCHANGING TVN_SELCHANGINGW - #define TVN_SELCHANGED TVN_SELCHANGEDW - #define TVN_GETDISPINFO TVN_GETDISPINFOW - #define TVN_SETDISPINFO TVN_SETDISPINFOW - #define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW - #define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW - #define TVN_BEGINDRAG TVN_BEGINDRAGW - #define TVN_BEGINRDRAG TVN_BEGINRDRAGW - #define TVN_DELETEITEM TVN_DELETEITEMW - #define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW - #define TVN_ENDLABELEDIT TVN_ENDLABELEDITW - #else - #define TVN_SELCHANGING TVN_SELCHANGINGA - #define TVN_SELCHANGED TVN_SELCHANGEDA - #define TVN_GETDISPINFO TVN_GETDISPINFOA - #define TVN_SETDISPINFO TVN_SETDISPINFOA - #define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA - #define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA - #define TVN_BEGINDRAG TVN_BEGINDRAGA - #define TVN_BEGINRDRAG TVN_BEGINRDRAGA - #define TVN_DELETEITEM TVN_DELETEITEMA - #define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA - #define TVN_ENDLABELEDIT TVN_ENDLABELEDITA - #endif - - #define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk) - - // for tooltips - - - #ifdef UNICODE - #define TVN_GETINFOTIP TVN_GETINFOTIPW - #define NMTVGETINFOTIP NMTVGETINFOTIPW - #define LPNMTVGETINFOTIP LPNMTVGETINFOTIPW - #else - #define TVN_GETINFOTIP TVN_GETINFOTIPA - #define NMTVGETINFOTIP NMTVGETINFOTIPA - #define LPNMTVGETINFOTIP LPNMTVGETINFOTIPA - #endif - - // treeview's customdraw return meaning don't draw images. valid on CDRF_NOTIFYITEMPREPAINT - #define TVCDRF_NOIMAGES 65536 - - #endif // NOTREEVIEW - - - #ifndef NOUSEREXCONTROLS - - //////////////////// ComboBoxEx //////////////////////////////// - - - #define WC_COMBOBOXEXW L"ComboBoxEx32" - #define WC_COMBOBOXEXA "ComboBoxEx32" - - #ifdef UNICODE - #define WC_COMBOBOXEX WC_COMBOBOXEXW - #else - #define WC_COMBOBOXEX WC_COMBOBOXEXA - #endif - - #define CBEIF_TEXT 1 - #define CBEIF_IMAGE 2 - #define CBEIF_SELECTEDIMAGE 4 - #define CBEIF_OVERLAY 8 - #define CBEIF_INDENT 16 - #define CBEIF_LPARAM 32 - - #define CBEIF_DI_SETITEM 268435456 - - - #ifdef UNICODE - #define COMBOBOXEXITEM COMBOBOXEXITEMW - #define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW - #define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW - #else - #define COMBOBOXEXITEM COMBOBOXEXITEMA - #define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA - #define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA - #endif - - #define CBEM_INSERTITEMA (WM_USER + 1) - #define CBEM_SETIMAGELIST (WM_USER + 2) - #define CBEM_GETIMAGELIST (WM_USER + 3) - #define CBEM_GETITEMA (WM_USER + 4) - #define CBEM_SETITEMA (WM_USER + 5) - #define CBEM_DELETEITEM CB_DELETESTRING - #define CBEM_GETCOMBOCONTROL (WM_USER + 6) - #define CBEM_GETEDITCONTROL (WM_USER + 7) - #define CBEM_SETEXSTYLE (WM_USER + 8) // use SETEXTENDEDSTYLE instead - #define CBEM_SETEXTENDEDSTYLE (WM_USER + 14) // lparam == new style, wParam (optional) == mask - #define CBEM_GETEXSTYLE (WM_USER + 9) // use GETEXTENDEDSTYLE instead - #define CBEM_GETEXTENDEDSTYLE (WM_USER + 9) - #define CBEM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define CBEM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - #define CBEM_HASEDITCHANGED (WM_USER + 10) - #define CBEM_INSERTITEMW (WM_USER + 11) - #define CBEM_SETITEMW (WM_USER + 12) - #define CBEM_GETITEMW (WM_USER + 13) - - #ifdef UNICODE - #define CBEM_INSERTITEM CBEM_INSERTITEMW - #define CBEM_SETITEM CBEM_SETITEMW - #define CBEM_GETITEM CBEM_GETITEMW - #else - #define CBEM_INSERTITEM CBEM_INSERTITEMA - #define CBEM_SETITEM CBEM_SETITEMA - #define CBEM_GETITEM CBEM_GETITEMA - #endif - - #define CBES_EX_NOEDITIMAGE 1 - #define CBES_EX_NOEDITIMAGEINDENT 2 - #define CBES_EX_PATHWORDBREAKPROC 4 - #define CBES_EX_NOSIZELIMIT 8 - #define CBES_EX_CASESENSITIVE 16 - - - #ifdef UNICODE - #define NMCOMBOBOXEX NMCOMBOBOXEXW - #define PNMCOMBOBOXEX PNMCOMBOBOXEXW - #define CBEN_GETDISPINFO CBEN_GETDISPINFOW - #else - #define NMCOMBOBOXEX NMCOMBOBOXEXA - #define PNMCOMBOBOXEX PNMCOMBOBOXEXA - #define CBEN_GETDISPINFO CBEN_GETDISPINFOA - #endif - - #define CBEN_GETDISPINFOA (CBEN_FIRST - 0) - #define CBEN_INSERTITEM (CBEN_FIRST - 1) - #define CBEN_DELETEITEM (CBEN_FIRST - 2) - #define CBEN_BEGINEDIT (CBEN_FIRST - 4) - #define CBEN_ENDEDITA (CBEN_FIRST - 5) - #define CBEN_ENDEDITW (CBEN_FIRST - 6) - - #define CBEN_GETDISPINFOW (CBEN_FIRST - 7) - - #define CBEN_DRAGBEGINA (CBEN_FIRST - 8) - #define CBEN_DRAGBEGINW (CBEN_FIRST - 9) - - #ifdef UNICODE - #define CBEN_DRAGBEGIN CBEN_DRAGBEGINW - #else - #define CBEN_DRAGBEGIN CBEN_DRAGBEGINA - #endif - - // lParam specifies why the endedit is happening - #ifdef UNICODE - #define CBEN_ENDEDIT CBEN_ENDEDITW - #else - #define CBEN_ENDEDIT CBEN_ENDEDITA - #endif - - #define CBENF_KILLFOCUS 1 - #define CBENF_RETURN 2 - #define CBENF_ESCAPE 3 - #define CBENF_DROPDOWN 4 - - #define CBEMAXSTRLEN 260 - - // CBEN_DRAGBEGIN sends this information ... - - - #ifdef UNICODE - #define NMCBEDRAGBEGIN NMCBEDRAGBEGINW - #define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW - #define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW - #else - #define NMCBEDRAGBEGIN NMCBEDRAGBEGINA - #define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA - #define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA - #endif - - // CBEN_ENDEDIT sends this information... - // fChanged if the user actually did anything - // iNewSelection gives what would be the new selection unless the notify is failed - // iNewSelection may be CB_ERR if there's no match - - - #ifdef UNICODE - #define NMCBEENDEDIT NMCBEENDEDITW - #define LPNMCBEENDEDIT LPNMCBEENDEDITW - #define PNMCBEENDEDIT PNMCBEENDEDITW - #else - #define NMCBEENDEDIT NMCBEENDEDITA - #define LPNMCBEENDEDIT LPNMCBEENDEDITA - #define PNMCBEENDEDIT PNMCBEENDEDITA - #endif - - #endif //NOUSEREXCONTROLS - - //====== TAB CONTROL ========================================================== - - #ifndef NOTABCONTROL - - #define WC_TABCONTROLA "SysTabControl32" - #define WC_TABCONTROLW L"SysTabControl32" - - #ifdef UNICODE - #define WC_TABCONTROL WC_TABCONTROLW - #else - #define WC_TABCONTROL WC_TABCONTROLA - #endif - - // begin_r_commctrl - - #define TCS_SCROLLOPPOSITE 1 // assumes multiline tab - #define TCS_BOTTOM 2 - #define TCS_RIGHT 2 - #define TCS_MULTISELECT 4 // allow multi-select in button mode - #define TCS_FLATBUTTONS 8 - #define TCS_FORCEICONLEFT 16 - #define TCS_FORCELABELLEFT 32 - #define TCS_HOTTRACK 64 - #define TCS_VERTICAL 128 - #define TCS_TABS 0 - #define TCS_BUTTONS 256 - #define TCS_SINGLELINE 0 - #define TCS_MULTILINE 512 - #define TCS_RIGHTJUSTIFY 0 - #define TCS_FIXEDWIDTH 1024 - #define TCS_RAGGEDRIGHT 2048 - #define TCS_FOCUSONBUTTONDOWN 4096 - #define TCS_OWNERDRAWFIXED 8192 - #define TCS_TOOLTIPS 16384 - #define TCS_FOCUSNEVER 32768 - - // end_r_commctrl - - // EX styles for use with TCM_SETEXTENDEDSTYLE - #define TCS_EX_FLATSEPARATORS 1 - #define TCS_EX_REGISTERDROP 2 - - - #define TCM_GETIMAGELIST (TCM_FIRST + 2) - //#define TabCtrl_GetImageList(hwnd) \ - - - #define TCM_SETIMAGELIST (TCM_FIRST + 3) - //#define TabCtrl_SetImageList(hwnd, himl) \ - - - #define TCM_GETITEMCOUNT (TCM_FIRST + 4) - //#define TabCtrl_GetItemCount(hwnd) \ - - - #define TCIF_TEXT 1 - #define TCIF_IMAGE 2 - #define TCIF_RTLREADING 4 - #define TCIF_PARAM 8 - #define TCIF_STATE 16 - - - #define TCIS_BUTTONPRESSED 1 - #define TCIS_HIGHLIGHTED 2 - - #define TC_ITEMHEADERA TCITEMHEADERA - #define TC_ITEMHEADERW TCITEMHEADERW - #define TC_ITEMHEADER TCITEMHEADER - - - #ifdef UNICODE - #define TCITEMHEADER TCITEMHEADERW - #define LPTCITEMHEADER LPTCITEMHEADERW - #else - #define TCITEMHEADER TCITEMHEADERA - #define LPTCITEMHEADER LPTCITEMHEADERA - #endif - - - #define TC_ITEMA TCITEMA - #define TC_ITEMW TCITEMW - #define TC_ITEM TCITEM - - - #ifdef UNICODE - #define TCITEM TCITEMW - #define LPTCITEM LPTCITEMW - #else - #define TCITEM TCITEMA - #define LPTCITEM LPTCITEMA - #endif - - - #define TCM_GETITEMA (TCM_FIRST + 5) - #define TCM_GETITEMW (TCM_FIRST + 60) - - #ifdef UNICODE - #define TCM_GETITEM TCM_GETITEMW - #else - #define TCM_GETITEM TCM_GETITEMA - #endif - - //#define TabCtrl_GetItem(hwnd, iItem, pitem) \ - - - #define TCM_SETITEMA (TCM_FIRST + 6) - #define TCM_SETITEMW (TCM_FIRST + 61) - - #ifdef UNICODE - #define TCM_SETITEM TCM_SETITEMW - #else - #define TCM_SETITEM TCM_SETITEMA - #endif - - //#define TabCtrl_SetItem(hwnd, iItem, pitem) \ - - - #define TCM_INSERTITEMA (TCM_FIRST + 7) - #define TCM_INSERTITEMW (TCM_FIRST + 62) - - #ifdef UNICODE - #define TCM_INSERTITEM TCM_INSERTITEMW - #else - #define TCM_INSERTITEM TCM_INSERTITEMA - #endif - - //#define TabCtrl_InsertItem(hwnd, iItem, pitem) \ - - - #define TCM_DELETEITEM (TCM_FIRST + 8) - //#define TabCtrl_DeleteItem(hwnd, i) \ - - - #define TCM_DELETEALLITEMS (TCM_FIRST + 9) - //#define TabCtrl_DeleteAllItems(hwnd) \ - - - #define TCM_GETITEMRECT (TCM_FIRST + 10) - //#define TabCtrl_GetItemRect(hwnd, i, prc) \ - - - #define TCM_GETCURSEL (TCM_FIRST + 11) - //#define TabCtrl_GetCurSel(hwnd) \ - - - #define TCM_SETCURSEL (TCM_FIRST + 12) - //#define TabCtrl_SetCurSel(hwnd, i) \ - - - #define TCHT_NOWHERE 1 - #define TCHT_ONITEMICON 2 - #define TCHT_ONITEMLABEL 4 - #define TCHT_ONITEM (TCHT_ONITEMICON + TCHT_ONITEMLABEL) - - #define LPTC_HITTESTINFO LPTCHITTESTINFO - #define TC_HITTESTINFO TCHITTESTINFO - - #define TCM_HITTEST (TCM_FIRST + 13) - //#define TabCtrl_HitTest(hwndTC, pinfo) \ - - - #define TCM_SETITEMEXTRA (TCM_FIRST + 14) - //#define TabCtrl_SetItemExtra(hwndTC, cb) \ - - - #define TCM_ADJUSTRECT (TCM_FIRST + 40) - //#define TabCtrl_AdjustRect(hwnd, bLarger, prc) \ - - - #define TCM_SETITEMSIZE (TCM_FIRST + 41) - //#define TabCtrl_SetItemSize(hwnd, x, y) \ - - - #define TCM_REMOVEIMAGE (TCM_FIRST + 42) - //#define TabCtrl_RemoveImage(hwnd, i) \ - - - #define TCM_SETPADDING (TCM_FIRST + 43) - //#define TabCtrl_SetPadding(hwnd, cx, cy) \ - - - #define TCM_GETROWCOUNT (TCM_FIRST + 44) - //#define TabCtrl_GetRowCount(hwnd) \ - - - #define TCM_GETTOOLTIPS (TCM_FIRST + 45) - //#define TabCtrl_GetToolTips(hwnd) \ - - - #define TCM_SETTOOLTIPS (TCM_FIRST + 46) - //#define TabCtrl_SetToolTips(hwnd, hwndTT) \ - - - #define TCM_GETCURFOCUS (TCM_FIRST + 47) - //#define TabCtrl_GetCurFocus(hwnd) \ - - - #define TCM_SETCURFOCUS (TCM_FIRST + 48) - //#define TabCtrl_SetCurFocus(hwnd, i) \ - - - #define TCM_SETMINTABWIDTH (TCM_FIRST + 49) - //#define TabCtrl_SetMinTabWidth(hwnd, x) \ - - - #define TCM_DESELECTALL (TCM_FIRST + 50) - //#define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\ - - #define TCM_HIGHLIGHTITEM (TCM_FIRST + 51) - //#define TabCtrl_HighlightItem(hwnd, i, fHighlight) \ - - - #define TCM_SETEXTENDEDSTYLE (TCM_FIRST + 52) // optional wParam == mask - //#define TabCtrl_SetExtendedStyle(hwnd, dw)\ - - - #define TCM_GETEXTENDEDSTYLE (TCM_FIRST + 53) - //#define TabCtrl_GetExtendedStyle(hwnd)\ - - - #define TCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - //#define TabCtrl_SetUnicodeFormat(hwnd, fUnicode) \ - - - #define TCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - //#define TabCtrl_GetUnicodeFormat(hwnd) \ - - - #define TCN_KEYDOWN (TCN_FIRST - 0) - - #define TC_KEYDOWN NMTCKEYDOWN - - #define TCN_SELCHANGE (TCN_FIRST - 1) - #define TCN_SELCHANGING (TCN_FIRST - 2) - #define TCN_GETOBJECT (TCN_FIRST - 3) - #define TCN_FOCUSCHANGE (TCN_FIRST - 4) - - #endif // NOTABCONTROL - - - //====== ANIMATE CONTROL ====================================================== - - #ifndef NOANIMATE - - #define ANIMATE_CLASSW L"SysAnimate32" - #define ANIMATE_CLASSA "SysAnimate32" - - #ifdef UNICODE - #define ANIMATE_CLASS ANIMATE_CLASSW - #else - #define ANIMATE_CLASS ANIMATE_CLASSA - #endif - - // begin_r_commctrl - - #define ACS_CENTER 1 - #define ACS_TRANSPARENT 2 - #define ACS_AUTOPLAY 4 - #define ACS_TIMER 8 // don't use threads... use timers - - // end_r_commctrl - - #define ACM_OPENA (WM_USER+100) - #define ACM_OPENW (WM_USER+103) - - #ifdef UNICODE - #define ACM_OPEN ACM_OPENW - #else - #define ACM_OPEN ACM_OPENA - #endif - - #define ACM_PLAY (WM_USER+101) - #define ACM_STOP (WM_USER+102) - - - #define ACN_START 1 - #define ACN_STOP 2 - - - #define Animate_Create(hwndP, id, dwStyle, hInstance) \ - - - #define Animate_Open(hwnd, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName)) - #define Animate_OpenEx(hwnd, hInst, szName) (BOOL)SNDMSG(hwnd, ACM_OPEN, (WPARAM)(hInst), (LPARAM)(LPTSTR)(szName)) - #define Animate_Play(hwnd, from, to, rep) (BOOL)SNDMSG(hwnd, ACM_PLAY, (WPARAM)(rep), (LPARAM)MAKELONG(from, to)) - #define Animate_Stop(hwnd) (BOOL)SNDMSG(hwnd, ACM_STOP, 0, 0) - #define Animate_Close(hwnd) Animate_Open(hwnd, NULL) - #define Animate_Seek(hwnd, frame) Animate_Play(hwnd, frame, frame, 1) - - #endif // NOANIMATE - - //====== MONTHCAL CONTROL ====================================================== - - #ifndef NOMONTHCAL - - #define MONTHCAL_CLASSW L"SysMonthCal32" - #define MONTHCAL_CLASSA "SysMonthCal32" - - #ifdef UNICODE - #define MONTHCAL_CLASS MONTHCAL_CLASSW - #else - #define MONTHCAL_CLASS MONTHCAL_CLASSA - #endif - - // bit-packed array of "bold" info for a month - // if a bit is on, that day is drawn bold - - - #define MCM_FIRST 4096 - - // BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst) - // returns FALSE if MCS_MULTISELECT - // returns TRUE and sets *pst to the currently selected date otherwise - #define MCM_GETCURSEL (MCM_FIRST + 1) - #define MonthCal_GetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst)) - - // BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst) - // returns FALSE if MCS_MULTISELECT - // returns TURE and sets the currently selected date to *pst otherwise - #define MCM_SETCURSEL (MCM_FIRST + 2) - #define MonthCal_SetCurSel(hmc, pst) (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst)) - - // DWORD MonthCal_GetMaxSelCount(HWND hmc) - // returns the maximum number of selectable days allowed - #define MCM_GETMAXSELCOUNT (MCM_FIRST + 3) - #define MonthCal_GetMaxSelCount(hmc) (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L) - - // BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n) - // sets the max number days that can be selected iff MCS_MULTISELECT - #define MCM_SETMAXSELCOUNT (MCM_FIRST + 4) - #define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L) - - // BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst) - // sets rgst[0] to the first day of the selection range - // sets rgst[1] to the last day of the selection range - #define MCM_GETSELRANGE (MCM_FIRST + 5) - #define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM)(rgst)) - - // BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst) - // selects the range of days from rgst[0] to rgst[1] - #define MCM_SETSELRANGE (MCM_FIRST + 6) - #define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst)) - - // DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst) - // if rgst specified, sets rgst[0] to the starting date and - // and rgst[1] to the ending date of the the selectable (non-grayed) - // days if GMR_VISIBLE or all the displayed days (including grayed) - // if GMR_DAYSTATE. - // returns the number of months spanned by the above range. - #define MCM_GETMONTHRANGE (MCM_FIRST + 7) - #define MonthCal_GetMonthRange(hmc, gmr, rgst) (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst)) - - // BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds) - // cbds is the count of DAYSTATE items in rgds and it must be equal - // to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL) - // This sets the DAYSTATE bits for each month (grayed and non-grayed - // days) displayed in the calendar. The first bit in a month's DAYSTATE - // corresponts to bolding day 1, the second bit affects day 2, etc. - #define MCM_SETDAYSTATE (MCM_FIRST + 8) - #define MonthCal_SetDayState(hmc, cbds, rgds) SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds)) - - // BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc) - // sets *prc the minimal size needed to display one month - // To display two months, undo the AdjustWindowRect calculation already done to - // this rect, double the width, and redo the AdjustWindowRect calculation -- - // the monthcal control will display two calendars in this window (if you also - // double the vertical size, you will get 4 calendars) - // NOTE: if you want to gurantee that the "Today" string is not clipped, - // get the MCM_GETMAXTODAYWIDTH and use the max of that width and this width - #define MCM_GETMINREQRECT (MCM_FIRST + 9) - #define MonthCal_GetMinReqRect(hmc, prc) SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc)) - - // set colors to draw control with -- see MCSC_ bits below - #define MCM_SETCOLOR (MCM_FIRST + 10) - #define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr) - - #define MCM_GETCOLOR (MCM_FIRST + 11) - #define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_GETCOLOR, iColor, 0) - - #define MCSC_BACKGROUND 0 // the background color (between months) - #define MCSC_TEXT 1 // the dates - #define MCSC_TITLEBK 2 // background of the title - #define MCSC_TITLETEXT 3 - #define MCSC_MONTHBK 4 // background within the month cal - #define MCSC_TRAILINGTEXT 5 // the text color of header & trailing days - - // set what day is "today" send NULL to revert back to real date - #define MCM_SETTODAY (MCM_FIRST + 12) - #define MonthCal_SetToday(hmc, pst) SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)(pst)) - - // get what day is "today" - // returns BOOL for success/failure - #define MCM_GETTODAY (MCM_FIRST + 13) - #define MonthCal_GetToday(hmc, pst) (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)(pst)) - - // determine what pinfo->pt is over - #define MCM_HITTEST (MCM_FIRST + 14) - #define MonthCal_HitTest(hmc, pinfo) \ - - - // out param - - - #define MCHT_TITLE 65536 - #define MCHT_CALENDAR 131072 - #define MCHT_TODAYLINK 196608 - - #define MCHT_NEXT 16777216 // these indicate that hitting - #define MCHT_PREV 33554432 // here will go to the next/prev month - - #define MCHT_NOWHERE 0 - - #define MCHT_TITLEBK (MCHT_TITLE) - #define MCHT_TITLEMONTH (MCHT_TITLE + 1) - #define MCHT_TITLEYEAR (MCHT_TITLE + 2) - #define MCHT_TITLEBTNNEXT (MCHT_TITLE + MCHT_NEXT + 3) - #define MCHT_TITLEBTNPREV (MCHT_TITLE + MCHT_PREV + 3) - - #define MCHT_CALENDARBK (MCHT_CALENDAR) - #define MCHT_CALENDARDATE (MCHT_CALENDAR + 1) - #define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE + MCHT_NEXT) - #define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE + MCHT_PREV) - #define MCHT_CALENDARDAY (MCHT_CALENDAR + 2) - #define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR + 3) - - // set first day of week to iDay: - // 0 for Monday, 1 for Tuesday, ..., 6 for Sunday - // -1 for means use locale info - #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15) - #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \ - - - // DWORD result... low word has the day. high word is bool if this is app set - // or not (FALSE == using locale info) - #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16) - #define MonthCal_GetFirstDayOfWeek(hmc) \ - - - // DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst) - // modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum) - // modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum) - // returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit - #define MCM_GETRANGE (MCM_FIRST + 17) - #define MonthCal_GetRange(hmc, rgst) \ - - - // BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst) - // if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum - // if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum - // returns TRUE on success, FALSE on error (such as invalid parameters) - #define MCM_SETRANGE (MCM_FIRST + 18) - #define MonthCal_SetRange(hmc, gd, rgst) \ - - - // int MonthCal_GetMonthDelta(HWND hmc) - // returns the number of months one click on a next/prev button moves by - #define MCM_GETMONTHDELTA (MCM_FIRST + 19) - #define MonthCal_GetMonthDelta(hmc) \ - - - // int MonthCal_SetMonthDelta(HWND hmc, int n) - // sets the month delta to n. n==0 reverts to moving by a page of months - // returns the previous value of n. - #define MCM_SETMONTHDELTA (MCM_FIRST + 20) - #define MonthCal_SetMonthDelta(hmc, n) \ - - - // DWORD MonthCal_GetMaxTodayWidth(HWND hmc, LPSIZE psz) - // sets *psz to the maximum width/height of the "Today" string displayed - // at the bottom of the calendar (as long as MCS_NOTODAY is not specified) - #define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21) - #define MonthCal_GetMaxTodayWidth(hmc) \ - - - #define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - #define MonthCal_SetUnicodeFormat(hwnd, fUnicode) \ - - - #define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - #define MonthCal_GetUnicodeFormat(hwnd) \ - - // MCN_SELCHANGE is sent whenever the currently displayed date changes - // via month change, year change, keyboard navigation, prev/next button - // - - - // this must be first, so we don't break WM_NOTIFY - - - #define MCN_SELCHANGE (MCN_FIRST + 1) - - // MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate - // information is needed (month or year scroll) to draw bolding information. - // The app must fill in cDayState months worth of information starting from - // stStart date. The app may fill in the array at prgDayState or change - // prgDayState to point to a different array out of which the information - // will be copied. (similar to tooltips) - // - - - // this must be first, so we don't break WM_NOTIFY - - - // points to cDayState MONTHDAYSTATEs - - - #define MCN_GETDAYSTATE (MCN_FIRST + 3) - - // MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard) - // - - - #define MCN_SELECT (MCN_FIRST + 4) - - - // begin_r_commctrl - - #define MCS_DAYSTATE 1 - #define MCS_MULTISELECT 2 - #define MCS_WEEKNUMBERS 4 - #define MCS_NOTODAYCIRCLE 8 - #define MCS_NOTODAY 16 - - - // end_r_commctrl - - #define GMR_VISIBLE 0 // visible portion of display - #define GMR_DAYSTATE 1 // above plus the grayed out parts of - // partially displayed months - - #endif // NOMONTHCAL - - - //====== DATETIMEPICK CONTROL ================================================== - - #ifndef NODATETIMEPICK - - #define DATETIMEPICK_CLASSW L"SysDateTimePick32" - #define DATETIMEPICK_CLASSA "SysDateTimePick32" - - #ifdef UNICODE - #define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW - #else - #define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA - #endif - - #define DTM_FIRST 4096 - - // DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst) - // returns GDT_NONE if "none" is selected (DTS_SHOWNONE only) - // returns GDT_VALID and modifies *pst to be the currently selected value - #define DTM_GETSYSTEMTIME (DTM_FIRST + 1) - #define DateTime_GetSystemtime(hdp, pst) (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst)) - - // BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst) - // if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only) - // if gd==GDT_VALID, sets datetimepick to *pst - // returns TRUE on success, FALSE on error (such as bad params) - #define DTM_SETSYSTEMTIME (DTM_FIRST + 2) - #define DateTime_SetSystemtime(hdp, gd, pst) (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (WPARAM)(gd), (LPARAM)(pst)) - - // DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst) - // modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum) - // modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum) - // returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit - #define DTM_GETRANGE (DTM_FIRST + 3) - #define DateTime_GetRange(hdp, rgst) (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) - - // BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst) - // if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum - // if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum - // returns TRUE on success, FALSE on error (such as invalid parameters) - #define DTM_SETRANGE (DTM_FIRST + 4) - //#define DateTime_SetRange(hdp, gd, rgst) (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst)) - - // BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz) - // sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars) - // NOTE: 'X' is a valid formatting character which indicates that the application - // will determine how to display information. Such apps must support DTN_WMKEYDOWN, - // DTN_FORMAT, and DTN_FORMATQUERY. - #define DTM_SETFORMATA (DTM_FIRST + 5) - #define DTM_SETFORMATW (DTM_FIRST + 50) - - #ifdef UNICODE - #define DTM_SETFORMAT DTM_SETFORMATW - #else - #define DTM_SETFORMAT DTM_SETFORMATA - #endif - - #define DateTime_SetFormat(hdp, sz) (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz)) - - - #define DTM_SETMCCOLOR (DTM_FIRST + 6) - #define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr) - - #define DTM_GETMCCOLOR (DTM_FIRST + 7) - #define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0) - - // HWND DateTime_GetMonthCal(HWND hdp) - // returns the HWND of the MonthCal popup window. Only valid - // between DTN_DROPDOWN and DTN_CLOSEUP notifications. - #define DTM_GETMONTHCAL (DTM_FIRST + 8) - #define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0) - - #define DTM_SETMCFONT (DTM_FIRST + 9) - #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) SNDMSG(hdp, DTM_SETMCFONT, (WPARAM)(hfont), (LPARAM)(fRedraw)) - - #define DTM_GETMCFONT (DTM_FIRST + 10) - #define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp, DTM_GETMCFONT, 0, 0) - - // begin_r_commctrl - - #define DTS_UPDOWN 1 // use UPDOWN instead of MONTHCAL - #define DTS_SHOWNONE 2 // allow a NONE selection - #define DTS_SHORTDATEFORMAT 0 // use the short date format (app must forward WM_WININICHANGE messages) - #define DTS_LONGDATEFORMAT 4 // use the long date format (app must forward WM_WININICHANGE messages) - #define DTS_SHORTDATECENTURYFORMAT 12// short date format with century (app must forward WM_WININICHANGE messages) - #define DTS_TIMEFORMAT 9 // use the time format (app must forward WM_WININICHANGE messages) - #define DTS_APPCANPARSE 16 // allow user entered strings (app MUST respond to DTN_USERSTRING) - #define DTS_RIGHTALIGN 32 // right-align popup instead of left-align it - - // end_r_commctrl - - #define DTN_DATETIMECHANGE (DTN_FIRST + 1) // the systemtime has changed - - - // GDT_VALID or GDT_NONE - // valid iff dwFlags==GDT_VALID - - - #define DTN_USERSTRINGA (DTN_FIRST + 2) // the user has entered a string - #define DTN_USERSTRINGW (DTN_FIRST + 15) - - - // string user entered - // app fills this in - // GDT_VALID or GDT_NONE - - - // string user entered - // app fills this in - // GDT_VALID or GDT_NONE - - - #ifdef UNICODE - #define DTN_USERSTRING DTN_USERSTRINGW - #define NMDATETIMESTRING NMDATETIMESTRINGW - #define LPNMDATETIMESTRING LPNMDATETIMESTRINGW - #else - #define DTN_USERSTRING DTN_USERSTRINGA - #define NMDATETIMESTRING NMDATETIMESTRINGA - #define LPNMDATETIMESTRING LPNMDATETIMESTRINGA - #endif - - #define DTN_WMKEYDOWNA (DTN_FIRST + 3) // modify keydown on app format field (X) - #define DTN_WMKEYDOWNW (DTN_FIRST + 16) - - - // virtual key code of WM_KEYDOWN which MODIFIES an X field - // format substring - // current systemtime, app should modify based on key - - - // virtual key code of WM_KEYDOWN which MODIFIES an X field - // format substring - // current systemtime, app should modify based on key - - - #ifdef UNICODE - #define DTN_WMKEYDOWN DTN_WMKEYDOWNW - #define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNW - #define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNW - #else - #define DTN_WMKEYDOWN DTN_WMKEYDOWNA - #define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNA - #define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNA - #endif - - #define DTN_FORMATA (DTN_FIRST + 4) // query display for app format field (X) - #define DTN_FORMATW (DTN_FIRST + 17) - - - // format substring - // current systemtime - // string to display - // buffer pszDisplay originally points at - - - // format substring - // current systemtime - // string to display - // buffer pszDisplay originally points at - - - #ifdef UNICODE - #define DTN_FORMAT DTN_FORMATW - #define NMDATETIMEFORMAT NMDATETIMEFORMATW - #define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATW - #else - #define DTN_FORMAT DTN_FORMATA - #define NMDATETIMEFORMAT NMDATETIMEFORMATA - #define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATA - #endif - - #define DTN_FORMATQUERYA (DTN_FIRST + 5) // query formatting info for app format field (X) - #define DTN_FORMATQUERYW (DTN_FIRST + 18) - - - // format substring - // max bounding rectangle app will use for this format string - - - // format substring - // max bounding rectangle app will use for this format string - - - #ifdef UNICODE - #define DTN_FORMATQUERY DTN_FORMATQUERYW - #define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYW - #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW - #else - #define DTN_FORMATQUERY DTN_FORMATQUERYA - #define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYA - #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA - #endif - - #define DTN_DROPDOWN (DTN_FIRST + 6) // MonthCal has dropped down - #define DTN_CLOSEUP (DTN_FIRST + 7) // MonthCal is popping up - - #define GDTR_MIN 1 - #define GDTR_MAX 2 - - #define GDT_ERROR -1 - #define GDT_VALID 0 - #define GDT_NONE 1 - - #endif // NODATETIMEPICK - - - #ifndef NOIPADDRESS - - /////////////////////////////////////////////// - /// IP Address edit control - - // Messages sent to IPAddress controls - - #define IPM_CLEARADDRESS (WM_USER+100) // no parameters - #define IPM_SETADDRESS (WM_USER+101) // lparam = TCP/IP address - #define IPM_GETADDRESS (WM_USER+102) // lresult = # of non black fields. lparam = LPDWORD for TCP/IP address - #define IPM_SETRANGE (WM_USER+103) // wparam = field, lparam = range - #define IPM_SETFOCUS (WM_USER+104) // wparam = field - #define IPM_ISBLANK (WM_USER+105) // no parameters - - #define WC_IPADDRESSW L"SysIPAddress32" - #define WC_IPADDRESSA "SysIPAddress32" - - #ifdef UNICODE - #define WC_IPADDRESS WC_IPADDRESSW - #else - #define WC_IPADDRESS WC_IPADDRESSA - #endif - - #define IPN_FIELDCHANGED (IPN_FIRST - 0) - - - // The following is a useful macro for passing the range values in the - // IPM_SETRANGE message. - - #define MAKEIPRANGE(low, high) ((LPARAM)(WORD)(((BYTE)(high) << 8) + (BYTE)(low))) - - // And this is a useful macro for making the IP Address to be passed - // as a LPARAM. - - #define MAKEIPADDRESS(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4)))) - - // Get individual number - #define FIRST_IPADDRESS(x) ((x>>24) * 255) - #define SECOND_IPADDRESS(x) ((x>>16) * 255) - #define THIRD_IPADDRESS(x) ((x>>8) * 255) - #define FOURTH_IPADDRESS(x) (x * 255) - - #endif // NOIPADDRESS - - - //--------------------------------------------------------------------------------------- - //--------------------------------------------------------------------------------------- - /// ====================== Pager Control ============================= - //--------------------------------------------------------------------------------------- - //--------------------------------------------------------------------------------------- - - #ifndef NOPAGESCROLLER - - //Pager Class Name - #define WC_PAGESCROLLERW L"SysPager" - #define WC_PAGESCROLLERA "SysPager" - - #ifdef UNICODE - #define WC_PAGESCROLLER WC_PAGESCROLLERW - #else - #define WC_PAGESCROLLER WC_PAGESCROLLERA - #endif - - - //--------------------------------------------------------------------------------------- - // Pager Control Styles - //--------------------------------------------------------------------------------------- - // begin_r_commctrl - - #define PGS_VERT 0 - #define PGS_HORZ 1 - #define PGS_AUTOSCROLL 2 - #define PGS_DRAGNDROP 4 - - // end_r_commctrl - - - //--------------------------------------------------------------------------------------- - // Pager Button State - //--------------------------------------------------------------------------------------- - //The scroll can be in one of the following control State - #define PGF_INVISIBLE 0 // Scroll button is not visible - #define PGF_NORMAL 1 // Scroll button is in normal state - #define PGF_GRAYED 2 // Scroll button is in grayed state - #define PGF_DEPRESSED 4 // Scroll button is in depressed state - #define PGF_HOT 8 // Scroll button is in hot state - - - // The following identifiers specifies the button control - #define PGB_TOPORLEFT 0 - #define PGB_BOTTOMORRIGHT 1 - - //--------------------------------------------------------------------------------------- - // Pager Control Messages - //--------------------------------------------------------------------------------------- - #define PGM_SETCHILD (PGM_FIRST + 1) // lParam == hwnd - #define Pager_SetChild(hwnd, hwndChild) \ - - - #define PGM_RECALCSIZE (PGM_FIRST + 2) - #define Pager_RecalcSize(hwnd) \ - - - #define PGM_FORWARDMOUSE (PGM_FIRST + 3) - #define Pager_ForwardMouse(hwnd, bForward) \ - - - #define PGM_SETBKCOLOR (PGM_FIRST + 4) - #define Pager_SetBkColor(hwnd, clr) \ - - - #define PGM_GETBKCOLOR (PGM_FIRST + 5) - #define Pager_GetBkColor(hwnd) \ - - - #define PGM_SETBORDER (PGM_FIRST + 6) - #define Pager_SetBorder(hwnd, iBorder) \ - - - #define PGM_GETBORDER (PGM_FIRST + 7) - #define Pager_GetBorder(hwnd) \ - - - #define PGM_SETPOS (PGM_FIRST + 8) - #define Pager_SetPos(hwnd, iPos) \ - - - #define PGM_GETPOS (PGM_FIRST + 9) - #define Pager_GetPos(hwnd) \ - - - #define PGM_SETBUTTONSIZE (PGM_FIRST + 10) - #define Pager_SetButtonSize(hwnd, iSize) \ - - - #define PGM_GETBUTTONSIZE (PGM_FIRST + 11) - #define Pager_GetButtonSize(hwnd) \ - - - #define PGM_GETBUTTONSTATE (PGM_FIRST + 12) - #define Pager_GetButtonState(hwnd, iButton) \ - - - #define PGM_GETDROPTARGET CCM_GETDROPTARGET - #define Pager_GetDropTarget(hwnd, ppdt) \ - - //--------------------------------------------------------------------------------------- - //Pager Control Notification Messages - //--------------------------------------------------------------------------------------- - - - // PGN_SCROLL Notification Message - - #define PGN_SCROLL (PGN_FIRST-1) - - #define PGF_SCROLLUP 1 - #define PGF_SCROLLDOWN 2 - #define PGF_SCROLLLEFT 4 - #define PGF_SCROLLRIGHT 8 - - - //Keys down - #define PGK_SHIFT 1 - #define PGK_CONTROL 2 - #define PGK_MENU 4 - - - // This structure is sent along with PGN_SCROLL notifications - - - // Specifies which keys are down when this notification is send - // Contains Parent Window Rect - // Scrolling Direction - // Horizontal scroll position - // Vertical scroll position - // [in/out] Amount to scroll - - - // PGN_CALCSIZE Notification Message - - #define PGN_CALCSIZE (PGN_FIRST-2) - - #define PGF_CALCWIDTH 1 - #define PGF_CALCHEIGHT 2 - - #endif // NOPAGESCROLLER - - ////====================== End Pager Control ========================================== - - // - // === Native Font Control === - // - #ifndef NONATIVEFONTCTL - - //NativeFont Class Name - #define WC_NATIVEFONTCTLW L"NativeFontCtl" - #define WC_NATIVEFONTCTLA "NativeFontCtl" - - #ifdef UNICODE - #define WC_NATIVEFONTCTL WC_NATIVEFONTCTLW - #else - #define WC_NATIVEFONTCTL WC_NATIVEFONTCTLA - #endif - - // begin_r_commctrl - - // style definition - #define NFS_EDIT 1 - #define NFS_STATIC 2 - #define NFS_LISTCOMBO 4 - #define NFS_BUTTON 8 - #define NFS_ALL 16 - #define NFS_USEFONTASSOC 32 - - // end_r_commctrl - - #endif // NONATIVEFONTCTL - // === End Native Font Control === - - // - // === MUI APIs === - // - //====== TrackMouseEvent ===================================================== - - #ifndef NOTRACKMOUSEEVENT - - // - // If the messages for TrackMouseEvent have not been defined then define them - // now. - // - #ifndef WM_MOUSEHOVER - #define WM_MOUSEHOVER 673 - #define WM_MOUSELEAVE 675 - #endif - - // - // If the TRACKMOUSEEVENT structure and associated flags havent been declared - // then declare them now. - // - #ifndef TME_HOVER - #define TME_HOVER 0x00000001 - #define TME_LEAVE 0x00000002 - #define TME_NONCLIENT 0x00000010 - #define TME_QUERY 0x40000000 - #define TME_CANCEL 0x80000000 - - #define HOVER_DEFAULT 0xFFFFFFFF - - #endif // !TME_HOVER - - // - // Declare _TrackMouseEvent. This API tries to use the window manager's - // implementation of TrackMouseEvent if it is present, otherwise it emulates. - // - - #endif // !NOTRACKMOUSEEVENT - - //====== Flat Scrollbar APIs========================================= - #ifndef NOFLATSBAPIS - - #define WSB_PROP_CYVSCROLL 1 - #define WSB_PROP_CXHSCROLL 2 - #define WSB_PROP_CYHSCROLL 4 - #define WSB_PROP_CXVSCROLL 8 - #define WSB_PROP_CXHTHUMB 16 - #define WSB_PROP_CYVTHUMB 32 - #define WSB_PROP_VBKGCOLOR 64 - #define WSB_PROP_HBKGCOLOR 128 - #define WSB_PROP_VSTYLE 256 - #define WSB_PROP_HSTYLE 512 - #define WSB_PROP_WINSTYLE 1024 - #define WSB_PROP_PALETTE 2048 - #define WSB_PROP_MASK 4095 - - #define FSB_FLAT_MODE 2 - #define FSB_ENCARTA_MODE 1 - #define FSB_REGULAR_MODE 0 - - - #define FlatSB_GetScrollPropPtr FlatSB_GetScrollProp - - - #define FlatSB_SetScrollPropPtr FlatSB_SetScrollProp - - #endif // NOFLATSBAPIS - - - //P_O_Pop -#endif // _INC_COMMCTRL +#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") +#define HOTKEY_CLASSA "msctls_hotkey32" +#define HOTKEY_CLASSW L"msctls_hotkey32" +#define PROGRESS_CLASSA "msctls_progress32" +#define PROGRESS_CLASSW L"msctls_progress32" +#define STATUSCLASSNAMEA "msctls_statusbar32" +#define STATUSCLASSNAMEW L"msctls_statusbar32" +#define TOOLBARCLASSNAMEA "ToolbarWindow32" +#define TOOLBARCLASSNAMEW L"ToolbarWindow32" +#define TOOLTIPS_CLASSA "tooltips_class32" +#define TOOLTIPS_CLASSW L"tooltips_class32" +#define TRACKBAR_CLASSA "msctls_trackbar32" +#define TRACKBAR_CLASSW L"msctls_trackbar32" +#define UPDOWN_CLASSA "msctls_updown32" +#define UPDOWN_CLASSW L"msctls_updown32" +#define ANIMATE_CLASSA "SysAnimate32" +#define ANIMATE_CLASSW L"SysAnimate32" +#define DATETIMEPICK_CLASSW L"SysDateTimePick32" +#define DATETIMEPICK_CLASSA "SysDateTimePick32" +#define MONTHCAL_CLASSW L"SysMonthCal32" +#define MONTHCAL_CLASSA "SysMonthCal32" +#define REBARCLASSNAMEW L"ReBarWindow32" +#define REBARCLASSNAMEA "ReBarWindow32" +#define WC_COMBOBOXEXW L"ComboBoxEx32" +#define WC_COMBOBOXEXA "ComboBoxEx32" +#define WC_IPADDRESSW L"SysIPAddress32" +#define WC_IPADDRESSA "SysIPAddress32" +#define WC_LISTVIEWA "SysListView32" +#define WC_LISTVIEWW L"SysListView32" +#define WC_TABCONTROLA "SysTabControl32" +#define WC_TABCONTROLW L"SysTabControl32" +#define WC_TREEVIEWA "SysTreeView32" +#define WC_TREEVIEWW L"SysTreeView32" +#define WC_HEADERA "SysHeader32" +#define WC_HEADERW L"SysHeader32" +#define WC_PAGESCROLLERW L"SysPager" +#define WC_PAGESCROLLERA "SysPager" +#define WC_NATIVEFONTCTLW L"NativeFontCtl" +#define WC_NATIVEFONTCTLA "NativeFontCtl" +#define WC_BUTTONA "Button" +#define WC_BUTTONW L"Button" +#define WC_STATICA "Static" +#define WC_STATICW L"Static" +#define WC_EDITA "Edit" +#define WC_EDITW L"Edit" +#define WC_LISTBOXA "ListBox" +#define WC_LISTBOXW L"ListBox" +#define WC_COMBOBOXA "ComboBox" +#define WC_COMBOBOXW L"ComboBox" +#define WC_SCROLLBARA "ScrollBar" +#define WC_SCROLLBARW L"ScrollBar" +#define WC_LINKA "SysLink" +#define WC_LINKW L"SysLink" + +#ifdef UNICODE +#define HOTKEY_CLASS HOTKEY_CLASSW +#define PROGRESS_CLASS PROGRESS_CLASSW +#define STATUSCLASSNAME STATUSCLASSNAMEW +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW +#define TOOLTIPS_CLASS TOOLTIPS_CLASSW +#define TRACKBAR_CLASS TRACKBAR_CLASSW +#define UPDOWN_CLASS UPDOWN_CLASSW +#define ANIMATE_CLASS ANIMATE_CLASSW +#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW +#define MONTHCAL_CLASS MONTHCAL_CLASSW +#define REBARCLASSNAME REBARCLASSNAMEW +#define WC_COMBOBOXEX WC_COMBOBOXEXW +#define WC_HEADER WC_HEADERW +#define WC_IPADDRESS WC_IPADDRESSW +#define WC_LISTVIEW WC_LISTVIEWW +#define WC_TABCONTROL WC_TABCONTROLW +#define WC_TREEVIEW WC_TREEVIEWW +#define WC_PAGESCROLLER WC_PAGESCROLLERW +#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLW +#define WC_BUTTON WC_BUTTONW +#define WC_STATIC WC_STATICW +#define WC_EDIT WC_EDITW +#define WC_LISTBOX WC_LISTBOXW +#define WC_COMBOBOX WC_COMBOBOXW +#define WC_SCROLLBAR WC_SCROLLBARW +#define WC_LINK WC_LINKW +#else +#define ANIMATE_CLASS ANIMATE_CLASSA +#define HOTKEY_CLASS HOTKEY_CLASSA +#define PROGRESS_CLASS PROGRESS_CLASSA +#define STATUSCLASSNAME STATUSCLASSNAMEA +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA +#define TOOLTIPS_CLASS TOOLTIPS_CLASSA +#define TRACKBAR_CLASS TRACKBAR_CLASSA +#define UPDOWN_CLASS UPDOWN_CLASSA +#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA +#define MONTHCAL_CLASS MONTHCAL_CLASSA +#define REBARCLASSNAME REBARCLASSNAMEA +#define WC_COMBOBOXEX WC_COMBOBOXEXA +#define WC_HEADER WC_HEADERA +#define WC_IPADDRESS WC_IPADDRESSA +#define WC_LISTVIEW WC_LISTVIEWA +#define WC_TABCONTROL WC_TABCONTROLA +#define WC_TREEVIEW WC_TREEVIEWA +#define WC_PAGESCROLLER WC_PAGESCROLLERA +#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLA +#define WC_BUTTON WC_BUTTONA +#define WC_STATIC WC_STATICA +#define WC_EDIT WC_EDITA +#define WC_LISTBOX WC_LISTBOXA +#define WC_COMBOBOX WC_COMBOBOXA +#define WC_SCROLLBAR WC_SCROLLBARA +#define WC_LINK WC_LINKA +#endif + +#ifdef UNICODE +#define ACM_OPEN ACM_OPENW +#define COMBOBOXEXITEM COMBOBOXEXITEMW +#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW +#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW +#define CBEM_INSERTITEM CBEM_INSERTITEMW +#define CBEM_SETITEM CBEM_SETITEMW +#define CBEM_GETITEM CBEM_GETITEMW +#define CBEN_ENDEDIT CBEN_ENDEDITW +#define NMCBEENDEDIT NMCBEENDEDITW +#define LPNMCBEENDEDIT LPNMCBEENDEDITW +#define PNMCBEENDEDIT PNMCBEENDEDITW +#define NMCOMBOBOXEX NMCOMBOBOXEXW +#define PNMCOMBOBOXEX PNMCOMBOBOXEXW +#define CBEN_GETDISPINFO CBEN_GETDISPINFOW +#define CBEN_DRAGBEGIN CBEN_DRAGBEGINW +#define NMCBEDRAGBEGIN NMCBEDRAGBEGINW +#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW +#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW +#define SB_GETTEXT SB_GETTEXTW +#define SB_SETTEXT SB_SETTEXTW +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW +#define HDM_INSERTITEM HDM_INSERTITEMW +#define HDM_GETITEM HDM_GETITEMW +#define HDM_SETITEM HDM_SETITEMW +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW +#define HDN_ITEMCLICK HDN_ITEMCLICKW +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW +#define HDN_BEGINTRACK HDN_BEGINTRACKW +#define HDN_ENDTRACK HDN_ENDTRACKW +#define HDN_TRACK HDN_TRACKW +#define HDN_GETDISPINFO HDN_GETDISPINFOW +#define HD_NOTIFY HD_NOTIFYW +#define TBSAVEPARAMS TBSAVEPARAMSW +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW +#define TB_SAVERESTORE TB_SAVERESTOREW +#define TB_ADDSTRING TB_ADDSTRINGW +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW +#define TB_GETBUTTONINFO TB_GETBUTTONINFOW +#define TB_SETBUTTONINFO TB_SETBUTTONINFOW +#define TB_INSERTBUTTON TB_INSERTBUTTONW +#define TB_ADDBUTTONS TB_ADDBUTTONSW +#define TB_MAPACCELERATOR TB_MAPACCELERATORW +#define TB_GETSTRING TB_GETSTRINGW +#define TBBUTTONINFO TBBUTTONINFOW +#define LPTBBUTTONINFO LPTBBUTTONINFOW +#define TBN_GETDISPINFO TBN_GETDISPINFOW +#define NMTBDISPINFO NMTBDISPINFOW +#define LPNMTBDISPINFO LPNMTBDISPINFOW +#define NMTBGETINFOTIP NMTBGETINFOTIPW +#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW +#define TBNOTIFY TBNOTIFYW +#define LPTBNOTIFY LPTBNOTIFYW +#define NMTOOLBAR NMTOOLBARW +#define LPNMTOOLBAR LPNMTOOLBARW +#define TTM_ADDTOOL TTM_ADDTOOLW +#define TTM_DELTOOL TTM_DELTOOLW +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW +#define TTM_GETTOOLINFO TTM_GETTOOLINFOW +#define TTM_SETTOOLINFO TTM_SETTOOLINFOW +#define TTM_HITTEST TTM_HITTESTW +#define TTM_GETTEXT TTM_GETTEXTW +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW +#define TTM_ENUMTOOLS TTM_ENUMTOOLSW +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW +#define TTN_NEEDTEXT TTN_NEEDTEXTW +#define TTN_GETDISPINFO TTN_GETDISPINFOW +#define LV_ITEM LV_ITEMW +#define LVITEM LVITEMW +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW +#define LVBKIMAGE LVBKIMAGEW +#define LPLVBKIMAGE LPLVBKIMAGEW +#define LVM_SETBKIMAGE LVM_SETBKIMAGEW +#define LVM_GETBKIMAGE LVM_GETBKIMAGEW +#define LVM_GETITEM LVM_GETITEMW +#define LVM_SETITEM LVM_SETITEMW +#define LVM_INSERTITEM LVM_INSERTITEMW +#define LV_FINDINFO LV_FINDINFOW +#define LVFINDINFO LVFINDINFOW +#define LPFINDINFO LPFINDINFOW +#define NMLVFINDITEM NMLVFINDITEMW +#define PNMLVFINDITEM PNMLVFINDITEMW +#define LPNMLVFINDITEM LPNMLVFINDITEMW +#define LVM_FINDITEM LVM_FINDITEMW +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW +#define LVM_EDITLABEL LVM_EDITLABELW +#define LV_COLUMN LV_COLUMNW +#define LVCOLUMN LVCOLUMNW +#define LVM_GETCOLUMN LVM_GETCOLUMNW +#define LVM_SETCOLUMN LVM_SETCOLUMNW +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW +#define LVM_GETITEMTEXT LVM_GETITEMTEXTW +#define LVM_SETITEMTEXT LVM_SETITEMTEXTW +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW +#define LVN_GETDISPINFO LVN_GETDISPINFOW +#define LVN_SETDISPINFO LVN_SETDISPINFOW +#define LVN_GETINFOTIP LVN_GETINFOTIPW +#define NMLVGETINFOTIP NMLVGETINFOTIPW +#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPW +#define LV_DISPINFO LV_DISPINFOW +#define NMLVDISPINFO NMLVDISPINFOW +#define LPNMLVDISPINFO LPNMLVDISPINFOW +#define TVM_INSERTITEM TVM_INSERTITEMW +#define TVM_GETITEM TVM_GETITEMW +#define TVM_SETITEM TVM_SETITEMW +#define TVM_EDITLABEL TVM_EDITLABELW +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW +#define TV_DISPINFO NMTVDISPINFOW +#define NMTVDISPINFO NMTVDISPINFOW +#define LPNMTVDISPINFO LPNMTVDISPINFOW +#define NMTVGETINFOTIP NMTVGETINFOTIPW +#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPW +#define TVN_GETINFOTIP TVN_GETINFOTIPW +#define TVN_SELCHANGING TVN_SELCHANGINGW +#define TVN_SELCHANGED TVN_SELCHANGEDW +#define TVN_GETDISPINFO TVN_GETDISPINFOW +#define TVN_SETDISPINFO TVN_SETDISPINFOW +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW +#define TVN_BEGINDRAG TVN_BEGINDRAGW +#define TVN_BEGINRDRAG TVN_BEGINRDRAGW +#define TVN_DELETEITEM TVN_DELETEITEMW +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW +#define TC_ITEMHEADER TC_ITEMHEADERW +#define TC_ITEM TC_ITEMW +#define TCITEM TCITEMW +#define LPTCITEM LPTCITEMW +#define TCM_GETITEM TCM_GETITEMW +#define TCM_SETITEM TCM_SETITEMW +#define TCM_INSERTITEM TCM_INSERTITEMW +#define CreateStatusWindow CreateStatusWindowW +#define DrawStatusText DrawStatusTextW +#define ImageList_LoadImage ImageList_LoadImageW +#define DTM_SETFORMAT DTM_SETFORMATW +#define DTN_USERSTRING DTN_USERSTRINGW +#define DTN_WMKEYDOWN DTN_WMKEYDOWNW +#define DTN_FORMAT DTN_FORMATW +#define DTN_FORMATQUERY DTN_FORMATQUERYW +#define LPCREBARBANDINFO LPCREBARBANDINFOW +#define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE +#define RB_INSERTBAND RB_INSERTBANDW +#define RB_SETBANDINFO RB_SETBANDINFOW +#else /* UNICODE */ +#define ACM_OPEN ACM_OPENA +#define COMBOBOXEXITEM COMBOBOXEXITEMA +#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA +#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA +#define CBEM_INSERTITEM CBEM_INSERTITEMA +#define CBEM_SETITEM CBEM_SETITEMA +#define CBEM_GETITEM CBEM_GETITEMA +#define CBEN_ENDEDIT CBEN_ENDEDITA +#define NMCBEENDEDIT NMCBEENDEDITA +#define LPNMCBEENDEDIT LPNMCBEENDEDITA +#define PNMCBEENDEDIT PNMCBEENDEDITA +#define TB_GETBUTTONINFO TB_GETBUTTONINFOA +#define TB_SETBUTTONINFO TB_SETBUTTONINFOA +#define TB_INSERTBUTTON TB_INSERTBUTTONA +#define TB_ADDBUTTONS TB_ADDBUTTONSA +#define TB_MAPACCELERATOR TB_MAPACCELERATORA +#define TB_GETSTRING TB_GETSTRINGA +#define NMCOMBOBOXEX NMCOMBOBOXEXA +#define PNMCOMBOBOXEX PNMCOMBOBOXEXA +#define CBEN_DRAGBEGIN CBEN_DRAGBEGINA +#define CBEN_GETDISPINFO CBEN_GETDISPINFOA +#define NMCBEDRAGBEGIN NMCBEDRAGBEGINA +#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA +#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA +#define TBN_GETDISPINFO TBN_GETDISPINFOA +#define NMTBDISPINFO NMTBDISPINFOA +#define LPNMTBDISPINFO LPNMTBDISPINFOA +#define NMTBGETINFOTIP NMTBGETINFOTIPA +#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA +#define SB_GETTEXT SB_GETTEXTA +#define SB_SETTEXT SB_SETTEXTA +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA +#define HDM_INSERTITEM HDM_INSERTITEMA +#define HDM_GETITEM HDM_GETITEMA +#define HDM_SETITEM HDM_SETITEMA +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA +#define HDN_ITEMCLICK HDN_ITEMCLICKA +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA +#define HDN_BEGINTRACK HDN_BEGINTRACKA +#define HDN_ENDTRACK HDN_ENDTRACKA +#define HDN_TRACK HDN_TRACKA +#define HDN_GETDISPINFO HDN_GETDISPINFOA +#define HD_NOTIFY HD_NOTIFYA +#define TBSAVEPARAMS TBSAVEPARAMSA +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA +#define TB_SAVERESTORE TB_SAVERESTOREA +#define TB_ADDSTRING TB_ADDSTRINGA +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA +#define TBBUTTONINFO TBBUTTONINFOA +#define LPTBBUTTONINFO LPTBBUTTONINFOA +#define TBNOTIFY TBNOTIFYA +#define LPTBNOTIFY LPTBNOTIFYA +#define NMTOOLBAR NMTOOLBARA +#define LPNMTOOLBAR LPNMTOOLBARA +#define TTM_ADDTOOL TTM_ADDTOOLA +#define TTM_DELTOOL TTM_DELTOOLA +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA +#define TTM_GETTOOLINFO TTM_GETTOOLINFOA +#define TTM_SETTOOLINFO TTM_SETTOOLINFOA +#define TTM_HITTEST TTM_HITTESTA +#define TTM_GETTEXT TTM_GETTEXTA +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA +#define TTM_ENUMTOOLS TTM_ENUMTOOLSA +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA +#define TTN_NEEDTEXT TTN_NEEDTEXTA +#define TTN_GETDISPINFO TTN_GETDISPINFOA +#define LV_ITEM LV_ITEMA +#define LVITEM LVITEMA +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA +#define LVBKIMAGE LVBKIMAGEA +#define LPLVBKIMAGE LPLVBKIMAGEA +#define LVM_SETBKIMAGE LVM_SETBKIMAGEA +#define LVM_GETBKIMAGE LVM_GETBKIMAGEA +#define LVM_GETITEM LVM_GETITEMA +#define LVM_SETITEM LVM_SETITEMA +#define LVM_INSERTITEM LVM_INSERTITEMA +#define LV_FINDINFO LV_FINDINFOA +#define LVFINDINFO LVFINDINFOA +#define LPFINDINFO LPFINDINFOA +#define NMLVFINDITEM NMLVFINDITEMA +#define PNMLVFINDITEM PNMLVFINDITEMA +#define LPNMLVFINDITEM LPNMLVFINDITEMA +#define LVM_FINDITEM LVM_FINDITEMA +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA +#define LVM_EDITLABEL LVM_EDITLABELA +#define LV_COLUMN LV_COLUMNA +#define LVCOLUMN LVCOLUMNA +#define LVM_GETCOLUMN LVM_GETCOLUMNA +#define LVM_SETCOLUMN LVM_SETCOLUMNA +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA +#define LVM_GETITEMTEXT LVM_GETITEMTEXTA +#define LVM_SETITEMTEXT LVM_SETITEMTEXTA +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA +#define LVN_GETDISPINFO LVN_GETDISPINFOA +#define LVN_SETDISPINFO LVN_SETDISPINFOA +#define LVN_GETINFOTIP LVN_GETINFOTIPA +#define NMLVGETINFOTIP NMLVGETINFOTIPA +#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPA +#define LV_DISPINFO LV_DISPINFOA +#define NMLVDISPINFO NMLVDISPINFOA +#define LPNMLVDISPINFO LPNMLVDISPINFOA +#define TVM_INSERTITEM TVM_INSERTITEMA +#define TVM_GETITEM TVM_GETITEMA +#define TVM_SETITEM TVM_SETITEMA +#define TVM_EDITLABEL TVM_EDITLABELA +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA +#define TV_DISPINFO NMTVDISPINFOA +#define NMTVDISPINFO NMTVDISPINFOA +#define LPNMTVDISPINFO LPNMTVDISPINFOA +#define NMTVGETINFOTIP NMTVGETINFOTIPA +#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPA +#define TVN_GETINFOTIP TVN_GETINFOTIPA +#define TVN_SELCHANGING TVN_SELCHANGINGA +#define TVN_SELCHANGED TVN_SELCHANGEDA +#define TVN_GETDISPINFO TVN_GETDISPINFOA +#define TVN_SETDISPINFO TVN_SETDISPINFOA +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA +#define TVN_BEGINDRAG TVN_BEGINDRAGA +#define TVN_BEGINRDRAG TVN_BEGINRDRAGA +#define TVN_DELETEITEM TVN_DELETEITEMA +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA +#define TC_ITEMHEADER TC_ITEMHEADERA +#define TC_ITEM TC_ITEMA +#define TCITEM TCITEMA +#define LPTCITEM LPTCITEMA +#define TCM_GETITEM TCM_GETITEMA +#define TCM_SETITEM TCM_SETITEMA +#define TCM_INSERTITEM TCM_INSERTITEMA +#define CreateStatusWindow CreateStatusWindowA +#define DrawStatusText DrawStatusTextA +#define ImageList_LoadImage ImageList_LoadImageA +#define DTM_SETFORMAT DTM_SETFORMATA +#define DTN_USERSTRING DTN_USERSTRINGA +#define DTN_WMKEYDOWN DTN_WMKEYDOWNA +#define DTN_FORMAT DTN_FORMATA +#define DTN_FORMATQUERY DTN_FORMATQUERYA +#define LPCREBARBANDINFO LPCREBARBANDINFOA +#define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE +#define RB_INSERTBAND RB_INSERTBANDA +#define RB_SETBANDINFO RB_SETBANDINFOA +#endif + +#define LVM_FIRST 0x1000 +#define TV_FIRST 0x1100 +#define HDM_FIRST 0x1200 +#define ACM_OPENA (WM_USER+100) +#define ACM_PLAY (WM_USER+101) +#define ACM_STOP (WM_USER+102) +#define ACM_OPENW (WM_USER+103) +#define ACN_START 1 +#define ACN_STOP 2 +#define CBEIF_TEXT 0x00000001 +#define CBEIF_IMAGE 0x00000002 +#define CBEIF_SELECTEDIMAGE 0x00000004 +#define CBEIF_OVERLAY 0x00000008 +#define CBEIF_INDENT 0x00000010 +#define CBEIF_LPARAM 0x00000020 +#define CBEIF_DI_SETITEM 0x10000000 +#define CBEN_INSERTITEM (CBEN_FIRST - 1) +#define CBEN_DELETEITEM (CBEN_FIRST - 2) +#define CBEN_BEGINEDIT (CBEN_FIRST - 4) +#define CBEN_ENDEDITA (CBEN_FIRST - 5) +#define CBEN_ENDEDITW (CBEN_FIRST - 6) +#define CBENF_KILLFOCUS 1 +#define CBENF_RETURN 2 +#define CBENF_ESCAPE 3 +#define CBENF_DROPDOWN 4 +#define CBEMAXSTRLEN 260 +#define DL_BEGINDRAG 1157 +#define DL_CANCELDRAG 1160 +#define DL_DRAGGING 1158 +#define DL_DROPPED 1159 +#define DL_CURSORSET 0 +#define DL_STOPCURSOR 1 +#define DL_COPYCURSOR 2 +#define DL_MOVECURSOR 3 +#define CCS_TOP 1 +#define CCS_NOMOVEY 2 +#define CCS_BOTTOM 3 +#define CCS_NORESIZE 4 +#define CCS_NOPARENTALIGN 8 +#define CCS_ADJUSTABLE 32 +#define CCS_NODIVIDER 64 +#define CCS_VERT 128 +#define CCS_LEFT 129 +#define CCS_NOMOVEX 130 +#define CCS_RIGHT 131 +#define ACS_CENTER 0x0001 +#define ACS_TRANSPARENT 0x0002 +#define ACS_AUTOPLAY 0x0004 +#define ACS_TIMER 0x0008 +#define PGS_VERT 0x00000000 +#define PGS_HORZ 0x00000001 +#define PGS_AUTOSCROLL 0x00000002 +#define PGS_DRAGNDROP 0x00000004 +#define CMB_MASKED 2 +#define MINSYSCOMMAND SC_SIZE +#define SBT_OWNERDRAW 0x1000 +#define SBT_NOBORDERS 256 +#define SBT_POPOUT 512 +#define SBT_RTLREADING 1024 +#define SB_SETTEXTA (WM_USER+1) +#define SB_SETTEXTW (WM_USER+11) +#define SB_GETTEXTA (WM_USER+2) +#define SB_GETTEXTW (WM_USER+13) +#define SB_GETTEXTLENGTHA (WM_USER+3) +#define SB_GETTEXTLENGTHW (WM_USER+12) +#define SB_SETPARTS (WM_USER+4) +#define SB_GETPARTS (WM_USER+6) +#define SB_GETBORDERS (WM_USER+7) +#define SB_SETMINHEIGHT (WM_USER+8) +#define SB_SIMPLE (WM_USER+9) +#define SB_GETRECT (WM_USER+10) +#define MSGF_COMMCTRL_BEGINDRAG 0x4200 +#define MSGF_COMMCTRL_SIZEHEADER 0x4201 +#define MSGF_COMMCTRL_DRAGSELECT 0x4202 +#define MSGF_COMMCTRL_TOOLBARCUST 0x4203 +#define ILC_COLOR 0 +#define ILC_COLOR4 4 +#define ILC_COLOR8 8 +#define ILC_COLOR16 16 +#define ILC_COLOR24 24 +#define ILC_COLOR32 32 +#define ILC_COLORDDB 254 +#define ILC_MASK 1 +#define ILC_PALETTE 2048 +#define ILCF_MOVE 0 +#define ILCF_SWAP 1 +#define ILS_NORMAL 0 +#define ILS_GLOW 1 +#define ILS_SHADOW 2 +#define ILS_SATURATE 4 +#define ILS_ALPHA 8 +#define ILD_BLEND25 2 +#define ILD_BLEND50 4 +#define ILD_SELECTED 4 +#define ILD_BLEND 4 +#define ILD_FOCUS 2 +#define ILD_MASK 16 +#define ILD_NORMAL 0 +#define ILD_TRANSPARENT 1 +#define ILD_IMAGE 0x0020 +#define ILD_ROP 0x0040 +#define ILD_OVERLAYMASK 0x0F00 +#define ILD_PRESERVEALPHA 0x1000 +#define ILD_SCALE 0x2000 +#define ILD_DPISCALE 0x4000 +#define HDS_HORZ 0 +#define HDS_BUTTONS 2 +#define HDS_HIDDEN 8 +#define HDS_HOTTRACK 4 +#define HDS_DRAGDROP 0x0040 +#define HDS_FULLDRAG 0x0080 +#define HDS_FILTERBAR 0x0100 +#define NM_FIRST 0 +#define NM_LAST (-99) +#define LVN_FIRST (-100) +#define LVN_LAST (-199) +#define HDN_FIRST (-300) +#define HDN_LAST (-399) +#define TVN_FIRST (-400) +#define TVN_LAST (-499) +#define TTN_FIRST (-520) +#define TTN_LAST (-549) +#define TCN_FIRST (-550) +#define TCN_LAST (-580) +#ifndef CDN_FIRST +#define CDN_FIRST (-601) /* also in commdlg.h */ +#define CDN_LAST (-699) +#define TBN_FIRST (-700) +#define TBN_LAST (-720) +#define UDN_FIRST (-721) +#define UDN_LAST (-740) +#define RBN_FIRST (-831) +#define RBN_LAST (-859) +#define MCN_FIRST (-750) +#define MCN_LAST (-759) +#define DTN_FIRST (-760) +#define DTN_LAST (-799) +#define CBEN_FIRST (-800) +#define CBEN_LAST (-830) +#define IPN_FIRST (-860) +#define IPN_LAST (-879) +#define IPN_FIELDCHANGED (IPN_FIRST-0) +#define SBN_FIRST (-880) +#define SBN_LAST (-899) +#define PGN_FIRST (-900) +#define PGN_LAST (-950) +#define PGN_SCROLL (PGN_FIRST-1) +#define PGN_CALCSIZE (PGN_FIRST-2) +#define HDI_WIDTH 1 +#define HDI_HEIGHT 1 +#define HDI_TEXT 2 +#define HDI_FORMAT 4 +#define HDI_LPARAM 8 +#define HDI_BITMAP 16 +#define HDI_IMAGE 32 +#define HDI_DI_SETITEM 64 +#define HDI_ORDER 128 +#define CBES_EX_NOEDITIMAGE 0x00000001 +#define CBES_EX_NOEDITIMAGEINDENT 0x00000002 +#define CBES_EX_PATHWORDBREAKPROC 0x00000004 +#define CBES_EX_NOSIZELIMIT 0x00000008 +#define CBES_EX_CASESENSITIVE 0x00000010 +#define CBEN_GETDISPINFOA (CBEN_FIRST - 0) +#define CBEN_GETDISPINFOW (CBEN_FIRST - 7) +#define CBEN_DRAGBEGINA (CBEN_FIRST - 8) +#define CBEN_DRAGBEGINW (CBEN_FIRST - 9) +#define HDI_FILTER 256 +#define HDF_LEFT 0 +#define HDF_RIGHT 1 +#define HDF_CENTER 2 +#define HDF_JUSTIFYMASK 3 +#define HDF_RTLREADING 4 +#define HDF_OWNERDRAW 0x8000 +#define HDF_STRING 0x4000 +#define HDF_BITMAP 0x2000 +#define HDF_BITMAP_ON_RIGHT 0x1000 +#define HDF_IMAGE 0x0800 +#define HDM_GETITEMCOUNT HDM_FIRST +#define HDM_INSERTITEMA (HDM_FIRST+1) +#define HDM_INSERTITEMW (HDM_FIRST+10) +#define HDM_DELETEITEM (HDM_FIRST+2) +#define HDM_GETITEMA (HDM_FIRST+3) +#define HDM_GETITEMW (HDM_FIRST+11) +#define HDM_SETITEMA (HDM_FIRST+4) +#define HDM_SETITEMW (HDM_FIRST+12) +#define HDM_LAYOUT (HDM_FIRST+5) +#define HDM_GETITEMRECT (HDM_FIRST+7) +#define HDM_SETIMAGELIST (HDM_FIRST+8) +#define HDM_GETIMAGELIST (HDM_FIRST+9) +#define HDM_ORDERTOINDEX (HDM_FIRST+15) +#define HDM_CREATEDRAGIMAGE (HDM_FIRST+16) +#define HDM_GETORDERARRAY (HDM_FIRST+17) +#define HDM_SETORDERARRAY (HDM_FIRST+18) +#define HDM_SETHOTDIVIDER (HDM_FIRST+19) +#define HDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define HDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define HHT_NOWHERE 1 +#define HHT_ONHEADER 2 +#define HHT_ONDIVIDER 4 +#define HHT_ONDIVOPEN 8 +#define HHT_ABOVE 256 +#define HHT_BELOW 512 +#define HHT_TORIGHT 1024 +#define HHT_TOLEFT 2048 +#define HDM_HITTEST (HDM_FIRST+6) +#define HDN_ITEMCHANGINGA (HDN_FIRST-0) +#define HDN_ITEMCHANGINGW (HDN_FIRST-20) +#define HDN_ITEMCHANGEDA (HDN_FIRST-1) +#define HDN_ITEMCHANGEDW (HDN_FIRST-21) +#define HDN_ITEMCLICKA (HDN_FIRST-2) +#define HDN_ITEMCLICKW (HDN_FIRST-22) +#define HDN_ITEMDBLCLICKA (HDN_FIRST-3) +#define HDN_ITEMDBLCLICKW (HDN_FIRST-23) +#define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5) +#define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25) +#define HDN_BEGINTRACKA (HDN_FIRST-6) +#define HDN_BEGINTRACKW (HDN_FIRST-26) +#define HDN_ENDTRACKA (HDN_FIRST-7) +#define HDN_ENDTRACKW (HDN_FIRST-27) +#define HDN_TRACKA (HDN_FIRST-8) +#define HDN_TRACKW (HDN_FIRST-28) +#define HDN_ENDDRAG (HDN_FIRST-11) +#define HDN_BEGINDRAG (HDN_FIRST-10) +#define HDN_GETDISPINFOA (HDN_FIRST-9) +#define HDN_GETDISPINFOW (HDN_FIRST-29) +#define HICF_OTHER 0x00 +#define HICF_MOUSE 0x01 +#define HICF_ARROWKEYS 0x02 +#define HICF_ACCELERATOR 0x04 +#define HICF_DUPACCEL 0x08 +#define HICF_ENTERING 0x10 +#define HICF_LEAVING 0x20 +#define HICF_RESELECT 0x40 +#define HICF_LMOUSE 0x80 +#define HICF_TOGGLEDROPDOWN 0x100 +#define IPM_CLEARADDRESS (WM_USER+100) +#define IPM_SETADDRESS (WM_USER+101) +#define IPM_GETADDRESS (WM_USER+102) +#define IPM_SETRANGE (WM_USER+103) +#define IPM_SETFOCUS (WM_USER+104) +#define IPM_ISBLANK (WM_USER+105) +#define I_INDENTCALLBACK (-1) +#define I_IMAGENONE (-2) +#define TBSTATE_CHECKED 1 +#define TBSTATE_PRESSED 2 +#define TBSTATE_ENABLED 4 +#define TBSTATE_HIDDEN 8 +#define TBSTATE_INDETERMINATE 16 +#define TBSTATE_WRAP 32 +#define TBSTATE_ELLIPSES 0x40 +#define TBSTATE_MARKED 0x0080 +#define TBSTYLE_BUTTON 0 +#define TBSTYLE_SEP 1 +#define TBSTYLE_CHECK 2 +#define TBSTYLE_GROUP 4 +#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP|TBSTYLE_CHECK) +#define TBSTYLE_DROPDOWN 8 +#define TBSTYLE_AUTOSIZE 16 +#define TBSTYLE_NOPREFIX 32 +#define TBSTYLE_TOOLTIPS 256 +#define TBSTYLE_WRAPABLE 512 +#define TBSTYLE_ALTDRAG 1024 +#define TBSTYLE_FLAT 2048 +#define TBSTYLE_LIST 4096 +#define TBSTYLE_CUSTOMERASE 8192 +#define TBSTYLE_REGISTERDROP 0x4000 +#define TBSTYLE_TRANSPARENT 0x8000 +#define TBSTYLE_EX_DRAWDDARROWS 0x00000001 +#define TBSTYLE_EX_MIXEDBUTTONS 8 +#define TBSTYLE_EX_HIDECLIPPEDBUTTONS 16 +#define TBSTYLE_EX_DOUBLEBUFFER 0x80 +#define BTNS_BUTTON TBSTYLE_BUTTON +#define BTNS_SEP TBSTYLE_SEP +#define BTNS_CHECK TBSTYLE_CHECK +#define BTNS_GROUP TBSTYLE_GROUP +#define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP +#define BTNS_DROPDOWN TBSTYLE_DROPDOWN +#define BTNS_AUTOSIZE TBSTYLE_AUTOSIZE +#define BTNS_NOPREFIX TBSTYLE_NOPREFIX +#define BTNS_WHOLEDROPDOWN 0x0080 +#define BTNS_SHOWTEXT 0x0040 +#define TBCDRF_NOEDGES 0x10000 +#define TBCDRF_HILITEHOTTRACK 0x20000 +#define TBCDRF_NOOFFSET 0x40000 +#define TBCDRF_NOMARK 0x80000 +#define TBCDRF_NOETCHEDEFFECT 0x100000 +#define HINST_COMMCTRL ((HINSTANCE)-1) +#define IDB_STD_SMALL_COLOR 0 +#define IDB_STD_LARGE_COLOR 1 +#define IDB_VIEW_SMALL_COLOR 4 +#define IDB_VIEW_LARGE_COLOR 5 +#define IDB_HIST_SMALL_COLOR 8 +#define IDB_HIST_LARGE_COLOR 9 +#define STD_CUT 0 +#define STD_COPY 1 +#define STD_PASTE 2 +#define STD_UNDO 3 +#define STD_REDOW 4 +#define STD_DELETE 5 +#define STD_FILENEW 6 +#define STD_FILEOPEN 7 +#define STD_FILESAVE 8 +#define STD_PRINTPRE 9 +#define STD_PROPERTIES 10 +#define STD_HELP 11 +#define STD_FIND 12 +#define STD_REPLACE 13 +#define STD_PRINT 14 +#define VIEW_LARGEICONS 0 +#define VIEW_SMALLICONS 1 +#define VIEW_LIST 2 +#define VIEW_DETAILS 3 +#define VIEW_SORTNAME 4 +#define VIEW_SORTSIZE 5 +#define VIEW_SORTDATE 6 +#define VIEW_SORTTYPE 7 +#define VIEW_PARENTFOLDER 8 +#define VIEW_NETCONNECT 9 +#define VIEW_NETDISCONNECT 10 +#define VIEW_NEWFOLDER 11 +#define TB_ENABLEBUTTON (WM_USER+1) +#define TB_CHECKBUTTON (WM_USER+2) +#define TB_PRESSBUTTON (WM_USER+3) +#define TB_HIDEBUTTON (WM_USER+4) +#define TB_INDETERMINATE (WM_USER+5) +#define TB_MARKBUTTON (WM_USER+6) +#define TB_ISBUTTONENABLED (WM_USER+9) +#define TB_ISBUTTONCHECKED (WM_USER+10) +#define TB_ISBUTTONPRESSED (WM_USER+11) +#define TB_ISBUTTONHIDDEN (WM_USER+12) +#define TB_ISBUTTONINDETERMINATE (WM_USER+13) +#define TB_ISBUTTONHIGHLIGHTED (WM_USER+14) +#define TB_SETSTATE (WM_USER+17) +#define TB_GETSTATE (WM_USER+18) +#define TB_ADDBITMAP (WM_USER+19) +#define TB_ADDBUTTONSA (WM_USER+20) +#define TB_INSERTBUTTONA (WM_USER+21) +#define TB_DELETEBUTTON (WM_USER+22) +#define TB_GETBUTTON (WM_USER+23) +#define TB_BUTTONCOUNT (WM_USER+24) +#define TB_COMMANDTOINDEX (WM_USER+25) +#define TB_SAVERESTOREA (WM_USER+26) +#define TB_SAVERESTOREW (WM_USER+76) +#define TB_CUSTOMIZE (WM_USER+27) +#define TB_ADDSTRINGA (WM_USER+28) +#define TB_ADDSTRINGW (WM_USER+77) +#define TB_GETITEMRECT (WM_USER+29) +#define TB_BUTTONSTRUCTSIZE (WM_USER+30) +#define TB_SETBUTTONSIZE (WM_USER+31) +#define TB_SETBITMAPSIZE (WM_USER+32) +#define TB_AUTOSIZE (WM_USER+33) +#define TB_GETTOOLTIPS (WM_USER+35) +#define TB_SETTOOLTIPS (WM_USER+36) +#define TB_SETPARENT (WM_USER+37) +#define TB_SETROWS (WM_USER+39) +#define TB_GETROWS (WM_USER+40) +#define TB_GETBITMAPFLAGS (WM_USER+41) +#define TB_SETCMDID (WM_USER+42) +#define TB_CHANGEBITMAP (WM_USER+43) +#define TB_GETBITMAP (WM_USER+44) +#define TB_GETBUTTONTEXTA (WM_USER+45) +#define TB_GETBUTTONTEXTW (WM_USER+75) +#define TB_REPLACEBITMAP (WM_USER+46) +#define TB_SETINDENT (WM_USER+47) +#define TB_SETIMAGELIST (WM_USER+48) +#define TB_GETIMAGELIST (WM_USER+49) +#define TB_LOADIMAGES (WM_USER+50) +#define TB_GETRECT (WM_USER+51) +#define TB_SETHOTIMAGELIST (WM_USER+52) +#define TB_GETHOTIMAGELIST (WM_USER+53) +#define TB_SETDISABLEDIMAGELIST (WM_USER+54) +#define TB_GETDISABLEDIMAGELIST (WM_USER+55) +#define TB_SETSTYLE (WM_USER+56) +#define TB_GETSTYLE (WM_USER+57) +#define TB_GETBUTTONSIZE (WM_USER+58) +#define TB_SETBUTTONWIDTH (WM_USER+59) +#define TB_SETMAXTEXTROWS (WM_USER+60) +#define TB_GETTEXTROWS (WM_USER+61) +#define TB_GETOBJECT (WM_USER+62) +#define TB_GETBUTTONINFOW (WM_USER+63) +#define TB_SETBUTTONINFOW (WM_USER+64) +#define TB_GETBUTTONINFOA (WM_USER+65) +#define TB_SETBUTTONINFOA (WM_USER+66) +#define TB_INSERTBUTTONW (WM_USER+67) +#define TB_ADDBUTTONSW (WM_USER+68) +#define TB_HITTEST (WM_USER+69) +#define TB_SETDRAWTEXTFLAGS (WM_USER+70) +#define TB_GETHOTITEM (WM_USER+71) +#define TB_SETHOTITEM (WM_USER+72) +#define TB_SETANCHORHIGHLIGHT (WM_USER+73) +#define TB_GETANCHORHIGHLIGHT (WM_USER+74) +#define TB_MAPACCELERATORA (WM_USER+78) +#define TB_GETINSERTMARK (WM_USER+79) +#define TB_SETINSERTMARK (WM_USER+80) +#define TB_INSERTMARKHITTEST (WM_USER+81) +#define TB_MOVEBUTTON (WM_USER+82) +#define TB_GETMAXSIZE (WM_USER+83) +#define TB_SETEXTENDEDSTYLE (WM_USER+84) +#define TB_GETEXTENDEDSTYLE (WM_USER+85) +#define TB_GETPADDING (WM_USER+86) +#define TB_SETPADDING (WM_USER+87) +#define TB_SETINSERTMARKCOLOR (WM_USER+88) +#define TB_GETINSERTMARKCOLOR (WM_USER+89) +#define TB_MAPACCELERATORW (WM_USER+90) +#define TB_GETSTRINGW (WM_USER+91) +#define TB_GETSTRINGA (WM_USER+92) +#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME +#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME +#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TBBF_LARGE 1 +#define TBN_GETBUTTONINFOA (TBN_FIRST-0) +#define TBN_BEGINDRAG (TBN_FIRST-1) +#define TBN_ENDDRAG (TBN_FIRST-2) +#define TBN_BEGINADJUST (TBN_FIRST-3) +#define TBN_ENDADJUST (TBN_FIRST-4) +#define TBN_RESET (TBN_FIRST-5) +#define TBN_QUERYINSERT (TBN_FIRST-6) +#define TBN_QUERYDELETE (TBN_FIRST-7) +#define TBN_TOOLBARCHANGE (TBN_FIRST-8) +#define TBN_CUSTHELP (TBN_FIRST-9) +#define TBN_DROPDOWN (TBN_FIRST-10) +#define TBN_HOTITEMCHANGE (TBN_FIRST-13) +#define TBN_DRAGOUT (TBN_FIRST-14) +#define TBN_DELETINGBUTTON (TBN_FIRST-15) +#define TBN_GETDISPINFOA (TBN_FIRST-16) +#define TBN_GETDISPINFOW (TBN_FIRST-17) +#define TBN_GETINFOTIPA (TBN_FIRST-18) +#define TBN_GETINFOTIPW (TBN_FIRST-19) +#define TBN_GETBUTTONINFOW (TBN_FIRST-20) +#define TBN_RESTORE (TBN_FIRST-21) +#define TBN_SAVE (TBN_FIRST-22) +#define TBN_INITCUSTOMIZE (TBN_FIRST-23) +#define TBNRF_HIDEHELP 1 +#define TBNRF_ENDCUSTOMIZE 2 +#define TBNF_IMAGE 1 +#define TBNF_TEXT 2 +#define TBNF_DI_SETITEM 0x10000000 +#define TTS_ALWAYSTIP 1 +#define TTS_NOPREFIX 2 +#define TTS_NOANIMATE 0x10 +#define TTS_NOFADE 0x20 +#define TTS_BALLOON 0x40 +#define TTS_CLOSE 0x80 +#define TTF_IDISHWND 1 +#define TTF_CENTERTIP 2 +#define TTF_RTLREADING 4 +#define TTF_SUBCLASS 16 +#define TTF_TRACK 0x0020 +#define TTF_ABSOLUTE 0x0080 +#define TTF_TRANSPARENT 0x0100 +#define TTF_PARSELINKS 0x1000 +#define TTF_DI_SETITEM 0x8000 +#define TBCD_TICS 1 +#define TBCD_THUMB 2 +#define TBCD_CHANNEL 3 +#define TBDDRET_DEFAULT 0 +#define TBDDRET_NODEFAULT 1 +#define TBDDRET_TREATPRESSED 2 +#define TBIMHT_AFTER 1 +#define TBIMHT_BACKGROUND 2 +#define TTDT_AUTOMATIC 0 +#define TTDT_RESHOW 1 +#define TTDT_AUTOPOP 2 +#define TTDT_INITIAL 3 +#define TTM_ACTIVATE (WM_USER+1) +#define TTM_SETDELAYTIME (WM_USER+3) +#define TTM_ADDTOOLA (WM_USER+4) +#define TTM_ADDTOOLW (WM_USER+50) +#define TTM_DELTOOLA (WM_USER+5) +#define TTM_DELTOOLW (WM_USER+51) +#define TTM_NEWTOOLRECTA (WM_USER+6) +#define TTM_NEWTOOLRECTW (WM_USER+52) +#define TTM_RELAYEVENT (WM_USER+7) +#define TTM_GETTOOLINFOA (WM_USER+8) +#define TTM_GETTOOLINFOW (WM_USER+53) +#define TTM_SETTOOLINFOA (WM_USER+9) +#define TTM_SETTOOLINFOW (WM_USER+54) +#define TTM_HITTESTA (WM_USER+10) +#define TTM_HITTESTW (WM_USER+55) +#define TTM_GETTEXTA (WM_USER+11) +#define TTM_GETTEXTW (WM_USER+56) +#define TTM_UPDATETIPTEXTA (WM_USER+12) +#define TTM_UPDATETIPTEXTW (WM_USER+57) +#define TTM_GETTOOLCOUNT (WM_USER+13) +#define TTM_ENUMTOOLSA (WM_USER+14) +#define TTM_ENUMTOOLSW (WM_USER+58) +#define TTM_GETCURRENTTOOLA (WM_USER+15) +#define TTM_GETCURRENTTOOLW (WM_USER+59) +#define TTM_WINDOWFROMPOINT (WM_USER+16) +#define TTM_TRACKACTIVATE (WM_USER+17) +#define TTM_TRACKPOSITION (WM_USER+18) +#define TTM_SETTIPBKCOLOR (WM_USER+19) +#define TTM_SETTIPTEXTCOLOR (WM_USER+20) +#define TTM_GETDELAYTIME (WM_USER+21) +#define TTM_GETTIPBKCOLOR (WM_USER+22) +#define TTM_GETTIPTEXTCOLOR (WM_USER+23) +#define TTM_SETMAXTIPWIDTH (WM_USER+24) +#define TTM_GETMAXTIPWIDTH (WM_USER+25) +#define TTM_SETMARGIN (WM_USER+26) +#define TTM_GETMARGIN (WM_USER+27) +#define TTM_POP (WM_USER+28) +#define TTM_UPDATE (WM_USER+29) +#define TTM_GETBUBBLESIZE (WM_USER+30) +#define TTM_ADJUSTRECT (WM_USER+31) +#define TTM_SETTITLEA (WM_USER+32) +#define TTM_SETTITLEW (WM_USER+33) +#define TTN_GETDISPINFOA (TTN_FIRST - 0) +#define TTN_GETDISPINFOW (TTN_FIRST - 10) +#define TTN_NEEDTEXTA TTN_GETDISPINFOA +#define TTN_NEEDTEXTW TTN_GETDISPINFOW +#define TTN_SHOW (TTN_FIRST-1) +#define TTN_POP (TTN_FIRST-2) +#define UD_MAXVAL 0x7fff +#define UD_MINVAL (-UD_MAXVAL) +#define UDN_DELTAPOS (UDN_FIRST-1) +#define UDS_WRAP 1 +#define UDS_SETBUDDYINT 2 +#define UDS_ALIGNRIGHT 4 +#define UDS_ALIGNLEFT 8 +#define UDS_AUTOBUDDY 16 +#define UDS_ARROWKEYS 32 +#define UDS_HORZ 64 +#define UDS_NOTHOUSANDS 128 +#define UDS_HOTTRACK 0x0100 +#define UDM_SETRANGE (WM_USER+101) +#define UDM_GETRANGE (WM_USER+102) +#define UDM_SETPOS (WM_USER+103) +#define UDM_GETPOS (WM_USER+104) +#define UDM_SETBUDDY (WM_USER+105) +#define UDM_GETBUDDY (WM_USER+106) +#define UDM_SETACCEL (WM_USER+107) +#define UDM_GETACCEL (WM_USER+108) +#define UDM_SETBASE (WM_USER+109) +#define UDM_GETBASE (WM_USER+110) +#define UDM_SETRANGE32 (WM_USER+111) +#define UDM_GETRANGE32 (WM_USER+112) +#define UDM_SETPOS32 (WM_USER+113) +#define UDM_GETPOS32 (WM_USER+114) +#define UDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define UDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define SBT_TOOLTIPS 0x0800 +#define SBN_SIMPLEMODECHANGE (SBN_FIRST) +#define TBS_AUTOTICKS 1 +#define TBS_VERT 2 +#define TBS_HORZ 0 +#define TBS_TOP 4 +#define TBS_BOTTOM 0 +#define TBS_LEFT 4 +#define TBS_RIGHT 0 +#define TBS_BOTH 8 +#define TBS_NOTICKS 16 +#define TBS_ENABLESELRANGE 32 +#define TBS_FIXEDLENGTH 64 +#define TBS_NOTHUMB 128 +#define TBS_TOOLTIPS 0x0100 +#define TBTS_TOP 0 +#define TBTS_LEFT 1 +#define TBTS_BOTTOM 2 +#define TBTS_RIGHT 3 +#define TBS_REVERSED 0x0200 +#define TBS_DOWNISLEFT 0x0400 +#define TBIF_BYINDEX 0x80000000 +#define TBIF_COMMAND 32 +#define TBIF_IMAGE 1 +#define TBIF_LPARAM 16 +#define TBIF_SIZE 64 +#define TBIF_STATE 4 +#define TBIF_STYLE 8 +#define TBIF_TEXT 2 +#define TBM_GETPOS (WM_USER) +#define TBM_GETRANGEMIN (WM_USER+1) +#define TBM_GETRANGEMAX (WM_USER+2) +#define TBM_GETTIC (WM_USER+3) +#define TBM_SETTIC (WM_USER+4) +#define TBM_SETPOS (WM_USER+5) +#define TBM_SETRANGE (WM_USER+6) +#define TBM_SETRANGEMIN (WM_USER+7) +#define TBM_SETRANGEMAX (WM_USER+8) +#define TBM_CLEARTICS (WM_USER+9) +#define TBM_SETSEL (WM_USER+10) +#define TBM_SETSELSTART (WM_USER+11) +#define TBM_SETSELEND (WM_USER+12) +#define TBM_GETPTICS (WM_USER+14) +#define TBM_GETTICPOS (WM_USER+15) +#define TBM_GETNUMTICS (WM_USER+16) +#define TBM_GETSELSTART (WM_USER+17) +#define TBM_GETSELEND (WM_USER+18) +#define TBM_CLEARSEL (WM_USER+19) +#define TBM_SETTICFREQ (WM_USER+20) +#define TBM_SETPAGESIZE (WM_USER+21) +#define TBM_GETPAGESIZE (WM_USER+22) +#define TBM_SETLINESIZE (WM_USER+23) +#define TBM_GETLINESIZE (WM_USER+24) +#define TBM_GETTHUMBRECT (WM_USER+25) +#define TBM_GETCHANNELRECT (WM_USER+26) +#define TBM_SETTHUMBLENGTH (WM_USER+27) +#define TBM_GETTHUMBLENGTH (WM_USER+28) +#define TBM_SETTOOLTIPS (WM_USER+29) +#define TBM_GETTOOLTIPS (WM_USER+30) +#define TBM_SETTIPSIDE (WM_USER+31) +#define TBM_SETBUDDY (WM_USER+32) +#define TBM_GETBUDDY (WM_USER+33) +#define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TB_LINEUP 0 +#define TB_LINEDOWN 1 +#define TB_PAGEUP 2 +#define TB_PAGEDOWN 3 +#define TB_THUMBPOSITION 4 +#define TB_THUMBTRACK 5 +#define TB_TOP 6 +#define TB_BOTTOM 7 +#define TB_ENDTRACK 8 +#define HOTKEYF_SHIFT 1 +#define HOTKEYF_CONTROL 2 +#define HOTKEYF_ALT 4 +#define HOTKEYF_EXT 8 +#define HKCOMB_NONE 1 +#define HKCOMB_S 2 +#define HKCOMB_C 4 +#define HKCOMB_A 8 +#define HKCOMB_SC 16 +#define HKCOMB_SA 32 +#define HKCOMB_CA 64 +#define HKCOMB_SCA 128 +#define HKM_SETHOTKEY (WM_USER+1) +#define HKM_GETHOTKEY (WM_USER+2) +#define HKM_SETRULES (WM_USER+3) +#define PBM_SETRANGE (WM_USER+1) +#define PBM_SETPOS (WM_USER+2) +#define PBM_DELTAPOS (WM_USER+3) +#define PBM_SETSTEP (WM_USER+4) +#define PBM_STEPIT (WM_USER+5) +#define PBM_SETRANGE32 1030 +#define PBM_GETRANGE 1031 +#define PBM_GETPOS 1032 +#define PBM_SETBARCOLOR 1033 +#define PBM_SETBKCOLOR CCM_SETBKCOLOR +#define PBS_SMOOTH 1 +#define PBS_VERTICAL 4 +#define LVS_ICON 0 +#define LVS_REPORT 1 +#define LVS_SMALLICON 2 +#define LVS_LIST 3 +#define LVS_TYPEMASK 3 +#define LVS_SINGLESEL 4 +#define LVS_SHOWSELALWAYS 8 +#define LVS_SORTASCENDING 16 +#define LVS_SORTDESCENDING 32 +#define LVS_SHAREIMAGELISTS 64 +#define LVS_NOLABELWRAP 128 +#define LVS_AUTOARRANGE 256 +#define LVS_EDITLABELS 512 +#define LVS_NOSCROLL 0x2000 +#define LVS_TYPESTYLEMASK 0xfc00 +#define LVS_ALIGNTOP 0 +#define LVS_ALIGNLEFT 0x800 +#define LVS_ALIGNMASK 0xc00 +#define LVS_OWNERDRAWFIXED 0x400 +#define LVS_NOCOLUMNHEADER 0x4000 +#define LVS_NOSORTHEADER 0x8000 +#define CDIS_CHECKED 8 +#define CDIS_DEFAULT 32 +#define CDIS_DISABLED 4 +#define CDIS_FOCUS 16 +#define CDIS_GRAYED 2 +#define CDIS_HOT 64 +#define CDIS_SELECTED 1 +#define CDIS_MARKED 128 +#define CDIS_INDETERMINATE 256 +#define CDIS_SHOWKEYBOARDCUES 512 +#define CDDS_POSTERASE 4 +#define CDDS_POSTPAINT 2 +#define CDDS_PREERASE 3 +#define CDDS_PREPAINT 1 +#define CDDS_ITEM 65536 +#define CDDS_ITEMPOSTERASE 65540 +#define CDDS_ITEMPOSTPAINT 65538 +#define CDDS_ITEMPREERASE 65539 +#define CDDS_ITEMPREPAINT 65537 +#define CDDS_SUBITEM 0x20000 +#define CDRF_DODEFAULT 0x00 +#define CDRF_NOTIFYITEMDRAW 0x20 +#define CDRF_NOTIFYSUBITEMDRAW 0x20 +#define CDRF_NOTIFYITEMERASE 0x80 +#define CDRF_NOTIFYPOSTERASE 0x40 +#define CDRF_NOTIFYPOSTPAINT 0x10 +#define CDRF_NEWFONT 0x02 +#define CDRF_SKIPDEFAULT 0x04 +#define LVBKIF_SOURCE_NONE 0x00000000 +#define LVBKIF_SOURCE_HBITMAP 0x00000001 +#define LVBKIF_SOURCE_URL 0x00000002 +#define LVBKIF_SOURCE_MASK 0x00000003 +#define LVBKIF_STYLE_NORMAL 0x00000000 +#define LVBKIF_STYLE_TILE 0x00000010 +#define LVBKIF_STYLE_MASK 0x00000010 +#define LVBKIF_FLAG_TILEOFFSET 0x00000100 +#define LVBKIF_TYPE_WATERMARK 0x10000000 +#define LVS_OWNERDATA 4096 +#define LVS_EX_CHECKBOXES 4 +#define LVS_EX_FULLROWSELECT 32 +#define LVS_EX_GRIDLINES 1 +#define LVS_EX_HEADERDRAGDROP 16 +#define LVS_EX_ONECLICKACTIVATE 64 +#define LVS_EX_SUBITEMIMAGES 2 +#define LVS_EX_TRACKSELECT 8 +#define LVS_EX_TWOCLICKACTIVATE 128 +#define LVSICF_NOINVALIDATEALL 0x00000001 +#define LVSICF_NOSCROLL 0x00000002 +#define LVS_EX_FLATSB 0x00000100 +#define LVS_EX_REGIONAL 0x00000200 +#define LVS_EX_INFOTIP 0x00000400 +#define LVS_EX_UNDERLINEHOT 0x00000800 +#define LVS_EX_UNDERLINECOLD 0x00001000 +#define LVS_EX_MULTIWORKAREAS 0x00002000 +#define LVS_EX_LABELTIP 0x00004000 +#define LVS_EX_BORDERSELECT 0x00008000 +#define LVSIL_NORMAL 0 +#define LVSIL_SMALL 1 +#define LVSIL_STATE 2 +#define LVM_GETBKCOLOR LVM_FIRST +#define LVM_SETBKCOLOR (LVM_FIRST+1) +#define LVM_GETIMAGELIST (LVM_FIRST+2) +#define LVM_SETIMAGELIST (LVM_FIRST+3) +#define LVM_GETITEMCOUNT (LVM_FIRST+4) +#define LVM_SORTITEMSEX (LVM_FIRST+81) +#define LVM_SETSELECTEDCOLUMN (LVM_FIRST+140) +#define LVM_SETVIEW (LVM_FIRST+142) +#define LVM_GETVIEW (LVM_FIRST+143) +#define LVM_INSERTGROUP (LVM_FIRST+145) +#define LVM_SETGROUPINFO (LVM_FIRST+147) +#define LVM_GETGROUPINFO (LVM_FIRST+149) +#define LVM_REMOVEGROUP (LVM_FIRST+150) +#define LVM_MOVEGROUP (LVM_FIRST+151) +#define LVM_SETGROUPMETRICS (LVM_FIRST+155) +#define LVM_GETGROUPMETRICS (LVM_FIRST+156) +#define LVM_ENABLEGROUPVIEW (LVM_FIRST+157) +#define LVM_SORTGROUPS (LVM_FIRST+158) +#define LVM_INSERTGROUPSORTED (LVM_FIRST+159) +#define LVM_REMOVEALLGROUPS (LVM_FIRST+160) +#define LVM_HASGROUP (LVM_FIRST+161) +#define LVM_SETTILEVIEWINFO (LVM_FIRST+162) +#define LVM_GETTILEVIEWINFO (LVM_FIRST+163) +#define LVM_SETTILEINFO (LVM_FIRST+164) +#define LVM_GETTILEINFO (LVM_FIRST+165) +#define LVM_SETINSERTMARK (LVM_FIRST+166) +#define LVM_GETINSERTMARK (LVM_FIRST+167) +#define LVM_INSERTMARKHITTEST (LVM_FIRST+168) +#define LVM_GETINSERTMARKRECT (LVM_FIRST+169) +#define LVM_SETINSERTMARKCOLOR (LVM_FIRST+170) +#define LVM_GETINSERTMARKCOLOR (LVM_FIRST+171) +#define LVM_SETINFOTIP (LVM_FIRST+173) +#define LVM_GETSELECTEDCOLUMN (LVM_FIRST+174) +#define LVM_ISGROUPVIEWENABLED (LVM_FIRST+175) +#define LVM_GETOUTLINECOLOR (LVM_FIRST+176) +#define LVM_SETOUTLINECOLOR (LVM_FIRST+177) +#define LVM_CANCELEDITLABEL (LVM_FIRST+179) +#define LVM_MAPIDTOINDEX (LVM_FIRST+181) +#define LVIF_TEXT 1 +#define LVIF_IMAGE 2 +#define LVIF_PARAM 4 +#define LVIF_STATE 8 +#define LVIF_INDENT 16 +#define LVIF_NORECOMPUTE 2048 +#define LVIF_GROUPID 128 +#define LVIF_COLUMNS 256 +#define LVIS_FOCUSED 1 +#define LVIS_SELECTED 2 +#define LVIS_CUT 4 +#define LVIS_DROPHILITED 8 +#define LVIS_OVERLAYMASK 0xF00 +#define LVIS_STATEIMAGEMASK 0xF000 +#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1) +#define LPSTR_TEXTCALLBACKA ((LPSTR)-1) +#define I_IMAGECALLBACK (-1) +#define LVM_GETITEMA (LVM_FIRST+5) +#define LVM_GETITEMW (LVM_FIRST+75) +#define LVM_SETITEMA (LVM_FIRST+6) +#define LVM_SETITEMW (LVM_FIRST+76) +#define LVM_INSERTITEMA (LVM_FIRST+7) +#define LVM_INSERTITEMW (LVM_FIRST+77) +#define LVM_DELETEITEM (LVM_FIRST+8) +#define LVM_DELETEALLITEMS (LVM_FIRST+9) +#define LVM_GETCALLBACKMASK (LVM_FIRST+10) +#define LVM_SETCALLBACKMASK (LVM_FIRST+11) +#define LVM_SETBKIMAGEA (LVM_FIRST + 68) +#define LVM_SETBKIMAGEW (LVM_FIRST + 138) +#define LVM_GETBKIMAGEA (LVM_FIRST + 69) +#define LVM_GETBKIMAGEW (LVM_FIRST + 139) +#define LV_MAX_WORKAREAS 16 +#define LVM_SETWORKAREAS (LVM_FIRST+65) +#define LVM_GETWORKAREAS (LVM_FIRST+70) +#define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST+73) +#define LVM_GETSELECTIONMARK (LVM_FIRST+66) +#define LVM_SETSELECTIONMARK (LVM_FIRST+67) +#define LVM_SETHOVERTIME (LVM_FIRST+71) +#define LVM_GETHOVERTIME (LVM_FIRST+72) +#define LVM_SETTOOLTIPS (LVM_FIRST+74) +#define LVM_GETTOOLTIPS (LVM_FIRST+78) +#define LVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define LVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define LVNI_ALL 0 +#define LVNI_FOCUSED 1 +#define LVNI_SELECTED 2 +#define LVNI_CUT 4 +#define LVNI_DROPHILITED 8 +#define LVNI_ABOVE 256 +#define LVNI_BELOW 512 +#define LVNI_TOLEFT 1024 +#define LVNI_TORIGHT 2048 +#define LVM_GETNEXTITEM (LVM_FIRST+12) +#define LVFI_PARAM 1 +#define LVFI_STRING 2 +#define LVFI_PARTIAL 8 +#define LVFI_WRAP 32 +#define LVFI_NEARESTXY 64 +#define LVIF_DI_SETITEM 0x1000 +#define LVM_FINDITEMA (LVM_FIRST+13) +#define LVM_FINDITEMW (LVM_FIRST+83) +#define LVIR_BOUNDS 0 +#define LVIR_ICON 1 +#define LVIR_LABEL 2 +#define LVIR_SELECTBOUNDS 3 +#define LVM_GETITEMRECT (LVM_FIRST+14) +#define LVM_SETITEMPOSITION (LVM_FIRST+15) +#define LVM_GETITEMPOSITION (LVM_FIRST+16) +#define LVM_GETSTRINGWIDTHA (LVM_FIRST+17) +#define LVM_GETSTRINGWIDTHW (LVM_FIRST+87) +#define LVHT_NOWHERE 1 +#define LVHT_ONITEMICON 2 +#define LVHT_ONITEMLABEL 4 +#define LVHT_ONITEMSTATEICON 8 +#define LVHT_ONITEM (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON) +#define LVHT_ABOVE 8 +#define LVHT_BELOW 16 +#define LVHT_TORIGHT 32 +#define LVHT_TOLEFT 64 +#define LVM_HITTEST (LVM_FIRST+18) +#define LVM_ENSUREVISIBLE (LVM_FIRST+19) +#define LVM_SCROLL (LVM_FIRST+20) +#define LVM_REDRAWITEMS (LVM_FIRST+21) +#define LVA_DEFAULT 0 +#define LVA_ALIGNLEFT 1 +#define LVA_ALIGNTOP 2 +#define LVA_SNAPTOGRID 5 +#define LVM_ARRANGE (LVM_FIRST+22) +#define LVM_EDITLABELA (LVM_FIRST+23) +#define LVM_EDITLABELW (LVM_FIRST+118) +#define LVM_GETEDITCONTROL (LVM_FIRST+24) +#define LVCF_FMT 1 +#define LVCF_WIDTH 2 +#define LVCF_TEXT 4 +#define LVCF_SUBITEM 8 +#define LVCF_IMAGE 16 +#define LVCF_ORDER 32 +#define LVCFMT_LEFT 0 +#define LVCFMT_RIGHT 1 +#define LVCFMT_CENTER 2 +#define LVCFMT_JUSTIFYMASK 3 +#define LVCFMT_BITMAP_ON_RIGHT 4096 +#define LVCFMT_COL_HAS_IMAGES 32768 +#define LVCFMT_IMAGE 2048 +#define LVM_GETCOLUMNA (LVM_FIRST+25) +#define LVM_GETCOLUMNW (LVM_FIRST+95) +#define LVM_SETCOLUMNA (LVM_FIRST+26) +#define LVM_SETCOLUMNW (LVM_FIRST+96) +#define LVM_INSERTCOLUMNA (LVM_FIRST+27) +#define LVM_INSERTCOLUMNW (LVM_FIRST+97) +#define LVM_DELETECOLUMN (LVM_FIRST+28) +#define LVM_GETCOLUMNWIDTH (LVM_FIRST+29) +#define LVSCW_AUTOSIZE (-1) +#define LVSCW_AUTOSIZE_USEHEADER (-2) +#define LVM_SETCOLUMNWIDTH (LVM_FIRST+30) +#define LVM_CREATEDRAGIMAGE (LVM_FIRST+33) +#define LVM_GETVIEWRECT (LVM_FIRST+34) +#define LVM_GETTEXTCOLOR (LVM_FIRST+35) +#define LVM_SETTEXTCOLOR (LVM_FIRST+36) +#define LVM_GETTEXTBKCOLOR (LVM_FIRST+37) +#define LVM_SETTEXTBKCOLOR (LVM_FIRST+38) +#define LVM_GETTOPINDEX (LVM_FIRST+39) +#define LVM_GETCOUNTPERPAGE (LVM_FIRST+40) +#define LVM_GETORIGIN (LVM_FIRST+41) +#define LVM_UPDATE (LVM_FIRST+42) +#define LVM_SETITEMSTATE (LVM_FIRST+43) +#define LVM_GETITEMSTATE (LVM_FIRST+44) +#define LVM_GETITEMTEXTA (LVM_FIRST+45) +#define LVM_GETITEMTEXTW (LVM_FIRST+115) +#define LVM_SETITEMTEXTA (LVM_FIRST+46) +#define LVM_SETITEMTEXTW (LVM_FIRST+116) +#define LVM_SETITEMCOUNT (LVM_FIRST+47) +#define LVM_SORTITEMS (LVM_FIRST+48) +#define LVM_SETITEMPOSITION32 (LVM_FIRST+49) +#define LVM_GETSELECTEDCOUNT (LVM_FIRST+50) +#define LVM_GETITEMSPACING (LVM_FIRST+51) +#define LVM_GETISEARCHSTRINGA (LVM_FIRST+52) +#define LVM_GETISEARCHSTRINGW (LVM_FIRST+117) +#define LVM_APPROXIMATEVIEWRECT (LVM_FIRST+64) +#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54) +#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55) +#define LVM_SETCOLUMNORDERARRAY (LVM_FIRST+58) +#define LVM_GETCOLUMNORDERARRAY (LVM_FIRST+59) +#define LVM_GETHEADER (LVM_FIRST+31) +#define LVM_GETHOTCURSOR (LVM_FIRST+63) +#define LVM_GETHOTITEM (LVM_FIRST+61) +#define LVM_GETSUBITEMRECT (LVM_FIRST+56) +#define LVM_SETHOTCURSOR (LVM_FIRST+62) +#define LVM_SETHOTITEM (LVM_FIRST+60) +#define LVM_SETICONSPACING (LVM_FIRST+53) +#define LVM_SUBITEMHITTEST (LVM_FIRST+57) +#define LVN_ITEMCHANGING LVN_FIRST +#define LVN_ITEMCHANGED (LVN_FIRST-1) +#define LVN_INSERTITEM (LVN_FIRST-2) +#define LVN_DELETEITEM (LVN_FIRST-3) +#define LVN_DELETEALLITEMS (LVN_FIRST-4) +#define LVN_BEGINLABELEDITA (LVN_FIRST-5) +#define LVN_BEGINLABELEDITW (LVN_FIRST-75) +#define LVN_ENDLABELEDITA (LVN_FIRST-6) +#define LVN_ENDLABELEDITW (LVN_FIRST-76) +#define LVN_COLUMNCLICK (LVN_FIRST-8) +#define LVN_BEGINDRAG (LVN_FIRST-9) +#define LVN_BEGINRDRAG (LVN_FIRST-11) +#define LVN_GETDISPINFOA (LVN_FIRST-50) +#define LVN_GETDISPINFOW (LVN_FIRST-77) +#define LVN_SETDISPINFOA (LVN_FIRST-51) +#define LVN_SETDISPINFOW (LVN_FIRST-78) +#define LVN_KEYDOWN (LVN_FIRST-55) +#define LVN_GETINFOTIPA (LVN_FIRST-57) +#define LVN_GETINFOTIPW (LVN_FIRST-58) +#define LVKF_ALT 0x0001 +#define LVKF_CONTROL 0x0002 +#define LVKF_SHIFT 0x0004 +#define LVGIT_UNFOLDED 1 +#define TVS_HASBUTTONS 1 +#define TVS_HASLINES 2 +#define TVS_LINESATROOT 4 +#define TVS_EDITLABELS 8 +#define TVS_DISABLEDRAGDROP 16 +#define TVS_SHOWSELALWAYS 32 +#define TVS_CHECKBOXES 256 +#define TVS_NOTOOLTIPS 128 +#define TVS_RTLREADING 64 +#define TVS_TRACKSELECT 512 +#define TVS_FULLROWSELECT 4096 +#define TVS_INFOTIP 2048 +#define TVS_NONEVENHEIGHT 16384 +#define TVS_NOSCROLL 8192 +#define TVS_SINGLEEXPAND 1024 +#define TVS_NOHSCROLL 0x8000 +#define TVIF_TEXT 1 +#define TVIF_IMAGE 2 +#define TVIF_PARAM 4 +#define TVIF_STATE 8 +#define TVIF_HANDLE 16 +#define TVIF_SELECTEDIMAGE 32 +#define TVIF_CHILDREN 64 +#define TVIF_INTEGRAL 0x0080 +#define TVIS_FOCUSED 1 +#define TVIS_SELECTED 2 +#define TVIS_CUT 4 +#define TVIS_DROPHILITED 8 +#define TVIS_BOLD 16 +#define TVIS_EXPANDED 32 +#define TVIS_EXPANDEDONCE 64 +#define TVIS_OVERLAYMASK 0xF00 +#define TVIS_STATEIMAGEMASK 0xF000 +#define TVIS_USERMASK 0xF000 +#define I_CHILDRENCALLBACK (-1) +#define TVI_ROOT ((HTREEITEM)0xFFFF0000) +#define TVI_FIRST ((HTREEITEM)0xFFFF0001) +#define TVI_LAST ((HTREEITEM)0xFFFF0002) +#define TVI_SORT ((HTREEITEM)0xFFFF0003) +#define TVSIL_NORMAL 0 +#define TVSIL_STATE 2 +#define TVM_INSERTITEMA TV_FIRST +#define TVM_INSERTITEMW (TV_FIRST+50) +#define TVM_DELETEITEM (TV_FIRST+1) +#define TVM_EXPAND (TV_FIRST+2) +#define TVM_GETITEMRECT (TV_FIRST+4) +#define TVM_GETCOUNT (TV_FIRST+5) +#define TVM_GETINDENT (TV_FIRST+6) +#define TVM_SETINDENT (TV_FIRST+7) +#define TVM_GETIMAGELIST (TV_FIRST+8) +#define TVM_SETIMAGELIST (TV_FIRST+9) +#define TVM_GETNEXTITEM (TV_FIRST+10) +#define TVM_SELECTITEM (TV_FIRST+11) +#define TVM_GETITEMA (TV_FIRST+12) +#define TVM_GETITEMW (TV_FIRST+62) +#define TVM_SETITEMA (TV_FIRST+13) +#define TVM_SETITEMW (TV_FIRST+63) +#define TVM_EDITLABELA (TV_FIRST+14) +#define TVM_EDITLABELW (TV_FIRST+65) +#define TVM_GETEDITCONTROL (TV_FIRST+15) +#define TVM_GETVISIBLECOUNT (TV_FIRST+16) +#define TVM_HITTEST (TV_FIRST+17) +#define TVM_CREATEDRAGIMAGE (TV_FIRST+18) +#define TVM_SORTCHILDREN (TV_FIRST+19) +#define TVM_ENSUREVISIBLE (TV_FIRST+20) +#define TVM_SORTCHILDRENCB (TV_FIRST+21) +#define TVM_ENDEDITLABELNOW (TV_FIRST+22) +#define TVM_GETISEARCHSTRINGA (TV_FIRST+23) +#define TVM_GETISEARCHSTRINGW (TV_FIRST+64) +#define TVM_GETTOOLTIPS (TV_FIRST+25) +#define TVM_SETTOOLTIPS (TV_FIRST+24) +#define TVM_GETBKCOLOR (TV_FIRST+31) +#define TVM_GETINSERTMARKCOLOR (TV_FIRST+38) +#define TVM_GETITEMHEIGHT (TV_FIRST+28) +#define TVM_GETSCROLLTIME (TV_FIRST+34) +#define TVM_GETTEXTCOLOR (TV_FIRST+32) +#define TVM_SETBKCOLOR (TV_FIRST+29) +#define TVM_SETINSERTMARK (TV_FIRST+26) +#define TVM_SETINSERTMARKCOLOR (TV_FIRST+37) +#define TVM_SETITEMHEIGHT (TV_FIRST+27) +#define TVM_SETSCROLLTIME (TV_FIRST+33) +#define TVM_SETTEXTCOLOR (TV_FIRST+30) +#define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TVM_GETITEMSTATE (TV_FIRST+39) +#define TVM_SETLINECOLOR (TV_FIRST+40) +#define TVM_GETLINECOLOR (TV_FIRST+41) +#define TVE_COLLAPSE 1 +#define TVE_EXPAND 2 +#define TVE_TOGGLE 3 +#define TVE_COLLAPSERESET 0x8000 +#define TVE_EXPANDPARTIAL 0x4000 +#define TVC_UNKNOWN 0 +#define TVC_BYMOUSE 1 +#define TVC_BYKEYBOARD 2 +#define TVGN_ROOT 0 +#define TVGN_NEXT 1 +#define TVGN_PREVIOUS 2 +#define TVGN_PARENT 3 +#define TVGN_CHILD 4 +#define TVGN_FIRSTVISIBLE 5 +#define TVGN_NEXTVISIBLE 6 +#define TVGN_PREVIOUSVISIBLE 7 +#define TVGN_DROPHILITE 8 +#define TVGN_CARET 9 +#define TVGN_LASTVISIBLE 10 +#define TVN_SELCHANGINGA (TVN_FIRST-1) +#define TVN_SELCHANGINGW (TVN_FIRST-50) +#define TVN_SELCHANGEDA (TVN_FIRST-2) +#define TVN_SELCHANGEDW (TVN_FIRST-51) +#define TVN_GETDISPINFOA (TVN_FIRST-3) +#define TVN_GETDISPINFOW (TVN_FIRST-52) +#define TVN_SETDISPINFOA (TVN_FIRST-4) +#define TVN_SETDISPINFOW (TVN_FIRST-53) +#define TVN_ITEMEXPANDINGA (TVN_FIRST-5) +#define TVN_ITEMEXPANDINGW (TVN_FIRST-54) +#define TVN_ITEMEXPANDEDA (TVN_FIRST-6) +#define TVN_ITEMEXPANDEDW (TVN_FIRST-55) +#define TVN_BEGINDRAGA (TVN_FIRST-7) +#define TVN_BEGINDRAGW (TVN_FIRST-56) +#define TVN_BEGINRDRAGA (TVN_FIRST-8) +#define TVN_BEGINRDRAGW (TVN_FIRST-57) +#define TVN_DELETEITEMA (TVN_FIRST-9) +#define TVN_DELETEITEMW (TVN_FIRST-58) +#define TVN_BEGINLABELEDITA (TVN_FIRST-10) +#define TVN_BEGINLABELEDITW (TVN_FIRST-59) +#define TVN_ENDLABELEDITA (TVN_FIRST-11) +#define TVN_ENDLABELEDITW (TVN_FIRST-60) +#define TVN_KEYDOWN (TVN_FIRST-12) +#define TVN_GETINFOTIPA (TVN_FIRST-13) +#define TVN_GETINFOTIPW (TVN_FIRST-14) +#define TVN_SINGLEEXPAND (TVN_FIRST-15) +#define TVNRET_DEFAULT 0 +#define TVNRET_SKIPOLD 1 +#define TVNRET_SKIPNEW 2 +#define TVIF_DI_SETITEM 0x1000 +#define TVHT_NOWHERE 1 +#define TVHT_ONITEMICON 2 +#define TVHT_ONITEMLABEL 4 +#define TVHT_ONITEM (TVHT_ONITEMICON|TVHT_ONITEMLABEL|TVHT_ONITEMSTATEICON) +#define TVHT_ONITEMINDENT 8 +#define TVHT_ONITEMBUTTON 16 +#define TVHT_ONITEMRIGHT 32 +#define TVHT_ONITEMSTATEICON 64 +#define TVHT_ABOVE 256 +#define TVHT_BELOW 512 +#define TVHT_TORIGHT 1024 +#define TVHT_TOLEFT 2048 +#define TCHT_NOWHERE 1 +#define TCHT_ONITEMICON 2 +#define TCHT_ONITEMLABEL 4 +#define TCHT_ONITEM (TCHT_ONITEMICON|TCHT_ONITEMLABEL) +#define TCS_FORCEICONLEFT 16 +#define TCS_FORCELABELLEFT 32 +#define TCS_TABS 0 +#define TCS_BUTTONS 256 +#define TCS_SINGLELINE 0 +#define TCS_MULTILINE 512 +#define TCS_RIGHTJUSTIFY 0 +#define TCS_FIXEDWIDTH 1024 +#define TCS_RAGGEDRIGHT 2048 +#define TCS_FOCUSONBUTTONDOWN 0x1000 +#define TCS_OWNERDRAWFIXED 0x2000 +#define TCS_TOOLTIPS 0x4000 +#define TCS_FOCUSNEVER 0x8000 +#define TCS_BOTTOM 2 +#define TCS_RIGHT 2 +#define TCS_VERTICAL 128 +#define TCS_SCROLLOPPOSITE 0x0001 +#define TCS_HOTTRACK 0x0040 +#define TCS_MULTISELECT 0x0004 +#define TCS_FLATBUTTONS 0x0008 +#define TCS_EX_FLATSEPARATORS 0x00000001 +#define TCS_EX_REGISTERDROP 0x00000002 +#define TCIF_TEXT 1 +#define TCIF_IMAGE 2 +#define TCIF_RTLREADING 4 +#define TCIF_PARAM 8 +#define TCIF_STATE 16 +#define TCIS_BUTTONPRESSED 1 +#define TCIS_HIGHLIGHTED 2 +#define TCM_FIRST 0x1300 +#define TCM_GETIMAGELIST (TCM_FIRST+2) +#define TCM_SETIMAGELIST (TCM_FIRST+3) +#define TCM_GETITEMCOUNT (TCM_FIRST+4) +#define TCM_GETITEMA (TCM_FIRST+5) +#define TCM_GETITEMW (TCM_FIRST+60) +#define TCM_SETITEMA (TCM_FIRST+6) +#define TCM_SETITEMW (TCM_FIRST+61) +#define TCM_INSERTITEMA (TCM_FIRST+7) +#define TCM_INSERTITEMW (TCM_FIRST+62) +#define TCM_DELETEITEM (TCM_FIRST+8) +#define TCM_DELETEALLITEMS (TCM_FIRST+9) +#define TCM_GETITEMRECT (TCM_FIRST+10) +#define TCM_GETCURSEL (TCM_FIRST+11) +#define TCM_SETCURSEL (TCM_FIRST+12) +#define TCM_HITTEST (TCM_FIRST+13) +#define TCM_SETITEMEXTRA (TCM_FIRST+14) + +#define TCM_ADJUSTRECT (TCM_FIRST+40) +#define TCM_SETITEMSIZE (TCM_FIRST+41) +#define TCM_REMOVEIMAGE (TCM_FIRST+42) +#define TCM_SETPADDING (TCM_FIRST+43) +#define TCM_GETROWCOUNT (TCM_FIRST+44) +#define TCM_GETTOOLTIPS (TCM_FIRST+45) +#define TCM_SETTOOLTIPS (TCM_FIRST+46) +#define TCM_GETCURFOCUS (TCM_FIRST+47) +#define TCM_SETCURFOCUS (TCM_FIRST+48) +#define TCM_SETMINTABWIDTH (TCM_FIRST + 49) +#define TCM_DESELECTALL (TCM_FIRST + 50) +#define TCM_HIGHLIGHTITEM (TCM_FIRST + 51) +#define TCM_SETEXTENDEDSTYLE (TCM_FIRST + 52) +#define TCM_GETEXTENDEDSTYLE (TCM_FIRST + 53) +#define TCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TCN_KEYDOWN TCN_FIRST +#define TCN_SELCHANGE (TCN_FIRST-1) +#define TCN_SELCHANGING (TCN_FIRST-2) +#define NM_OUTOFMEMORY (NM_FIRST-1) +#define NM_CLICK (NM_FIRST-2) +#define NM_DBLCLK (NM_FIRST-3) +#define NM_RETURN (NM_FIRST-4) +#define NM_RCLICK (NM_FIRST-5) +#define NM_RDBLCLK (NM_FIRST-6) +#define NM_SETFOCUS (NM_FIRST-7) +#define NM_KILLFOCUS (NM_FIRST-8) +#define NM_CUSTOMDRAW (NM_FIRST-12) +#define NM_HOVER (NM_FIRST-13) +#define NM_NCHITTEST (NM_FIRST-14) +#define NM_KEYDOWN (NM_FIRST-15) +#define NM_RELEASEDCAPTURE (NM_FIRST-16) +#define NM_SETCURSOR (NM_FIRST-17) +#define NM_CHAR (NM_FIRST-18) +#define NM_TOOLTIPSCREATED (NM_FIRST-19) +#define SBARS_SIZEGRIP 256 +#define CCM_FIRST 0x2000 +#define CCM_LAST (CCM_FIRST+0x200) +#define CCM_SETBKCOLOR 8193 +#define CCM_SETCOLORSCHEME 8194 +#define CCM_GETCOLORSCHEME 8195 +#define CCM_GETDROPTARGET 8196 +#define CCM_SETUNICODEFORMAT 8197 +#define CCM_GETUNICODEFORMAT 8198 +#define CCM_SETVERSION 0x2007 +#define CCM_GETVERSION 0x2008 +#define CCM_SETNOTIFYWINDOW 0x2009 +#define CCM_SETWINDOWTHEME 0x200b +#define CCM_DPISCALE 0x200c +#define ICC_LISTVIEW_CLASSES 1 +#define ICC_TREEVIEW_CLASSES 2 +#define ICC_BAR_CLASSES 4 +#define ICC_TAB_CLASSES 8 +#define ICC_UPDOWN_CLASS 16 +#define ICC_PROGRESS_CLASS 32 +#define ICC_HOTKEY_CLASS 64 +#define ICC_ANIMATE_CLASS 128 +#define ICC_WIN95_CLASSES 255 +#define ICC_DATE_CLASSES 256 +#define ICC_USEREX_CLASSES 512 +#define ICC_COOL_CLASSES 1024 +#define ICC_INTERNET_CLASSES 2048 +#define ICC_PAGESCROLLER_CLASS 4096 +#define ICC_NATIVEFNTCTL_CLASS 8192 +#define INFOTIPSIZE 1024 +#define ICC_STANDARD_CLASSES 0x00004000 +#define ICC_LINK_CLASS 0x00008000 +#define GDTR_MIN 1 +#define GDTR_MAX 2 +#define GMR_VISIBLE 0 +#define GMR_DAYSTATE 1 +#define GDT_ERROR -1 +#define GDT_VALID 0 +#define GDT_NONE 1 +#define DTS_UPDOWN 1 +#define DTS_SHOWNONE 2 +#define DTS_SHORTDATEFORMAT 0 +#define DTS_LONGDATEFORMAT 4 +#define DTS_TIMEFORMAT 9 +#define DTS_APPCANPARSE 16 +#define DTS_RIGHTALIGN 32 +#define DTS_SHORTDATECENTURYFORMAT 0x000C +#define MCS_DAYSTATE 1 +#define MCS_MULTISELECT 2 +#define MCS_WEEKNUMBERS 4 +#define MCS_NOTODAYCIRCLE 0x0008 +#define MCS_NOTODAY 0x0010 +//#define MCS_NOTODAY 0x0008 +#define DTM_GETSYSTEMTIME 0x1001 +#define DTM_SETSYSTEMTIME 0x1002 +#define DTM_GETRANGE 0x1003 +#define DTM_SETRANGE 0x1004 +#define DTM_SETFORMATA 0x1005 +#define DTM_SETFORMATW 0x1050 +#define DTM_SETMCCOLOR 0x1006 +#define DTM_GETMCCOLOR 0x1007 +#define DTM_GETMONTHCAL 0x1008 +#define DTM_SETMCFONT 0x1009 +#define DTM_GETMCFONT 0x100a +#define DTN_USERSTRINGA (-758) +#define DTN_USERSTRINGW (-745) +#define DTN_WMKEYDOWNA (-757) +#define DTN_WMKEYDOWNW (-744) +#define DTN_FORMATA (-756) +#define DTN_FORMATW (-743) +#define DTN_FORMATQUERYA (-755) +#define DTN_FORMATQUERYW (-742) +#define DTN_DROPDOWN (-754) +#define DTN_CLOSEUP (-753) +#define DTN_DATETIMECHANGE (-759) +#define MCM_GETCURSEL 0x1001 +#define MCM_SETCURSEL 0x1002 +#define MCM_GETMAXSELCOUNT 0x1003 +#define MCM_SETMAXSELCOUNT 0x1004 +#define MCM_GETSELRANGE 0x1005 +#define MCM_SETSELRANGE 0x1006 +#define MCM_GETMONTHRANGE 0x1007 +#define MCM_SETDAYSTATE 0x1008 +#define MCM_GETMINREQRECT 0x1009 +#define MCM_SETCOLOR 0x100a +#define MCM_GETCOLOR 0x100b +#define MCM_SETTODAY 0x100c +#define MCM_GETTODAY 0x100d +#define MCM_HITTEST 0x100e +#define MCM_SETFIRSTDAYOFWEEK 0x100f +#define MCM_GETFIRSTDAYOFWEEK 0x1010 +#define MCM_GETRANGE 0x1011 +#define MCM_SETRANGE 0x1012 +#define MCM_GETMONTHDELTA 0x1013 +#define MCM_SETMONTHDELTA 0x1014 +#define MCM_GETMAXTODAYWIDTH 0x1015 +#define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define MCN_SELCHANGE (-749) +#define MCN_GETDAYSTATE (-747) +#define MCN_SELECT (-746) +#define ODT_HEADER 100 +#define ODT_TAB 101 +#define ODT_LISTVIEW 102 +#define SB_SETBKCOLOR 0x2001 +#define SB_ISSIMPLE 1038 +#define MCSC_BACKGROUND 0 +#define MCSC_TEXT 1 +#define MCSC_TITLEBK 2 +#define MCSC_TITLETEXT 3 +#define MCSC_MONTHBK 4 +#define MCSC_TRAILINGTEXT 5 +#define MCHT_TITLE 0x10000 +#define MCHT_CALENDAR 0x20000 +#define MCHT_TODAYLINK 0x30000 +#define MCHT_NEXT 0x1000000 +#define MCHT_PREV 0x2000000 +#define MCHT_NOWHERE 0x00 +#define MCHT_TITLEBK (MCHT_TITLE) +#define MCHT_TITLEMONTH (MCHT_TITLE | 0x0001) +#define MCHT_TITLEYEAR (MCHT_TITLE | 0x0002) +#define MCHT_TITLEBTNNEXT (MCHT_TITLE | MCHT_NEXT | 0x0003) +#define MCHT_TITLEBTNPREV (MCHT_TITLE | MCHT_PREV | 0x0003) +#define MCHT_CALENDARBK (MCHT_CALENDAR) +#define MCHT_CALENDARDATE (MCHT_CALENDAR | 0x0001) +#define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE | MCHT_NEXT) +#define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE | MCHT_PREV) +#define MCHT_CALENDARDAY (MCHT_CALENDAR | 0x0002) +#define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR | 0x0003) +#define RBS_TOOLTIPS 256 +#define RBS_VARHEIGHT 512 +#define RBS_BANDBORDERS 1024 +#define RBS_FIXEDORDER 2048 +#define RBIM_IMAGELIST 1 +#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME +#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME +#define RBBS_BREAK 0x0001 +#define RBBS_FIXEDSIZE 0x0002 +#define RBBS_CHILDEDGE 0x0004 +#define RBBS_HIDDEN 0x0008 +#define RBBS_NOVERT 0x0010 +#define RBBS_FIXEDBMP 0x0020 +#define RBBS_VARIABLEHEIGHT 0x0040 +#define RBBS_GRIPPERALWAYS 0x0080 +#define RBBS_NOGRIPPER 0x0100 +#define RBBS_USECHEVRON 0x0200 +#define RBBS_HIDETITLE 0x0400 +#define RBBS_TOPALIGN 0x0800 +#define RBBIM_STYLE 1 +#define RBBIM_COLORS 2 +#define RBBIM_TEXT 4 +#define RBBIM_IMAGE 8 +#define RBBIM_CHILD 16 +#define RBBIM_CHILDSIZE 32 +#define RBBIM_SIZE 64 +#define RBBIM_BACKGROUND 128 +#define RBBIM_ID 256 +#define RB_INSERTBANDA (WM_USER+1) +#define RB_DELETEBAND (WM_USER+2) +#define RB_GETBARINFO (WM_USER+3) +#define RB_SETBARINFO (WM_USER+4) +#define RB_GETBANDCOUNT (WM_USER+12) +#define RB_GETROWCOUNT (WM_USER+13) +#define RB_GETROWHEIGHT (WM_USER+14) +#define RB_SETBANDINFOA (WM_USER+6) +#define RB_SETBANDINFOW (WM_USER+11) +#define RB_SETPARENT (WM_USER+7) +#define RBN_HEIGHTCHANGE RBN_FIRST +#define LVN_ODCACHEHINT (LVN_FIRST-13) +#define LVN_ODFINDITEM (LVN_FIRST-52) +#define LVN_ITEMACTIVATE (LVN_FIRST-14) +#define LVN_ODSTATECHANGED (LVN_FIRST-15) +#define SB_SETICON 1039 +#define SB_SETTIPTEXT 1040 +#define SB_GETTIPTEXT 1042 +#define SB_GETICON 1044 +#define SB_SETUNICODEFORMAT 0x2005 +#define SB_GETUNICODEFORMAT 0x2006 +#define PGF_INVISIBLE 0 +#define PGF_NORMAL 1 +#define PGF_GRAYED 2 +#define PGF_DEPRESSED 4 +#define PGF_HOT 8 +#define PGB_TOPORLEFT 0 +#define PGB_BOTTOMORRIGHT 1 +#define PGF_SCROLLUP 1 +#define PGF_SCROLLDOWN 2 +#define PGF_SCROLLLEFT 4 +#define PGF_SCROLLRIGHT 8 +#define PGK_SHIFT 1 +#define PGK_CONTROL 2 +#define PGK_MENU 4 +#define PGF_CALCWIDTH 1 +#define PGF_CALCHEIGHT 2 +#define PGM_FIRST 0x1400 +#define PGM_SETCHILD (PGM_FIRST+1) +#define PGM_RECALCSIZE (PGM_FIRST+2) +#define PGM_FORWARDMOUSE (PGM_FIRST+3) +#define PGM_SETBKCOLOR (PGM_FIRST+4) +#define PGM_GETBKCOLOR (PGM_FIRST+5) +#define PGM_SETBORDER (PGM_FIRST+6) +#define PGM_GETBORDER (PGM_FIRST+7) +#define PGM_SETPOS (PGM_FIRST+8) +#define PGM_GETPOS (PGM_FIRST+9) +#define PGM_SETBUTTONSIZE (PGM_FIRST+10) +#define PGM_GETBUTTONSIZE (PGM_FIRST+11) +#define PGM_GETBUTTONSTATE (PGM_FIRST+12) +#define PGM_GETDROPTARGET CCM_GETDROPTARGET +#define RBS_REGISTERDROP 4096 +#define RBS_AUTOSIZE 8192 +#define RBS_VERTICALGRIPPER 16384 +#define RBS_DBLCLKTOGGLE 32768 +#define RBBIM_IDEALSIZE 512 +#define RBBIM_LPARAM 1024 +#define RBBIM_HEADERSIZE 2048 +#define RB_HITTEST (WM_USER+8) +#define RB_GETRECT (WM_USER+9) +#define RB_IDTOINDEX (WM_USER+16) +#define RB_GETTOOLTIPS (WM_USER+17) +#define RB_SETTOOLTIPS (WM_USER+18) +#define RB_SETBKCOLOR (WM_USER+19) +#define RB_GETBKCOLOR (WM_USER+20) +#define RB_SETTEXTCOLOR (WM_USER+21) +#define RB_GETTEXTCOLOR (WM_USER+22) +#define RB_SIZETORECT (WM_USER+23) +#define RB_BEGINDRAG (WM_USER+24) +#define RB_ENDDRAG (WM_USER+25) +#define RB_DRAGMOVE (WM_USER+26) +#define RB_GETBARHEIGHT (WM_USER+27) +#define RB_GETBANDINFOW (WM_USER+28) +#define RB_GETBANDINFOA (WM_USER+29) +#define RB_MINIMIZEBAND (WM_USER+30) +#define RB_MAXIMIZEBAND (WM_USER+31) +#define RB_GETDROPTARGET CCM_GETDROPTARGET +#define RB_GETBANDBORDERS (WM_USER+34) +#define RB_SHOWBAND (WM_USER+35) +#define RB_SETPALETTE (WM_USER+37) +#define RB_GETPALETTE (WM_USER+38) +#define RB_MOVEBAND (WM_USER+39) +#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define RBN_GETOBJECT (RBN_FIRST-1) +#define RBN_LAYOUTCHANGED (RBN_FIRST-2) +#define RBN_AUTOSIZE (RBN_FIRST-3) +#define RBN_BEGINDRAG (RBN_FIRST-4) +#define RBN_ENDDRAG (RBN_FIRST-5) +#define RBN_DELETINGBAND (RBN_FIRST-6) +#define RBN_DELETEDBAND (RBN_FIRST-7) +#define RBN_CHILDSIZE (RBN_FIRST-8) +#define RBNM_ID 1 +#define RBNM_STYLE 2 +#define RBNM_LPARAM 4 +#define RBHT_NOWHERE 1 +#define RBHT_CAPTION 2 +#define RBHT_CLIENT 3 +#define RBHT_GRABBER 4 +#define RB_GETBANDINFO (WM_USER+5) +#define CBEM_INSERTITEMA (WM_USER + 1) +#define CBEM_SETIMAGELIST (WM_USER + 2) +#define CBEM_GETIMAGELIST (WM_USER + 3) +#define CBEM_GETITEMA (WM_USER + 4) +#define CBEM_SETITEMA (WM_USER + 5) +#define CBEM_DELETEITEM CB_DELETESTRING +#define CBEM_GETCOMBOCONTROL (WM_USER + 6) +#define CBEM_GETEDITCONTROL (WM_USER + 7) +#define CBEM_SETEXSTYLE (WM_USER + 8) +#define CBEM_GETEXSTYLE (WM_USER + 9) +#define CBEM_SETEXTENDEDSTYLE (WM_USER + 14) +#define CBEM_GETEXTENDEDSTYLE (WM_USER + 9) +#define CBEM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define CBEM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define CBEM_HASEDITCHANGED (WM_USER + 10) +#define CBEM_INSERTITEMW (WM_USER + 11) +#define CBEM_SETITEMW (WM_USER + 12) +#define CBEM_GETITEMW (WM_USER + 13) +#define DA_LAST 0x7fffffff +#define DPA_APPEND 0x7fffffff +#define DPA_ERR -1 +#define DSA_APPEND 0x7fffffff +#define DSA_ERR -1 +#define DPAS_SORTED 1 +#define DPAS_INSERTBEFORE 2 +#define DPAS_INSERTAFTER 4 +#define WSB_PROP_CYVSCROLL 1 +#define WSB_PROP_CXHSCROLL 2 +#define WSB_PROP_CYHSCROLL 4 +#define WSB_PROP_CXVSCROLL 8 +#define WSB_PROP_CXHTHUMB 16 +#define WSB_PROP_CYVTHUMB 32 +#define WSB_PROP_VBKGCOLOR 64 +#define WSB_PROP_HBKGCOLOR 128 +#define WSB_PROP_VSTYLE 256 +#define WSB_PROP_HSTYLE 512 +#define WSB_PROP_WINSTYLE 1024 +#define WSB_PROP_PALETTE 2048 +#define WSB_PROP_MASK 0xfff +#define FSB_FLAT_MODE 2 +#define FSB_ENCARTA_MODE 1 +#define FSB_REGULAR_MODE 0 +#define LIF_ITEMINDEX 0x00000001 +#define LIF_STATE 0x00000002 +#define LIF_ITEMID 0x00000004 +#define LIF_URL 0x00000008 +#define LIS_FOCUSED 0x00000001 +#define LIS_ENABLED 0x00000002 +#define LIS_VISITED 0x00000004 +#define LM_HITTEST (WM_USER + 768) +#define LM_GETIDEALHEIGHT (WM_USER + 769) +#define LM_SETITEM (WM_USER + 770) +#define LM_GETITEM (WM_USER + 771) +#define MAX_LINKID_TEXT 48 +#define L_MAX_URL_LENGTH 2084 diff --git a/harbour-1.0.0RC1/contrib/hbwhat32/commdlg.ch b/harbour-1.0.0RC1/contrib/hbwhat32/commdlg.ch index 5ace616944..46fea6ace5 100644 --- a/harbour-1.0.0RC1/contrib/hbwhat32/commdlg.ch +++ b/harbour-1.0.0RC1/contrib/hbwhat32/commdlg.ch @@ -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 // - #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 // \Favorites - #define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup - #define CSIDL_RECENT 0x0008 // \Recent - #define CSIDL_SENDTO 0x0009 // \SendTo - #define CSIDL_BITBUCKET 0x000a // \Recycle Bin - #define CSIDL_STARTMENU 0x000b // \Start Menu - #define CSIDL_DESKTOPDIRECTORY 0x0010 // \Desktop - #define CSIDL_DRIVES 0x0011 // My Computer - #define CSIDL_NETWORK 0x0012 // Network Neighborhood - #define CSIDL_NETHOOD 0x0013 // \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 // \Application Data - #define CSIDL_PRINTHOOD 0x001b // \PrintHood - #define CSIDL_LOCAL_APPDATA 0x001c // \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 // \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 diff --git a/harbour-1.0.0RC1/contrib/hbwhat32/wingdi.ch b/harbour-1.0.0RC1/contrib/hbwhat32/wingdi.ch index b9351aff3b..678d45f816 100644 --- a/harbour-1.0.0RC1/contrib/hbwhat32/wingdi.ch +++ b/harbour-1.0.0RC1/contrib/hbwhat32/wingdi.ch @@ -2,1909 +2,1258 @@ * $Id$ */ -* Automatically translated from wingdi.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. +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 +#define BI_JPEG 4 +#define BI_PNG 5 +#define LF_FACESIZE 32 +#define LF_FULLFACESIZE 64 +#define CA_NEGATIVE 1 +#define CA_LOG_FILTER 2 +#define ILLUMINANT_DEVICE_DEFAULT 0 +#define ILLUMINANT_A 1 +#define ILLUMINANT_B 2 +#define ILLUMINANT_C 3 +#define ILLUMINANT_D50 4 +#define ILLUMINANT_D55 5 +#define ILLUMINANT_D65 6 +#define ILLUMINANT_D75 7 +#define ILLUMINANT_F2 8 +#define ILLUMINANT_MAX_INDEX ILLUMINANT_F2 +#define ILLUMINANT_TUNGSTEN ILLUMINANT_A +#define ILLUMINANT_DAYLIGHT ILLUMINANT_C +#define ILLUMINANT_FLUORESCENT ILLUMINANT_F2 +#define ILLUMINANT_NTSC ILLUMINANT_C +#define RGB_GAMMA_MIN 2500 +#define RGB_GAMMA_MAX 65000 +#define REFERENCE_WHITE_MIN 6000 +#define REFERENCE_WHITE_MAX 10000 +#define REFERENCE_BLACK_MIN 0 +#define REFERENCE_BLACK_MAX 4000 +#define COLOR_ADJ_MIN (-100) +#define COLOR_ADJ_MAX 100 +#define CCHDEVICENAME 32 +#define CCHFORMNAME 32 +#define DI_COMPAT 4 +#define DI_DEFAULTSIZE 8 +#define DI_IMAGE 2 +#define DI_MASK 1 +#define DI_NORMAL 3 +#define DI_APPBANDING 1 +#define EMR_HEADER 1 +#define EMR_POLYBEZIER 2 +#define EMR_POLYGON 3 +#define EMR_POLYLINE 4 +#define EMR_POLYBEZIERTO 5 +#define EMR_POLYLINETO 6 +#define EMR_POLYPOLYLINE 7 +#define EMR_POLYPOLYGON 8 +#define EMR_SETWINDOWEXTEX 9 +#define EMR_SETWINDOWORGEX 10 +#define EMR_SETVIEWPORTEXTEX 11 +#define EMR_SETVIEWPORTORGEX 12 +#define EMR_SETBRUSHORGEX 13 +#define EMR_EOF 14 +#define EMR_SETPIXELV 15 +#define EMR_SETMAPPERFLAGS 16 +#define EMR_SETMAPMODE 17 +#define EMR_SETBKMODE 18 +#define EMR_SETPOLYFILLMODE 19 +#define EMR_SETROP2 20 +#define EMR_SETSTRETCHBLTMODE 21 +#define EMR_SETTEXTALIGN 22 +#define EMR_SETCOLORADJUSTMENT 23 +#define EMR_SETTEXTCOLOR 24 +#define EMR_SETBKCOLOR 25 +#define EMR_OFFSETCLIPRGN 26 +#define EMR_MOVETOEX 27 +#define EMR_SETMETARGN 28 +#define EMR_EXCLUDECLIPRECT 29 +#define EMR_INTERSECTCLIPRECT 30 +#define EMR_SCALEVIEWPORTEXTEX 31 +#define EMR_SCALEWINDOWEXTEX 32 +#define EMR_SAVEDC 33 +#define EMR_RESTOREDC 34 +#define EMR_SETWORLDTRANSFORM 35 +#define EMR_MODIFYWORLDTRANSFORM 36 +#define EMR_SELECTOBJECT 37 +#define EMR_CREATEPEN 38 +#define EMR_CREATEBRUSHINDIRECT 39 +#define EMR_DELETEOBJECT 40 +#define EMR_ANGLEARC 41 +#define EMR_ELLIPSE 42 +#define EMR_RECTANGLE 43 +#define EMR_ROUNDRECT 44 +#define EMR_ARC 45 +#define EMR_CHORD 46 +#define EMR_PIE 47 +#define EMR_SELECTPALETTE 48 +#define EMR_CREATEPALETTE 49 +#define EMR_SETPALETTEENTRIES 50 +#define EMR_RESIZEPALETTE 51 +#define EMR_REALIZEPALETTE 52 +#define EMR_EXTFLOODFILL 53 +#define EMR_LINETO 54 +#define EMR_ARCTO 55 +#define EMR_POLYDRAW 56 +#define EMR_SETARCDIRECTION 57 +#define EMR_SETMITERLIMIT 58 +#define EMR_BEGINPATH 59 +#define EMR_ENDPATH 60 +#define EMR_CLOSEFIGURE 61 +#define EMR_FILLPATH 62 +#define EMR_STROKEANDFILLPATH 63 +#define EMR_STROKEPATH 64 +#define EMR_FLATTENPATH 65 +#define EMR_WIDENPATH 66 +#define EMR_SELECTCLIPPATH 67 +#define EMR_ABORTPATH 68 +#define EMR_GDICOMMENT 70 +#define EMR_FILLRGN 71 +#define EMR_FRAMERGN 72 +#define EMR_INVERTRGN 73 +#define EMR_PAINTRGN 74 +#define EMR_EXTSELECTCLIPRGN 75 +#define EMR_BITBLT 76 +#define EMR_STRETCHBLT 77 +#define EMR_MASKBLT 78 +#define EMR_PLGBLT 79 +#define EMR_SETDIBITSTODEVICE 80 +#define EMR_STRETCHDIBITS 81 +#define EMR_EXTCREATEFONTINDIRECTW 82 +#define EMR_EXTTEXTOUTA 83 +#define EMR_EXTTEXTOUTW 84 +#define EMR_POLYBEZIER16 85 +#define EMR_POLYGON16 86 +#define EMR_POLYLINE16 87 +#define EMR_POLYBEZIERTO16 88 +#define EMR_POLYLINETO16 89 +#define EMR_POLYPOLYLINE16 90 +#define EMR_POLYPOLYGON16 91 +#define EMR_POLYDRAW16 92 +#define EMR_CREATEMONOBRUSH 93 +#define EMR_CREATEDIBPATTERNBRUSHPT 94 +#define EMR_EXTCREATEPEN 95 +#define EMR_POLYTEXTOUTA 96 +#define EMR_POLYTEXTOUTW 97 +#define EMR_SETICMMODE 98 +#define EMR_CREATECOLORSPACE 99 +#define EMR_SETCOLORSPACE 100 +#define EMR_DELETECOLORSPACE 101 +#define EMR_GLSRECORD 102 +#define EMR_GLSBOUNDEDRECORD 103 +#define EMR_PIXELFORMAT 104 +#define ENHMETA_SIGNATURE 1179469088 +#define EPS_SIGNATURE 0x46535045 +#define FR_PRIVATE 0x10 +#define FR_NOT_ENUM 0x20 +#define META_SETBKCOLOR 0x201 +#define META_SETBKMODE 0x102 +#define META_SETMAPMODE 0x103 +#define META_SETROP2 0x104 +#define META_SETRELABS 0x105 +#define META_SETPOLYFILLMODE 0x106 +#define META_SETSTRETCHBLTMODE 0x107 +#define META_SETTEXTCHAREXTRA 0x108 +#define META_SETTEXTCOLOR 0x209 +#define META_SETTEXTJUSTIFICATION 0x20A +#define META_SETWINDOWORG 0x20B +#define META_SETWINDOWEXT 0x20C +#define META_SETVIEWPORTORG 0x20D +#define META_SETVIEWPORTEXT 0x20E +#define META_OFFSETWINDOWORG 0x20F +#define META_SCALEWINDOWEXT 0x410 +#define META_OFFSETVIEWPORTORG 0x211 +#define META_SCALEVIEWPORTEXT 0x412 +#define META_LINETO 0x213 +#define META_MOVETO 0x214 +#define META_EXCLUDECLIPRECT 0x415 +#define META_INTERSECTCLIPRECT 0x416 +#define META_ARC 0x817 +#define META_ELLIPSE 0x418 +#define META_FLOODFILL 0x419 +#define META_PIE 0x81A +#define META_RECTANGLE 0x41B +#define META_ROUNDRECT 0x61C +#define META_PATBLT 0x61D +#define META_SAVEDC 0x1E +#define META_SETPIXEL 0x41F +#define META_OFFSETCLIPRGN 0x220 +#define META_TEXTOUT 0x521 +#define META_BITBLT 0x922 +#define META_STRETCHBLT 0xB23 +#define META_POLYGON 0x324 +#define META_POLYLINE 0x325 +#define META_ESCAPE 0x626 +#define META_RESTOREDC 0x127 +#define META_FILLREGION 0x228 +#define META_FRAMEREGION 0x429 +#define META_INVERTREGION 0x12A +#define META_PAINTREGION 0x12B +#define META_SELECTCLIPREGION 0x12C +#define META_SELECTOBJECT 0x12D +#define META_SETTEXTALIGN 0x12E +#define META_CHORD 0x830 +#define META_SETMAPPERFLAGS 0x231 +#define META_EXTTEXTOUT 0xa32 +#define META_SETDIBTODEV 0xd33 +#define META_SELECTPALETTE 0x234 +#define META_REALIZEPALETTE 0x35 +#define META_ANIMATEPALETTE 0x436 +#define META_SETPALENTRIES 0x37 +#define META_POLYPOLYGON 0x538 +#define META_RESIZEPALETTE 0x139 +#define META_DIBBITBLT 0x940 +#define META_DIBSTRETCHBLT 0xb41 +#define META_DIBCREATEPATTERNBRUSH 0x142 +#define META_STRETCHDIB 0xf43 +#define META_EXTFLOODFILL 0x548 +#define META_DELETEOBJECT 0x1f0 +#define META_CREATEPALETTE 0xf7 +#define META_CREATEPATTERNBRUSH 0x1F9 +#define META_CREATEPENINDIRECT 0x2FA +#define META_CREATEFONTINDIRECT 0x2FB +#define META_CREATEBRUSHINDIRECT 0x2FC +#define META_CREATEREGION 0x6FF +#define PT_MOVETO 6 +#define PT_LINETO 2 +#define PT_BEZIERTO 4 +#define PT_CLOSEFIGURE 1 +#define ELF_VENDOR_SIZE 4 +#define ELF_VERSION 0 +#define ELF_CULTURE_LATIN 0 +#define PFD_TYPE_RGBA 0 +#define PFD_TYPE_COLORINDEX 1 +#define PFD_MAIN_PLANE 0 +#define PFD_OVERLAY_PLANE 1 +#define PFD_UNDERLAY_PLANE (-1) +#define PFD_DOUBLEBUFFER 1 +#define PFD_STEREO 2 +#define PFD_DRAW_TO_WINDOW 4 +#define PFD_DRAW_TO_BITMAP 8 +#define PFD_SUPPORT_GDI 16 +#define PFD_SUPPORT_OPENGL 32 +#define PFD_GENERIC_FORMAT 64 +#define PFD_NEED_PALETTE 128 +#define PFD_NEED_SYSTEM_PALETTE 0x00000100 +#define PFD_SWAP_EXCHANGE 0x00000200 +#define PFD_SWAP_COPY 0x00000400 +#define PFD_SWAP_LAYER_BUFFERS 0x00000800 +#define PFD_GENERIC_ACCELERATED 0x00001000 +#define PFD_DEPTH_DONTCARE 0x20000000 +#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000 +#define PFD_STEREO_DONTCARE 0x80000000 +#define SP_ERROR (-1) +#define SP_OUTOFDISK (-4) +#define SP_OUTOFMEMORY (-5) +#define SP_USERABORT (-3) +#define SP_APPABORT (-2) +#define BLACKNESS 0x00000042 +#define NOTSRCERASE 0x001100A6 +#define NOTSRCCOPY 0x00330008 +#define SRCERASE 0x00440328 +#define DSTINVERT 0x00550009 +#define PATINVERT 0x005A0049 +#define SRCINVERT 0x00660046 +#define SRCAND 0x008800C6 +#define MERGEPAINT 0x00BB0226 +#define MERGECOPY 0x00C000CA +#define SRCCOPY 0x00CC0020 +#define SRCPAINT 0x00EE0086 +#define PATCOPY 0x00F00021 +#define PATPAINT 0x00FB0A09 +#define WHITENESS 0x00FF0062 +#define CAPTUREBLT 0x40000000 +#define NOMIRRORBITMAP 0x80000000 +#define R2_BLACK 1 +#define R2_COPYPEN 13 +#define R2_MASKNOTPEN 3 +#define R2_MASKPEN 9 +#define R2_MASKPENNOT 5 +#define R2_MERGENOTPEN 12 +#define R2_MERGEPEN 15 +#define R2_MERGEPENNOT 14 +#define R2_NOP 11 +#define R2_NOT 6 +#define R2_NOTCOPYPEN 4 +#define R2_NOTMASKPEN 8 +#define R2_NOTMERGEPEN 2 +#define R2_NOTXORPEN 10 +#define R2_WHITE 16 +#define R2_XORPEN 7 +#define CM_OUT_OF_GAMUT 255 +#define CM_IN_GAMUT 0 +#define RGN_AND 1 +#define RGN_COPY 5 +#define RGN_DIFF 4 +#define RGN_OR 2 +#define RGN_XOR 3 +#define NULLREGION 1 +#define SIMPLEREGION 2 +#define COMPLEXREGION 3 +#define ERROR 0 +#define CBM_INIT 4 +#define DIB_PAL_COLORS 1 +#define DIB_RGB_COLORS 0 +#define FW_DONTCARE 0 +#define FW_THIN 100 +#define FW_EXTRALIGHT 200 +#define FW_ULTRALIGHT FW_EXTRALIGHT +#define FW_LIGHT 300 +#define FW_NORMAL 400 +#define FW_REGULAR 400 +#define FW_MEDIUM 500 +#define FW_SEMIBOLD 600 +#define FW_DEMIBOLD FW_SEMIBOLD +#define FW_BOLD 700 +#define FW_EXTRABOLD 800 +#define FW_ULTRABOLD FW_EXTRABOLD +#define FW_HEAVY 900 +#define FW_BLACK FW_HEAVY +#define ANSI_CHARSET 0 +#define DEFAULT_CHARSET 1 +#define SYMBOL_CHARSET 2 +#define SHIFTJIS_CHARSET 128 +#define HANGEUL_CHARSET 129 +#define HANGUL_CHARSET 129 +#define GB2312_CHARSET 134 +#define CHINESEBIG5_CHARSET 136 +#define GREEK_CHARSET 161 +#define TURKISH_CHARSET 162 +#define HEBREW_CHARSET 177 +#define ARABIC_CHARSET 178 +#define BALTIC_CHARSET 186 +#define RUSSIAN_CHARSET 204 +#define THAI_CHARSET 222 +#define EASTEUROPE_CHARSET 238 +#define OEM_CHARSET 255 +#define JOHAB_CHARSET 130 +#define VIETNAMESE_CHARSET 163 +#define MAC_CHARSET 77 +#define OUT_DEFAULT_PRECIS 0 +#define OUT_STRING_PRECIS 1 +#define OUT_CHARACTER_PRECIS 2 +#define OUT_STROKE_PRECIS 3 +#define OUT_TT_PRECIS 4 +#define OUT_DEVICE_PRECIS 5 +#define OUT_RASTER_PRECIS 6 +#define OUT_TT_ONLY_PRECIS 7 +#define OUT_OUTLINE_PRECIS 8 +#define CLIP_DEFAULT_PRECIS 0 +#define CLIP_CHARACTER_PRECIS 1 +#define CLIP_STROKE_PRECIS 2 +#define CLIP_MASK 15 +#define CLIP_LH_ANGLES 16 +#define CLIP_TT_ALWAYS 32 +#define CLIP_EMBEDDED 128 +#define DEFAULT_QUALITY 0 +#define DRAFT_QUALITY 1 +#define PROOF_QUALITY 2 +#define NONANTIALIASED_QUALITY 3 +#define ANTIALIASED_QUALITY 4 +#define DEFAULT_PITCH 0 +#define FIXED_PITCH 1 +#define VARIABLE_PITCH 2 +#define MONO_FONT 8 +#define FF_DECORATIVE 80 +#define FF_DONTCARE 0 +#define FF_MODERN 48 +#define FF_ROMAN 16 +#define FF_SCRIPT 64 +#define FF_SWISS 32 +#define PANOSE_COUNT 10 +#define PAN_FAMILYTYPE_INDEX 0 +#define PAN_SERIFSTYLE_INDEX 1 +#define PAN_WEIGHT_INDEX 2 +#define PAN_PROPORTION_INDEX 3 +#define PAN_CONTRAST_INDEX 4 +#define PAN_STROKEVARIATION_INDEX 5 +#define PAN_ARMSTYLE_INDEX 6 +#define PAN_LETTERFORM_INDEX 7 +#define PAN_MIDLINE_INDEX 8 +#define PAN_XHEIGHT_INDEX 9 +#define PAN_CULTURE_LATIN 0 +#define PAN_ANY 0 +#define PAN_NO_FIT 1 +#define PAN_FAMILY_TEXT_DISPLAY 2 +#define PAN_FAMILY_SCRIPT 3 +#define PAN_FAMILY_DECORATIVE 4 +#define PAN_FAMILY_PICTORIAL 5 +#define PAN_SERIF_COVE 2 +#define PAN_SERIF_OBTUSE_COVE 3 +#define PAN_SERIF_SQUARE_COVE 4 +#define PAN_SERIF_OBTUSE_SQUARE_COVE 5 +#define PAN_SERIF_SQUARE 6 +#define PAN_SERIF_THIN 7 +#define PAN_SERIF_BONE 8 +#define PAN_SERIF_EXAGGERATED 9 +#define PAN_SERIF_TRIANGLE 10 +#define PAN_SERIF_NORMAL_SANS 11 +#define PAN_SERIF_OBTUSE_SANS 12 +#define PAN_SERIF_PERP_SANS 13 +#define PAN_SERIF_FLARED 14 +#define PAN_SERIF_ROUNDED 15 +#define PAN_WEIGHT_VERY_LIGHT 2 +#define PAN_WEIGHT_LIGHT 3 +#define PAN_WEIGHT_THIN 4 +#define PAN_WEIGHT_BOOK 5 +#define PAN_WEIGHT_MEDIUM 6 +#define PAN_WEIGHT_DEMI 7 +#define PAN_WEIGHT_BOLD 8 +#define PAN_WEIGHT_HEAVY 9 +#define PAN_WEIGHT_BLACK 10 +#define PAN_WEIGHT_NORD 11 +#define PAN_PROP_OLD_STYLE 2 +#define PAN_PROP_MODERN 3 +#define PAN_PROP_EVEN_WIDTH 4 +#define PAN_PROP_EXPANDED 5 +#define PAN_PROP_CONDENSED 6 +#define PAN_PROP_VERY_EXPANDED 7 +#define PAN_PROP_VERY_CONDENSED 8 +#define PAN_PROP_MONOSPACED 9 +#define PAN_CONTRAST_NONE 2 +#define PAN_CONTRAST_VERY_LOW 3 +#define PAN_CONTRAST_LOW 4 +#define PAN_CONTRAST_MEDIUM_LOW 5 +#define PAN_CONTRAST_MEDIUM 6 +#define PAN_CONTRAST_MEDIUM_HIGH 7 +#define PAN_CONTRAST_HIGH 8 +#define PAN_CONTRAST_VERY_HIGH 9 +#define PAN_STROKE_GRADUAL_DIAG 2 +#define PAN_STROKE_GRADUAL_TRAN 3 +#define PAN_STROKE_GRADUAL_VERT 4 +#define PAN_STROKE_GRADUAL_HORZ 5 +#define PAN_STROKE_RAPID_VERT 6 +#define PAN_STROKE_RAPID_HORZ 7 +#define PAN_STROKE_INSTANT_VERT 8 +#define PAN_STRAIGHT_ARMS_HORZ 2 +#define PAN_STRAIGHT_ARMS_WEDGE 3 +#define PAN_STRAIGHT_ARMS_VERT 4 +#define PAN_STRAIGHT_ARMS_SINGLE_SERIF 5 +#define PAN_STRAIGHT_ARMS_DOUBLE_SERIF 6 +#define PAN_BENT_ARMS_HORZ 7 +#define PAN_BENT_ARMS_WEDGE 8 +#define PAN_BENT_ARMS_VERT 9 +#define PAN_BENT_ARMS_SINGLE_SERIF 10 +#define PAN_BENT_ARMS_DOUBLE_SERIF 11 +#define PAN_LETT_NORMAL_CONTACT 2 +#define PAN_LETT_NORMAL_WEIGHTED 3 +#define PAN_LETT_NORMAL_BOXED 4 +#define PAN_LETT_NORMAL_FLATTENED 5 +#define PAN_LETT_NORMAL_ROUNDED 6 +#define PAN_LETT_NORMAL_OFF_CENTER 7 +#define PAN_LETT_NORMAL_SQUARE 8 +#define PAN_LETT_OBLIQUE_CONTACT 9 +#define PAN_LETT_OBLIQUE_WEIGHTED 10 +#define PAN_LETT_OBLIQUE_BOXED 11 +#define PAN_LETT_OBLIQUE_FLATTENED 12 +#define PAN_LETT_OBLIQUE_ROUNDED 13 +#define PAN_LETT_OBLIQUE_OFF_CENTER 14 +#define PAN_LETT_OBLIQUE_SQUARE 15 +#define PAN_MIDLINE_STANDARD_TRIMMED 2 +#define PAN_MIDLINE_STANDARD_POINTED 3 +#define PAN_MIDLINE_STANDARD_SERIFED 4 +#define PAN_MIDLINE_HIGH_TRIMMED 5 +#define PAN_MIDLINE_HIGH_POINTED 6 +#define PAN_MIDLINE_HIGH_SERIFED 7 +#define PAN_MIDLINE_CONSTANT_TRIMMED 8 +#define PAN_MIDLINE_CONSTANT_POINTED 9 +#define PAN_MIDLINE_CONSTANT_SERIFED 10 +#define PAN_MIDLINE_LOW_TRIMMED 11 +#define PAN_MIDLINE_LOW_POINTED 12 +#define PAN_MIDLINE_LOW_SERIFED 13 +#define PAN_XHEIGHT_CONSTANT_SMALL 2 +#define PAN_XHEIGHT_CONSTANT_STD 3 +#define PAN_XHEIGHT_CONSTANT_LARGE 4 +#define PAN_XHEIGHT_DUCKING_SMALL 5 +#define PAN_XHEIGHT_DUCKING_STD 6 +#define PAN_XHEIGHT_DUCKING_LARGE 7 +#define FS_LATIN1 1 +#define FS_LATIN2 2 +#define FS_CYRILLIC 4 +#define FS_GREEK 8 +#define FS_TURKISH 16 +#define FS_HEBREW 32 +#define FS_ARABIC 64 +#define FS_BALTIC 128 +#define FS_THAI 0x10000 +#define FS_JISJAPAN 0x20000 +#define FS_CHINESESIMP 0x40000 +#define FS_WANSUNG 0x80000 +#define FS_CHINESETRAD 0x100000 +#define FS_JOHAB 0x200000 +#define FS_SYMBOL 0x80000000 +#define HS_BDIAGONAL 3 +#define HS_CROSS 4 +#define HS_DIAGCROSS 5 +#define HS_FDIAGONAL 2 +#define HS_HORIZONTAL 0 +#define HS_VERTICAL 1 +#define PS_GEOMETRIC 65536 +#define PS_COSMETIC 0 +#define PS_ALTERNATE 8 +#define PS_SOLID 0 +#define PS_DASH 1 +#define PS_DOT 2 +#define PS_DASHDOT 3 +#define PS_DASHDOTDOT 4 +#define PS_NULL 5 +#define PS_USERSTYLE 7 +#define PS_INSIDEFRAME 6 +#define PS_ENDCAP_ROUND 0 +#define PS_ENDCAP_SQUARE 256 +#define PS_ENDCAP_FLAT 512 +#define PS_JOIN_BEVEL 4096 +#define PS_JOIN_MITER 8192 +#define PS_JOIN_ROUND 0 +#define PS_STYLE_MASK 15 +#define PS_ENDCAP_MASK 3840 +#define PS_TYPE_MASK 983040 +#define ALTERNATE 1 +#define WINDING 2 +#define DC_BINNAMES 12 +#define DC_BINS 6 +#define DC_COPIES 18 +#define DC_DRIVER 11 +#define DC_DUPLEX 7 +#define DC_ENUMRESOLUTIONS 13 +#define DC_EXTRA 9 +#define DC_FIELDS 1 +#define DC_FILEDEPENDENCIES 14 +#define DC_MAXEXTENT 5 +#define DC_MINEXTENT 4 +#define DC_ORIENTATION 17 +#define DC_PAPERNAMES 16 +#define DC_PAPERS 2 +#define DC_PAPERSIZE 3 +#define DC_SIZE 8 +#define DC_TRUETYPE 15 +#define DCTT_BITMAP 1 +#define DCTT_DOWNLOAD 2 +#define DCTT_SUBDEV 4 +#define DCTT_DOWNLOAD_OUTLINE 8 +#define DC_VERSION 10 +#define DC_BINADJUST 19 +#define DC_EMF_COMPLIANT 20 +#define DC_DATATYPE_PRODUCED 21 +#define DC_MANUFACTURER 23 +#define DC_MODEL 24 +#define DC_PERSONALITY 25 +#define DC_PRINTRATE 26 +#define DC_PRINTRATEUNIT 27 +#define DC_PRINTERMEM 28 +#define DC_MEDIAREADY 29 +#define DC_STAPLE 30 +#define DC_PRINTRATEPPM 31 +#define DC_COLORDEVICE 32 +#define DC_NUP 33 +#define DC_MEDIATYPENAMES 34 +#define DC_MEDIATYPES 35 +#define DCBA_FACEUPNONE 0 +#define DCBA_FACEUPCENTER 1 +#define DCBA_FACEUPLEFT 2 +#define DCBA_FACEUPRIGHT 3 +#define DCBA_FACEDOWNNONE 256 +#define DCBA_FACEDOWNCENTER 257 +#define DCBA_FACEDOWNLEFT 258 +#define DCBA_FACEDOWNRIGHT 259 +#define FLOODFILLBORDER 0 +#define FLOODFILLSURFACE 1 +#define ETO_CLIPPED 0x0004 +#define ETO_GLYPH_INDEX 0x0010 +#define ETO_OPAQUE 0x0002 +#define ETO_NUMERICSLATIN 0x0800 +#define ETO_NUMERICSLOCAL 0x0400 +#define ETO_RTLREADING 0x0080 +#define ETO_IGNORELANGUAGE 0x1000 +#define ETO_PDY 0x2000 +#define GDICOMMENT_WINDOWS_METAFILE (-2147483647) +#define GDICOMMENT_BEGINGROUP 2 +#define GDICOMMENT_ENDGROUP 3 +#define GDICOMMENT_MULTIFORMATS 1073741828 +#define GDICOMMENT_IDENTIFIER 1128875079 +#define AD_COUNTERCLOCKWISE 1 +#define AD_CLOCKWISE 2 +#define RDH_RECTANGLES 1 +#define GCPCLASS_LATIN 1 +#define GCPCLASS_HEBREW 2 +#define GCPCLASS_ARABIC 2 +#define GCPCLASS_NEUTRAL 3 +#define GCPCLASS_LOCALNUMBER 4 +#define GCPCLASS_LATINNUMBER 5 +#define GCPCLASS_LATINNUMERICTERMINATOR 6 +#define GCPCLASS_LATINNUMERICSEPARATOR 7 +#define GCPCLASS_NUMERICSEPARATOR 8 +#define GCPCLASS_PREBOUNDLTR 128 +#define GCPCLASS_PREBOUNDRTL 64 +#define GCPCLASS_POSTBOUNDLTR 32 +#define GCPCLASS_POSTBOUNDRTL 16 +#define GCPGLYPH_LINKBEFORE 0x8000 +#define GCPGLYPH_LINKAFTER 0x4000 +#define DCB_DISABLE 8 +#define DCB_ENABLE 4 +#define DCB_RESET 1 +#define DCB_SET 3 +#define DCB_ACCUMULATE 2 +#define DCB_DIRTY 2 +#define OBJ_BRUSH 2 +#define OBJ_PEN 1 +#define OBJ_PAL 5 +#define OBJ_FONT 6 +#define OBJ_BITMAP 7 +#define OBJ_EXTPEN 11 +#define OBJ_REGION 8 +#define OBJ_DC 3 +#define OBJ_MEMDC 10 +#define OBJ_METAFILE 9 +#define OBJ_METADC 4 +#define OBJ_ENHMETAFILE 13 +#define OBJ_ENHMETADC 12 +#define DRIVERVERSION 0 +#define TECHNOLOGY 2 +#define DT_PLOTTER 0 +#define DT_RASDISPLAY 1 +#define DT_RASPRINTER 2 +#define DT_RASCAMERA 3 +#define DT_CHARSTREAM 4 +#define DT_METAFILE 5 +#define DT_DISPFILE 6 +#define HORZSIZE 4 +#define VERTSIZE 6 +#define HORZRES 8 +#define VERTRES 10 +#define LOGPIXELSX 88 +#define LOGPIXELSY 90 +#define BITSPIXEL 12 +#define PLANES 14 +#define NUMBRUSHES 16 +#define NUMPENS 18 +#define NUMFONTS 22 +#define NUMCOLORS 24 +#define NUMMARKERS 20 +#define ASPECTX 40 +#define ASPECTY 42 +#define ASPECTXY 44 +#define PDEVICESIZE 26 +#define CLIPCAPS 36 +#define SIZEPALETTE 104 +#define NUMRESERVED 106 +#define COLORRES 108 +#define PHYSICALWIDTH 110 +#define PHYSICALHEIGHT 111 +#define PHYSICALOFFSETX 112 +#define PHYSICALOFFSETY 113 +#define SCALINGFACTORX 114 +#define SCALINGFACTORY 115 +#define VREFRESH 116 +#define DESKTOPHORZRES 118 +#define DESKTOPVERTRES 117 +#define BLTALIGNMENT 119 +#define SHADEBLENDCAPS 120 +#define SB_NONE 0x00 +#define SB_CONST_ALPHA 0x01 +#define SB_PIXEL_ALPHA 0x02 +#define SB_PREMULT_ALPHA 0x04 +#define SB_GRAD_RECT 0x10 +#define SB_GRAD_TRI 0x20 +#define COLORMGMTCAPS 121 +#define CM_NONE 0x00 +#define CM_DEVICE_ICM 0x01 +#define CM_GAMMA_RAMP 0x02 +#define CM_CMYK_COLOR 0x04 +#define RASTERCAPS 38 +#define RC_BANDING 2 +#define RC_BITBLT 1 +#define RC_BITMAP64 8 +#define RC_DI_BITMAP 128 +#define RC_DIBTODEV 512 +#define RC_FLOODFILL 4096 +#define RC_GDI20_OUTPUT 16 +#define RC_PALETTE 256 +#define RC_SCALING 4 +#define RC_STRETCHBLT 2048 +#define RC_STRETCHDIB 8192 +#define RC_DEVBITS 0x8000 +#define RC_OP_DX_OUTPUT 0x4000 +#define CURVECAPS 28 +#define CC_NONE 0 +#define CC_CIRCLES 1 +#define CC_PIE 2 +#define CC_CHORD 4 +#define CC_ELLIPSES 8 +#define CC_WIDE 16 +#define CC_STYLED 32 +#define CC_WIDESTYLED 64 +#define CC_INTERIORS 128 +#define CC_ROUNDRECT 256 +#define LINECAPS 30 +#define LC_NONE 0 +#define LC_POLYLINE 2 +#define LC_MARKER 4 +#define LC_POLYMARKER 8 +#define LC_WIDE 16 +#define LC_STYLED 32 +#define LC_WIDESTYLED 64 +#define LC_INTERIORS 128 +#define POLYGONALCAPS 32 +#define RC_BIGFONT 1024 +#define RC_GDI20_STATE 32 +#define RC_NONE 0 +#define RC_SAVEBITMAP 64 +#define PC_NONE 0 +#define PC_POLYGON 1 +#define PC_POLYPOLYGON 256 +#define PC_RECTANGLE 2 +#define PC_WINDPOLYGON 4 +#define PC_SCANLINE 8 +#define PC_TRAPEZOID 4 +#define PC_WIDE 16 +#define PC_STYLED 32 +#define PC_WIDESTYLED 64 +#define PC_INTERIORS 128 +#define PC_PATHS 512 +#define TEXTCAPS 34 +#define TC_OP_CHARACTER 1 +#define TC_OP_STROKE 2 +#define TC_CP_STROKE 4 +#define TC_CR_90 8 +#define TC_CR_ANY 16 +#define TC_SF_X_YINDEP 32 +#define TC_SA_DOUBLE 64 +#define TC_SA_INTEGER 128 +#define TC_SA_CONTIN 256 +#define TC_EA_DOUBLE 512 +#define TC_IA_ABLE 1024 +#define TC_UA_ABLE 2048 +#define TC_SO_ABLE 4096 +#define TC_RA_ABLE 8192 +#define TC_VA_ABLE 16384 +#define TC_RESERVED 32768 +#define TC_SCROLLBLT 65536 +#define GCP_DBCS 1 +#define GCP_ERROR 0x8000 +#define GCP_CLASSIN 0x80000 +#define GCP_DIACRITIC 256 +#define GCP_DISPLAYZWG 0x400000 +#define GCP_GLYPHSHAPE 16 +#define GCP_JUSTIFY 0x10000 +#define GCP_JUSTIFYIN 0x200000 +#define GCP_KASHIDA 1024 +#define GCP_LIGATE 32 +#define GCP_MAXEXTENT 0x100000 +#define GCP_NEUTRALOVERRIDE 0x2000000 +#define GCP_NUMERICOVERRIDE 0x1000000 +#define GCP_NUMERICSLATIN 0x4000000 +#define GCP_NUMERICSLOCAL 0x8000000 +#define GCP_REORDER 2 +#define GCP_SYMSWAPOFF 0x800000 +#define GCP_USEKERNING 8 +#define FLI_GLYPHS 0x40000 +#define FLI_MASK 0x103b +#define GGO_METRICS 0 +#define GGO_BITMAP 1 +#define GGO_NATIVE 2 +#define GGO_BEZIER 3 +#define GGO_GRAY2_BITMAP 4 +#define GGO_GRAY4_BITMAP 5 +#define GGO_GRAY8_BITMAP 6 +#define GGO_GLYPH_INDEX 128 +#define GGO_UNHINTED 256 +#define GM_COMPATIBLE 1 +#define GM_ADVANCED 2 +#define MM_ANISOTROPIC 8 +#define MM_HIENGLISH 5 +#define MM_HIMETRIC 3 +#define MM_ISOTROPIC 7 +#define MM_LOENGLISH 4 +#define MM_LOMETRIC 2 +#define MM_TEXT 1 +#define MM_TWIPS 6 +#define MM_MAX_FIXEDSCALE MM_TWIPS +#define ABSOLUTE 1 +#define RELATIVE 2 +#define PC_EXPLICIT 2 +#define PC_NOCOLLAPSE 4 +#define PC_RESERVED 1 +#define CLR_NONE 0xffffffff +#define CLR_INVALID CLR_NONE +#define CLR_DEFAULT 0xff000000 +#define TT_AVAILABLE 1 +#define TT_ENABLED 2 +#define BLACK_BRUSH 4 +#define DKGRAY_BRUSH 3 +#define GRAY_BRUSH 2 +#define HOLLOW_BRUSH 5 +#define LTGRAY_BRUSH 1 +#define NULL_BRUSH 5 +#define WHITE_BRUSH 0 +#define BLACK_PEN 7 +#define NULL_PEN 8 +#define WHITE_PEN 6 +#define ANSI_FIXED_FONT 11 +#define ANSI_VAR_FONT 12 +#define DEVICE_DEFAULT_FONT 14 +#define DEFAULT_GUI_FONT 17 +#define OEM_FIXED_FONT 10 +#define SYSTEM_FONT 13 +#define SYSTEM_FIXED_FONT 16 +#define DEFAULT_PALETTE 15 +#define DC_BRUSH 18 +#define DC_PEN 19 +#define SYSPAL_ERROR 0 +#define SYSPAL_STATIC 1 +#define SYSPAL_NOSTATIC 2 +#define SYSPAL_NOSTATIC256 3 +#define TA_BASELINE 24 +#define TA_BOTTOM 8 +#define TA_TOP 0 +#define TA_CENTER 6 +#define TA_LEFT 0 +#define TA_RIGHT 2 +#define TA_RTLREADING 256 +#define TA_NOUPDATECP 0 +#define TA_UPDATECP 1 +#define TA_MASK (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING) +#define VTA_BASELINE 24 +#define VTA_CENTER 6 +#define VTA_LEFT TA_BOTTOM +#define VTA_RIGHT TA_TOP +#define VTA_BOTTOM TA_RIGHT +#define VTA_TOP TA_LEFT +#define MWT_IDENTITY 1 +#define MWT_LEFTMULTIPLY 2 +#define MWT_RIGHTMULTIPLY 3 +#define OPAQUE 2 +#define TRANSPARENT 1 +#define BLACKONWHITE 1 +#define WHITEONBLACK 2 +#define COLORONCOLOR 3 +#define HALFTONE 4 +#define MAXSTRETCHBLTMODE 4 +#define STRETCH_ANDSCANS 1 +#define STRETCH_DELETESCANS 3 +#define STRETCH_HALFTONE 4 +#define STRETCH_ORSCANS 2 +#define TCI_SRCCHARSET 1 +#define TCI_SRCCODEPAGE 2 +#define TCI_SRCFONTSIG 3 +#define ICM_ON 2 +#define ICM_OFF 1 +#define ICM_QUERY 3 +#define NEWFRAME 1 +#define ABORTDOC 2 +#define NEXTBAND 3 +#define SETCOLORTABLE 4 +#define GETCOLORTABLE 5 +#define FLUSHOUTPUT 6 +#define DRAFTMODE 7 +#define QUERYESCSUPPORT 8 +#define SETABORTPROC 9 +#define STARTDOC 10 +#define ENDDOC 11 +#define GETPHYSPAGESIZE 12 +#define GETPRINTINGOFFSET 13 +#define GETSCALINGFACTOR 14 +#define MFCOMMENT 15 +#define GETPENWIDTH 16 +#define SETCOPYCOUNT 17 +#define SELECTPAPERSOURCE 18 +#define DEVICEDATA 19 +#define PASSTHROUGH 19 +#define GETTECHNOLGY 20 +#define GETTECHNOLOGY 20 +#define SETLINECAP 21 +#define SETLINEJOIN 22 +#define SETMITERLIMIT 23 +#define BANDINFO 24 +#define DRAWPATTERNRECT 25 +#define GETVECTORPENSIZE 26 +#define GETVECTORBRUSHSIZE 27 +#define ENABLEDUPLEX 28 +#define GETSETPAPERBINS 29 +#define GETSETPRINTORIENT 30 +#define ENUMPAPERBINS 31 +#define SETDIBSCALING 32 +#define EPSPRINTING 33 +#define ENUMPAPERMETRICS 34 +#define GETSETPAPERMETRICS 35 +#define POSTSCRIPT_DATA 37 +#define POSTSCRIPT_IGNORE 38 +#define MOUSETRAILS 39 +#define GETDEVICEUNITS 42 +#define GETEXTENDEDTEXTMETRICS 256 +#define GETEXTENTTABLE 257 +#define GETPAIRKERNTABLE 258 +#define GETTRACKKERNTABLE 259 +#define EXTTEXTOUT 512 +#define GETFACENAME 513 +#define DOWNLOADFACE 514 +#define ENABLERELATIVEWIDTHS 768 +#define ENABLEPAIRKERNING 769 +#define SETKERNTRACK 770 +#define SETALLJUSTVALUES 771 +#define SETCHARSET 772 +#define STRETCHBLT 2048 +#define GETSETSCREENPARAMS 3072 +#define QUERYDIBSUPPORT 3073 +#define BEGIN_PATH 4096 +#define CLIP_TO_PATH 4097 +#define END_PATH 4098 +#define EXT_DEVICE_CAPS 4099 +#define RESTORE_CTM 4100 +#define SAVE_CTM 4101 +#define SET_ARC_DIRECTION 4102 +#define SET_BACKGROUND_COLOR 4103 +#define SET_POLY_MODE 4104 +#define SET_SCREEN_ANGLE 4105 +#define SET_SPREAD 4106 +#define TRANSFORM_CTM 4107 +#define SET_CLIP_BOX 4108 +#define SET_BOUNDS 4109 +#define SET_MIRROR_MODE 4110 +#define OPENCHANNEL 4110 +#define DOWNLOADHEADER 4111 +#define CLOSECHANNEL 4112 +#define POSTSCRIPT_PASSTHROUGH 4115 +#define ENCAPSULATED_POSTSCRIPT 4116 +#define QDI_SETDIBITS 1 +#define QDI_GETDIBITS 2 +#define QDI_DIBTOSCREEN 4 +#define QDI_STRETCHDIB 8 +#define SP_NOTREPORTED 0x4000 +#define PR_JOBSTATUS 0 +#define ASPECT_FILTERING 1 +#define BS_SOLID 0 +#define BS_NULL 1 +#define BS_HOLLOW 1 +#define BS_HATCHED 2 +#define BS_PATTERN 3 +#define BS_INDEXED 4 +#define BS_DIBPATTERN 5 +#define BS_DIBPATTERNPT 6 +#define BS_PATTERN8X8 7 +#define BS_DIBPATTERN8X8 8 +#define LCS_CALIBRATED_RGB 0 +#define LCS_DEVICE_RGB 1 +#define LCS_DEVICE_CMYK 2 +#define LCS_GM_BUSINESS 1 +#define LCS_GM_GRAPHICS 2 +#define LCS_GM_IMAGES 4 +#define RASTER_FONTTYPE 1 +#define DEVICE_FONTTYPE 2 +#define TRUETYPE_FONTTYPE 4 +#define DMORIENT_PORTRAIT 1 +#define DMORIENT_LANDSCAPE 2 +#define DMPAPER_FIRST 1 +#define DMPAPER_LETTER 1 +#define DMPAPER_LETTERSMALL 2 +#define DMPAPER_TABLOID 3 +#define DMPAPER_LEDGER 4 +#define DMPAPER_LEGAL 5 +#define DMPAPER_STATEMENT 6 +#define DMPAPER_EXECUTIVE 7 +#define DMPAPER_A3 8 +#define DMPAPER_A4 9 +#define DMPAPER_A4SMALL 10 +#define DMPAPER_A5 11 +#define DMPAPER_B4 12 +#define DMPAPER_B5 13 +#define DMPAPER_FOLIO 14 +#define DMPAPER_QUARTO 15 +#define DMPAPER_10X14 16 +#define DMPAPER_11X17 17 +#define DMPAPER_NOTE 18 +#define DMPAPER_ENV_9 19 +#define DMPAPER_ENV_10 20 +#define DMPAPER_ENV_11 21 +#define DMPAPER_ENV_12 22 +#define DMPAPER_ENV_14 23 +#define DMPAPER_CSHEET 24 +#define DMPAPER_DSHEET 25 +#define DMPAPER_ESHEET 26 +#define DMPAPER_ENV_DL 27 +#define DMPAPER_ENV_C5 28 +#define DMPAPER_ENV_C3 29 +#define DMPAPER_ENV_C4 30 +#define DMPAPER_ENV_C6 31 +#define DMPAPER_ENV_C65 32 +#define DMPAPER_ENV_B4 33 +#define DMPAPER_ENV_B5 34 +#define DMPAPER_ENV_B6 35 +#define DMPAPER_ENV_ITALY 36 +#define DMPAPER_ENV_MONARCH 37 +#define DMPAPER_ENV_PERSONAL 38 +#define DMPAPER_FANFOLD_US 39 +#define DMPAPER_FANFOLD_STD_GERMAN 40 +#define DMPAPER_FANFOLD_LGL_GERMAN 41 +#define DMPAPER_ISO_B4 42 +#define DMPAPER_JAPANESE_POSTCARD 43 +#define DMPAPER_9X11 44 +#define DMPAPER_10X11 45 +#define DMPAPER_15X11 46 +#define DMPAPER_ENV_INVITE 47 +#define DMPAPER_RESERVED_48 48 +#define DMPAPER_RESERVED_49 49 +#define DMPAPER_LETTER_EXTRA 50 +#define DMPAPER_LEGAL_EXTRA 51 +#define DMPAPER_TABLOID_EXTRA 52 +#define DMPAPER_A4_EXTRA 53 +#define DMPAPER_LETTER_TRANSVERSE 54 +#define DMPAPER_A4_TRANSVERSE 55 +#define DMPAPER_LETTER_EXTRA_TRANSVERSE 56 +#define DMPAPER_A_PLUS 57 +#define DMPAPER_B_PLUS 58 +#define DMPAPER_LETTER_PLUS 59 +#define DMPAPER_A4_PLUS 60 +#define DMPAPER_A5_TRANSVERSE 61 +#define DMPAPER_B5_TRANSVERSE 62 +#define DMPAPER_A3_EXTRA 63 +#define DMPAPER_A5_EXTRA 64 +#define DMPAPER_B5_EXTRA 65 +#define DMPAPER_A2 66 +#define DMPAPER_A3_TRANSVERSE 67 +#define DMPAPER_A3_EXTRA_TRANSVERSE 68 +#define DMPAPER_DBL_JAPANESE_POSTCARD 69 +#define DMPAPER_A6 70 +#define DMPAPER_JENV_KAKU2 71 +#define DMPAPER_JENV_KAKU3 72 +#define DMPAPER_JENV_CHOU3 73 +#define DMPAPER_JENV_CHOU4 74 +#define DMPAPER_LETTER_ROTATED 75 +#define DMPAPER_A3_ROTATED 76 +#define DMPAPER_A4_ROTATED 77 +#define DMPAPER_A5_ROTATED 78 +#define DMPAPER_B4_JIS_ROTATED 79 +#define DMPAPER_B5_JIS_ROTATED 80 +#define DMPAPER_JAPANESE_POSTCARD_ROTATED 81 +#define DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED 82 +#define DMPAPER_A6_ROTATED 83 +#define DMPAPER_JENV_KAKU2_ROTATED 84 +#define DMPAPER_JENV_KAKU3_ROTATED 85 +#define DMPAPER_JENV_CHOU3_ROTATED 86 +#define DMPAPER_JENV_CHOU4_ROTATED 87 +#define DMPAPER_B6_JIS 88 +#define DMPAPER_B6_JIS_ROTATED 89 +#define DMPAPER_12X11 90 +#define DMPAPER_JENV_YOU4 91 +#define DMPAPER_JENV_YOU4_ROTATED 92 +#define DMPAPER_P16K 93 +#define DMPAPER_P32K 94 +#define DMPAPER_P32KBIG 95 +#define DMPAPER_PENV_1 96 +#define DMPAPER_PENV_2 97 +#define DMPAPER_PENV_3 98 +#define DMPAPER_PENV_4 99 +#define DMPAPER_PENV_5 100 +#define DMPAPER_PENV_6 101 +#define DMPAPER_PENV_7 102 +#define DMPAPER_PENV_8 103 +#define DMPAPER_PENV_9 104 +#define DMPAPER_PENV_10 105 +#define DMPAPER_P16K_ROTATED 106 +#define DMPAPER_P32K_ROTATED 107 +#define DMPAPER_P32KBIG_ROTATED 108 +#define DMPAPER_PENV_1_ROTATED 109 +#define DMPAPER_PENV_2_ROTATED 110 +#define DMPAPER_PENV_3_ROTATED 111 +#define DMPAPER_PENV_4_ROTATED 112 +#define DMPAPER_PENV_5_ROTATED 113 +#define DMPAPER_PENV_6_ROTATED 114 +#define DMPAPER_PENV_7_ROTATED 115 +#define DMPAPER_PENV_8_ROTATED 116 +#define DMPAPER_PENV_9_ROTATED 117 +#define DMPAPER_PENV_10_ROTATED 118 +#define DMPAPER_LAST 118 +#define DMPAPER_USER 256 +#define DMBIN_FIRST 1 +#define DMBIN_UPPER 1 +#define DMBIN_ONLYONE 1 +#define DMBIN_LOWER 2 +#define DMBIN_MIDDLE 3 +#define DMBIN_MANUAL 4 +#define DMBIN_ENVELOPE 5 +#define DMBIN_ENVMANUAL 6 +#define DMBIN_AUTO 7 +#define DMBIN_TRACTOR 8 +#define DMBIN_SMALLFMT 9 +#define DMBIN_LARGEFMT 10 +#define DMBIN_LARGECAPACITY 11 +#define DMBIN_CASSETTE 14 +#define DMBIN_FORMSOURCE 15 +#define DMBIN_LAST 15 +#define DMBIN_USER 256 +#define DMRES_DRAFT (-1) +#define DMRES_LOW (-2) +#define DMRES_MEDIUM (-3) +#define DMRES_HIGH (-4) +#define DMCOLOR_MONOCHROME 1 +#define DMCOLOR_COLOR 2 +#define DMDUP_SIMPLEX 1 +#define DMDUP_VERTICAL 2 +#define DMDUP_HORIZONTAL 3 +#define DMTT_BITMAP 1 +#define DMTT_DOWNLOAD 2 +#define DMTT_SUBDEV 3 +#define DMTT_DOWNLOAD_OUTLINE 4 +#define DMCOLLATE_FALSE 0 +#define DMCOLLATE_TRUE 1 +#define DM_SPECVERSION 800 +#define DM_GRAYSCALE 1 +#define DM_INTERLACED 2 +#define DM_UPDATE 1 +#define DM_COPY 2 +#define DM_PROMPT 4 +#define DM_MODIFY 8 +#define DM_IN_BUFFER DM_MODIFY +#define DM_IN_PROMPT DM_PROMPT +#define DM_OUT_BUFFER DM_COPY +#define DM_OUT_DEFAULT DM_UPDATE +#define DM_ORIENTATION 0x00000001 +#define DM_PAPERSIZE 0x00000002 +#define DM_PAPERLENGTH 0x00000004 +#define DM_PAPERWIDTH 0x00000008 +#define DM_SCALE 0x00000010 +#define DM_POSITION 0x00000020 +#define DM_COPIES 0x00000100 +#define DM_DEFAULTSOURCE 0x00000200 +#define DM_PRINTQUALITY 0x00000400 +#define DM_COLOR 0x00000800 +#define DM_DUPLEX 0x00001000 +#define DM_YRESOLUTION 0x00002000 +#define DM_TTOPTION 0x00004000 +#define DM_COLLATE 0x00008000 +#define DM_FORMNAME 0x00010000 +#define DM_LOGPIXELS 0x00020000 +#define DM_BITSPERPEL 0x00040000 +#define DM_PELSWIDTH 0x00080000 +#define DM_PELSHEIGHT 0x00100000 +#define DM_DISPLAYFLAGS 0x00200000 +#define DM_DISPLAYFREQUENCY 0x00400000 +#define DM_ICMMETHOD 0x00800000 +#define DM_ICMINTENT 0x01000000 +#define DM_MEDIATYPE 0x02000000 +#define DM_DITHERTYPE 0x04000000 +#define DM_PANNINGWIDTH 0x08000000 +#define DM_PANNINGHEIGHT 0x10000000 +#define DM_DISPLAYFIXEDOUTPUT 0x20000000 +#define DM_DISPLAYORIENTATION 0x00000080 +#define DMDO_DEFAULT 0x00000000 +#define DMDO_90 0x00000001 +#define DMDO_180 0x00000002 +#define DMDO_270 0x00000003 +#define DMDFO_DEFAULT 0x00000000 +#define DMDFO_STRETCH 0x00000001 +#define DMDFO_CENTER 0x00000002 +#define DMICMMETHOD_NONE 1 +#define DMICMMETHOD_SYSTEM 2 +#define DMICMMETHOD_DRIVER 3 +#define DMICMMETHOD_DEVICE 4 +#define DMICMMETHOD_USER 256 +#define DMICM_SATURATE 1 +#define DMICM_CONTRAST 2 +#define DMICM_COLORMETRIC 3 +#define DMICM_USER 256 +#define DMMEDIA_STANDARD 1 +#define DMMEDIA_TRANSPARENCY 2 +#define DMMEDIA_GLOSSY 3 +#define DMMEDIA_USER 256 +#define DMDITHER_NONE 1 +#define DMDITHER_COARSE 2 +#define DMDITHER_FINE 3 +#define DMDITHER_LINEART 4 +#define DMDITHER_ERRORDIFFUSION 5 +#define DMDITHER_RESERVED6 6 +#define DMDITHER_RESERVED7 7 +#define DMDITHER_RESERVED8 8 +#define DMDITHER_RESERVED9 9 +#define DMDITHER_GRAYSCALE 10 +#define DMDITHER_USER 256 +#define GDI_ERROR 0xFFFFFFFF +#define HGDI_ERROR ((HANDLE)GDI_ERROR) +#define TMPF_FIXED_PITCH 1 +#define TMPF_VECTOR 2 +#define TMPF_TRUETYPE 4 +#define TMPF_DEVICE 8 +#define NTM_ITALIC 1 +#define NTM_BOLD 32 +#define NTM_REGULAR 64 +#define TT_POLYGON_TYPE 24 +#define TT_PRIM_LINE 1 +#define TT_PRIM_QSPLINE 2 +#define TT_PRIM_CSPLINE 3 +#define FONTMAPPER_MAX 10 +#define ENHMETA_STOCK_OBJECT 0x80000000 +#define WGL_FONT_LINES 0 +#define WGL_FONT_POLYGONS 1 +#define LPD_DOUBLEBUFFER 1 +#define LPD_STEREO 2 +#define LPD_SUPPORT_GDI 16 +#define LPD_SUPPORT_OPENGL 32 +#define LPD_SHARE_DEPTH 64 +#define LPD_SHARE_STENCIL 128 +#define LPD_SHARE_ACCUM 256 +#define LPD_SWAP_EXCHANGE 512 +#define LPD_SWAP_COPY 1024 +#define LPD_TRANSPARENT 4096 +#define LPD_TYPE_RGBA 0 +#define LPD_TYPE_COLORINDEX 1 +#define WGL_SWAP_MAIN_PLANE 1 +#define WGL_SWAP_OVERLAY1 2 +#define WGL_SWAP_OVERLAY2 4 +#define WGL_SWAP_OVERLAY3 8 +#define WGL_SWAP_OVERLAY4 16 +#define WGL_SWAP_OVERLAY5 32 +#define WGL_SWAP_OVERLAY6 64 +#define WGL_SWAP_OVERLAY7 128 +#define WGL_SWAP_OVERLAY8 256 +#define WGL_SWAP_OVERLAY9 512 +#define WGL_SWAP_OVERLAY10 1024 +#define WGL_SWAP_OVERLAY11 2048 +#define WGL_SWAP_OVERLAY12 4096 +#define WGL_SWAP_OVERLAY13 8192 +#define WGL_SWAP_OVERLAY14 16384 +#define WGL_SWAP_OVERLAY15 32768 +#define WGL_SWAP_UNDERLAY1 65536 +#define WGL_SWAP_UNDERLAY2 0x20000 +#define WGL_SWAP_UNDERLAY3 0x40000 +#define WGL_SWAP_UNDERLAY4 0x80000 +#define WGL_SWAP_UNDERLAY5 0x100000 +#define WGL_SWAP_UNDERLAY6 0x200000 +#define WGL_SWAP_UNDERLAY7 0x400000 +#define WGL_SWAP_UNDERLAY8 0x800000 +#define WGL_SWAP_UNDERLAY9 0x1000000 +#define WGL_SWAP_UNDERLAY10 0x2000000 +#define WGL_SWAP_UNDERLAY11 0x4000000 +#define WGL_SWAP_UNDERLAY12 0x8000000 +#define WGL_SWAP_UNDERLAY13 0x10000000 +#define WGL_SWAP_UNDERLAY14 0x20000000 +#define WGL_SWAP_UNDERLAY15 0x40000000 +#define AC_SRC_OVER 0x00 +#define AC_SRC_ALPHA 0x01 +#define AC_SRC_NO_PREMULT_ALPHA 0x01 +#define AC_SRC_NO_ALPHA 0x02 +#define AC_DST_NO_PREMULT_ALPHA 0x10 +#define AC_DST_NO_ALPHA 0x20 +#define LAYOUT_RTL 1 +#define LAYOUT_BITMAPORIENTATIONPRESERVED 8 +#define CS_ENABLE 0x00000001 +#define CS_DISABLE 0x00000002 +#define CS_DELETE_TRANSFORM 0x00000003 +#define GRADIENT_FILL_RECT_H 0x00 +#define GRADIENT_FILL_RECT_V 0x01 +#define GRADIENT_FILL_TRIANGLE 0x02 +#define GRADIENT_FILL_OP_FLAG 0xff +#define COLORMATCHTOTARGET_EMBEDED 0x00000001 +#define CREATECOLORSPACE_EMBEDED 0x00000001 +#define SETICMPROFILE_EMBEDED 0x00000001 +#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 +#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002 +#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 +#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 +#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010 +#define DISPLAY_DEVICE_REMOVABLE 0x00000020 +#define DISPLAY_DEVICE_MODESPRUNED 0x08000000 +#define GGI_MARK_NONEXISTING_GLYPHS 1 -/************************************************************************** -* * -* wingdi.h -- GDI procedure declarations, constant definitions and macros * -* * -* Copyright (c) 1985-1999, Microsoft Corp. All rights reserved. * -* * -**************************************************************************/ - - -#ifndef _WINGDI_ - //P_O_Push - #define _WINGDI_ - - - #ifndef WINVER - #define WINVER 1280 // version 5.0 - #endif // WINVER - - #ifndef NOGDI - - #ifndef NORASTEROPS - - // Binary raster ops - #define R2_BLACK 1 // 0 - #define R2_NOTMERGEPEN 2 // DPon - #define R2_MASKNOTPEN 3 // DPna - #define R2_NOTCOPYPEN 4 // PN - #define R2_MASKPENNOT 5 // PDna - #define R2_NOT 6 // Dn - #define R2_XORPEN 7 // DPx - #define R2_NOTMASKPEN 8 // DPan - #define R2_MASKPEN 9 // DPa - #define R2_NOTXORPEN 10 // DPxn - #define R2_NOP 11 // D - #define R2_MERGENOTPEN 12 // DPno - #define R2_COPYPEN 13 // P - #define R2_MERGEPENNOT 14 // PDno - #define R2_MERGEPEN 15 // DPo - #define R2_WHITE 16 // 1 - #define R2_LAST 16 - - // Ternary raster operations - #define SRCCOPY 13369376 // dest = source - #define SRCPAINT 15597702 // dest = source OR dest - #define SRCAND 8913094 // dest = source AND dest - #define SRCINVERT 6684742 // dest = source XOR dest - #define SRCERASE 4457256 // dest = source AND (NOT dest ) - #define NOTSRCCOPY 3342344 // dest = (NOT source) - #define NOTSRCERASE 1114278 // dest = (NOT src) AND (NOT dest) - #define MERGECOPY 12583114 // dest = (source AND pattern) - #define MERGEPAINT 12255782 // dest = (NOT source) OR dest - #define PATCOPY 15728673 // dest = pattern - #define PATPAINT 16452105 // dest = DPSnoo - #define PATINVERT 5898313 // dest = pattern XOR dest - #define DSTINVERT 5570569 // dest = (NOT dest) - #define BLACKNESS 66 // dest = BLACK - #define WHITENESS 16711778 // dest = WHITE - #define NOMIRRORBITMAP 2147483648 // Do not Mirror the bitmap in this call - #define CAPTUREBLT 1073741824 // Include layered windows - - // Quaternary raster codes - //#define MAKEROP4(fore,back) (DWORD)((((back) << 8) * 4278190080) + (fore)) - - #endif // NORASTEROPS - - #define GDI_ERROR ( 4294967295) - #define HGDI_ERROR ( 4294967295) - - // Region Flags - #define ERROR 0 - #define NULLREGION 1 - #define SIMPLEREGION 2 - #define COMPLEXREGION 3 - #define RGN_ERROR ERROR - - // CombineRgn() Styles - #define RGN_AND 1 - #define RGN_OR 2 - #define RGN_XOR 3 - #define RGN_DIFF 4 - #define RGN_COPY 5 - #define RGN_MIN RGN_AND - #define RGN_MAX RGN_COPY - - // StretchBlt() Modes - #define BLACKONWHITE 1 - #define WHITEONBLACK 2 - #define COLORONCOLOR 3 - #define HALFTONE 4 - #define MAXSTRETCHBLTMODE 4 - - // New StretchBlt() Modes - #define STRETCH_ANDSCANS BLACKONWHITE - #define STRETCH_ORSCANS WHITEONBLACK - #define STRETCH_DELETESCANS COLORONCOLOR - #define STRETCH_HALFTONE HALFTONE - - // PolyFill() Modes - #define ALTERNATE 1 - #define WINDING 2 - #define POLYFILL_LAST 2 - - // Layout Orientation Options - #define LAYOUT_RTL 1 // Right to left - #define LAYOUT_BTT 2 // Bottom to top - #define LAYOUT_VBH 4 // Vertical before horizontal - #define LAYOUT_ORIENTATIONMASK (LAYOUT_RTL + LAYOUT_BTT + LAYOUT_VBH) - #define LAYOUT_BITMAPORIENTATIONPRESERVED 8 - - // Text Alignment Options - #define TA_NOUPDATECP 0 - #define TA_UPDATECP 1 - - #define TA_LEFT 0 - #define TA_RIGHT 2 - #define TA_CENTER 6 - - #define TA_TOP 0 - #define TA_BOTTOM 8 - #define TA_BASELINE 24 - #define TA_RTLREADING 256 - #define TA_MASK (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING) - #define VTA_BASELINE TA_BASELINE - #define VTA_LEFT TA_BOTTOM - #define VTA_RIGHT TA_TOP - #define VTA_CENTER TA_CENTER - #define VTA_BOTTOM TA_RIGHT - #define VTA_TOP TA_LEFT - - #define ETO_OPAQUE 2 - #define ETO_CLIPPED 4 - #define ETO_GLYPH_INDEX 16 - #define ETO_RTLREADING 128 - #define ETO_NUMERICSLOCAL 1024 - #define ETO_NUMERICSLATIN 2048 - #define ETO_IGNORELANGUAGE 4096 - #define ETO_PDY 8192 - #define ASPECT_FILTERING 1 - - // Bounds Accumulation APIs - - #define DCB_RESET 1 - #define DCB_ACCUMULATE 2 - #define DCB_DIRTY DCB_ACCUMULATE - #define DCB_SET (DCB_RESET + DCB_ACCUMULATE) - #define DCB_ENABLE 4 - #define DCB_DISABLE 8 - - #ifndef NOMETAFILE - - // Metafile Functions - #define META_SETBKCOLOR 513 - #define META_SETBKMODE 258 - #define META_SETMAPMODE 259 - #define META_SETROP2 260 - #define META_SETRELABS 261 - #define META_SETPOLYFILLMODE 262 - #define META_SETSTRETCHBLTMODE 263 - #define META_SETTEXTCHAREXTRA 264 - #define META_SETTEXTCOLOR 521 - #define META_SETTEXTJUSTIFICATION 522 - #define META_SETWINDOWORG 523 - #define META_SETWINDOWEXT 524 - #define META_SETVIEWPORTORG 525 - #define META_SETVIEWPORTEXT 526 - #define META_OFFSETWINDOWORG 527 - #define META_SCALEWINDOWEXT 1040 - #define META_OFFSETVIEWPORTORG 529 - #define META_SCALEVIEWPORTEXT 1042 - #define META_LINETO 531 - #define META_MOVETO 532 - #define META_EXCLUDECLIPRECT 1045 - #define META_INTERSECTCLIPRECT 1046 - #define META_ARC 2071 - #define META_ELLIPSE 1048 - #define META_FLOODFILL 1049 - #define META_PIE 2074 - #define META_RECTANGLE 1051 - #define META_ROUNDRECT 1564 - #define META_PATBLT 1565 - #define META_SAVEDC 30 - #define META_SETPIXEL 1055 - #define META_OFFSETCLIPRGN 544 - #define META_TEXTOUT 1313 - #define META_BITBLT 2338 - #define META_STRETCHBLT 2851 - #define META_POLYGON 804 - #define META_POLYLINE 805 - #define META_ESCAPE 1574 - #define META_RESTOREDC 295 - #define META_FILLREGION 552 - #define META_FRAMEREGION 1065 - #define META_INVERTREGION 298 - #define META_PAINTREGION 299 - #define META_SELECTCLIPREGION 300 - #define META_SELECTOBJECT 301 - #define META_SETTEXTALIGN 302 - #define META_CHORD 2096 - #define META_SETMAPPERFLAGS 561 - #define META_EXTTEXTOUT 2610 - #define META_SETDIBTODEV 3379 - #define META_SELECTPALETTE 564 - #define META_REALIZEPALETTE 53 - #define META_ANIMATEPALETTE 1078 - #define META_SETPALENTRIES 55 - #define META_POLYPOLYGON 1336 - #define META_RESIZEPALETTE 313 - #define META_DIBBITBLT 2368 - #define META_DIBSTRETCHBLT 2881 - #define META_DIBCREATEPATTERNBRUSH 322 - #define META_STRETCHDIB 3907 - #define META_EXTFLOODFILL 1352 - #define META_SETLAYOUT 329 - #define META_DELETEOBJECT 496 - #define META_CREATEPALETTE 247 - #define META_CREATEPATTERNBRUSH 505 - #define META_CREATEPENINDIRECT 762 - #define META_CREATEFONTINDIRECT 763 - #define META_CREATEBRUSHINDIRECT 764 - #define META_CREATEREGION 1791 - - #endif // NOMETAFILE - - // GDI Escapes - #define NEWFRAME 1 - #define ABORTDOC 2 - #define NEXTBAND 3 - #define SETCOLORTABLE 4 - #define GETCOLORTABLE 5 - #define FLUSHOUTPUT 6 - #define DRAFTMODE 7 - #define QUERYESCSUPPORT 8 - #define SETABORTPROC 9 - #define STARTDOC 10 - #define ENDDOC 11 - #define GETPHYSPAGESIZE 12 - #define GETPRINTINGOFFSET 13 - #define GETSCALINGFACTOR 14 - #define MFCOMMENT 15 - #define GETPENWIDTH 16 - #define SETCOPYCOUNT 17 - #define SELECTPAPERSOURCE 18 - #define DEVICEDATA 19 - #define PASSTHROUGH 19 - #define GETTECHNOLGY 20 - #define GETTECHNOLOGY 20 - #define SETLINECAP 21 - #define SETLINEJOIN 22 - #define SETMITERLIMIT 23 - #define BANDINFO 24 - #define DRAWPATTERNRECT 25 - #define GETVECTORPENSIZE 26 - #define GETVECTORBRUSHSIZE 27 - #define ENABLEDUPLEX 28 - #define GETSETPAPERBINS 29 - #define GETSETPRINTORIENT 30 - #define ENUMPAPERBINS 31 - #define SETDIBSCALING 32 - #define EPSPRINTING 33 - #define ENUMPAPERMETRICS 34 - #define GETSETPAPERMETRICS 35 - #define POSTSCRIPT_DATA 37 - #define POSTSCRIPT_IGNORE 38 - #define MOUSETRAILS 39 - #define GETDEVICEUNITS 42 - - #define GETEXTENDEDTEXTMETRICS 256 - #define GETEXTENTTABLE 257 - #define GETPAIRKERNTABLE 258 - #define GETTRACKKERNTABLE 259 - #define EXTTEXTOUT 512 - #define GETFACENAME 513 - #define DOWNLOADFACE 514 - #define ENABLERELATIVEWIDTHS 768 - #define ENABLEPAIRKERNING 769 - #define SETKERNTRACK 770 - #define SETALLJUSTVALUES 771 - #define SETCHARSET 772 - - #define STRETCHBLT 2048 - #define METAFILE_DRIVER 2049 - #define GETSETSCREENPARAMS 3072 - #define QUERYDIBSUPPORT 3073 - #define BEGIN_PATH 4096 - #define CLIP_TO_PATH 4097 - #define END_PATH 4098 - #define EXT_DEVICE_CAPS 4099 - #define RESTORE_CTM 4100 - #define SAVE_CTM 4101 - #define SET_ARC_DIRECTION 4102 - #define SET_BACKGROUND_COLOR 4103 - #define SET_POLY_MODE 4104 - #define SET_SCREEN_ANGLE 4105 - #define SET_SPREAD 4106 - #define TRANSFORM_CTM 4107 - #define SET_CLIP_BOX 4108 - #define SET_BOUNDS 4109 - #define SET_MIRROR_MODE 4110 - #define OPENCHANNEL 4110 - #define DOWNLOADHEADER 4111 - #define CLOSECHANNEL 4112 - #define POSTSCRIPT_PASSTHROUGH 4115 - #define ENCAPSULATED_POSTSCRIPT 4116 - - #define POSTSCRIPT_IDENTIFY 4117 // new escape for NT5 pscript driver - #define POSTSCRIPT_INJECTION 4118 // new escape for NT5 pscript driver - - #define CHECKJPEGFORMAT 4119 - #define CHECKPNGFORMAT 4120 - - #define GET_PS_FEATURESETTING 4121 // new escape for NT5 pscript driver - - #define SPCLPASSTHROUGH2 4568 // new escape for NT5 pscript driver - - /* - * Parameters for POSTSCRIPT_IDENTIFY escape - */ - - #define PSIDENT_GDICENTRIC 0 - #define PSIDENT_PSCENTRIC 1 - - /* - * Constants for PSINJECTDATA.InjectionPoint field - */ - - #define PSINJECT_BEGINSTREAM 1 - #define PSINJECT_PSADOBE 2 - #define PSINJECT_PAGESATEND 3 - #define PSINJECT_PAGES 4 - - #define PSINJECT_DOCNEEDEDRES 5 - #define PSINJECT_DOCSUPPLIEDRES 6 - #define PSINJECT_PAGEORDER 7 - #define PSINJECT_ORIENTATION 8 - #define PSINJECT_BOUNDINGBOX 9 - #define PSINJECT_DOCUMENTPROCESSCOLORS 10 - - #define PSINJECT_COMMENTS 11 - #define PSINJECT_BEGINDEFAULTS 12 - #define PSINJECT_ENDDEFAULTS 13 - #define PSINJECT_BEGINPROLOG 14 - #define PSINJECT_ENDPROLOG 15 - #define PSINJECT_BEGINSETUP 16 - #define PSINJECT_ENDSETUP 17 - #define PSINJECT_TRAILER 18 - #define PSINJECT_EOF 19 - #define PSINJECT_ENDSTREAM 20 - #define PSINJECT_DOCUMENTPROCESSCOLORSATEND 21 - - #define PSINJECT_PAGENUMBER 100 - #define PSINJECT_BEGINPAGESETUP 101 - #define PSINJECT_ENDPAGESETUP 102 - #define PSINJECT_PAGETRAILER 103 - #define PSINJECT_PLATECOLOR 104 - - #define PSINJECT_SHOWPAGE 105 - #define PSINJECT_PAGEBBOX 106 - #define PSINJECT_ENDPAGECOMMENTS 107 - - #define PSINJECT_VMSAVE 200 - #define PSINJECT_VMRESTORE 201 - - /* - * Parameter for GET_PS_FEATURESETTING escape - */ - - #define FEATURESETTING_NUP 0 - #define FEATURESETTING_OUTPUT 1 - #define FEATURESETTING_PSLEVEL 2 - #define FEATURESETTING_CUSTPAPER 3 - #define FEATURESETTING_MIRROR 4 - #define FEATURESETTING_NEGATIVE 5 - #define FEATURESETTING_PROTOCOL 6 - - /* - * Information about output options - */ - - - /* - * Information about custom paper size - */ - - - // Value returned for FEATURESETTING_PROTOCOL - #define PSPROTOCOL_ASCII 0 - #define PSPROTOCOL_BCP 1 - #define PSPROTOCOL_TBCP 2 - #define PSPROTOCOL_BINARY 3 - - // Flag returned from QUERYDIBSUPPORT - #define QDI_SETDIBITS 1 - #define QDI_GETDIBITS 2 - #define QDI_DIBTOSCREEN 4 - #define QDI_STRETCHDIB 8 - - // Spooler Error Codes - #define SP_NOTREPORTED 16384 - #define SP_ERROR (-1) - #define SP_APPABORT (-2) - #define SP_USERABORT (-3) - #define SP_OUTOFDISK (-4) - #define SP_OUTOFMEMORY (-5) - - #define PR_JOBSTATUS 0 - - // Object Definitions for EnumObjects() - #define OBJ_PEN 1 - #define OBJ_BRUSH 2 - #define OBJ_DC 3 - #define OBJ_METADC 4 - #define OBJ_PAL 5 - #define OBJ_FONT 6 - #define OBJ_BITMAP 7 - #define OBJ_REGION 8 - #define OBJ_METAFILE 9 - #define OBJ_MEMDC 10 - #define OBJ_EXTPEN 11 - #define OBJ_ENHMETADC 12 - #define OBJ_ENHMETAFILE 13 - #define OBJ_COLORSPACE 14 - - // xform stuff - #define MWT_IDENTITY 1 - #define MWT_LEFTMULTIPLY 2 - #define MWT_RIGHTMULTIPLY 3 - - #define MWT_MIN MWT_IDENTITY - #define MWT_MAX MWT_RIGHTMULTIPLY - - #define _XFORM_ - - - // Bitmap Header Definition - - - //#include "pshpack1.ch" - - - //#include "poppack.ch" - - // Image Color Matching color definitions - - #define CS_ENABLE 1 - #define CS_DISABLE 2 - #define CS_DELETE_TRANSFORM 3 - - // Logcolorspace signature - - #define LCS_SIGNATURE 'PSOC' - - // Logcolorspace lcsType values - - #define LCS_sRGB 'sRGB' - #define LCS_WINDOWS_COLOR_SPACE 'Win ' // Windows default color space - - - #define LCS_CALIBRATED_RGB 0 - - - #define LCS_GM_BUSINESS 1 - #define LCS_GM_GRAPHICS 2 - #define LCS_GM_IMAGES 4 - #define LCS_GM_ABS_COLORIMETRIC 8 - - // ICM Defines for results from CheckColorInGamut() - #define CM_OUT_OF_GAMUT 255 - #define CM_IN_GAMUT 0 - - // UpdateICMRegKey Constants - #define ICM_ADDPROFILE 1 - #define ICM_DELETEPROFILE 2 - #define ICM_QUERYPROFILE 3 - #define ICM_SETDEFAULTPROFILE 4 - #define ICM_REGISTERICMATCHER 5 - #define ICM_UNREGISTERICMATCHER 6 - #define ICM_QUERYMATCH 7 - - - // Macros to retrieve CMYK values from a COLORREF - //#define GetKValue(cmyk) ((BYTE)(cmyk)) - //#define GetYValue(cmyk) ((BYTE)((cmyk)>> 8)) - //#define GetMValue(cmyk) ((BYTE)((cmyk)>>16)) - //#define GetCValue(cmyk) ((BYTE)((cmyk)>>24)) - - //#define CMYK(c,m,y,k) ((COLORREF)((((BYTE)(k)|((WORD)((BYTE)(y))<<8))|(((DWORD)(BYTE)(m))<<16))|(((DWORD)(BYTE)(c))<<24))) - - - // Values for bV5CSType - #define PROFILE_LINKED 'LINK' - #define PROFILE_EMBEDDED 'MBED' - - // constants for the biCompression field - #define BI_RGB 0L - #define BI_RLE8 1L - #define BI_RLE4 2L - #define BI_BITFIELDS 3L - #define BI_JPEG 4L - #define BI_PNG 5L - - //#define MAKEPOINTS(l) (*((POINTS FAR *)&(l))) - - #ifndef NOFONTSIG - - #define TCI_SRCCHARSET 1 - #define TCI_SRCCODEPAGE 2 - #define TCI_SRCFONTSIG 3 - - #endif - - #ifndef NOMETAFILE - - // Clipboard Metafile Picture Structure - - // Enhanced Metafile structures - #ifndef NOTEXTMETRIC - - // tmPitchAndFamily flags - #define TMPF_FIXED_PITCH 1 - #define TMPF_VECTOR 2 - #define TMPF_DEVICE 8 - #define TMPF_TRUETYPE 4 - - #ifndef _TEXTMETRIC_DEFINED - #define _TEXTMETRIC_DEFINED - #endif // !_TEXTMETRIC_DEFINED - - // ntmFlags field flags - #define NTM_REGULAR 64 - #define NTM_BOLD 32 - #define NTM_ITALIC 1 - - // new in NT 5.0 - - #define NTM_NONNEGATIVE_AC 65536 - #define NTM_PS_OPENTYPE 131072 - #define NTM_TT_OPENTYPE 262144 - #define NTM_MULTIPLEMASTER 524288 - #define NTM_TYPE1 1048576 - #define NTM_DSIG 2097152 - - #endif // NOTEXTMETRIC - - - #ifndef _PALETTEENTRY_DEFINED - #define _PALETTEENTRY_DEFINED - #endif // !_PALETTEENTRY_DEFINED - - #ifndef _LOGPALETTE_DEFINED - #define _LOGPALETTE_DEFINED - #endif // !_LOGPALETTE_DEFINED - - // Logical Font - #define LF_FACESIZE 32 - #define LF_FULLFACESIZE 64 - - #define OUT_DEFAULT_PRECIS 0 - #define OUT_STRING_PRECIS 1 - #define OUT_CHARACTER_PRECIS 2 - #define OUT_STROKE_PRECIS 3 - #define OUT_TT_PRECIS 4 - #define OUT_DEVICE_PRECIS 5 - #define OUT_RASTER_PRECIS 6 - #define OUT_TT_ONLY_PRECIS 7 - #define OUT_OUTLINE_PRECIS 8 - #define OUT_SCREEN_OUTLINE_PRECIS 9 - #define OUT_PS_ONLY_PRECIS 10 - - #define CLIP_DEFAULT_PRECIS 0 - #define CLIP_CHARACTER_PRECIS 1 - #define CLIP_STROKE_PRECIS 2 - #define CLIP_MASK 15 - //#define CLIP_LH_ANGLES (1<<4) - //#define CLIP_TT_ALWAYS (2<<4) - //#define CLIP_EMBEDDED (8<<4) - - #define DEFAULT_QUALITY 0 - #define DRAFT_QUALITY 1 - #define PROOF_QUALITY 2 - #define NONANTIALIASED_QUALITY 3 - #define ANTIALIASED_QUALITY 4 - #define DEFAULT_PITCH 0 - #define FIXED_PITCH 1 - #define VARIABLE_PITCH 2 - #define MONO_FONT 8 - #define ANSI_CHARSET 0 - #define DEFAULT_CHARSET 1 - #define SYMBOL_CHARSET 2 - #define SHIFTJIS_CHARSET 128 - #define HANGEUL_CHARSET 129 - #define HANGUL_CHARSET 129 - #define GB2312_CHARSET 134 - #define CHINESEBIG5_CHARSET 136 - #define OEM_CHARSET 255 - #define JOHAB_CHARSET 130 - #define HEBREW_CHARSET 177 - #define ARABIC_CHARSET 178 - #define GREEK_CHARSET 161 - #define TURKISH_CHARSET 162 - #define VIETNAMESE_CHARSET 163 - #define THAI_CHARSET 222 - #define EASTEUROPE_CHARSET 238 - #define RUSSIAN_CHARSET 204 - - #define MAC_CHARSET 77 - #define BALTIC_CHARSET 186 - - #define FS_LATIN1 1 - #define FS_LATIN2 2 - #define FS_CYRILLIC 4 - #define FS_GREEK 8 - #define FS_TURKISH 16 - #define FS_HEBREW 32 - #define FS_ARABIC 64 - #define FS_BALTIC 128 - #define FS_VIETNAMESE 256 - #define FS_THAI 65536 - #define FS_JISJAPAN 131072 - #define FS_CHINESESIMP 262144 - #define FS_WANSUNG 524288 - #define FS_CHINESETRAD 1048576 - #define FS_JOHAB 2097152 - #define FS_SYMBOL 2147483648 - - // Font Families - #define FF_DONTCARE 0 // Don't care or don't know. - #define FF_ROMAN 16 // Variable stroke width, serifed. - // Times Roman, Century Schoolbook, etc. - #define FF_SWISS 32 // Variable stroke width, sans-serifed. - // Helvetica, Swiss, etc. - #define FF_MODERN 48 // Constant stroke width, serifed or sans-serifed. - // Pica, Elite, Courier, etc. - #define FF_SCRIPT 64 // Cursive, etc. - #define FF_DECORATIVE 80 // Old English, etc. - - // Font Weights - #define FW_DONTCARE 0 - #define FW_THIN 100 - #define FW_EXTRALIGHT 200 - #define FW_LIGHT 300 - #define FW_NORMAL 400 - #define FW_MEDIUM 500 - #define FW_SEMIBOLD 600 - #define FW_BOLD 700 - #define FW_EXTRABOLD 800 - #define FW_HEAVY 900 - - #define FW_ULTRALIGHT FW_EXTRALIGHT - #define FW_REGULAR FW_NORMAL - #define FW_DEMIBOLD FW_SEMIBOLD - #define FW_ULTRABOLD FW_EXTRABOLD - #define FW_BLACK FW_HEAVY - - #define PANOSE_COUNT 10 - #define PAN_FAMILYTYPE_INDEX 0 - #define PAN_SERIFSTYLE_INDEX 1 - #define PAN_WEIGHT_INDEX 2 - #define PAN_PROPORTION_INDEX 3 - #define PAN_CONTRAST_INDEX 4 - #define PAN_STROKEVARIATION_INDEX 5 - #define PAN_ARMSTYLE_INDEX 6 - #define PAN_LETTERFORM_INDEX 7 - #define PAN_MIDLINE_INDEX 8 - #define PAN_XHEIGHT_INDEX 9 - - #define PAN_CULTURE_LATIN 0 - - - #define PAN_ANY 0 // Any - #define PAN_NO_FIT 1 // No Fit - - #define PAN_FAMILY_TEXT_DISPLAY 2 // Text and Display - #define PAN_FAMILY_SCRIPT 3 // Script - #define PAN_FAMILY_DECORATIVE 4 // Decorative - #define PAN_FAMILY_PICTORIAL 5 // Pictorial - - #define PAN_SERIF_COVE 2 // Cove - #define PAN_SERIF_OBTUSE_COVE 3 // Obtuse Cove - #define PAN_SERIF_SQUARE_COVE 4 // Square Cove - #define PAN_SERIF_OBTUSE_SQUARE_COVE 5 // Obtuse Square Cove - #define PAN_SERIF_SQUARE 6 // Square - #define PAN_SERIF_THIN 7 // Thin - #define PAN_SERIF_BONE 8 // Bone - #define PAN_SERIF_EXAGGERATED 9 // Exaggerated - #define PAN_SERIF_TRIANGLE 10 // Triangle - #define PAN_SERIF_NORMAL_SANS 11 // Normal Sans - #define PAN_SERIF_OBTUSE_SANS 12 // Obtuse Sans - #define PAN_SERIF_PERP_SANS 13 // Prep Sans - #define PAN_SERIF_FLARED 14 // Flared - #define PAN_SERIF_ROUNDED 15 // Rounded - - #define PAN_WEIGHT_VERY_LIGHT 2 // Very Light - #define PAN_WEIGHT_LIGHT 3 // Light - #define PAN_WEIGHT_THIN 4 // Thin - #define PAN_WEIGHT_BOOK 5 // Book - #define PAN_WEIGHT_MEDIUM 6 // Medium - #define PAN_WEIGHT_DEMI 7 // Demi - #define PAN_WEIGHT_BOLD 8 // Bold - #define PAN_WEIGHT_HEAVY 9 // Heavy - #define PAN_WEIGHT_BLACK 10 // Black - #define PAN_WEIGHT_NORD 11 // Nord - - #define PAN_PROP_OLD_STYLE 2 // Old Style - #define PAN_PROP_MODERN 3 // Modern - #define PAN_PROP_EVEN_WIDTH 4 // Even Width - #define PAN_PROP_EXPANDED 5 // Expanded - #define PAN_PROP_CONDENSED 6 // Condensed - #define PAN_PROP_VERY_EXPANDED 7 // Very Expanded - #define PAN_PROP_VERY_CONDENSED 8 // Very Condensed - #define PAN_PROP_MONOSPACED 9 // Monospaced - - #define PAN_CONTRAST_NONE 2 // None - #define PAN_CONTRAST_VERY_LOW 3 // Very Low - #define PAN_CONTRAST_LOW 4 // Low - #define PAN_CONTRAST_MEDIUM_LOW 5 // Medium Low - #define PAN_CONTRAST_MEDIUM 6 // Medium - #define PAN_CONTRAST_MEDIUM_HIGH 7 // Mediim High - #define PAN_CONTRAST_HIGH 8 // High - #define PAN_CONTRAST_VERY_HIGH 9 // Very High - - #define PAN_STROKE_GRADUAL_DIAG 2 // Gradual/Diagonal - #define PAN_STROKE_GRADUAL_TRAN 3 // Gradual/Transitional - #define PAN_STROKE_GRADUAL_VERT 4 // Gradual/Vertical - #define PAN_STROKE_GRADUAL_HORZ 5 // Gradual/Horizontal - #define PAN_STROKE_RAPID_VERT 6 // Rapid/Vertical - #define PAN_STROKE_RAPID_HORZ 7 // Rapid/Horizontal - #define PAN_STROKE_INSTANT_VERT 8 // Instant/Vertical - - #define PAN_STRAIGHT_ARMS_HORZ 2 // Straight Arms/Horizontal - #define PAN_STRAIGHT_ARMS_WEDGE 3 // Straight Arms/Wedge - #define PAN_STRAIGHT_ARMS_VERT 4 // Straight Arms/Vertical - #define PAN_STRAIGHT_ARMS_SINGLE_SERIF 5 // Straight Arms/Single-Serif - #define PAN_STRAIGHT_ARMS_DOUBLE_SERIF 6 // Straight Arms/Double-Serif - #define PAN_BENT_ARMS_HORZ 7 // Non-Straight Arms/Horizontal - #define PAN_BENT_ARMS_WEDGE 8 // Non-Straight Arms/Wedge - #define PAN_BENT_ARMS_VERT 9 // Non-Straight Arms/Vertical - #define PAN_BENT_ARMS_SINGLE_SERIF 10 // Non-Straight Arms/Single-Serif - #define PAN_BENT_ARMS_DOUBLE_SERIF 11 // Non-Straight Arms/Double-Serif - - #define PAN_LETT_NORMAL_CONTACT 2 // Normal/Contact - #define PAN_LETT_NORMAL_WEIGHTED 3 // Normal/Weighted - #define PAN_LETT_NORMAL_BOXED 4 // Normal/Boxed - #define PAN_LETT_NORMAL_FLATTENED 5 // Normal/Flattened - #define PAN_LETT_NORMAL_ROUNDED 6 // Normal/Rounded - #define PAN_LETT_NORMAL_OFF_CENTER 7 // Normal/Off Center - #define PAN_LETT_NORMAL_SQUARE 8 // Normal/Square - #define PAN_LETT_OBLIQUE_CONTACT 9 // Oblique/Contact - #define PAN_LETT_OBLIQUE_WEIGHTED 10 // Oblique/Weighted - #define PAN_LETT_OBLIQUE_BOXED 11 // Oblique/Boxed - #define PAN_LETT_OBLIQUE_FLATTENED 12 // Oblique/Flattened - #define PAN_LETT_OBLIQUE_ROUNDED 13 // Oblique/Rounded - #define PAN_LETT_OBLIQUE_OFF_CENTER 14 // Oblique/Off Center - #define PAN_LETT_OBLIQUE_SQUARE 15 // Oblique/Square - - #define PAN_MIDLINE_STANDARD_TRIMMED 2 // Standard/Trimmed - #define PAN_MIDLINE_STANDARD_POINTED 3 // Standard/Pointed - #define PAN_MIDLINE_STANDARD_SERIFED 4 // Standard/Serifed - #define PAN_MIDLINE_HIGH_TRIMMED 5 // High/Trimmed - #define PAN_MIDLINE_HIGH_POINTED 6 // High/Pointed - #define PAN_MIDLINE_HIGH_SERIFED 7 // High/Serifed - #define PAN_MIDLINE_CONSTANT_TRIMMED 8 // Constant/Trimmed - #define PAN_MIDLINE_CONSTANT_POINTED 9 // Constant/Pointed - #define PAN_MIDLINE_CONSTANT_SERIFED 10 // Constant/Serifed - #define PAN_MIDLINE_LOW_TRIMMED 11 // Low/Trimmed - #define PAN_MIDLINE_LOW_POINTED 12 // Low/Pointed - #define PAN_MIDLINE_LOW_SERIFED 13 // Low/Serifed - - #define PAN_XHEIGHT_CONSTANT_SMALL 2 // Constant/Small - #define PAN_XHEIGHT_CONSTANT_STD 3 // Constant/Standard - #define PAN_XHEIGHT_CONSTANT_LARGE 4 // Constant/Large - #define PAN_XHEIGHT_DUCKING_SMALL 5 // Ducking/Small - #define PAN_XHEIGHT_DUCKING_STD 6 // Ducking/Standard - #define PAN_XHEIGHT_DUCKING_LARGE 7 // Ducking/Large - - - #define ELF_VENDOR_SIZE 4 - - #define ELF_VERSION 0 - #define ELF_CULTURE_LATIN 0 - - // EnumFonts Masks - #define RASTER_FONTTYPE 1 - #define DEVICE_FONTTYPE 2 - #define TRUETYPE_FONTTYPE 4 - - //#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) - #define PALETTERGB(r,g,b) ( 33554432 + RGB(r,g,b)) - //#define PALETTEINDEX(i) ((COLORREF)( 16777216 + (DWORD)(WORD)(i))) - - // palette entry flags - - #define PC_RESERVED 1 // palette index used for animation - #define PC_EXPLICIT 2 // palette index is explicit to device - #define PC_NOCOLLAPSE 4 // do not match color to system palette - - //#define GetRValue(rgb) ((BYTE)(rgb)) - //#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8)) - //#define GetBValue(rgb) ((BYTE)((rgb)>>16)) - - // Background Modes - #define TRANSPARENT 1 - #define OPAQUE 2 - #define BKMODE_LAST 2 - - // Graphics Modes - - #define GM_COMPATIBLE 1 - #define GM_ADVANCED 2 - #define GM_LAST 2 - - // PolyDraw and GetPath point types - #define PT_CLOSEFIGURE 1 - #define PT_LINETO 2 - #define PT_BEZIERTO 4 - #define PT_MOVETO 6 - - // Mapping Modes - #define MM_TEXT 1 - #define MM_LOMETRIC 2 - #define MM_HIMETRIC 3 - #define MM_LOENGLISH 4 - #define MM_HIENGLISH 5 - #define MM_TWIPS 6 - #define MM_ISOTROPIC 7 - #define MM_ANISOTROPIC 8 - - // Min and Max Mapping Mode values - #define MM_MIN MM_TEXT - #define MM_MAX MM_ANISOTROPIC - #define MM_MAX_FIXEDSCALE MM_TWIPS - - // Coordinate Modes - #define ABSOLUTE 1 - #define RELATIVE 2 - - // Stock Logical Objects - #define WHITE_BRUSH 0 - #define LTGRAY_BRUSH 1 - #define GRAY_BRUSH 2 - #define DKGRAY_BRUSH 3 - #define BLACK_BRUSH 4 - #define NULL_BRUSH 5 - #define HOLLOW_BRUSH NULL_BRUSH - #define WHITE_PEN 6 - #define BLACK_PEN 7 - #define NULL_PEN 8 - #define OEM_FIXED_FONT 10 - #define ANSI_FIXED_FONT 11 - #define ANSI_VAR_FONT 12 - #define SYSTEM_FONT 13 - #define DEVICE_DEFAULT_FONT 14 - #define DEFAULT_PALETTE 15 - #define SYSTEM_FIXED_FONT 16 - #define DEFAULT_GUI_FONT 17 - - #define DC_BRUSH 18 - #define DC_PEN 19 - #define STOCK_LAST 17 - #define CLR_INVALID 4294967295 - - // Brush Styles - #define BS_SOLID 0 - #define BS_NULL 1 - #define BS_HOLLOW BS_NULL - #define BS_HATCHED 2 - #define BS_PATTERN 3 - #define BS_INDEXED 4 - #define BS_DIBPATTERN 5 - #define BS_DIBPATTERNPT 6 - #define BS_PATTERN8X8 7 - #define BS_DIBPATTERN8X8 8 - #define BS_MONOPATTERN 9 - - // Hatch Styles - #define HS_HORIZONTAL 0 // ----- - #define HS_VERTICAL 1 // ||||| - #define HS_FDIAGONAL 2 // \\\\\ - #define HS_BDIAGONAL 3 // ///// - #define HS_CROSS 4 // +++++ - #define HS_DIAGCROSS 5 // xxxxx - - // Pen Styles - #define PS_SOLID 0 - #define PS_DASH 1 // ------- - #define PS_DOT 2 // ....... - #define PS_DASHDOT 3 // _._._._ - #define PS_DASHDOTDOT 4 // _.._.._ - #define PS_NULL 5 - #define PS_INSIDEFRAME 6 - #define PS_USERSTYLE 7 - #define PS_ALTERNATE 8 - #define PS_STYLE_MASK 15 - - #define PS_ENDCAP_ROUND 0 - #define PS_ENDCAP_SQUARE 256 - #define PS_ENDCAP_FLAT 512 - #define PS_ENDCAP_MASK 3840 - - #define PS_JOIN_ROUND 0 - #define PS_JOIN_BEVEL 4096 - #define PS_JOIN_MITER 8192 - #define PS_JOIN_MASK 61440 - - #define PS_COSMETIC 0 - #define PS_GEOMETRIC 65536 - #define PS_TYPE_MASK 983040 - - #define AD_COUNTERCLOCKWISE 1 - #define AD_CLOCKWISE 2 - - // Device Parameters for GetDeviceCaps() - #define DRIVERVERSION 0 // Device driver version - #define TECHNOLOGY 2 // Device classification - #define HORZSIZE 4 // Horizontal size in millimeters - #define VERTSIZE 6 // Vertical size in millimeters - #define HORZRES 8 // Horizontal width in pixels - #define VERTRES 10 // Vertical height in pixels - #define BITSPIXEL 12 // Number of bits per pixel - #define PLANES 14 // Number of planes - #define NUMBRUSHES 16 // Number of brushes the device has - #define NUMPENS 18 // Number of pens the device has - #define NUMMARKERS 20 // Number of markers the device has - #define NUMFONTS 22 // Number of fonts the device has - #define NUMCOLORS 24 // Number of colors the device supports - #define PDEVICESIZE 26 // Size required for device descriptor - #define CURVECAPS 28 // Curve capabilities - #define LINECAPS 30 // Line capabilities - #define POLYGONALCAPS 32 // Polygonal capabilities - #define TEXTCAPS 34 // Text capabilities - #define CLIPCAPS 36 // Clipping capabilities - #define RASTERCAPS 38 // Bitblt capabilities - #define ASPECTX 40 // Length of the X leg - #define ASPECTY 42 // Length of the Y leg - #define ASPECTXY 44 // Length of the hypotenuse - - #define LOGPIXELSX 88 // Logical pixels/inch in X - #define LOGPIXELSY 90 // Logical pixels/inch in Y - - #define SIZEPALETTE 104 // Number of entries in physical palette - #define NUMRESERVED 106 // Number of reserved entries in palette - #define COLORRES 108 // Actual color resolution - - // Printing related DeviceCaps. These replace the appropriate Escapes - - #define PHYSICALWIDTH 110 // Physical Width in device units - #define PHYSICALHEIGHT 111 // Physical Height in device units - #define PHYSICALOFFSETX 112 // Physical Printable Area x margin - #define PHYSICALOFFSETY 113 // Physical Printable Area y margin - #define SCALINGFACTORX 114 // Scaling factor x - #define SCALINGFACTORY 115 // Scaling factor y - - // Display driver specific - - #define VREFRESH 116 // Current vertical refresh rate of the - // display device (for displays only) in Hz - #define DESKTOPVERTRES 117 // Horizontal width of entire desktop in - // pixels - #define DESKTOPHORZRES 118 // Vertical height of entire desktop in - // pixels - #define BLTALIGNMENT 119 // Preferred blt alignment - - #define SHADEBLENDCAPS 120 // Shading and blending caps - #define COLORMGMTCAPS 121 // Color Management caps - - - #ifndef NOGDICAPMASKS - - // Device Capability Masks: - - // Device Technologies - #define DT_PLOTTER 0 // Vector plotter - #define DT_RASDISPLAY 1 // Raster display - #define DT_RASPRINTER 2 // Raster printer - #define DT_RASCAMERA 3 // Raster camera - #define DT_CHARSTREAM 4 // Character-stream, PLP - #define DT_METAFILE 5 // Metafile, VDM - #define DT_DISPFILE 6 // Display-file - - // Curve Capabilities - #define CC_NONE 0 // Curves not supported - #define CC_CIRCLES 1 // Can do circles - #define CC_PIE 2 // Can do pie wedges - #define CC_CHORD 4 // Can do chord arcs - #define CC_ELLIPSES 8 // Can do ellipese - #define CC_WIDE 16 // Can do wide lines - #define CC_STYLED 32 // Can do styled lines - #define CC_WIDESTYLED 64 // Can do wide styled lines - #define CC_INTERIORS 128 // Can do interiors - #define CC_ROUNDRECT 256 // - - // Line Capabilities - #define LC_NONE 0 // Lines not supported - #define LC_POLYLINE 2 // Can do polylines - #define LC_MARKER 4 // Can do markers - #define LC_POLYMARKER 8 // Can do polymarkers - #define LC_WIDE 16 // Can do wide lines - #define LC_STYLED 32 // Can do styled lines - #define LC_WIDESTYLED 64 // Can do wide styled lines - #define LC_INTERIORS 128 // Can do interiors - - // Polygonal Capabilities - #define PC_NONE 0 // Polygonals not supported - #define PC_POLYGON 1 // Can do polygons - #define PC_RECTANGLE 2 // Can do rectangles - #define PC_WINDPOLYGON 4 // Can do winding polygons - #define PC_TRAPEZOID 4 // Can do trapezoids - #define PC_SCANLINE 8 // Can do scanlines - #define PC_WIDE 16 // Can do wide borders - #define PC_STYLED 32 // Can do styled borders - #define PC_WIDESTYLED 64 // Can do wide styled borders - #define PC_INTERIORS 128 // Can do interiors - #define PC_POLYPOLYGON 256 // Can do polypolygons - #define PC_PATHS 512 // Can do paths - - // Clipping Capabilities - #define CP_NONE 0 // No clipping of output - #define CP_RECTANGLE 1 // Output clipped to rects - #define CP_REGION 2 // obsolete - - // Text Capabilities - #define TC_OP_CHARACTER 1 // Can do OutputPrecision CHARACTER - #define TC_OP_STROKE 2 // Can do OutputPrecision STROKE - #define TC_CP_STROKE 4 // Can do ClipPrecision STROKE - #define TC_CR_90 8 // Can do CharRotAbility 90 - #define TC_CR_ANY 16 // Can do CharRotAbility ANY - #define TC_SF_X_YINDEP 32 // Can do ScaleFreedom X_YINDEPENDENT - #define TC_SA_DOUBLE 64 // Can do ScaleAbility DOUBLE - #define TC_SA_INTEGER 128 // Can do ScaleAbility INTEGER - #define TC_SA_CONTIN 256 // Can do ScaleAbility CONTINUOUS - #define TC_EA_DOUBLE 512 // Can do EmboldenAbility DOUBLE - #define TC_IA_ABLE 1024 // Can do ItalisizeAbility ABLE - #define TC_UA_ABLE 2048 // Can do UnderlineAbility ABLE - #define TC_SO_ABLE 4096 // Can do StrikeOutAbility ABLE - #define TC_RA_ABLE 8192 // Can do RasterFontAble ABLE - #define TC_VA_ABLE 16384 // Can do VectorFontAble ABLE - #define TC_RESERVED 32768 - #define TC_SCROLLBLT 65536 // Don't do text scroll with blt - - #endif // NOGDICAPMASKS - - // Raster Capabilities - #define RC_NONE - #define RC_BITBLT 1 // Can do standard BLT. - #define RC_BANDING 2 // Device requires banding support - #define RC_SCALING 4 // Device requires scaling support - #define RC_BITMAP64 8 // Device can support >64K bitmap - #define RC_GDI20_OUTPUT 16 // has 2.0 output calls - #define RC_GDI20_STATE 32 - #define RC_SAVEBITMAP 64 - #define RC_DI_BITMAP 128 // supports DIB to memory - #define RC_PALETTE 256 // supports a palette - #define RC_DIBTODEV 512 // supports DIBitsToDevice - #define RC_BIGFONT 1024 // supports >64K fonts - #define RC_STRETCHBLT 2048 // supports StretchBlt - #define RC_FLOODFILL 4096 // supports FloodFill - #define RC_STRETCHDIB 8192 // supports StretchDIBits - #define RC_OP_DX_OUTPUT 16384 - #define RC_DEVBITS 32768 - - // Shading and blending caps - #define SB_NONE 0 - #define SB_CONST_ALPHA 1 - #define SB_PIXEL_ALPHA 2 - #define SB_PREMULT_ALPHA 4 - - #define SB_GRAD_RECT 16 - #define SB_GRAD_TRI 32 - - // Color Management caps - #define CM_NONE 0 - #define CM_DEVICE_ICM 1 - #define CM_GAMMA_RAMP 2 - #define CM_CMYK_COLOR 4 - - // DIB color table identifiers - - #define DIB_RGB_COLORS 0 // color table in RGBs - #define DIB_PAL_COLORS 1 // color table in palette indices - - // constants for Get/SetSystemPaletteUse() - - #define SYSPAL_ERROR 0 - #define SYSPAL_STATIC 1 - #define SYSPAL_NOSTATIC 2 - #define SYSPAL_NOSTATIC256 3 - - // constants for CreateDIBitmap - #define CBM_INIT 4 // initialize bitmap - - // ExtFloodFill style flags - #define FLOODFILLBORDER 0 - #define FLOODFILLSURFACE 1 - - // size of a device name string - #define CCHDEVICENAME 32 - - // size of a form name string - #define CCHFORMNAME 32 - - // field selection bits - #define DM_ORIENTATION 1 - #define DM_PAPERSIZE 2 - #define DM_PAPERLENGTH 4 - #define DM_PAPERWIDTH 8 - #define DM_SCALE 16 - #define DM_POSITION 32 - #define DM_NUP 64 - #define DM_COPIES 256 - #define DM_DEFAULTSOURCE 512 - #define DM_PRINTQUALITY 1024 - #define DM_COLOR 2048 - #define DM_DUPLEX 4096 - #define DM_YRESOLUTION 8192 - #define DM_TTOPTION 16384 - #define DM_COLLATE 32768 - #define DM_FORMNAME 65536 - #define DM_LOGPIXELS 131072 - #define DM_BITSPERPEL 262144 - #define DM_PELSWIDTH 524288 - #define DM_PELSHEIGHT 1048576 - #define DM_DISPLAYFLAGS 2097152 - #define DM_DISPLAYFREQUENCY 4194304 - #define DM_ICMMETHOD 8388608 - #define DM_ICMINTENT 16777216 - #define DM_MEDIATYPE 33554432 - #define DM_DITHERTYPE 67108864 - #define DM_PANNINGWIDTH 134217728 - #define DM_PANNINGHEIGHT 268435456 - - // orientation selections - #define DMORIENT_PORTRAIT 1 - #define DMORIENT_LANDSCAPE 2 - - // paper selections - #define DMPAPER_FIRST DMPAPER_LETTER - #define DMPAPER_LETTER 1 // Letter 8 1/2 x 11 in - #define DMPAPER_LETTERSMALL 2 // Letter Small 8 1/2 x 11 in - #define DMPAPER_TABLOID 3 // Tabloid 11 x 17 in - #define DMPAPER_LEDGER 4 // Ledger 17 x 11 in - #define DMPAPER_LEGAL 5 // Legal 8 1/2 x 14 in - #define DMPAPER_STATEMENT 6 // Statement 5 1/2 x 8 1/2 in - #define DMPAPER_EXECUTIVE 7 // Executive 7 1/4 x 10 1/2 in - #define DMPAPER_A3 8 // A3 297 x 420 mm - #define DMPAPER_A4 9 // A4 210 x 297 mm - #define DMPAPER_A4SMALL 10 // A4 Small 210 x 297 mm - #define DMPAPER_A5 11 // A5 148 x 210 mm - #define DMPAPER_B4 12 // B4 (JIS) 250 x 354 - #define DMPAPER_B5 13 // B5 (JIS) 182 x 257 mm - #define DMPAPER_FOLIO 14 // Folio 8 1/2 x 13 in - #define DMPAPER_QUARTO 15 // Quarto 215 x 275 mm - #define DMPAPER_10X14 16 // 10x14 in - #define DMPAPER_11X17 17 // 11x17 in - #define DMPAPER_NOTE 18 // Note 8 1/2 x 11 in - #define DMPAPER_ENV_9 19 // Envelope #9 3 7/8 x 8 7/8 - #define DMPAPER_ENV_10 20 // Envelope #10 4 1/8 x 9 1/2 - #define DMPAPER_ENV_11 21 // Envelope #11 4 1/2 x 10 3/8 - #define DMPAPER_ENV_12 22 // Envelope #12 4 \276 x 11 - #define DMPAPER_ENV_14 23 // Envelope #14 5 x 11 1/2 - #define DMPAPER_CSHEET 24 // C size sheet - #define DMPAPER_DSHEET 25 // D size sheet - #define DMPAPER_ESHEET 26 // E size sheet - #define DMPAPER_ENV_DL 27 // Envelope DL 110 x 220mm - #define DMPAPER_ENV_C5 28 // Envelope C5 162 x 229 mm - #define DMPAPER_ENV_C3 29 // Envelope C3 324 x 458 mm - #define DMPAPER_ENV_C4 30 // Envelope C4 229 x 324 mm - #define DMPAPER_ENV_C6 31 // Envelope C6 114 x 162 mm - #define DMPAPER_ENV_C65 32 // Envelope C65 114 x 229 mm - #define DMPAPER_ENV_B4 33 // Envelope B4 250 x 353 mm - #define DMPAPER_ENV_B5 34 // Envelope B5 176 x 250 mm - #define DMPAPER_ENV_B6 35 // Envelope B6 176 x 125 mm - #define DMPAPER_ENV_ITALY 36 // Envelope 110 x 230 mm - #define DMPAPER_ENV_MONARCH 37 // Envelope Monarch 3.875 x 7.5 in - #define DMPAPER_ENV_PERSONAL 38 // 6 3/4 Envelope 3 5/8 x 6 1/2 in - #define DMPAPER_FANFOLD_US 39 // US Std Fanfold 14 7/8 x 11 in - #define DMPAPER_FANFOLD_STD_GERMAN 40 // German Std Fanfold 8 1/2 x 12 in - #define DMPAPER_FANFOLD_LGL_GERMAN 41 // German Legal Fanfold 8 1/2 x 13 in - #define DMPAPER_ISO_B4 42 // B4 (ISO) 250 x 353 mm - #define DMPAPER_JAPANESE_POSTCARD 43 // Japanese Postcard 100 x 148 mm - #define DMPAPER_9X11 44 // 9 x 11 in - #define DMPAPER_10X11 45 // 10 x 11 in - #define DMPAPER_15X11 46 // 15 x 11 in - #define DMPAPER_ENV_INVITE 47 // Envelope Invite 220 x 220 mm - #define DMPAPER_RESERVED_48 48 // RESERVED--DO NOT USE - #define DMPAPER_RESERVED_49 49 // RESERVED--DO NOT USE - #define DMPAPER_LETTER_EXTRA 50 // Letter Extra 9 \275 x 12 in - #define DMPAPER_LEGAL_EXTRA 51 // Legal Extra 9 \275 x 15 in - #define DMPAPER_TABLOID_EXTRA 52 // Tabloid Extra 11.69 x 18 in - #define DMPAPER_A4_EXTRA 53 // A4 Extra 9.27 x 12.69 in - #define DMPAPER_LETTER_TRANSVERSE 54 // Letter Transverse 8 \275 x 11 in - #define DMPAPER_A4_TRANSVERSE 55 // A4 Transverse 210 x 297 mm - #define DMPAPER_LETTER_EXTRA_TRANSVERSE 56 // Letter Extra Transverse 9\275 x 12 in - #define DMPAPER_A_PLUS 57 // SuperA/SuperA/A4 227 x 356 mm - #define DMPAPER_B_PLUS 58 // SuperB/SuperB/A3 305 x 487 mm - #define DMPAPER_LETTER_PLUS 59 // Letter Plus 8.5 x 12.69 in - #define DMPAPER_A4_PLUS 60 // A4 Plus 210 x 330 mm - #define DMPAPER_A5_TRANSVERSE 61 // A5 Transverse 148 x 210 mm - #define DMPAPER_B5_TRANSVERSE 62 // B5 (JIS) Transverse 182 x 257 mm - #define DMPAPER_A3_EXTRA 63 // A3 Extra 322 x 445 mm - #define DMPAPER_A5_EXTRA 64 // A5 Extra 174 x 235 mm - #define DMPAPER_B5_EXTRA 65 // B5 (ISO) Extra 201 x 276 mm - #define DMPAPER_A2 66 // A2 420 x 594 mm - #define DMPAPER_A3_TRANSVERSE 67 // A3 Transverse 297 x 420 mm - #define DMPAPER_A3_EXTRA_TRANSVERSE 68 // A3 Extra Transverse 322 x 445 mm - #define DMPAPER_DBL_JAPANESE_POSTCARD 69 // Japanese Double Postcard 200 x 148 mm - #define DMPAPER_A6 70 // A6 105 x 148 mm - #define DMPAPER_JENV_KAKU2 71 // Japanese Envelope Kaku #2 - #define DMPAPER_JENV_KAKU3 72 // Japanese Envelope Kaku #3 - #define DMPAPER_JENV_CHOU3 73 // Japanese Envelope Chou #3 - #define DMPAPER_JENV_CHOU4 74 // Japanese Envelope Chou #4 - #define DMPAPER_LETTER_ROTATED 75 // Letter Rotated 11 x 8 1/2 11 in - #define DMPAPER_A3_ROTATED 76 // A3 Rotated 420 x 297 mm - #define DMPAPER_A4_ROTATED 77 // A4 Rotated 297 x 210 mm - #define DMPAPER_A5_ROTATED 78 // A5 Rotated 210 x 148 mm - #define DMPAPER_B4_JIS_ROTATED 79 // B4 (JIS) Rotated 364 x 257 mm - #define DMPAPER_B5_JIS_ROTATED 80 // B5 (JIS) Rotated 257 x 182 mm - #define DMPAPER_JAPANESE_POSTCARD_ROTATED 81 // Japanese Postcard Rotated 148 x 100 mm - #define DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED 82 // Double Japanese Postcard Rotated 148 x 200 mm - #define DMPAPER_A6_ROTATED 83 // A6 Rotated 148 x 105 mm - #define DMPAPER_JENV_KAKU2_ROTATED 84 // Japanese Envelope Kaku #2 Rotated - #define DMPAPER_JENV_KAKU3_ROTATED 85 // Japanese Envelope Kaku #3 Rotated - #define DMPAPER_JENV_CHOU3_ROTATED 86 // Japanese Envelope Chou #3 Rotated - #define DMPAPER_JENV_CHOU4_ROTATED 87 // Japanese Envelope Chou #4 Rotated - #define DMPAPER_B6_JIS 88 // B6 (JIS) 128 x 182 mm - #define DMPAPER_B6_JIS_ROTATED 89 // B6 (JIS) Rotated 182 x 128 mm - #define DMPAPER_12X11 90 // 12 x 11 in - #define DMPAPER_JENV_YOU4 91 // Japanese Envelope You #4 - #define DMPAPER_JENV_YOU4_ROTATED 92 // Japanese Envelope You #4 Rotated - #define DMPAPER_P16K 93 // PRC 16K 146 x 215 mm - #define DMPAPER_P32K 94 // PRC 32K 97 x 151 mm - #define DMPAPER_P32KBIG 95 // PRC 32K(Big) 97 x 151 mm - #define DMPAPER_PENV_1 96 // PRC Envelope #1 102 x 165 mm - #define DMPAPER_PENV_2 97 // PRC Envelope #2 102 x 176 mm - #define DMPAPER_PENV_3 98 // PRC Envelope #3 125 x 176 mm - #define DMPAPER_PENV_4 99 // PRC Envelope #4 110 x 208 mm - #define DMPAPER_PENV_5 100 // PRC Envelope #5 110 x 220 mm - #define DMPAPER_PENV_6 101 // PRC Envelope #6 120 x 230 mm - #define DMPAPER_PENV_7 102 // PRC Envelope #7 160 x 230 mm - #define DMPAPER_PENV_8 103 // PRC Envelope #8 120 x 309 mm - #define DMPAPER_PENV_9 104 // PRC Envelope #9 229 x 324 mm - #define DMPAPER_PENV_10 105 // PRC Envelope #10 324 x 458 mm - #define DMPAPER_P16K_ROTATED 106 // PRC 16K Rotated - #define DMPAPER_P32K_ROTATED 107 // PRC 32K Rotated - #define DMPAPER_P32KBIG_ROTATED 108 // PRC 32K(Big) Rotated - #define DMPAPER_PENV_1_ROTATED 109 // PRC Envelope #1 Rotated 165 x 102 mm - #define DMPAPER_PENV_2_ROTATED 110 // PRC Envelope #2 Rotated 176 x 102 mm - #define DMPAPER_PENV_3_ROTATED 111 // PRC Envelope #3 Rotated 176 x 125 mm - #define DMPAPER_PENV_4_ROTATED 112 // PRC Envelope #4 Rotated 208 x 110 mm - #define DMPAPER_PENV_5_ROTATED 113 // PRC Envelope #5 Rotated 220 x 110 mm - #define DMPAPER_PENV_6_ROTATED 114 // PRC Envelope #6 Rotated 230 x 120 mm - #define DMPAPER_PENV_7_ROTATED 115 // PRC Envelope #7 Rotated 230 x 160 mm - #define DMPAPER_PENV_8_ROTATED 116 // PRC Envelope #8 Rotated 309 x 120 mm - #define DMPAPER_PENV_9_ROTATED 117 // PRC Envelope #9 Rotated 324 x 229 mm - #define DMPAPER_PENV_10_ROTATED 118 // PRC Envelope #10 Rotated 458 x 324 mm - - #define DMPAPER_LAST DMPAPER_PENV_10_ROTATED - - #define DMPAPER_USER 256 - - // bin selections - #define DMBIN_FIRST DMBIN_UPPER - #define DMBIN_UPPER 1 - #define DMBIN_ONLYONE 1 - #define DMBIN_LOWER 2 - #define DMBIN_MIDDLE 3 - #define DMBIN_MANUAL 4 - #define DMBIN_ENVELOPE 5 - #define DMBIN_ENVMANUAL 6 - #define DMBIN_AUTO 7 - #define DMBIN_TRACTOR 8 - #define DMBIN_SMALLFMT 9 - #define DMBIN_LARGEFMT 10 - #define DMBIN_LARGECAPACITY 11 - #define DMBIN_CASSETTE 14 - #define DMBIN_FORMSOURCE 15 - #define DMBIN_LAST DMBIN_FORMSOURCE - - #define DMBIN_USER 256 // device specific bins start here - - // print qualities - #define DMRES_DRAFT (-1) - #define DMRES_LOW (-2) - #define DMRES_MEDIUM (-3) - #define DMRES_HIGH (-4) - - // color enable/disable for color printers - #define DMCOLOR_MONOCHROME 1 - #define DMCOLOR_COLOR 2 - - // duplex enable - #define DMDUP_SIMPLEX 1 - #define DMDUP_VERTICAL 2 - #define DMDUP_HORIZONTAL 3 - - // TrueType options - #define DMTT_BITMAP 1 // print TT fonts as graphics - #define DMTT_DOWNLOAD 2 // download TT fonts as soft fonts - #define DMTT_SUBDEV 3 // substitute device fonts for TT fonts - #define DMTT_DOWNLOAD_OUTLINE 4 // download TT fonts as outline soft fonts - - // Collation selections - #define DMCOLLATE_FALSE 0 - #define DMCOLLATE_TRUE 1 - - // DEVMODE dmDisplayFlags flags - - #define DM_GRAYSCALE 0x00000001 /* This flag is no longer valid */ - #define DM_INTERLACED 0x00000002 /* This flag is no longer valid */ - #define DMDISPLAYFLAGS_TEXTMODE 4 - - // dmNup , multiple logical page per physical page options - #define DMNUP_SYSTEM 1 - #define DMNUP_ONEUP 2 - - // ICM methods - #define DMICMMETHOD_NONE 1 // ICM disabled - #define DMICMMETHOD_SYSTEM 2 // ICM handled by system - #define DMICMMETHOD_DRIVER 3 // ICM handled by driver - #define DMICMMETHOD_DEVICE 4 // ICM handled by device - - #define DMICMMETHOD_USER 256 // Device-specific methods start here - - // ICM Intents - #define DMICM_SATURATE 1 // Maximize color saturation - #define DMICM_CONTRAST 2 // Maximize color contrast - #define DMICM_COLORIMETRIC 3 // Use specific color metric - #define DMICM_ABS_COLORIMETRIC 4 // Use specific color metric - - #define DMICM_USER 256 // Device-specific intents start here - - // Media types - - #define DMMEDIA_STANDARD 1 // Standard paper - #define DMMEDIA_TRANSPARENCY 2 // Transparency - #define DMMEDIA_GLOSSY 3 // Glossy paper - - #define DMMEDIA_USER 256 // Device-specific media start here - - // Dither types - #define DMDITHER_NONE 1 // No dithering - #define DMDITHER_COARSE 2 // Dither with a coarse brush - #define DMDITHER_FINE 3 // Dither with a fine brush - #define DMDITHER_LINEART 4 // LineArt dithering - #define DMDITHER_ERRORDIFFUSION 5 // LineArt dithering - #define DMDITHER_RESERVED6 6 // LineArt dithering - #define DMDITHER_RESERVED7 7 // LineArt dithering - #define DMDITHER_RESERVED8 8 // LineArt dithering - #define DMDITHER_RESERVED9 9 // LineArt dithering - #define DMDITHER_GRAYSCALE 10 // Device does grayscaling - - #define DMDITHER_USER 256 // Device-specific dithers start here - - #define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 1 - #define DISPLAY_DEVICE_MULTI_DRIVER 2 - #define DISPLAY_DEVICE_PRIMARY_DEVICE 4 - #define DISPLAY_DEVICE_MIRRORING_DRIVER 8 - #define DISPLAY_DEVICE_VGA_COMPATIBLE 16 - #define DISPLAY_DEVICE_MODESPRUNED 134217728 - - // GetRegionData/ExtCreateRegion - - #define RDH_RECTANGLES 1 - - // for GetRandomRgn - #define SYSRGN 4 - - #ifndef NOTEXTMETRIC - - // GetGlyphOutline constants - - #define GGO_METRICS 0 - #define GGO_BITMAP 1 - #define GGO_NATIVE 2 - #define GGO_BEZIER 3 - - #define GGO_GRAY2_BITMAP 4 - #define GGO_GRAY4_BITMAP 5 - #define GGO_GRAY8_BITMAP 6 - #define GGO_GLYPH_INDEX 128 - #define GGO_UNHINTED 256 - #define TT_POLYGON_TYPE 24 - - #define TT_PRIM_LINE 1 - #define TT_PRIM_QSPLINE 2 - #define TT_PRIM_CSPLINE 3 - - - #define GCP_DBCS 1 - #define GCP_REORDER 2 - #define GCP_USEKERNING 8 - #define GCP_GLYPHSHAPE 16 - #define GCP_LIGATE 32 - ////#define GCP_GLYPHINDEXING 0x0080 - #define GCP_DIACRITIC 256 - #define GCP_KASHIDA 1024 - #define GCP_ERROR 32768 - #define FLI_MASK 4155 - - #define GCP_JUSTIFY 65536 - ////#define GCP_NODIACRITICS 0x00020000L - #define FLI_GLYPHS 262144 - #define GCP_CLASSIN 524288 - #define GCP_MAXEXTENT 1048576 - #define GCP_JUSTIFYIN 2097152 - #define GCP_DISPLAYZWG 4194304 - #define GCP_SYMSWAPOFF 8388608 - #define GCP_NUMERICOVERRIDE 16777216 - #define GCP_NEUTRALOVERRIDE 33554432 - #define GCP_NUMERICSLATIN 67108864 - #define GCP_NUMERICSLOCAL 134217728 - - #define GCPCLASS_LATIN 1 - #define GCPCLASS_HEBREW 2 - #define GCPCLASS_ARABIC 2 - #define GCPCLASS_NEUTRAL 3 - #define GCPCLASS_LOCALNUMBER 4 - #define GCPCLASS_LATINNUMBER 5 - #define GCPCLASS_LATINNUMERICTERMINATOR 6 - #define GCPCLASS_LATINNUMERICSEPARATOR 7 - #define GCPCLASS_NUMERICSEPARATOR 8 - #define GCPCLASS_PREBOUNDLTR 128 - #define GCPCLASS_PREBOUNDRTL 64 - #define GCPCLASS_POSTBOUNDLTR 32 - #define GCPCLASS_POSTBOUNDRTL 16 - - #define GCPGLYPH_LINKBEFORE 32768 - #define GCPGLYPH_LINKAFTER 16384 - - // bits defined in wFlags of RASTERIZER_STATUS - #define TT_AVAILABLE 1 - #define TT_ENABLED 2 - - // Pixel format descriptor - - - // pixel types - #define PFD_TYPE_RGBA 0 - #define PFD_TYPE_COLORINDEX 1 - - // layer types - #define PFD_MAIN_PLANE 0 - #define PFD_OVERLAY_PLANE 1 - #define PFD_UNDERLAY_PLANE (-1) - - // PIXELFORMATDESCRIPTOR flags - #define PFD_DOUBLEBUFFER 1 - #define PFD_STEREO 2 - #define PFD_DRAW_TO_WINDOW 4 - #define PFD_DRAW_TO_BITMAP 8 - #define PFD_SUPPORT_GDI 16 - #define PFD_SUPPORT_OPENGL 32 - #define PFD_GENERIC_FORMAT 64 - #define PFD_NEED_PALETTE 128 - #define PFD_NEED_SYSTEM_PALETTE 256 - #define PFD_SWAP_EXCHANGE 512 - #define PFD_SWAP_COPY 1024 - #define PFD_SWAP_LAYER_BUFFERS 2048 - #define PFD_GENERIC_ACCELERATED 4096 - #define PFD_SUPPORT_DIRECTDRAW 8192 - - // PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only - #define PFD_DEPTH_DONTCARE 536870912 - #define PFD_DOUBLEBUFFER_DONTCARE 1073741824 - #define PFD_STEREO_DONTCARE 2147483648 - - #ifdef STRICT - - #ifndef NOTEXTMETRIC - - // mode selections for the device mode function - #define DM_UPDATE 1 - #define DM_COPY 2 - #define DM_PROMPT 4 - #define DM_MODIFY 8 - - #define DM_IN_BUFFER DM_MODIFY - #define DM_IN_PROMPT DM_PROMPT - #define DM_OUT_BUFFER DM_COPY - #define DM_OUT_DEFAULT DM_UPDATE - - // device capabilities indices - #define DC_FIELDS 1 - #define DC_PAPERS 2 - #define DC_PAPERSIZE 3 - #define DC_MINEXTENT 4 - #define DC_MAXEXTENT 5 - #define DC_BINS 6 - #define DC_DUPLEX 7 - #define DC_SIZE 8 - #define DC_EXTRA 9 - #define DC_VERSION 10 - #define DC_DRIVER 11 - #define DC_BINNAMES 12 - #define DC_ENUMRESOLUTIONS 13 - #define DC_FILEDEPENDENCIES 14 - #define DC_TRUETYPE 15 - #define DC_PAPERNAMES 16 - #define DC_ORIENTATION 17 - #define DC_COPIES 18 - #define DC_BINADJUST 19 - #define DC_EMF_COMPLIANT 20 - #define DC_DATATYPE_PRODUCED 21 - #define DC_COLLATE 22 - #define DC_MANUFACTURER 23 - #define DC_MODEL 24 - #define DC_PERSONALITY 25 - #define DC_PRINTRATE 26 - #define DC_PRINTRATEUNIT 27 - #define PRINTRATEUNIT_PPM 1 - #define PRINTRATEUNIT_CPS 2 - #define PRINTRATEUNIT_LPM 3 - #define PRINTRATEUNIT_IPM 4 - #define DC_PRINTERMEM 28 - #define DC_MEDIAREADY 29 - #define DC_STAPLE 30 - #define DC_PRINTRATEPPM 31 - #define DC_COLORDEVICE 32 - #define DC_NUP 33 - // bit fields of the return value (DWORD) for DC_TRUETYPE - #define DCTT_BITMAP 1 - #define DCTT_DOWNLOAD 2 - #define DCTT_SUBDEV 4 - #define DCTT_DOWNLOAD_OUTLINE 8 - - // return values for DC_BINADJUST - #define DCBA_FACEUPNONE 0 - #define DCBA_FACEUPCENTER 1 - #define DCBA_FACEUPLEFT 2 - #define DCBA_FACEUPRIGHT 3 - #define DCBA_FACEDOWNNONE 256 - #define DCBA_FACEDOWNCENTER 257 - #define DCBA_FACEDOWNLEFT 258 - #define DCBA_FACEDOWNRIGHT 259 - #define GS_8BIT_INDICES 1 - - // flags for GetGlyphIndices - - #define GGI_MARK_NONEXISTING_GLYPHS 0X0001 - - //#define STAMP_DESIGNVECTOR (134217728 + 'd' + ('v' << 8)) - //#define STAMP_AXESLIST (134217728 + 'a' + ('l' << 8)) - #define MM_MAX_NUMAXES 16 - - #define FR_PRIVATE 16 - #define FR_NOT_ENUM 32 - - // The actual size of the DESIGNVECTOR and ENUMLOGFONTEXDV structures - // is determined by dvNumAxes, - // MM_MAX_NUMAXES only detemines the maximal size allowed - - #define AC_SRC_OVER 0 - - // - // alpha format flags - // - - #define AC_SRC_ALPHA 1 - - - // - // gradient drawing modes - // - - #define GRADIENT_FILL_RECT_H 0 - #define GRADIENT_FILL_RECT_V 1 - #define GRADIENT_FILL_TRIANGLE 2 - #define GRADIENT_FILL_OP_FLAG 255 - - #ifndef NOMETAFILE - - // Enhanced Metafile Function Declarations - - // new GDI - - - // Flags value for COLORADJUSTMENT - #define CA_NEGATIVE 1 - #define CA_LOG_FILTER 2 - - // IlluminantIndex values - #define ILLUMINANT_DEVICE_DEFAULT 0 - #define ILLUMINANT_A 1 - #define ILLUMINANT_B 2 - #define ILLUMINANT_C 3 - #define ILLUMINANT_D50 4 - #define ILLUMINANT_D55 5 - #define ILLUMINANT_D65 6 - #define ILLUMINANT_D75 7 - #define ILLUMINANT_F2 8 - #define ILLUMINANT_MAX_INDEX ILLUMINANT_F2 - - #define ILLUMINANT_TUNGSTEN ILLUMINANT_A - #define ILLUMINANT_DAYLIGHT ILLUMINANT_C - #define ILLUMINANT_FLUORESCENT ILLUMINANT_F2 - #define ILLUMINANT_NTSC ILLUMINANT_C - - // Min and max for RedGamma, GreenGamma, BlueGamma - #define RGB_GAMMA_MIN 02500 - #define RGB_GAMMA_MAX 65000 - - // Min and max for ReferenceBlack and ReferenceWhite - #define REFERENCE_WHITE_MIN 6000 - #define REFERENCE_WHITE_MAX 10000 - #define REFERENCE_BLACK_MIN 0 - #define REFERENCE_BLACK_MAX 4000 - - // Min and max for Contrast, Brightness, Colorfulness, RedGreenTint - #define COLOR_ADJ_MIN -100 - #define COLOR_ADJ_MAX 100 - - #define DI_APPBANDING 1 - #define DI_ROPS_READ_DESTINATION 2 - - #define FONTMAPPER_MAX 10 - - #define ICM_OFF 1 - #define ICM_ON 2 - #define ICM_QUERY 3 - #define ICM_DONE_OUTSIDEDC 4 - - - #define ICMENUMPROC ICMENUMPROCA - - // Enhanced metafile constants. - - #define ENHMETA_SIGNATURE 541412678 - - // Stock object flag used in the object handle index in the enhanced - // metafile records. - // E.g. The object handle index (META_STOCK_OBJECT | BLACK_BRUSH) - // represents the stock object BLACK_BRUSH. - - #define ENHMETA_STOCK_OBJECT 2147483648 - - // Enhanced metafile record types. - - #define EMR_HEADER 1 - #define EMR_POLYBEZIER 2 - #define EMR_POLYGON 3 - #define EMR_POLYLINE 4 - #define EMR_POLYBEZIERTO 5 - #define EMR_POLYLINETO 6 - #define EMR_POLYPOLYLINE 7 - #define EMR_POLYPOLYGON 8 - #define EMR_SETWINDOWEXTEX 9 - #define EMR_SETWINDOWORGEX 10 - #define EMR_SETVIEWPORTEXTEX 11 - #define EMR_SETVIEWPORTORGEX 12 - #define EMR_SETBRUSHORGEX 13 - #define EMR_EOF 14 - #define EMR_SETPIXELV 15 - #define EMR_SETMAPPERFLAGS 16 - #define EMR_SETMAPMODE 17 - #define EMR_SETBKMODE 18 - #define EMR_SETPOLYFILLMODE 19 - #define EMR_SETROP2 20 - #define EMR_SETSTRETCHBLTMODE 21 - #define EMR_SETTEXTALIGN 22 - #define EMR_SETCOLORADJUSTMENT 23 - #define EMR_SETTEXTCOLOR 24 - #define EMR_SETBKCOLOR 25 - #define EMR_OFFSETCLIPRGN 26 - #define EMR_MOVETOEX 27 - #define EMR_SETMETARGN 28 - #define EMR_EXCLUDECLIPRECT 29 - #define EMR_INTERSECTCLIPRECT 30 - #define EMR_SCALEVIEWPORTEXTEX 31 - #define EMR_SCALEWINDOWEXTEX 32 - #define EMR_SAVEDC 33 - #define EMR_RESTOREDC 34 - #define EMR_SETWORLDTRANSFORM 35 - #define EMR_MODIFYWORLDTRANSFORM 36 - #define EMR_SELECTOBJECT 37 - #define EMR_CREATEPEN 38 - #define EMR_CREATEBRUSHINDIRECT 39 - #define EMR_DELETEOBJECT 40 - #define EMR_ANGLEARC 41 - #define EMR_ELLIPSE 42 - #define EMR_RECTANGLE 43 - #define EMR_ROUNDRECT 44 - #define EMR_ARC 45 - #define EMR_CHORD 46 - #define EMR_PIE 47 - #define EMR_SELECTPALETTE 48 - #define EMR_CREATEPALETTE 49 - #define EMR_SETPALETTEENTRIES 50 - #define EMR_RESIZEPALETTE 51 - #define EMR_REALIZEPALETTE 52 - #define EMR_EXTFLOODFILL 53 - #define EMR_LINETO 54 - #define EMR_ARCTO 55 - #define EMR_POLYDRAW 56 - #define EMR_SETARCDIRECTION 57 - #define EMR_SETMITERLIMIT 58 - #define EMR_BEGINPATH 59 - #define EMR_ENDPATH 60 - #define EMR_CLOSEFIGURE 61 - #define EMR_FILLPATH 62 - #define EMR_STROKEANDFILLPATH 63 - #define EMR_STROKEPATH 64 - #define EMR_FLATTENPATH 65 - #define EMR_WIDENPATH 66 - #define EMR_SELECTCLIPPATH 67 - #define EMR_ABORTPATH 68 - - #define EMR_GDICOMMENT 70 - #define EMR_FILLRGN 71 - #define EMR_FRAMERGN 72 - #define EMR_INVERTRGN 73 - #define EMR_PAINTRGN 74 - #define EMR_EXTSELECTCLIPRGN 75 - #define EMR_BITBLT 76 - #define EMR_STRETCHBLT 77 - #define EMR_MASKBLT 78 - #define EMR_PLGBLT 79 - #define EMR_SETDIBITSTODEVICE 80 - #define EMR_STRETCHDIBITS 81 - #define EMR_EXTCREATEFONTINDIRECTW 82 - #define EMR_EXTTEXTOUTA 83 - #define EMR_EXTTEXTOUTW 84 - #define EMR_POLYBEZIER16 85 - #define EMR_POLYGON16 86 - #define EMR_POLYLINE16 87 - #define EMR_POLYBEZIERTO16 88 - #define EMR_POLYLINETO16 89 - #define EMR_POLYPOLYLINE16 90 - #define EMR_POLYPOLYGON16 91 - #define EMR_POLYDRAW16 92 - #define EMR_CREATEMONOBRUSH 93 - #define EMR_CREATEDIBPATTERNBRUSHPT 94 - #define EMR_EXTCREATEPEN 95 - #define EMR_POLYTEXTOUTA 96 - #define EMR_POLYTEXTOUTW 97 - - #define EMR_SETICMMODE 98 - #define EMR_CREATECOLORSPACE 99 - #define EMR_SETCOLORSPACE 100 - #define EMR_DELETECOLORSPACE 101 - #define EMR_GLSRECORD 102 - #define EMR_GLSBOUNDEDRECORD 103 - #define EMR_PIXELFORMAT 104 - #define EMR_RESERVED_105 105 - #define EMR_RESERVED_106 106 - #define EMR_RESERVED_107 107 - #define EMR_RESERVED_108 108 - #define EMR_RESERVED_109 109 - #define EMR_RESERVED_110 110 - #define EMR_COLORCORRECTPALETTE 111 - #define EMR_SETICMPROFILEA 112 - #define EMR_SETICMPROFILEW 113 - #define EMR_ALPHABLEND 114 - #define EMR_SETLAYOUT 115 - #define EMR_TRANSPARENTBLT 116 - #define EMR_GRADIENTFILL 118 - #define EMR_RESERVED_119 119 - #define EMR_RESERVED_120 120 - #define EMR_COLORMATCHTOTARGETW 121 - #define EMR_CREATECOLORSPACEW 122 - - // Record structures for the enhanced metafile. - - - #define SETICMPROFILE_EMBEDED 1 - - #define CREATECOLORSPACE_EMBEDED 1 - - - #define COLORMATCHTOTARGET_EMBEDED 1 - - #define GDICOMMENT_IDENTIFIER 1128875079 - #define GDICOMMENT_WINDOWS_METAFILE 2147483649 - #define GDICOMMENT_BEGINGROUP 2 - #define GDICOMMENT_ENDGROUP 3 - #define GDICOMMENT_MULTIFORMATS 1073741828 - #define EPS_SIGNATURE 1179865157 - #define GDICOMMENT_UNICODE_STRING 64 - #define GDICOMMENT_UNICODE_END 128 - - - // OpenGL wgl prototypes - - #define wglUseFontBitmaps wglUseFontBitmapsA - - #define WGL_FONT_LINES 0 - #define WGL_FONT_POLYGONS 1 - - - #define wglUseFontOutlines wglUseFontOutlinesA - - - // LAYERPLANEDESCRIPTOR flags - #define LPD_DOUBLEBUFFER 1 - #define LPD_STEREO 2 - #define LPD_SUPPORT_GDI 16 - #define LPD_SUPPORT_OPENGL 32 - #define LPD_SHARE_DEPTH 64 - #define LPD_SHARE_STENCIL 128 - #define LPD_SHARE_ACCUM 256 - #define LPD_SWAP_EXCHANGE 512 - #define LPD_SWAP_COPY 1024 - #define LPD_TRANSPARENT 4096 - - #define LPD_TYPE_RGBA 0 - #define LPD_TYPE_COLORINDEX 1 - - // wglSwapLayerBuffers flags - #define WGL_SWAP_MAIN_PLANE 1 - #define WGL_SWAP_OVERLAY1 2 - #define WGL_SWAP_OVERLAY2 4 - #define WGL_SWAP_OVERLAY3 8 - #define WGL_SWAP_OVERLAY4 16 - #define WGL_SWAP_OVERLAY5 32 - #define WGL_SWAP_OVERLAY6 64 - #define WGL_SWAP_OVERLAY7 128 - #define WGL_SWAP_OVERLAY8 256 - #define WGL_SWAP_OVERLAY9 512 - #define WGL_SWAP_OVERLAY10 1024 - #define WGL_SWAP_OVERLAY11 2048 - #define WGL_SWAP_OVERLAY12 4096 - #define WGL_SWAP_OVERLAY13 8192 - #define WGL_SWAP_OVERLAY14 16384 - #define WGL_SWAP_OVERLAY15 32768 - #define WGL_SWAP_UNDERLAY1 65536 - #define WGL_SWAP_UNDERLAY2 131072 - #define WGL_SWAP_UNDERLAY3 262144 - #define WGL_SWAP_UNDERLAY4 524288 - #define WGL_SWAP_UNDERLAY5 1048576 - #define WGL_SWAP_UNDERLAY6 2097152 - #define WGL_SWAP_UNDERLAY7 4194304 - #define WGL_SWAP_UNDERLAY8 8388608 - #define WGL_SWAP_UNDERLAY9 16777216 - #define WGL_SWAP_UNDERLAY10 33554432 - #define WGL_SWAP_UNDERLAY11 67108864 - #define WGL_SWAP_UNDERLAY12 134217728 - #define WGL_SWAP_UNDERLAY13 268435456 - #define WGL_SWAP_UNDERLAY14 536870912 - #define WGL_SWAP_UNDERLAY15 1073741824 - - #endif - - // flags for DrawFrameControl - /* - #define DFC_CAPTION 1 - #define DFC_MENU 2 - #define DFC_SCROLL 3 - #define DFC_BUTTON 4 - #define DFC_POPUPMENU 5 - - #define DFCS_CAPTIONCLOSE 0 - #define DFCS_CAPTIONMIN 1 - #define DFCS_CAPTIONMAX 2 - #define DFCS_CAPTIONRESTORE 3 - #define DFCS_CAPTIONHELP 4 - - #define DFCS_MENUARROW 0 - #define DFCS_MENUCHECK 1 - #define DFCS_MENUBULLET 2 - #define DFCS_MENUARROWRIGHT 4 - #define DFCS_SCROLLUP 0 - #define DFCS_SCROLLDOWN 1 - #define DFCS_SCROLLLEFT 2 - #define DFCS_SCROLLRIGHT 3 - #define DFCS_SCROLLCOMBOBOX 5 - #define DFCS_SCROLLSIZEGRIP 8 - #define DFCS_SCROLLSIZEGRIPRIGHT 16 - - #define DFCS_BUTTONCHECK 0 - #define DFCS_BUTTONRADIOIMAGE 1 - #define DFCS_BUTTONRADIOMASK 2 - #define DFCS_BUTTONRADIO 4 - #define DFCS_BUTTON3STATE 8 - #define DFCS_BUTTONPUSH 16 - - #define DFCS_INACTIVE 256 - #define DFCS_PUSHED 512 - #define DFCS_CHECKED 1024 - - #define DFCS_TRANSPARENT 2048 - #define DFCS_HOT 4096 - - #define DFCS_ADJUSTRECT 8192 - #define DFCS_FLAT 16384 - #define DFCS_MONO 32768 - - // flags for DrawCaption - #define DC_ACTIVE 1 - #define DC_SMALLCAP 2 - #define DC_ICON 4 - #define DC_TEXT 8 - #define DC_INBUTTON 16 - #define DC_GRADIENT 32 - - #define IDANI_OPEN 1 - - */ - - #endif - #endif - #endif - #endif - #endif // NOGDI -#endif // _WINGDI_ diff --git a/harbour-1.0.0RC1/contrib/hbwhat32/wininet.ch b/harbour-1.0.0RC1/contrib/hbwhat32/wininet.ch index fde29c5e5a..d2de43711a 100644 --- a/harbour-1.0.0RC1/contrib/hbwhat32/wininet.ch +++ b/harbour-1.0.0RC1/contrib/hbwhat32/wininet.ch @@ -2,1081 +2,459 @@ * $Id$ */ -// -// Internet APIs -// - -// -// manifests -// - -#define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default - -#define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers -#define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher " -#define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP " -#define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS " -#define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers. - - -// -// maximum field lengths (arbitrary) -// - -#define INTERNET_MAX_HOST_NAME_LENGTH 256 -#define INTERNET_MAX_USER_NAME_LENGTH 128 -#define INTERNET_MAX_PASSWORD_LENGTH 128 -#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 // INTERNET_PORT is unsigned short -#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 // maximum unsigned short value -#define INTERNET_MAX_PATH_LENGTH 2048 -#define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length - - - -// -// values returned by InternetQueryOption() with INTERNET_OPTION_KEEP_CONNECTION: -// - -#define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1) -#define INTERNET_KEEP_ALIVE_ENABLED 1 -#define INTERNET_KEEP_ALIVE_DISABLED 0 - -// -// flags returned by InternetQueryOption() with INTERNET_OPTION_REQUEST_FLAGS -// - -#define INTERNET_REQFLAG_FROM_CACHE 0x00000001 // response came from cache -#define INTERNET_REQFLAG_ASYNC 0x00000002 // request was made asynchronously -#define INTERNET_REQFLAG_VIA_PROXY 0x00000004 // request was made via a proxy -#define INTERNET_REQFLAG_NO_HEADERS 0x00000008 // orginal response contained no headers -#define INTERNET_REQFLAG_PASSIVE 0x00000010 // FTP: passive-mode connection -#define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040 // HTTPS: this request not cacheable -#define INTERNET_REQFLAG_NET_TIMEOUT 0x00000080 // w/ _FROM_CACHE: net request timed out - -// -// flags common to open functions (not InternetOpen()): -// - -#define INTERNET_FLAG_RELOAD 0x80000000 // retrieve the original item - -// -// flags for InternetOpenUrl(): -// - -#define INTERNET_FLAG_RAW_DATA 0x40000000 // FTP/gopher find: receive the item as raw (structured) data -#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 // FTP: use existing InternetConnect handle for server if possible - -// -// flags for InternetOpen(): -// - -#define INTERNET_FLAG_ASYNC 0x10000000 // this request is asynchronous (where supported) - -// -// protocol-specific flags: -// - -#define INTERNET_FLAG_PASSIVE 0x08000000 // used for FTP connections - -// -// additional cache flags -// - -#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 // don't write this item to the cache -#define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE -#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 // make this item persistent in cache -#define INTERNET_FLAG_FROM_CACHE 0x01000000 // use offline semantics -#define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE - -// -// additional flags -// - -#define INTERNET_FLAG_SECURE 0x00800000 // use PCT/SSL if applicable (HTTP) -#define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 // use keep-alive semantics -#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 // don't handle redirections automatically -#define INTERNET_FLAG_READ_PREFETCH 0x00100000 // do background read prefetch -#define INTERNET_FLAG_NO_COOKIES 0x00080000 // no automatic cookie handling -#define INTERNET_FLAG_NO_AUTH 0x00040000 // no automatic authentication handling -#define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000 // return cache file if net request fails - -// -// Security Ignore Flags, Allow HttpOpenRequest to overide -// Secure Channel (SSL/PCT) failures of the following types. -// - -#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 // ex: https:// to http:// -#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 // ex: http:// to https:// -#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 // expired X509 Cert. -#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 // bad common name in X509 Cert. - -// -// more caching flags -// - -#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 // asking wininet to update an item if it is newer -#define INTERNET_FLAG_HYPERLINK 0x00000400 // asking wininet to do hyperlinking semantic which works right for scripts -#define INTERNET_FLAG_NO_UI 0x00000200 // no cookie popup -#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 // asking wininet to add "pragma: no-cache" -#define INTERNET_FLAG_CACHE_ASYNC 0x00000080 // ok to perform lazy cache-write -#define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 // this is a forms submit -#define INTERNET_FLAG_FWD_BACK 0x00000020 // fwd-back button op -#define INTERNET_FLAG_NEED_FILE 0x00000010 // need a file for this request -#define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE - -// -// flags for FTP -// - -#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII // 0x00000001 -#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY // 0x00000002 - -#define INTERNET_ERROR_MASK_INSERT_CDROM 0x1 -#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2 -#define INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG 0X4 -#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY 0x8 - -#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK) - -// -// common per-API flags (new APIs) -// - -#define WININET_API_FLAG_ASYNC 0x00000001 // force async operation -#define WININET_API_FLAG_SYNC 0x00000004 // force sync operation -#define WININET_API_FLAG_USE_CONTEXT 0x00000008 // use value supplied in dwContext (even if 0) - -// -// INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter -// then no call-backs will be made for that API -// - -#define INTERNET_NO_CALLBACK 0 - - -// -// Options used in INTERNET_PER_CONN_OPTON struct -// -#define INTERNET_PER_CONN_FLAGS 1 -#define INTERNET_PER_CONN_PROXY_SERVER 2 -#define INTERNET_PER_CONN_PROXY_BYPASS 3 -#define INTERNET_PER_CONN_AUTOCONFIG_URL 4 -#define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS 5 - -// -// PER_CONN_FLAGS -// -#define PROXY_TYPE_DIRECT 0x00000001 // direct to net -#define PROXY_TYPE_PROXY 0x00000002 // via named proxy -#define PROXY_TYPE_AUTO_PROXY_URL 0x00000004 // autoproxy URL -#define PROXY_TYPE_AUTO_DETECT 0x00000008 // use autoproxy detection - -// -// PER_CONN_AUTODISCOVERY_FLAGS -// -#define AUTO_PROXY_FLAG_USER_SET 0x00000001 // user changed this setting -#define AUTO_PROXY_FLAG_ALWAYS_DETECT 0x00000002 // force detection even when its not needed -#define AUTO_PROXY_FLAG_DETECTION_RUN 0x00000004 // detection has been run -#define AUTO_PROXY_FLAG_MIGRATED 0x00000008 // migration has just been done -#define AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT 0x00000010 // don't cache result of host=proxy name -#define AUTO_PROXY_FLAG_CACHE_INIT_RUN 0x00000020 // don't initalize and run unless URL expired -#define AUTO_PROXY_FLAG_DETECTION_SUSPECT 0x00000040 // if we're on a LAN & Modem, with only one IP, bad?!? - -// -// ISO_FORCE_DISCONNECTED - if set when putting Wininet into disconnected mode, -// all outstanding requests will be aborted with a cancelled error -// - -#define ISO_FORCE_DISCONNECTED 0x00000001 - - -#define INTERNET_RFC1123_FORMAT 0 -#define INTERNET_RFC1123_BUFSIZE 30 - -// -// flags for InternetCrackUrl() and InternetCreateUrl() -// - -#define ICU_ESCAPE 0x80000000 // (un)escape URL characters -#define ICU_USERNAME 0x40000000 // use internal username & password - -// -// flags for InternetCanonicalizeUrl() and InternetCombineUrl() -// - -#define ICU_NO_ENCODE 0x20000000 // Don't convert unsafe characters to escape sequence -#define ICU_DECODE 0x10000000 // Convert %XX escape sequences to characters -#define ICU_NO_META 0x08000000 // Don't convert .. etc. meta path sequences -#define ICU_ENCODE_SPACES_ONLY 0x04000000 // Encode spaces only -#define ICU_BROWSER_MODE 0x02000000 // Special encode/decode rules for browser -#define ICU_ENCODE_PERCENT 0x00001000 // Encode any percent (ASCII25) - // signs encountered, default is to not encode percent. - -// -// access types for InternetOpen() -// - -#define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration -#define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net -#define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy -#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS - -// -// old names for access types -// - -#define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG -#define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT -#define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY - - -// -// service types for InternetConnect() -// - -#define INTERNET_SERVICE_FTP 1 -#define INTERNET_SERVICE_GOPHER 2 -#define INTERNET_SERVICE_HTTP 3 - -// -// flags for InternetReadFileEx() -// - -#define IRF_ASYNC WININET_API_FLAG_ASYNC -#define IRF_SYNC WININET_API_FLAG_SYNC -#define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT -#define IRF_NO_WAIT 0x00000008 - -// -// flags for InternetSetOptionEx() -// - -#define ISO_GLOBAL 0x00000001 // modify option globally -#define ISO_REGISTRY 0x00000002 // write option to registry (where applicable) - +#define INTERNET_INVALID_PORT_NUMBER 0 +#define INTERNET_DEFAULT_FTP_PORT 21 +#define INTERNET_DEFAULT_GOPHER_PORT 70 +#define INTERNET_DEFAULT_HTTP_PORT 80 +#define INTERNET_DEFAULT_HTTPS_PORT 443 +#define INTERNET_DEFAULT_SOCKS_PORT 1080 +#define MAX_CACHE_ENTRY_INFO_SIZE 4096 +#define INTERNET_MAX_HOST_NAME_LENGTH 256 +#define INTERNET_MAX_USER_NAME_LENGTH 128 +#define INTERNET_MAX_PASSWORD_LENGTH 128 +#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 +#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 +#define INTERNET_MAX_PATH_LENGTH 2048 +#define INTERNET_MAX_SCHEME_LENGTH 32 +#define INTERNET_KEEP_ALIVE_UNKNOWN (-1) +#define INTERNET_KEEP_ALIVE_ENABLED 1 +#define INTERNET_KEEP_ALIVE_DISABLED 0 +#define INTERNET_REQFLAG_FROM_CACHE 1 +#define INTERNET_REQFLAG_ASYNC 2 +#define INTERNET_FLAG_RELOAD 0x80000000 +#define INTERNET_FLAG_RAW_DATA 0x40000000 +#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 +#define INTERNET_FLAG_ASYNC 0x10000000 +#define INTERNET_FLAG_PASSIVE 0x08000000 +#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 +#define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE +#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 +#define INTERNET_FLAG_OFFLINE 0x1000000 +#define INTERNET_FLAG_SECURE 0x800000 +#define INTERNET_FLAG_KEEP_CONNECTION 0x400000 +#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x200000 +#define INTERNET_FLAG_READ_PREFETCH 0x100000 +#define INTERNET_FLAG_NO_COOKIES 0x80000 +#define INTERNET_FLAG_NO_AUTH 0x40000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x8000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x4000 +#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x2000 +#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x1000 +#define INTERNET_FLAG_MUST_CACHE_REQUEST 16 +#define INTERNET_FLAG_RESYNCHRONIZE 0x800 +#define INTERNET_FLAG_HYPERLINK 0x400 +#define INTERNET_FLAG_NO_UI 0x200 +#define INTERNET_FLAG_PRAGMA_NOCACHE 0x100 +#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII +#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY +#define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID|INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP) +#define SECURITY_SET_MASK SECURITY_INTERNET_MASK +#define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD|INTERNET_FLAG_RAW_DATA|INTERNET_FLAG_EXISTING_CONNECT|\ +INTERNET_FLAG_ASYNC|INTERNET_FLAG_PASSIVE|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_MAKE_PERSISTENT|INTERNET_FLAG_OFFLINE|\ +INTERNET_FLAG_SECURE|INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_NO_AUTO_REDIRECT|INTERNET_FLAG_READ_PREFETCH |\ +INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_AUTH|SECURITY_INTERNET_MASK|INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_TRANSFER_BINARY\ +|INTERNET_FLAG_RESYNCHRONIZE|INTERNET_FLAG_MUST_CACHE_REQUEST|INTERNET_FLAG_HYPERLINK|INTERNET_FLAG_NO_UI) +#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK) +#define INTERNET_NO_CALLBACK 0 +#define INTERNET_RFC1123_FORMAT 0 +#define INTERNET_RFC1123_BUFSIZE 30 +#define ICU_ESCAPE 0x80000000 +#define ICU_USERNAME 0x40000000 +#define ICU_NO_ENCODE 0x20000000 +#define ICU_DECODE 0x10000000 +#define ICU_NO_META 0x08000000 +#define ICU_ENCODE_SPACES_ONLY 0x04000000 +#define ICU_BROWSER_MODE 0x02000000 +#define INTERNET_OPEN_TYPE_PRECONFIG 0 +#define INTERNET_OPEN_TYPE_DIRECT 1 +#define INTERNET_OPEN_TYPE_PROXY 3 +#define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG +#define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT +#define GATEWAY_INTERNET_ACCESS 2 +#define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY +#define ISO_GLOBAL 1 +#define ISO_REGISTRY 2 #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY) - -// -// options manifests for Internet{Query|Set}Option -// - -#define INTERNET_OPTION_CALLBACK 1 -#define INTERNET_OPTION_CONNECT_TIMEOUT 2 -#define INTERNET_OPTION_CONNECT_RETRIES 3 -#define INTERNET_OPTION_CONNECT_BACKOFF 4 -#define INTERNET_OPTION_SEND_TIMEOUT 5 -#define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT -#define INTERNET_OPTION_RECEIVE_TIMEOUT 6 +#define INTERNET_OPTION_CALLBACK 1 +#define INTERNET_OPTION_CONNECT_TIMEOUT 2 +#define INTERNET_OPTION_CONNECT_RETRIES 3 +#define INTERNET_OPTION_CONNECT_BACKOFF 4 +#define INTERNET_OPTION_SEND_TIMEOUT 5 +#define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT +#define INTERNET_OPTION_RECEIVE_TIMEOUT 6 #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT -#define INTERNET_OPTION_DATA_SEND_TIMEOUT 7 -#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8 -#define INTERNET_OPTION_HANDLE_TYPE 9 -#define INTERNET_OPTION_LISTEN_TIMEOUT 11 -#define INTERNET_OPTION_READ_BUFFER_SIZE 12 -#define INTERNET_OPTION_WRITE_BUFFER_SIZE 13 - -#define INTERNET_OPTION_ASYNC_ID 15 -#define INTERNET_OPTION_ASYNC_PRIORITY 16 - -#define INTERNET_OPTION_PARENT_HANDLE 21 -#define INTERNET_OPTION_KEEP_CONNECTION 22 -#define INTERNET_OPTION_REQUEST_FLAGS 23 -#define INTERNET_OPTION_EXTENDED_ERROR 24 - -#define INTERNET_OPTION_OFFLINE_MODE 26 -#define INTERNET_OPTION_CACHE_STREAM_HANDLE 27 -#define INTERNET_OPTION_USERNAME 28 -#define INTERNET_OPTION_PASSWORD 29 -#define INTERNET_OPTION_ASYNC 30 -#define INTERNET_OPTION_SECURITY_FLAGS 31 +#define INTERNET_OPTION_DATA_SEND_TIMEOUT 7 +#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8 +#define INTERNET_OPTION_HANDLE_TYPE 9 +#define INTERNET_OPTION_CONTEXT_VALUE 10 +#define INTERNET_OPTION_LISTEN_TIMEOUT 11 +#define INTERNET_OPTION_READ_BUFFER_SIZE 12 +#define INTERNET_OPTION_WRITE_BUFFER_SIZE 13 +#define INTERNET_OPTION_ASYNC_ID 15 +#define INTERNET_OPTION_ASYNC_PRIORITY 16 +#define INTERNET_OPTION_PARENT_HANDLE 21 +#define INTERNET_OPTION_KEEP_CONNECTION 22 +#define INTERNET_OPTION_REQUEST_FLAGS 23 +#define INTERNET_OPTION_EXTENDED_ERROR 24 +#define INTERNET_OPTION_OFFLINE_MODE 26 +#define INTERNET_OPTION_CACHE_STREAM_HANDLE 27 +#define INTERNET_OPTION_USERNAME 28 +#define INTERNET_OPTION_PASSWORD 29 +#define INTERNET_OPTION_ASYNC 30 +#define INTERNET_OPTION_SECURITY_FLAGS 31 #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32 -#define INTERNET_OPTION_DATAFILE_NAME 33 -#define INTERNET_OPTION_URL 34 -#define INTERNET_OPTION_SECURITY_CERTIFICATE 35 -#define INTERNET_OPTION_SECURITY_KEY_BITNESS 36 -#define INTERNET_OPTION_REFRESH 37 -#define INTERNET_OPTION_PROXY 38 -#define INTERNET_OPTION_SETTINGS_CHANGED 39 -#define INTERNET_OPTION_VERSION 40 -#define INTERNET_OPTION_USER_AGENT 41 -#define INTERNET_OPTION_END_BROWSER_SESSION 42 -#define INTERNET_OPTION_PROXY_USERNAME 43 -#define INTERNET_OPTION_PROXY_PASSWORD 44 -#define INTERNET_OPTION_CONTEXT_VALUE 45 -#define INTERNET_OPTION_CONNECT_LIMIT 46 -#define INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT 47 -#define INTERNET_OPTION_POLICY 48 -#define INTERNET_OPTION_DISCONNECTED_TIMEOUT 49 -#define INTERNET_OPTION_CONNECTED_STATE 50 -#define INTERNET_OPTION_IDLE_STATE 51 -#define INTERNET_OPTION_OFFLINE_SEMANTICS 52 -#define INTERNET_OPTION_SECONDARY_CACHE_KEY 53 -#define INTERNET_OPTION_CALLBACK_FILTER 54 -#define INTERNET_OPTION_CONNECT_TIME 55 -#define INTERNET_OPTION_SEND_THROUGHPUT 56 -#define INTERNET_OPTION_RECEIVE_THROUGHPUT 57 -#define INTERNET_OPTION_REQUEST_PRIORITY 58 -#define INTERNET_OPTION_HTTP_VERSION 59 -#define INTERNET_OPTION_RESET_URLCACHE_SESSION 60 -#define INTERNET_OPTION_ERROR_MASK 62 -#define INTERNET_OPTION_FROM_CACHE_TIMEOUT 63 -#define INTERNET_OPTION_BYPASS_EDITED_ENTRY 64 -#define INTERNET_OPTION_CODEPAGE 68 -#define INTERNET_OPTION_CACHE_TIMESTAMPS 69 -#define INTERNET_OPTION_DISABLE_AUTODIAL 70 -#define INTERNET_OPTION_MAX_CONNS_PER_SERVER 73 -#define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74 -#define INTERNET_OPTION_PER_CONNECTION_OPTION 75 -#define INTERNET_OPTION_DIGEST_AUTH_UNLOAD 76 -#define INTERNET_OPTION_IGNORE_OFFLINE 77 - -#define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK -#define INTERNET_LAST_OPTION INTERNET_OPTION_IGNORE_OFFLINE - -// -// values for INTERNET_OPTION_PRIORITY -// - -#define INTERNET_PRIORITY_FOREGROUND 1000 - -// -// handle types -// - -#define INTERNET_HANDLE_TYPE_INTERNET 1 -#define INTERNET_HANDLE_TYPE_CONNECT_FTP 2 -#define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3 -#define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4 -#define INTERNET_HANDLE_TYPE_FTP_FIND 5 -#define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6 -#define INTERNET_HANDLE_TYPE_FTP_FILE 7 -#define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8 -#define INTERNET_HANDLE_TYPE_GOPHER_FIND 9 -#define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10 -#define INTERNET_HANDLE_TYPE_GOPHER_FILE 11 -#define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12 -#define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13 -#define INTERNET_HANDLE_TYPE_FILE_REQUEST 14 - -// -// values for INTERNET_OPTION_SECURITY_FLAGS -// - -// query only -#define SECURITY_FLAG_SECURE 0x00000001 // can query only -#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 -#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 -#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 -#define SECURITY_FLAG_UNKNOWNBIT 0x80000000 -#define SECURITY_FLAG_FORTEZZA 0x08000000 -#define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_STRENGTH_WEAK - - - -// The following are unused -#define SECURITY_FLAG_SSL 0x00000002 -#define SECURITY_FLAG_SSL3 0x00000004 -#define SECURITY_FLAG_PCT 0x00000008 -#define SECURITY_FLAG_PCT4 0x00000010 -#define SECURITY_FLAG_IETFSSL4 0x00000020 - -// The following are for backwards compatability only. -#define SECURITY_FLAG_40BIT SECURITY_FLAG_STRENGTH_WEAK -#define SECURITY_FLAG_128BIT SECURITY_FLAG_STRENGTH_STRONG -#define SECURITY_FLAG_56BIT SECURITY_FLAG_STRENGTH_MEDIUM - -// setable flags -#define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080 -#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 -#define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200 - -#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID -#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID - - -#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS -#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP - - - -// -// status manifests for Internet status callback -// - -#define INTERNET_STATUS_RESOLVING_NAME 10 -#define INTERNET_STATUS_NAME_RESOLVED 11 -#define INTERNET_STATUS_CONNECTING_TO_SERVER 20 -#define INTERNET_STATUS_CONNECTED_TO_SERVER 21 -#define INTERNET_STATUS_SENDING_REQUEST 30 -#define INTERNET_STATUS_REQUEST_SENT 31 -#define INTERNET_STATUS_RECEIVING_RESPONSE 40 -#define INTERNET_STATUS_RESPONSE_RECEIVED 41 -#define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42 -#define INTERNET_STATUS_PREFETCH 43 -#define INTERNET_STATUS_CLOSING_CONNECTION 50 -#define INTERNET_STATUS_CONNECTION_CLOSED 51 -#define INTERNET_STATUS_HANDLE_CREATED 60 -#define INTERNET_STATUS_HANDLE_CLOSING 70 -#define INTERNET_STATUS_DETECTING_PROXY 80 -#define INTERNET_STATUS_REQUEST_COMPLETE 100 -#define INTERNET_STATUS_REDIRECT 110 -#define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120 -#define INTERNET_STATUS_USER_INPUT_REQUIRED 140 -#define INTERNET_STATUS_STATE_CHANGE 200 - -// -// the following can be indicated in a state change notification: -// - -#define INTERNET_STATE_CONNECTED 0x00000001 // connected state (mutually exclusive with disconnected) -#define INTERNET_STATE_DISCONNECTED 0x00000002 // disconnected from network -#define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010 // disconnected by user request -#define INTERNET_STATE_IDLE 0x00000100 // no network requests being made (by Wininet) -#define INTERNET_STATE_BUSY 0x00000200 // network requests being made (by Wininet) - - -// -// FTP -// - -// -// manifests -// - -#define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000 -#define FTP_TRANSFER_TYPE_ASCII 0x00000001 -#define FTP_TRANSFER_TYPE_BINARY 0x00000002 - -#define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY) - -// -// Gopher -// - -// -// manifests -// - -// -// string field lengths (in characters, not bytes) -// - -#define MAX_GOPHER_DISPLAY_TEXT 128 -#define MAX_GOPHER_SELECTOR_TEXT 256 -#define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH - -// -// manifests for GopherType -// - -#define GOPHER_TYPE_TEXT_FILE 0x00000001 -#define GOPHER_TYPE_DIRECTORY 0x00000002 -#define GOPHER_TYPE_CSO 0x00000004 -#define GOPHER_TYPE_ERROR 0x00000008 -#define GOPHER_TYPE_MAC_BINHEX 0x00000010 -#define GOPHER_TYPE_DOS_ARCHIVE 0x00000020 -#define GOPHER_TYPE_UNIX_UUENCODED 0x00000040 -#define GOPHER_TYPE_INDEX_SERVER 0x00000080 -#define GOPHER_TYPE_TELNET 0x00000100 -#define GOPHER_TYPE_BINARY 0x00000200 -#define GOPHER_TYPE_REDUNDANT 0x00000400 -#define GOPHER_TYPE_TN3270 0x00000800 -#define GOPHER_TYPE_GIF 0x00001000 -#define GOPHER_TYPE_IMAGE 0x00002000 -#define GOPHER_TYPE_BITMAP 0x00004000 -#define GOPHER_TYPE_MOVIE 0x00008000 -#define GOPHER_TYPE_SOUND 0x00010000 -#define GOPHER_TYPE_HTML 0x00020000 -#define GOPHER_TYPE_PDF 0x00040000 -#define GOPHER_TYPE_CALENDAR 0x00080000 -#define GOPHER_TYPE_INLINE 0x00100000 -#define GOPHER_TYPE_UNKNOWN 0x20000000 -#define GOPHER_TYPE_ASK 0x40000000 -#define GOPHER_TYPE_GOPHER_PLUS 0x80000000 - - -#define MAX_GOPHER_CATEGORY_NAME 128 // arbitrary -#define MAX_GOPHER_ATTRIBUTE_NAME 128 // " -#define MIN_GOPHER_ATTRIBUTE_LENGTH 256 // " - -// -// known gopher attribute categories. See below for ordinals -// - -#define GOPHER_INFO_CATEGORY TEXT("+INFO") -#define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN") -#define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS") -#define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT") -#define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA") - -// -// known gopher attributes. These are the attribute names as defined in the -// gopher+ protocol document -// - -#define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin") -#define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date") -#define GOPHER_TTL_ATTRIBUTE TEXT("TTL") -#define GOPHER_SCORE_ATTRIBUTE TEXT("Score") -#define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range") -#define GOPHER_SITE_ATTRIBUTE TEXT("Site") -#define GOPHER_ORG_ATTRIBUTE TEXT("Org") -#define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc") -#define GOPHER_GEOG_ATTRIBUTE TEXT("Geog") -#define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ") -#define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider") -#define GOPHER_VERSION_ATTRIBUTE TEXT("Version") -#define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract") -#define GOPHER_VIEW_ATTRIBUTE TEXT("View") -#define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk") - -// -// identifiers for attribute strings -// - -#define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00 - -#define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1) - -#define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2) -#define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3) -#define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4) -#define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5) -#define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6) -#define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7) - -#define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8) - -#define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9) - -#define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10) -#define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11) -#define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12) -#define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13) -#define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14) -#define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15) -#define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16) -#define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17) -#define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18) -#define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19) -#define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20) -#define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21) -#define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22) -#define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23) -#define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24) - -#define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25) - - -// -// HTTP -// - -// -// manifests -// - -// -// the default major/minor HTTP version numbers -// - -#define HTTP_MAJOR_VERSION 1 -#define HTTP_MINOR_VERSION 0 - -#define HTTP_VERSIONA "HTTP/1.0" -#define HTTP_VERSIONW L"HTTP/1.0" - -#ifdef UNICODE -#define HTTP_VERSION HTTP_VERSIONW -#else -#define HTTP_VERSION HTTP_VERSIONA -#endif - -// -// HttpQueryInfo info levels. Generally, there is one info level -// for each potential RFC822/HTTP/MIME header that an HTTP server -// may send as part of a request response. -// -// The HTTP_QUERY_RAW_HEADERS info level is provided for clients -// that choose to perform their own header parsing. -// - - -#define HTTP_QUERY_MIME_VERSION 0 -#define HTTP_QUERY_CONTENT_TYPE 1 -#define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2 -#define HTTP_QUERY_CONTENT_ID 3 -#define HTTP_QUERY_CONTENT_DESCRIPTION 4 -#define HTTP_QUERY_CONTENT_LENGTH 5 -#define HTTP_QUERY_CONTENT_LANGUAGE 6 -#define HTTP_QUERY_ALLOW 7 -#define HTTP_QUERY_PUBLIC 8 -#define HTTP_QUERY_DATE 9 -#define HTTP_QUERY_EXPIRES 10 -#define HTTP_QUERY_LAST_MODIFIED 11 -#define HTTP_QUERY_MESSAGE_ID 12 -#define HTTP_QUERY_URI 13 -#define HTTP_QUERY_DERIVED_FROM 14 -#define HTTP_QUERY_COST 15 -#define HTTP_QUERY_LINK 16 -#define HTTP_QUERY_PRAGMA 17 -#define HTTP_QUERY_VERSION 18 // special: part of status line -#define HTTP_QUERY_STATUS_CODE 19 // special: part of status line -#define HTTP_QUERY_STATUS_TEXT 20 // special: part of status line -#define HTTP_QUERY_RAW_HEADERS 21 // special: all headers as ASCIIZ -#define HTTP_QUERY_RAW_HEADERS_CRLF 22 // special: all headers -#define HTTP_QUERY_CONNECTION 23 -#define HTTP_QUERY_ACCEPT 24 -#define HTTP_QUERY_ACCEPT_CHARSET 25 -#define HTTP_QUERY_ACCEPT_ENCODING 26 -#define HTTP_QUERY_ACCEPT_LANGUAGE 27 -#define HTTP_QUERY_AUTHORIZATION 28 -#define HTTP_QUERY_CONTENT_ENCODING 29 -#define HTTP_QUERY_FORWARDED 30 -#define HTTP_QUERY_FROM 31 -#define HTTP_QUERY_IF_MODIFIED_SINCE 32 -#define HTTP_QUERY_LOCATION 33 -#define HTTP_QUERY_ORIG_URI 34 -#define HTTP_QUERY_REFERER 35 -#define HTTP_QUERY_RETRY_AFTER 36 -#define HTTP_QUERY_SERVER 37 -#define HTTP_QUERY_TITLE 38 -#define HTTP_QUERY_USER_AGENT 39 -#define HTTP_QUERY_WWW_AUTHENTICATE 40 -#define HTTP_QUERY_PROXY_AUTHENTICATE 41 -#define HTTP_QUERY_ACCEPT_RANGES 42 -#define HTTP_QUERY_SET_COOKIE 43 -#define HTTP_QUERY_COOKIE 44 -#define HTTP_QUERY_REQUEST_METHOD 45 // special: GET/POST etc. -#define HTTP_QUERY_REFRESH 46 -#define HTTP_QUERY_CONTENT_DISPOSITION 47 - -// -// HTTP 1.1 defined headers -// - -#define HTTP_QUERY_AGE 48 -#define HTTP_QUERY_CACHE_CONTROL 49 -#define HTTP_QUERY_CONTENT_BASE 50 -#define HTTP_QUERY_CONTENT_LOCATION 51 -#define HTTP_QUERY_CONTENT_MD5 52 -#define HTTP_QUERY_CONTENT_RANGE 53 -#define HTTP_QUERY_ETAG 54 -#define HTTP_QUERY_HOST 55 -#define HTTP_QUERY_IF_MATCH 56 -#define HTTP_QUERY_IF_NONE_MATCH 57 -#define HTTP_QUERY_IF_RANGE 58 -#define HTTP_QUERY_IF_UNMODIFIED_SINCE 59 -#define HTTP_QUERY_MAX_FORWARDS 60 -#define HTTP_QUERY_PROXY_AUTHORIZATION 61 -#define HTTP_QUERY_RANGE 62 -#define HTTP_QUERY_TRANSFER_ENCODING 63 -#define HTTP_QUERY_UPGRADE 64 -#define HTTP_QUERY_VARY 65 -#define HTTP_QUERY_VIA 66 -#define HTTP_QUERY_WARNING 67 -#define HTTP_QUERY_EXPECT 68 -#define HTTP_QUERY_PROXY_CONNECTION 69 -#define HTTP_QUERY_UNLESS_MODIFIED_SINCE 70 - - - -#define HTTP_QUERY_ECHO_REQUEST 71 -#define HTTP_QUERY_ECHO_REPLY 72 - -// These are the set of headers that should be added back to a request when -// re-doing a request after a RETRY_WITH response. -#define HTTP_QUERY_ECHO_HEADERS 73 -#define HTTP_QUERY_ECHO_HEADERS_CRLF 74 - -#define HTTP_QUERY_MAX 74 - -// -// HTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel -// parameter of HttpQueryInfo() then the lpBuffer parameter contains the name -// of the header we are to query -// - -#define HTTP_QUERY_CUSTOM 65535 - -// -// HTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel -// parameter of HttpQueryInfo() then the request headers will be queried for the -// request information -// - -#define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000 - -// -// HTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter -// of HttpQueryInfo() AND the header being queried contains date information, -// e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure -// containing the date and time information converted from the header string -// - -#define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000 - -// -// HTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of -// HttpQueryInfo(), then the value of the header will be converted to a number -// before being returned to the caller, if applicable -// - -#define HTTP_QUERY_FLAG_NUMBER 0x20000000 - -// -// HTTP_QUERY_FLAG_COALESCE - combine the values from several headers of the -// same name into the output buffer -// - -#define HTTP_QUERY_FLAG_COALESCE 0x10000000 - - -#define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK) - -// -// HTTP Response Status Codes: -// - -#define HTTP_STATUS_CONTINUE 100 // OK to continue with request -#define HTTP_STATUS_SWITCH_PROTOCOLS 101 // server has switched protocols in upgrade header - -#define HTTP_STATUS_OK 200 // request completed -#define HTTP_STATUS_CREATED 201 // object created, reason = new URI -#define HTTP_STATUS_ACCEPTED 202 // async completion (TBS) -#define HTTP_STATUS_PARTIAL 203 // partial completion -#define HTTP_STATUS_NO_CONTENT 204 // no info to return -#define HTTP_STATUS_RESET_CONTENT 205 // request completed, but clear form -#define HTTP_STATUS_PARTIAL_CONTENT 206 // partial GET furfilled - -#define HTTP_STATUS_AMBIGUOUS 300 // server couldn't decide what to return -#define HTTP_STATUS_MOVED 301 // object permanently moved -#define HTTP_STATUS_REDIRECT 302 // object temporarily moved -#define HTTP_STATUS_REDIRECT_METHOD 303 // redirection w/ new access method -#define HTTP_STATUS_NOT_MODIFIED 304 // if-modified-since was not modified -#define HTTP_STATUS_USE_PROXY 305 // redirection to proxy, location header specifies proxy to use -#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 // HTTP/1.1: keep same verb - -#define HTTP_STATUS_BAD_REQUEST 400 // invalid syntax -#define HTTP_STATUS_DENIED 401 // access denied -#define HTTP_STATUS_PAYMENT_REQ 402 // payment required -#define HTTP_STATUS_FORBIDDEN 403 // request forbidden -#define HTTP_STATUS_NOT_FOUND 404 // object not found -#define HTTP_STATUS_BAD_METHOD 405 // method is not allowed -#define HTTP_STATUS_NONE_ACCEPTABLE 406 // no response acceptable to client found -#define HTTP_STATUS_PROXY_AUTH_REQ 407 // proxy authentication required -#define HTTP_STATUS_REQUEST_TIMEOUT 408 // server timed out waiting for request -#define HTTP_STATUS_CONFLICT 409 // user should resubmit with more info -#define HTTP_STATUS_GONE 410 // the resource is no longer available -#define HTTP_STATUS_LENGTH_REQUIRED 411 // the server refused to accept request w/o a length -#define HTTP_STATUS_PRECOND_FAILED 412 // precondition given in request failed -#define HTTP_STATUS_REQUEST_TOO_LARGE 413 // request entity was too large -#define HTTP_STATUS_URI_TOO_LONG 414 // request URI too long -#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 // unsupported media type -#define HTTP_STATUS_RETRY_WITH 449 // retry after doing the appropriate action. - -#define HTTP_STATUS_SERVER_ERROR 500 // internal server error -#define HTTP_STATUS_NOT_SUPPORTED 501 // required not supported -#define HTTP_STATUS_BAD_GATEWAY 502 // error response received from gateway -#define HTTP_STATUS_SERVICE_UNAVAIL 503 // temporarily overloaded -#define HTTP_STATUS_GATEWAY_TIMEOUT 504 // timed out waiting for gateway -#define HTTP_STATUS_VERSION_NOT_SUP 505 // HTTP version not supported - -#define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE -#define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP - - -// -// values for dwModifiers parameter of HttpAddRequestHeaders() -// - -#define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF -#define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000 - -// -// HTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't -// already exist -// - +#define INTERNET_OPTION_DATAFILE_NAME 33 +#define INTERNET_OPTION_URL 34 +#define INTERNET_OPTION_SECURITY_CERTIFICATE 35 +#define INTERNET_OPTION_SECURITY_KEY_BITNESS 36 +#define INTERNET_OPTION_REFRESH 37 +#define INTERNET_OPTION_PROXY 38 +#define INTERNET_OPTION_SETTINGS_CHANGED 39 +#define INTERNET_OPTION_VERSION 40 +#define INTERNET_OPTION_USER_AGENT 41 +#define INTERNET_OPTION_END_BROWSER_SESSION 42 +#define INTERNET_OPTION_PROXY_USERNAME 43 +#define INTERNET_OPTION_PROXY_PASSWORD 44 +#define INTERNET_OPTION_CONNECTED_STATE 50 +#define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK +/* FIXME: missing INTERNET_OPTION_*? */ +#define INTERNET_LAST_OPTION INTERNET_OPTION_CONNECTED_STATE +#define INTERNET_PRIORITY_FOREGROUND 1000 +#define INTERNET_HANDLE_TYPE_INTERNET 1 +#define INTERNET_HANDLE_TYPE_CONNECT_FTP 2 +#define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3 +#define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4 +#define INTERNET_HANDLE_TYPE_FTP_FIND 5 +#define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6 +#define INTERNET_HANDLE_TYPE_FTP_FILE 7 +#define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8 +#define INTERNET_HANDLE_TYPE_GOPHER_FIND 9 +#define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10 +#define INTERNET_HANDLE_TYPE_GOPHER_FILE 11 +#define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12 +#define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13 +#define SECURITY_FLAG_SECURE 1 +#define SECURITY_FLAG_SSL 2 +#define SECURITY_FLAG_SSL3 4 +#define SECURITY_FLAG_PCT 8 +#define SECURITY_FLAG_PCT4 16 +#define SECURITY_FLAG_IETFSSL4 0x20 +#define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080 +#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 +#define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200 +#define SECURITY_FLAG_40BIT 0x10000000 +#define SECURITY_FLAG_128BIT 0x20000000 +#define SECURITY_FLAG_56BIT 0x40000000 +#define SECURITY_FLAG_UNKNOWNBIT 0x80000000 +#define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_40BIT +#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID +#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID +#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS +#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP +#define INTERNET_SERVICE_FTP 1 +#define INTERNET_SERVICE_GOPHER 2 +#define INTERNET_SERVICE_HTTP 3 +#define INTERNET_STATUS_RESOLVING_NAME 10 +#define INTERNET_STATUS_NAME_RESOLVED 11 +#define INTERNET_STATUS_CONNECTING_TO_SERVER 20 +#define INTERNET_STATUS_CONNECTED_TO_SERVER 21 +#define INTERNET_STATUS_SENDING_REQUEST 30 +#define INTERNET_STATUS_REQUEST_SENT 31 +#define INTERNET_STATUS_RECEIVING_RESPONSE 40 +#define INTERNET_STATUS_RESPONSE_RECEIVED 41 +#define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42 +#define INTERNET_STATUS_PREFETCH 43 +#define INTERNET_STATUS_CLOSING_CONNECTION 50 +#define INTERNET_STATUS_CONNECTION_CLOSED 51 +#define INTERNET_STATUS_HANDLE_CREATED 60 +#define INTERNET_STATUS_HANDLE_CLOSING 70 +#define INTERNET_STATUS_REQUEST_COMPLETE 100 +#define INTERNET_STATUS_REDIRECT 110 +#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L)) +#define FTP_TRANSFER_TYPE_UNKNOWN 0 +#define FTP_TRANSFER_TYPE_ASCII 1 +#define FTP_TRANSFER_TYPE_BINARY 2 +#define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY) +#define MAX_GOPHER_DISPLAY_TEXT 128 +#define MAX_GOPHER_SELECTOR_TEXT 256 +#define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH +#define MAX_GOPHER_LOCATOR_LENGTH (1+MAX_GOPHER_DISPLAY_TEXT+1+MAX_GOPHER_SELECTOR_TEXT+1+MAX_GOPHER_HOST_NAME+1+INTERNET_MAX_PORT_NUMBER_LENGTH+1+1+2) +#define GOPHER_TYPE_TEXT_FILE 1 +#define GOPHER_TYPE_DIRECTORY 2 +#define GOPHER_TYPE_CSO 4 +#define GOPHER_TYPE_ERROR 8 +#define GOPHER_TYPE_MAC_BINHEX 16 +#define GOPHER_TYPE_DOS_ARCHIVE 32 +#define GOPHER_TYPE_UNIX_UUENCODED 64 +#define GOPHER_TYPE_INDEX_SERVER 128 +#define GOPHER_TYPE_TELNET 256 +#define GOPHER_TYPE_BINARY 512 +#define GOPHER_TYPE_REDUNDANT 1024 +#define GOPHER_TYPE_TN3270 0x800 +#define GOPHER_TYPE_GIF 0x1000 +#define GOPHER_TYPE_IMAGE 0x2000 +#define GOPHER_TYPE_BITMAP 0x4000 +#define GOPHER_TYPE_MOVIE 0x8000 +#define GOPHER_TYPE_SOUND 0x10000 +#define GOPHER_TYPE_HTML 0x20000 +#define GOPHER_TYPE_PDF 0x40000 +#define GOPHER_TYPE_CALENDAR 0x80000 +#define GOPHER_TYPE_INLINE 0x100000 +#define GOPHER_TYPE_UNKNOWN 0x20000000 +#define GOPHER_TYPE_ASK 0x40000000 +#define GOPHER_TYPE_GOPHER_PLUS 0x80000000 +#define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE|GOPHER_TYPE_MAC_BINHEX|GOPHER_TYPE_DOS_ARCHIVE|\ +GOPHER_TYPE_UNIX_UUENCODED|GOPHER_TYPE_BINARY|GOPHER_TYPE_GIF|GOPHER_TYPE_IMAGE|GOPHER_TYPE_BITMAP\ +|GOPHER_TYPE_MOVIE|GOPHER_TYPE_SOUND|GOPHER_TYPE_HTML|GOPHER_TYPE_PDF|GOPHER_TYPE_CALENDAR|GOPHER_TYPE_INLINE) +#define MAX_GOPHER_CATEGORY_NAME 128 +#define MAX_GOPHER_ATTRIBUTE_NAME 128 +#define MIN_GOPHER_ATTRIBUTE_LENGTH 256 +#define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00 +#define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE+1) +#define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE+2) +#define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE+3) +#define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE+4) +#define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE+5) +#define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE+6) +#define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE+7) +#define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE+8) +#define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE+9) +#define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE+10) +#define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE+11) +#define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE+12) +#define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE+13) +#define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE+14) +#define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE+15) +#define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE+16) +#define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE+17) +#define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE+18) +#define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE+19) +#define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE+20) +#define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE+21) +#define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE+22) +#define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE+23) +#define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE+24) +#define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE+25) +#define HTTP_MAJOR_VERSION 1 +#define HTTP_MINOR_VERSION 0 +#define HTTP_QUERY_MIME_VERSION 0 +#define HTTP_QUERY_CONTENT_TYPE 1 +#define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2 +#define HTTP_QUERY_CONTENT_ID 3 +#define HTTP_QUERY_CONTENT_DESCRIPTION 4 +#define HTTP_QUERY_CONTENT_LENGTH 5 +#define HTTP_QUERY_CONTENT_LANGUAGE 6 +#define HTTP_QUERY_ALLOW 7 +#define HTTP_QUERY_PUBLIC 8 +#define HTTP_QUERY_DATE 9 +#define HTTP_QUERY_EXPIRES 10 +#define HTTP_QUERY_LAST_MODIFIED 11 +#define HTTP_QUERY_MESSAGE_ID 12 +#define HTTP_QUERY_URI 13 +#define HTTP_QUERY_DERIVED_FROM 14 +#define HTTP_QUERY_COST 15 +#define HTTP_QUERY_LINK 16 +#define HTTP_QUERY_PRAGMA 17 +#define HTTP_QUERY_VERSION 18 +#define HTTP_QUERY_STATUS_CODE 19 +#define HTTP_QUERY_STATUS_TEXT 20 +#define HTTP_QUERY_RAW_HEADERS 21 +#define HTTP_QUERY_RAW_HEADERS_CRLF 22 +#define HTTP_QUERY_CONNECTION 23 +#define HTTP_QUERY_ACCEPT 24 +#define HTTP_QUERY_ACCEPT_CHARSET 25 +#define HTTP_QUERY_ACCEPT_ENCODING 26 +#define HTTP_QUERY_ACCEPT_LANGUAGE 27 +#define HTTP_QUERY_AUTHORIZATION 28 +#define HTTP_QUERY_CONTENT_ENCODING 29 +#define HTTP_QUERY_FORWARDED 30 +#define HTTP_QUERY_FROM 31 +#define HTTP_QUERY_IF_MODIFIED_SINCE 32 +#define HTTP_QUERY_LOCATION 33 +#define HTTP_QUERY_ORIG_URI 34 +#define HTTP_QUERY_REFERER 35 +#define HTTP_QUERY_RETRY_AFTER 36 +#define HTTP_QUERY_SERVER 37 +#define HTTP_QUERY_TITLE 38 +#define HTTP_QUERY_USER_AGENT 39 +#define HTTP_QUERY_WWW_AUTHENTICATE 40 +#define HTTP_QUERY_PROXY_AUTHENTICATE 41 +#define HTTP_QUERY_ACCEPT_RANGES 42 +#define HTTP_QUERY_SET_COOKIE 43 +#define HTTP_QUERY_COOKIE 44 +#define HTTP_QUERY_REQUEST_METHOD 45 +#define HTTP_QUERY_MAX 45 +#define HTTP_QUERY_CUSTOM 65535 +#define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000 +#define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000 +#define HTTP_QUERY_FLAG_NUMBER 0x20000000 +#define HTTP_QUERY_FLAG_COALESCE 0x10000000 +#define HTTP_QUERY_MODIFIER_FLAGS_MASK (HTTP_QUERY_FLAG_REQUEST_HEADERS|HTTP_QUERY_FLAG_SYSTEMTIME|HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_FLAG_COALESCE) +#define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK) +#define HTTP_STATUS_OK 200 +#define HTTP_STATUS_CREATED 201 +#define HTTP_STATUS_ACCEPTED 202 +#define HTTP_STATUS_PARTIAL 203 +#define HTTP_STATUS_NO_CONTENT 204 +#define HTTP_STATUS_AMBIGUOUS 300 +#define HTTP_STATUS_MOVED 301 +#define HTTP_STATUS_REDIRECT 302 +#define HTTP_STATUS_REDIRECT_METHOD 303 +#define HTTP_STATUS_NOT_MODIFIED 304 +#define HTTP_STATUS_BAD_REQUEST 400 +#define HTTP_STATUS_DENIED 401 +#define HTTP_STATUS_PAYMENT_REQ 402 +#define HTTP_STATUS_FORBIDDEN 403 +#define HTTP_STATUS_NOT_FOUND 404 +#define HTTP_STATUS_BAD_METHOD 405 +#define HTTP_STATUS_NONE_ACCEPTABLE 406 +#define HTTP_STATUS_PROXY_AUTH_REQ 407 +#define HTTP_STATUS_REQUEST_TIMEOUT 408 +#define HTTP_STATUS_CONFLICT 409 +#define HTTP_STATUS_GONE 410 +#define HTTP_STATUS_AUTH_REFUSED 411 +#define HTTP_STATUS_SERVER_ERROR 500 +#define HTTP_STATUS_NOT_SUPPORTED 501 +#define HTTP_STATUS_BAD_GATEWAY 502 +#define HTTP_STATUS_SERVICE_UNAVAIL 503 +#define HTTP_STATUS_GATEWAY_TIMEOUT 504 +#define INTERNET_PREFETCH_PROGRESS 0 +#define INTERNET_PREFETCH_COMPLETE 1 +#define INTERNET_PREFETCH_ABORTED 2 +#define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01 +#define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02 +#define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04 +#define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08 +#define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF +#define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000 #define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000 - -// -// HTTP_ADDREQ_FLAG_ADD - if HTTP_ADDREQ_FLAG_REPLACE is set but the header is -// not found then if this flag is set, the header is added anyway, so long as -// there is a valid header-value -// - -#define HTTP_ADDREQ_FLAG_ADD 0x20000000 - -// -// HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g. -// "Accept: text/*" and "Accept: audio/*" with this flag results in a single -// header: "Accept: text/*, audio/*" -// - -#define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000 -#define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000 -#define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA - -// -// HTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can -// be supplied in the buffer. If the header to be replaced is not the first -// in a list of headers with the same name, then the relative index should be -// supplied in the low 8 bits of the dwModifiers parameter. If the header-value -// part is missing, then the header is removed -// - -#define HTTP_ADDREQ_FLAG_REPLACE 0x80000000 - -// -// flags for HttpSendRequestEx(), HttpEndRequest() -// - -#define HSR_ASYNC WININET_API_FLAG_ASYNC // force async -#define HSR_SYNC WININET_API_FLAG_SYNC // force sync -#define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT // use dwContext value -#define HSR_INITIATE 0x00000008 // iterative operation (completed by HttpEndRequest) -#define HSR_DOWNLOAD 0x00000010 // download to file -#define HSR_CHUNKED 0x00000020 // operation is send of chunked data - - -#define FLAG_ICC_FORCE_CONNECTION 0x00000001 - -// -// Internet UI -// - -// -// InternetErrorDlg - Provides UI for certain Errors. -// - -#define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01 -#define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02 -#define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04 -#define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08 -#define FLAGS_ERROR_UI_SERIALIZE_DIALOGS 0x10 - -// -// If SERIALIZE_DIALOGS flag set, client should implement thread-safe non-blocking callback... -// - -// -// Internet API error returns -// - -#define INTERNET_ERROR_BASE 12000 - -#define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE + 1) -#define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2) -#define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE + 3) -#define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE + 4) -#define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE + 5) -#define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE + 6) -#define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE + 7) -#define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE + 8) -#define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE + 9) -#define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE + 10) -#define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE + 11) -#define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE + 12) -#define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE + 13) -#define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE + 14) -#define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE + 15) -#define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE + 16) -#define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE + 17) -#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE + 18) -#define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE + 19) -#define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE + 20) -#define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21) -#define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE + 22) -#define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE + 23) -#define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE + 24) -#define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE + 25) -#define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE + 26) -#define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE + 27) -#define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE + 28) -#define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE + 29) -#define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE + 30) -#define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE + 31) -#define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE + 32) -#define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE + 33) -#define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE + 34) - -#define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE + 36) -#define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE + 37) -#define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE + 38) -#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE + 39) -#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE + 40) -#define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE + 41) -#define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 42) -#define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 43) -#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE + 44) -#define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE + 45) -#define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE + 46) -#define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE + 47) -#define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE + 48) -#define ERROR_INTERNET_DIALOG_PENDING (INTERNET_ERROR_BASE + 49) -#define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50) -#define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52) -#define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53) -#define ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED (INTERNET_ERROR_BASE + 54) -#define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55) -#define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56) -#define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57) - -// -// FTP API errors -// - -#define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110) -#define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111) -#define ERROR_FTP_NO_PASSIVE_MODE (INTERNET_ERROR_BASE + 112) - -// -// gopher API errors -// - -#define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE + 130) -#define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE + 131) -#define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE + 132) -#define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE + 133) -#define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE + 134) -#define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE + 135) -#define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE + 136) -#define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE + 137) -#define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE + 138) - -// -// HTTP API errors -// - -#define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE + 150) -#define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE + 151) -#define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE + 152) -#define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE + 153) -#define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE + 154) -#define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE + 155) -#define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE + 156) -#define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE + 160) -#define ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 161) -#define ERROR_HTTP_COOKIE_DECLINED (INTERNET_ERROR_BASE + 162) -#define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 168) - -// -// additional Internet API error codes -// - -#define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE + 157) -#define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE + 158) -#define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE + 159) -#define ERROR_INTERNET_DISCONNECTED (INTERNET_ERROR_BASE + 163) -#define ERROR_INTERNET_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 164) -#define ERROR_INTERNET_PROXY_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 165) - -#define ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT (INTERNET_ERROR_BASE + 166) -#define ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT (INTERNET_ERROR_BASE + 167) -#define ERROR_INTERNET_SEC_INVALID_CERT (INTERNET_ERROR_BASE + 169) -#define ERROR_INTERNET_SEC_CERT_REVOKED (INTERNET_ERROR_BASE + 170) - -// InternetAutodial specific errors - -#define ERROR_INTERNET_FAILED_DUETOSECURITYCHECK (INTERNET_ERROR_BASE + 171) -#define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172) -#define ERROR_INTERNET_NEED_MSN_SSPI_PKG (INTERNET_ERROR_BASE + 173) -#define ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY (INTERNET_ERROR_BASE + 174) - - -#define INTERNET_ERROR_LAST ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY - - -// -// URLCACHE APIs -// - -// -// datatype definitions. -// - -// -// cache entry type flags. -// - -#define NORMAL_CACHE_ENTRY 0x00000001 -#define STICKY_CACHE_ENTRY 0x00000004 -#define EDITED_CACHE_ENTRY 0x00000008 -#define TRACK_OFFLINE_CACHE_ENTRY 0x00000010 -#define TRACK_ONLINE_CACHE_ENTRY 0x00000020 -#define SPARSE_CACHE_ENTRY 0x00010000 -#define COOKIE_CACHE_ENTRY 0x00100000 -#define URLHISTORY_CACHE_ENTRY 0x00200000 - - -// -// INTERNET_CACHE_ENTRY_INFO - -// - - -// -// Cache Group Flags -// -#define CACHEGROUP_ATTRIBUTE_GET_ALL 0xffffffff -#define CACHEGROUP_ATTRIBUTE_BASIC 0x00000001 -#define CACHEGROUP_ATTRIBUTE_FLAG 0x00000002 -#define CACHEGROUP_ATTRIBUTE_TYPE 0x00000004 -#define CACHEGROUP_ATTRIBUTE_QUOTA 0x00000008 -#define CACHEGROUP_ATTRIBUTE_GROUPNAME 0x00000010 -#define CACHEGROUP_ATTRIBUTE_STORAGE 0x00000020 - -#define CACHEGROUP_FLAG_NONPURGEABLE 0x00000001 -#define CACHEGROUP_FLAG_GIDONLY 0x00000004 - -#define CACHEGROUP_FLAG_FLUSHURL_ONDELETE 0x00000002 - -#define CACHEGROUP_SEARCH_ALL 0x00000000 -#define CACHEGROUP_SEARCH_BYURL 0x00000001 - -#define CACHEGROUP_TYPE_INVALID 0x00000001 - -// -// INTERNET_CACHE_GROUP_INFO -// - -#define GROUPNAME_MAX_LENGTH 120 -#define GROUP_OWNER_STORAGE_SIZE 4 - - -#define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004 -#define CACHE_ENTRY_HITRATE_FC 0x00000010 -#define CACHE_ENTRY_MODTIME_FC 0x00000040 -#define CACHE_ENTRY_EXPTIME_FC 0x00000080 -#define CACHE_ENTRY_ACCTIME_FC 0x00000100 -#define CACHE_ENTRY_SYNCTIME_FC 0x00000200 -#define CACHE_ENTRY_HEADERINFO_FC 0x00000400 -#define CACHE_ENTRY_EXEMPT_DELTA_FC 0x00000800 - - -// Flags for InternetAutodial -#define INTERNET_AUTODIAL_FORCE_ONLINE 1 -#define INTERNET_AUTODIAL_FORCE_UNATTENDED 2 +#define HTTP_ADDREQ_FLAG_ADD 0x20000000 +#define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000 +#define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000 +#define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA +#define HTTP_ADDREQ_FLAG_REPLACE 0x80000000 +#define INTERNET_ERROR_BASE 12000 +#define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE+1) +#define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE+2) +#define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE+3) +#define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE+4) +#define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE+5) +#define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE+6) +#define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE+7) +#define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE+8) +#define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE+9) +#define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE+10) +#define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE+11) +#define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE+12) +#define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE+13) +#define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE+14) +#define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE+15) +#define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE+16) +#define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE+17) +#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE+18) +#define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE+19) +#define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE+20) +#define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE+21) +#define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE+22) +#define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE+23) +#define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE+24) +#define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE+25) +#define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE+26) +#define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE+27) +#define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE+28) +#define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE+29) +#define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE+30) +#define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE+31) +#define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE+32) +#define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE+33) +#define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE+34) +#define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE+36) +#define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE+37) +#define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE+38) +#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE+39) +#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE+40) +#define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE+41) +#define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE+42) +#define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE+43) +#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE+44) +#define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE+45) +#define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE+46) +#define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE+47) +#define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE+48) +#define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE+110) +#define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE+111) +#define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE+130) +#define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE+131) +#define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE+132) +#define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE+133) +#define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE+134) +#define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE+135) +#define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE+136) +#define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE+137) +#define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE+138) +#define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE+150) +#define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE+151) +#define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE+152) +#define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE+153) +#define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE+154) +#define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE+155) +#define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE+156) +#define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE+160) +#define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE+157) +#define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE+158) +#define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE+159) +#define INTERNET_ERROR_LAST ERROR_INTERNET_TCPIP_NOT_INSTALLED +#define URLCACHEAPI DECLSPEC_IMPORT +#define NORMAL_CACHE_ENTRY 1 +#define STABLE_CACHE_ENTRY 2 +#define STICKY_CACHE_ENTRY 4 +#define SPARSE_CACHE_ENTRY 0x10000 +#define OCX_CACHE_ENTRY 0x20000 +#define COOKIE_CACHE_ENTRY 0x100000 +#define URLHISTORY_CACHE_ENTRY 0x200000 +#define CACHE_ENTRY_ATTRIBUTE_FC 4 +#define CACHE_ENTRY_HITRATE_FC 0x10 +#define CACHE_ENTRY_MODTIME_FC 0x40 +#define CACHE_ENTRY_EXPTIME_FC 0x80 +#define CACHE_ENTRY_ACCTIME_FC 0x100 +#define CACHE_ENTRY_SYNCTIME_FC 0x200 +#define CACHE_ENTRY_HEADERINFO_FC 0x400 +#define IRF_ASYNC WININET_API_FLAG_ASYNC +#define IRF_SYNC WININET_API_FLAG_SYNC +#define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT +#define IRF_NO_WAIT 8 +#define HSR_ASYNC WININET_API_FLAG_ASYNC +#define HSR_SYNC WININET_API_FLAG_SYNC +#define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT +#define HSR_INITIATE 8 +#define HSR_DOWNLOAD 16 +#define HSR_CHUNKED 32 +#define INTERNET_DIAL_UNATTENDED 0x8000 +#define INTERNET_DIALSTATE_DISCONNECTED 1 +#define INTERENT_GOONLINE_REFRESH 1 +#define INTERENT_GOONLINE_MASK 1 +#define INTERNET_AUTODIAL_FORCE_ONLINE 1 +#define INTERNET_AUTODIAL_FORCE_UNATTENDED 2 #define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4 +#define INTERNET_CONNECTION_MODEM 0x01 +#define INTERNET_CONNECTION_LAN 0x02 +#define INTERNET_CONNECTION_PROXY 0x04 +#define INTERNET_CONNECTION_MODEM_BUSY 0x08 +#define INTERNET_RAS_INSTALLED 0x10 +#define INTERNET_CONNECTION_OFFLINE 0x20 +#define INTERNET_CONNECTION_CONFIGURED 0x40 +#define CACHEGROUP_SEARCH_ALL 0 +#define CACHEGROUP_SEARCH_BYURL 1 +#define INTERNET_CACHE_GROUP_ADD 0 +#define INTERNET_CACHE_GROUP_REMOVE 1 +#define WININET_API_FLAG_ASYNC 0x00000001 +#define WININET_API_FLAG_SYNC 0x00000004 +#define WININET_API_FLAG_USE_CONTEXT 0x00000008 + +#define INTERNET_STATE_CONNECTED 0x0001 +#define INTERNET_STATE_DISCONNECTED 0x0002 +#define INTERNET_STATE_DISCONNECTED_BY_USER 0x0010 +#define INTERNET_STATE_IDLE 0x0100 +#define INTERNET_STATE_BUSY 0x0200 -// Flags for InternetGetConnectedState and Ex -#define INTERNET_CONNECTION_MODEM 0x01 -#define INTERNET_CONNECTION_LAN 0x02 -#define INTERNET_CONNECTION_PROXY 0x04 -#define INTERNET_CONNECTION_MODEM_BUSY 0x08 /* no longer used */ -#define INTERNET_RAS_INSTALLED 0x10 -#define INTERNET_CONNECTION_OFFLINE 0x20 -#define INTERNET_CONNECTION_CONFIGURED 0x40 - -// Flags for custom dial handler -#define INTERNET_CUSTOMDIAL_CONNECT 0 -#define INTERNET_CUSTOMDIAL_UNATTENDED 1 -#define INTERNET_CUSTOMDIAL_DISCONNECT 2 -#define INTERNET_CUSTOMDIAL_SHOWOFFLINE 4 - -// Custom dial handler supported functionality flags -#define INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED 1 -#define INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE 2 -#define INTERNET_CUSTOMDIAL_CAN_HANGUP 4 - diff --git a/harbour-1.0.0RC1/contrib/hbziparch/hbcomprs.c b/harbour-1.0.0RC1/contrib/hbziparch/hbcomprs.c index dd00341226..f98444f6d1 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/hbcomprs.c +++ b/harbour-1.0.0RC1/contrib/hbziparch/hbcomprs.c @@ -3,12 +3,11 @@ */ /* - * xHarbour Project source code: - * Compression related functions + * Harbour Project source code: + * DIRECTORY() related functions * - * Copyright 2003 Giancarlo Niccolai - * www - http://www.xharbour.org - * SEE ALSO COPYRIGHT NOTICE FOR ZLIB BELOW. + * Copyright 1999 Leslee Griffith + * 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 @@ -51,4078 +50,12 @@ * */ -/* This file is based upon ZLIB source code, whose copyright holder is: - * - * Copyright (C) 1995-2002 Jean-loup Gailly. - * - * Also, this file includes code slices from adler32.c for advanced CRC - * Holder of copyright for this code is: - * - * Copyright (C) 1995-2002 Mark Adler - * - * ZLIB (containing adler32 code) can be found at: - * http://www.gzip.org/zlib/ - */ - -#include "hbcomprs.h" -#include "hbchksum.h" #include "hbapi.h" #include "hbapiitm.h" #include "hbapifs.h" -#include "hbstack.h" -#include "directry.ch" -#include "hbdefs.h" -#include "hbvm.h" #include "hbapierr.h" -/* =========================================================================== - * Constants - */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define END_BLOCK 256 -/* end of block literal code */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - -local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -local const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -local const uch bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - -static void * hb_xgrabz( ULONG ulSize ) -{ - void * ptr = hb_xgrab( ulSize ); - memset( ptr, '\0', ulSize ); - return ptr; -} -#undef hb_xgrab -#define hb_xgrab( n ) hb_xgrabz( (n) ) - -/* Number of bits used within bi_buf. (bi_buf might be implemented on - * more than 16 bits on some systems.) - */ -#define Buf_size (8 * 2*sizeof(char)) - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -/* ========================================================================= */ -int HB_EXPORT deflateInit2_( z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, - const char * version, int stream_size) -{ - deflate_state *s; - int noheader = 0; - static const char* my_version = ZLIB_VERSION; - - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - - if (version == NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == NULL) return Z_STREAM_ERROR; - - strm->msg = NULL; - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#ifdef FASTEST - level = 1; -#endif - - if (windowBits < 0) { /* undocumented feature: suppress zlib header */ - noheader = 1; - windowBits = -windowBits; - } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_HUFFMAN_ONLY) { - return Z_STREAM_ERROR; - } - s = (deflate_state *) hb_xgrab( sizeof(deflate_state) ); - if (s == NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; - s->strm = strm; - - s->noheader = noheader; - s->w_bits = windowBits; - s->w_size = 1 << s->w_bits; - s->w_mask = s->w_size - 1; - - s->hash_bits = memLevel + 7; - s->hash_size = 1 << s->hash_bits; - s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - - s->window = (Bytef *) hb_xgrab( s->w_size* 2*sizeof(Byte)); - s->prev = (Posf *) hb_xgrab( s->w_size* sizeof(Pos)); - s->head = (Posf *) hb_xgrab( s->hash_size * sizeof(Pos)); - - s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - overlay = (ushf *) hb_xgrab( s->lit_bufsize * ( sizeof(ush)+2)); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - - if (s->window == NULL || s->prev == NULL || s->head == NULL || - s->pending_buf == NULL) - { - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); - deflateEnd (strm); - return Z_MEM_ERROR; - } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - - s->level = level; - s->strategy = strategy; - s->method = (Byte)method; - - return deflateReset(strm); -} - -int HB_EXPORT deflateInit_( z_streamp strm, int level, const char *version, int stream_size) -{ - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); - /* To do: ignore strm->next_in if we use it as window */ -} - - -/* =========================================================================== - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ -int HB_EXPORT compress ( Bytef * dest, uLongf *destLen, const Bytef * source, uLong sourceLen, int level) -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; - stream.next_out = dest; - stream.avail_out = (uInt) *destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - err = deflateInit(&stream, level); - if (err != Z_OK) return err; - - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; - - err = deflateEnd(&stream); - return err; -} - -#if 0 -const char deflate_copyright[] = - " deflate & inflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly "; -#endif - -/* =========================================================================== - * Function prototypes. - */ -typedef enum { - need_more, /* block not completed, need more input or more output */ - block_done, /* block flush performed */ - finish_started, /* finish started, need only more output at next deflate */ - finish_done /* finish done, accept no more input or output */ -} block_state; - -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); -/* Compression function. Returns the block state after the call. */ - -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); -local block_state deflate_slow OF((deflate_state *s, int flush)); -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif - - -/* =========================================================================== - * Local data - */ - -#define NIL 0 -/* Tail of hash chains */ - -#ifndef TOO_FAR -# define TOO_FAR 4096 -#endif -/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -typedef struct config_s { - ush good_length; /* reduce lazy search above this match length */ - ush max_lazy; /* do not perform lazy search above this match length */ - ush nice_length; /* quit search above this match length */ - ush max_chain; - compress_func func; -} config; - -local const config configuration_table[10] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */ -/* 2 */ {4, 5, 16, 8, deflate_fast}, -/* 3 */ {4, 6, 32, 32, deflate_fast}, - -/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ -/* 5 */ {8, 16, 32, 32, deflate_slow}, -/* 6 */ {8, 16, 128, 128, deflate_slow}, -/* 7 */ {8, 32, 128, 256, deflate_slow}, -/* 8 */ {32, 128, 258, 1024, deflate_slow}, -/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */ - -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 - * For deflate_fast() (levels <= 3) good is ignored and lazy has a different - * meaning. - */ - -#define EQUAL 0 -/* result of memcmp for equal strings */ - -/* =========================================================================== - * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. - */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) - - -/* =========================================================================== - * Insert string str in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * If this file is compiled with -DFASTEST, the compression level is forced - * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ -#ifdef FASTEST -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#define INSERT_STRING_2(s, str ) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - s->head[s->ins_h] = (Pos)(str)) -#else -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#define INSERT_STRING_2(s, str ) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#endif - -/* =========================================================================== - * Initialize the hash table (avoiding 64K overflow for 16 bit systems). - * prev[] will be initialized on the fly. - */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - memset((Bytef *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head)); -/* ========================================================================= */ - -/* ========================================================================= */ -int HB_EXPORT deflateSetDictionary ( z_streamp strm, const Bytef * dictionary, UINT dictLength) -{ - deflate_state *s; - uInt length = dictLength; - uInt n; - //IPos hash_head = 0; - - if (strm == NULL || strm->state == NULL || dictionary == NULL || - strm->state->status != INIT_STATE) return Z_STREAM_ERROR; - - s = strm->state; - strm->adler = adler32(strm->adler, dictionary, dictLength); - - if (length < MIN_MATCH) return Z_OK; - if (length > MAX_DIST(s)) { - length = MAX_DIST(s); -#ifndef USE_DICT_HEAD - dictionary += dictLength - length; /* use the tail of the dictionary */ -#endif - } - memcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (LONG)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING_2(s, n ); - } - return Z_OK; -} - -/* ========================================================================= */ -int HB_EXPORT deflateReset ( z_streamp strm) -{ - deflate_state *s; - - if (strm == NULL || strm->state == NULL ) - { - return Z_STREAM_ERROR; - } - - strm->total_in = strm->total_out = 0; - strm->msg = NULL; /* use hb_xfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; - - s = (deflate_state *)strm->state; - s->pending = 0; - s->pending_out = s->pending_buf; - - if (s->noheader < 0) - { - s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */ - } - s->status = s->noheader ? BUSY_STATE : INIT_STATE; - strm->adler = 1; - s->last_flush = Z_NO_FLUSH; - - _tr_init(s); - lm_init(s); - - return Z_OK; -} - -/* ========================================================================= */ -int HB_EXPORT deflateParams( z_streamp strm, int level, int strategy) -{ - deflate_state *s; - compress_func func; - int err = Z_OK; - - if (strm == NULL || strm->state == NULL) - { - return Z_STREAM_ERROR; - } - - s = strm->state; - - if (level == Z_DEFAULT_COMPRESSION) - { - level = 6; - } - - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) - { - return Z_STREAM_ERROR; - } - func = configuration_table[s->level].func; - - if (func != configuration_table[level].func && strm->total_in != 0) - { - /* Flush the last buffer: */ - err = deflate(strm, Z_PARTIAL_FLUSH); - } - - if (s->level != level) - { - s->level = level; - s->max_lazy_match = configuration_table[level].max_lazy; - s->good_match = configuration_table[level].good_length; - s->nice_match = configuration_table[level].nice_length; - s->max_chain_length = configuration_table[level].max_chain; - } - s->strategy = strategy; - return err; -} - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -local void putShortMSB ( deflate_state *s, UINT b) -{ - put_byte(s, (Byte)(b >> 8)); - put_byte(s, (Byte)(b & 0xff)); -} - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). - */ -local void flush_pending( z_streamp strm) -{ - unsigned len = strm->state->pending; - - if (len > strm->avail_out) len = strm->avail_out; - if (len == 0) return; - - memcpy(strm->next_out, strm->state->pending_out, len); - strm->next_out += len; - strm->state->pending_out += len; - strm->total_out += len; - strm->avail_out -= len; - strm->state->pending -= len; - if (strm->state->pending == 0) { - strm->state->pending_out = strm->state->pending_buf; - } -} - -/* ========================================================================= */ -int HB_EXPORT deflate ( z_streamp strm, int flush) -{ - int old_flush; /* value of flush param for previous deflate call */ - deflate_state *s; - - if (strm == NULL || strm->state == NULL || - flush > Z_FINISH || flush < 0) { - return Z_STREAM_ERROR; - } - s = strm->state; - - if (strm->next_out == NULL || - (strm->next_in == NULL && strm->avail_in != 0) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); - } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - - s->strm = strm; /* just in case */ - old_flush = s->last_flush; - s->last_flush = flush; - - /* Write the zlib header */ - if (s->status == INIT_STATE) { - - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags = (s->level-1) >> 1; - - if (level_flags > 3) level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); - - s->status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - strm->adler = 1L; - } - - /* Flush as much pending output as possible */ - if (s->pending != 0) { - flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s->last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUFF_ERROR. - */ - } else if (strm->avail_in == 0 && flush <= old_flush && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { - block_state bstate; - - bstate = (*(configuration_table[s->level].func))(s, flush); - - if (bstate == finish_started || bstate == finish_done) { - s->status = FINISH_STATE; - } - if (bstate == need_more || bstate == finish_started) { - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { - _tr_align(s); - } else { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block(s, (char*)0, 0L, 0); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush == Z_FULL_FLUSH) { - CLEAR_HASH(s); /* forget history */ - } - } - flush_pending(strm); - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - - if (flush != Z_FINISH) return Z_OK; - if (s->noheader) return Z_STREAM_END; - - /* Write the zlib trailer (adler32) */ - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - s->noheader = -1; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; -} - -/* ========================================================================= */ -int HB_EXPORT deflateEnd ( z_streamp strm ) -{ - int status; - - if (strm == NULL || strm->state == NULL) - { - return Z_STREAM_ERROR; - } - - status = strm->state->status; - if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) - { - return Z_STREAM_ERROR; - } - - /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm->state->pending_buf); - TRY_FREE(strm->state->head); - TRY_FREE(strm->state->prev); - TRY_FREE(strm->state->window); - - hb_xfree(strm->state); - strm->state = NULL; - - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; -} - -/* ========================================================================= - * Copy the source state to the destination state. - * To simplify the source, this is not supported for 16-bit MSDOS (which - * doesn't have enough memory anyway to duplicate compression states). - */ -int HB_EXPORT deflateCopy (z_streamp dest, z_streamp source ) -{ -#ifdef MAXSEG_64K - return Z_STREAM_ERROR; -#else - deflate_state *ds; - deflate_state *ss; - ushf *overlay; - - - if (source == NULL || dest == NULL || source->state == NULL) { - return Z_STREAM_ERROR; - } - - ss = source->state; - - *dest = *source; - - ds = (deflate_state *) hb_xgrab( sizeof(deflate_state)); - if (ds == NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; - *ds = *ss; - ds->strm = dest; - - ds->window = (Bytef *) hb_xgrab( ds->w_size * 2*sizeof(Byte)); - ds->prev = (Posf *) hb_xgrab( ds->w_size * sizeof(Pos)); - ds->head = (Posf *) hb_xgrab( ds->hash_size * sizeof(Pos)); - overlay = (ushf *) hb_xgrab( ds->lit_bufsize * (sizeof(ush)+2)); - ds->pending_buf = (uchf *) overlay; - - if (ds->window == NULL || ds->prev == NULL || ds->head == NULL || - ds->pending_buf == NULL) { - deflateEnd (dest); - return Z_MEM_ERROR; - } - /* following memcpy do not work for 16-bit MSDOS */ - memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - memcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); - memcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); - memcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); - - ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; - - ds->l_desc.dyn_tree = ds->dyn_ltree; - ds->d_desc.dyn_tree = ds->dyn_dtree; - ds->bl_desc.dyn_tree = ds->bl_tree; - - return Z_OK; -#endif -} - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local int read_buf( z_streamp strm, Bytef *buf, unsigned size ) -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - if (!strm->state->noheader) { - strm->adler = adler32(strm->adler, strm->next_in, len); - } - memcpy(buf, strm->next_in, len); - strm->next_in += len; - strm->total_in += len; - - return (int)len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init ( deflate_state *s ) -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -} - -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -#ifndef FASTEST -local uInt longest_match( deflate_state *s, IPos cur_match ) - /* current match */ -{ - unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ - int nice_match = s->nice_match; /* stop if match long enough */ - IPos limit = s->strstart > (IPos)MAX_DIST(s) ? - s->strstart - (IPos)MAX_DIST(s) : NIL; - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - Posf *prev = s->prev; - uInt wmask = s->w_mask; - -#ifdef UNALIGNED_OK - /* Compare two bytes at a time. Note: this is not always beneficial. - * Try with and without -DUNALIGNED_OK to check. - */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); -#else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; -#endif - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - - /* Do not waste too much time if we already have a good match: */ - if (s->prev_length >= s->good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - do { - match = s->window + cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: - */ -#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) - /* This code assumes sizeof(USHORT) == 2. Do not use - * UNALIGNED_OK if your compiler uses a different size. - */ - if (*(ushf*)(match+best_len-1) != scan_end || - *(ushf*)match != scan_start) continue; - - /* It is not necessary to compare scan[2] and match[2] since they are - * always equal when the other bytes match, given that the hash keys - * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient - * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is - * necessary to put more guard bytes at the end of the window, or - * to check more often for insufficient lookahead. - */ - scan++, match++; - do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - scan < strend); - /* The funny "do {}" generates better code on most compilers */ - - /* Here, scan <= window+strstart+257 */ - if (*scan == *match) scan++; - - len = (MAX_MATCH - 1) - (int)(strend-scan); - scan = strend - (MAX_MATCH-1); - -#else /* UNALIGNED_OK */ - - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match++; - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - -#endif /* UNALIGNED_OK */ - - if (len > best_len) { - s->match_start = cur_match; - best_len = len; - if (len >= nice_match) break; -#ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); -#else - scan_end1 = scan[best_len-1]; - scan_end = scan[best_len]; -#endif - } - } while ((cur_match = prev[cur_match & wmask]) > limit - && --chain_length != 0); - - if ((uInt)best_len <= s->lookahead) return (uInt)best_len; - return s->lookahead; -} - -#else /* FASTEST */ -/* --------------------------------------------------------------------------- - * Optimized version for level == 1 only - */ -local uInt longest_match( deflate_state *s, IPos cur_match ) - /* current match */ -{ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - - match = s->window + cur_match; - - /* Return failure if the match length is less than 2: - */ - if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match += 2; - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - len = MAX_MATCH - (int)(strend - scan); - - if (len < MIN_MATCH) return MIN_MATCH - 1; - - s->match_start = cur_match; - return len <= s->lookahead ? len : s->lookahead; -} -#endif /* FASTEST */ -#endif /* ASMV */ - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window( deflate_state *s ) -{ - register unsigned n, m; - register Posf *p; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ - more--; - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - } else if (s->strstart >= wsize+MAX_DIST(s)) { - - memcpy(s->window, s->window+wsize, (unsigned)wsize); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (LONG) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif - more += wsize; - } - if (s->strm->avail_in == 0) return; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead >= MIN_MATCH) { - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); -} - -/* =========================================================================== - * Flush the current block, with given end-of-file flag. - * IN assertion: strstart is set to the end of the current match. - */ -#define FLUSH_BLOCK_ONLY(s, eof) { \ - _tr_flush_block(s, (s->block_start >= 0L ? \ - (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)NULL), \ - (ulg)((LONG)s->strstart - s->block_start), \ - (eof)); \ - s->block_start = s->strstart; \ - flush_pending(s->strm); \ -} - -/* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, eof) { \ - FLUSH_BLOCK_ONLY(s, eof); \ - if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -local block_state deflate_stored( deflate_state *s, int flush ) -{ - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; - - if (s->lookahead == 0) break; /* flush the current block */ - } - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); - } - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -local block_state deflate_fast( deflate_state *s, int flush ) -{ - IPos hash_head = NIL; /* head of the hash chain */ - int bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - if (s->strategy != Z_HUFFMAN_ONLY) { - s->match_length = longest_match (s, hash_head); - } - /* longest_match() sets match_start */ - } - if (s->match_length >= MIN_MATCH) { - - _tr_tally_dist(s, s->strstart - s->match_start, - s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ -#ifndef FASTEST - if (s->match_length <= s->max_insert_length && - s->lookahead >= MIN_MATCH) { - s->match_length--; /* string at strstart already in hash table */ - do { - s->strstart++; - INSERT_STRING(s, s->strstart, hash_head); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s->match_length != 0); - s->strstart++; - } else -#endif - { - s->strstart += s->match_length; - s->match_length = 0; - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -local block_state deflate_slow( deflate_state *s, int flush ) -{ - IPos hash_head = NIL; /* head of hash chain */ - int bflush; /* set if current block must be flushed */ - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - */ - s->prev_length = s->match_length, s->prev_match = s->match_start; - s->match_length = MIN_MATCH-1; - - if (hash_head != NIL && s->prev_length < s->max_lazy_match && - s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - if (s->strategy != Z_HUFFMAN_ONLY) { - s->match_length = longest_match (s, hash_head); - } - /* longest_match() sets match_start */ - - if (s->match_length <= 5 && (s->strategy == Z_FILTERED || - (s->match_length == MIN_MATCH && - s->strstart - s->match_start > TOO_FAR))) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s->match_length = MIN_MATCH-1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - _tr_tally_dist(s, s->strstart -1 - s->prev_match, - s->prev_length - MIN_MATCH, bflush); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s->lookahead -= s->prev_length-1; - s->prev_length -= 2; - do { - if (++s->strstart <= max_insert) { - INSERT_STRING(s, s->strstart, hash_head); - } - } while (--s->prev_length != 0); - s->match_available = 0; - s->match_length = MIN_MATCH-1; - s->strstart++; - - if (bflush) FLUSH_BLOCK(s, 0); - - } else if (s->match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - if (bflush) { - FLUSH_BLOCK_ONLY(s, 0); - } - s->strstart++; - s->lookahead--; - if (s->strm->avail_out == 0) return need_more; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s->match_available = 1; - s->strstart++; - s->lookahead--; - } - } - if (s->match_available) { - _tr_tally_lit_2(s, s->window[s->strstart-1] ); - s->match_available = 0; - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - - -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - - -const char *z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; - - -HB_EXPORT const char * zlibVersion() -{ - return ZLIB_VERSION; -} - -/* exported to allow conversion of error code to string for compress() and - * uncompress() - */ -HB_EXPORT const char * zError( int err) -{ - return ERR_MSG(err); -} - - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -local static_tree_desc static_l_desc = -{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; - -local static_tree_desc static_d_desc = -{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; - -local static_tree_desc static_bl_desc = -{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; - -/* =========================================================================== - * Local (static) routines in this file. - */ - -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); -local void set_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); - -#define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) - /* Send a code of the given tree. c and tree must not have side effects */ - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ - -#define send_bits(s, value, length) \ -{ int len = length;\ - if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ - s->bi_buf |= (val << s->bi_valid);\ - put_short(s, s->bi_buf);\ - s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ - s->bi_valid += len - Buf_size;\ - } else {\ - s->bi_buf |= (value) << s->bi_valid;\ - s->bi_valid += len;\ - }\ -} - - -/* the arguments must not have side effects */ - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -void _tr_init( deflate_state *s ) -{ - s->l_desc.dyn_tree = s->dyn_ltree; - s->l_desc.stat_desc = &static_l_desc; - - s->d_desc.dyn_tree = s->dyn_dtree; - s->d_desc.stat_desc = &static_d_desc; - - s->bl_desc.dyn_tree = s->bl_tree; - s->bl_desc.stat_desc = &static_bl_desc; - - s->bi_buf = 0; - s->bi_valid = 0; - s->last_eob_len = 8; /* enough lookahead for inflate */ - - /* Initialize the first block of the first file: */ - init_block(s); -} - -/* =========================================================================== - * Initialize a new block. - */ -local void init_block( deflate_state *s ) -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; -} - -#define SMALLEST 1 -/* Index within the heap array of least frequent node in the Huffman tree */ - - -/* =========================================================================== - * Remove the smallest element from the heap and recreate the heap with - * one less element. Updates heap and heap_len. - */ -#define pqremove(s, tree, top) \ -{\ - top = s->heap[SMALLEST]; \ - s->heap[SMALLEST] = s->heap[s->heap_len--]; \ - pqdownheap(s, tree, SMALLEST); \ -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -#define smaller(tree, n, m, depth) \ - (tree[n].Freq < tree[m].Freq || \ - (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -local void pqdownheap( - deflate_state *s, - ct_data *tree, /* the tree to restore */ - int k) /* node to move down */ -{ - int v = s->heap[k]; - int j = k << 1; /* left son of k */ - while (j <= s->heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s->heap[j], s->depth)) break; - - /* Exchange v with the smallest son */ - s->heap[k] = s->heap[j]; k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s->heap[k] = v; -} - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -local void gen_bitlen( - deflate_state *s, - tree_desc *desc) /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - int max_code = desc->max_code; - const ct_data *stree = desc->stat_desc->static_tree; - const intf *extra = desc->stat_desc->extra_bits; - int base = desc->stat_desc->extra_base; - int max_length = desc->stat_desc->max_length; - int h; /* heap index */ - int n, m; /* iterate over the tree elements */ - int bits; /* bit length */ - int xbits; /* extra bits */ - ush f; /* frequency */ - int overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { - n = s->heap[h]; - bits = tree[tree[n].Dad].Len + 1; - if (bits > max_length) bits = max_length, overflow++; - tree[n].Len = (ush)bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) continue; /* not a leaf node */ - - s->bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n-base]; - f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); - } - if (overflow == 0) return; - - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length-1; - while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ - s->bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = s->bl_count[bits]; - while (n != 0) { - m = s->heap[--h]; - if (m > max_code) continue; - if ((unsigned)tree[m].Len != (unsigned) bits) { - s->opt_len += ((LONG)bits - (LONG)tree[m].Len) - *(LONG)tree[m].Freq; - tree[m].Len = (ush)bits; - } - n--; - } - } -} - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes( - ct_data *tree, /* the tree to decorate */ - int max_code, /* largest code with non zero frequency */ - ushf *bl_count) /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - - for (n = 0; n <= max_code; n++) { - int len = tree[n].Len; - if (len == 0) continue; - /* Now reverse the bits */ - tree[n].Code = bi_reverse(next_code[len]++, len); - - } -} - -/* =========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ -local void build_tree( - deflate_state *s, - tree_desc *desc) /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - const ct_data *stree = desc->stat_desc->static_tree; - int elems = desc->stat_desc->elems; - int n, m; /* iterate over heap elements */ - int max_code = -1; /* largest code with non zero frequency */ - int node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s->heap_len = 0, s->heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].Freq != 0) { - s->heap[++(s->heap_len)] = max_code = n; - s->depth[n] = 0; - } else { - tree[n].Len = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s->heap_len < 2) { - node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); - tree[node].Freq = 1; - s->depth[node] = 0; - s->opt_len--; if (stree) s->static_len -= stree[node].Len; - /* node is 0 or 1 so it does not have extra bits */ - } - desc->max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - pqremove(s, tree, n); /* n = node of least frequency */ - m = s->heap[SMALLEST]; /* m = node of next least frequency */ - - s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ - s->heap[--(s->heap_max)] = m; - - /* Create a new node father of n and m */ - tree[node].Freq = tree[n].Freq + tree[m].Freq; - s->depth[node] = (uch) (HB_MAX(s->depth[n], s->depth[m]) + 1); - tree[n].Dad = tree[m].Dad = (ush)node; -#ifdef DUMP_BL_TREE - if (tree == s->bl_tree) { - fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", - node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); - } -#endif - /* and insert the new node in the heap */ - s->heap[SMALLEST] = node++; - pqdownheap(s, tree, SMALLEST); - - } while (s->heap_len >= 2); - - s->heap[--(s->heap_max)] = s->heap[SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, (tree_desc *)desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes ((ct_data *)tree, max_code, s->bl_count); -} - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -local void scan_tree( - deflate_state *s, - ct_data *tree, /* the tree to be scanned */ - int max_code) /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; - } else if (curlen != 0) { - if (curlen != prevlen) s->bl_tree[curlen].Freq++; - s->bl_tree[REP_3_6].Freq++; - } else if (count <= 10) { - s->bl_tree[REPZ_3_10].Freq++; - } else { - s->bl_tree[REPZ_11_138].Freq++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -local void send_tree( - deflate_state *s, - ct_data *tree, /* the tree to be scanned */ - int max_code) /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen == 0) max_count = 138, min_count = 3; - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { send_code(s, curlen, s->bl_tree); } while (--count != 0); - - } else if (curlen != 0) { - if (curlen != prevlen) { - send_code(s, curlen, s->bl_tree); count--; - } - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); - - } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -local int build_bl_tree( deflate_state *s ) -{ - int max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); - scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; - - return max_blindex; -} - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -local void send_all_trees( deflate_state *s, int lcodes, int dcodes, int blcodes) - /* number of codes for each tree */ -{ - int rank; /* index in bl_order */ - - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); - } - - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ - - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ -} - -/* =========================================================================== - * Send a stored block - */ -void _tr_stored_block( - deflate_state *s, - charf *buf, /* input block */ - ulg stored_len, /* length of input block */ - int eof) /* true if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ -} - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - * The current inflate code requires 9 bits of lookahead. If the - * last two codes for the previous block (real code plus EOB) were coded - * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode - * the last real code. In this case we send two empty static blocks instead - * of one. (There are no problems if the previous block is stored or fixed.) - * To simplify the code, we assume the worst case of last real code encoded - * on one bit only. - */ -void _tr_align( deflate_state *s ) -{ send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); - /* Of the 10 bits for the empty block, we have already sent - * (10 - bi_valid) bits. The lookahead for the last real code (before - * the EOB of the previous block) was thus at least one plus the length - * of the EOB plus what we have just sent of the empty static block. - */ - if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); - } - s->last_eob_len = 7; -} - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -void _tr_flush_block( - deflate_state *s, - charf *buf, /* input block, or NULL if too old */ - ulg stored_len, /* length of input block */ - int eof) /* true if this is the last block for a file */ -{ - ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s->level > 0) { - - /* Check if the file is ascii or binary */ - if (s->data_type == Z_UNKNOWN) set_data_type(s); - - /* Construct the literal and distance trees */ - build_tree(s, (tree_desc *)(&(s->l_desc))); - - build_tree(s, (tree_desc *)(&(s->d_desc))); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute first the block length in bytes*/ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - } else { - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - -#ifdef FORCE_STORED - if (buf != (char*)0) { /* force stored block */ -#else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { - /* 4: two words for the lengths */ -#endif - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, eof); - -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+eof, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); - } else { - send_bits(s, (DYN_TREES<<1)+eof, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); - } - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (eof) { - bi_windup(s); - } -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -int _tr_tally ( - deflate_state *s, - unsigned dist, /* distance of matched string */ - unsigned lc) /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; - if (dist == 0) { - /* lc is the unmatched char */ - s->dyn_ltree[lc].Freq++; - } else { - s->matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; - s->dyn_dtree[d_code(dist)].Freq++; - } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((LONG)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block( - deflate_state *s, - ct_data *ltree, /* literal tree */ - ct_data *dtree) /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - - } while (lx < s->last_lit); - - send_code(s, END_BLOCK, ltree); - s->last_eob_len = ltree[END_BLOCK].Len; -} - -/* =========================================================================== - * Set the data type to ASCII or BINARY, using a crude approximation: - * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. - * IN assertion: the fields freq of dyn_ltree are set and the total of all - * frequencies does not exceed 64K (to fit in an int on 16 bit machines). - */ -local void set_data_type( deflate_state *s ) -{ - int n = 0; - unsigned ascii_freq = 0; - unsigned bin_freq = 0; - while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; - while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; - while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse( - unsigned code, /* the value to invert */ - int len) /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush( deflate_state *s ) -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup( deflate_state *s ) -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block( - deflate_state *s, - charf *buf, /* the input data */ - unsigned len, /* its length */ - int header) /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - s->last_eob_len = 8; /* enough lookahead for inflate */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); - } - while (len--) { - put_byte(s, *buf++); - } -} - - -int HB_EXPORT inflateInit2_( -z_streamp z, -int w, -const char *version, -int stream_size) -{ - if (version == NULL || version[0] != ZLIB_VERSION[0] || - stream_size != sizeof(z_stream)) - return Z_VERSION_ERROR; - - /* initialize state */ - if (z == NULL) - return Z_STREAM_ERROR; - z->msg = NULL; - if ((z->inf_state = (struct inflate_internal_state FAR *) - hb_xgrab( sizeof(struct inflate_internal_state))) == NULL) - return Z_MEM_ERROR; - z->inf_state->blocks = NULL; - - /* handle undocumented nowrap option (no zlib header or check) */ - z->inf_state->nowrap = 0; - if (w < 0) - { - w = - w; - z->inf_state->nowrap = 1; - } - - /* set window size */ - if (w < 8 || w > 15) - { - inflateEnd(z); - return Z_STREAM_ERROR; - } - z->inf_state->wbits = (uInt)w; - - /* create inflate_blocks state */ - if ((z->inf_state->blocks = - inflate_blocks_new(z, z->inf_state->nowrap ? NULL : adler32, (uInt)1 << w)) - == NULL) - { - inflateEnd(z); - return Z_MEM_ERROR; - } - - /* reset state */ - inflateReset(z); - return Z_OK; -} - - -int HB_EXPORT inflateInit_( -z_streamp z, -const char *version, -int stream_size) -{ - return inflateInit2_(z, DEF_WBITS, version, stream_size); -} - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ -int HB_EXPORT uncompress ( - Bytef *dest, - uLongf *destLen, - const Bytef *source, - uLong sourceLen) -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; -} - - -/* inflate.c -- zlib interface to inflate modules - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -int HB_EXPORT inflateReset( z_streamp z ) -{ - if (z == NULL || z->inf_state == NULL) - return Z_STREAM_ERROR; - z->total_in = z->total_out = 0; - z->msg = NULL; - z->inf_state->mode = z->inf_state->nowrap ? BLOCKS : METHOD; - inflate_blocks_reset(z->inf_state->blocks, z, NULL); - return Z_OK; -} - - -int HB_EXPORT inflateEnd( z_streamp z ) -{ - if (z == NULL || z->inf_state == NULL ) - return Z_STREAM_ERROR; - if (z->inf_state->blocks != NULL) - inflate_blocks_free(z->inf_state->blocks, z); - hb_xfree(z->inf_state); - z->inf_state = NULL; - return Z_OK; -} - - -int HB_EXPORT inflate( -z_streamp z, -int f) -{ - int r; - uInt b; - - if (z == NULL || z->inf_state == NULL || z->next_in == NULL) - return Z_STREAM_ERROR; - f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; - r = Z_BUF_ERROR; - while (1) switch (z->inf_state->mode) - { - case METHOD: - INF_NEEDBYTE - if (((z->inf_state->sub.method = INF_NEXTBYTE) & 0xf) != Z_DEFLATED) - { - z->inf_state->mode = BAD; - z->msg = (char*)"unknown compression method"; - z->inf_state->sub.marker = 5; /* can't try inflateSync */ - break; - } - if ((z->inf_state->sub.method >> 4) + 8 > z->inf_state->wbits) - { - z->inf_state->mode = BAD; - z->msg = (char*)"invalid window size"; - z->inf_state->sub.marker = 5; /* can't try inflateSync */ - break; - } - z->inf_state->mode = FLAG; - case FLAG: - INF_NEEDBYTE - b = INF_NEXTBYTE; - if (((z->inf_state->sub.method << 8) + b) % 31) - { - z->inf_state->mode = BAD; - z->msg = (char*)"incorrect header check"; - z->inf_state->sub.marker = 5; /* can't try inflateSync */ - break; - } - if (!(b & PRESET_DICT)) - { - z->inf_state->mode = BLOCKS; - break; - } - z->inf_state->mode = DICT4; - case DICT4: - INF_NEEDBYTE - z->inf_state->sub.check.need = (uLong)INF_NEXTBYTE << 24; - z->inf_state->mode = DICT3; - case DICT3: - INF_NEEDBYTE - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE << 16; - z->inf_state->mode = DICT2; - case DICT2: - INF_NEEDBYTE - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE << 8; - z->inf_state->mode = DICT1; - case DICT1: - INF_NEEDBYTE_2 - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE; - z->adler = z->inf_state->sub.check.need; - z->inf_state->mode = DICT0; - return Z_NEED_DICT; - case DICT0: - z->inf_state->mode = BAD; - z->msg = (char*)"need dictionary"; - z->inf_state->sub.marker = 0; /* can try inflateSync */ - return Z_STREAM_ERROR; - case BLOCKS: - r = inflate_blocks(z->inf_state->blocks, z, r); - if (r == Z_DATA_ERROR) - { - z->inf_state->mode = BAD; - z->inf_state->sub.marker = 0; /* can try inflateSync */ - break; - } - if (r == Z_OK) - r = f; - if (r != Z_STREAM_END) - return r; - r = f; - inflate_blocks_reset(z->inf_state->blocks, z, &z->inf_state->sub.check.was); - if (z->inf_state->nowrap) - { - z->inf_state->mode = DONE; - break; - } - z->inf_state->mode = CHECK4; - case CHECK4: - INF_NEEDBYTE - z->inf_state->sub.check.need = (uLong)INF_NEXTBYTE << 24; - z->inf_state->mode = CHECK3; - case CHECK3: - INF_NEEDBYTE - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE << 16; - z->inf_state->mode = CHECK2; - case CHECK2: - INF_NEEDBYTE - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE << 8; - z->inf_state->mode = CHECK1; - case CHECK1: - INF_NEEDBYTE - z->inf_state->sub.check.need += (uLong)INF_NEXTBYTE; - - if (z->inf_state->sub.check.was != z->inf_state->sub.check.need) - { - z->inf_state->mode = BAD; - z->msg = (char*)"incorrect data check"; - z->inf_state->sub.marker = 5; /* can't try inflateSync */ - break; - } - z->inf_state->mode = DONE; - case DONE: - return Z_STREAM_END; - case BAD: - return Z_DATA_ERROR; - default: - return Z_STREAM_ERROR; - } -#ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ -#endif -} - - -int HB_EXPORT inflateSetDictionary( -z_streamp z, -const Bytef *dictionary, -uInt dictLength) -{ - uInt length = dictLength; - - if (z == NULL || z->inf_state == NULL || z->inf_state->mode != DICT0) - return Z_STREAM_ERROR; - - if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; - z->adler = 1L; - - if (length >= ((uInt)1<inf_state->wbits)) - { - length = (1<inf_state->wbits)-1; - dictionary += dictLength - length; - } - inflate_set_dictionary(z->inf_state->blocks, dictionary, length); - z->inf_state->mode = BLOCKS; - return Z_OK; -} - - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - -/* Table for deflate from PKZIP's appnote.txt. */ -local const uInt border[] = { /* Order of the bit length code lengths */ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -void inflate_blocks_reset( -inflate_blocks_statef *s, -z_streamp z, -uLongf *c) -{ - if (c != NULL) - *c = s->check; - if (s->mode == BTREE || s->mode == DTREE) - hb_xfree(s->sub.trees.blens); - if (s->mode == CODES) - inflate_codes_free(s->sub.decode.codes, z); - s->mode = TYPE; - s->bitk = 0; - s->bitb = 0; - s->read = s->write = s->window; - if (s->checkfn != NULL) - z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)NULL, 0); -} - - -inflate_blocks_statef *inflate_blocks_new( -z_streamp z, -check_func c, -uInt w) -{ - inflate_blocks_statef *s; - - if ((s = (inflate_blocks_statef *) hb_xgrab(sizeof(struct inflate_blocks_state))) == NULL) - return s; - if ((s->hufts = - (inflate_huft *)hb_xgrab( sizeof(inflate_huft) * MANY)) == NULL) - { - hb_xfree(s); - return NULL; - } - if ((s->window = (Bytef *) hb_xgrab( w )) == NULL) - { - hb_xfree(s->hufts); - hb_xfree(s); - return NULL; - } - s->end = s->window + w; - s->checkfn = c; - s->mode = TYPE; - inflate_blocks_reset(s, z, NULL); - return s; -} - - -int inflate_blocks( -inflate_blocks_statef *s, -z_streamp z, -int r) -{ - uInt t; /* temporary storage */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - - /* copy input/output information to locals (UPDATE macro restores) */ - LOAD - - /* process input based on current state */ - while (1) switch (s->mode) - { - case TYPE: - NEEDBITS(3) - t = (uInt)b & 7; - s->last = t & 1; - switch (t >> 1) - { - case 0: /* stored */ - DUMPBITS(3) - t = k & 7; /* go to byte boundary */ - DUMPBITS(t) - s->mode = LENS; /* get length of stored block */ - break; - case 1: /* fixed */ - { - uInt bl, bd; - inflate_huft *tl, *td; - - - #ifdef BUILDFIXED - inflate_trees_fixed(&bl, &bd, &tl, &td, z); - #else - inflate_trees_fixed(&bl, &bd, &tl, &td ); - #endif - s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); - if (s->sub.decode.codes == NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - } - DUMPBITS(3) - s->mode = CODES; - break; - case 2: /* dynamic */ - DUMPBITS(3) - s->mode = TABLE; - break; - case 3: /* illegal */ - DUMPBITS(3) - s->mode = BLOCK_BAD; - z->msg = (char*)"invalid block type"; - r = Z_DATA_ERROR; - LEAVE - } - break; - case LENS: - NEEDBITS(32) - if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) - { - s->mode = BLOCK_BAD; - z->msg = (char*)"invalid stored block lengths"; - r = Z_DATA_ERROR; - LEAVE - } - s->sub.left = (uInt)b & 0xffff; - b = k = 0; /* dump bits */ - s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); - break; - case STORED: - if (n == 0) - LEAVE - NEEDOUT - t = s->sub.left; - if (t > n) t = n; - if (t > m) t = m; - memcpy(q, p, t); - p += t; n -= t; - q += t; m -= t; - if ((s->sub.left -= t) != 0) - break; - s->mode = s->last ? DRY : TYPE; - break; - case TABLE: - NEEDBITS(14) - s->sub.trees.table = t = (uInt)b & 0x3fff; -#ifndef PKZIP_BUG_WORKAROUND - if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) - { - s->mode = BLOCK_BAD; - z->msg = (char*)"too many length or distance symbols"; - r = Z_DATA_ERROR; - LEAVE - } -#endif - t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); - if ((s->sub.trees.blens = (uIntf*)hb_xgrab( t * sizeof(uInt))) == NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - DUMPBITS(14) - s->sub.trees.index = 0; - s->mode = BTREE; - case BTREE: - while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) - { - NEEDBITS(3) - s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; - DUMPBITS(3) - } - while (s->sub.trees.index < 19) - s->sub.trees.blens[border[s->sub.trees.index++]] = 0; - s->sub.trees.bb = 7; - t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, - &s->sub.trees.tb, s->hufts, z); - if (t != Z_OK) - { - r = t; - if (r == Z_DATA_ERROR) - { - hb_xfree(s->sub.trees.blens); - s->mode = BLOCK_BAD; - } - LEAVE - } - s->sub.trees.index = 0; - s->mode = DTREE; - case DTREE: - while (t = s->sub.trees.table, - s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) - { - inflate_huft *h; - uInt i, j, c; - - t = s->sub.trees.bb; - NEEDBITS(t) - h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); - t = h->bits; - c = h->base; - if (c < 16) - { - DUMPBITS(t) - s->sub.trees.blens[s->sub.trees.index++] = c; - } - else /* c == 16..18 */ - { - i = c == 18 ? 7 : c - 14; - j = c == 18 ? 11 : 3; - NEEDBITS(t + i) - DUMPBITS(t) - j += (uInt)b & inflate_mask[i]; - DUMPBITS(i) - i = s->sub.trees.index; - t = s->sub.trees.table; - if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || - (c == 16 && i < 1)) - { - hb_xfree(s->sub.trees.blens); - s->mode = BLOCK_BAD; - z->msg = (char*)"invalid bit length repeat"; - r = Z_DATA_ERROR; - LEAVE - } - c = c == 16 ? s->sub.trees.blens[i - 1] : 0; - do { - s->sub.trees.blens[i++] = c; - } while (--j); - s->sub.trees.index = i; - } - } - s->sub.trees.tb = NULL; - { - uInt bl, bd; - inflate_huft *tl, *td; - inflate_codes_statef *c; - - bl = 9; /* must be <= 9 for lookahead assumptions */ - bd = 6; /* must be <= 9 for lookahead assumptions */ - t = s->sub.trees.table; - t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), - s->sub.trees.blens, &bl, &bd, &tl, &td, - s->hufts, z); - if (t != Z_OK) - { - if (t == (uInt)Z_DATA_ERROR) - { - hb_xfree(s->sub.trees.blens); - s->mode = BLOCK_BAD; - } - r = t; - LEAVE - } - if ((c = inflate_codes_new(bl, bd, tl, td, z)) == NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - s->sub.decode.codes = c; - } - hb_xfree(s->sub.trees.blens); - s->mode = CODES; - case CODES: - UPDATE - if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) - return inflate_flush(s, z, r); - r = Z_OK; - inflate_codes_free(s->sub.decode.codes, z); - LOAD - if (!s->last) - { - s->mode = TYPE; - break; - } - s->mode = DRY; - case DRY: - FLUSH_2 - if (s->read != s->write) - LEAVE - s->mode = BLOCK_DONE; - case BLOCK_DONE: - r = Z_STREAM_END; - LEAVE - case BLOCK_BAD: - r = Z_DATA_ERROR; - LEAVE - default: - r = Z_STREAM_ERROR; - LEAVE - } -#ifdef NEED_DUMMY_RETURN - return 0; /* Some dumb compilers complain without this */ -#endif -} - - -int inflate_blocks_free( -inflate_blocks_statef *s, -z_streamp z) -{ - inflate_blocks_reset(s, z, NULL); - hb_xfree(s->window); - hb_xfree(s->hufts); - hb_xfree(s); - return Z_OK; -} - - -void inflate_set_dictionary( -inflate_blocks_statef *s, -const Bytef *d, -uInt n) -{ - memcpy(s->window, d, n); - s->read = s->write = s->window + n; -} - - -/* Returns true if inflate is currently at the end of a block generated - * by Z_SYNC_FLUSH or Z_FULL_FLUSH. - * IN assertion: s != NULL - */ -int inflate_blocks_sync_point( inflate_blocks_statef *s ) -{ - return s->mode == LENS; -} - -/* FROM INFCODES */ - -local int huft_build OF(( - uIntf *, /* code lengths in bits */ - uInt, /* number of codes */ - uInt, /* number of "simple" codes */ - const uIntf *, /* list of base values for non-simple codes */ - const uIntf *, /* list of extra bits for non-simple codes */ - inflate_huft * FAR*,/* result: starting table */ - uIntf *, /* maximum lookup bits (returns actual) */ - inflate_huft *, /* space for trees */ - uInt *, /* hufts used in space */ - uIntf * )); /* space for values */ - -/* Tables for deflate from PKZIP's appnote.txt. */ -local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* see note #13 above about 258 */ -local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ -local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577}; -local const uInt cpdext[30] = { /* Extra bits for distance codes */ - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13}; - -/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ -#define BMAX 15 /* maximum bit length of any code */ - -local int huft_build( -uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ -uInt n, /* number of codes (assumed <= 288) */ -uInt s, /* number of simple-valued codes (0..s-1) */ -const uIntf *d, /* list of base values for non-simple codes */ -const uIntf *e, /* list of extra bits for non-simple codes */ -inflate_huft * FAR *t, /* result: starting table */ -uIntf *m, /* maximum lookup bits, returns actual */ -inflate_huft *hp, /* space for trees */ -uInt *hn, /* hufts used in space */ -uIntf *v) /* working area: values in order of bit length */ -/* Given a list of code lengths and a maximum table size, make a set of - tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR - if the given code set is incomplete (the tables are still built in this - case), or Z_DATA_ERROR if the input is invalid. */ -{ - - uInt a; /* counter for codes of length k */ - uInt c[BMAX+1]; /* bit length count table */ - uInt f; /* i repeats in table every f entries */ - int g; /* maximum code length */ - int h; /* table level */ - register uInt i; /* counter, current code */ - register uInt j; /* counter */ - register int k; /* number of bits in current code */ - int l; /* bits per table (returned in m) */ - uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ - register uIntf *p; /* pointer into c[], b[], or v[] */ - inflate_huft *q; /* points to current table */ - struct inflate_huft_s r; /* table entry for structure assignment */ - inflate_huft *u[BMAX]; /* table stack */ - register int w; /* bits before this table == (l * h) */ - uInt x[BMAX+1]; /* bit offsets, then code stack */ - uIntf *xp; /* pointer into x */ - int y; /* number of dummy codes added */ - uInt z; /* number of entries in current table */ - - - /* Generate counts for each bit length */ - p = c; - /* clear c[]--assume BMAX+1 is 16 */ - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; p++; - *p = 0; - - p = b; i = n; - do { - c[*p++]++; /* assume all entries <= BMAX */ - } while (--i); - if (c[0] == n) /* null input--all zero length codes */ - { - *t = (inflate_huft *)NULL; - *m = 0; - return Z_OK; - } - - - /* Find minimum and maximum length, bound *m by those */ - l = *m; - for (j = 1; j <= BMAX; j++) - if (c[j]) - break; - k = j; /* minimum code length */ - if ((uInt)l < j) - l = j; - for (i = BMAX; i; i--) - if (c[i]) - break; - g = i; /* maximum code length */ - if ((uInt)l > i) - l = i; - *m = l; - - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= c[j]) < 0) - return Z_DATA_ERROR; - if ((y -= c[i]) < 0) - return Z_DATA_ERROR; - c[i] += y; - - - /* Generate starting offsets into the value table for each length */ - x[1] = j = 0; - p = c + 1; xp = x + 2; - while (--i) { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - - /* Make a table of values in order of bit lengths */ - p = b; i = 0; - do { - if ((j = *p++) != 0) - v[x[j]++] = i; - } while (++i < n); - n = x[g]; /* set n to length of v */ - - - /* Generate the Huffman codes and for each, make the table entries */ - x[0] = i = 0; /* first Huffman code is zero */ - p = v; /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = -l; /* bits decoded == (l * h) */ - u[0] = (inflate_huft *)NULL; /* just to keep compilers happy */ - q = (inflate_huft *)NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = c[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l) - { - h++; - w += l; /* previous table always l bits */ - - /* compute minimum size table less than or equal to l bits */ - z = g - w; - z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = c + k; - if (j < z) - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - z = 1 << j; /* table entries for j-bit table */ - - /* allocate new table */ - if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ - return Z_DATA_ERROR; /* overflow of MANY */ - u[h] = q = hp + *hn; - *hn += z; - - /* connect to last table, if there is one */ - if (h) - { - x[h] = i; /* save pattern for backing up */ - r.bits = (Byte)l; /* bits to dump before this table */ - r.exop = (Byte)j; /* bits in this table */ - j = i >> (w - l); - r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ - u[h-1][j] = r; /* connect to last table */ - } - else - *t = q; /* first table is returned result */ - } - - /* set up table entry in r */ - r.bits = (Byte)(k - w); - if (p >= v + n) - r.exop = 128 + 64; /* out of values--invalid code */ - else if (*p < s) - { - r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ - r.base = *p++; /* simple code is just the value */ - } - else - { - r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ - r.base = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - mask = (1 << w) - 1; /* needed on HP, cc -O bug */ - while ((i & mask) != x[h]) - { - h--; /* don't need to update q */ - w -= l; - mask = (1 << w) - 1; - } - } - } - - - /* Return Z_BUF_ERROR if we were given an incomplete table */ - return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; -} - - -int inflate_trees_bits( -uIntf *c, /* 19 code lengths */ -uIntf *bb, /* bits tree desired/actual depth */ -inflate_huft * FAR *tb, /* bits tree result */ -inflate_huft *hp, /* space for trees */ -z_streamp z) /* for messages */ -{ - int r; - uInt hn = 0; /* hufts used in space */ - uIntf *v; /* work area for huft_build */ - - if ((v = (uIntf*)hb_xgrab( 19 * sizeof(uInt))) == NULL) - return Z_MEM_ERROR; - r = huft_build(c, 19, 19, (uIntf*)NULL, (uIntf*)NULL, - tb, bb, hp, &hn, v); - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed dynamic bit lengths tree"; - else if (r == Z_BUF_ERROR || *bb == 0) - { - z->msg = (char*)"incomplete dynamic bit lengths tree"; - r = Z_DATA_ERROR; - } - hb_xfree(v); - return r; -} - - -int inflate_trees_dynamic( -uInt nl, /* number of literal/length codes */ -uInt nd, /* number of distance codes */ -uIntf *c, /* that many (total) code lengths */ -uIntf *bl, /* literal desired/actual bit depth */ -uIntf *bd, /* distance desired/actual bit depth */ -inflate_huft * FAR *tl, /* literal/length tree result */ -inflate_huft * FAR *td, /* distance tree result */ -inflate_huft *hp, /* space for trees */ -z_streamp z) /* for messages */ -{ - int r; - uInt hn = 0; /* hufts used in space */ - uIntf *v; /* work area for huft_build */ - - /* allocate work area */ - if ((v = (uIntf*)hb_xgrab( 288 * sizeof(uInt))) == NULL) - return Z_MEM_ERROR; - - /* build literal/length tree */ - r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); - if (r != Z_OK || *bl == 0) - { - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed literal/length tree"; - else if (r != Z_MEM_ERROR) - { - z->msg = (char*)"incomplete literal/length tree"; - r = Z_DATA_ERROR; - } - hb_xfree(v); - return r; - } - - /* build distance tree */ - r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); - if (r != Z_OK || (*bd == 0 && nl > 257)) - { - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed distance tree"; - else if (r == Z_BUF_ERROR) { -#ifdef PKZIP_BUG_WORKAROUND - r = Z_OK; - } -#else - z->msg = (char*)"incomplete distance tree"; - r = Z_DATA_ERROR; - } - else if (r != Z_MEM_ERROR) - { - z->msg = (char*)"empty distance tree with lengths"; - r = Z_DATA_ERROR; - } - hb_xfree(v); - return r; -#endif - } - - /* done */ - hb_xfree(v); - return Z_OK; -} - - -local uInt fixed_bl = 9; -local uInt fixed_bd = 5; -local inflate_huft fixed_tl[] = { - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} - }; -local inflate_huft fixed_td[] = { - {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, - {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, - {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, - {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, - {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, - {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, - {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, - {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} - }; - -int inflate_trees_fixed( -uIntf *bl, /* literal desired/actual bit depth */ -uIntf *bd, /* distance desired/actual bit depth */ -inflate_huft * FAR *tl, /* literal/length tree result */ -inflate_huft * FAR *td /* distance tree result */ - -#ifdef BUILDFIXED -, z_streamp z) /* for memory allocation */ -#else -) -#endif -{ -#ifdef BUILDFIXED - /* build fixed tables if not already */ - if (!fixed_built) - { - int k; /* temporary variable */ - uInt f = 0; /* number of hufts used in fixed_mem */ - uIntf *c; /* length list for huft_build */ - uIntf *v; /* work area for huft_build */ - - /* allocate memory */ - if ((c = (uIntf*)hb_xgrab( 288 * sizeof(uInt))) == NULL) - return Z_MEM_ERROR; - if ((v = (uIntf*)hb_xgrab( 288 * sizeof(uInt))) == NULL) - { - hb_xfree(c); - return Z_MEM_ERROR; - } - - /* literal table */ - for (k = 0; k < 144; k++) - c[k] = 8; - for (; k < 256; k++) - c[k] = 9; - for (; k < 280; k++) - c[k] = 7; - for (; k < 288; k++) - c[k] = 8; - fixed_bl = 9; - huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, - fixed_mem, &f, v); - - /* distance table */ - for (k = 0; k < 30; k++) - c[k] = 5; - fixed_bd = 5; - huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, - fixed_mem, &f, v); - - /* done */ - hb_xfree(v); - hb_xfree(c); - fixed_built = 1; - } -#endif - *bl = fixed_bl; - *bd = fixed_bd; - *tl = fixed_tl; - *td = fixed_td; - return Z_OK; -} - -/* -* -* From infcodes -* -*/ - -typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ - START, /* x: set up for LEN */ - LEN, /* i: get length/literal/eob next */ - LENEXT, /* i: getting length extra (have base) */ - DIST, /* i: get distance next */ - DISTEXT, /* i: getting distance extra */ - COPY, /* o: copying bytes in window, waiting for space */ - LIT, /* o: got literal, waiting for output space */ - WASH, /* o: got eob, possibly still output waiting */ - END, /* x: got eob and all data flushed */ - BADCODE} /* x: got error */ -inflate_codes_mode; - -/* inflate codes private state */ -struct inflate_codes_state { - - /* mode */ - inflate_codes_mode mode; /* current inflate_codes mode */ - - /* mode dependent information */ - uInt len; - union { - struct { - inflate_huft *tree; /* pointer into tree */ - uInt need; /* bits needed */ - } code; /* if LEN or DIST, where in tree */ - uInt lit; /* if LIT, literal */ - struct { - uInt get; /* bits to get for extra */ - uInt dist; /* distance back to copy from */ - } copy; /* if EXT or COPY, where and how much */ - } sub; /* submode */ - - /* mode independent information */ - Byte lbits; /* ltree bits decoded per branch */ - Byte dbits; /* dtree bits decoder per branch */ - inflate_huft *ltree; /* literal/length/eob tree */ - inflate_huft *dtree; /* distance tree */ - -}; - - -inflate_codes_statef *inflate_codes_new( -uInt bl, -uInt bd, -inflate_huft *tl, -inflate_huft *td, /* need separate declaration for Borland C++ */ -z_streamp z) -{ - inflate_codes_statef *c; - - HB_SYMBOL_UNUSED( z ); - - if ((c = (inflate_codes_statef *) - hb_xgrab(sizeof(struct inflate_codes_state))) != NULL) - { - c->mode = START; - c->lbits = (Byte)bl; - c->dbits = (Byte)bd; - c->ltree = tl; - c->dtree = td; - } - return c; -} - - -int inflate_codes( -inflate_blocks_statef *s, -z_streamp z, -int r) -{ - uInt j; /* temporary storage */ - inflate_huft *t; /* temporary pointer */ - uInt e; /* extra bits or operation */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - Bytef *f; /* pointer to copy strings from */ - inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ - - /* copy input/output information to locals (UPDATE macro restores) */ - LOAD - - /* process input and output based on current state */ - while (1) switch (c->mode) - { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ - case START: /* x: set up for LEN */ - if (m >= 258 && n >= 10) - { - UPDATE - r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); - LOAD - if (r != Z_OK) - { - c->mode = r == Z_STREAM_END ? WASH : BADCODE; - break; - } - } - c->sub.code.need = c->lbits; - c->sub.code.tree = c->ltree; - c->mode = LEN; - case LEN: /* i: get length/literal/eob next */ - j = c->sub.code.need; - NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); - DUMPBITS(t->bits) - e = (uInt)(t->exop); - if (e == 0) /* literal */ - { - c->sub.lit = t->base; - c->mode = LIT; - break; - } - if (e & 16) /* length */ - { - c->sub.copy.get = e & 15; - c->len = t->base; - c->mode = LENEXT; - break; - } - if ((e & 64) == 0) /* next table */ - { - c->sub.code.need = e; - c->sub.code.tree = t + t->base; - break; - } - if (e & 32) /* end of block */ - { - c->mode = WASH; - break; - } - c->mode = BADCODE; /* invalid code */ - z->msg = (char*)"invalid literal/length code"; - r = Z_DATA_ERROR; - LEAVE - case LENEXT: /* i: getting length extra (have base) */ - j = c->sub.copy.get; - NEEDBITS(j) - c->len += (uInt)b & inflate_mask[j]; - DUMPBITS(j) - c->sub.code.need = c->dbits; - c->sub.code.tree = c->dtree; - c->mode = DIST; - case DIST: /* i: get distance next */ - j = c->sub.code.need; - NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); - DUMPBITS(t->bits) - e = (uInt)(t->exop); - if (e & 16) /* distance */ - { - c->sub.copy.get = e & 15; - c->sub.copy.dist = t->base; - c->mode = DISTEXT; - break; - } - if ((e & 64) == 0) /* next table */ - { - c->sub.code.need = e; - c->sub.code.tree = t + t->base; - break; - } - c->mode = BADCODE; /* invalid code */ - z->msg = (char*)"invalid distance code"; - r = Z_DATA_ERROR; - LEAVE - case DISTEXT: /* i: getting distance extra */ - j = c->sub.copy.get; - NEEDBITS(j) - c->sub.copy.dist += (uInt)b & inflate_mask[j]; - DUMPBITS(j) - c->mode = COPY; - case COPY: /* o: copying bytes in window, waiting for space */ - f = q - c->sub.copy.dist; - while (f < s->window) /* modulo window size-"while" instead */ - f += s->end - s->window; /* of "if" handles invalid distances */ - while (c->len) - { - NEEDOUT - OUTBYTE(*f++) - if (f == s->end) - f = s->window; - c->len--; - } - c->mode = START; - break; - case LIT: /* o: got literal, waiting for output space */ - NEEDOUT - OUTBYTE(c->sub.lit) - c->mode = START; - break; - case WASH: /* o: got eob, possibly more output */ - if (k > 7) /* return unused byte, if any */ - { - k -= 8; - n++; - p--; /* can always return one */ - } - FLUSH_2 - if (s->read != s->write) - LEAVE - c->mode = END; - case END: - r = Z_STREAM_END; - LEAVE - case BADCODE: /* x: got error */ - r = Z_DATA_ERROR; - LEAVE - default: - r = Z_STREAM_ERROR; - LEAVE - } -#ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ -#endif -} - - -void inflate_codes_free( -inflate_codes_statef *c, -z_streamp z) -{ - HB_SYMBOL_UNUSED( z ); - hb_xfree(c); -} - -/* -* -* FROM INFFAST -*/ - -/* macros for bit input with no checking and for returning unused bytes */ -#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;} - -/* Called with number of bytes left to write in window at least 258 - (the maximum string length) and number of input bytes available - at least ten. The ten bytes are six bytes for the longest length/ - distance pair plus four bytes for overloading the bit buffer. */ - -int inflate_fast( -uInt bl, -uInt bd, -inflate_huft *tl, -inflate_huft *td, /* need separate declaration for Borland C++ */ -inflate_blocks_statef *s, -z_streamp z) -{ - inflate_huft *t; /* temporary pointer */ - uInt e; /* extra bits or operation */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - uInt ml; /* mask for literal/length tree */ - uInt md; /* mask for distance tree */ - uInt c; /* bytes to copy */ - uInt d; /* distance back to copy from */ - Bytef *r; /* copy source pointer */ - - /* load input, output, bit values */ - LOAD - - /* initialize masks */ - ml = inflate_mask[bl]; - md = inflate_mask[bd]; - - /* do until not enough input or output space for fast loop */ - do { /* assume called with m >= 258 && n >= 10 */ - /* get literal/length code */ - GRABBITS(20) /* max bits for literal/length code */ - if ((e = (t = tl + ((uInt)b & ml))->exop) == 0) - { - DUMPBITS(t->bits) - *q++ = (Byte)t->base; - m--; - continue; - } - do { - DUMPBITS(t->bits) - if (e & 16) - { - /* get extra bits for length */ - e &= 15; - c = t->base + ((uInt)b & inflate_mask[e]); - DUMPBITS(e) - - /* decode distance base of block to copy */ - GRABBITS(15); /* max bits for distance code */ - e = (t = td + ((uInt)b & md))->exop; - do { - DUMPBITS(t->bits) - if (e & 16) - { - /* get extra bits to add to distance base */ - e &= 15; - GRABBITS(e) /* get extra bits (up to 13) */ - d = t->base + ((uInt)b & inflate_mask[e]); - DUMPBITS(e) - - /* do the copy */ - m -= c; - r = q - d; - if (r < s->window) /* wrap if needed */ - { - do { - r += s->end - s->window; /* force pointer in window */ - } while (r < s->window); /* covers invalid distances */ - e = s->end - r; - if (c > e) - { - c -= e; /* wrapped copy */ - do { - *q++ = *r++; - } while (--e); - r = s->window; - do { - *q++ = *r++; - } while (--c); - } - else /* normal copy */ - { - *q++ = *r++; c--; - *q++ = *r++; c--; - do { - *q++ = *r++; - } while (--c); - } - } - else /* normal copy */ - { - *q++ = *r++; c--; - *q++ = *r++; c--; - do { - *q++ = *r++; - } while (--c); - } - break; - } - else if ((e & 64) == 0) - { - t += t->base; - e = (t += ((uInt)b & inflate_mask[e]))->exop; - } - else - { - z->msg = (char*)"invalid distance code"; - UNGRAB - UPDATE - return Z_DATA_ERROR; - } - } while (1); - break; - } - if ((e & 64) == 0) - { - t += t->base; - if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) - { - DUMPBITS(t->bits) - *q++ = (Byte)t->base; - m--; - break; - } - } - else if (e & 32) - { - UNGRAB - UPDATE - return Z_STREAM_END; - } - else - { - z->msg = (char*)"invalid literal/length code"; - UNGRAB - UPDATE - return Z_DATA_ERROR; - } - } while (1); - } while (m >= 258 && n >= 10); - - /* not enough input or output--restore pointers and return */ - UNGRAB - UPDATE - return Z_OK; -} - - -/* And'ing with mask[n] masks the lower n bits */ -uInt inflate_mask[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - -/* -* -* INFLATE UTILS -* -*/ - -/* copy as much as possible from the sliding window to the output area */ -int inflate_flush( -inflate_blocks_statef *s, -z_streamp z, -int r) -{ - uInt n; - Bytef *p; - Bytef *q; - - /* local copies of source and destination pointers */ - p = z->next_out; - q = s->read; - - /* compute number of bytes to copy as far as end of window */ - n = (uInt)((q <= s->write ? s->write : s->end) - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy as far as end of window */ - memcpy(p, q, n); - p += n; - q += n; - - /* see if more to copy at beginning of window */ - if (q == s->end) - { - /* wrap pointers */ - q = s->window; - if (s->write == s->end) - s->write = s->window; - - /* compute bytes to copy */ - n = (uInt)(s->write - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy */ - memcpy(p, q, n); - p += n; - q += n; - } - - /* update pointers */ - z->next_out = p; - s->read = q; - - /* done */ - return r; -} - -/* ========================================================================= */ - -#define BASE 65521L /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -ULONG HB_EXPORT adler32( ULONG adler, const BYTE *buf, UINT len) -{ - ULONG s1 = adler & 0xffff; - ULONG s2 = (adler >> 16) & 0xffff; - int k; - - if (buf == NULL) return 1L; - - while (len > 0) { - k = len < NMAX ? len : NMAX; - len -= k; - while (k >= 16) { - DO16(buf); - buf += 16; - k -= 16; - } - if (k != 0) do { - s1 += *buf++; - s2 += s1; - } while (--k); - s1 %= BASE; - s2 %= BASE; - } - return (s2 << 16) | s1; -} - -static const ULONG crc_table[256] = { - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL -}; - -/* ========================================================================= - * This function can be used by asm versions of crc32() - */ -const ULONG * get_crc_table() -{ - return (const ULONG *)crc_table; -} - -/* ========================================================================= */ -#undef DO1 -#undef DO2 -#undef DO4 -#undef DO8 -#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8); -#define DO2(buf) DO1(buf); DO1(buf); -#define DO4(buf) DO2(buf); DO2(buf); -#define DO8(buf) DO4(buf); DO4(buf); - -/* ========================================================================= */ -ULONG HB_EXPORT crc32( ULONG crc, const BYTE *buf, UINT len){ - if (buf == NULL) return 0L; - crc = crc ^ 0xffffffffL; - while (len >= 8) - { - DO8(buf); - len -= 8; - } - if (len) do { - DO1(buf); - } while (--len); - return crc ^ 0xffffffffL; -} +#include "directry.ch" static void hb_fsGrabDirectory( PHB_ITEM pDir, const char * szDirSpec, USHORT uiMask, PHB_FNAME fDirSpec, BOOL bFullPath, BOOL bDirOnly ) { @@ -4258,4 +191,3 @@ void HB_EXPORT hb_fsDirectory( PHB_ITEM pDir, char* szSkleton, char* szAttribute if( bAlloc ) hb_xfree( szDirSpec ); } - diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/hbcomprs.h b/harbour-1.0.0RC1/contrib/hbziparch/include/hbcomprs.h deleted file mode 100644 index 5026ca75c2..0000000000 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/hbcomprs.h +++ /dev/null @@ -1,1006 +0,0 @@ -/* - * $Id$ - */ - -/* - * xHarbour Project source code: - * Compression related functions - * - * Copyright 2003 Giancarlo Niccolai - * www - http://www.xharbour.org - * SEE ALSO COPYRIGHT NOTICE FOR ZLIB BELOW. - * - * 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) - * 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 software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -/* This file is based upon ZLIB source code, whose copyright holder is: - * - * Copyright (C) 1995-2002 Jean-loup Gailly. - * - * Also, this file includes code slices from adler32.c for advanced CRC - * Holder of copyright for this code is: - * - * Copyright (C) 1995-2002 Mark Adler - * - * ZLIB (containing adler32 code) can be found at: - * http://www.gzip.org/zlib/ - */ - -#ifndef _HBCOMPRESS_H -#define _HBCOMPRESS_H - -#include "hbdefs.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) - #pragma warning (disable : 4518) -#endif // _MSC_VER > 1000 -*/ - -#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) -# if !defined(NEED_DUMMY_RETURN) -# define NEED_DUMMY_RETURN -# endif -#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. -*/ - - -#ifndef OF /* function prototypes */ -# 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 - -#ifndef FAR -# define FAR -#endif - -#if !defined(MACOS) && !defined(TARGET_OS_MAC) -typedef BYTE Byte; /* 8 bits */ -#endif -typedef UINT uInt; /* 16 bits or more */ -typedef ULONG 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 /* for off_t */ -# include /* 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 - - -//#ifdef __cplusplus -//extern "C" { -//#endif - -#define ZLIB_VERSION "1.1.4" - -struct internal_state; -struct inflate_internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - struct inflate_internal_state FAR *inf_state; /* not visible by applications */ - - int data_type; /* best guess about the data type: ascii or binary */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -/* Allowed flush values; see deflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_ASCII 1 -#define Z_UNKNOWN 2 -/* Possible values of the data_type field */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) - -#ifdef __cplusplus -extern "C" { -#endif - -extern uLong HB_EXPORT adler32 OF(( uLong adler, const BYTE *buf, UINT len)); -extern uLong HB_EXPORT crc32 OF(( uLong crc, const BYTE *buf, uInt len)); -extern int HB_EXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -extern int HB_EXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); - -HB_EXPORT extern const char * zlibVersion OF((void)); -extern int HB_EXPORT deflate OF((z_streamp strm, int flush)); -extern int HB_EXPORT deflateCopy OF((z_streamp dest, z_streamp source)); -extern int HB_EXPORT deflateEnd OF((z_streamp strm)); -extern int HB_EXPORT deflateInit_ OF(( z_streamp strm, int level, const char *version, int stream_size)); -extern int HB_EXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, int strategy, - const char * version, int stream_size)); -extern int HB_EXPORT deflateParams OF((z_streamp strm, - int level, int strategy)); -extern int HB_EXPORT deflateReset OF((z_streamp strm)); -extern int HB_EXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, uInt dictLength)); -extern int HB_EXPORT inflate OF((z_streamp strm, int flush)); - -extern int HB_EXPORT inflateEnd OF((z_streamp strm)); -extern int HB_EXPORT inflateInit_ OF((z_streamp z, const char *version, int stream_size)); -extern int HB_EXPORT inflateInit2_ OF((z_streamp z, int w, const char *version, int stream_size)); -extern int HB_EXPORT inflateReset OF((z_streamp strm)); -extern int HB_EXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, uInt dictLength)); - -HB_EXPORT extern const char * zError OF((int err)); -HB_EXPORT extern const uLongf * get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#include -#ifndef local -# define local static -#endif - -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 */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) - -/* 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 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 /* 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 - -typedef ULONG (*check_func) OF((uLong check, const BYTE *buf, UINT len)); - -#define TRY_FREE(p) {if (p) hb_xfree(p);} - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -struct static_tree_desc_s { - const ct_data *static_tree; /* static tree or NULL */ - const intf *extra_bits; /* extra bits for each code or NULL */ - int extra_base; /* base index for extra_bits */ - int elems; /* max number of elements in the tree */ - int max_length; /* max bit length for the codes */ -}; - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - int pending; /* nb of bytes in the pending buffer */ - int noheader; /* suppress zlib header and adler32 */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to supress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - uInt lit_bufsize; /* Size of match buffer for literals/lengths. */ - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_lit_2(s, c ) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } - - -/* header created automatically with -DGEN_TREES_H */ -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - - -/* infblock.h -- header to use infblock.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - - -struct inflate_huft_s { - union { - struct { - Byte Exop; /* number of extra bits or operation */ - Byte Bits; /* number of bits in this code or subcode */ - } what; - uInt pad; /* pad structure to a power of 2 (4 bytes for */ - } word; /* 16-bit, 8 bytes for 32-bit int's) */ - uInt base; /* literal, length base, distance base, - or table offset */ -}; -typedef struct inflate_huft_s FAR inflate_huft; - -struct inflate_codes_state; -typedef struct inflate_codes_state FAR inflate_codes_statef; - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 huft structures (850 for length/literals - and 154 for distances, the latter actually the result of an - exhaustive search). The actual maximum is not known, but the - value below is more than safe. */ -#define MANY 1440 - -extern int inflate_trees_bits OF(( - uIntf *, /* 19 code lengths */ - uIntf *, /* bits tree desired/actual depth */ - inflate_huft * FAR *, /* bits tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -extern int inflate_trees_dynamic OF(( - uInt, /* number of literal/length codes */ - uInt, /* number of distance codes */ - uIntf *, /* that many (total) code lengths */ - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR *, /* distance tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -#ifdef BUILDFIXED -extern int inflate_trees_fixed OF(( - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR * /* distance tree result */ - , z_streamp)); /* for memory allocation */ -#else -extern int inflate_trees_fixed OF(( - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR *)); - -#endif - -/* 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. - */ - -typedef enum { - TYPE, /* get type bits (3, including end bit) */ - LENS, /* get lengths for stored */ - STORED, /* processing stored block */ - TABLE, /* get table lengths */ - BTREE, /* get bit lengths tree for a dynamic block */ - DTREE, /* get length, distance trees for a dynamic block */ - CODES, /* processing fixed or dynamic block */ - DRY, /* output remaining window bytes */ - BLOCK_DONE, /* finished last block, done */ - BLOCK_BAD} /* got a data error--stuck here */ -inflate_block_mode; - -/* inflate blocks semi-private state */ -struct inflate_blocks_state { - - /* mode */ - inflate_block_mode mode; /* current inflate_block mode */ - - /* mode dependent information */ - union { - uInt left; /* if STORED, bytes left to copy */ - struct { - uInt table; /* table lengths (14 bits) */ - uInt index; /* index into blens (or border) */ - uIntf *blens; /* bit lengths of codes */ - uInt bb; /* bit length tree depth */ - inflate_huft *tb; /* bit length decoding tree */ - } trees; /* if DTREE, decoding info for trees */ - struct { - inflate_codes_statef - *codes; - } decode; /* if CODES, current state */ - } sub; /* submode */ - uInt last; /* true if this block is the last block */ - - /* mode independent information */ - uInt bitk; /* bits in bit buffer */ - uLong bitb; /* bit buffer */ - inflate_huft *hufts; /* single malloc for tree space */ - Bytef *window; /* sliding window */ - Bytef *end; /* one byte after sliding window */ - Bytef *read; /* window read pointer */ - Bytef *write; /* window write pointer */ - check_func checkfn; /* check function */ - uLong check; /* check on output */ - -}; - - -/* defines for inflate input/output */ -/* update pointers and return */ -#define UPDBITS {s->bitb=b;s->bitk=k;} -#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} -#define UPDOUT {s->write=q;} -#define UPDATE {UPDBITS UPDIN UPDOUT} -#define LEAVE {UPDATE return inflate_flush(s,z,r);} -/* get bytes and bits */ -#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} -#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} -#define NEXTBYTE (n--,*p++) -#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} -/* output bytes */ -#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) -#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} -#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} -#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} -#define FLUSH_2 {UPDOUT r=inflate_flush(s,z,r); q=s->write;} -#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} -#define OUTBYTE(a) {*q++=(Byte)(a);m--;} -/* load local pointers */ -#define LOAD {LOADIN LOADOUT} - -#define INF_NEEDBYTE {if(z->avail_in==0)return r;r=f;} -#define INF_NEEDBYTE_2 {if(z->avail_in==0)return r;} -#define INF_NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) - -/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ -extern uInt inflate_mask[17]; - -typedef struct inflate_blocks_state FAR inflate_blocks_statef; - -extern inflate_blocks_statef * inflate_blocks_new OF(( - z_streamp z, - check_func c, /* check function */ - uInt w)); /* window size */ - -extern int inflate_blocks OF(( - inflate_blocks_statef *, - z_streamp , - int)); /* initial return code */ - -extern void inflate_blocks_reset OF(( - inflate_blocks_statef *, - z_streamp , - uLongf *)); /* check value on output */ - -extern int inflate_blocks_free OF(( - inflate_blocks_statef *, - z_streamp)); - -extern void inflate_set_dictionary OF(( - inflate_blocks_statef *s, - const Bytef *d, /* dictionary */ - uInt n)); /* dictionary length */ - -extern int inflate_blocks_sync_point OF(( - inflate_blocks_statef *s)); - -extern inflate_codes_statef *inflate_codes_new OF(( - uInt, uInt, - inflate_huft *, inflate_huft *, - z_streamp )); - -extern int inflate_codes OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -extern void inflate_codes_free OF(( - inflate_codes_statef *, - z_streamp )); - -/* copy as much as possible from the sliding window to the output area */ -extern int inflate_flush OF(( - inflate_blocks_statef *, - z_streamp , - int)); - - -typedef enum { - METHOD, /* waiting for method byte */ - FLAG, /* waiting for flag byte */ - DICT4, /* four dictionary check bytes to go */ - DICT3, /* three dictionary check bytes to go */ - DICT2, /* two dictionary check bytes to go */ - DICT1, /* one dictionary check byte to go */ - DICT0, /* waiting for inflateSetDictionary */ - BLOCKS, /* decompressing blocks */ - CHECK4, /* four check bytes to go */ - CHECK3, /* three check bytes to go */ - CHECK2, /* two check bytes to go */ - CHECK1, /* one check byte to go */ - DONE, /* finished check, done */ - BAD} /* got an error--stay here */ -inflate_mode; - -/* inflate private state */ -struct inflate_internal_state { - - /* mode */ - inflate_mode mode; /* current inflate mode */ - - /* mode dependent information */ - union { - uInt method; /* if FLAGS, method byte */ - struct { - uLong was; /* computed check value */ - uLong need; /* stream check value */ - } check; /* if CHECK, check values to compare */ - uInt marker; /* if BAD, inflateSync's marker bytes count */ - } sub; /* submode */ - - /* mode independent information */ - int nowrap; /* flag for no wrapper */ - uInt wbits; /* log2(window size) (8..15, defaults to 15) */ - inflate_blocks_statef - *blocks; /* current inflate_blocks state */ - -}; - -extern int inflate_fast(uInt bl, uInt bd, inflate_huft *tl, inflate_huft *td, - inflate_blocks_statef *s, z_streamp z); - - -//#ifdef __cplusplus -//}; -//#endif - -#endif - diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/unzip.h b/harbour-1.0.0RC1/contrib/hbziparch/include/unzip.h index 89fef3fd7a..b60f102fbc 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/unzip.h +++ b/harbour-1.0.0RC1/contrib/hbziparch/include/unzip.h @@ -41,9 +41,7 @@ #ifndef _unz_H #define _unz_H -#ifndef _HBCOMPRESS_H -#include "hbcomprs.h" -#endif +#include "hbzlib.h" #ifdef __cplusplus diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/zconf.h b/harbour-1.0.0RC1/contrib/hbziparch/include/zconf.h deleted file mode 100644 index 9fcacbe06f..0000000000 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/zconf.h +++ /dev/null @@ -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 -# 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 -# 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 /* for off_t */ -# include /* 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 */ diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/zip.h b/harbour-1.0.0RC1/contrib/hbziparch/include/zip.h index 9310860a79..ebdb5f6294 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/zip.h +++ b/harbour-1.0.0RC1/contrib/hbziparch/include/zip.h @@ -46,9 +46,8 @@ #define _zip_H -#ifndef _HBCOMPRESS_H -#include "hbcomprs.h" -#endif +#include "hbzlib.h" + #ifdef __cplusplus extern "C" { diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/ziparchive.h b/harbour-1.0.0RC1/contrib/hbziparch/include/ziparchive.h index 4d6ce9f9fb..6e7966886b 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/ziparchive.h +++ b/harbour-1.0.0RC1/contrib/hbziparch/include/ziparchive.h @@ -83,9 +83,7 @@ //#ifdef __cplusplus //extern "C" { //#endif -#ifndef _HBCOMPRESS_H -#include "hbcomprs.h" -#endif +#include "hbzlib.h" //#ifdef __cplusplus //} //#endif diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/zipinternalinfo.h b/harbour-1.0.0RC1/contrib/hbziparch/include/zipinternalinfo.h index 73d3c3d536..e719afe81e 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/zipinternalinfo.h +++ b/harbour-1.0.0RC1/contrib/hbziparch/include/zipinternalinfo.h @@ -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 diff --git a/harbour-1.0.0RC1/contrib/hbziparch/include/zutil.h b/harbour-1.0.0RC1/contrib/hbziparch/include/zutil.h deleted file mode 100644 index 5cf5d5f2ef..0000000000 --- a/harbour-1.0.0RC1/contrib/hbziparch/include/zutil.h +++ /dev/null @@ -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 -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#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 -# endif -# else /* MSC or DJGPP */ -# include -# 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 /* 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 - 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 */ diff --git a/harbour-1.0.0RC1/contrib/hbziparch/zip.c b/harbour-1.0.0RC1/contrib/hbziparch/zip.c index ff460e185c..d95c9480b6 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/zip.c +++ b/harbour-1.0.0RC1/contrib/hbziparch/zip.c @@ -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 diff --git a/harbour-1.0.0RC1/contrib/hbziparch/ziparchive.cpp b/harbour-1.0.0RC1/contrib/hbziparch/ziparchive.cpp index 79e5fdec0c..2bea2ce30a 100644 --- a/harbour-1.0.0RC1/contrib/hbziparch/ziparchive.cpp +++ b/harbour-1.0.0RC1/contrib/hbziparch/ziparchive.cpp @@ -15,7 +15,6 @@ //////////////////////////////////////////////////////////////////////////////// -#include "hbcomprs.h" #include "stdafx.h" #include "ziparchive.h" // #include "ZipPathComponent.h" diff --git a/harbour-1.0.0RC1/source/pp/hbppgen.c b/harbour-1.0.0RC1/source/pp/hbppgen.c index b7f4a552ae..7a7c44b22a 100644 --- a/harbour-1.0.0RC1/source/pp/hbppgen.c +++ b/harbour-1.0.0RC1/source/pp/hbppgen.c @@ -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 ); } diff --git a/harbour-1.0.0RC1/utils/hbpp/Makefile b/harbour-1.0.0RC1/utils/hbpp/Makefile index 2cea7e82b7..c017abafe5 100644 --- a/harbour-1.0.0RC1/utils/hbpp/Makefile +++ b/harbour-1.0.0RC1/utils/hbpp/Makefile @@ -7,8 +7,8 @@ ROOT = ../../ C_SOURCES=\ hbppcore.c \ hbppcomp.c \ - hbpptbl.c \ - pragma.c \ + hbpptbl.c \ + hbpragma.c \ C_MAIN=hbpp.c diff --git a/harbour-1.0.0RC1/utils/hbpp/pragma.c b/harbour-1.0.0RC1/utils/hbpp/hbpragma.c similarity index 100% rename from harbour-1.0.0RC1/utils/hbpp/pragma.c rename to harbour-1.0.0RC1/utils/hbpp/hbpragma.c