Update Copyright headers
[apps/home/video-player.git] / src / hb-unicode-private.hh
1 /*
2  * Copyright © 2009  Red Hat, Inc.
3  * Copyright © 2011 Codethink Limited
4  * Copyright © 2010,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_PRIVATE_HH
32 #define HB_UNICODE_PRIVATE_HH
33
34 #include "hb-private.hh"
35
36 #include "hb-unicode.h"
37
38 HB_BEGIN_DECLS
39
40
41 /*
42  * hb_unicode_funcs_t
43  */
44
45 struct _hb_unicode_funcs_t {
46   hb_reference_count_t ref_count;
47   hb_unicode_funcs_t *parent;
48
49   hb_bool_t immutable;
50
51 #define IMPLEMENT(return_type, name) \
52   inline return_type \
53   get_##name (hb_codepoint_t unicode) \
54   { return this->get.name (this, unicode, this->user_data.name); }
55
56   IMPLEMENT (unsigned int, combining_class)
57   IMPLEMENT (unsigned int, eastasian_width)
58   IMPLEMENT (hb_unicode_general_category_t, general_category)
59   IMPLEMENT (hb_codepoint_t, mirroring)
60   IMPLEMENT (hb_script_t, script)
61
62 #undef IMPLEMENT
63
64   /* Don't access these directly.  Call get_*() instead. */
65
66   struct {
67     hb_unicode_get_combining_class_func_t       combining_class;
68     hb_unicode_get_eastasian_width_func_t       eastasian_width;
69     hb_unicode_get_general_category_func_t      general_category;
70     hb_unicode_get_mirroring_func_t             mirroring;
71     hb_unicode_get_script_func_t                script;
72   } get;
73
74   struct {
75     void                                        *combining_class;
76     void                                        *eastasian_width;
77     void                                        *general_category;
78     void                                        *mirroring;
79     void                                        *script;
80   } user_data;
81
82   struct {
83     hb_destroy_func_t                           combining_class;
84     hb_destroy_func_t                           eastasian_width;
85     hb_destroy_func_t                           general_category;
86     hb_destroy_func_t                           mirroring;
87     hb_destroy_func_t                           script;
88   } destroy;
89 };
90
91 extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_nil;
92
93
94 HB_END_DECLS
95
96 #endif /* HB_UNICODE_PRIVATE_HH */