Update Copyright headers
[apps/home/video-player.git] / src / hb-unicode.h
1 /*
2  * Copyright © 2009  Red Hat, Inc.
3  * Copyright © 2011 Codethink Limited
4  * Copyright © 2011  Google, Inc.
5  *
6  *  This is part of HarfBuzz, a text shaping library.
7  *
8  * Permission is hereby granted, without written agreement and without
9  * license or royalty fees, to use, copy, modify, and distribute this
10  * software and its documentation for any purpose, provided that the
11  * above copyright notice and the following two paragraphs appear in
12  * all copies of this software.
13  *
14  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
15  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
17  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18  * DAMAGE.
19  *
20  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
21  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
23  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
24  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25  *
26  * Red Hat Author(s): Behdad Esfahbod
27  * Codethink Author(s): Ryan Lortie
28  * Google Author(s): Behdad Esfahbod
29  */
30
31 #ifndef HB_UNICODE_H
32 #define HB_UNICODE_H
33
34 #include "hb-common.h"
35
36 HB_BEGIN_DECLS
37
38
39 /*
40  * hb_unicode_funcs_t
41  */
42
43 typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t;
44
45 hb_unicode_funcs_t *
46 hb_unicode_funcs_create (hb_unicode_funcs_t *parent_funcs);
47
48 hb_unicode_funcs_t *
49 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
50
51 void
52 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);
53
54 void
55 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
56
57 hb_bool_t
58 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs);
59
60 hb_unicode_funcs_t *
61 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs);
62
63
64 /*
65  * funcs
66  */
67
68 /* typedefs */
69
70 typedef unsigned int                  (*hb_unicode_get_combining_class_func_t)  (hb_unicode_funcs_t *ufuncs,
71                                                                                  hb_codepoint_t      unicode,
72                                                                                  void               *user_data);
73 typedef unsigned int                  (*hb_unicode_get_eastasian_width_func_t)  (hb_unicode_funcs_t *ufuncs,
74                                                                                  hb_codepoint_t      unicode,
75                                                                                  void               *user_data);
76 typedef hb_unicode_general_category_t (*hb_unicode_get_general_category_func_t) (hb_unicode_funcs_t *ufuncs,
77                                                                                  hb_codepoint_t      unicode,
78                                                                                  void               *user_data);
79 typedef hb_codepoint_t                (*hb_unicode_get_mirroring_func_t)        (hb_unicode_funcs_t *ufuncs,
80                                                                                  hb_codepoint_t      unicode,
81                                                                                  void               *user_data);
82 typedef hb_script_t                   (*hb_unicode_get_script_func_t)           (hb_unicode_funcs_t *ufuncs,
83                                                                                  hb_codepoint_t      unicode,
84                                                                                  void               *user_data);
85
86 /* setters */
87
88 void
89 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
90                                            hb_unicode_get_combining_class_func_t combining_class_func,
91                                            void *user_data, hb_destroy_func_t destroy);
92
93 void
94 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
95                                            hb_unicode_get_eastasian_width_func_t eastasian_width_func,
96                                            void *user_data, hb_destroy_func_t destroy);
97
98 void
99 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
100                                             hb_unicode_get_general_category_func_t general_category_func,
101                                             void *user_data, hb_destroy_func_t destroy);
102
103 void
104 hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
105                                      hb_unicode_get_mirroring_func_t mirroring_func,
106                                      void *user_data, hb_destroy_func_t destroy);
107
108 void
109 hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
110                                   hb_unicode_get_script_func_t script_func,
111                                   void *user_data, hb_destroy_func_t destroy);
112
113
114
115 /* accessors */
116
117 unsigned int
118 hb_unicode_get_combining_class (hb_unicode_funcs_t *ufuncs,
119                                 hb_codepoint_t unicode);
120
121 unsigned int
122 hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
123                                 hb_codepoint_t unicode);
124
125 hb_unicode_general_category_t
126 hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs,
127                                  hb_codepoint_t unicode);
128
129 hb_codepoint_t
130 hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
131                           hb_codepoint_t unicode);
132
133 hb_script_t
134 hb_unicode_get_script (hb_unicode_funcs_t *ufuncs,
135                        hb_codepoint_t unicode);
136
137
138 HB_END_DECLS
139
140 #endif /* HB_UNICODE_H */