1 /***************************************************************************/
2 /*                                                                         */
3 /*  sfntpic.h                                                              */
4 /*                                                                         */
5 /*    The FreeType position independent code services for sfnt module.     */
6 /*                                                                         */
7 /*  Copyright 2009-2016 by                                                 */
8 /*  Oran Agra and Mickey Gabel.                                            */
9 /*                                                                         */
10 /*  This file is part of the FreeType project, and may only be used,       */
11 /*  modified, and distributed under the terms of the FreeType project      */
12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
13 /*  this file you indicate that you have read the license and              */
14 /*  understand and accept it fully.                                        */
15 /*                                                                         */
16 /***************************************************************************/
17 
18 
19 #ifndef SFNTPIC_H_
20 #define SFNTPIC_H_
21 
22 
23 #include FT_INTERNAL_PIC_H
24 
25 
26 #ifndef FT_CONFIG_OPTION_PIC
27 
28 #define SFNT_SERVICES_GET            sfnt_services
29 #define SFNT_SERVICE_GLYPH_DICT_GET  sfnt_service_glyph_dict
30 #define SFNT_SERVICE_PS_NAME_GET     sfnt_service_ps_name
31 #define TT_SERVICE_CMAP_INFO_GET     tt_service_get_cmap_info
32 #define TT_CMAP_CLASSES_GET          tt_cmap_classes
33 #define SFNT_SERVICE_SFNT_TABLE_GET  sfnt_service_sfnt_table
34 #define SFNT_SERVICE_BDF_GET         sfnt_service_bdf
35 #define SFNT_INTERFACE_GET           sfnt_interface
36 
37 #else /* FT_CONFIG_OPTION_PIC */
38 
39   /* some include files required for members of sfntModulePIC */
40 #include FT_SERVICE_GLYPH_DICT_H
41 #include FT_SERVICE_POSTSCRIPT_NAME_H
42 #include FT_SERVICE_SFNT_H
43 #include FT_SERVICE_TT_CMAP_H
44 
45 #ifdef TT_CONFIG_OPTION_BDF
46 #include "ttbdf.h"
47 #include FT_SERVICE_BDF_H
48 #endif
49 
50 #include FT_INTERNAL_DEBUG_H
51 #include FT_INTERNAL_STREAM_H
52 #include FT_INTERNAL_SFNT_H
53 #include "ttcmap.h"
54 
55 
56 FT_BEGIN_HEADER
57 
58   typedef struct  sfntModulePIC_
59   {
60     FT_ServiceDescRec*        sfnt_services;
61     FT_Service_GlyphDictRec   sfnt_service_glyph_dict;
62     FT_Service_PsFontNameRec  sfnt_service_ps_name;
63     FT_Service_TTCMapsRec     tt_service_get_cmap_info;
64     TT_CMap_Class*            tt_cmap_classes;
65     FT_Service_SFNT_TableRec  sfnt_service_sfnt_table;
66 #ifdef TT_CONFIG_OPTION_BDF
67     FT_Service_BDFRec         sfnt_service_bdf;
68 #endif
69     SFNT_Interface            sfnt_interface;
70 
71   } sfntModulePIC;
72 
73 
74 #define GET_PIC( lib )                                      \
75           ( (sfntModulePIC*)( (lib)->pic_container.sfnt ) )
76 
77 #define SFNT_SERVICES_GET                       \
78           ( GET_PIC( library )->sfnt_services )
79 #define SFNT_SERVICE_GLYPH_DICT_GET                       \
80           ( GET_PIC( library )->sfnt_service_glyph_dict )
81 #define SFNT_SERVICE_PS_NAME_GET                       \
82           ( GET_PIC( library )->sfnt_service_ps_name )
83 #define TT_SERVICE_CMAP_INFO_GET                           \
84           ( GET_PIC( library )->tt_service_get_cmap_info )
85 #define TT_CMAP_CLASSES_GET                       \
86           ( GET_PIC( library )->tt_cmap_classes )
87 #define SFNT_SERVICE_SFNT_TABLE_GET                       \
88           ( GET_PIC( library )->sfnt_service_sfnt_table )
89 #define SFNT_SERVICE_BDF_GET                       \
90           ( GET_PIC( library )->sfnt_service_bdf )
91 #define SFNT_INTERFACE_GET                       \
92           ( GET_PIC( library )->sfnt_interface )
93 
94 
95   /* see sfntpic.c for the implementation */
96   void
97   sfnt_module_class_pic_free( FT_Library  library );
98 
99   FT_Error
100   sfnt_module_class_pic_init( FT_Library  library );
101 
102 
103 FT_END_HEADER
104 
105 #endif /* FT_CONFIG_OPTION_PIC */
106 
107   /* */
108 
109 #endif /* SFNTPIC_H_ */
110 
111 
112 /* END */
113