Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5f512017
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f512017
编写于
9月 04, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[docs] Document a few symbols
上级
e0dbf99b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
251 addition
and
4 deletion
+251
-4
src/hb-blob.cc
src/hb-blob.cc
+158
-2
src/hb-buffer.cc
src/hb-buffer.cc
+76
-2
src/hb-version.h.in
src/hb-version.h.in
+17
-0
未找到文件。
src/hb-blob.cc
浏览文件 @
5f512017
...
...
@@ -76,6 +76,22 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
}
}
/**
* hb_blob_create:
* @data: (array length=length) (allow-none): Pointer to blob data.
* @length: Length of @data in bytes.
* @mode: Memory mode for @data.
* @user_data: (allow-none): Data parameter to pass to @destroy.
* @destroy: (allow-none) (closure user_data): Callback to call when @data is not needed anymore.
*
* Creates a new "blob" object wrapping @data. The @mode parameter is used
* to negotiate ownership and lifecycle of @data.
*
* Returns: New blob, or the empty blob if something failed or if @length is
* zero. Destroy with hb_blob_destroy().
*
* Since: 1.0
**/
hb_blob_t
*
hb_blob_create
(
const
char
*
data
,
unsigned
int
length
,
...
...
@@ -109,6 +125,26 @@ hb_blob_create (const char *data,
return
blob
;
}
/**
* hb_blob_create_sub_blob:
* @parent: Parent blob.
* @offset: Start offset of sub-blob within @parent, in bytes.
* @length: Length of sub-blob.
*
* Returns a blob that represents a range of bytes in @parent. The new
* blob is always created with %HB_MEMORY_MODE_READONLY, meaning that it
* will never modify data in the parent blob. The parent data is not
* expected to be modified, and will result in undefined behavior if it
* is.
*
* Makes @parent immutable.
*
* Returns: New blob, or the empty blob if something failed or if @length is
* zero or @offset is beyond the end of @parent's data. Destroy with
* hb_blob_destroy().
*
* Since: 1.0
**/
hb_blob_t
*
hb_blob_create_sub_blob
(
hb_blob_t
*
parent
,
unsigned
int
offset
,
...
...
@@ -130,6 +166,17 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
return
blob
;
}
/**
* hb_blob_get_empty:
*
* Returns the singleton empty blob.
*
* See TODO:link object types for more information.
*
* Returns: The empty blob.
*
* Since: 1.0
**/
hb_blob_t
*
hb_blob_get_empty
(
void
)
{
...
...
@@ -149,12 +196,36 @@ hb_blob_get_empty (void)
return
const_cast
<
hb_blob_t
*>
(
&
_hb_blob_nil
);
}
/**
* hb_blob_reference:
* @blob: a blob.
*
* Increases the reference count on @blob.
*
* See TODO:link object types for more information.
*
* Returns: @blob.
*
* Since: 1.0
**/
hb_blob_t
*
hb_blob_reference
(
hb_blob_t
*
blob
)
{
return
hb_object_reference
(
blob
);
}
/**
* hb_blob_destroy:
* @blob: a blob.
*
* Descreases the reference count on @blob, and if it reaches zero, destroys
* @blob, freeing all memory, possibly calling the destroy-callback the blob
* was created for if it has not been called already.
*
* See TODO:link object types for more information.
*
* Since: 1.0
**/
void
hb_blob_destroy
(
hb_blob_t
*
blob
)
{
...
...
@@ -165,6 +236,22 @@ hb_blob_destroy (hb_blob_t *blob)
free
(
blob
);
}
/**
* hb_blob_set_user_data:
* @blob: a blob.
* @key: key for data to set.
* @data: data to set.
* @destroy: callback to call when @data is not needed anymore.
* @replace: whether to replace an existing data with the same key.
*
* Attaches a piece of data to the object.
*
* See TODO:link object types for more information.
*
* Returns: TODO
*
* Since: 1.0
**/
hb_bool_t
hb_blob_set_user_data
(
hb_blob_t
*
blob
,
hb_user_data_key_t
*
key
,
...
...
@@ -175,6 +262,19 @@ hb_blob_set_user_data (hb_blob_t *blob,
return
hb_object_set_user_data
(
blob
,
key
,
data
,
destroy
,
replace
);
}
/**
* hb_blob_get_user_data:
* @blob: a blob.
* @key: key for data to get.
*
* TODO
*
* See TODO:link object types for more information.
*
* Returns: (transfer none): data, or TODO
*
* Since: 1.0
**/
void
*
hb_blob_get_user_data
(
hb_blob_t
*
blob
,
hb_user_data_key_t
*
key
)
...
...
@@ -183,6 +283,16 @@ hb_blob_get_user_data (hb_blob_t *blob,
}
/**
* hb_blob_make_immutable:
* @blob: a blob.
*
* TODO
*
* See TODO:link object types for more information.
*
* Since: 1.0
**/
void
hb_blob_make_immutable
(
hb_blob_t
*
blob
)
{
...
...
@@ -192,6 +302,18 @@ hb_blob_make_immutable (hb_blob_t *blob)
blob
->
immutable
=
true
;
}
/**
* hb_blob_is_immutable:
* @blob: a blob.
*
* TODO
*
* See TODO:link object types for more information.
*
* Returns: TODO
*
* Since: 1.0
**/
hb_bool_t
hb_blob_is_immutable
(
hb_blob_t
*
blob
)
{
...
...
@@ -199,12 +321,33 @@ hb_blob_is_immutable (hb_blob_t *blob)
}
/**
* hb_blob_get_length:
* @blob: a blob.
*
* TODO
*
* Returns: the length of blob data in bytes.
*
* Since: 1.0
**/
unsigned
int
hb_blob_get_length
(
hb_blob_t
*
blob
)
{
return
blob
->
length
;
}
/**
* hb_blob_get_data:
* @blob: a blob.
* @length: (out) TODO
*
* TODO
*
* Returns: (transfer none): TODO
*
* Since: 1.0
**/
const
char
*
hb_blob_get_data
(
hb_blob_t
*
blob
,
unsigned
int
*
length
)
{
...
...
@@ -214,6 +357,21 @@ hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
return
blob
->
data
;
}
/**
* hb_blob_get_data_writable:
* @blob: a blob.
* @length: (out): output length of the writable data.
*
* Tries to make blob data writable (possibly copying it) and
* return pointer to data.
*
* Fails if blob has been made immutable, or if memory allocation
* fails.
*
* Returns: (transfer none): Writable blob data, or %NULL if failed.
*
* Since: 1.0
**/
char
*
hb_blob_get_data_writable
(
hb_blob_t
*
blob
,
unsigned
int
*
length
)
{
...
...
@@ -324,5 +482,3 @@ _try_writable (hb_blob_t *blob)
return
true
;
}
src/hb-buffer.cc
浏览文件 @
5f512017
...
...
@@ -853,13 +853,34 @@ hb_buffer_set_length (hb_buffer_t *buffer,
return
true
;
}
/**
* hb_buffer_get_length:
* @buffer: a buffer.
*
* Returns the number of items in the buffer.
*
* Return value: buffer length.
*
* Since: 1.0
*/
unsigned
int
hb_buffer_get_length
(
hb_buffer_t
*
buffer
)
{
return
buffer
->
len
;
}
/* Return value valid as long as buffer not modified */
/**
* hb_buffer_get_glyph_infos:
* @buffer: a buffer.
* @length: (out): output array length.
*
* Returns buffer glyph information array. Returned pointer
* is valid as long as buffer contents are not modified.
*
* Return value: (transfer none) (array length=length): buffer glyph information array.
*
* Since: 1.0
*/
hb_glyph_info_t
*
hb_buffer_get_glyph_infos
(
hb_buffer_t
*
buffer
,
unsigned
int
*
length
)
...
...
@@ -870,7 +891,18 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
return
(
hb_glyph_info_t
*
)
buffer
->
info
;
}
/* Return value valid as long as buffer not modified */
/**
* hb_buffer_get_glyph_positions:
* @buffer: a buffer.
* @length: (out): output length.
*
* Returns buffer glyph position array. Returned pointer
* is valid as long as buffer contents are not modified.
*
* Return value: (transfer none) (array length=length): buffer glyph position array.
*
* Since: 1.0
*/
hb_glyph_position_t
*
hb_buffer_get_glyph_positions
(
hb_buffer_t
*
buffer
,
unsigned
int
*
length
)
...
...
@@ -884,18 +916,60 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
return
(
hb_glyph_position_t
*
)
buffer
->
pos
;
}
/**
* hb_buffer_reverse:
* @buffer: a buffer.
*
* Reverses buffer contents.
*
* Since: 1.0
*/
void
hb_buffer_reverse
(
hb_buffer_t
*
buffer
)
{
buffer
->
reverse
();
}
/**
* hb_buffer_reverse_clusters:
* @buffer: a buffer.
*
* Reverses buffer clusters. That is, the buffer contents are
* reversed, then each cluster (consecutive items having the
* same cluster number) are reversed again.
*
* Since: 1.0
*/
void
hb_buffer_reverse_clusters
(
hb_buffer_t
*
buffer
)
{
buffer
->
reverse_clusters
();
}
/**
* hb_buffer_guess_segment_properties:
* @buffer: a buffer.
*
* Sets unset buffer segment properties based on buffer Unicode
* contents. If buffer is not empty, it must have content type
* %HB_BUFFER_CONTENT_TYPE_UNICODE.
*
* If buffer script is not set (ie. is %HB_SCRIPT_INVALID), it
* will be set to the Unicode script of the first character in
* the buffer that has a script other than %HB_SCRIPT_COMMON,
* %HB_SCRIPT_INHERITED, and %HB_SCRIPT_UNKNOWN.
*
* Next, if buffer direction is not set (ie. is %HB_DIRECTION_INVALID),
* it will be set to the natural horizontal direction of the
* buffer script as returned by hb_script_get_horizontal_direction().
*
* Finally, if buffer language is not set (ie. is %HB_LANGUAGE_INVALID),
* it will be set to the process's default language as returned by
* hb_language_get_default(). This may change in the future by
* taking buffer script into consideration when choosing a language.
*
* Since: 1.0
*/
void
hb_buffer_guess_segment_properties
(
hb_buffer_t
*
buffer
)
{
...
...
src/hb-version.h.in
浏览文件 @
5f512017
...
...
@@ -47,11 +47,28 @@ HB_BEGIN_DECLS
HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)
/**
* hb_version:
* @major: (out): Library major version component.
* @minor: (out): Library minor version component.
* @micro: (out): Library micro version component.
*
* Returns library version as three integer components.
*
* Since: 1.0
*/
void
hb_version (unsigned int *major,
unsigned int *minor,
unsigned int *micro);
/**
* hb_version_string:
*
* Returns library version as a string with three components.
*
* Since: 1.0
*/
const char *
hb_version_string (void);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录