Imported Upstream version 58.1
[platform/upstream/icu.git] / source / samples / layout / gnomeglue.cpp
1 /*
2  *
3  * Copyright (C) 2016 and later: Unicode, Inc. and others.
4  * License & terms of use: http://www.unicode.org/copyright.html#License
5  *
6  * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
7  *
8  */
9
10 #include <gnome.h>
11 #include <ft2build.h>
12 #include FT_FREETYPE_H
13
14 #include "unicode/utypes.h"
15 #include "loengine.h"
16 #include "rsurface.h"
17 #include "gsupport.h"
18
19 #include "gnomeglue.h"
20
21 #include "LETypes.h"
22 #include "LEFontInstance.h"
23 #include "GnomeGUISupport.h"
24 #include "GnomeFontMap.h"
25 #include "GnomeFontInstance.h"
26 #include "ScriptCompositeFontInstance.h"
27
28
29 U_CDECL_BEGIN
30
31 gs_guiSupport *gs_gnomeGuiSupportOpen()
32 {
33     return (gs_guiSupport *) new GnomeGUISupport();
34 }
35
36 void gs_gnomeGuiSupportClose(gs_guiSupport *guiSupport)
37 {
38     GnomeGUISupport *gs = (GnomeGUISupport *) guiSupport;
39
40     delete gs;
41 }
42
43 rs_surface *rs_gnomeRenderingSurfaceOpen(GtkWidget *theWidget)
44 {
45     return (rs_surface *) new GnomeSurface(theWidget);
46 }
47
48 void rs_gnomeRenderingSurfaceClose(rs_surface *surface)
49 {
50     GnomeSurface *rs = (GnomeSurface *) surface;
51
52     delete rs;
53 }
54
55 fm_fontMap *fm_gnomeFontMapOpen(FT_Library engine, const char *fileName, le_int16 pointSize, gs_guiSupport *guiSupport, LEErrorCode *status)
56 {
57     return (fm_fontMap *) new GnomeFontMap(engine, fileName, pointSize, (GnomeGUISupport *) guiSupport, *status);
58 }
59
60 void fm_fontMapClose(fm_fontMap *fontMap)
61 {
62     GnomeFontMap *fm = (GnomeFontMap *) fontMap;
63
64     delete fm;
65 }
66
67 le_font *le_scriptCompositeFontOpen(fm_fontMap *fontMap)
68 {
69     return (le_font *) new ScriptCompositeFontInstance((FontMap *) fontMap);
70 }
71
72 void le_fontClose(le_font *font)
73 {
74     LEFontInstance *fi = (LEFontInstance *) font;
75
76     delete fi;
77 }
78
79 U_CDECL_END