1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/harfbuzz/src/hb-face-private.hh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,107 @@ 1.4 +/* 1.5 + * Copyright © 2009 Red Hat, Inc. 1.6 + * Copyright © 2011 Google, Inc. 1.7 + * 1.8 + * This is part of HarfBuzz, a text shaping library. 1.9 + * 1.10 + * Permission is hereby granted, without written agreement and without 1.11 + * license or royalty fees, to use, copy, modify, and distribute this 1.12 + * software and its documentation for any purpose, provided that the 1.13 + * above copyright notice and the following two paragraphs appear in 1.14 + * all copies of this software. 1.15 + * 1.16 + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 1.17 + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 1.18 + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 1.19 + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 1.20 + * DAMAGE. 1.21 + * 1.22 + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 1.23 + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 1.24 + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 1.25 + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 1.26 + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 1.27 + * 1.28 + * Red Hat Author(s): Behdad Esfahbod 1.29 + * Google Author(s): Behdad Esfahbod 1.30 + */ 1.31 + 1.32 +#ifndef HB_FACE_PRIVATE_HH 1.33 +#define HB_FACE_PRIVATE_HH 1.34 + 1.35 +#include "hb-private.hh" 1.36 + 1.37 +#include "hb-object-private.hh" 1.38 +#include "hb-shaper-private.hh" 1.39 +#include "hb-shape-plan-private.hh" 1.40 + 1.41 + 1.42 +/* 1.43 + * hb_face_t 1.44 + */ 1.45 + 1.46 +struct hb_face_t { 1.47 + hb_object_header_t header; 1.48 + ASSERT_POD (); 1.49 + 1.50 + hb_bool_t immutable; 1.51 + 1.52 + hb_reference_table_func_t reference_table_func; 1.53 + void *user_data; 1.54 + hb_destroy_func_t destroy; 1.55 + 1.56 + unsigned int index; 1.57 + mutable unsigned int upem; 1.58 + mutable unsigned int num_glyphs; 1.59 + 1.60 + struct hb_shaper_data_t shaper_data; 1.61 + 1.62 + struct plan_node_t { 1.63 + hb_shape_plan_t *shape_plan; 1.64 + plan_node_t *next; 1.65 + } *shape_plans; 1.66 + 1.67 + 1.68 + inline hb_blob_t *reference_table (hb_tag_t tag) const 1.69 + { 1.70 + hb_blob_t *blob; 1.71 + 1.72 + if (unlikely (!this || !reference_table_func)) 1.73 + return hb_blob_get_empty (); 1.74 + 1.75 + blob = reference_table_func (/*XXX*/const_cast<hb_face_t *> (this), tag, user_data); 1.76 + if (unlikely (!blob)) 1.77 + return hb_blob_get_empty (); 1.78 + 1.79 + return blob; 1.80 + } 1.81 + 1.82 + inline HB_PURE_FUNC unsigned int get_upem (void) const 1.83 + { 1.84 + if (unlikely (!upem)) 1.85 + load_upem (); 1.86 + return upem; 1.87 + } 1.88 + 1.89 + inline unsigned int get_num_glyphs (void) const 1.90 + { 1.91 + if (unlikely (num_glyphs == (unsigned int) -1)) 1.92 + load_num_glyphs (); 1.93 + return num_glyphs; 1.94 + } 1.95 + 1.96 + private: 1.97 + HB_INTERNAL void load_upem (void) const; 1.98 + HB_INTERNAL void load_num_glyphs (void) const; 1.99 +}; 1.100 + 1.101 +extern HB_INTERNAL const hb_face_t _hb_face_nil; 1.102 + 1.103 +#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS 1.104 +#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, face); 1.105 +#include "hb-shaper-list.hh" 1.106 +#undef HB_SHAPER_IMPLEMENT 1.107 +#undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS 1.108 + 1.109 + 1.110 +#endif /* HB_FACE_PRIVATE_HH */