ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cffpic.c
Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  cffpic.c                                                               */
00004 /*                                                                         */
00005 /*    The FreeType position independent code services for cff module.      */
00006 /*                                                                         */
00007 /*  Copyright 2009, 2010 by                                                */
00008 /*  Oran Agra and Mickey Gabel.                                            */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #include <ft2build.h>
00020 #include FT_FREETYPE_H
00021 #include FT_INTERNAL_OBJECTS_H
00022 #include "cffpic.h"
00023 
00024 #ifdef FT_CONFIG_OPTION_PIC
00025 
00026   /* forward declaration of PIC init functions from cffdrivr.c */
00027   FT_Error FT_Create_Class_cff_services( FT_Library, FT_ServiceDescRec**);
00028   void FT_Destroy_Class_cff_services( FT_Library, FT_ServiceDescRec*);
00029   void FT_Init_Class_cff_service_ps_info( FT_Library, FT_Service_PsInfoRec*);
00030   void FT_Init_Class_cff_service_glyph_dict( FT_Library, FT_Service_GlyphDictRec*);
00031   void FT_Init_Class_cff_service_ps_name( FT_Library, FT_Service_PsFontNameRec*);
00032   void FT_Init_Class_cff_service_get_cmap_info( FT_Library, FT_Service_TTCMapsRec*);
00033   void FT_Init_Class_cff_service_cid_info( FT_Library, FT_Service_CIDRec*);
00034 
00035   /* forward declaration of PIC init functions from cffparse.c */
00036   FT_Error FT_Create_Class_cff_field_handlers( FT_Library, CFF_Field_Handler**);
00037   void FT_Destroy_Class_cff_field_handlers( FT_Library, CFF_Field_Handler*);
00038 
00039   /* forward declaration of PIC init functions from cffcmap.c */
00040   void FT_Init_Class_cff_cmap_encoding_class_rec( FT_Library, FT_CMap_ClassRec*);
00041   void FT_Init_Class_cff_cmap_unicode_class_rec( FT_Library, FT_CMap_ClassRec*);
00042 
00043   void
00044   cff_driver_class_pic_free(  FT_Library library )
00045   {
00046     FT_PIC_Container* pic_container = &library->pic_container;
00047     FT_Memory memory = library->memory;
00048     if ( pic_container->cff )
00049     {
00050       CffModulePIC* container = (CffModulePIC*)pic_container->cff;
00051       if(container->cff_services)
00052         FT_Destroy_Class_cff_services(library, container->cff_services);
00053       container->cff_services = NULL;
00054       if(container->cff_field_handlers)
00055         FT_Destroy_Class_cff_field_handlers(library, container->cff_field_handlers);
00056       container->cff_field_handlers = NULL;
00057       FT_FREE( container );
00058       pic_container->cff = NULL;
00059     }
00060   }
00061 
00062 
00063   FT_Error
00064   cff_driver_class_pic_init( FT_Library  library )
00065   {
00066     FT_PIC_Container*  pic_container = &library->pic_container;
00067     FT_Error           error         = CFF_Err_Ok;
00068     CffModulePIC*      container;
00069     FT_Memory          memory        = library->memory;
00070 
00071 
00072     /* allocate pointer, clear and set global container pointer */
00073     if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00074       return error;
00075     FT_MEM_SET( container, 0, sizeof ( *container ) );
00076     pic_container->cff = container;
00077 
00078     /* initialize pointer table - this is how the module usually expects this data */
00079     error = FT_Create_Class_cff_services(library, &container->cff_services);
00080     if(error) 
00081       goto Exit;
00082     error = FT_Create_Class_cff_field_handlers(library, &container->cff_field_handlers);
00083     if(error) 
00084       goto Exit;
00085     FT_Init_Class_cff_service_ps_info(library, &container->cff_service_ps_info);
00086     FT_Init_Class_cff_service_glyph_dict(library, &container->cff_service_glyph_dict);
00087     FT_Init_Class_cff_service_ps_name(library, &container->cff_service_ps_name);
00088     FT_Init_Class_cff_service_get_cmap_info(library, &container->cff_service_get_cmap_info);
00089     FT_Init_Class_cff_service_cid_info(library, &container->cff_service_cid_info);
00090     FT_Init_Class_cff_cmap_encoding_class_rec(library, &container->cff_cmap_encoding_class_rec);
00091     FT_Init_Class_cff_cmap_unicode_class_rec(library, &container->cff_cmap_unicode_class_rec);
00092 Exit:
00093     if(error)
00094       cff_driver_class_pic_free(library);
00095     return error;
00096   }
00097 
00098 #endif /* FT_CONFIG_OPTION_PIC */
00099 
00100 
00101 /* END */

Generated on Fri May 25 2012 04:32:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.