1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/harfbuzz/src/hb-set.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,154 @@ 1.4 +/* 1.5 + * Copyright © 2012 Google, Inc. 1.6 + * 1.7 + * This is part of HarfBuzz, a text shaping library. 1.8 + * 1.9 + * Permission is hereby granted, without written agreement and without 1.10 + * license or royalty fees, to use, copy, modify, and distribute this 1.11 + * software and its documentation for any purpose, provided that the 1.12 + * above copyright notice and the following two paragraphs appear in 1.13 + * all copies of this software. 1.14 + * 1.15 + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 1.16 + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 1.17 + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 1.18 + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 1.19 + * DAMAGE. 1.20 + * 1.21 + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 1.22 + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 1.23 + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 1.24 + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 1.25 + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 1.26 + * 1.27 + * Google Author(s): Behdad Esfahbod 1.28 + */ 1.29 + 1.30 +#ifndef HB_H_IN 1.31 +#error "Include <hb.h> instead." 1.32 +#endif 1.33 + 1.34 +#ifndef HB_SET_H 1.35 +#define HB_SET_H 1.36 + 1.37 +#include "hb-common.h" 1.38 + 1.39 +HB_BEGIN_DECLS 1.40 + 1.41 + 1.42 +#define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1) 1.43 + 1.44 +typedef struct hb_set_t hb_set_t; 1.45 + 1.46 + 1.47 +hb_set_t * 1.48 +hb_set_create (void); 1.49 + 1.50 +hb_set_t * 1.51 +hb_set_get_empty (void); 1.52 + 1.53 +hb_set_t * 1.54 +hb_set_reference (hb_set_t *set); 1.55 + 1.56 +void 1.57 +hb_set_destroy (hb_set_t *set); 1.58 + 1.59 +hb_bool_t 1.60 +hb_set_set_user_data (hb_set_t *set, 1.61 + hb_user_data_key_t *key, 1.62 + void * data, 1.63 + hb_destroy_func_t destroy, 1.64 + hb_bool_t replace); 1.65 + 1.66 +void * 1.67 +hb_set_get_user_data (hb_set_t *set, 1.68 + hb_user_data_key_t *key); 1.69 + 1.70 + 1.71 +/* Returns false if allocation has failed before */ 1.72 +hb_bool_t 1.73 +hb_set_allocation_successful (const hb_set_t *set); 1.74 + 1.75 +void 1.76 +hb_set_clear (hb_set_t *set); 1.77 + 1.78 +hb_bool_t 1.79 +hb_set_is_empty (const hb_set_t *set); 1.80 + 1.81 +hb_bool_t 1.82 +hb_set_has (const hb_set_t *set, 1.83 + hb_codepoint_t codepoint); 1.84 + 1.85 +/* Right now limited to 16-bit integers. Eventually will do full codepoint range, sans -1 1.86 + * which we will use as a sentinel. */ 1.87 +void 1.88 +hb_set_add (hb_set_t *set, 1.89 + hb_codepoint_t codepoint); 1.90 + 1.91 +void 1.92 +hb_set_add_range (hb_set_t *set, 1.93 + hb_codepoint_t first, 1.94 + hb_codepoint_t last); 1.95 + 1.96 +void 1.97 +hb_set_del (hb_set_t *set, 1.98 + hb_codepoint_t codepoint); 1.99 + 1.100 +void 1.101 +hb_set_del_range (hb_set_t *set, 1.102 + hb_codepoint_t first, 1.103 + hb_codepoint_t last); 1.104 + 1.105 +hb_bool_t 1.106 +hb_set_is_equal (const hb_set_t *set, 1.107 + const hb_set_t *other); 1.108 + 1.109 +void 1.110 +hb_set_set (hb_set_t *set, 1.111 + const hb_set_t *other); 1.112 + 1.113 +void 1.114 +hb_set_union (hb_set_t *set, 1.115 + const hb_set_t *other); 1.116 + 1.117 +void 1.118 +hb_set_intersect (hb_set_t *set, 1.119 + const hb_set_t *other); 1.120 + 1.121 +void 1.122 +hb_set_subtract (hb_set_t *set, 1.123 + const hb_set_t *other); 1.124 + 1.125 +void 1.126 +hb_set_symmetric_difference (hb_set_t *set, 1.127 + const hb_set_t *other); 1.128 + 1.129 +void 1.130 +hb_set_invert (hb_set_t *set); 1.131 + 1.132 +unsigned int 1.133 +hb_set_get_population (const hb_set_t *set); 1.134 + 1.135 +/* Returns -1 if set empty. */ 1.136 +hb_codepoint_t 1.137 +hb_set_get_min (const hb_set_t *set); 1.138 + 1.139 +/* Returns -1 if set empty. */ 1.140 +hb_codepoint_t 1.141 +hb_set_get_max (const hb_set_t *set); 1.142 + 1.143 +/* Pass -1 in to get started. */ 1.144 +hb_bool_t 1.145 +hb_set_next (const hb_set_t *set, 1.146 + hb_codepoint_t *codepoint); 1.147 + 1.148 +/* Pass -1 for first and last to get started. */ 1.149 +hb_bool_t 1.150 +hb_set_next_range (const hb_set_t *set, 1.151 + hb_codepoint_t *first, 1.152 + hb_codepoint_t *last); 1.153 + 1.154 + 1.155 +HB_END_DECLS 1.156 + 1.157 +#endif /* HB_SET_H */