use debhacks; ifdef out cmdbar stuff which debian tools don't support yet

This commit is contained in:
ehouse 2006-01-28 19:02:04 +00:00
parent df51f38946
commit 3174ff031f

View file

@ -46,7 +46,7 @@
#include "ceclrsel.h" #include "ceclrsel.h"
#include "cehntlim.h" #include "cehntlim.h"
#include "LocalizedStrIncludes.h" #include "LocalizedStrIncludes.h"
#include "debhacks.h"
#define MAX_LOADSTRING 100 #define MAX_LOADSTRING 100
/* #define PREFSFILENAME L"\\My Documents\\Personal\\.xwprefs" */ /* #define PREFSFILENAME L"\\My Documents\\Personal\\.xwprefs" */
@ -185,6 +185,23 @@ WinMain( HINSTANCE hInstance,
return msg.wParam; return msg.wParam;
} }
#ifdef __GNUC__
int
main()
{
XP_LOGF( "main called" );
return WinMain( GetModuleHandle(NULL), 0,
#if defined TARGET_OS_WINCE
GetCommandLineW(),
#elif defined TARGET_OS_WIN32
GetCommandLineA(),
#endif
0 );
}
#endif
// //
// FUNCTION: MyRegisterClass() // FUNCTION: MyRegisterClass()
// //
@ -237,6 +254,7 @@ addButtonsToCmdBar( CEAppGlobals* globals )
-1 -1
}; };
#ifndef CANT_DO_CMDBAR
#ifdef TARGET_OS_WINCE #ifdef TARGET_OS_WINCE
for ( i = 0; i < N_TOOLBAR_BUTTONS; ++i ) { for ( i = 0; i < N_TOOLBAR_BUTTONS; ++i ) {
index = CommandBar_AddBitmap(globals->hwndCB, globals->hInst, index = CommandBar_AddBitmap(globals->hwndCB, globals->hInst,
@ -246,6 +264,7 @@ addButtonsToCmdBar( CEAppGlobals* globals )
success = CommandBar_InsertButton( globals->hwndCB, -1, &buttData ); success = CommandBar_InsertButton( globals->hwndCB, -1, &buttData );
} }
#endif #endif
#endif
} /* addButtonsToCmdBar */ } /* addButtonsToCmdBar */
static void static void
@ -606,8 +625,7 @@ logLastError( XP_UCHAR* comment )
XP_U16 len; XP_U16 len;
XP_U16 lenSoFar; XP_U16 lenSoFar;
strcpy( msg, comment ); sprintf( msg, "%s (err: %d): ", comment, lastErr );
strcat( msg, ": " );
lenSoFar = strlen( msg ); lenSoFar = strlen( msg );
FormatMessage( FormatMessage(
@ -985,10 +1003,12 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
ShowWindow(hWnd, nCmdShow); ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd); UpdateWindow(hWnd);
#ifndef CANT_DO_CMDBAR
#ifdef TARGET_OS_WINCE #ifdef TARGET_OS_WINCE
if (globals->hwndCB) { if (globals->hwndCB) {
CommandBar_Show(globals->hwndCB, TRUE); CommandBar_Show(globals->hwndCB, TRUE);
} }
#endif
#endif #endif
if ( result && !newDone ) { if ( result && !newDone ) {
ceInitAndStartBoard( globals, !oldGameLoaded, NULL, NULL ); ceInitAndStartBoard( globals, !oldGameLoaded, NULL, NULL );
@ -1130,7 +1150,7 @@ doNewGame( CEAppGlobals* globals, XP_Bool silent )
giState.globals = globals; giState.globals = globals;
giState.isNewGame = XP_TRUE; giState.isNewGame = XP_TRUE;
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_GAMEINFO, globals->hWnd, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_GAMEINFO, globals->hWnd,
(DLGPROC)GameInfo, (long)&giState ); (DLGPROC)GameInfo, (long)&giState );
if ( !giState.userCancelled if ( !giState.userCancelled
@ -1599,8 +1619,8 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
// Parse the menu selections: // Parse the menu selections:
switch (wmId) { switch (wmId) {
case ID_FILE_ABOUT: case ID_FILE_ABOUT:
DialogBox(globals->hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, DH(DialogBoxParam)(globals->hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd,
(DLGPROC)About); (DLGPROC)About, NULL );
break; break;
case ID_GAME_GAMEINFO: { case ID_GAME_GAMEINFO: {
GameInfoState state; GameInfoState state;
@ -1609,7 +1629,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
state.globals = globals; state.globals = globals;
state.isNewGame = XP_FALSE; state.isNewGame = XP_FALSE;
DialogBoxParam(globals->hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, DH(DialogBoxParam)(globals->hInst, (LPCTSTR)IDD_GAMEINFO, hWnd,
(DLGPROC)GameInfo, (long)&state ); (DLGPROC)GameInfo, (long)&state );
if ( !state.userCancelled && state.prefsChanged ) { if ( !state.userCancelled && state.prefsChanged ) {
@ -1783,8 +1803,10 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break; break;
case WM_DESTROY: case WM_DESTROY:
#ifndef CANT_DO_CMDBAR
#ifdef TARGET_OS_WINCE #ifdef TARGET_OS_WINCE
CommandBar_Destroy(globals->hwndCB); /* supposedly not needed */ CommandBar_Destroy(globals->hwndCB); /* supposedly not needed */
#endif
#endif #endif
PostQuitMessage(0); PostQuitMessage(0);
break; break;
@ -1859,7 +1881,7 @@ ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream,
init.isQuery = isQuery; init.isQuery = isQuery;
init.globals = globals; init.globals = globals;
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_STRBOX, globals->hWnd, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_STRBOX, globals->hWnd,
(DLGPROC)StrBox, (long)&init ); (DLGPROC)StrBox, (long)&init );
if ( destroy ) { if ( destroy ) {
@ -1965,7 +1987,7 @@ makeTimeStamp( XP_UCHAR* timeStamp, XP_U16 size )
SYSTEMTIME st; SYSTEMTIME st;
DWORD tid; DWORD tid;
tid = GetCurrentThreadId(); tid = DH(GetCurrentThreadId)();
GetLocalTime( &st ); GetLocalTime( &st );
sprintf( timeStamp, "<%lx>%d:%.2d:%.2d ", tid, st.wHour, st.wMinute, sprintf( timeStamp, "<%lx>%d:%.2d:%.2d ", tid, st.wHour, st.wMinute,
@ -2256,7 +2278,7 @@ ce_util_userPickTile( XW_UtilCtxt* uc, const PickInfo* pi,
state.playerNum = playerNum; state.playerNum = playerNum;
state.pi = pi; state.pi = pi;
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKBLANK, globals->hWnd, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_ASKBLANK, globals->hWnd,
(DLGPROC)BlankDlg, (long)&state ); (DLGPROC)BlankDlg, (long)&state );
return state.result; return state.result;
} /* ce_util_userPickTile */ } /* ce_util_userPickTile */
@ -2273,7 +2295,7 @@ ce_util_askPassword( XW_UtilCtxt* uc, const XP_UCHAR* name,
state.buf = buf; state.buf = buf;
state.lenp = len; state.lenp = len;
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKPASS, globals->hWnd, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_ASKPASS, globals->hWnd,
(DLGPROC)PasswdDlg, (long)&state ); (DLGPROC)PasswdDlg, (long)&state );
return !state.userCancelled; return !state.userCancelled;
@ -2526,7 +2548,7 @@ ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min, XP_U16* max )
hls.min = *min; hls.min = *min;
hls.max = *max; hls.max = *max;
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKHINTLIMTS, globals->hWnd, DH(DialogBoxParam)( globals->hInst, (LPCTSTR)IDD_ASKHINTLIMTS, globals->hWnd,
(DLGPROC)HintLimitsDlg, (long)&hls ); (DLGPROC)HintLimitsDlg, (long)&hls );
if ( !hls.cancelled ) { if ( !hls.cancelled ) {