Towards normalization
[framework/uifw/harfbuzz.git] / src / hb-ot-layout-private.hh
1 /*
2  * Copyright © 2007,2008,2009  Red Hat, Inc.
3  *
4  *  This is part of HarfBuzz, a text shaping library.
5  *
6  * Permission is hereby granted, without written agreement and without
7  * license or royalty fees, to use, copy, modify, and distribute this
8  * software and its documentation for any purpose, provided that the
9  * above copyright notice and the following two paragraphs appear in
10  * all copies of this software.
11  *
12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16  * DAMAGE.
17  *
18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23  *
24  * Red Hat Author(s): Behdad Esfahbod
25  */
26
27 #ifndef HB_OT_LAYOUT_PRIVATE_HH
28 #define HB_OT_LAYOUT_PRIVATE_HH
29
30 #include "hb-private.hh"
31
32 #include "hb-ot-layout.h"
33
34 #include "hb-font-private.hh"
35 #include "hb-buffer-private.hh"
36
37 HB_BEGIN_DECLS
38
39
40 /*
41  * GDEF
42  */
43
44 /* buffer var allocations */
45 #define props_cache() var1.u16[1] /* glyph_props cache */
46
47 /* XXX cleanup */
48 typedef enum {
49   HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0001,
50   HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH   = 0x0002,
51   HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE     = 0x0004,
52   HB_OT_LAYOUT_GLYPH_CLASS_MARK         = 0x0008,
53   HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT    = 0x0010
54 } hb_ot_layout_glyph_class_t;
55
56
57 HB_INTERNAL unsigned int
58 _hb_ot_layout_get_glyph_property (hb_face_t       *face,
59                                   hb_glyph_info_t *info);
60
61 HB_INTERNAL hb_bool_t
62 _hb_ot_layout_check_glyph_property (hb_face_t    *face,
63                                     hb_glyph_info_t *ginfo,
64                                     unsigned int  lookup_props,
65                                     unsigned int *property_out);
66
67 HB_INTERNAL hb_bool_t
68 _hb_ot_layout_skip_mark (hb_face_t    *face,
69                          hb_glyph_info_t *ginfo,
70                          unsigned int  lookup_props,
71                          unsigned int *property_out);
72
73
74 /*
75  * head
76  */
77
78 HB_INTERNAL unsigned int
79 _hb_ot_layout_get_upem (hb_face_t    *face);
80
81
82 /*
83  * hb_ot_layout_t
84  */
85
86 struct hb_ot_layout_t
87 {
88   hb_blob_t *gdef_blob;
89   hb_blob_t *gsub_blob;
90   hb_blob_t *gpos_blob;
91   hb_blob_t *head_blob;
92
93   const struct GDEF *gdef;
94   const struct GSUB *gsub;
95   const struct GPOS *gpos;
96   const struct head *head;
97 };
98
99
100 HB_INTERNAL hb_ot_layout_t *
101 _hb_ot_layout_create (hb_face_t *face);
102
103 HB_INTERNAL void
104 _hb_ot_layout_destroy (hb_ot_layout_t *layout);
105
106
107 HB_END_DECLS
108
109 #endif /* HB_OT_LAYOUT_PRIVATE_HH */