[docs] Add gtkdoc comments to hb-buffer

This commit is contained in:
Nathan Willis 2019-04-21 20:31:54 +01:00 committed by Khaled Hosny
parent d13b7eaaf1
commit e8de26e1ef
2 changed files with 139 additions and 113 deletions

View File

@ -37,8 +37,9 @@
* @short_description: Input and output buffers
* @include: hb.h
*
* Buffers serve dual role in HarfBuzz; they hold the input characters that are
* passed to hb_shape(), and after shaping they hold the output glyphs.
* Buffers serve a dual role in HarfBuzz; before shaping, they hold
* the input characters that are passed to hb_shape(), and after
* shaping they hold the output glyphs.
**/
@ -705,9 +706,9 @@ hb_buffer_create ()
/**
* hb_buffer_get_empty:
*
* Fetches an empty #hb_buffer_t.
*
*
* Return value: (transfer full):
* Return value: (transfer full): The empty buffer
*
* Since: 0.9.2
**/
@ -719,7 +720,7 @@ hb_buffer_get_empty ()
/**
* hb_buffer_reference: (skip)
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Increases the reference count on @buffer by one. This prevents @buffer from
* being destroyed until a matching call to hb_buffer_destroy() is made.
@ -737,7 +738,7 @@ hb_buffer_reference (hb_buffer_t *buffer)
/**
* hb_buffer_destroy: (skip)
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Deallocate the @buffer.
* Decreases the reference count on @buffer by one. If the result is zero, then
@ -764,15 +765,15 @@ hb_buffer_destroy (hb_buffer_t *buffer)
/**
* hb_buffer_set_user_data: (skip)
* @buffer: an #hb_buffer_t.
* @key:
* @data:
* @destroy:
* @replace:
* @buffer: An #hb_buffer_t
* @key: The user-data key
* @data: A pointer to the user data
* @destroy: A callback to call when @data is not needed anymore
* @replace: Whether to replace an existing data with the same key
*
* Attaches a user-data key/data pair to the specified buffer.
*
*
* Return value:
* Return value: %true if success, false otherwise
*
* Since: 0.9.2
**/
@ -788,12 +789,13 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
/**
* hb_buffer_get_user_data: (skip)
* @buffer: an #hb_buffer_t.
* @key:
* @buffer: An #hb_buffer_t
* @key: The user-data key to query
*
* Fetches the user data associated with the specified key,
* attached to the specified buffer.
*
*
* Return value:
* Return value: A pointer to the user data
*
* Since: 0.9.2
**/
@ -807,11 +809,11 @@ hb_buffer_get_user_data (hb_buffer_t *buffer,
/**
* hb_buffer_set_content_type:
* @buffer: an #hb_buffer_t.
* @content_type: the type of buffer contents to set
* @buffer: An #hb_buffer_t
* @content_type: The type of buffer contents to set
*
* Sets the type of @buffer contents, buffers are either empty, contain
* characters (before shaping) or glyphs (the result of shaping).
* Sets the type of @buffer contents. Buffers are either empty, contain
* characters (before shaping), or contain glyphs (the result of shaping).
*
* Since: 0.9.5
**/
@ -824,12 +826,13 @@ hb_buffer_set_content_type (hb_buffer_t *buffer,
/**
* hb_buffer_get_content_type:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* see hb_buffer_set_content_type().
* Fetches the type of @buffer contents. Buffers are either empty, contain
* characters (before shaping), or contain glyphs (the result of shaping).
*
* Return value:
* The type of @buffer contents.
* The type of @buffer contents
*
* Since: 0.9.5
**/
@ -842,10 +845,11 @@ hb_buffer_get_content_type (hb_buffer_t *buffer)
/**
* hb_buffer_set_unicode_funcs:
* @buffer: an #hb_buffer_t.
* @unicode_funcs:
*
* @buffer: An #hb_buffer_t
* @unicode_funcs: The Unicode-functions structure
*
* Sets the Unicode-functions structure of a buffer to
* @unicode_funcs.
*
* Since: 0.9.2
**/
@ -866,11 +870,11 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer,
/**
* hb_buffer_get_unicode_funcs:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Fetches the Unicode-functions structure of a buffer.
*
*
* Return value:
* Return value: The Unicode-functions structure
*
* Since: 0.9.2
**/
@ -882,7 +886,7 @@ hb_buffer_get_unicode_funcs (hb_buffer_t *buffer)
/**
* hb_buffer_set_direction:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @direction: the #hb_direction_t of the @buffer
*
* Set the text flow direction of the buffer. No shaping can happen without
@ -908,7 +912,7 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
/**
* hb_buffer_get_direction:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_direction()
*
@ -925,8 +929,8 @@ hb_buffer_get_direction (hb_buffer_t *buffer)
/**
* hb_buffer_set_script:
* @buffer: an #hb_buffer_t.
* @script: an #hb_script_t to set.
* @buffer: An #hb_buffer_t
* @script: An #hb_script_t to set.
*
* Sets the script of @buffer to @script.
*
@ -952,12 +956,12 @@ hb_buffer_set_script (hb_buffer_t *buffer,
/**
* hb_buffer_get_script:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_script().
* Fetches the script of @buffer.
*
* Return value:
* The #hb_script_t of the @buffer.
* The #hb_script_t of the @buffer
*
* Since: 0.9.2
**/
@ -969,8 +973,8 @@ hb_buffer_get_script (hb_buffer_t *buffer)
/**
* hb_buffer_set_language:
* @buffer: an #hb_buffer_t.
* @language: an hb_language_t to set.
* @buffer: An #hb_buffer_t
* @language: An hb_language_t to set
*
* Sets the language of @buffer to @language.
*
@ -996,7 +1000,7 @@ hb_buffer_set_language (hb_buffer_t *buffer,
/**
* hb_buffer_get_language:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_language().
*
@ -1013,8 +1017,8 @@ hb_buffer_get_language (hb_buffer_t *buffer)
/**
* hb_buffer_set_segment_properties:
* @buffer: an #hb_buffer_t.
* @props: an #hb_segment_properties_t to use.
* @buffer: An #hb_buffer_t
* @props: An #hb_segment_properties_t to use
*
* Sets the segment properties of the buffer, a shortcut for calling
* hb_buffer_set_direction(), hb_buffer_set_script() and
@ -1034,8 +1038,8 @@ hb_buffer_set_segment_properties (hb_buffer_t *buffer,
/**
* hb_buffer_get_segment_properties:
* @buffer: an #hb_buffer_t.
* @props: (out): the output #hb_segment_properties_t.
* @buffer: An #hb_buffer_t
* @props: (out): The output #hb_segment_properties_t
*
* Sets @props to the #hb_segment_properties_t of @buffer.
*
@ -1051,8 +1055,8 @@ hb_buffer_get_segment_properties (hb_buffer_t *buffer,
/**
* hb_buffer_set_flags:
* @buffer: an #hb_buffer_t.
* @flags: the buffer flags to set.
* @buffer: An #hb_buffer_t
* @flags: The buffer flags to set
*
* Sets @buffer flags to @flags. See #hb_buffer_flags_t.
*
@ -1070,12 +1074,12 @@ hb_buffer_set_flags (hb_buffer_t *buffer,
/**
* hb_buffer_get_flags:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_flags().
* Fetches the #hb_buffer_flags_t for @buffer.
*
* Return value:
* The @buffer flags.
* The @buffer flags
*
* Since: 0.9.7
**/
@ -1087,10 +1091,12 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
/**
* hb_buffer_set_cluster_level:
* @buffer: an #hb_buffer_t.
* @cluster_level:
*
* @buffer: An #hb_buffer_t
* @cluster_level: The cluster level to set on the buffer
*
* Sets the cluster level of a buffer. The #hb_buffer_cluster_level_t
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
* Since: 0.9.42
**/
@ -1106,11 +1112,13 @@ hb_buffer_set_cluster_level (hb_buffer_t *buffer,
/**
* hb_buffer_get_cluster_level:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Fetches the cluster level of a buffer. The #hb_buffer_cluster_level_t
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
*
* Return value:
* Return value: The cluster level of @buffer
*
* Since: 0.9.42
**/
@ -1123,7 +1131,7 @@ hb_buffer_get_cluster_level (hb_buffer_t *buffer)
/**
* hb_buffer_set_replacement_codepoint:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @replacement: the replacement #hb_codepoint_t
*
* Sets the #hb_codepoint_t that replaces invalid entries for a given encoding
@ -1145,12 +1153,13 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer,
/**
* hb_buffer_get_replacement_codepoint:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_replacement_codepoint().
* Fetches the #hb_codepoint_t that replaces invalid entries for a given encoding
* when adding text to @buffer.
*
* Return value:
* The @buffer replacement #hb_codepoint_t.
* The @buffer replacement #hb_codepoint_t
*
* Since: 0.9.31
**/
@ -1163,7 +1172,7 @@ hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer)
/**
* hb_buffer_set_invisible_glyph:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @invisible: the invisible #hb_codepoint_t
*
* Sets the #hb_codepoint_t that replaces invisible characters in
@ -1185,12 +1194,12 @@ hb_buffer_set_invisible_glyph (hb_buffer_t *buffer,
/**
* hb_buffer_get_invisible_glyph:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_invisible_glyph().
*
* Return value:
* The @buffer invisible #hb_codepoint_t.
* The @buffer invisible #hb_codepoint_t
*
* Since: 2.0.0
**/
@ -1203,7 +1212,7 @@ hb_buffer_get_invisible_glyph (hb_buffer_t *buffer)
/**
* hb_buffer_reset:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Resets the buffer to its initial status, as if it was just newly created
* with hb_buffer_create().
@ -1218,7 +1227,7 @@ hb_buffer_reset (hb_buffer_t *buffer)
/**
* hb_buffer_clear_contents:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Similar to hb_buffer_reset(), but does not clear the Unicode functions and
* the replacement code point.
@ -1233,13 +1242,13 @@ hb_buffer_clear_contents (hb_buffer_t *buffer)
/**
* hb_buffer_pre_allocate:
* @buffer: an #hb_buffer_t.
* @size: number of items to pre allocate.
* @buffer: An #hb_buffer_t
* @size: Number of items to pre allocate.
*
* Pre allocates memory for @buffer to fit at least @size number of items.
*
* Return value:
* %true if @buffer memory allocation succeeded, %false otherwise.
* %true if @buffer memory allocation succeeded, %false otherwise
*
* Since: 0.9.2
**/
@ -1251,7 +1260,7 @@ hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
/**
* hb_buffer_allocation_successful:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Check if allocating memory for the buffer succeeded.
*
@ -1268,9 +1277,9 @@ hb_buffer_allocation_successful (hb_buffer_t *buffer)
/**
* hb_buffer_add:
* @buffer: an #hb_buffer_t.
* @codepoint: a Unicode code point.
* @cluster: the cluster value of @codepoint.
* @buffer: An #hb_buffer_t
* @codepoint: A Unicode code point.
* @cluster: The cluster value of @codepoint.
*
* Appends a character with the Unicode value of @codepoint to @buffer, and
* gives it the initial cluster value of @cluster. Clusters can be any thing
@ -1294,8 +1303,8 @@ hb_buffer_add (hb_buffer_t *buffer,
/**
* hb_buffer_set_length:
* @buffer: an #hb_buffer_t.
* @length: the new length of @buffer.
* @buffer: An #hb_buffer_t
* @length: The new length of @buffer
*
* Similar to hb_buffer_pre_allocate(), but clears any new items added at the
* end.
@ -1336,7 +1345,7 @@ hb_buffer_set_length (hb_buffer_t *buffer,
/**
* hb_buffer_get_length:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Returns the number of items in the buffer.
*
@ -1354,8 +1363,8 @@ hb_buffer_get_length (hb_buffer_t *buffer)
/**
* hb_buffer_get_glyph_infos:
* @buffer: an #hb_buffer_t.
* @length: (out): output array length.
* @buffer: An #hb_buffer_t
* @length: (out): The output-array length.
*
* Returns @buffer glyph information array. Returned pointer
* is valid as long as @buffer contents are not modified.
@ -1378,8 +1387,8 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
/**
* hb_buffer_get_glyph_positions:
* @buffer: an #hb_buffer_t.
* @length: (out): output length.
* @buffer: An #hb_buffer_t
* @length: (out): The output length
*
* Returns @buffer glyph position array. Returned pointer
* is valid as long as @buffer contents are not modified.
@ -1424,12 +1433,12 @@ hb_buffer_has_positions (hb_buffer_t *buffer)
/**
* hb_glyph_info_get_glyph_flags:
* @info: a #hb_glyph_info_t.
* @info: a #hb_glyph_info_t
*
* Returns glyph flags encoded within a #hb_glyph_info_t.
*
* Return value:
* The #hb_glyph_flags_t encoded within @info.
* The #hb_glyph_flags_t encoded within @info
*
* Since: 1.5.0
**/
@ -1441,7 +1450,7 @@ hb_glyph_flags_t
/**
* hb_buffer_reverse:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reverses buffer contents.
*
@ -1455,11 +1464,11 @@ hb_buffer_reverse (hb_buffer_t *buffer)
/**
* hb_buffer_reverse_range:
* @buffer: an #hb_buffer_t.
* @start: start index.
* @end: end index.
* @buffer: An #hb_buffer_t
* @start: start index
* @end: end index
*
* Reverses buffer contents between start to end.
* Reverses buffer contents between @start and @end.
*
* Since: 0.9.41
**/
@ -1472,7 +1481,7 @@ hb_buffer_reverse_range (hb_buffer_t *buffer,
/**
* hb_buffer_reverse_clusters:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reverses buffer clusters. That is, the buffer contents are
* reversed, then each cluster (consecutive items having the
@ -1488,7 +1497,7 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
/**
* hb_buffer_guess_segment_properties:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Sets unset buffer segment properties based on buffer Unicode
* contents. If buffer is not empty, it must have content type
@ -1590,12 +1599,12 @@ hb_buffer_add_utf (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf8:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length) (element-type uint8_t): an array of UTF-8
* @buffer: An #hb_buffer_t
* @text: (array length=text_length) (element-type uint8_t): An array of UTF-8
* characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* @text_length: The length of the @text, or -1 if it is %NULL terminated.
* @item_offset: The offset of the first character to add to the @buffer.
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
*
* See hb_buffer_add_codepoints().
@ -1617,12 +1626,12 @@ hb_buffer_add_utf8 (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf16:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length): an array of UTF-16 characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* @buffer: An #hb_buffer_t
* @text: (array length=text_length): An array of UTF-16 characters to append
* @text_length: The length of the @text, or -1 if it is %NULL terminated
* @item_offset: The offset of the first character to add to the @buffer
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated)
*
* See hb_buffer_add_codepoints().
*
@ -1643,12 +1652,12 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer,
/**
* hb_buffer_add_utf32:
* @buffer: an #hb_buffer_t.
* @text: (array length=text_length): an array of UTF-32 characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* @buffer: An #hb_buffer_t
* @text: (array length=text_length): An array of UTF-32 characters to append
* @text_length: The length of the @text, or -1 if it is %NULL terminated
* @item_offset: The offset of the first character to add to the @buffer
* @item_length: The number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated)
*
* See hb_buffer_add_codepoints().
*
@ -1669,13 +1678,13 @@ hb_buffer_add_utf32 (hb_buffer_t *buffer,
/**
* hb_buffer_add_latin1:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @text: (array length=text_length) (element-type uint8_t): an array of UTF-8
* characters to append.
* @text_length: the length of the @text, or -1 if it is %NULL terminated.
* @item_offset: the offset of the first character to add to the @buffer.
* characters to append
* @text_length: the length of the @text, or -1 if it is %NULL terminated
* @item_offset: the offset of the first character to add to the @buffer
* @item_length: the number of characters to add to the @buffer, or -1 for the
* end of @text (assuming it is %NULL terminated).
* end of @text (assuming it is %NULL terminated)
*
* Similar to hb_buffer_add_codepoints(), but allows only access to first 256
* Unicode code points that can fit in 8-bit strings.
@ -1731,8 +1740,8 @@ hb_buffer_add_codepoints (hb_buffer_t *buffer,
/**
* hb_buffer_append:
* @buffer: an #hb_buffer_t.
* @source: source #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @source: source #hb_buffer_t
* @start: start index into source buffer to copy. Use 0 to copy from start of buffer.
* @end: end index into source buffer to copy. Use @HB_FEATURE_GLOBAL_END to copy to end of buffer.
*
@ -1838,7 +1847,7 @@ normalize_glyphs_cluster (hb_buffer_t *buffer,
/**
* hb_buffer_normalize_glyphs:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
*
* Reorders a glyph buffer to have canonical in-cluster glyph order / position.
* The resulting clusters should behave identical to pre-reordering clusters.
@ -1984,7 +1993,7 @@ hb_buffer_diff (hb_buffer_t *buffer,
#ifndef HB_NO_BUFFER_MESSAGE
/**
* hb_buffer_set_message_func:
* @buffer: an #hb_buffer_t.
* @buffer: An #hb_buffer_t
* @func: (closure user_data) (destroy destroy) (scope notified):
* @user_data:
* @destroy:

View File

@ -314,6 +314,23 @@ hb_buffer_get_flags (hb_buffer_t *buffer);
* @HB_BUFFER_CLUSTER_LEVEL_CHARACTERS: Don't group cluster values.
* @HB_BUFFER_CLUSTER_LEVEL_DEFAULT: Default cluster level,
* equal to @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES.
*
* Data type for holding HarfBuzz's clustering behavior options. The cluster level
* dictates one aspect of how HarfBuzz will treat non-base characters
* during shaping.
*
* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES, non-base
* characters are merged into the cluster of the base character that precedes them.
*
* In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS, non-base characters are initially
* assigned their own cluster values, which are not merged into preceding base
* clusters. This allows HarfBuzz to perform additional operations like reorder
* sequences of adjacent marks.
*
* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES is the default, because it maintains
* backward compatibility with older versions of HarfBuzz. New client programs that
* do not need to maintain such backward compatibility are recommended to use
* @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS instead of the default.
*
* Since: 0.9.42
*/