From: Behdad Esfahbod Date: Sat, 8 Aug 2009 20:53:23 +0000 (-0400) Subject: [HB] Rename hb_ot_layout_feature_mask_t to hb_mask_t X-Git-Tag: submit/master/20120920.151126~7^2~1040 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=468769b8f5332940278244e744ec2bd5a5dc5ee9;p=framework%2Fuifw%2Fharfbuzz.git [HB] Rename hb_ot_layout_feature_mask_t to hb_mask_t --- diff --git a/src/TODO b/src/TODO index 2b22970..5797df7 100644 --- a/src/TODO +++ b/src/TODO @@ -1,6 +1,5 @@ - Test OpenType 1.6 mark filtering sets - HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH vs LookupType::... mess -- remove hb_ot_layout_feature_mask_t in favore of hb_mask_t or something - Rename LookupFlag::MarkAttachmentType to LookupFlag:IgnoreSpecialMarks - cmap14 support in get_glyph callback - size_t? diff --git a/src/hb-buffer-private.h b/src/hb-buffer-private.h index c8dd260..948309d 100644 --- a/src/hb-buffer-private.h +++ b/src/hb-buffer-private.h @@ -38,7 +38,7 @@ HB_BEGIN_DECLS typedef struct _hb_internal_glyph_info_t { hb_codepoint_t codepoint; - uint32_t properties; + hb_mask_t mask; uint32_t cluster; uint16_t component; uint16_t lig_id; @@ -122,7 +122,7 @@ _hb_buffer_allocate_lig_id (hb_buffer_t *buffer); #define IN_INFO(pos) (&buffer->in_string[(pos)]) #define IN_CURGLYPH() (buffer->in_string[buffer->in_pos].codepoint) #define IN_CURINFO() (&buffer->in_string[buffer->in_pos]) -#define IN_PROPERTIES(pos) (buffer->in_string[(pos)].properties) +#define IN_MASK(pos) (buffer->in_string[(pos)].mask) #define IN_LIGID(pos) (buffer->in_string[(pos)].lig_id) #define IN_COMPONENT(pos) (buffer->in_string[(pos)].component) #define POSITION(pos) (&buffer->positions[(pos)]) diff --git a/src/hb-buffer.c b/src/hb-buffer.c index 61f960d..fef3855 100644 --- a/src/hb-buffer.c +++ b/src/hb-buffer.c @@ -160,7 +160,7 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size) void hb_buffer_add_glyph (hb_buffer_t *buffer, hb_codepoint_t codepoint, - unsigned int properties, + hb_mask_t mask, unsigned int cluster) { hb_internal_glyph_info_t *glyph; @@ -169,7 +169,7 @@ hb_buffer_add_glyph (hb_buffer_t *buffer, glyph = &buffer->in_string[buffer->in_length]; glyph->codepoint = codepoint; - glyph->properties = properties; + glyph->mask = mask; glyph->cluster = cluster; glyph->component = 0; glyph->lig_id = 0; @@ -248,7 +248,7 @@ _hb_buffer_swap (hb_buffer_t *buffer) will copied `num_out' times, otherwise `lig_id' itself will be used to fill the `lig_id' fields. - The properties for all replacement glyphs are taken + The mask for all replacement glyphs are taken from the glyph at position `buffer->in_pos'. The cluster value for the glyph at position buffer->in_pos is used @@ -262,7 +262,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer, unsigned short lig_id) { unsigned int i; - unsigned int properties; + unsigned int mask; unsigned int cluster; if (buffer->out_string != buffer->in_string || @@ -271,7 +271,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer, hb_buffer_ensure_separate (buffer, buffer->out_pos + num_out); } - properties = buffer->in_string[buffer->in_pos].properties; + mask = buffer->in_string[buffer->in_pos].mask; cluster = buffer->in_string[buffer->in_pos].cluster; if (component == 0xFFFF) component = buffer->in_string[buffer->in_pos].component; @@ -282,7 +282,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer, { hb_internal_glyph_info_t *info = &buffer->out_string[buffer->out_pos + i]; info->codepoint = hb_be_uint16 (glyph_data_be[i]); - info->properties = properties; + info->mask = mask; info->cluster = cluster; info->component = component; info->lig_id = lig_id; diff --git a/src/hb-buffer.h b/src/hb-buffer.h index 069e6dd..57f56bd 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -43,7 +43,7 @@ typedef enum _hb_direction_t { typedef struct _hb_glyph_info_t { hb_codepoint_t codepoint; - uint32_t properties; + hb_mask_t mask; uint32_t cluster; uint16_t component; uint16_t lig_id; @@ -103,7 +103,7 @@ hb_buffer_ensure (hb_buffer_t *buffer, void hb_buffer_add_glyph (hb_buffer_t *buffer, hb_codepoint_t codepoint, - unsigned int properties, + hb_mask_t mask, unsigned int cluster); diff --git a/src/hb-common.h b/src/hb-common.h index de94fb2..11f64ed 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -50,6 +50,7 @@ typedef uint32_t hb_tag_t; typedef uint32_t hb_codepoint_t; typedef int32_t hb_position_t; typedef int32_t hb_16dot16_t; +typedef uint32_t hb_mask_t; typedef void (*hb_destroy_func_t) (void *user_data); diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 70dc791..157294e 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -1461,8 +1461,8 @@ struct PosLookup : Lookup } bool apply_string (hb_ot_layout_context_t *context, - hb_buffer_t *buffer, - hb_ot_layout_feature_mask_t mask) const + hb_buffer_t *buffer, + hb_mask_t mask) const { bool ret = false; @@ -1475,7 +1475,7 @@ struct PosLookup : Lookup while (buffer->in_pos < buffer->in_length) { bool done; - if (~IN_PROPERTIES (buffer->in_pos) & mask) + if (~IN_MASK (buffer->in_pos) & mask) { done = apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL); ret |= done; @@ -1522,9 +1522,9 @@ struct GPOS : GSUBGPOS { return (const PosLookup&) GSUBGPOS::get_lookup (i); } inline bool position_lookup (hb_ot_layout_context_t *context, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask) const + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask) const { return get_lookup (lookup_index).apply_string (context, buffer, mask); } bool sanitize (SANITIZE_ARG_DEF) { diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index a46006d..20431ae 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -774,8 +774,8 @@ struct SubstLookup : Lookup } bool apply_string (hb_ot_layout_context_t *context, - hb_buffer_t *buffer, - hb_ot_layout_feature_mask_t mask) const + hb_buffer_t *buffer, + hb_mask_t mask) const { bool ret = false; @@ -789,7 +789,7 @@ struct SubstLookup : Lookup buffer->in_pos = 0; while (buffer->in_pos < buffer->in_length) { - if ((~IN_PROPERTIES (buffer->in_pos) & mask) && + if ((~IN_MASK (buffer->in_pos) & mask) && apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL)) ret = true; else @@ -807,7 +807,7 @@ struct SubstLookup : Lookup buffer->in_pos = buffer->in_length - 1; do { - if ((~IN_PROPERTIES (buffer->in_pos) & mask) && + if ((~IN_MASK (buffer->in_pos) & mask) && apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL)) ret = true; else @@ -847,9 +847,9 @@ struct GSUB : GSUBGPOS { return (const SubstLookup&) GSUBGPOS::get_lookup (i); } inline bool substitute_lookup (hb_ot_layout_context_t *context, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask) const + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask) const { return get_lookup (lookup_index).apply_string (context, buffer, mask); } diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index b912a97..125cff7 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -534,10 +534,10 @@ hb_ot_layout_has_substitution (hb_face_t *face) } hb_bool_t -hb_ot_layout_substitute_lookup (hb_face_t *face, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask) +hb_ot_layout_substitute_lookup (hb_face_t *face, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask) { hb_ot_layout_context_t context; context.font = NULL; @@ -557,11 +557,11 @@ hb_ot_layout_has_positioning (hb_face_t *face) } hb_bool_t -hb_ot_layout_position_lookup (hb_face_t *face, - hb_font_t *font, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask) +hb_ot_layout_position_lookup (hb_face_t *face, + hb_font_t *font, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask) { hb_ot_layout_context_t context; context.font = font; diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index 04078d3..d9eb057 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -92,8 +92,6 @@ hb_ot_layout_get_lig_carets (hb_face_t *face, * GSUB/GPOS feature query and enumeration interface */ -typedef uint32_t hb_ot_layout_feature_mask_t; - #define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF) #define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF) #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF) @@ -184,12 +182,11 @@ hb_ot_layout_feature_get_lookup_indexes (hb_face_t *face, hb_bool_t hb_ot_layout_has_substitution (hb_face_t *face); -/* XXX ?? GSUB is not font-size dependent, so we apply on face */ hb_bool_t -hb_ot_layout_substitute_lookup (hb_face_t *face, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask); +hb_ot_layout_substitute_lookup (hb_face_t *face, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask); /* * GPOS @@ -199,25 +196,12 @@ hb_bool_t hb_ot_layout_has_positioning (hb_face_t *face); hb_bool_t -hb_ot_layout_position_lookup (hb_face_t *face, - hb_font_t *font, - hb_buffer_t *buffer, - unsigned int lookup_index, - hb_ot_layout_feature_mask_t mask); - - - - - - - - - - -/* -#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF) +hb_ot_layout_position_lookup (hb_face_t *face, + hb_font_t *font, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_mask_t mask); -*/ HB_END_DECLS