Add AppDefaults app selection to control panel
[wine/gsoc-2012-control.git] / dlls / commdlg.dll16 / fontdlg.c
blobb7c87fd7361d7c2fb7256c9e048ea4b9b9c60508
1 /*
2 * COMMDLG - Font Dialog
4 * Copyright 1994 Martin Ayotte
5 * Copyright 1996 Albrecht Kleine
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <ctype.h>
23 #include <stdlib.h>
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <string.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "wine/winbase16.h"
32 #include "wine/winuser16.h"
33 #include "commdlg.h"
34 #include "wine/debug.h"
35 #include "cderr.h"
36 #include "cdlg16.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
40 /***********************************************************************
41 * FontFamilyEnumProc (COMMDLG.19)
43 INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
44 UINT16 nFontType, LPARAM lParam )
46 FIXME( "%08x %08x %u %lx\n", logfont, metrics, nFontType, lParam );
47 return 0;
50 /***********************************************************************
51 * FontStyleEnumProc (COMMDLG.18)
53 INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
54 UINT16 nFontType, LPARAM lParam )
56 FIXME( "%08x %08x %u %lx\n", logfont, metrics, nFontType, lParam );
57 return 0;
60 /***********************************************************************
61 * ChooseFont (COMMDLG.15)
63 BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
65 CHOOSEFONTA cf32;
66 LOGFONTA lf32;
67 LOGFONT16 *font16;
69 if (!lpChFont) return FALSE;
70 font16 = MapSL(lpChFont->lpLogFont);
72 cf32.lStructSize = sizeof(CHOOSEFONTW);
73 cf32.hwndOwner = HWND_32(lpChFont->hwndOwner);
74 cf32.hDC = HDC_32(lpChFont->hDC);
75 cf32.iPointSize = lpChFont->iPointSize;
76 cf32.Flags = lpChFont->Flags & ~(CF_ENABLETEMPLATEHANDLE | CF_ENABLETEMPLATE);
77 cf32.rgbColors = lpChFont->rgbColors;
78 cf32.lCustData = lpChFont->lCustData;
79 cf32.lpfnHook = NULL;
80 cf32.hInstance = GetModuleHandleA("comdlg32.dll");
81 cf32.nFontType = lpChFont->nFontType;
82 cf32.nSizeMax = lpChFont->nSizeMax;
83 cf32.nSizeMin = lpChFont->nSizeMin;
84 cf32.lpLogFont = &lf32;
86 lf32.lfHeight = font16->lfHeight;
87 lf32.lfWidth = font16->lfWidth;
88 lf32.lfEscapement = font16->lfEscapement;
89 lf32.lfOrientation = font16->lfOrientation;
90 lf32.lfWeight = font16->lfWeight;
91 lf32.lfItalic = font16->lfItalic;
92 lf32.lfUnderline = font16->lfUnderline;
93 lf32.lfStrikeOut = font16->lfStrikeOut;
94 lf32.lfCharSet = font16->lfCharSet;
95 lf32.lfOutPrecision = font16->lfOutPrecision;
96 lf32.lfClipPrecision = font16->lfClipPrecision;
97 lf32.lfQuality = font16->lfQuality;
98 lf32.lfPitchAndFamily = font16->lfPitchAndFamily;
99 lstrcpynA( lf32.lfFaceName, font16->lfFaceName, LF_FACESIZE );
101 if (lpChFont->Flags & (CF_ENABLETEMPLATEHANDLE | CF_ENABLETEMPLATE))
102 FIXME( "custom templates no longer supported, using default\n" );
104 if (lpChFont->lpfnHook)
105 FIXME( "custom hook %p no longer supported\n", lpChFont->lpfnHook );
107 if (!ChooseFontA( &cf32 )) return FALSE;
109 lpChFont->iPointSize = cf32.iPointSize;
110 lpChFont->Flags = cf32.Flags;
111 lpChFont->rgbColors = cf32.rgbColors;
112 lpChFont->lCustData = cf32.lCustData;
113 lpChFont->nFontType = cf32.nFontType;
115 font16->lfHeight = lf32.lfHeight;
116 font16->lfWidth = lf32.lfWidth;
117 font16->lfEscapement = lf32.lfEscapement;
118 font16->lfOrientation = lf32.lfOrientation;
119 font16->lfWeight = lf32.lfWeight;
120 font16->lfItalic = lf32.lfItalic;
121 font16->lfUnderline = lf32.lfUnderline;
122 font16->lfStrikeOut = lf32.lfStrikeOut;
123 font16->lfCharSet = lf32.lfCharSet;
124 font16->lfOutPrecision = lf32.lfOutPrecision;
125 font16->lfClipPrecision = lf32.lfClipPrecision;
126 font16->lfQuality = lf32.lfQuality;
127 font16->lfPitchAndFamily = lf32.lfPitchAndFamily;
128 lstrcpynA( font16->lfFaceName, lf32.lfFaceName, LF_FACESIZE );
129 return TRUE;
132 /***********************************************************************
133 * FormatCharDlgProc (COMMDLG.16)
134 FIXME: 1. some strings are "hardcoded", but it's better load from sysres
135 2. some CF_.. flags are not supported
136 3. some TType extensions
138 BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message,
139 WPARAM16 wParam, LPARAM lParam)
141 FIXME( "%04x %04x %04x %08lx: stub\n", hDlg16, message, wParam, lParam );
142 return FALSE;