diff --git a/wince/ceclrsel.c.~1~ b/wince/ceclrsel.c.~1~ deleted file mode 100644 index 0d1bdbaaa..000000000 --- a/wince/ceclrsel.c.~1~ +++ /dev/null @@ -1,19 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2002 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - diff --git a/wince/ceclrsel.c.~2~ b/wince/ceclrsel.c.~2~ deleted file mode 100644 index 03425247f..000000000 --- a/wince/ceclrsel.c.~2~ +++ /dev/null @@ -1,110 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - */ - -static void -initColorData( ColorsDlgState* cState ) -{ - CEAppGlobals* globals = cState->globals; - - for ( i = 0; i < NUM_COLORS; ++i ) { - COLORREF ref = globals->appPrefs.colors[i]; - cState->colors[i] = ref; - cState->brushes[i] = CreateSolidBrush( ref ); - } -} /* initColorData */ - -static HBRUSH -brushForButton( ColorsDlgState* cState, HWND hwndButton ) -{ - XP_U16 i; - for ( i = 0; i < NUM_COLORS; ++i ) { - if ( cState->buttons[i] == hwndButton ) { - return cState->brushes[i]; - } - } - return NULL; -} /* brushForButton */ - -static void -deleteButtonBrushes( ColorsDlgState* cState ) -{ - XP_U16 i; - for ( i = 0; i < NUM_COLORS; ++i ) { - DeleteObject( cState->brushes[i] ); - } -} /* deleteButtonBrushes */ - -LRESULT CALLBACK -ColorsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) -{ - ColorsDlgState* cState; - - if ( message == WM_INITDIALOG ) { - SetWindowLong( hDlg, GWL_USERDATA, lParam ); - - cState = (ColorsDlgState*)lParam; - cState->cancelled = XP_TRUE; - cState->inited = XP_FALSE; - - return TRUE; - } else { - cState = (ColorsDlgState*)GetWindowLong( hDlg, GWL_USERDATA ); - - if ( !cState->inited ) { - initColorData( cState ); - cState->inited = XP_TRUE; - } - - switch (message) { - - case WM_CTLCOLORBTN: { - HDC hdcButton = (HDC)wParam; - HWND hwndButton = (HWND)lParam; - HBRUSH brush = brushForButton( cState, hwndButton ); - return (BOOL)brush; - } - - case WM_COMMAND: - switch( LOWORD(wParam) ) { - - case IDOK: - ceControlsToPrefs( hDlg, &cState->prefsPrefs ); - cState->cancelled = XP_FALSE; - /* fallthrough */ - - case IDCANCEL: - deleteButtonBrushes( cState ); - EndDialog(hDlg, id); - return TRUE; - default: - /* it's one of the color buttons. Set up with the - appropriate color and launch ChooseColor */ - BOOL hitOk = ChooseColor( &ccs ); - } - - - } - } - - return FALSE; - -} /* ColorsDlg */ diff --git a/wince/ceclrsel.c.~3~ b/wince/ceclrsel.c.~3~ deleted file mode 100644 index 2257efc3d..000000000 --- a/wince/ceclrsel.c.~3~ +++ /dev/null @@ -1,171 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef XWFEATURE_CE_EDITCOLORS - -#include -//#include -#include "stdafx.h" - -#include "ceclrsel.h" - -typedef struct ColorsDlgState { - - CEAppGlobals* globals; - - COLORREF colors[NUM_EDITABLE_COLORS]; - HBRUSH brushes[NUM_EDITABLE_COLORS]; - HWND buttons[NUM_EDITABLE_COLORS]; - - XP_Bool cancelled; -} ColorsDlgState; - -#define FIRST_BUTTON PLAYER1_BUTTON -#define LAST_BUTTON TBACK_BUTTON - -static void -initColorData( ColorsDlgState* cState, HWND hDlg ) -{ - CEAppGlobals* globals = cState->globals; - XP_U16 i; - - XP_ASSERT( (LAST_BUTTON - FIRST_BUTTON + 1) == NUM_EDITABLE_COLORS ); - - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - COLORREF ref = globals->appPrefs.colors[i]; - cState->colors[i] = ref; - cState->brushes[i] = CreateSolidBrush( ref ); - cState->buttons[i] = GetDlgItem( hDlg, FIRST_BUTTON + i ); - } -} /* initColorData */ - -static HBRUSH -brushForButton( ColorsDlgState* cState, HWND hwndButton ) -{ - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - if ( cState->buttons[i] == hwndButton ) { - return cState->brushes[i]; - } - } - return NULL; -} /* brushForButton */ - -static void -deleteButtonBrushes( ColorsDlgState* cState ) -{ - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - DeleteObject( cState->brushes[i] ); - } -} /* deleteButtonBrushes */ - -static void -wrapChooseColor( ColorsDlgState* cState ) -{ - CHOOSECOLOR ccs; - - XP_MEMSET( &ccs, 0, sizeof(ccs) ); - - BOOL hitOk = ChooseColor( &ccs ); -} /* wrapChooseColor */ - -LRESULT CALLBACK -ColorsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) -{ - ColorsDlgState* cState; - XP_U16 wid; - - if ( message == WM_INITDIALOG ) { - SetWindowLong( hDlg, GWL_USERDATA, lParam ); - - cState = (ColorsDlgState*)lParam; - cState->cancelled = XP_TRUE; - cState->inited = XP_FALSE; - - return TRUE; - } else { - cState = (ColorsDlgState*)GetWindowLong( hDlg, GWL_USERDATA ); - - if ( !cState->inited ) { - initColorData( cState, hDlg ); - cState->inited = XP_TRUE; - } - - switch (message) { - - case WM_CTLCOLORBTN: { - HDC hdcButton = (HDC)wParam; - HWND hwndButton = (HWND)lParam; - HBRUSH brush = brushForButton( cState, hwndButton ); -/* if ( !!brush ) { */ -/* SetSysColors( hdcButton ) */ -/* } */ - return (BOOL)brush; - } - - case WM_COMMAND: - wid = LOWORD(wParam); - switch( wid ) { - - case IDOK: - ceControlsToPrefs( hDlg, &cState->prefsPrefs ); - cState->cancelled = XP_FALSE; - /* fallthrough */ - - case IDCANCEL: - deleteButtonBrushes( cState ); - EndDialog(hDlg, id); - return TRUE; - default: - /* it's one of the color buttons. Set up with the - appropriate color and launch ChooseColor */ - wrapChooseColor( cState ); - return TRUE; - } - - - } - } - - return FALSE; -} /* ColorsDlg */ - -XP_Bool -ceDoColorsEdit( HWND hDlg, CEAppGlobals* globals ) -{ - ColorsDlgState state; - XP_MEMSET( &state, 0, sizeof(state) ); - - state.globals = globals; - - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hDlg, - (DLGPROC)ColorsDlg, (long)&state ); - - if ( !state.cancelled ) { - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - globals->appPrefs.colors[i] = state.colors[i]; - } - } - - return !state.cancelled; -} /* ceDoColorsEdit */ - -#endif diff --git a/wince/ceclrsel.c.~4~ b/wince/ceclrsel.c.~4~ deleted file mode 100644 index 6c693c7f4..000000000 --- a/wince/ceclrsel.c.~4~ +++ /dev/null @@ -1,187 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef XWFEATURE_CE_EDITCOLORS - -#include -#include "stdafx.h" -#include - -#include "ceclrsel.h" - -typedef struct ColorsDlgState { - - CEAppGlobals* globals; - - COLORREF colors[NUM_EDITABLE_COLORS]; - HBRUSH brushes[NUM_EDITABLE_COLORS]; - HWND buttons[NUM_EDITABLE_COLORS]; - - XP_Bool cancelled; - XP_Bool inited; -} ColorsDlgState; - -#define FIRST_BUTTON PLAYER1_BUTTON -#define LAST_BUTTON TBACK_BUTTON - -static void -initColorData( ColorsDlgState* cState, HWND hDlg ) -{ - CEAppGlobals* globals = cState->globals; - XP_U16 i; - - XP_ASSERT( (LAST_BUTTON - FIRST_BUTTON + 1) == NUM_EDITABLE_COLORS ); - - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - COLORREF ref = globals->appPrefs.colors[i]; - cState->colors[i] = ref; - XP_LOGF( "ref[%d] = 0x%lx", i, (unsigned long)ref ); - cState->brushes[i] = CreateSolidBrush( ref ); - cState->buttons[i] = GetDlgItem( hDlg, FIRST_BUTTON + i ); - } -} /* initColorData */ - -static HBRUSH -brushForButton( ColorsDlgState* cState, HWND hwndButton ) -{ - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - if ( cState->buttons[i] == hwndButton ) { - return cState->brushes[i]; - } - } - return NULL; -} /* brushForButton */ - -static void -deleteButtonBrushes( ColorsDlgState* cState ) -{ - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - DeleteObject( cState->brushes[i] ); - } -} /* deleteButtonBrushes */ - -static void -wrapChooseColor( ColorsDlgState* cState, HWND owner, XP_U16 button ) -{ - CHOOSECOLOR ccs; - BOOL hitOk; - COLORREF arr[16]; - - XP_MEMSET( &ccs, 0, sizeof(ccs) ); - XP_MEMSET( &arr, 0, sizeof(arr) ); - - ccs.lStructSize = sizeof(ccs); - ccs.hwndOwner = owner; - ccs.rgbResult = cState->colors[button-FIRST_BUTTON]; - ccs.lpCustColors = arr; - - ccs.Flags = CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN; - - hitOk = ChooseColor( &ccs ); - - if ( hitOk ) { - cState->colors[button-FIRST_BUTTON] = ccs.rgbResult; - } -} /* wrapChooseColor */ - -LRESULT CALLBACK -ColorsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) -{ - ColorsDlgState* cState; - XP_U16 wid; - - if ( message == WM_INITDIALOG ) { - SetWindowLong( hDlg, GWL_USERDATA, lParam ); - - cState = (ColorsDlgState*)lParam; - cState->cancelled = XP_TRUE; - cState->inited = XP_FALSE; - - return TRUE; - } else { - cState = (ColorsDlgState*)GetWindowLong( hDlg, GWL_USERDATA ); - - if ( !cState->inited ) { - initColorData( cState, hDlg ); - cState->inited = XP_TRUE; - } - - switch (message) { - - case WM_CTLCOLORBTN: { - HDC hdcButton = (HDC)wParam; - HWND hwndButton = (HWND)lParam; - HBRUSH brush = brushForButton( cState, hwndButton ); -/* if ( !!brush ) { */ -/* SetSysColors( hdcButton ) */ -/* } */ - return (BOOL)brush; - } - - case WM_COMMAND: - wid = LOWORD(wParam); - switch( wid ) { - - case IDOK: - cState->cancelled = XP_FALSE; - /* fallthrough */ - - case IDCANCEL: - deleteButtonBrushes( cState ); - EndDialog(hDlg, wid); - return TRUE; - default: - /* it's one of the color buttons. Set up with the - appropriate color and launch ChooseColor */ - wrapChooseColor( cState, hDlg, wid ); - return TRUE; - } - - - } - } - - return FALSE; -} /* ColorsDlg */ - -XP_Bool -ceDoColorsEdit( HWND hwnd, CEAppGlobals* globals ) -{ - ColorsDlgState state; - int result; - - XP_MEMSET( &state, 0, sizeof(state) ); - state.globals = globals; - - result = DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd, - (DLGPROC)ColorsDlg, (long)&state ); - - if ( !state.cancelled ) { - XP_U16 i; - for ( i = 0; i < NUM_EDITABLE_COLORS; ++i ) { - globals->appPrefs.colors[i] = state.colors[i]; - } - } - - return !state.cancelled; -} /* ceDoColorsEdit */ - -#endif diff --git a/wince/ceclrsel.h.~1~ b/wince/ceclrsel.h.~1~ deleted file mode 100644 index 25755ebe2..000000000 --- a/wince/ceclrsel.h.~1~ +++ /dev/null @@ -1,18 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ diff --git a/wince/ceclrsel.h.~2~ b/wince/ceclrsel.h.~2~ deleted file mode 100644 index 1c0d777e2..000000000 --- a/wince/ceclrsel.h.~2~ +++ /dev/null @@ -1,37 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _CECLRSEL_H_ -#define _CECLRSEL_H_ - -typedef struct ColorsDlgState { - - COLORREF colors[NUM_COLORS]; - HBRUSH brushes[NUM_COLORS]; - HWND buttons[NUM_COLORS]; - - XP_Bool cancelled; -} ColorsDlgState; - - -LRESULT CALLBACK ColorsDlg( HWND hDlg, UINT message, WPARAM wParam, - LPARAM lParam ); - - -#endif diff --git a/wince/ceclrsel.h.~3~ b/wince/ceclrsel.h.~3~ deleted file mode 100644 index ae5cc9045..000000000 --- a/wince/ceclrsel.h.~3~ +++ /dev/null @@ -1,32 +0,0 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ -/* - * Copyright 2004 by Eric House (fixin@peak.org). All rights reserved. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _CECLRSEL_H_ -#define _CECLRSEL_H_ - -#ifdef XWFEATURE_CE_EDITCOLORS - -#include "xptypes.h" -#include "cemain.h" - -XP_Bool ceDoColorsEdit( CEAppGlobals* globals ); - -#endif - -#endif