2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2007 Red Hat, Inc.
5 * This is part of HarfBuzz, an OpenType Layout engine library.
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 * Red Hat Author(s): Behdad Esfahbod
28 #ifndef HARFBUZZ_GLOBAL_H
29 #define HARFBUZZ_GLOBAL_H
34 #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
35 # define HB_BEGIN_VISIBILITY _Pragma ("GCC visibility push(hidden)")
36 # define HB_END_VISIBILITY _Pragma ("GCC visibility pop")
38 # define HB_BEGIN_VISIBILITY
39 # define HB_END_VISIBILITY
42 # define HB_BEGIN_HEADER extern "C" { HB_BEGIN_VISIBILITY
43 # define HB_END_HEADER HB_END_VISIBILITY }
45 # define HB_BEGIN_HEADER HB_BEGIN_VISIBILITY
46 # define HB_END_HEADER HB_END_VISIBILITY
59 #define HB_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
60 ( ( (HB_UInt)_x1 << 24 ) | \
61 ( (HB_UInt)_x2 << 16 ) | \
62 ( (HB_UInt)_x3 << 8 ) | \
66 typedef unsigned char hb_uint8;
67 typedef short hb_int16;
68 typedef unsigned short hb_uint16;
70 typedef unsigned int hb_uint32;
72 typedef hb_uint8 HB_Bool;
74 typedef hb_uint8 HB_Byte;
75 typedef hb_uint16 HB_UShort;
76 typedef hb_uint32 HB_UInt;
77 typedef hb_int8 HB_Char;
78 typedef hb_int16 HB_Short;
79 typedef hb_int32 HB_Int;
81 typedef hb_uint16 HB_UChar16;
82 typedef hb_uint32 HB_UChar32;
83 typedef hb_uint32 HB_Glyph;
84 typedef hb_int32 HB_Fixed; /* 26.6 */
86 #define HB_FIXED_CONSTANT(v) ((v) * 64)
87 #define HB_FIXED_ROUND(v) (((v)+32) & -64)
89 typedef hb_int32 HB_16Dot16; /* 16.16 */
91 typedef void * HB_Pointer;
92 typedef hb_uint32 HB_Tag;
97 HB_Err_Not_Covered = 0xFFFF,
99 /* _hb_err() is called whenever returning the following errors,
100 * and in a couple places for HB_Err_Not_Covered too. */
102 /* programmer error */
103 HB_Err_Invalid_Argument = 0x1A66,
106 HB_Err_Invalid_SubTable_Format = 0x157F,
107 HB_Err_Invalid_SubTable = 0x1570,
108 HB_Err_Read_Error = 0x6EAD,
111 HB_Err_Out_Of_Memory = 0xDEAD
119 typedef struct HB_Font_ *HB_Font;
120 typedef struct HB_StreamRec_ *HB_Stream;
121 typedef struct HB_FaceRec_ *HB_Face;