freetype2/src/truetype/ttpic.h

84 lines
2.9 KiB
C
Raw Normal View History

/***************************************************************************/
/* */
/* ttpic.h */
/* */
/* The FreeType position independent code services for truetype module. */
/* */
2015-01-17 20:41:43 +01:00
/* Copyright 2009-2015 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef TTPIC_H_
#define TTPIC_H_
2012-01-16 18:00:24 +01:00
#include FT_INTERNAL_PIC_H
#ifndef FT_CONFIG_OPTION_PIC
2012-07-29 13:15:53 +02:00
#define TT_SERVICES_GET tt_services
#define TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters
#define TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf
#define TT_SERVICE_PROPERTIES_GET tt_service_properties
#else /* FT_CONFIG_OPTION_PIC */
#include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_TRUETYPE_GLYF_H
#include FT_SERVICE_PROPERTIES_H
2012-07-29 13:15:53 +02:00
FT_BEGIN_HEADER
2012-07-29 13:15:53 +02:00
typedef struct TTModulePIC_
{
FT_ServiceDescRec* tt_services;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Service_MultiMastersRec tt_service_gx_multi_masters;
#endif
FT_Service_TTGlyfRec tt_service_truetype_glyf;
FT_Service_PropertiesRec tt_service_properties;
2012-07-29 13:15:53 +02:00
} TTModulePIC;
2012-07-29 13:15:53 +02:00
#define GET_PIC( lib ) \
( (TTModulePIC*)((lib)->pic_container.truetype) )
#define TT_SERVICES_GET \
2012-07-29 13:15:53 +02:00
( GET_PIC( library )->tt_services )
#define TT_SERVICE_GX_MULTI_MASTERS_GET \
2012-07-29 13:15:53 +02:00
( GET_PIC( library )->tt_service_gx_multi_masters )
#define TT_SERVICE_TRUETYPE_GLYF_GET \
2012-07-29 13:15:53 +02:00
( GET_PIC( library )->tt_service_truetype_glyf )
#define TT_SERVICE_PROPERTIES_GET \
( GET_PIC( library )->tt_service_properties )
2012-07-29 13:15:53 +02:00
Fix redundant declaration warning in PIC mode. Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were designed to declare xxx_pic_{free,init} by themselves. Because these macros are used at the end of the module interface (e.g. ttdriver.c) and the wrapper source to build a module as a single object (e.g. truetype.c) includes the PIC file (e.g. ttpic.c) before the module interface, these macros are expanded AFTER xxx_pic_{free,init} body when the modules are built as single object. The declaration after the implementation causes the redundant declaration warnings, so the declarations are moved to module PIC headers (e.g. ttpic.h). Separating to other header files are needed for multi build. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): Remove class_##_pic_free and class_##_pic_init declarations. * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE): Ditto. * src/base/basepic.h: Insert a comment and fix coding style. * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, init}. * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, init}. * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, init}. * src/raster/rastpic.h: Declare ft_raster{1,5}_renderer_class_pic_{free,init} * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. * src/smooth/ftspic.h: Declare ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
2012-01-15 15:35:31 +01:00
/* see ttpic.c for the implementation */
void
tt_driver_class_pic_free( FT_Library library );
FT_Error
tt_driver_class_pic_init( FT_Library library );
FT_END_HEADER
#endif /* FT_CONFIG_OPTION_PIC */
/* */
#endif /* TTPIC_H_ */
/* END */