Sync with trunk r58740.
[reactos.git] / win32ss / drivers / font / ftfd / enable.c
1 /*
2 * PROJECT: ReactOS win32 subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: GDI font driver for bitmap fonts
5 * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
6 */
7
8 #include "ftfd.h"
9
10 static DRVFN gadrvfn[] =
11 {
12 {INDEX_DrvEnablePDEV, (PFN)FtfdEnablePDEV},
13 {INDEX_DrvCompletePDEV, (PFN)FtfdCompletePDEV},
14 {INDEX_DrvDisablePDEV, (PFN)FtfdDisablePDEV},
15 {INDEX_DrvLoadFontFile, (PFN)FtfdLoadFontFile},
16 {INDEX_DrvUnloadFontFile, (PFN)FtfdUnloadFontFile},
17 {INDEX_DrvQueryFontFile, (PFN)FtfdQueryFontFile},
18 {INDEX_DrvQueryFontCaps, (PFN)FtfdQueryFontCaps},
19 {INDEX_DrvQueryFontTree, (PFN)FtfdQueryFontTree},
20 {INDEX_DrvQueryFont, (PFN)FtfdQueryFont},
21 {INDEX_DrvFree, (PFN)FtfdFree},
22 {INDEX_DrvQueryGlyphAttrs, (PFN)FtfdQueryGlyphAttrs},
23 {INDEX_DrvQueryFontData, (PFN)FtfdQueryFontData},
24 };
25
26 FT_Library gftlibrary;
27
28
29 BOOL
30 APIENTRY
31 FtfdEnableDriver(
32 ULONG iEngineVersion,
33 ULONG cj,
34 PDRVENABLEDATA pded)
35 {
36 FT_Error fterror;
37
38 DbgPrint("FtfdEnableDriver()\n");
39
40 /* Check parameter */
41 if (cj < sizeof(DRVENABLEDATA))
42 {
43 return FALSE;
44 }
45
46 /* Initialize freetype library */
47 fterror = FT_Init_FreeType(&gftlibrary);
48 if (fterror)
49 {
50 DbgPrint("an error occurred during library initialization: %ld.\n", fterror);
51 return FALSE;
52 }
53
54 /* Fill DRVENABLEDATA */
55 pded->c = sizeof(gadrvfn) / sizeof(DRVFN);
56 pded->pdrvfn = gadrvfn;
57 pded->iDriverVersion = DDI_DRIVER_VERSION_NT5;
58
59 /* Success */
60 return TRUE;
61 }
62
63
64 DHPDEV
65 APIENTRY
66 FtfdEnablePDEV(
67 IN DEVMODEW *pdm,
68 IN LPWSTR pwszLogAddress,
69 IN ULONG cPat,
70 OUT HSURF *phsurfPatterns,
71 IN ULONG cjCaps,
72 OUT ULONG *pdevcaps,
73 IN ULONG cjDevInfo,
74 OUT DEVINFO *pdi,
75 IN HDEV hdev,
76 IN LPWSTR pwszDeviceName,
77 IN HANDLE hDriver)
78 {
79 DbgPrint("FtfdEnablePDEV(hdev=%p)\n", hdev);
80 __debugbreak();
81
82
83 /* Return a dummy DHPDEV */
84 return (PVOID)1;
85 }
86
87
88 VOID
89 APIENTRY
90 FtfdCompletePDEV(
91 IN DHPDEV dhpdev,
92 IN HDEV hdev)
93 {
94 DbgPrint("FtfdCompletePDEV()\n");
95 /* Nothing to do */
96 }
97
98
99 VOID
100 APIENTRY
101 FtfdDisablePDEV(
102 IN DHPDEV dhpdev)
103 {
104 DbgPrint("FtfdDisablePDEV()\n");
105 /* Nothing to do */
106 }