Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: include/freetype/internal/ftobjs.h

Issue 23555005: Update freetype to the latest version of Android external/freetype (Closed) Base URL: https://chromium.googlesource.com/chromium/src/third_party/freetype.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/freetype/internal/ftdriver.h ('k') | include/freetype/internal/ftpic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* ftobjs.h */ 3 /* ftobjs.h */
4 /* */ 4 /* */
5 /* The FreeType private base classes (specification). */ 5 /* The FreeType private base classes (specification). */
6 /* */ 6 /* */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */ 7 /* Copyright 1996-2006, 2008, 2010, 2012 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */ 9 /* */
10 /* This file is part of the FreeType project, and may only be used, */ 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 */ 11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */ 13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */ 14 /* understand and accept it fully. */
15 /* */ 15 /* */
16 /***************************************************************************/ 16 /***************************************************************************/
17 17
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 clazz->size = size_; \ 236 clazz->size = size_; \
237 clazz->init = init_; \ 237 clazz->init = init_; \
238 clazz->done = done_; \ 238 clazz->done = done_; \
239 clazz->char_index = char_index_; \ 239 clazz->char_index = char_index_; \
240 clazz->char_next = char_next_; \ 240 clazz->char_next = char_next_; \
241 clazz->char_var_index = char_var_index_; \ 241 clazz->char_var_index = char_var_index_; \
242 clazz->char_var_default = char_var_default_; \ 242 clazz->char_var_default = char_var_default_; \
243 clazz->variant_list = variant_list_; \ 243 clazz->variant_list = variant_list_; \
244 clazz->charvariant_list = charvariant_list_; \ 244 clazz->charvariant_list = charvariant_list_; \
245 clazz->variantchar_list = variantchar_list_; \ 245 clazz->variantchar_list = variantchar_list_; \
246 } 246 }
247 #endif /* FT_CONFIG_OPTION_PIC */ 247 #endif /* FT_CONFIG_OPTION_PIC */
248 248
249 /* create a new charmap and add it to charmap->face */ 249 /* create a new charmap and add it to charmap->face */
250 FT_BASE( FT_Error ) 250 FT_BASE( FT_Error )
251 FT_CMap_New( FT_CMap_Class clazz, 251 FT_CMap_New( FT_CMap_Class clazz,
252 FT_Pointer init_data, 252 FT_Pointer init_data,
253 FT_CharMap charmap, 253 FT_CharMap charmap,
254 FT_CMap *acmap ); 254 FT_CMap *acmap );
255 255
256 /* destroy a charmap and remove it from face's list */ 256 /* destroy a charmap and remove it from face's list */
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 /* <Description> */ 429 /* <Description> */
430 /* A module object instance. */ 430 /* A module object instance. */
431 /* */ 431 /* */
432 /* <Fields> */ 432 /* <Fields> */
433 /* clazz :: A pointer to the module's class. */ 433 /* clazz :: A pointer to the module's class. */
434 /* */ 434 /* */
435 /* library :: A handle to the parent library object. */ 435 /* library :: A handle to the parent library object. */
436 /* */ 436 /* */
437 /* memory :: A handle to the memory manager. */ 437 /* memory :: A handle to the memory manager. */
438 /* */ 438 /* */
439 /* generic :: A generic structure for user-level extensibility (?). */
440 /* */
441 typedef struct FT_ModuleRec_ 439 typedef struct FT_ModuleRec_
442 { 440 {
443 FT_Module_Class* clazz; 441 FT_Module_Class* clazz;
444 FT_Library library; 442 FT_Library library;
445 FT_Memory memory; 443 FT_Memory memory;
446 FT_Generic generic;
447 444
448 } FT_ModuleRec; 445 } FT_ModuleRec;
449 446
450 447
451 /* typecast an object to a FT_Module */ 448 /* typecast an object to an FT_Module */
452 #define FT_MODULE( x ) ((FT_Module)( x )) 449 #define FT_MODULE( x ) ((FT_Module)( x ))
453 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz 450 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
454 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library 451 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
455 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory 452 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
456 453
457 454
458 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 455 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
459 FT_MODULE_FONT_DRIVER ) 456 FT_MODULE_FONT_DRIVER )
460 457
461 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 458 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 /* <Fields> */ 701 /* <Fields> */
705 /* root :: Contains the fields of the root module class. */ 702 /* root :: Contains the fields of the root module class. */
706 /* */ 703 /* */
707 /* clazz :: A pointer to the font driver's class. Note that */ 704 /* clazz :: A pointer to the font driver's class. Note that */
708 /* this is NOT root.clazz. `class' wasn't used */ 705 /* this is NOT root.clazz. `class' wasn't used */
709 /* as it is a reserved word in C++. */ 706 /* as it is a reserved word in C++. */
710 /* */ 707 /* */
711 /* faces_list :: The list of faces currently opened by this */ 708 /* faces_list :: The list of faces currently opened by this */
712 /* driver. */ 709 /* driver. */
713 /* */ 710 /* */
714 /* extensions :: A typeless pointer to the driver's extensions */
715 /* registry, if they are supported through the */
716 /* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */
717 /* */
718 /* glyph_loader :: The glyph loader for all faces managed by this */ 711 /* glyph_loader :: The glyph loader for all faces managed by this */
719 /* driver. This object isn't defined for unscalable */ 712 /* driver. This object isn't defined for unscalable */
720 /* formats. */ 713 /* formats. */
721 /* */ 714 /* */
722 typedef struct FT_DriverRec_ 715 typedef struct FT_DriverRec_
723 { 716 {
724 FT_ModuleRec root; 717 FT_ModuleRec root;
725 FT_Driver_Class clazz; 718 FT_Driver_Class clazz;
726
727 FT_ListRec faces_list; 719 FT_ListRec faces_list;
728 void* extensions;
729
730 FT_GlyphLoader glyph_loader; 720 FT_GlyphLoader glyph_loader;
731 721
732 } FT_DriverRec; 722 } FT_DriverRec;
733 723
734 724
735 /*************************************************************************/ 725 /*************************************************************************/
736 /*************************************************************************/ 726 /*************************************************************************/
737 /*************************************************************************/ 727 /*************************************************************************/
738 /**** ****/ 728 /**** ****/
739 /**** ****/ 729 /**** ****/
(...skipping 29 matching lines...) Expand all
769 /* */ 759 /* */
770 /* <Description> */ 760 /* <Description> */
771 /* The FreeType library class. This is the root of all FreeType */ 761 /* The FreeType library class. This is the root of all FreeType */
772 /* data. Use FT_New_Library() to create a library object, and */ 762 /* data. Use FT_New_Library() to create a library object, and */
773 /* FT_Done_Library() to discard it and all child objects. */ 763 /* FT_Done_Library() to discard it and all child objects. */
774 /* */ 764 /* */
775 /* <Fields> */ 765 /* <Fields> */
776 /* memory :: The library's memory object. Manages memory */ 766 /* memory :: The library's memory object. Manages memory */
777 /* allocation. */ 767 /* allocation. */
778 /* */ 768 /* */
779 /* generic :: Client data variable. Used to extend the */
780 /* Library class by higher levels and clients. */
781 /* */
782 /* version_major :: The major version number of the library. */ 769 /* version_major :: The major version number of the library. */
783 /* */ 770 /* */
784 /* version_minor :: The minor version number of the library. */ 771 /* version_minor :: The minor version number of the library. */
785 /* */ 772 /* */
786 /* version_patch :: The current patch level of the library. */ 773 /* version_patch :: The current patch level of the library. */
787 /* */ 774 /* */
788 /* num_modules :: The number of modules currently registered */ 775 /* num_modules :: The number of modules currently registered */
789 /* within this library. This is set to 0 for new */ 776 /* within this library. This is set to 0 for new */
790 /* libraries. New modules are added through the */ 777 /* libraries. New modules are added through the */
791 /* FT_Add_Module() API function. */ 778 /* FT_Add_Module() API function. */
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 /* @FT_Library structure is created. */ 818 /* @FT_Library structure is created. */
832 /* @FT_Reference_Library increments this counter, */ 819 /* @FT_Reference_Library increments this counter, */
833 /* and @FT_Done_Library only destroys a library */ 820 /* and @FT_Done_Library only destroys a library */
834 /* if the counter is~1, otherwise it simply */ 821 /* if the counter is~1, otherwise it simply */
835 /* decrements it. */ 822 /* decrements it. */
836 /* */ 823 /* */
837 typedef struct FT_LibraryRec_ 824 typedef struct FT_LibraryRec_
838 { 825 {
839 FT_Memory memory; /* library's memory manager */ 826 FT_Memory memory; /* library's memory manager */
840 827
841 FT_Generic generic;
842
843 FT_Int version_major; 828 FT_Int version_major;
844 FT_Int version_minor; 829 FT_Int version_minor;
845 FT_Int version_patch; 830 FT_Int version_patch;
846 831
847 FT_UInt num_modules; 832 FT_UInt num_modules;
848 FT_Module modules[FT_MAX_MODULES]; /* module objects */ 833 FT_Module modules[FT_MAX_MODULES]; /* module objects */
849 834
850 FT_ListRec renderers; /* list of renderers */ 835 FT_ListRec renderers; /* list of renderers */
851 FT_Renderer cur_renderer; /* current outline renderer */ 836 FT_Renderer cur_renderer; /* current outline renderer */
852 FT_Module auto_hinter; 837 FT_Module auto_hinter;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 /* */ 954 /* */
970 #ifndef FT_CONFIG_OPTION_PIC 955 #ifndef FT_CONFIG_OPTION_PIC
971 956
972 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ 957 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
973 cubic_to_, shift_, delta_) \ 958 cubic_to_, shift_, delta_) \
974 static const FT_Outline_Funcs class_ = \ 959 static const FT_Outline_Funcs class_ = \
975 { \ 960 { \
976 move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \ 961 move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \
977 }; 962 };
978 963
979 #else /* FT_CONFIG_OPTION_PIC */ 964 #else /* FT_CONFIG_OPTION_PIC */
980 965
981 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \ 966 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
982 cubic_to_, shift_, delta_) \ 967 cubic_to_, shift_, delta_) \
983 static FT_Error \ 968 static FT_Error \
984 Init_Class_##class_( FT_Outline_Funcs* clazz ) \ 969 Init_Class_##class_( FT_Outline_Funcs* clazz ) \
985 { \ 970 { \
986 clazz->move_to = move_to_; \ 971 clazz->move_to = move_to_; \
987 clazz->line_to = line_to_; \ 972 clazz->line_to = line_to_; \
988 clazz->conic_to = conic_to_; \ 973 clazz->conic_to = conic_to_; \
989 clazz->cubic_to = cubic_to_; \ 974 clazz->cubic_to = cubic_to_; \
990 clazz->shift = shift_; \ 975 clazz->shift = shift_; \
991 clazz->delta = delta_; \ 976 clazz->delta = delta_; \
992 return FT_Err_Ok; \ 977 return FT_Err_Ok; \
993 } 978 }
994 979
995 #endif /* FT_CONFIG_OPTION_PIC */ 980 #endif /* FT_CONFIG_OPTION_PIC */
996 981
997 /*************************************************************************/ 982 /*************************************************************************/
998 /* */ 983 /* */
999 /* <Macro> */ 984 /* <Macro> */
1000 /* FT_DEFINE_RASTER_FUNCS */ 985 /* FT_DEFINE_RASTER_FUNCS */
1001 /* */ 986 /* */
1002 /* <Description> */ 987 /* <Description> */
1003 /* Used to initialize an instance of FT_Raster_Funcs struct. */ 988 /* Used to initialize an instance of FT_Raster_Funcs struct. */
1004 /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */ 989 /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
1005 /* called with a pre-allocated stracture to be filled. */ 990 /* called with a pre-allocated stracture to be filled. */
1006 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ 991 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1007 /* allocated in the global scope (or the scope where the macro */ 992 /* allocated in the global scope (or the scope where the macro */
1008 /* is used). */ 993 /* is used). */
1009 /* */ 994 /* */
1010 #ifndef FT_CONFIG_OPTION_PIC 995 #ifndef FT_CONFIG_OPTION_PIC
1011 996
1012 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ 997 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
1013 raster_reset_, raster_set_mode_, \ 998 raster_reset_, raster_set_mode_, \
1014 raster_render_, raster_done_) \ 999 raster_render_, raster_done_) \
1015 const FT_Raster_Funcs class_ = \ 1000 const FT_Raster_Funcs class_ = \
1016 { \ 1001 { \
1017 glyph_format_, raster_new_, raster_reset_, \ 1002 glyph_format_, raster_new_, raster_reset_, \
1018 raster_set_mode_, raster_render_, raster_done_ \ 1003 raster_set_mode_, raster_render_, raster_done_ \
1019 }; 1004 };
1020 1005
1021 #else /* FT_CONFIG_OPTION_PIC */ 1006 #else /* FT_CONFIG_OPTION_PIC */
1022 1007
1023 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \ 1008 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
1024 raster_reset_, raster_set_mode_, raster_render_, raster_done_) \ 1009 raster_reset_, raster_set_mode_, raster_render_, raster_done_) \
1025 void \ 1010 void \
1026 FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \ 1011 FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \
1027 { \ 1012 { \
1028 clazz->glyph_format = glyph_format_; \ 1013 clazz->glyph_format = glyph_format_; \
1029 clazz->raster_new = raster_new_; \ 1014 clazz->raster_new = raster_new_; \
1030 clazz->raster_reset = raster_reset_; \ 1015 clazz->raster_reset = raster_reset_; \
1031 clazz->raster_set_mode = raster_set_mode_; \ 1016 clazz->raster_set_mode = raster_set_mode_; \
1032 clazz->raster_render = raster_render_; \ 1017 clazz->raster_render = raster_render_; \
1033 clazz->raster_done = raster_done_; \ 1018 clazz->raster_done = raster_done_; \
1034 } 1019 }
1035 1020
1036 #endif /* FT_CONFIG_OPTION_PIC */ 1021 #endif /* FT_CONFIG_OPTION_PIC */
1037 1022
1038 /*************************************************************************/ 1023 /*************************************************************************/
1039 /*************************************************************************/ 1024 /*************************************************************************/
1040 /*************************************************************************/ 1025 /*************************************************************************/
1041 /**** ****/ 1026 /**** ****/
1042 /**** ****/ 1027 /**** ****/
1043 /**** PIC-Support Macros for ftrender.h ****/ 1028 /**** PIC-Support Macros for ftrender.h ****/
1044 /**** ****/ 1029 /**** ****/
1045 /**** ****/ 1030 /**** ****/
1046 /*************************************************************************/ 1031 /*************************************************************************/
(...skipping 18 matching lines...) Expand all
1065 #ifndef FT_CONFIG_OPTION_PIC 1050 #ifndef FT_CONFIG_OPTION_PIC
1066 1051
1067 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ 1052 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
1068 transform_, bbox_, prepare_) \ 1053 transform_, bbox_, prepare_) \
1069 FT_CALLBACK_TABLE_DEF \ 1054 FT_CALLBACK_TABLE_DEF \
1070 const FT_Glyph_Class class_ = \ 1055 const FT_Glyph_Class class_ = \
1071 { \ 1056 { \
1072 size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \ 1057 size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \
1073 }; 1058 };
1074 1059
1075 #else /* FT_CONFIG_OPTION_PIC */ 1060 #else /* FT_CONFIG_OPTION_PIC */
1076 1061
1077 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \ 1062 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
1078 transform_, bbox_, prepare_) \ 1063 transform_, bbox_, prepare_) \
1079 void \ 1064 void \
1080 FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \ 1065 FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \
1081 { \ 1066 { \
1082 clazz->glyph_size = size_; \ 1067 clazz->glyph_size = size_; \
1083 clazz->glyph_format = format_; \ 1068 clazz->glyph_format = format_; \
1084 clazz->glyph_init = init_; \ 1069 clazz->glyph_init = init_; \
1085 clazz->glyph_done = done_; \ 1070 clazz->glyph_done = done_; \
1086 clazz->glyph_copy = copy_; \ 1071 clazz->glyph_copy = copy_; \
1087 clazz->glyph_transform = transform_; \ 1072 clazz->glyph_transform = transform_; \
1088 clazz->glyph_bbox = bbox_; \ 1073 clazz->glyph_bbox = bbox_; \
1089 clazz->glyph_prepare = prepare_; \ 1074 clazz->glyph_prepare = prepare_; \
1090 } 1075 }
1091 1076
1092 #endif /* FT_CONFIG_OPTION_PIC */ 1077 #endif /* FT_CONFIG_OPTION_PIC */
1093 1078
1094 /*************************************************************************/ 1079 /*************************************************************************/
1095 /* */ 1080 /* */
1096 /* <Macro> */ 1081 /* <Macro> */
1097 /* FT_DECLARE_RENDERER */ 1082 /* FT_DECLARE_RENDERER */
1098 /* */ 1083 /* */
1099 /* <Description> */ 1084 /* <Description> */
1100 /* Used to create a forward declaration of a */ 1085 /* Used to create a forward declaration of a */
1101 /* FT_Renderer_Class stract instance. */ 1086 /* FT_Renderer_Class stract instance. */
1102 /* */ 1087 /* */
1103 /* <Macro> */ 1088 /* <Macro> */
1104 /* FT_DEFINE_RENDERER */ 1089 /* FT_DEFINE_RENDERER */
1105 /* */ 1090 /* */
1106 /* <Description> */ 1091 /* <Description> */
1107 /* Used to initialize an instance of FT_Renderer_Class struct. */ 1092 /* Used to initialize an instance of FT_Renderer_Class struct. */
1108 /* */ 1093 /* */
1109 /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ 1094 /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
1110 /* to called with a pointer where the allocated stracture is returned.*/ 1095 /* to called with a pointer where the allocated stracture is returned.*/
1111 /* And when it is no longer needed a Destroy function needs */ 1096 /* And when it is no longer needed a Destroy function needs */
1112 /* to be called to release that allocation. */ 1097 /* to be called to release that allocation. */
1113 /* fcinit.c (ft_create_default_module_classes) already contains */ 1098 /* fcinit.c (ft_create_default_module_classes) already contains */
1114 /* a mechanism to call these functions for the default modules */ 1099 /* a mechanism to call these functions for the default modules */
1115 /* described in ftmodule.h */ 1100 /* described in ftmodule.h */
1116 /* */ 1101 /* */
1117 /* Notice that the created Create and Destroy functions call */ 1102 /* Notice that the created Create and Destroy functions call */
1118 /* pic_init and pic_free function to allow you to manually allocate */ 1103 /* pic_init and pic_free function to allow you to manually allocate */
1119 /* and initialize any additional global data, like module specific */ 1104 /* and initialize any additional global data, like module specific */
1120 /* interface, and put them in the global pic container defined in */ 1105 /* interface, and put them in the global pic container defined in */
1121 /* ftpic.h. if you don't need them just implement the functions as */ 1106 /* ftpic.h. if you don't need them just implement the functions as */
1122 /* empty to resolve the link error. */ 1107 /* empty to resolve the link error. Also the pic_init and pic_free */
1108 /* functions should be declared in pic.h, to be referred by renderer */
1109 /* definition calling FT_DEFINE_RENDERER() in following. */
1123 /* */ 1110 /* */
1124 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ 1111 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1125 /* allocated in the global scope (or the scope where the macro */ 1112 /* allocated in the global scope (or the scope where the macro */
1126 /* is used). */ 1113 /* is used). */
1127 /* */ 1114 /* */
1128 #ifndef FT_CONFIG_OPTION_PIC 1115 #ifndef FT_CONFIG_OPTION_PIC
1129 1116
1130 #define FT_DECLARE_RENDERER(class_) \ 1117 #define FT_DECLARE_RENDERER(class_) \
1131 FT_EXPORT_VAR( const FT_Renderer_Class ) class_; 1118 FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
1132 1119
(...skipping 10 matching lines...) Expand all
1143 glyph_format_, \ 1130 glyph_format_, \
1144 \ 1131 \
1145 render_glyph_, \ 1132 render_glyph_, \
1146 transform_glyph_, \ 1133 transform_glyph_, \
1147 get_glyph_cbox_, \ 1134 get_glyph_cbox_, \
1148 set_mode_, \ 1135 set_mode_, \
1149 \ 1136 \
1150 raster_class_ \ 1137 raster_class_ \
1151 }; 1138 };
1152 1139
1153 #else /* FT_CONFIG_OPTION_PIC */ 1140 #else /* FT_CONFIG_OPTION_PIC */
1154 1141
1155 #define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_) 1142 #define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_)
1156 1143
1157 #define FT_DEFINE_RENDERER(class_, \ 1144 #define FT_DEFINE_RENDERER(class_, \
1158 flags_, size_, name_, version_, requires_, \ 1145 flags_, size_, name_, version_, requires_, \
1159 interface_, init_, done_, get_interface_, \ 1146 interface_, init_, done_, get_interface_, \
1160 glyph_format_, render_glyph_, transform_glyph_, \ 1147 glyph_format_, render_glyph_, transform_glyph_, \
1161 get_glyph_cbox_, set_mode_, raster_class_ ) \ 1148 get_glyph_cbox_, set_mode_, raster_class_ ) \
1162 void class_##_pic_free( FT_Library library ); \
1163 FT_Error class_##_pic_init( FT_Library library ); \
1164 \ 1149 \
1165 void \ 1150 void \
1166 FT_Destroy_Class_##class_( FT_Library library, \ 1151 FT_Destroy_Class_##class_( FT_Library library, \
1167 FT_Module_Class* clazz ) \ 1152 FT_Module_Class* clazz ) \
1168 { \ 1153 { \
1169 FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \ 1154 FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
1170 FT_Memory memory = library->memory; \ 1155 FT_Memory memory = library->memory; \
1171 class_##_pic_free( library ); \ 1156 class_##_pic_free( library ); \
1172 if ( rclazz ) \ 1157 if ( rclazz ) \
1173 FT_FREE( rclazz ); \ 1158 FT_FREE( rclazz ); \
(...skipping 24 matching lines...) Expand all
1198 \ 1183 \
1199 clazz->render_glyph = render_glyph_; \ 1184 clazz->render_glyph = render_glyph_; \
1200 clazz->transform_glyph = transform_glyph_; \ 1185 clazz->transform_glyph = transform_glyph_; \
1201 clazz->get_glyph_cbox = get_glyph_cbox_; \ 1186 clazz->get_glyph_cbox = get_glyph_cbox_; \
1202 clazz->set_mode = set_mode_; \ 1187 clazz->set_mode = set_mode_; \
1203 \ 1188 \
1204 clazz->raster_class = raster_class_; \ 1189 clazz->raster_class = raster_class_; \
1205 \ 1190 \
1206 *output_class = (FT_Module_Class*)clazz; \ 1191 *output_class = (FT_Module_Class*)clazz; \
1207 return FT_Err_Ok; \ 1192 return FT_Err_Ok; \
1208 } 1193 }
1209 1194
1210 1195
1211 1196
1212 #endif /* FT_CONFIG_OPTION_PIC */ 1197 #endif /* FT_CONFIG_OPTION_PIC */
1213 1198
1214 /*************************************************************************/ 1199 /*************************************************************************/
1215 /*************************************************************************/ 1200 /*************************************************************************/
1216 /*************************************************************************/ 1201 /*************************************************************************/
1217 /**** ****/ 1202 /**** ****/
1218 /**** ****/ 1203 /**** ****/
1219 /**** PIC-Support Macros for ftmodapi.h ****/ 1204 /**** PIC-Support Macros for ftmodapi.h ****/
1220 /**** ****/ 1205 /**** ****/
1221 /**** ****/ 1206 /**** ****/
1222 /*************************************************************************/ 1207 /*************************************************************************/
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 /* to be called to release that allocation. */ 1268 /* to be called to release that allocation. */
1284 /* fcinit.c (ft_create_default_module_classes) already contains */ 1269 /* fcinit.c (ft_create_default_module_classes) already contains */
1285 /* a mechanism to call these functions for the default modules */ 1270 /* a mechanism to call these functions for the default modules */
1286 /* described in ftmodule.h */ 1271 /* described in ftmodule.h */
1287 /* */ 1272 /* */
1288 /* Notice that the created Create and Destroy functions call */ 1273 /* Notice that the created Create and Destroy functions call */
1289 /* pic_init and pic_free function to allow you to manually allocate */ 1274 /* pic_init and pic_free function to allow you to manually allocate */
1290 /* and initialize any additional global data, like module specific */ 1275 /* and initialize any additional global data, like module specific */
1291 /* interface, and put them in the global pic container defined in */ 1276 /* interface, and put them in the global pic container defined in */
1292 /* ftpic.h. if you don't need them just implement the functions as */ 1277 /* ftpic.h. if you don't need them just implement the functions as */
1293 /* empty to resolve the link error. */ 1278 /* empty to resolve the link error. Also the pic_init and pic_free */
1279 /* functions should be declared in pic.h, to be referred by module */
1280 /* definition calling FT_DEFINE_MODULE() in following. */
1294 /* */ 1281 /* */
1295 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ 1282 /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1296 /* allocated in the global scope (or the scope where the macro */ 1283 /* allocated in the global scope (or the scope where the macro */
1297 /* is used). */ 1284 /* is used). */
1298 /* */ 1285 /* */
1299 /* <Macro> */ 1286 /* <Macro> */
1300 /* FT_DEFINE_ROOT_MODULE */ 1287 /* FT_DEFINE_ROOT_MODULE */
1301 /* */ 1288 /* */
1302 /* <Description> */ 1289 /* <Description> */
1303 /* Used to initialize an instance of FT_Module_Class struct inside */ 1290 /* Used to initialize an instance of FT_Module_Class struct inside */
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 clazz->root.module_flags = flags_; \ 1347 clazz->root.module_flags = flags_; \
1361 clazz->root.module_size = size_; \ 1348 clazz->root.module_size = size_; \
1362 clazz->root.module_name = name_; \ 1349 clazz->root.module_name = name_; \
1363 clazz->root.module_version = version_; \ 1350 clazz->root.module_version = version_; \
1364 clazz->root.module_requires = requires_; \ 1351 clazz->root.module_requires = requires_; \
1365 \ 1352 \
1366 clazz->root.module_interface = interface_; \ 1353 clazz->root.module_interface = interface_; \
1367 \ 1354 \
1368 clazz->root.module_init = init_; \ 1355 clazz->root.module_init = init_; \
1369 clazz->root.module_done = done_; \ 1356 clazz->root.module_done = done_; \
1370 clazz->root.get_interface = get_interface_; 1357 clazz->root.get_interface = get_interface_;
1371 1358
1372 #define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \ 1359 #define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
1373 interface_, init_, done_, get_interface_) \ 1360 interface_, init_, done_, get_interface_) \
1374 void class_##_pic_free( FT_Library library ); \
1375 FT_Error class_##_pic_init( FT_Library library ); \
1376 \ 1361 \
1377 void \ 1362 void \
1378 FT_Destroy_Class_##class_( FT_Library library, \ 1363 FT_Destroy_Class_##class_( FT_Library library, \
1379 FT_Module_Class* clazz ) \ 1364 FT_Module_Class* clazz ) \
1380 { \ 1365 { \
1381 FT_Memory memory = library->memory; \ 1366 FT_Memory memory = library->memory; \
1382 class_##_pic_free( library ); \ 1367 class_##_pic_free( library ); \
1383 if ( clazz ) \ 1368 if ( clazz ) \
1384 FT_FREE( clazz ); \ 1369 FT_FREE( clazz ); \
1385 } \ 1370 } \
(...skipping 22 matching lines...) Expand all
1408 clazz->module_requires = requires_; \ 1393 clazz->module_requires = requires_; \
1409 \ 1394 \
1410 clazz->module_interface = interface_; \ 1395 clazz->module_interface = interface_; \
1411 \ 1396 \
1412 clazz->module_init = init_; \ 1397 clazz->module_init = init_; \
1413 clazz->module_done = done_; \ 1398 clazz->module_done = done_; \
1414 clazz->get_interface = get_interface_; \ 1399 clazz->get_interface = get_interface_; \
1415 \ 1400 \
1416 *output_class = clazz; \ 1401 *output_class = clazz; \
1417 return FT_Err_Ok; \ 1402 return FT_Err_Ok; \
1418 } 1403 }
1419 1404
1420 #endif /* FT_CONFIG_OPTION_PIC */ 1405 #endif /* FT_CONFIG_OPTION_PIC */
1421 1406
1422 1407
1423 FT_END_HEADER 1408 FT_END_HEADER
1424 1409
1425 #endif /* __FTOBJS_H__ */ 1410 #endif /* __FTOBJS_H__ */
1426 1411
1427 1412
1428 /* END */ 1413 /* END */
OLDNEW
« no previous file with comments | « include/freetype/internal/ftdriver.h ('k') | include/freetype/internal/ftpic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698