From d0841ea73badc69771413780ea6392eeed733dbd Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 27 Aug 2012 06:57:05 +0200 Subject: [PATCH] [autofit] Some macro and variable renamings for orthogonality. * include/freetype/internal/autohint.h, src/base/ftobjs.c, src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h: s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/. --- ChangeLog | 8 ++++ include/freetype/internal/autohint.h | 64 ++++++++++++++-------------- src/autofit/afmodule.c | 7 +-- src/autofit/afpic.c | 15 ++++--- src/autofit/afpic.h | 26 ++++++----- src/base/ftobjs.c | 4 +- 6 files changed, 70 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e90f6439..62718a4df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-08-27 Werner Lemberg + + [autofit] Some macro and variable renamings for orthogonality. + + * include/freetype/internal/autohint.h, src/base/ftobjs.c, + src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h: + s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/. + 2012-08-26 Werner Lemberg Fix Savannah bug #37178. diff --git a/include/freetype/internal/autohint.h b/include/freetype/internal/autohint.h index 1d59b51f2..545de938c 100644 --- a/include/freetype/internal/autohint.h +++ b/include/freetype/internal/autohint.h @@ -182,56 +182,56 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* */ - /* FT_AutoHinter_ServiceRec */ + /* FT_AutoHinter_InterfaceRec */ /* */ /* */ /* The auto-hinter module's interface. */ /* */ - typedef struct FT_AutoHinter_ServiceRec_ + typedef struct FT_AutoHinter_InterfaceRec_ { FT_AutoHinter_GlobalResetFunc reset_face; FT_AutoHinter_GlobalGetFunc get_global_hints; FT_AutoHinter_GlobalDoneFunc done_global_hints; FT_AutoHinter_GlyphLoadFunc load_glyph; - } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service; + } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface; #ifndef FT_CONFIG_OPTION_PIC -#define FT_DEFINE_AUTOHINTER_SERVICE( \ - class_, \ - reset_face_, \ - get_global_hints_, \ - done_global_hints_, \ - load_glyph_ ) \ - FT_CALLBACK_TABLE_DEF \ - const FT_AutoHinter_ServiceRec class_ = \ - { \ - reset_face_, \ - get_global_hints_, \ - done_global_hints_, \ - load_glyph_ \ +#define FT_DEFINE_AUTOHINTER_INTERFACE( \ + class_, \ + reset_face_, \ + get_global_hints_, \ + done_global_hints_, \ + load_glyph_ ) \ + FT_CALLBACK_TABLE_DEF \ + const FT_AutoHinter_InterfaceRec class_ = \ + { \ + reset_face_, \ + get_global_hints_, \ + done_global_hints_, \ + load_glyph_ \ }; #else /* FT_CONFIG_OPTION_PIC */ -#define FT_DEFINE_AUTOHINTER_SERVICE( \ - class_, \ - reset_face_, \ - get_global_hints_, \ - done_global_hints_, \ - load_glyph_ ) \ - void \ - FT_Init_Class_ ## class_( FT_Library library, \ - FT_AutoHinter_ServiceRec* clazz ) \ - { \ - FT_UNUSED( library ); \ - \ - clazz->reset_face = reset_face_; \ - clazz->get_global_hints = get_global_hints_; \ - clazz->done_global_hints = done_global_hints_; \ - clazz->load_glyph = load_glyph_; \ +#define FT_DEFINE_AUTOHINTER_INTERFACE( \ + class_, \ + reset_face_, \ + get_global_hints_, \ + done_global_hints_, \ + load_glyph_ ) \ + void \ + FT_Init_Class_ ## class_( FT_Library library, \ + FT_AutoHinter_InterfaceRec* clazz ) \ + { \ + FT_UNUSED( library ); \ + \ + clazz->reset_face = reset_face_; \ + clazz->get_global_hints = get_global_hints_; \ + clazz->done_global_hints = done_global_hints_; \ + clazz->load_glyph = load_glyph_; \ } #endif /* FT_CONFIG_OPTION_PIC */ diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c index 6e158e081..4ea7a31dc 100644 --- a/src/autofit/afmodule.c +++ b/src/autofit/afmodule.c @@ -66,13 +66,14 @@ } - FT_DEFINE_AUTOHINTER_SERVICE( - af_autofitter_service, + FT_DEFINE_AUTOHINTER_INTERFACE( + af_autofitter_interface, NULL, /* reset_face */ NULL, /* get_global_hints */ NULL, /* done_global_hints */ (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph ) /* load_glyph */ + FT_DEFINE_MODULE( autofit_module_class, @@ -83,7 +84,7 @@ 0x10000L, /* version 1.0 of the autofitter */ 0x20000L, /* requires FreeType 2.0 or above */ - (const void*)&AF_AUTOFITTER_SERVICE_GET, + (const void*)&AF_AUTOFITTER_INTERFACE_GET, (FT_Module_Constructor)af_autofitter_init, (FT_Module_Destructor) af_autofitter_done, diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c index 87074afcf..a395faead 100644 --- a/src/autofit/afpic.c +++ b/src/autofit/afpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009, 2010, 2011 by */ +/* Copyright 2009-2012 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,12 +22,13 @@ #include "afpic.h" #include "aferrors.h" + #ifdef FT_CONFIG_OPTION_PIC /* forward declaration of PIC init functions from afmodule.c */ - void FT_Init_Class_af_autofitter_service( - FT_Library library, - FT_AutoHinter_ServiceRec* clazz ); + void FT_Init_Class_af_autofitter_interface( + FT_Library library, + FT_AutoHinter_InterfaceRec* clazz ); /* forward declaration of PIC init functions from script classes */ #include "aflatin.h" @@ -38,6 +39,7 @@ #include "afdummy.h" #include "afindic.h" + void autofit_module_class_pic_free( FT_Library library ) { @@ -93,8 +95,8 @@ FT_Init_Class_af_indic_script_class( &container->af_script_classes_rec[ss++] ); - FT_Init_Class_af_autofitter_service( - library, &container->af_autofitter_service ); + FT_Init_Class_af_autofitter_interface( + library, &container->af_autofitter_interface ); /* Exit: */ @@ -103,7 +105,6 @@ return error; } - #endif /* FT_CONFIG_OPTION_PIC */ diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h index 0b08d69a2..0ae5bfcb3 100644 --- a/src/autofit/afpic.h +++ b/src/autofit/afpic.h @@ -24,10 +24,11 @@ FT_BEGIN_HEADER #include FT_INTERNAL_PIC_H + #ifndef FT_CONFIG_OPTION_PIC -#define AF_SCRIPT_CLASSES_GET af_script_classes -#define AF_AUTOFITTER_SERVICE_GET af_autofitter_service +#define AF_SCRIPT_CLASSES_GET af_script_classes +#define AF_AUTOFITTER_INTERFACE_GET af_autofitter_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -36,26 +37,31 @@ FT_BEGIN_HEADER /* increase these when you add new scripts, */ /* and update autofit_module_class_pic_init */ #ifdef FT_OPTION_AUTOFIT2 -#define AF_SCRIPT_CLASSES_COUNT 6 +#define AF_SCRIPT_CLASSES_COUNT 6 #else -#define AF_SCRIPT_CLASSES_COUNT 5 +#define AF_SCRIPT_CLASSES_COUNT 5 #endif + #define AF_SCRIPT_CLASSES_REC_COUNT ( AF_SCRIPT_CLASSES_COUNT - 1 ) - typedef struct AFModulePIC_ + + typedef struct AFModulePIC_ { - AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT]; - AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT]; - FT_AutoHinter_ServiceRec af_autofitter_service; + AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT]; + AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT]; + FT_AutoHinter_InterfaceRec af_autofitter_interface; } AFModulePIC; + #define GET_PIC( lib ) \ ( (AFModulePIC*)((lib)->pic_container.autofit) ) + #define AF_SCRIPT_CLASSES_GET \ ( GET_PIC( FT_FACE_LIBRARY(globals->face) )->af_script_classes ) -#define AF_AUTOFITTER_SERVICE_GET \ - ( GET_PIC( library )->af_autofitter_service ) +#define AF_AUTOFITTER_INTERFACE_GET \ + ( GET_PIC( library )->af_autofitter_interface ) + /* see afpic.c for the implementation */ void diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 453d9dacc..d8c746281 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -651,7 +651,7 @@ if ( autohint ) { - FT_AutoHinter_Service hinting; + FT_AutoHinter_Interface hinting; /* try to load embedded bitmaps first if available */ @@ -680,7 +680,7 @@ internal->transform_flags = 0; /* load auto-hinted outline */ - hinting = (FT_AutoHinter_Service)hinter->clazz->module_interface; + hinting = (FT_AutoHinter_Interface)hinter->clazz->module_interface; error = hinting->load_glyph( (FT_AutoHinter)hinter, slot, face->size,