15569331642446be05292e3e1f8a51218827168cdclaireho/*
25569331642446be05292e3e1f8a51218827168cdclaireho * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
35569331642446be05292e3e1f8a51218827168cdclaireho * Copyright (C) 2007  Red Hat, Inc.
45569331642446be05292e3e1f8a51218827168cdclaireho *
55569331642446be05292e3e1f8a51218827168cdclaireho * This is part of HarfBuzz, an OpenType Layout engine library.
65569331642446be05292e3e1f8a51218827168cdclaireho *
75569331642446be05292e3e1f8a51218827168cdclaireho * Permission is hereby granted, without written agreement and without
85569331642446be05292e3e1f8a51218827168cdclaireho * license or royalty fees, to use, copy, modify, and distribute this
95569331642446be05292e3e1f8a51218827168cdclaireho * software and its documentation for any purpose, provided that the
105569331642446be05292e3e1f8a51218827168cdclaireho * above copyright notice and the following two paragraphs appear in
115569331642446be05292e3e1f8a51218827168cdclaireho * all copies of this software.
125569331642446be05292e3e1f8a51218827168cdclaireho *
135569331642446be05292e3e1f8a51218827168cdclaireho * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
145569331642446be05292e3e1f8a51218827168cdclaireho * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
155569331642446be05292e3e1f8a51218827168cdclaireho * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
165569331642446be05292e3e1f8a51218827168cdclaireho * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
175569331642446be05292e3e1f8a51218827168cdclaireho * DAMAGE.
185569331642446be05292e3e1f8a51218827168cdclaireho *
195569331642446be05292e3e1f8a51218827168cdclaireho * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
205569331642446be05292e3e1f8a51218827168cdclaireho * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
215569331642446be05292e3e1f8a51218827168cdclaireho * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
225569331642446be05292e3e1f8a51218827168cdclaireho * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
235569331642446be05292e3e1f8a51218827168cdclaireho * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
245569331642446be05292e3e1f8a51218827168cdclaireho *
255569331642446be05292e3e1f8a51218827168cdclaireho * Red Hat Author(s): Behdad Esfahbod
265569331642446be05292e3e1f8a51218827168cdclaireho */
275569331642446be05292e3e1f8a51218827168cdclaireho
285569331642446be05292e3e1f8a51218827168cdclaireho#ifndef HARFBUZZ_GLOBAL_H
295569331642446be05292e3e1f8a51218827168cdclaireho#define HARFBUZZ_GLOBAL_H
305569331642446be05292e3e1f8a51218827168cdclaireho
315569331642446be05292e3e1f8a51218827168cdclaireho#include <stdlib.h>
325569331642446be05292e3e1f8a51218827168cdclaireho#include <string.h>
335569331642446be05292e3e1f8a51218827168cdclaireho
345569331642446be05292e3e1f8a51218827168cdclaireho#ifdef __cplusplus
355569331642446be05292e3e1f8a51218827168cdclaireho#define HB_BEGIN_HEADER  extern "C" {
365569331642446be05292e3e1f8a51218827168cdclaireho#define HB_END_HEADER  }
375569331642446be05292e3e1f8a51218827168cdclaireho#else
385569331642446be05292e3e1f8a51218827168cdclaireho#define HB_BEGIN_HEADER  /* nothing */
395569331642446be05292e3e1f8a51218827168cdclaireho#define HB_END_HEADER  /* nothing */
405569331642446be05292e3e1f8a51218827168cdclaireho#endif
415569331642446be05292e3e1f8a51218827168cdclaireho
4257e6107a9d66a9a97b146def0ef38c010f954be6claireho#if defined(__GNUC__) || defined(_MSC_VER)
4357e6107a9d66a9a97b146def0ef38c010f954be6claireho#define HB_USE_PACKED_STRUCTS
4457e6107a9d66a9a97b146def0ef38c010f954be6claireho#endif
4557e6107a9d66a9a97b146def0ef38c010f954be6claireho
465569331642446be05292e3e1f8a51218827168cdclairehoHB_BEGIN_HEADER
475569331642446be05292e3e1f8a51218827168cdclaireho
485569331642446be05292e3e1f8a51218827168cdclaireho#ifndef FALSE
495569331642446be05292e3e1f8a51218827168cdclaireho#define FALSE 0
505569331642446be05292e3e1f8a51218827168cdclaireho#endif
515569331642446be05292e3e1f8a51218827168cdclaireho
525569331642446be05292e3e1f8a51218827168cdclaireho#ifndef TRUE
535569331642446be05292e3e1f8a51218827168cdclaireho#define TRUE (!FALSE)
545569331642446be05292e3e1f8a51218827168cdclaireho#endif
555569331642446be05292e3e1f8a51218827168cdclaireho
565569331642446be05292e3e1f8a51218827168cdclaireho#define HB_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
575569331642446be05292e3e1f8a51218827168cdclaireho          ( ( (HB_UInt)_x1 << 24 ) |     \
585569331642446be05292e3e1f8a51218827168cdclaireho            ( (HB_UInt)_x2 << 16 ) |     \
595569331642446be05292e3e1f8a51218827168cdclaireho            ( (HB_UInt)_x3 <<  8 ) |     \
605569331642446be05292e3e1f8a51218827168cdclaireho              (HB_UInt)_x4         )
615569331642446be05292e3e1f8a51218827168cdclaireho
625569331642446be05292e3e1f8a51218827168cdclairehotypedef char hb_int8;
635569331642446be05292e3e1f8a51218827168cdclairehotypedef unsigned char hb_uint8;
645569331642446be05292e3e1f8a51218827168cdclairehotypedef short hb_int16;
655569331642446be05292e3e1f8a51218827168cdclairehotypedef unsigned short hb_uint16;
665569331642446be05292e3e1f8a51218827168cdclairehotypedef int hb_int32;
675569331642446be05292e3e1f8a51218827168cdclairehotypedef unsigned int hb_uint32;
685569331642446be05292e3e1f8a51218827168cdclaireho
695569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint8 HB_Bool;
705569331642446be05292e3e1f8a51218827168cdclaireho
715569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint8 HB_Byte;
725569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint16 HB_UShort;
735569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint32 HB_UInt;
745569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_int8 HB_Char;
755569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_int16 HB_Short;
765569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_int32 HB_Int;
775569331642446be05292e3e1f8a51218827168cdclaireho
785569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint16 HB_UChar16;
795569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint32 HB_UChar32;
805569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint32 HB_Glyph;
815569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_int32 HB_Fixed; /* 26.6 */
825569331642446be05292e3e1f8a51218827168cdclaireho
835569331642446be05292e3e1f8a51218827168cdclaireho#define HB_FIXED_CONSTANT(v) ((v) * 64)
845569331642446be05292e3e1f8a51218827168cdclaireho#define HB_FIXED_ROUND(v) (((v)+32) & -64)
855569331642446be05292e3e1f8a51218827168cdclaireho
865569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_int32 HB_16Dot16; /* 16.16 */
875569331642446be05292e3e1f8a51218827168cdclaireho
885569331642446be05292e3e1f8a51218827168cdclairehotypedef void * HB_Pointer;
895569331642446be05292e3e1f8a51218827168cdclairehotypedef hb_uint32 HB_Tag;
905569331642446be05292e3e1f8a51218827168cdclaireho
915569331642446be05292e3e1f8a51218827168cdclairehotypedef enum {
925569331642446be05292e3e1f8a51218827168cdclaireho  /* no error */
935569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Ok                           = 0x0000,
945569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Not_Covered                  = 0xFFFF,
955569331642446be05292e3e1f8a51218827168cdclaireho
965569331642446be05292e3e1f8a51218827168cdclaireho  /* _hb_err() is called whenever returning the following errors,
975569331642446be05292e3e1f8a51218827168cdclaireho   * and in a couple places for HB_Err_Not_Covered too. */
985569331642446be05292e3e1f8a51218827168cdclaireho
995569331642446be05292e3e1f8a51218827168cdclaireho  /* programmer error */
1005569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Invalid_Argument             = 0x1A66,
1015569331642446be05292e3e1f8a51218827168cdclaireho
1025569331642446be05292e3e1f8a51218827168cdclaireho  /* font error */
1035569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Invalid_SubTable_Format      = 0x157F,
1045569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Invalid_SubTable             = 0x1570,
1055569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Read_Error                   = 0x6EAD,
1065569331642446be05292e3e1f8a51218827168cdclaireho
1075569331642446be05292e3e1f8a51218827168cdclaireho  /* system error */
1085569331642446be05292e3e1f8a51218827168cdclaireho  HB_Err_Out_Of_Memory                = 0xDEAD
1095569331642446be05292e3e1f8a51218827168cdclaireho} HB_Error;
1105569331642446be05292e3e1f8a51218827168cdclaireho
1115569331642446be05292e3e1f8a51218827168cdclairehotypedef struct {
1125569331642446be05292e3e1f8a51218827168cdclaireho    HB_Fixed x;
1135569331642446be05292e3e1f8a51218827168cdclaireho    HB_Fixed y;
1145569331642446be05292e3e1f8a51218827168cdclaireho} HB_FixedPoint;
1155569331642446be05292e3e1f8a51218827168cdclaireho
1165569331642446be05292e3e1f8a51218827168cdclairehotypedef struct HB_Font_ *HB_Font;
1175569331642446be05292e3e1f8a51218827168cdclairehotypedef struct HB_StreamRec_ *HB_Stream;
1185569331642446be05292e3e1f8a51218827168cdclairehotypedef struct HB_FaceRec_ *HB_Face;
1195569331642446be05292e3e1f8a51218827168cdclaireho
1205569331642446be05292e3e1f8a51218827168cdclairehoHB_END_HEADER
1215569331642446be05292e3e1f8a51218827168cdclaireho
1225569331642446be05292e3e1f8a51218827168cdclaireho#endif
123