• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  *
3  * ftcsbits.h
4  *
5  *   A small-bitmap cache (specification).
6  *
7  * Copyright (C) 2000-2020 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 FTCSBITS_H_
20 #define FTCSBITS_H_
21 
22 
23 #include <freetype/ftcache.h>
24 #include "ftcglyph.h"
25 
26 
27 FT_BEGIN_HEADER
28 
29 #define FTC_SBIT_ITEMS_PER_NODE  16
30 
31   typedef struct  FTC_SNodeRec_
32   {
33     FTC_GNodeRec  gnode;
34     FT_UInt       count;
35     FTC_SBitRec   sbits[FTC_SBIT_ITEMS_PER_NODE];
36 
37   } FTC_SNodeRec, *FTC_SNode;
38 
39 
40 #define FTC_SNODE( x )         ( (FTC_SNode)( x ) )
41 #define FTC_SNODE_GINDEX( x )  FTC_GNODE( x )->gindex
42 #define FTC_SNODE_FAMILY( x )  FTC_GNODE( x )->family
43 
44   typedef FT_UInt
45   (*FTC_SFamily_GetCountFunc)( FTC_Family   family,
46                                FTC_Manager  manager );
47 
48   typedef FT_Error
49   (*FTC_SFamily_LoadGlyphFunc)( FTC_Family   family,
50                                 FT_UInt      gindex,
51                                 FTC_Manager  manager,
52                                 FT_Face     *aface );
53 
54   typedef struct  FTC_SFamilyClassRec_
55   {
56     FTC_MruListClassRec        clazz;
57     FTC_SFamily_GetCountFunc   family_get_count;
58     FTC_SFamily_LoadGlyphFunc  family_load_glyph;
59 
60   } FTC_SFamilyClassRec;
61 
62   typedef const FTC_SFamilyClassRec*  FTC_SFamilyClass;
63 
64 #define FTC_SFAMILY_CLASS( x )  ((FTC_SFamilyClass)(x))
65 
66 #define FTC_CACHE_SFAMILY_CLASS( x )  \
67           FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
68 
69 
70   FT_LOCAL( void )
71   FTC_SNode_Free( FTC_SNode  snode,
72                   FTC_Cache  cache );
73 
74   FT_LOCAL( FT_Error )
75   FTC_SNode_New( FTC_SNode   *psnode,
76                  FTC_GQuery   gquery,
77                  FTC_Cache    cache );
78 
79 #if 0
80   FT_LOCAL( FT_ULong )
81   FTC_SNode_Weight( FTC_SNode  inode );
82 #endif
83 
84 
85 #ifdef FTC_INLINE
86 
87   FT_LOCAL( FT_Bool )
88   FTC_SNode_Compare( FTC_SNode   snode,
89                      FTC_GQuery  gquery,
90                      FTC_Cache   cache,
91                      FT_Bool*    list_changed);
92 
93 #endif
94 
95   /* */
96 
97 FT_END_HEADER
98 
99 #endif /* FTCSBITS_H_ */
100 
101 
102 /* END */
103