use debhacks

This commit is contained in:
ehouse 2006-01-28 19:03:10 +00:00
parent 2ea8c2e0cd
commit 3f577181dd
6 changed files with 27 additions and 21 deletions

View file

@ -23,6 +23,7 @@
#include "ceclrsel.h"
#include "ceutil.h"
#include "debhacks.h"
#ifdef MY_COLOR_SEL
@ -224,8 +225,8 @@ myChooseColor( CEAppGlobals* globals, HWND hwnd, COLORREF* cref )
XP_LOGF( "setting up IDD_COLOREDITDLG" );
result = DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLOREDITDLG, hwnd,
(DLGPROC)EditColorsDlg, (long)&state );
result = DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_COLOREDITDLG, hwnd,
(DLGPROC)EditColorsDlg, (long)&state );
XP_LOGF( "DialogBoxParam=>%d", result );
@ -405,8 +406,8 @@ ceDoColorsEdit( HWND hwnd, CEAppGlobals* globals, COLORREF* colors )
state.globals = globals;
state.inColors = colors;
(void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd,
(DLGPROC)ColorsDlg, (long)&state );
(void)DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd,
(DLGPROC)ColorsDlg, (long)&state );
if ( !state.cancelled ) {
XP_U16 i;

View file

@ -21,6 +21,7 @@
#include "cecondlg.h"
#include "ceutil.h"
#include "debhacks.h"
static void
ceControlsToAddrRec( HWND hDlg, CeConnDlgState* cState )
@ -112,8 +113,8 @@ WrapConnsDlg( HWND hDlg, CEAppGlobals* globals, const CommsAddrRec* addrRec,
XP_MEMCPY( &state->addrRec, addrRec, sizeof(state->addrRec) );
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg,
(DLGPROC)ConnsDlg, (long)state );
DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg,
(DLGPROC)ConnsDlg, (long)state );
result = !state->userCancelled;
return result;

View file

@ -24,6 +24,7 @@
#include "dictnryp.h"
#include "strutils.h"
#include "cedict.h"
#include "debhacks.h"
typedef struct CEDictionaryCtxt {
DictionaryCtxt super;
@ -594,18 +595,18 @@ checkIfDictAndLegal( MPFORMAL wchar_t* path, XP_U16 pathLen,
static XP_Bool
locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
{
WIN32_FIND_DATA data;
DH(WIN32_FIND_DATA) data;
HANDLE fileH;
XP_Bool result = XP_FALSE;
XP_U16 startLen;
#if defined TARGET_OS_WINCE
lstrcat( path, L"\\" );
DH(lstrcat)( path, L"\\" );
#elif defined TARGET_OS_WIN32
lstrcat( path, L".\\" );
DH(lstrcat)( path, L".\\" );
#endif
startLen = wcslen(path); /* record where we were so can back up */
lstrcat( path, L"*" );
DH(lstrcat)( path, L"*" );
XP_MEMSET( &data, 0, sizeof(data) );
@ -621,7 +622,7 @@ locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0){
#if defined TARGET_OS_WINCE
/* We don't do recursive search on Win32!!! */
lstrcpy( path+startLen, data.cFileName );
DH(lstrcpy)( path+startLen, data.cFileName );
result = locateOneDir( MPPARM(mpool) path, which );
if ( result ) {
break;
@ -632,7 +633,7 @@ locateOneDir( MPFORMAL wchar_t* path, XP_U16* which )
&data )
&& (*which-- == 0)) {
/* we're done! */
lstrcpy( path+startLen, data.cFileName );
DH(lstrcpy)( path+startLen, data.cFileName );
result = XP_TRUE;
break;
}

View file

@ -31,6 +31,7 @@
#include "cemain.h"
#include "cedict.h"
#include "cedefines.h"
#include "debhacks.h"
static void ceClearToBkground( CEDrawCtx* dctx, XP_Rect* rect );
static void ceDrawBitmapInRect( HDC hdc, const RECT* r, HBITMAP bitmap );
@ -486,7 +487,7 @@ formatRemText( HDC hdc, wchar_t* buf, XP_S16 nTilesLeft, SIZE* size )
size->cx = size->cy = 0;
} else {
swprintf( buf, format, nTilesLeft );
GetTextExtentPoint32( hdc, buf, wcslen(buf), size );
DH(GetTextExtentPoint32)( hdc, buf, wcslen(buf), size );
}
} /* formatRemText */
@ -549,7 +550,7 @@ ceWidthAndText( HDC hdc, wchar_t* buf, DrawScoreInfo* dsi,
len = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, tbuf, -1,
buf, 10 );
GetTextExtentPoint32( hdc, buf, len, &size );
DH(GetTextExtentPoint32)( hdc, buf, len, &size );
*widthP = (XP_U16)size.cx;
*heightP = (XP_U16)size.cy;
} /* ceWidthAndText */
@ -735,7 +736,7 @@ ce_draw_measureMiniWText( DrawCtx* p_dctx, XP_UCHAR* str,
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, len,
widebuf, sizeof(widebuf)/sizeof(widebuf[0]) );
widebuf[len] = 0;
GetTextExtentPoint32( hdc, widebuf, wcslen(widebuf), &size );
DH(GetTextExtentPoint32)( hdc, widebuf, wcslen(widebuf), &size );
maxWidth = (XP_U16)XP_MAX( maxWidth, size.cx );
height += size.cy + CE_INTERLINE_SPACE;

View file

@ -21,6 +21,7 @@
#include "cemain.h"
#include "ceclrsel.h"
#include "ceutil.h"
#include "debhacks.h"
/* Stuff the strings for phonies. Why can't I put this in the resource?
*/
@ -332,8 +333,8 @@ WrapPrefsDialog( HWND hDlg, CEAppGlobals* globals, CePrefsDlgState* state,
state->isNewGame = isNewGame;
XP_MEMCPY( &state->prefsPrefs, prefsPrefs, sizeof( state->prefsPrefs ) );
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg,
(DLGPROC)PrefsDlg, (long)state );
DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg,
(DLGPROC)PrefsDlg, (long)state );
result = !state->userCancelled;

View file

@ -20,6 +20,7 @@
#include "cesockwr.h"
#include "cemain.h"
#include "debhacks.h"
#include <winsock.h>
@ -92,7 +93,7 @@ queue_packet( CeSocketWrapper* self, XP_U8* packet, XP_U16 len )
XP_LOGF( "there are now %d packets on send queue", self->nPackets );
/* signal the writer thread */
SetEvent( self->queueAddEvent );
DH(SetEvent)( self->queueAddEvent );
success = XP_TRUE;
}
@ -216,7 +217,7 @@ connectSocket( CeSocketWrapper* self )
self->socket = sock;
/* Let the reader thread know there's now a socket to listen on */
SetEvent( self->socketConnEvent );
DH(SetEvent)( self->socketConnEvent );
} else {
logLastError( "connect" );
@ -246,7 +247,7 @@ closeConnection( CeSocketWrapper* self )
if ( self->connState >= CE_IP_UNCONNECTED ) {
if ( self->socket != -1 ) {
closesocket( self->socket );
MS(closesocket)( self->socket );
}
self->socket = -1;
@ -279,7 +280,7 @@ WriterThreadProc( LPVOID lpParameter )
/* Should this happen sooner? What if other thread signals in the
meantime? */
ResetEvent( self->queueAddEvent );
DH(ResetEvent)( self->queueAddEvent );
}
ExitThread(0); /* docs say to exit this way */