Commit e5a09cff authored by Alexandre Julliard's avatar Alexandre Julliard

comdlg32: Reimplement the 16-bit font dialog on top of the 32-bit one.

Stub out the functionality that cannot be supported that way.
parent 459a0c4d
......@@ -206,29 +206,4 @@ int CC_HSLtoRGB(char c, int hue, int sat, int lum);
void CC_EditSetRGB( HWND hDlg, COLORREF cr );
void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, const COLORREF* lpcr );
typedef struct
{
HWND hWnd1;
HWND hWnd2;
LPCHOOSEFONTW lpcf32w;
int added;
} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;
INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd,
LPCFn_ENUMSTRUCT e);
INT AddFontStyle(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *metrics,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3,
HWND hDlg, BOOL iswin16);
void _dump_cf_flags(DWORD cflags);
LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTW lpcf);
LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTW lpcf);
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
const CHOOSEFONTW *lpcf);
#endif /* _WINE_DLL_CDLG_H */
......@@ -33,16 +33,24 @@
#include "dlgs.h"
#include "wine/debug.h"
#include "cderr.h"
#include "cdlg.h"
WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
typedef struct
{
HWND hWnd1;
HWND hWnd2;
LPCHOOSEFONTW lpcf32w;
int added;
} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;
static const WCHAR strWineFontData[] = {'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A',0};
static const WCHAR strWineFontData_a[] =
{'_','_','W','I','N','E','_','F','O','N','T','D','L','G','D','A','T','A','_','A',0};
static const WCHAR chooseFontW[] = {'C','H','O','O','S','E','_','F','O','N','T',0};
#include "cdlg.h"
/* image list with TrueType bitmaps and more */
static HIMAGELIST himlTT = 0;
#define TTBITMAP_XSIZE 20 /* x-size of the bitmaps */
......@@ -148,7 +156,7 @@ static const struct {
#undef XX
};
void _dump_cf_flags(DWORD cflags)
static void _dump_cf_flags(DWORD cflags)
{
unsigned int i;
......@@ -299,8 +307,8 @@ static BOOL CFn_HookCallChk32(const CHOOSEFONTW *lpcf)
/*************************************************************************
* AddFontFamily [internal]
*/
INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e)
static INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e)
{
int i;
WORD w;
......@@ -459,9 +467,8 @@ static inline void CFn_ReleaseDC(const CHOOSEFONTW *lpcf, HDC hdc)
/***********************************************************************
* AddFontStyle [internal]
*/
INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3,
HWND hDlg, BOOL iswin16)
static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg)
{
int i;
const LOGFONTW *lplf = &(lpElfex->elfLogFont);
......@@ -495,7 +502,7 @@ INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
if (i)
return 0;
}
if( iswin16 || !( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1;
if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1;
i = SendMessageW( hcmb5, CB_FINDSTRINGEXACT, 0,
(LPARAM)lpElfex->elfScript);
if( i == CB_ERR) {
......@@ -584,14 +591,13 @@ static INT WINAPI FontStyleEnumProc( const ENUMLOGFONTEXW *lpElfex,
HWND hcmb3=s->hWnd2;
HWND hDlg=GetParent(hcmb3);
return AddFontStyle( lpElfex, (const NEWTEXTMETRICEXW *) metrics,
dwFontType, s->lpcf32w, hcmb2, hcmb3, hDlg, FALSE);
dwFontType, s->lpcf32w, hcmb2, hcmb3, hDlg);
}
/***********************************************************************
* CFn_WMInitDialog [internal]
*/
LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTW lpcf)
static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcf)
{
HDC hdc;
int i,j,init=0;
......@@ -747,7 +753,7 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
/***********************************************************************
* CFn_WMMeasureItem [internal]
*/
LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
static LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
HFONT hfontprev;
......@@ -775,7 +781,7 @@ LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
/***********************************************************************
* CFn_WMDrawItem [internal]
*/
LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBrush;
WCHAR buffer[40];
......@@ -879,8 +885,7 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
/***********************************************************************
* CFn_WMCommand [internal]
*/
LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
LPCHOOSEFONTW lpcf)
static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, LPCHOOSEFONTW lpcf)
{
int i;
long l;
......@@ -1028,8 +1033,6 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
i=RegisterWindowMessageW( HELPMSGSTRINGW );
if (lpcf->hwndOwner)
SendMessageW(lpcf->hwndOwner, i, 0, (LPARAM)GetPropW(hDlg, strWineFontData));
/* if (CFn_HookCallChk(lpcf))
CallWindowProc16(lpcf->lpfnHook,hDlg,WM_COMMAND,psh15,(LPARAM)lpcf);*/
break;
case IDOK:
......@@ -1084,7 +1087,7 @@ static LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFO
return TRUE;
}
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, const CHOOSEFONTW *lpcf)
static LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, const CHOOSEFONTW *lpcf)
{
WINDOWINFO info;
......@@ -1137,8 +1140,7 @@ LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam, const CHOOSEFONTW *
/***********************************************************************
* FormatCharDlgProcA [internal]
*/
INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
static INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LPCHOOSEFONTW lpcfw;
LPCHOOSEFONTA lpcfa;
......@@ -1201,8 +1203,7 @@ INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
/***********************************************************************
* FormatCharDlgProcW [internal]
*/
INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam)
static INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LPCHOOSEFONTW lpcf;
INT_PTR res = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment