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