Add buffer->swap()
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 13 May 2010 03:34:52 +0000 (23:34 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 13 May 2010 03:34:52 +0000 (23:34 -0400)
src/hb-buffer-private.hh
src/hb-ot-layout-gsub-private.hh

index c8859c8..b5e4550 100644 (file)
@@ -62,37 +62,6 @@ ASSERT_STATIC (sizeof (hb_glyph_position_t) == sizeof (hb_internal_glyph_positio
 ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t));
 
 
-struct _hb_buffer_t {
-  hb_reference_count_t ref_count;
-
-  /* Information about how the text in the buffer should be treated */
-  hb_unicode_funcs_t *unicode;
-  hb_direction_t      direction;
-  hb_script_t         script;
-  hb_language_t       language;
-
-  /* Buffer contents */
-
-  unsigned int allocated;
-
-  hb_bool_t    have_output; /* whether we have an output buffer going on */
-  hb_bool_t    have_positions; /* whether we have positions */
-  unsigned int in_length;
-  unsigned int out_length;
-  unsigned int in_pos;
-  unsigned int out_pos; /* out_length and out_pos are actually always the same */
-
-  hb_internal_glyph_info_t     *in_string;
-  hb_internal_glyph_info_t     *out_string;
-  hb_internal_glyph_position_t *positions;
-
-  /* Other stuff */
-
-  unsigned int         max_lig_id;
-
-  inline unsigned int allocate_lig_id (void) { return max_lig_id++; }
-};
-
 
 HB_INTERNAL void
 _hb_buffer_swap (hb_buffer_t *buffer);
@@ -130,6 +99,43 @@ _hb_buffer_replace_glyph (hb_buffer_t *buffer,
                          hb_codepoint_t glyph_index);
 
 
+
+struct _hb_buffer_t {
+  hb_reference_count_t ref_count;
+
+  /* Information about how the text in the buffer should be treated */
+  hb_unicode_funcs_t *unicode;
+  hb_direction_t      direction;
+  hb_script_t         script;
+  hb_language_t       language;
+
+  /* Buffer contents */
+
+  unsigned int allocated;
+
+  hb_bool_t    have_output; /* whether we have an output buffer going on */
+  hb_bool_t    have_positions; /* whether we have positions */
+  unsigned int in_length;
+  unsigned int out_length;
+  unsigned int in_pos;
+  unsigned int out_pos; /* out_length and out_pos are actually always the same */
+
+  hb_internal_glyph_info_t     *in_string;
+  hb_internal_glyph_info_t     *out_string;
+  hb_internal_glyph_position_t *positions;
+
+  /* Other stuff */
+
+  unsigned int         max_lig_id;
+
+
+  /* Methods */
+  inline unsigned int allocate_lig_id (void) { return max_lig_id++; }
+  inline void swap (void) { _hb_buffer_swap (this); }
+};
+
+
+
 #ifndef BUFFER
 #define BUFFER buffer
 #endif
index 38364a5..0101c4f 100644 (file)
@@ -844,7 +844,7 @@ struct SubstLookup : Lookup
 
        }
        if (ret)
-         _hb_buffer_swap (buffer);
+         buffer->swap ();
     }
     else
     {