From 6f20f72e9c58ba23db2e31afa5d331acfea3d77e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 17 May 2009 20:28:01 -0400 Subject: [PATCH] [HB] Split Layout-common tables into new files --- src/hb-ot-layout-common-private.h | 429 ++++++++++++++++++++++++++++ src/hb-ot-layout-gdef-private.h | 3 +- src/hb-ot-layout-gsub-private.h | 1 + src/hb-ot-layout-gsubgpos-private.h | 2 + src/hb-ot-layout-open-private.h | 408 -------------------------- 5 files changed, 434 insertions(+), 409 deletions(-) create mode 100644 src/hb-ot-layout-common-private.h diff --git a/src/hb-ot-layout-common-private.h b/src/hb-ot-layout-common-private.h new file mode 100644 index 000000000..54298a01b --- /dev/null +++ b/src/hb-ot-layout-common-private.h @@ -0,0 +1,429 @@ +/* + * Copyright (C) 2007,2008,2009 Red Hat, Inc. + * + * This is part of HarfBuzz, an OpenType Layout engine library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_H +#define HB_OT_LAYOUT_COMMON_PRIVATE_H + +#include "hb-ot-layout-open-private.h" + + +/* + * + * OpenType Layout Common Table Formats + * + */ + +/* + * Script, ScriptList, LangSys, Feature, FeatureList, Lookup, LookupList + */ + +template +struct Record { + Tag tag; /* 4-byte Tag identifier */ + OffsetTo + offset; /* Offset from beginning of object holding + * the Record */ +}; + +template +struct RecordListOf : ArrayOf > { + inline const Type& operator [] (unsigned int i) const { + if (HB_UNLIKELY (i >= this->len)) return Null(Type); + return this+this->array[i].offset; + } + inline const Tag& get_tag (unsigned int i) const { + if (HB_UNLIKELY (i >= this->len)) return Null(Tag); + return this->array[i].tag; + } +}; + + +struct Script; +typedef Record