struct MarkArray
{
- inline bool apply (APPLY_ARG_DEF,
+ inline bool apply (hb_apply_context_t *context,
unsigned int mark_index, unsigned int glyph_index,
const AnchorMatrix &anchors, unsigned int class_count,
unsigned int glyph_pos) const
friend struct SinglePos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
friend struct SinglePos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
- case 2: return u.format2->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
+ case 2: return u.format2->apply (context);
default:return false;
}
}
friend struct PairPos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int end = MIN (context->buffer->in_length, context->buffer->in_pos + context->context_length);
friend struct PairPos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int end = MIN (context->buffer->in_length, context->buffer->in_pos + context->context_length);
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
- case 2: return u.format2->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
+ case 2: return u.format2->apply (context);
default:return false;
}
}
friend struct CursivePos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
/* Now comes the messiest part of the whole OpenType
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
friend struct MarkBasePos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
if (base_index == NOT_COVERED)
return false;
- return (this+markArray).apply (APPLY_ARG, mark_index, base_index, this+baseArray, classCount, j);
+ return (this+markArray).apply (context, mark_index, base_index, this+baseArray, classCount, j);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
friend struct MarkLigPos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int mark_index = (this+markCoverage) (IN_CURGLYPH ());
else
comp_index = comp_count - 1;
- return (this+markArray).apply (APPLY_ARG, mark_index, comp_index, lig_attach, classCount, j);
+ return (this+markArray).apply (context, mark_index, comp_index, lig_attach, classCount, j);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
friend struct MarkMarkPos;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
unsigned int mark1_index = (this+mark1Coverage) (IN_CURGLYPH ());
if (mark2_index == NOT_COVERED)
return false;
- return (this+mark1Array).apply (APPLY_ARG, mark1_index, mark2_index, this+mark2Array, classCount, j);
+ return (this+mark1Array).apply (context, mark1_index, mark2_index, this+mark2Array, classCount, j);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
};
-static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
+static inline bool position_lookup (hb_apply_context_t *context, unsigned int lookup_index);
struct ContextPos : Context
{
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return Context::apply (APPLY_ARG, position_lookup);
+ return Context::apply (context, position_lookup);
}
};
friend struct PosLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return ChainContext::apply (APPLY_ARG, position_lookup);
+ return ChainContext::apply (context, position_lookup);
}
};
return StructAtOffset<PosLookupSubTable> (*this, offset);
}
- inline bool apply (APPLY_ARG_DEF) const;
+ inline bool apply (hb_apply_context_t *context) const;
inline bool sanitize (hb_sanitize_context_t *context);
};
Extension = 9
};
- inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
+ inline bool apply (hb_apply_context_t *context, unsigned int lookup_type) const
{
TRACE_APPLY ();
switch (lookup_type) {
- case Single: return u.single->apply (APPLY_ARG);
- case Pair: return u.pair->apply (APPLY_ARG);
- case Cursive: return u.cursive->apply (APPLY_ARG);
- case MarkBase: return u.markBase->apply (APPLY_ARG);
- case MarkLig: return u.markLig->apply (APPLY_ARG);
- case MarkMark: return u.markMark->apply (APPLY_ARG);
- case Context: return u.context->apply (APPLY_ARG);
- case ChainContext: return u.chainContext->apply (APPLY_ARG);
- case Extension: return u.extension->apply (APPLY_ARG);
+ case Single: return u.single->apply (context);
+ case Pair: return u.pair->apply (context);
+ case Cursive: return u.cursive->apply (context);
+ case MarkBase: return u.markBase->apply (context);
+ case MarkLig: return u.markLig->apply (context);
+ case MarkMark: return u.markMark->apply (context);
+ case Context: return u.context->apply (context);
+ case ChainContext: return u.chainContext->apply (context);
+ case Extension: return u.extension->apply (context);
default:return false;
}
}
return false;
for (unsigned int i = 0; i < get_subtable_count (); i++)
- if (get_subtable (i).apply (APPLY_ARG, lookup_type))
+ if (get_subtable (i).apply (context, lookup_type))
return true;
return false;
/* Out-of-class implementation for methods recursing */
-inline bool ExtensionPos::apply (APPLY_ARG_DEF) const
+inline bool ExtensionPos::apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return get_subtable ().apply (APPLY_ARG, get_type ());
+ return get_subtable ().apply (context, get_type ());
}
inline bool ExtensionPos::sanitize (hb_sanitize_context_t *context)
return SANITIZE (StructAtOffset<PosLookupSubTable> (*this, offset));
}
-static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
+static inline bool position_lookup (hb_apply_context_t *context, unsigned int lookup_index)
{
const GPOS &gpos = *(context->layout->face->ot_layout.gpos);
const PosLookup &l = gpos.get_lookup (lookup_index);
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
- case 2: return u.format2->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
+ case 2: return u.format2->apply (context);
default:return false;
}
}
friend struct MultipleSubstFormat1;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
if (unlikely (!substitute.len))
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
if (likely (index == NOT_COVERED))
return false;
- return (this+sequence[index]).apply (APPLY_ARG);
+ return (this+sequence[index]).apply (context);
}
inline bool sanitize (hb_sanitize_context_t *context) {
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
friend struct LigatureSet;
private:
- inline bool apply (APPLY_ARG_DEF, bool is_mark) const
+ inline bool apply (hb_apply_context_t *context, bool is_mark) const
{
TRACE_APPLY ();
unsigned int i, j;
friend struct LigatureSubstFormat1;
private:
- inline bool apply (APPLY_ARG_DEF, bool is_mark) const
+ inline bool apply (hb_apply_context_t *context, bool is_mark) const
{
TRACE_APPLY ();
unsigned int num_ligs = ligature.len;
for (unsigned int i = 0; i < num_ligs; i++)
{
const Ligature &lig = this+ligature[i];
- if (lig.apply (APPLY_ARG, is_mark))
+ if (lig.apply (context, is_mark))
return true;
}
friend struct LigatureSubst;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
hb_codepoint_t glyph_id = IN_CURGLYPH ();
return false;
const LigatureSet &lig_set = this+ligatureSet[index];
- return lig_set.apply (APPLY_ARG, first_is_mark);
+ return lig_set.apply (context, first_is_mark);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct SubstLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
-static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
+static inline bool substitute_lookup (hb_apply_context_t *context, unsigned int lookup_index);
struct ContextSubst : Context
{
friend struct SubstLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return Context::apply (APPLY_ARG, substitute_lookup);
+ return Context::apply (context, substitute_lookup);
}
};
friend struct SubstLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return ChainContext::apply (APPLY_ARG, substitute_lookup);
+ return ChainContext::apply (context, substitute_lookup);
}
};
return StructAtOffset<SubstLookupSubTable> (*this, offset);
}
- inline bool apply (APPLY_ARG_DEF) const;
+ inline bool apply (hb_apply_context_t *context) const;
inline bool sanitize (hb_sanitize_context_t *context);
friend struct ReverseChainSingleSubst;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
if (unlikely (context->context_length != NO_CONTEXT))
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
- if (match_backtrack (APPLY_ARG,
+ if (match_backtrack (context,
backtrack.len, (USHORT *) backtrack.array(),
match_coverage, CharP(this)) &&
- match_lookahead (APPLY_ARG,
+ match_lookahead (context,
lookahead.len, (USHORT *) lookahead.array(),
match_coverage, CharP(this),
1))
friend struct SubstLookupSubTable;
private:
- inline bool apply (APPLY_ARG_DEF) const
+ inline bool apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
switch (u.format) {
- case 1: return u.format1->apply (APPLY_ARG);
+ case 1: return u.format1->apply (context);
default:return false;
}
}
ReverseChainSingle = 8
};
- inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
+ inline bool apply (hb_apply_context_t *context, unsigned int lookup_type) const
{
TRACE_APPLY ();
switch (lookup_type) {
- case Single: return u.single->apply (APPLY_ARG);
- case Multiple: return u.multiple->apply (APPLY_ARG);
- case Alternate: return u.alternate->apply (APPLY_ARG);
- case Ligature: return u.ligature->apply (APPLY_ARG);
- case Context: return u.context->apply (APPLY_ARG);
- case ChainContext: return u.chainContext->apply (APPLY_ARG);
- case Extension: return u.extension->apply (APPLY_ARG);
- case ReverseChainSingle: return u.reverseChainContextSingle->apply (APPLY_ARG);
+ case Single: return u.single->apply (context);
+ case Multiple: return u.multiple->apply (context);
+ case Alternate: return u.alternate->apply (context);
+ case Ligature: return u.ligature->apply (context);
+ case Context: return u.context->apply (context);
+ case ChainContext: return u.chainContext->apply (context);
+ case Extension: return u.extension->apply (context);
+ case ReverseChainSingle: return u.reverseChainContextSingle->apply (context);
default:return false;
}
}
unsigned int count = get_subtable_count ();
for (unsigned int i = 0; i < count; i++)
- if (get_subtable (i).apply (APPLY_ARG, lookup_type))
+ if (get_subtable (i).apply (context, lookup_type))
return true;
return false;
/* Out-of-class implementation for methods recursing */
-inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
+inline bool ExtensionSubst::apply (hb_apply_context_t *context) const
{
TRACE_APPLY ();
- return get_subtable ().apply (APPLY_ARG, get_type ());
+ return get_subtable ().apply (context, get_type ());
}
inline bool ExtensionSubst::sanitize (hb_sanitize_context_t *context)
return SubstLookup::lookup_type_is_reverse (type);
}
-static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
+static inline bool substitute_lookup (hb_apply_context_t *context, unsigned int lookup_index)
{
const GSUB &gsub = *(context->layout->face->ot_layout.gsub);
const SubstLookup &l = gsub.get_lookup (lookup_index);
trace.log ("APPLY", HB_FUNC, this);
-#define APPLY_ARG_DEF \
- hb_apply_context_t *context
-#define APPLY_ARG \
- context
-
struct hb_apply_context_t
{
hb_ot_layout_context_t *layout;
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const char *data);
-typedef bool (*apply_lookup_func_t) (APPLY_ARG_DEF, unsigned int lookup_index);
+typedef bool (*apply_lookup_func_t) (hb_apply_context_t *context, unsigned int lookup_index);
struct ContextFuncs
{
}
-static inline bool match_input (APPLY_ARG_DEF,
+static inline bool match_input (hb_apply_context_t *context,
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,
return true;
}
-static inline bool match_backtrack (APPLY_ARG_DEF,
+static inline bool match_backtrack (hb_apply_context_t *context,
unsigned int count,
const USHORT backtrack[],
match_func_t match_func,
return true;
}
-static inline bool match_lookahead (APPLY_ARG_DEF,
+static inline bool match_lookahead (hb_apply_context_t *context,
unsigned int count,
const USHORT lookahead[],
match_func_t match_func,
};
ASSERT_SIZE (LookupRecord, 4);
-static inline bool apply_lookup (APPLY_ARG_DEF,
+static inline bool apply_lookup (hb_apply_context_t *context,
unsigned int count, /* Including the first glyph */
unsigned int lookupCount,
const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
unsigned int old_pos = context->buffer->in_pos;
/* Apply a lookup */
- bool done = apply_func (APPLY_ARG, lookupRecord->lookupListIndex);
+ bool done = apply_func (context, lookupRecord->lookupListIndex);
lookupRecord++;
lookupCount--;
const char *match_data;
};
-static inline bool context_lookup (APPLY_ARG_DEF,
+static inline bool context_lookup (hb_apply_context_t *context,
unsigned int inputCount, /* Including the first glyph (not matched) */
const USHORT input[], /* Array of input values--start with second glyph */
unsigned int lookupCount,
ContextLookupContext &lookup_context)
{
unsigned int new_context_length;
- if (!match_input (APPLY_ARG,
+ if (!match_input (context,
inputCount, input,
lookup_context.funcs.match, lookup_context.match_data,
&new_context_length)) return false;
unsigned int old_context_length;
old_context_length = context->context_length;
context->context_length = new_context_length;
- bool ret = apply_lookup (APPLY_ARG,
+ bool ret = apply_lookup (context,
inputCount,
lookupCount, lookupRecord,
lookup_context.funcs.apply);
friend struct RuleSet;
private:
- inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const
+ inline bool apply (hb_apply_context_t *context, ContextLookupContext &lookup_context) const
{
TRACE_APPLY ();
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (input, input[0].get_size () * (inputCount ? inputCount - 1 : 0));
- return context_lookup (APPLY_ARG,
+ return context_lookup (context,
inputCount, input,
lookupCount, lookupRecord,
lookup_context);
struct RuleSet
{
- inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const
+ inline bool apply (hb_apply_context_t *context, ContextLookupContext &lookup_context) const
{
TRACE_APPLY ();
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
{
- if ((this+rule[i]).apply (APPLY_ARG, lookup_context))
+ if ((this+rule[i]).apply (context, lookup_context))
return true;
}
friend struct Context;
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
{match_glyph, apply_func},
NULL
};
- return rule_set.apply (APPLY_ARG, lookup_context);
+ return rule_set.apply (context, lookup_context);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct Context;
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
{match_class, apply_func},
CharP(&class_def)
};
- return rule_set.apply (APPLY_ARG, lookup_context);
+ return rule_set.apply (context, lookup_context);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct Context;
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage[0]) (IN_CURGLYPH ());
{match_coverage, apply_func},
CharP(this)
};
- return context_lookup (APPLY_ARG,
+ return context_lookup (context,
glyphCount, (const USHORT *) (coverage + 1),
lookupCount, lookupRecord,
lookup_context);
struct Context
{
protected:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
switch (u.format) {
- 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);
+ case 1: return u.format1->apply (context, apply_func);
+ case 2: return u.format2->apply (context, apply_func);
+ case 3: return u.format3->apply (context, apply_func);
default:return false;
}
}
const char *match_data[3];
};
-static inline bool chain_context_lookup (APPLY_ARG_DEF,
+static inline bool chain_context_lookup (hb_apply_context_t *context,
unsigned int backtrackCount,
const USHORT backtrack[],
unsigned int inputCount, /* Including the first glyph (not matched) */
return false;
unsigned int offset;
- if (!(match_backtrack (APPLY_ARG,
+ if (!(match_backtrack (context,
backtrackCount, backtrack,
lookup_context.funcs.match, lookup_context.match_data[0]) &&
- match_input (APPLY_ARG,
+ match_input (context,
inputCount, input,
lookup_context.funcs.match, lookup_context.match_data[1],
&offset) &&
- match_lookahead (APPLY_ARG,
+ match_lookahead (context,
lookaheadCount, lookahead,
lookup_context.funcs.match, lookup_context.match_data[2],
offset))) return false;
unsigned int old_context_length;
old_context_length = context->context_length;
context->context_length = offset;
- bool ret = apply_lookup (APPLY_ARG,
+ bool ret = apply_lookup (context,
inputCount,
lookupCount, lookupRecord,
lookup_context.funcs.apply);
friend struct ChainRuleSet;
private:
- inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const
+ inline bool apply (hb_apply_context_t *context, ChainContextLookupContext &lookup_context) const
{
TRACE_APPLY ();
const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
- return chain_context_lookup (APPLY_ARG,
+ return chain_context_lookup (context,
backtrack.len, backtrack.array(),
input.len, input.array(),
lookahead.len, lookahead.array(),
struct ChainRuleSet
{
- inline bool apply (APPLY_ARG_DEF, ChainContextLookupContext &lookup_context) const
+ inline bool apply (hb_apply_context_t *context, ChainContextLookupContext &lookup_context) const
{
TRACE_APPLY ();
unsigned int num_rules = rule.len;
for (unsigned int i = 0; i < num_rules; i++)
{
- if ((this+rule[i]).apply (APPLY_ARG, lookup_context))
+ if ((this+rule[i]).apply (context, lookup_context))
return true;
}
friend struct ChainContext;
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
{match_glyph, apply_func},
{NULL, NULL, NULL}
};
- return rule_set.apply (APPLY_ARG, lookup_context);
+ return rule_set.apply (context, lookup_context);
}
inline bool sanitize (hb_sanitize_context_t *context) {
friend struct ChainContext;
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
unsigned int index = (this+coverage) (IN_CURGLYPH ());
CharP(&input_class_def),
CharP(&lookahead_class_def)}
};
- return rule_set.apply (APPLY_ARG, lookup_context);
+ return rule_set.apply (context, lookup_context);
}
inline bool sanitize (hb_sanitize_context_t *context) {
private:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
{match_coverage, apply_func},
{CharP(this), CharP(this), CharP(this)}
};
- return chain_context_lookup (APPLY_ARG,
+ return chain_context_lookup (context,
backtrack.len, (const USHORT *) backtrack.array(),
input.len, (const USHORT *) input.array() + 1,
lookahead.len, (const USHORT *) lookahead.array(),
struct ChainContext
{
protected:
- inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
+ inline bool apply (hb_apply_context_t *context, apply_lookup_func_t apply_func) const
{
TRACE_APPLY ();
switch (u.format) {
- 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);
+ case 1: return u.format1->apply (context, apply_func);
+ case 2: return u.format2->apply (context, apply_func);
+ case 3: return u.format3->apply (context, apply_func);
default:return false;
}
}