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

ttpic.c
Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ttpic.c                                                                */
00004 /*                                                                         */
00005 /*    The FreeType position independent code services for truetype 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 "ttpic.h"
00023 
00024 #ifdef FT_CONFIG_OPTION_PIC
00025 
00026   /* forward declaration of PIC init functions from ttdriver.c */
00027   FT_Error FT_Create_Class_tt_services( FT_Library, FT_ServiceDescRec**);
00028   void FT_Destroy_Class_tt_services( FT_Library, FT_ServiceDescRec*);
00029   void FT_Init_Class_tt_service_gx_multi_masters(FT_Service_MultiMastersRec*);
00030   void FT_Init_Class_tt_service_truetype_glyf(FT_Service_TTGlyfRec*);
00031 
00032   void
00033   tt_driver_class_pic_free(  FT_Library library )
00034   {
00035     FT_PIC_Container* pic_container = &library->pic_container;
00036     FT_Memory memory = library->memory;
00037     if ( pic_container->truetype )
00038     {
00039       TTModulePIC* container = (TTModulePIC*)pic_container->truetype;
00040       if(container->tt_services)
00041         FT_Destroy_Class_tt_services(library, container->tt_services);
00042       container->tt_services = NULL;
00043       FT_FREE( container );
00044       pic_container->truetype = NULL;
00045     }
00046   }
00047 
00048 
00049   FT_Error
00050   tt_driver_class_pic_init( FT_Library  library )
00051   {
00052     FT_PIC_Container*  pic_container = &library->pic_container;
00053     FT_Error           error         = TT_Err_Ok;
00054     TTModulePIC*       container;
00055     FT_Memory          memory        = library->memory;
00056 
00057 
00058     /* allocate pointer, clear and set global container pointer */
00059     if ( FT_ALLOC ( container, sizeof ( *container ) ) )
00060       return error;
00061     FT_MEM_SET( container, 0, sizeof(*container) );
00062     pic_container->truetype = container;
00063 
00064     /* initialize pointer table - this is how the module usually expects this data */
00065     error = FT_Create_Class_tt_services(library, &container->tt_services);
00066     if(error) 
00067       goto Exit;
00068 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
00069     FT_Init_Class_tt_service_gx_multi_masters(&container->tt_service_gx_multi_masters);
00070 #endif
00071     FT_Init_Class_tt_service_truetype_glyf(&container->tt_service_truetype_glyf);
00072 Exit:
00073     if(error)
00074       tt_driver_class_pic_free(library);
00075     return error;
00076   }
00077 
00078 #endif /* FT_CONFIG_OPTION_PIC */
00079 
00080 
00081 /* END */

Generated on Sat May 26 2012 04:32:58 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.