ReactOS 0.4.16-dev-981-g80eb313
pshmod.c
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * pshmod.c
4 *
5 * FreeType PostScript hinter module implementation (body).
6 *
7 * Copyright (C) 2001-2019 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#include <ft2build.h>
20#include FT_INTERNAL_OBJECTS_H
21#include "pshrec.h"
22#include "pshalgo.h"
23
24
25 /* the Postscript Hinter module structure */
26 typedef struct PS_Hinter_Module_Rec_
27 {
30
34
36
37
38 /* finalize module */
39 FT_CALLBACK_DEF( void )
41 {
42 module->t1_funcs.hints = NULL;
43 module->t2_funcs.hints = NULL;
44
45 ps_hints_done( &module->ps_hints );
46 }
47
48
49 /* initialize module, create hints recorder and the interface */
52 {
53 FT_Memory memory = module->root.memory;
54 void* ph = &module->ps_hints;
55
56
57 ps_hints_init( &module->ps_hints, memory );
58
59 psh_globals_funcs_init( &module->globals_funcs );
60
61 t1_hints_funcs_init( &module->t1_funcs );
62 module->t1_funcs.hints = (T1_Hints)ph;
63
64 t2_hints_funcs_init( &module->t2_funcs );
65 module->t2_funcs.hints = (T2_Hints)ph;
66
67 return 0;
68 }
69
70
71 /* returns global hints interface */
74 {
75 return &((PS_Hinter_Module)module)->globals_funcs;
76 }
77
78
79 /* return Type 1 hints interface */
82 {
83 return &((PS_Hinter_Module)module)->t1_funcs;
84 }
85
86
87 /* return Type 2 hints interface */
90 {
91 return &((PS_Hinter_Module)module)->t2_funcs;
92 }
93
94
96 pshinter_interface,
97
101 )
102
103
105 pshinter_module_class,
106
107 0,
108 sizeof ( PS_Hinter_ModuleRec ),
109 "pshinter",
110 0x10000L,
111 0x20000L,
112
113 &pshinter_interface, /* module-specific interface */
114
115 (FT_Module_Constructor)ps_hinter_init, /* module_init */
116 (FT_Module_Destructor) ps_hinter_done, /* module_done */
117 (FT_Module_Requester) NULL /* get_interface */
118 )
119
120/* END */
#define NULL
Definition: types.h:112
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:544
void(* FT_Module_Destructor)(FT_Module module)
Definition: ftmodapi.h:169
FT_Error(* FT_Module_Constructor)(FT_Module module)
Definition: ftmodapi.h:153
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
Definition: ftmodapi.h:188
#define FT_DEFINE_MODULE( class_, flags_, size_, name_, version_, requires_, interface_, init_, done_, get_interface_)
Definition: ftobjs.h:1202
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
int FT_Error
Definition: fttypes.h:299
#define FT_DEFINE_PSHINTER_INTERFACE( class_, get_globals_funcs_, get_t1_funcs_, get_t2_funcs_)
Definition: pshints.h:682
struct T1_HintsRec_ * T1_Hints
Definition: pshints.h:104
struct T2_HintsRec_ * T2_Hints
Definition: pshints.h:391
static char memory[1024 *256]
Definition: process.c:116
psh_globals_funcs_init(PSH_Globals_FuncsRec *funcs)
Definition: pshglob.c:788
ps_hinter_init(PS_Hinter_Module module)
Definition: pshmod.c:51
ps_hinter_done(PS_Hinter_Module module)
Definition: pshmod.c:40
struct PS_Hinter_Module_Rec_ * PS_Hinter_Module
pshinter_get_t2_funcs(FT_Module module)
Definition: pshmod.c:89
pshinter_get_globals_funcs(FT_Module module)
Definition: pshmod.c:73
struct PS_Hinter_Module_Rec_ PS_Hinter_ModuleRec
pshinter_get_t1_funcs(FT_Module module)
Definition: pshmod.c:81
t1_hints_funcs_init(T1_Hints_FuncsRec *funcs)
Definition: pshrec.c:1141
ps_hints_init(PS_Hints hints, FT_Memory memory)
Definition: pshrec.c:818
ps_hints_done(PS_Hints hints)
Definition: pshrec.c:804
t2_hints_funcs_init(T2_Hints_FuncsRec *funcs)
Definition: pshrec.c:1207
T2_Hints_FuncsRec t2_funcs
Definition: pshmod.c:33
PSH_Globals_FuncsRec globals_funcs
Definition: pshmod.c:31
PS_HintsRec ps_hints
Definition: pshmod.c:29
FT_ModuleRec root
Definition: pshmod.c:28
T1_Hints_FuncsRec t1_funcs
Definition: pshmod.c:32