diff options
author | Peng Wu <alexepico@gmail.com> | 2017-05-23 17:39:07 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2017-05-23 17:39:07 +0800 |
commit | 132a15bb1da8bc426cb4abf796814f4ec307bccd (patch) | |
tree | 32495417a489e60e090b68c3db220f63a9385d11 /src/zhuyin.h | |
parent | cfc44f039a0320a2f35d541eb4bfc39e72ad7c48 (diff) | |
download | libpinyin-132a15bb1da8bc426cb4abf796814f4ec307bccd.tar.gz libpinyin-132a15bb1da8bc426cb4abf796814f4ec307bccd.tar.xz libpinyin-132a15bb1da8bc426cb4abf796814f4ec307bccd.zip |
update libzhuyin API
Diffstat (limited to 'src/zhuyin.h')
-rw-r--r-- | src/zhuyin.h | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/src/zhuyin.h b/src/zhuyin.h index de6e100..50a3287 100644 --- a/src/zhuyin.h +++ b/src/zhuyin.h @@ -582,6 +582,7 @@ bool zhuyin_get_candidate_string(zhuyin_instance_t * instance, lookup_candidate_t * candidate, const gchar ** utf8_str); +#if 0 /** * zhuyin_get_n_zhuyin: * @instance: the zhuyin instance. @@ -593,6 +594,7 @@ bool zhuyin_get_candidate_string(zhuyin_instance_t * instance, */ bool zhuyin_get_n_zhuyin(zhuyin_instance_t * instance, guint * num); +#endif /** * zhuyin_get_zhuyin_key: @@ -652,18 +654,62 @@ bool zhuyin_get_zhuyin_key_rest_length(zhuyin_instance_t * instance, guint16 * length); /** - * zhuyin_get_zhuyin_key_rest_offset: + * zhuyin_get_zhuyin_offset: + * @instance: the zhuyin instance. + * @cursor: the user cursor. + * @offset: the lookup offset. + * @returns: whether the get operation is successful. + * + * Get the lookup offset from the user cursor. + * + */ +bool zhuyin_get_zhuyin_offset(zhuyin_instance_t * instance, + size_t cursor, + size_t * offset); + +/** + * zhuyin_get_left_zhuyin_offset: + * @instance: the zhuyin instance. + * @offset: the lookup offset. + * @left: the left offset. + * @returns: whether the get operation is successful. + * + * Get the left offset from the lookup offset. + * + */ +bool zhuyin_get_left_zhuyin_offset(zhuyin_instance_t * instance, + size_t offset, + size_t * left); + +/** + * zhuyin_get_right_zhuyin_offset: + * @instance: the zhuyin instance. + * @offset: the lookup offset. + * @right: the right offset. + * @returns: whether the get operation is successful. + * + * Get the right offset from the lookup offset. + * + */ +bool zhuyin_get_right_zhuyin_offset(zhuyin_instance_t * instance, + size_t offset, + size_t * right); + +/** + * zhuyin_get_character_offset: * @instance: the zhuyin instance. - * @cursor: the cursor. - * @offset: the offset in the zhuyin array. + * @phrase: the utf8 phrase. + * @offset: the lookup offset. + * @length: the character offset. * @returns: whether the get operation is successful. * - * Get the offset in the zhuyin key array. + * Get the character offset from the lookup offset. * */ -bool zhuyin_get_zhuyin_key_rest_offset(zhuyin_instance_t * instance, - guint16 cursor, - guint16 * offset); +bool zhuyin_get_character_offset(zhuyin_instance_t * instance, + const char * phrase, + size_t offset, + size_t * length); #if 0 /** |