Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/harfbuzz-ng/src/hb-buffer.h

Issue 9223010: Update harfbuzz-ng to 1a5a91dc0d8bf4b72a2f22dc6300b06ad7000b79. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use -M option for 'git diff' to patch correctly Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-blob-private.h ('k') | third_party/harfbuzz-ng/src/hb-buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg 2 * Copyright © 1998-2004 David Turner and Werner Lemberg
3 * Copyright (C) 2004,2007,2009 Red Hat, Inc. 3 * Copyright © 2004,2007,2009 Red Hat, Inc.
4 * Copyright © 2011 Google, Inc.
4 * 5 *
5 * This is part of HarfBuzz, a text shaping library. 6 * This is part of HarfBuzz, a text shaping library.
6 * 7 *
7 * Permission is hereby granted, without written agreement and without 8 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this 9 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the 10 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in 11 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software. 12 * all copies of this software.
12 * 13 *
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 14 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 16 * 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 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17 * DAMAGE. 18 * DAMAGE.
18 * 19 *
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 20 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22 * 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 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 * 25 *
25 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod 26 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
27 * Google Author(s): Behdad Esfahbod
26 */ 28 */
27 29
28 #ifndef HB_BUFFER_H 30 #ifndef HB_BUFFER_H
29 #define HB_BUFFER_H 31 #define HB_BUFFER_H
30 32
31 #include "hb-common.h" 33 #include "hb-common.h"
32 #include "hb-unicode.h" 34 #include "hb-unicode.h"
33 #include "hb-language.h"
34 35
35 HB_BEGIN_DECLS 36 HB_BEGIN_DECLS
36 37
37 38
38 typedef struct _hb_buffer_t hb_buffer_t; 39 typedef struct _hb_buffer_t hb_buffer_t;
39 40
40 typedef struct _hb_glyph_info_t { 41 typedef struct _hb_glyph_info_t {
41 hb_codepoint_t codepoint; 42 hb_codepoint_t codepoint;
42 hb_mask_t mask; 43 hb_mask_t mask;
43 uint32_t cluster; 44 uint32_t cluster;
45
46 /*< private >*/
44 hb_var_int_t var1; 47 hb_var_int_t var1;
45 hb_var_int_t var2; 48 hb_var_int_t var2;
46 } hb_glyph_info_t; 49 } hb_glyph_info_t;
47 50
48 typedef struct _hb_glyph_position_t { 51 typedef struct _hb_glyph_position_t {
49 hb_position_t x_advance; 52 hb_position_t x_advance;
50 hb_position_t y_advance; 53 hb_position_t y_advance;
51 hb_position_t x_offset; 54 hb_position_t x_offset;
52 hb_position_t y_offset; 55 hb_position_t y_offset;
56
57 /*< private >*/
53 hb_var_int_t var; 58 hb_var_int_t var;
54 } hb_glyph_position_t; 59 } hb_glyph_position_t;
55 60
56 61
57 hb_buffer_t * 62 hb_buffer_t *
58 hb_buffer_create (unsigned int pre_alloc_size); 63 hb_buffer_create (void);
64
65 hb_buffer_t *
66 hb_buffer_get_empty (void);
59 67
60 hb_buffer_t * 68 hb_buffer_t *
61 hb_buffer_reference (hb_buffer_t *buffer); 69 hb_buffer_reference (hb_buffer_t *buffer);
62 70
63 unsigned int
64 hb_buffer_get_reference_count (hb_buffer_t *buffer);
65
66 void 71 void
67 hb_buffer_destroy (hb_buffer_t *buffer); 72 hb_buffer_destroy (hb_buffer_t *buffer);
68 73
74 hb_bool_t
75 hb_buffer_set_user_data (hb_buffer_t *buffer,
76 hb_user_data_key_t *key,
77 void * data,
78 hb_destroy_func_t destroy,
79 hb_bool_t replace);
80
81 void *
82 hb_buffer_get_user_data (hb_buffer_t *buffer,
83 hb_user_data_key_t *key);
84
69 85
70 void 86 void
71 hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, 87 hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
72 hb_unicode_funcs_t *unicode_funcs); 88 hb_unicode_funcs_t *unicode_funcs);
73 89
74 hb_unicode_funcs_t * 90 hb_unicode_funcs_t *
75 hb_buffer_get_unicode_funcs (hb_buffer_t *buffer); 91 hb_buffer_get_unicode_funcs (hb_buffer_t *buffer);
76 92
77 void 93 void
78 hb_buffer_set_direction (hb_buffer_t *buffer, 94 hb_buffer_set_direction (hb_buffer_t *buffer,
(...skipping 10 matching lines...) Expand all
89 hb_buffer_get_script (hb_buffer_t *buffer); 105 hb_buffer_get_script (hb_buffer_t *buffer);
90 106
91 void 107 void
92 hb_buffer_set_language (hb_buffer_t *buffer, 108 hb_buffer_set_language (hb_buffer_t *buffer,
93 hb_language_t language); 109 hb_language_t language);
94 110
95 hb_language_t 111 hb_language_t
96 hb_buffer_get_language (hb_buffer_t *buffer); 112 hb_buffer_get_language (hb_buffer_t *buffer);
97 113
98 114
115 /* Resets the buffer. Afterwards it's as if it was just created,
116 * except that it has a larger buffer allocated perhaps... */
99 void 117 void
100 hb_buffer_clear (hb_buffer_t *buffer); 118 hb_buffer_reset (hb_buffer_t *buffer);
101 119
102 void 120 /* Returns FALSE if allocation failed */
103 hb_buffer_clear_positions (hb_buffer_t *buffer); 121 hb_bool_t
122 hb_buffer_pre_allocate (hb_buffer_t *buffer,
123 » » unsigned int size);
104 124
125
126 /* Returns FALSE if allocation has failed before */
105 hb_bool_t 127 hb_bool_t
106 hb_buffer_ensure (hb_buffer_t *buffer, 128 hb_buffer_allocation_successful (hb_buffer_t *buffer);
107 » » unsigned int size);
108 129
109 void 130 void
110 hb_buffer_reverse (hb_buffer_t *buffer); 131 hb_buffer_reverse (hb_buffer_t *buffer);
111 132
112 void 133 void
113 hb_buffer_reverse_clusters (hb_buffer_t *buffer); 134 hb_buffer_reverse_clusters (hb_buffer_t *buffer);
114 135
136 void
137 hb_buffer_guess_properties (hb_buffer_t *buffer);
138
115 139
116 /* Filling the buffer in */ 140 /* Filling the buffer in */
117 141
118 void 142 void
119 hb_buffer_add_glyph (hb_buffer_t *buffer, 143 hb_buffer_add (hb_buffer_t *buffer,
120 » » hb_codepoint_t codepoint, 144 » hb_codepoint_t codepoint,
121 » » hb_mask_t mask, 145 » hb_mask_t mask,
122 » » unsigned int cluster); 146 » unsigned int cluster);
123 147
124 void 148 void
125 hb_buffer_add_utf8 (hb_buffer_t *buffer, 149 hb_buffer_add_utf8 (hb_buffer_t *buffer,
126 const char *text, 150 const char *text,
127 » » unsigned int text_length, 151 » » int text_length,
128 unsigned int item_offset, 152 unsigned int item_offset,
129 » » unsigned int item_length); 153 » » int item_length);
130 154
131 void 155 void
132 hb_buffer_add_utf16 (hb_buffer_t *buffer, 156 hb_buffer_add_utf16 (hb_buffer_t *buffer,
133 const uint16_t *text, 157 const uint16_t *text,
134 » » unsigned int text_length, 158 » » int text_length,
135 unsigned int item_offset, 159 unsigned int item_offset,
136 » » unsigned int item_length); 160 » » int item_length);
137 161
138 void 162 void
139 hb_buffer_add_utf32 (hb_buffer_t *buffer, 163 hb_buffer_add_utf32 (hb_buffer_t *buffer,
140 const uint32_t *text, 164 const uint32_t *text,
141 » » unsigned int text_length, 165 » » int text_length,
142 unsigned int item_offset, 166 unsigned int item_offset,
143 » » unsigned int item_length); 167 » » int item_length);
144 168
145 169
146 /* Getting glyphs out of the buffer */ 170 /* Clears any new items added at the end */
171 hb_bool_t
172 hb_buffer_set_length (hb_buffer_t *buffer,
173 » » unsigned int length);
147 174
148 /* Return value valid as long as buffer not modified */ 175 /* Return value valid as long as buffer not modified */
149 unsigned int 176 unsigned int
150 hb_buffer_get_length (hb_buffer_t *buffer); 177 hb_buffer_get_length (hb_buffer_t *buffer);
151 178
179 /* Getting glyphs out of the buffer */
180
152 /* Return value valid as long as buffer not modified */ 181 /* Return value valid as long as buffer not modified */
153 hb_glyph_info_t * 182 hb_glyph_info_t *
154 hb_buffer_get_glyph_infos (hb_buffer_t *buffer); 183 hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
184 unsigned int *length);
155 185
156 /* Return value valid as long as buffer not modified */ 186 /* Return value valid as long as buffer not modified */
157 hb_glyph_position_t * 187 hb_glyph_position_t *
158 hb_buffer_get_glyph_positions (hb_buffer_t *buffer); 188 hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
189 unsigned int *length);
159 190
160 191
161 HB_END_DECLS 192 HB_END_DECLS
162 193
163 #endif /* HB_BUFFER_H */ 194 #endif /* HB_BUFFER_H */
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-blob-private.h ('k') | third_party/harfbuzz-ng/src/hb-buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698