1 /***************************************************************************/
5 /* The FreeType position independent code services for psnames module. */
7 /* Copyright 2009, 2010 by */
8 /* Oran Agra and Mickey Gabel. */
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. */
16 /***************************************************************************/
20 #include FT_FREETYPE_H
21 #include FT_INTERNAL_OBJECTS_H
25 #ifdef FT_CONFIG_OPTION_PIC
27 /* forward declaration of PIC init functions from psmodule.c */
29 FT_Create_Class_pscmaps_services( FT_Library library,
30 FT_ServiceDescRec** output_class );
32 FT_Destroy_Class_pscmaps_services( FT_Library library,
33 FT_ServiceDescRec* clazz );
36 FT_Init_Class_pscmaps_interface( FT_Library library,
37 FT_Service_PsCMapsRec* clazz );
40 psnames_module_class_pic_free( FT_Library library )
42 FT_PIC_Container* pic_container = &library->pic_container;
43 FT_Memory memory = library->memory;
46 if ( pic_container->psnames )
48 PSModulePIC* container = (PSModulePIC*)pic_container->psnames;
51 if(container->pscmaps_services)
52 FT_Destroy_Class_pscmaps_services( library,
53 container->pscmaps_services );
54 container->pscmaps_services = NULL;
56 pic_container->psnames = NULL;
62 psnames_module_class_pic_init( FT_Library library )
64 FT_PIC_Container* pic_container = &library->pic_container;
65 FT_Error error = PSnames_Err_Ok;
66 PSModulePIC* container;
67 FT_Memory memory = library->memory;
70 /* allocate pointer, clear and set global container pointer */
71 if ( FT_ALLOC ( container, sizeof ( *container ) ) )
73 FT_MEM_SET( container, 0, sizeof ( *container ) );
74 pic_container->psnames = container;
76 /* initialize pointer table - this is how the module usually expects this data */
77 error = FT_Create_Class_pscmaps_services(
78 library, &container->pscmaps_services );
81 FT_Init_Class_pscmaps_interface( library,
82 &container->pscmaps_interface );
86 psnames_module_class_pic_free( library );
91 #endif /* FT_CONFIG_OPTION_PIC */