From 6a9be5bd3524dc3eb1e88d1063bde2e4d8b57011 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Apr 2012 22:23:17 -0400 Subject: [PATCH] Rename hb_glyph_map_t to hb_set_t --- src/hb-ot-layout-common-private.hh | 16 ++++++++-------- src/hb-ot-layout-gsubgpos-private.hh | 12 ++++++------ src/hb-ot-layout-private.hh | 2 +- src/hb-ot-layout.cc | 2 +- src/hb-ot-layout.h | 4 ++-- src/hb-ot-map-private.hh | 2 +- src/hb-ot-map.cc | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index cec339b..d104a44 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -131,7 +131,7 @@ struct RangeRecord return c->check_struct (this); } - inline bool intersects (const hb_glyph_map_t *glyphs) const { + inline bool intersects (const hb_set_t *glyphs) const { return glyphs->intersects (start, end); } @@ -358,7 +358,7 @@ struct CoverageFormat1 return glyphArray.sanitize (c); } - inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const { + inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const { return glyphs->has (glyphArray[index]); } @@ -402,7 +402,7 @@ struct CoverageFormat2 return rangeRecord.sanitize (c); } - inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const { + inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const { unsigned int i; unsigned int count = rangeRecord.len; for (i = 0; i < count; i++) { @@ -476,7 +476,7 @@ struct Coverage } } - inline bool intersects (const hb_glyph_map_t *glyphs) const { + inline bool intersects (const hb_set_t *glyphs) const { /* TODO speed this up */ Coverage::Iter iter; for (iter.init (*this); iter.more (); iter.next ()) { @@ -486,7 +486,7 @@ struct Coverage return false; } - inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const { + inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const { switch (u.format) { case 1: return u.format1.intersects_coverage (glyphs, index); case 2: return u.format2.intersects_coverage (glyphs, index); @@ -574,7 +574,7 @@ struct ClassDefFormat1 && classValue.sanitize (c); } - inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const { + inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const { unsigned int count = classValue.len; for (unsigned int i = 0; i < count; i++) if (classValue[i] == klass && glyphs->has (startGlyph + i)) @@ -608,7 +608,7 @@ struct ClassDefFormat2 return rangeRecord.sanitize (c); } - inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const { + inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const { unsigned int count = rangeRecord.len; for (unsigned int i = 0; i < count; i++) if (rangeRecord[i].value == klass && rangeRecord[i].intersects (glyphs)) @@ -647,7 +647,7 @@ struct ClassDef } } - inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const { + inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const { switch (u.format) { case 1: return u.format1.intersects_class (glyphs, klass); case 2: return u.format2.intersects_class (glyphs, klass); diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 10cfd34..aa3b268 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -58,13 +58,13 @@ static inline uint8_t allocate_lig_id (hb_buffer_t *buffer) { struct hb_closure_context_t { hb_face_t *face; - hb_glyph_map_t *glyphs; + hb_set_t *glyphs; unsigned int nesting_level_left; unsigned int debug_depth; hb_closure_context_t (hb_face_t *face_, - hb_glyph_map_t *glyphs_, + hb_set_t *glyphs_, unsigned int nesting_level_left_ = MAX_NESTING_LEVEL) : face (face_), glyphs (glyphs_), nesting_level_left (nesting_level_left_), @@ -227,7 +227,7 @@ struct hb_apply_context_t -typedef bool (*intersects_func_t) (hb_glyph_map_t *glyphs, const USHORT &value, const void *data); +typedef bool (*intersects_func_t) (hb_set_t *glyphs, const USHORT &value, const void *data); typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const void *data); typedef bool (*closure_lookup_func_t) (hb_closure_context_t *c, unsigned int lookup_index); typedef bool (*apply_lookup_func_t) (hb_apply_context_t *c, unsigned int lookup_index); @@ -243,16 +243,16 @@ struct ContextApplyFuncs apply_lookup_func_t apply; }; -static inline bool intersects_glyph (hb_glyph_map_t *glyphs, const USHORT &value, const void *data HB_UNUSED) +static inline bool intersects_glyph (hb_set_t *glyphs, const USHORT &value, const void *data HB_UNUSED) { return glyphs->has (value); } -static inline bool intersects_class (hb_glyph_map_t *glyphs, const USHORT &value, const void *data) +static inline bool intersects_class (hb_set_t *glyphs, const USHORT &value, const void *data) { const ClassDef &class_def = *reinterpret_cast(data); return class_def.intersects_class (glyphs, value); } -static inline bool intersects_coverage (hb_glyph_map_t *glyphs, const USHORT &value, const void *data) +static inline bool intersects_coverage (hb_set_t *glyphs, const USHORT &value, const void *data) { const OffsetTo &coverage = (const OffsetTo&)value; return (data+coverage).intersects (glyphs); diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 92f3c26..32da46d 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -95,7 +95,7 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout); -struct _hb_glyph_map_t +struct _hb_set_t { void clear (void) { memset (elts, 0, sizeof elts); diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 4441a7e..95ed9c6 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -472,7 +472,7 @@ hb_ot_layout_substitute_finish (hb_buffer_t *buffer HB_UNUSED) hb_bool_t hb_ot_layout_substitute_closure_lookup (hb_face_t *face, - hb_glyph_map_t *glyphs, + hb_set_t *glyphs, unsigned int lookup_index) { hb_closure_context_t c (face, glyphs); diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index a9db04f..1c1e7d9 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -183,11 +183,11 @@ void hb_ot_layout_substitute_finish (hb_buffer_t *buffer); -typedef struct _hb_glyph_map_t hb_glyph_map_t; +typedef struct _hb_set_t hb_set_t; hb_bool_t hb_ot_layout_substitute_closure_lookup (hb_face_t *face, - hb_glyph_map_t *glyphs, + hb_set_t *glyphs, unsigned int lookup_index); /* diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 5675d37..d5fc4ce 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -126,7 +126,7 @@ struct hb_ot_map_t hb_buffer_t *buffer) const; HB_INTERNAL void substitute_closure (hb_face_t *face, - hb_glyph_map_t *glyphs) const; + hb_set_t *glyphs) const; hb_mask_t global_mask; diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index a0efe90..bebf3ed 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -96,7 +96,7 @@ void hb_ot_map_t::apply (unsigned int table_index, } void hb_ot_map_t::substitute_closure (hb_face_t *face, - hb_glyph_map_t *glyphs) const + hb_set_t *glyphs) const { unsigned int table_index = 0; unsigned int i = 0; -- 2.7.4