summaryrefslogtreecommitdiff
path: root/src/hb-buffer.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-01 22:19:06 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-11-02 14:40:25 -0500
commit11fbb5487d9900a019440ef8235f35c9f525decb (patch)
tree94373d4120a034a0d6487b07730e0aa9b56b7b71 /src/hb-buffer.h
parent0cc7bc59ea6e8f38bf1e196c558cca9862ac3302 (diff)
[HB] Port buffert to new object API
Diffstat (limited to 'src/hb-buffer.h')
-rw-r--r--src/hb-buffer.h53
1 files changed, 33 insertions, 20 deletions
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index 1376ad4c..26879bf1 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -32,6 +32,8 @@
HB_BEGIN_DECLS
+typedef struct _hb_buffer_t hb_buffer_t;
+
typedef enum _hb_direction_t {
HB_DIRECTION_LTR,
HB_DIRECTION_RTL,
@@ -39,7 +41,7 @@ typedef enum _hb_direction_t {
HB_DIRECTION_BTT
} hb_direction_t;
-/* XXX Hide structs? */
+/* XXX these structs need review before we can commit to them */
typedef struct _hb_glyph_info_t {
hb_codepoint_t gindex;
@@ -67,45 +69,56 @@ typedef struct _hb_glyph_position_t {
} hb_glyph_position_t;
-typedef struct _hb_buffer_t {
- unsigned int allocated;
+hb_buffer_t *
+hb_buffer_create (unsigned int pre_alloc_size);
- unsigned int in_length;
- unsigned int out_length;
- unsigned int in_pos;
- unsigned int out_pos;
+hb_buffer_t *
+hb_buffer_reference (hb_buffer_t *buffer);
- hb_glyph_info_t *in_string;
- hb_glyph_info_t *out_string;
- hb_glyph_info_t *alt_string;
- hb_glyph_position_t *positions;
+unsigned int
+hb_buffer_get_reference_count (hb_buffer_t *buffer);
- hb_direction_t direction;
- unsigned int max_lig_id;
-} hb_buffer_t;
+void
+hb_buffer_destroy (hb_buffer_t *buffer);
-hb_buffer_t *
-hb_buffer_new (unsigned int allocation_size);
void
-hb_buffer_free (hb_buffer_t *buffer);
+hb_buffer_set_direction (hb_buffer_t *buffer,
+ hb_direction_t direction);
+
+hb_direction_t
+hb_buffer_get_direction (hb_buffer_t *buffer);
+
void
hb_buffer_clear (hb_buffer_t *buffer);
void
+hb_buffer_clear_positions (hb_buffer_t *buffer);
+
+void
hb_buffer_ensure (hb_buffer_t *buffer,
unsigned int size);
+
void
hb_buffer_add_glyph (hb_buffer_t *buffer,
hb_codepoint_t glyph_index,
unsigned int properties,
unsigned int cluster);
-void
-hb_buffer_set_direction (hb_buffer_t *buffer,
- hb_direction_t direction);
+
+/* Return value valid as long as buffer not modified */
+unsigned int
+hb_buffer_get_len (hb_buffer_t *buffer);
+
+/* Return value valid as long as buffer not modified */
+hb_glyph_info_t *
+hb_buffer_get_glyph_infos (hb_buffer_t *buffer);
+
+/* Return value valid as long as buffer not modified */
+hb_glyph_position_t *
+hb_buffer_get_glyph_positions (hb_buffer_t *buffer);
HB_END_DECLS