From: Behdad Esfahbod Date: Mon, 18 May 2009 22:22:44 +0000 (-0400) Subject: [HB] Rename LOOKUP_ARGS to APPLY_ARGS X-Git-Tag: submit/master/20120920.151126~7^2~1201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb0dfc830e09405492f494c85380e133ac5d0ea3;p=framework%2Fuifw%2Fharfbuzz.git [HB] Rename LOOKUP_ARGS to APPLY_ARGS --- diff --git a/src/hb-ot-layout-gpos-private.h b/src/hb-ot-layout-gpos-private.h index 834d360..bdf6ff4 100644 --- a/src/hb-ot-layout-gpos-private.h +++ b/src/hb-ot-layout-gpos-private.h @@ -211,7 +211,7 @@ struct SinglePosFormat1 { friend struct SinglePos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -234,7 +234,7 @@ struct SinglePosFormat2 { friend struct SinglePos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -258,10 +258,10 @@ struct SinglePos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); - case 2: return u.format2->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); + case 2: return u.format2->apply (APPLY_ARG); default:return false; } } @@ -297,7 +297,7 @@ struct PairPosFormat1 { friend struct PairPos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -324,7 +324,7 @@ struct PairPosFormat2 { friend struct PairPos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -364,10 +364,10 @@ struct PairPos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); - case 2: return u.format2->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); + case 2: return u.format2->apply (APPLY_ARG); default:return false; } } @@ -402,7 +402,7 @@ struct CursivePosFormat1 { friend struct CursivePos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -424,9 +424,9 @@ struct CursivePos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -466,7 +466,7 @@ struct MarkBasePosFormat1 { friend struct MarkBasePos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -492,9 +492,9 @@ struct MarkBasePos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -551,7 +551,7 @@ struct MarkLigPosFormat1 { friend struct MarkLigPos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -577,9 +577,9 @@ struct MarkLigPos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -618,7 +618,7 @@ struct MarkMarkPosFormat1 { friend struct MarkMarkPos; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { /* TODO */ return false; } @@ -644,9 +644,9 @@ struct MarkMarkPos { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -660,20 +660,20 @@ struct MarkMarkPos { ASSERT_SIZE (MarkMarkPos, 2); -static inline bool position_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index); +static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index); struct ContextPos : Context { - inline bool apply (LOOKUP_ARGS_DEF) const { - return Context::apply (LOOKUP_ARGS, position_lookup); + inline bool apply (APPLY_ARG_DEF) const { + return Context::apply (APPLY_ARG, position_lookup); } }; ASSERT_SIZE (ContextPos, 2); struct ChainContextPos : ChainContext { - inline bool apply (LOOKUP_ARGS_DEF) const { - return ChainContext::apply (LOOKUP_ARGS, position_lookup); + inline bool apply (APPLY_ARG_DEF) const { + return ChainContext::apply (APPLY_ARG, position_lookup); } }; ASSERT_SIZE (ChainContextPos, 2); @@ -686,7 +686,7 @@ struct ExtensionPosFormat1 { private: inline unsigned int get_type (void) const { return extensionLookupType; } inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; } - inline bool apply (LOOKUP_ARGS_DEF) const; + inline bool apply (APPLY_ARG_DEF) const; private: USHORT format; /* Format identifier. Set to 1. */ @@ -714,9 +714,9 @@ struct ExtensionPos { } } - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -751,18 +751,18 @@ struct PosLookupSubTable { friend struct PosLookup; - inline bool apply (LOOKUP_ARGS_DEF, unsigned int lookup_type) const { + inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const { switch (lookup_type) { - case GPOS_Single: return u.single->apply (LOOKUP_ARGS); - case GPOS_Pair: return u.pair->apply (LOOKUP_ARGS); - case GPOS_Cursive: return u.cursive->apply (LOOKUP_ARGS); - case GPOS_MarkBase: return u.markBase->apply (LOOKUP_ARGS); - case GPOS_MarkLig: return u.markLig->apply (LOOKUP_ARGS); - case GPOS_MarkMark: return u.markMark->apply (LOOKUP_ARGS); - case GPOS_Context: return u.context->apply (LOOKUP_ARGS); - case GPOS_ChainContext: return u.chainContext->apply (LOOKUP_ARGS); - case GPOS_Extension: return u.extension->apply (LOOKUP_ARGS); + case GPOS_Single: return u.single->apply (APPLY_ARG); + case GPOS_Pair: return u.pair->apply (APPLY_ARG); + case GPOS_Cursive: return u.cursive->apply (APPLY_ARG); + case GPOS_MarkBase: return u.markBase->apply (APPLY_ARG); + case GPOS_MarkLig: return u.markLig->apply (APPLY_ARG); + case GPOS_MarkMark: return u.markMark->apply (APPLY_ARG); + case GPOS_Context: return u.context->apply (APPLY_ARG); + case GPOS_ChainContext: return u.chainContext->apply (APPLY_ARG); + case GPOS_Extension: return u.extension->apply (APPLY_ARG); default:return false; } } @@ -817,7 +817,7 @@ struct PosLookup : Lookup { unsigned int lookup_flag = get_flag (); for (unsigned int i = 0; i < get_subtable_count (); i++) - if (get_subtable (i).apply (LOOKUP_ARGS, lookup_type)) + if (get_subtable (i).apply (APPLY_ARG, lookup_type)) return true; return false; @@ -896,16 +896,16 @@ ASSERT_SIZE (GPOS, 10); /* Out-of-class implementation for methods recursing */ -inline bool ExtensionPosFormat1::apply (LOOKUP_ARGS_DEF) const { +inline bool ExtensionPosFormat1::apply (APPLY_ARG_DEF) const { unsigned int lookup_type = get_type (); if (HB_UNLIKELY (lookup_type == GPOS_Extension)) return false; - return ((PosLookupSubTable&)*(((char *) this) + get_offset ())).apply (LOOKUP_ARGS, lookup_type); + return ((PosLookupSubTable&)*(((char *) this) + get_offset ())).apply (APPLY_ARG, lookup_type); } -static inline bool position_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index) { +static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index) { const GPOS &gpos = *(layout->gpos); const PosLookup &l = gpos.get_lookup (lookup_index); diff --git a/src/hb-ot-layout-gsub-private.h b/src/hb-ot-layout-gsub-private.h index bf2381e..3fcd344 100644 --- a/src/hb-ot-layout-gsub-private.h +++ b/src/hb-ot-layout-gsub-private.h @@ -111,7 +111,7 @@ struct SingleSubst { } } - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { hb_codepoint_t glyph_id = IN_CURGLYPH (); @@ -152,7 +152,7 @@ struct Sequence { _hb_ot_layout_set_glyph_property (layout, substitute[n], property); } - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { if (HB_UNLIKELY (!substitute.len)) return false; @@ -186,13 +186,13 @@ struct MultipleSubstFormat1 { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) return false; - return (this+sequence[index]).apply (LOOKUP_ARGS); + return (this+sequence[index]).apply (APPLY_ARG); } private: @@ -212,9 +212,9 @@ struct MultipleSubst { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -238,7 +238,7 @@ struct AlternateSubstFormat1 { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { hb_codepoint_t glyph_id = IN_CURGLYPH (); @@ -293,9 +293,9 @@ struct AlternateSubst { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -314,7 +314,7 @@ struct Ligature { friend struct LigatureSet; private: - inline bool apply (LOOKUP_ARGS_DEF, bool is_mark) const { + inline bool apply (APPLY_ARG_DEF, bool is_mark) const { unsigned int i, j; unsigned int count = component.len; @@ -393,12 +393,12 @@ struct LigatureSet { private: - inline bool apply (LOOKUP_ARGS_DEF, bool is_mark) const { + inline bool apply (APPLY_ARG_DEF, bool is_mark) const { unsigned int num_ligs = ligature.len; for (unsigned int i = 0; i < num_ligs; i++) { const Ligature &lig = this+ligature[i]; - if (lig.apply (LOOKUP_ARGS, is_mark)) + if (lig.apply (APPLY_ARG, is_mark)) return true; } @@ -418,7 +418,7 @@ struct LigatureSubstFormat1 { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { hb_codepoint_t glyph_id = IN_CURGLYPH (); @@ -430,7 +430,7 @@ struct LigatureSubstFormat1 { return false; const LigatureSet &lig_set = this+ligatureSet[index]; - return lig_set.apply (LOOKUP_ARGS, first_is_mark); + return lig_set.apply (APPLY_ARG, first_is_mark); } private: @@ -450,9 +450,9 @@ struct LigatureSubst { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -467,20 +467,20 @@ ASSERT_SIZE (LigatureSubst, 2); -static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index); +static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index); struct ContextSubst : Context { - inline bool apply (LOOKUP_ARGS_DEF) const { - return Context::apply (LOOKUP_ARGS, substitute_lookup); + inline bool apply (APPLY_ARG_DEF) const { + return Context::apply (APPLY_ARG, substitute_lookup); } }; ASSERT_SIZE (ContextSubst, 2); struct ChainContextSubst : ChainContext { - inline bool apply (LOOKUP_ARGS_DEF) const { - return ChainContext::apply (LOOKUP_ARGS, substitute_lookup); + inline bool apply (APPLY_ARG_DEF) const { + return ChainContext::apply (APPLY_ARG, substitute_lookup); } }; ASSERT_SIZE (ChainContextSubst, 2); @@ -493,7 +493,7 @@ struct ExtensionSubstFormat1 { private: inline unsigned int get_type (void) const { return extensionLookupType; } inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; } - inline bool apply (LOOKUP_ARGS_DEF) const; + inline bool apply (APPLY_ARG_DEF) const; private: USHORT format; /* Format identifier. Set to 1. */ @@ -521,9 +521,9 @@ struct ExtensionSubst { } } - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -542,7 +542,7 @@ struct ReverseChainSingleSubstFormat1 { friend struct ReverseChainSingleSubst; private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { if (HB_UNLIKELY (context_length != NO_CONTEXT)) return false; /* No chaining to this type */ @@ -556,10 +556,10 @@ struct ReverseChainSingleSubstFormat1 { const ArrayOf &substitute = * (const ArrayOf *) ((const char *) &lookahead + lookahead.get_size ()); - if (match_backtrack (LOOKUP_ARGS, + if (match_backtrack (APPLY_ARG, backtrack.len, (USHORT *) backtrack.array, match_coverage, (char *) this) && - match_lookahead (LOOKUP_ARGS, + match_lookahead (APPLY_ARG, lookahead.len, (USHORT *) lookahead.array, match_coverage, (char *) this, 1)) @@ -597,9 +597,9 @@ struct ReverseChainSingleSubst { private: - inline bool apply (LOOKUP_ARGS_DEF) const { + inline bool apply (APPLY_ARG_DEF) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS); + case 1: return u.format1->apply (APPLY_ARG); default:return false; } } @@ -633,17 +633,17 @@ struct SubstLookupSubTable { friend struct SubstLookup; - inline bool apply (LOOKUP_ARGS_DEF, unsigned int lookup_type) const { + inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const { switch (lookup_type) { - case GSUB_Single: return u.single->apply (LOOKUP_ARGS); - case GSUB_Multiple: return u.multiple->apply (LOOKUP_ARGS); - case GSUB_Alternate: return u.alternate->apply (LOOKUP_ARGS); - case GSUB_Ligature: return u.ligature->apply (LOOKUP_ARGS); - case GSUB_Context: return u.context->apply (LOOKUP_ARGS); - case GSUB_ChainContext: return u.chainContext->apply (LOOKUP_ARGS); - case GSUB_Extension: return u.extension->apply (LOOKUP_ARGS); - case GSUB_ReverseChainSingle: return u.reverseChainContextSingle->apply (LOOKUP_ARGS); + case GSUB_Single: return u.single->apply (APPLY_ARG); + case GSUB_Multiple: return u.multiple->apply (APPLY_ARG); + case GSUB_Alternate: return u.alternate->apply (APPLY_ARG); + case GSUB_Ligature: return u.ligature->apply (APPLY_ARG); + case GSUB_Context: return u.context->apply (APPLY_ARG); + case GSUB_ChainContext: return u.chainContext->apply (APPLY_ARG); + case GSUB_Extension: return u.extension->apply (APPLY_ARG); + case GSUB_ReverseChainSingle: return u.reverseChainContextSingle->apply (APPLY_ARG); default:return false; } } @@ -704,7 +704,7 @@ struct SubstLookup : Lookup { unsigned int lookup_flag = get_flag (); for (unsigned int i = 0; i < get_subtable_count (); i++) - if (get_subtable (i).apply (LOOKUP_ARGS, lookup_type)) + if (get_subtable (i).apply (APPLY_ARG, lookup_type)) return true; return false; @@ -795,16 +795,16 @@ ASSERT_SIZE (GSUB, 10); /* Out-of-class implementation for methods recursing */ -inline bool ExtensionSubstFormat1::apply (LOOKUP_ARGS_DEF) const { +inline bool ExtensionSubstFormat1::apply (APPLY_ARG_DEF) const { unsigned int lookup_type = get_type (); if (HB_UNLIKELY (lookup_type == GSUB_Extension)) return false; - return ((SubstLookupSubTable&)*(((char *) this) + get_offset ())).apply (LOOKUP_ARGS, lookup_type); + return ((SubstLookupSubTable&)*(((char *) this) + get_offset ())).apply (APPLY_ARG, lookup_type); } -static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index) { +static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index) { const GSUB &gsub = *(layout->gsub); const SubstLookup &l = gsub.get_lookup (lookup_index); diff --git a/src/hb-ot-layout-gsubgpos-private.h b/src/hb-ot-layout-gsubgpos-private.h index 5e36a1f..fd0c551 100644 --- a/src/hb-ot-layout-gsubgpos-private.h +++ b/src/hb-ot-layout-gsubgpos-private.h @@ -31,14 +31,14 @@ #include "harfbuzz-buffer-private.h" /* XXX */ -#define LOOKUP_ARGS_DEF \ +#define APPLY_ARG_DEF \ hb_ot_layout_t *layout, \ hb_buffer_t *buffer, \ unsigned int context_length HB_GNUC_UNUSED, \ unsigned int nesting_level_left HB_GNUC_UNUSED, \ unsigned int lookup_flag, \ unsigned int property HB_GNUC_UNUSED /* propety of first glyph */ -#define LOOKUP_ARGS \ +#define APPLY_ARG \ layout, \ buffer, \ context_length, \ @@ -48,7 +48,7 @@ typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, char *data); -typedef bool (*apply_lookup_func_t) (LOOKUP_ARGS_DEF, unsigned int lookup_index); +typedef bool (*apply_lookup_func_t) (APPLY_ARG_DEF, unsigned int lookup_index); struct ContextFuncs { match_func_t match; @@ -71,7 +71,7 @@ static inline bool match_coverage (hb_codepoint_t glyph_id, const USHORT &value, } -static inline bool match_input (LOOKUP_ARGS_DEF, +static inline bool match_input (APPLY_ARG_DEF, unsigned int count, /* Including the first glyph (not matched) */ const USHORT input[], /* Array of input values--start with second glyph */ match_func_t match_func, @@ -99,7 +99,7 @@ static inline bool match_input (LOOKUP_ARGS_DEF, return true; } -static inline bool match_backtrack (LOOKUP_ARGS_DEF, +static inline bool match_backtrack (APPLY_ARG_DEF, unsigned int count, const USHORT backtrack[], match_func_t match_func, @@ -122,7 +122,7 @@ static inline bool match_backtrack (LOOKUP_ARGS_DEF, return true; } -static inline bool match_lookahead (LOOKUP_ARGS_DEF, +static inline bool match_lookahead (APPLY_ARG_DEF, unsigned int count, const USHORT lookahead[], match_func_t match_func, @@ -158,7 +158,7 @@ struct LookupRecord { }; ASSERT_SIZE (LookupRecord, 4); -static inline bool apply_lookup (LOOKUP_ARGS_DEF, +static inline bool apply_lookup (APPLY_ARG_DEF, unsigned int count, /* Including the first glyph */ unsigned int lookupCount, const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */ @@ -183,7 +183,7 @@ static inline bool apply_lookup (LOOKUP_ARGS_DEF, unsigned int old_pos = buffer->in_pos; /* Apply a lookup */ - bool done = apply_func (LOOKUP_ARGS, lookupRecord->lookupListIndex); + bool done = apply_func (APPLY_ARG, lookupRecord->lookupListIndex); lookupRecord++; lookupCount--; @@ -214,18 +214,18 @@ struct ContextLookupContext { char *match_data; }; -static inline bool context_lookup (LOOKUP_ARGS_DEF, +static inline bool context_lookup (APPLY_ARG_DEF, unsigned int inputCount, /* Including the first glyph (not matched) */ const USHORT input[], /* Array of input values--start with second glyph */ unsigned int lookupCount, const LookupRecord lookupRecord[], ContextLookupContext &context) { - return match_input (LOOKUP_ARGS, + return match_input (APPLY_ARG, inputCount, input, context.funcs.match, context.match_data, &context_length) && - apply_lookup (LOOKUP_ARGS, + apply_lookup (APPLY_ARG, inputCount, lookupCount, lookupRecord, context.funcs.apply); @@ -236,11 +236,11 @@ struct Rule { friend struct RuleSet; private: - inline bool apply (LOOKUP_ARGS_DEF, ContextLookupContext &context) const { + inline bool apply (APPLY_ARG_DEF, ContextLookupContext &context) const { const LookupRecord *lookupRecord = (const LookupRecord *) ((const char *) input + sizeof (input[0]) * (inputCount ? inputCount - 1 : 0)); - return context_lookup (LOOKUP_ARGS, + return context_lookup (APPLY_ARG, inputCount, input, lookupCount, lookupRecord, context); @@ -260,11 +260,11 @@ ASSERT_SIZE (Rule, 4); struct RuleSet { - inline bool apply (LOOKUP_ARGS_DEF, ContextLookupContext &context) const { + inline bool apply (APPLY_ARG_DEF, ContextLookupContext &context) const { unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) { - if ((this+rule[i]).apply (LOOKUP_ARGS, context)) + if ((this+rule[i]).apply (APPLY_ARG, context)) return true; } @@ -283,7 +283,7 @@ struct ContextFormat1 { friend struct Context; private: - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -294,7 +294,7 @@ struct ContextFormat1 { {match_glyph, apply_func}, NULL }; - return rule_set.apply (LOOKUP_ARGS, context); + return rule_set.apply (APPLY_ARG, context); } private: @@ -314,7 +314,7 @@ struct ContextFormat2 { friend struct Context; private: - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -330,7 +330,7 @@ struct ContextFormat2 { {match_class, apply_func}, (char *) &class_def }; - return rule_set.apply (LOOKUP_ARGS, context); + return rule_set.apply (APPLY_ARG, context); } private: @@ -353,7 +353,7 @@ struct ContextFormat3 { friend struct Context; private: - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { unsigned int index = (this+coverage[0]) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -366,7 +366,7 @@ struct ContextFormat3 { {match_coverage, apply_func}, (char *) this }; - return context_lookup (LOOKUP_ARGS, + return context_lookup (APPLY_ARG, glyphCount, (const USHORT *) (coverage + 1), lookupCount, lookupRecord, context); @@ -388,11 +388,11 @@ ASSERT_SIZE (ContextFormat3, 6); struct Context { protected: - bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS, apply_func); - case 2: return u.format2->apply (LOOKUP_ARGS, apply_func); - case 3: return u.format3->apply (LOOKUP_ARGS, apply_func); + case 1: return u.format1->apply (APPLY_ARG, apply_func); + case 2: return u.format2->apply (APPLY_ARG, apply_func); + case 3: return u.format3->apply (APPLY_ARG, apply_func); default:return false; } } @@ -415,7 +415,7 @@ struct ChainContextLookupContext { char *match_data[3]; }; -static inline bool chain_context_lookup (LOOKUP_ARGS_DEF, +static inline bool chain_context_lookup (APPLY_ARG_DEF, unsigned int backtrackCount, const USHORT backtrack[], unsigned int inputCount, /* Including the first glyph (not matched) */ @@ -433,19 +433,19 @@ static inline bool chain_context_lookup (LOOKUP_ARGS_DEF, return false; unsigned int offset; - return match_backtrack (LOOKUP_ARGS, + return match_backtrack (APPLY_ARG, backtrackCount, backtrack, context.funcs.match, context.match_data[0]) && - match_input (LOOKUP_ARGS, + match_input (APPLY_ARG, inputCount, input, context.funcs.match, context.match_data[1], &offset) && - match_lookahead (LOOKUP_ARGS, + match_lookahead (APPLY_ARG, lookaheadCount, lookahead, context.funcs.match, context.match_data[2], offset) && (context_length = offset, true) && - apply_lookup (LOOKUP_ARGS, + apply_lookup (APPLY_ARG, inputCount, lookupCount, lookupRecord, context.funcs.apply); @@ -456,14 +456,14 @@ struct ChainRule { friend struct ChainRuleSet; private: - inline bool apply (LOOKUP_ARGS_DEF, ChainContextLookupContext &context) const { + inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &context) const { const HeadlessArrayOf &input = * (const HeadlessArrayOf *) ((const char *) &backtrack + backtrack.get_size ()); const ArrayOf &lookahead = * (const ArrayOf *) ((const char *) &input + input.get_size ()); const ArrayOf &lookup = * (const ArrayOf *) ((const char *) &lookahead + lookahead.get_size ()); - return chain_context_lookup (LOOKUP_ARGS, + return chain_context_lookup (APPLY_ARG, backtrack.len, backtrack.array, input.len, input.array + 1, lookahead.len, lookahead.array, @@ -492,11 +492,11 @@ ASSERT_SIZE (ChainRule, 8); struct ChainRuleSet { - inline bool apply (LOOKUP_ARGS_DEF, ChainContextLookupContext &context) const { + inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &context) const { unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) { - if ((this+rule[i]).apply (LOOKUP_ARGS, context)) + if ((this+rule[i]).apply (APPLY_ARG, context)) return true; } @@ -515,7 +515,7 @@ struct ChainContextFormat1 { friend struct ChainContext; private: - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -526,7 +526,7 @@ struct ChainContextFormat1 { {match_glyph, apply_func}, {NULL, NULL, NULL} }; - return rule_set.apply (LOOKUP_ARGS, context); + return rule_set.apply (APPLY_ARG, context); } private: USHORT format; /* Format identifier--format = 1 */ @@ -544,7 +544,7 @@ struct ChainContextFormat2 { friend struct ChainContext; private: - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { unsigned int index = (this+coverage) (IN_CURGLYPH ()); if (HB_LIKELY (index == NOT_COVERED)) @@ -565,7 +565,7 @@ struct ChainContextFormat2 { (char *) &input_class_def, (char *) &lookahead_class_def} }; - return rule_set.apply (LOOKUP_ARGS, context); + return rule_set.apply (APPLY_ARG, context); } private: @@ -597,10 +597,10 @@ struct ChainContextFormat3 { private: - inline bool apply_coverage (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply_coverage (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { } - inline bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { const OffsetArrayOf &input = * (const OffsetArrayOf *) ((const char *) &backtrack + backtrack.get_size ()); @@ -617,7 +617,7 @@ struct ChainContextFormat3 { {match_coverage, apply_func}, {(char *) this, (char *) this, (char *) this} }; - return chain_context_lookup (LOOKUP_ARGS, + return chain_context_lookup (APPLY_ARG, backtrack.len, (USHORT *) backtrack.array, input.len, (USHORT *) input.array, lookahead.len, (USHORT *) lookahead.array, @@ -649,11 +649,11 @@ ASSERT_SIZE (ChainContextFormat3, 10); struct ChainContext { protected: - bool apply (LOOKUP_ARGS_DEF, apply_lookup_func_t apply_func) const { + bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const { switch (u.format) { - case 1: return u.format1->apply (LOOKUP_ARGS, apply_func); - case 2: return u.format2->apply (LOOKUP_ARGS, apply_func); - case 3: return u.format3->apply (LOOKUP_ARGS, apply_func); + case 1: return u.format1->apply (APPLY_ARG, apply_func); + case 2: return u.format2->apply (APPLY_ARG, apply_func); + case 3: return u.format3->apply (APPLY_ARG, apply_func); default:return false; } }