1/*
2 *
3 * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
4 *
5 */
6
7#include <windows.h>
8
9#include "unicode/utypes.h"
10#include "loengine.h"
11#include "rsurface.h"
12#include "gsupport.h"
13
14#include "gdiglue.h"
15
16#include "LETypes.h"
17#include "LEFontInstance.h"
18#include "GDIGUISupport.h"
19#include "GDIFontMap.h"
20#include "ScriptCompositeFontInstance.h"
21
22
23U_CDECL_BEGIN
24
25gs_guiSupport *gs_gdiGuiSupportOpen()
26{
27    return (gs_guiSupport *) new GDIGUISupport();
28}
29
30void gs_gdiGuiSupportClose(gs_guiSupport *guiSupport)
31{
32    GDIGUISupport *gs = (GDIGUISupport *) guiSupport;
33
34    delete gs;
35}
36
37rs_surface *rs_gdiRenderingSurfaceOpen(HDC hdc)
38{
39    return (rs_surface *) new GDISurface(hdc);
40}
41
42void rs_gdiRenderingSurfaceSetHDC(rs_surface *surface, HDC hdc)
43{
44    GDISurface *rs = (GDISurface *) surface;
45
46    rs->setHDC(hdc);
47}
48
49void rs_gdiRenderingSurfaceClose(rs_surface *surface)
50{
51    GDISurface *rs = (GDISurface *) surface;
52
53    delete rs;
54}
55
56fm_fontMap *fm_gdiFontMapOpen(rs_surface *surface, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status)
57{
58    return (fm_fontMap *) new GDIFontMap((GDISurface *) surface, fileName, pointSize, (GDIGUISupport *) guiSupport, *status);
59}
60
61void fm_fontMapClose(fm_fontMap *fontMap)
62{
63    GDIFontMap *fm = (GDIFontMap *) fontMap;
64
65    delete fm;
66}
67
68le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap)
69{
70    return (le_font *) new ScriptCompositeFontInstance((FontMap *) fontMap);
71}
72
73void le_fontClose(le_font *font)
74{
75    LEFontInstance *fi = (LEFontInstance *) font;
76
77    delete fi;
78}
79
80U_CDECL_END
81