Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright © 2009 Red Hat, Inc. |
michael@0 | 3 | * Copyright © 2011 Google, Inc. |
michael@0 | 4 | * |
michael@0 | 5 | * This is part of HarfBuzz, a text shaping library. |
michael@0 | 6 | * |
michael@0 | 7 | * Permission is hereby granted, without written agreement and without |
michael@0 | 8 | * license or royalty fees, to use, copy, modify, and distribute this |
michael@0 | 9 | * software and its documentation for any purpose, provided that the |
michael@0 | 10 | * above copyright notice and the following two paragraphs appear in |
michael@0 | 11 | * all copies of this software. |
michael@0 | 12 | * |
michael@0 | 13 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
michael@0 | 14 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
michael@0 | 15 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
michael@0 | 16 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
michael@0 | 17 | * DAMAGE. |
michael@0 | 18 | * |
michael@0 | 19 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
michael@0 | 20 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
michael@0 | 21 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
michael@0 | 22 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
michael@0 | 23 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
michael@0 | 24 | * |
michael@0 | 25 | * Red Hat Author(s): Behdad Esfahbod |
michael@0 | 26 | * Google Author(s): Behdad Esfahbod |
michael@0 | 27 | */ |
michael@0 | 28 | |
michael@0 | 29 | #ifndef HB_FACE_PRIVATE_HH |
michael@0 | 30 | #define HB_FACE_PRIVATE_HH |
michael@0 | 31 | |
michael@0 | 32 | #include "hb-private.hh" |
michael@0 | 33 | |
michael@0 | 34 | #include "hb-object-private.hh" |
michael@0 | 35 | #include "hb-shaper-private.hh" |
michael@0 | 36 | #include "hb-shape-plan-private.hh" |
michael@0 | 37 | |
michael@0 | 38 | |
michael@0 | 39 | /* |
michael@0 | 40 | * hb_face_t |
michael@0 | 41 | */ |
michael@0 | 42 | |
michael@0 | 43 | struct hb_face_t { |
michael@0 | 44 | hb_object_header_t header; |
michael@0 | 45 | ASSERT_POD (); |
michael@0 | 46 | |
michael@0 | 47 | hb_bool_t immutable; |
michael@0 | 48 | |
michael@0 | 49 | hb_reference_table_func_t reference_table_func; |
michael@0 | 50 | void *user_data; |
michael@0 | 51 | hb_destroy_func_t destroy; |
michael@0 | 52 | |
michael@0 | 53 | unsigned int index; |
michael@0 | 54 | mutable unsigned int upem; |
michael@0 | 55 | mutable unsigned int num_glyphs; |
michael@0 | 56 | |
michael@0 | 57 | struct hb_shaper_data_t shaper_data; |
michael@0 | 58 | |
michael@0 | 59 | struct plan_node_t { |
michael@0 | 60 | hb_shape_plan_t *shape_plan; |
michael@0 | 61 | plan_node_t *next; |
michael@0 | 62 | } *shape_plans; |
michael@0 | 63 | |
michael@0 | 64 | |
michael@0 | 65 | inline hb_blob_t *reference_table (hb_tag_t tag) const |
michael@0 | 66 | { |
michael@0 | 67 | hb_blob_t *blob; |
michael@0 | 68 | |
michael@0 | 69 | if (unlikely (!this || !reference_table_func)) |
michael@0 | 70 | return hb_blob_get_empty (); |
michael@0 | 71 | |
michael@0 | 72 | blob = reference_table_func (/*XXX*/const_cast<hb_face_t *> (this), tag, user_data); |
michael@0 | 73 | if (unlikely (!blob)) |
michael@0 | 74 | return hb_blob_get_empty (); |
michael@0 | 75 | |
michael@0 | 76 | return blob; |
michael@0 | 77 | } |
michael@0 | 78 | |
michael@0 | 79 | inline HB_PURE_FUNC unsigned int get_upem (void) const |
michael@0 | 80 | { |
michael@0 | 81 | if (unlikely (!upem)) |
michael@0 | 82 | load_upem (); |
michael@0 | 83 | return upem; |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | inline unsigned int get_num_glyphs (void) const |
michael@0 | 87 | { |
michael@0 | 88 | if (unlikely (num_glyphs == (unsigned int) -1)) |
michael@0 | 89 | load_num_glyphs (); |
michael@0 | 90 | return num_glyphs; |
michael@0 | 91 | } |
michael@0 | 92 | |
michael@0 | 93 | private: |
michael@0 | 94 | HB_INTERNAL void load_upem (void) const; |
michael@0 | 95 | HB_INTERNAL void load_num_glyphs (void) const; |
michael@0 | 96 | }; |
michael@0 | 97 | |
michael@0 | 98 | extern HB_INTERNAL const hb_face_t _hb_face_nil; |
michael@0 | 99 | |
michael@0 | 100 | #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
michael@0 | 101 | #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, face); |
michael@0 | 102 | #include "hb-shaper-list.hh" |
michael@0 | 103 | #undef HB_SHAPER_IMPLEMENT |
michael@0 | 104 | #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS |
michael@0 | 105 | |
michael@0 | 106 | |
michael@0 | 107 | #endif /* HB_FACE_PRIVATE_HH */ |