harfbuzz-buffer-private.h 3.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* harfbuzz-buffer-private.h: Buffer of glyphs for substitution/positioning
 *
 * Copyright 2004,7 Red Hat Software
 *
 * Portions Copyright 1996-2000 by
 * David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 * This file is part of the FreeType project, and may only be used
 * modified and distributed under the terms of the FreeType project
 * license, LICENSE.TXT.  By continuing to use, modify, or distribute
 * this file you indicate that you have read the license and
 * understand and accept it fully.
 */
#ifndef HARFBUZZ_BUFFER_PRIVATE_H
#define HARFBUZZ_BUFFER_PRIVATE_H

#include "harfbuzz-impl.h"
#include "harfbuzz-buffer.h"

20
HB_BEGIN_HEADER
21 22 23 24 25 26 27 28 29 30 31 32 33 34

#define HB_GLYPH_PROPERTIES_UNKNOWN 0xFFFF

HB_INTERNAL void
_hb_buffer_swap( HB_Buffer buffer );

HB_INTERNAL void
_hb_buffer_clear_output( HB_Buffer buffer );

HB_INTERNAL HB_Error
_hb_buffer_clear_positions( HB_Buffer buffer );

HB_INTERNAL HB_Error
_hb_buffer_add_output_glyphs( HB_Buffer  buffer,
35 36 37 38 39
			      HB_UShort  num_in,
			      HB_UShort  num_out,
			      HB_UShort *glyph_data,
			      HB_UShort  component,
			      HB_UShort  ligID );
40 41 42

HB_INTERNAL HB_Error
_hb_buffer_add_output_glyph ( HB_Buffer buffer,
43 44 45
			      HB_UInt   glyph_index,
			      HB_UShort component,
			      HB_UShort ligID );
46 47 48 49 50 51

HB_INTERNAL HB_Error
_hb_buffer_copy_output_glyph ( HB_Buffer buffer );

HB_INTERNAL HB_Error
_hb_buffer_replace_output_glyph ( HB_Buffer buffer,
52 53
				  HB_UInt   glyph_index,
				  HB_Bool   inplace );
54

55
HB_INTERNAL HB_UShort
56 57
_hb_buffer_allocate_ligid( HB_Buffer buffer );

B
Behdad Esfahbod 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

/* convenience macros */

#define IN_GLYPH( pos )        (buffer->in_string[(pos)].gindex)
#define IN_ITEM( pos )         (&buffer->in_string[(pos)])
#define IN_CURGLYPH()          (buffer->in_string[buffer->in_pos].gindex)
#define IN_CURITEM()           (&buffer->in_string[buffer->in_pos])
#define IN_PROPERTIES( pos )   (buffer->in_string[(pos)].properties)
#define IN_LIGID( pos )        (buffer->in_string[(pos)].ligID)
#define IN_COMPONENT( pos )    (buffer->in_string[(pos)].component)
#define POSITION( pos )        (&buffer->positions[(pos)])
#define OUT_GLYPH( pos )       (buffer->out_string[(pos)].gindex)
#define OUT_ITEM( pos )        (&buffer->out_string[(pos)])

#define CHECK_Property( gdef, index, flags, property )					\
          ( ( error = _HB_GDEF_Check_Property( (gdef), (index), (flags),		\
                                      (property) ) ) != HB_Err_Ok )

#define ADD_String( buffer, num_in, num_out, glyph_data, component, ligID )             \
          ( ( error = _hb_buffer_add_output_glyphs( (buffer),                            \
						    (num_in), (num_out),                \
                                                    (glyph_data), (component), (ligID)  \
                                                  ) ) != HB_Err_Ok )
#define ADD_Glyph( buffer, glyph_index, component, ligID )				\
          ( ( error = _hb_buffer_add_output_glyph( (buffer),                             \
                                                    (glyph_index), (component), (ligID) \
                                                  ) ) != HB_Err_Ok )
#define REPLACE_Glyph( buffer, glyph_index, nesting_level )				\
          ( ( error = _hb_buffer_replace_output_glyph( (buffer), (glyph_index),		\
						      (nesting_level) == 1 ) ) != HB_Err_Ok )
#define COPY_Glyph( buffer )								\
	  ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )

91
HB_END_HEADER
92 93

#endif /* HARFBUZZ_BUFFER_PRIVATE_H */