#ifndef HB_BUFFER_PRIVATE_H
#define HB_BUFFER_PRIVATE_H
-#include "harfbuzz-impl.h"
+#include "hb-private.h"
#include "hb-buffer.h"
-HB_BEGIN_HEADER
+HB_BEGIN_DECLS();
#define HB_GLYPH_PROPERTY_UNKNOWN 0xFFFF
HB_INTERNAL void
-_hb_buffer_swap( HB_Buffer buffer );
+_hb_buffer_swap (hb_buffer_t *buffer);
HB_INTERNAL void
-_hb_buffer_clear_output( HB_Buffer buffer );
+_hb_buffer_clear_output (hb_buffer_t *buffer);
HB_INTERNAL HB_Error
-_hb_buffer_clear_positions( HB_Buffer buffer );
+_hb_buffer_clear_positions (hb_buffer_t *buffer);
HB_INTERNAL HB_Error
-_hb_buffer_add_output_glyphs( HB_Buffer buffer,
- HB_UShort num_in,
- HB_UShort num_out,
- HB_UShort *glyph_data,
- HB_UShort component,
- HB_UShort ligID );
+_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
+ unsigned int num_in,
+ unsigned int num_out,
+ unsigned short *glyph_data,
+ unsigned short component,
+ unsigned short ligID);
HB_INTERNAL HB_Error
-_hb_buffer_add_output_glyph ( HB_Buffer buffer,
- HB_UInt glyph_index,
- HB_UShort component,
- HB_UShort ligID );
+_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index,
+ unsigned short component,
+ unsigned short ligID);
HB_INTERNAL HB_Error
-_hb_buffer_next_glyph ( HB_Buffer buffer );
+_hb_buffer_next_glyph (hb_buffer_t *buffer);
HB_INTERNAL HB_Error
-_hb_buffer_replace_glyph ( HB_Buffer buffer,
- HB_UInt glyph_index );
+_hb_buffer_replace_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index);
-HB_INTERNAL HB_UShort
-_hb_buffer_allocate_ligid( HB_Buffer buffer );
+HB_INTERNAL unsigned short
+_hb_buffer_allocate_ligid (hb_buffer_t *buffer);
/* 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 CURPOSITION() (&buffer->positions[buffer->in_pos])
-#define OUT_GLYPH( pos ) (buffer->out_string[(pos)].gindex)
-#define OUT_ITEM( pos ) (&buffer->out_string[(pos)])
-
-#define CHECK_Property( layout, index, flags, properties ) \
+#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 CURPOSITION() (&buffer->positions[buffer->in_pos])
+#define OUT_GLYPH(pos) (buffer->out_string[(pos)].gindex)
+#define OUT_ITEM(pos) (&buffer->out_string[(pos)])
+
+#define CHECK_Property (layout, index, flags, properties) \
({unsigned int _p; error = _hb_ot_layout_check_glyph_property((layout), (index), (flags), (&_p)) \
? HB_Err_Ok : HB_Err_Not_Covered, *(properties) = _p; error;})
-#define ADD_String( buffer, num_in, num_out, glyph_data, component, ligID ) \
- ( ( error = _hb_buffer_add_output_glyphs( (buffer), \
+#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), \
+ )) != 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 ) \
- ( ( error = _hb_buffer_replace_glyph( (buffer), (glyph_index) ) ) != HB_Err_Ok )
-#define COPY_Glyph( buffer ) \
- ( (error = _hb_buffer_next_glyph ( buffer ) ) != HB_Err_Ok )
+ )) != HB_Err_Ok)
+#define REPLACE_Glyph (buffer, glyph_index) \
+ ((error = _hb_buffer_replace_glyph ((buffer), (glyph_index))) != HB_Err_Ok)
+#define COPY_Glyph (buffer) \
+ ((error = _hb_buffer_next_glyph (buffer)) != HB_Err_Ok)
-HB_END_HEADER
+HB_END_DECLS();
#endif /* HB_BUFFER_PRIVATE_H */
* Red Hat Author(s): Owen Taylor, Behdad Esfahbod
*/
-#include "harfbuzz-impl.h"
#include "hb-buffer-private.h"
/* Here is how the buffer works internally:
hb_buffer_ensure (hb_buffer_t *buffer,
unsigned int size)
{
- HB_UInt new_allocated = buffer->allocated;
+ unsigned int new_allocated = buffer->allocated;
/* XXX err handling */
if (size > new_allocated)
}
void
-hb_buffer_add_glyph (HB_Buffer buffer,
- HB_UInt glyph_index,
- HB_UInt properties,
- HB_UInt cluster)
+hb_buffer_add_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index,
+ unsigned int properties,
+ unsigned int cluster)
{
HB_Error error;
HB_GlyphItem glyph;
The cluster value for the glyph at position buffer->in_pos is used
for all replacement glyphs */
HB_INTERNAL HB_Error
-_hb_buffer_add_output_glyphs (HB_Buffer buffer,
- HB_UShort num_in,
- HB_UShort num_out,
- HB_UShort *glyph_data,
- HB_UShort component,
- HB_UShort ligID)
+_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
+ unsigned int num_in,
+ unsigned int num_out,
+ unsigned short *glyph_data,
+ unsigned short component,
+ unsigned short ligID)
{
HB_Error error;
- HB_UShort i;
- HB_UInt properties;
- HB_UInt cluster;
+ unsigned int i;
+ unsigned int properties;
+ unsigned int cluster;
hb_buffer_ensure (buffer, buffer->out_pos + num_out);
}
HB_INTERNAL HB_Error
-_hb_buffer_add_output_glyph (HB_Buffer buffer,
- HB_UInt glyph_index,
- HB_UShort component,
- HB_UShort ligID)
+_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index,
+ unsigned short component,
+ unsigned short ligID)
{
- HB_UShort glyph_data = glyph_index;
+ unsigned short glyph_data = glyph_index;
return _hb_buffer_add_output_glyphs (buffer, 1, 1,
&glyph_data, component, ligID);
}
HB_INTERNAL HB_Error
-_hb_buffer_replace_glyph (HB_Buffer buffer,
- HB_UInt glyph_index)
+_hb_buffer_replace_glyph (hb_buffer_t *buffer,
+ hb_codepoint_t glyph_index)
{
if (!buffer->separate_out)
{
return HB_Err_Ok;
}
-HB_INTERNAL HB_UShort
-_hb_buffer_allocate_ligid (HB_Buffer buffer)
+HB_INTERNAL unsigned short
+_hb_buffer_allocate_ligid (hb_buffer_t *buffer)
{
return ++buffer->max_ligID;
}
#include "hb-ot-layout-gsubgpos-private.h"
-/* XXX */
-#include "harfbuzz-impl.h"
-
/* Shared Tables: ValueRecord, Anchor Table, and MarkArray */
struct hb_ot_layout_t::gpos_info_t *gpi = &layout->gpos_info;
hb_codepoint_t last_pos = gpi->last;
- gpi->last = 0xFFFF;
+ gpi->last = HB_OT_GPOS_NO_LAST;
/* We don't handle mark glyphs here. */
if (property == HB_OT_LAYOUT_GLYPH_CLASS_MARK)
hb_position_t entry_x, entry_y, exit_x, exit_y;
- if (last_pos == 0xFFFF || !record.entryAnchor)
+ if (last_pos == HB_OT_GPOS_NO_LAST || !record.entryAnchor)
goto end;
(this+record.entryAnchor).get_anchor (layout, IN_CURGLYPH (), &entry_x, &entry_y);
if (HB_UNLIKELY (!buffer->in_length))
return false;
- layout->gpos_info.last = 0xFFFF; /* no last valid glyph for cursive pos. */
+ layout->gpos_info.last = HB_OT_GPOS_NO_LAST; /* no last valid glyph for cursive pos. */
buffer->in_pos = 0;
while (buffer->in_pos < buffer->in_length)
done = false;
/* Contrary to properties defined in GDEF, user-defined properties
will always stop a possible cursive positioning. */
- layout->gpos_info.last = 0xFFFF;
+ layout->gpos_info.last = HB_OT_GPOS_NO_LAST;
}
if (!done)