1/***************************************************************************/
2/*                                                                         */
3/*  afpic.h                                                                */
4/*                                                                         */
5/*    The FreeType position independent code services for autofit module.  */
6/*                                                                         */
7/*  Copyright 2009, 2011-2012 by                                           */
8/*  Oran Agra and Mickey Gabel.                                            */
9/*                                                                         */
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      */
12/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
13/*  this file you indicate that you have read the license and              */
14/*  understand and accept it fully.                                        */
15/*                                                                         */
16/***************************************************************************/
17
18
19#ifndef __AFPIC_H__
20#define __AFPIC_H__
21
22
23FT_BEGIN_HEADER
24
25#include FT_INTERNAL_PIC_H
26
27
28#ifndef FT_CONFIG_OPTION_PIC
29
30#define AF_SERVICES_GET            af_services
31#define AF_SERVICE_PROPERTIES_GET  af_service_properties
32
33#define AF_SCRIPT_CLASSES_GET      af_script_classes
34#define AF_INTERFACE_GET           af_autofitter_interface
35
36#else /* FT_CONFIG_OPTION_PIC */
37
38  /* some include files required for members of AFModulePIC */
39#include FT_SERVICE_PROPERTIES_H
40
41#include "aftypes.h"
42
43  /* increase these when you add new scripts, */
44  /* and update autofit_module_class_pic_init */
45#ifdef FT_OPTION_AUTOFIT2
46#define AF_SCRIPT_CLASSES_COUNT  6
47#else
48#define AF_SCRIPT_CLASSES_COUNT  5
49#endif
50
51#define AF_SCRIPT_CLASSES_REC_COUNT  ( AF_SCRIPT_CLASSES_COUNT - 1 )
52
53
54  typedef struct  AFModulePIC_
55  {
56    FT_ServiceDescRec*          af_services;
57    FT_Service_PropertiesRec    af_service_properties;
58
59    AF_ScriptClass              af_script_classes[AF_SCRIPT_CLASSES_COUNT];
60    AF_ScriptClassRec           af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
61    FT_AutoHinter_InterfaceRec  af_autofitter_interface;
62
63  } AFModulePIC;
64
65
66#define GET_PIC( lib )  \
67          ( (AFModulePIC*)((lib)->pic_container.autofit) )
68
69#define AF_SERVICES_GET  \
70          ( GET_PIC( library )->af_services )
71#define AF_SERVICE_PROPERTIES_GET  \
72          ( GET_PIC( library )->af_service_properties )
73
74#define AF_SCRIPT_CLASSES_GET  \
75          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
76#define AF_INTERFACE_GET  \
77          ( GET_PIC( library )->af_autofitter_interface )
78
79
80  /* see afpic.c for the implementation */
81  void
82  autofit_module_class_pic_free( FT_Library  library );
83
84  FT_Error
85  autofit_module_class_pic_init( FT_Library  library );
86
87#endif /* FT_CONFIG_OPTION_PIC */
88
89 /* */
90
91FT_END_HEADER
92
93#endif /* __AFPIC_H__ */
94
95
96/* END */
97