1/***************************************************************************/
2/*                                                                         */
3/*  svmm.h                                                                 */
4/*                                                                         */
5/*    The FreeType Multiple Masters and GX var services (specification).   */
6/*                                                                         */
7/*  Copyright 2003-2017 by                                                 */
8/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
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 SVMM_H_
20#define SVMM_H_
21
22#include FT_INTERNAL_SERVICE_H
23
24
25FT_BEGIN_HEADER
26
27
28  /*
29   *  A service used to manage multiple-masters data in a given face.
30   *
31   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
32   *
33   */
34
35#define FT_SERVICE_ID_MULTI_MASTERS  "multi-masters"
36
37
38  typedef FT_Error
39  (*FT_Get_MM_Func)( FT_Face           face,
40                     FT_Multi_Master*  master );
41
42  typedef FT_Error
43  (*FT_Get_MM_Var_Func)( FT_Face      face,
44                         FT_MM_Var*  *master );
45
46  typedef FT_Error
47  (*FT_Set_MM_Design_Func)( FT_Face   face,
48                            FT_UInt   num_coords,
49                            FT_Long*  coords );
50
51  typedef FT_Error
52  (*FT_Set_Var_Design_Func)( FT_Face    face,
53                             FT_UInt    num_coords,
54                             FT_Fixed*  coords );
55
56  typedef FT_Error
57  (*FT_Set_MM_Blend_Func)( FT_Face   face,
58                           FT_UInt   num_coords,
59                           FT_Long*  coords );
60
61  typedef FT_Error
62  (*FT_Get_Var_Design_Func)( FT_Face    face,
63                             FT_UInt    num_coords,
64                             FT_Fixed*  coords );
65
66  typedef FT_Error
67  (*FT_Get_MM_Blend_Func)( FT_Face   face,
68                           FT_UInt   num_coords,
69                           FT_Long*  coords );
70
71  typedef FT_Error
72  (*FT_Get_Var_Blend_Func)( FT_Face      face,
73                            FT_UInt     *num_coords,
74                            FT_Fixed*   *coords,
75                            FT_MM_Var*  *mm_var );
76
77  typedef void
78  (*FT_Done_Blend_Func)( FT_Face );
79
80
81  FT_DEFINE_SERVICE( MultiMasters )
82  {
83    FT_Get_MM_Func          get_mm;
84    FT_Set_MM_Design_Func   set_mm_design;
85    FT_Set_MM_Blend_Func    set_mm_blend;
86    FT_Get_MM_Blend_Func    get_mm_blend;
87    FT_Get_MM_Var_Func      get_mm_var;
88    FT_Set_Var_Design_Func  set_var_design;
89    FT_Get_Var_Design_Func  get_var_design;
90
91    /* for internal use; only needed for code sharing between modules */
92    FT_Get_Var_Blend_Func   get_var_blend;
93    FT_Done_Blend_Func      done_blend;
94  };
95
96
97#ifndef FT_CONFIG_OPTION_PIC
98
99#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,           \
100                                           get_mm_,          \
101                                           set_mm_design_,   \
102                                           set_mm_blend_,    \
103                                           get_mm_blend_,    \
104                                           get_mm_var_,      \
105                                           set_var_design_,  \
106                                           get_var_design_,  \
107                                           get_var_blend_,   \
108                                           done_blend_     ) \
109  static const FT_Service_MultiMastersRec  class_ =          \
110  {                                                          \
111    get_mm_,                                                 \
112    set_mm_design_,                                          \
113    set_mm_blend_,                                           \
114    get_mm_blend_,                                           \
115    get_mm_var_,                                             \
116    set_var_design_,                                         \
117    get_var_design_,                                         \
118    get_var_blend_,                                          \
119    done_blend_                                              \
120  };
121
122#else /* FT_CONFIG_OPTION_PIC */
123
124#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,               \
125                                           get_mm_,              \
126                                           set_mm_design_,       \
127                                           set_mm_blend_,        \
128                                           get_mm_blend_,        \
129                                           get_mm_var_,          \
130                                           set_var_design_,      \
131                                           get_var_design_,      \
132                                           get_var_blend_,       \
133                                           done_blend_ )         \
134  void                                                           \
135  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz ) \
136  {                                                              \
137    clazz->get_mm         = get_mm_;                             \
138    clazz->set_mm_design  = set_mm_design_;                      \
139    clazz->set_mm_blend   = set_mm_blend_;                       \
140    clazz->get_mm_blend   = get_mm_blend_;                       \
141    clazz->get_mm_var     = get_mm_var_;                         \
142    clazz->set_var_design = set_var_design_;                     \
143    clazz->get_var_design = get_var_design_;                     \
144    clazz->get_var_blend  = get_var_blend_;                      \
145    clazz->done_blend     = done_blend_;                         \
146  }
147
148#endif /* FT_CONFIG_OPTION_PIC */
149
150  /* */
151
152
153FT_END_HEADER
154
155#endif /* SVMM_H_ */
156
157
158/* END */
159